# schems and algorithms

## Lattice Boltzmann Method-1

Kinetic Theory and micro-macro relations Pressure and Temperature are related to kinetic energy of particle as, Phase space and probability distribution function A coordinate system comprising position and velocity can be used to express the dynamics of a system. Such a system is called phase space. In general, the dynamics of a point in the …

## SIMPLE scheme (2/3): Openfoam implementation-SimpleFoam

A walk through SimpleFoam wiki page . This is my study note of simpleFoam wiki page with links that helped me understand. Before simple loop createFields.H The included file createFields.H creates volumeScalarField p and volVectorField U from the 0 directory. Then it includes createPhi.H which creates surfaceScalarField phi with value fvc::flux(U) : It calls the …

## gaussLaplacianScheme(3/3): Adding source terms – fvOptions

Here, we continue the modification of the solver myThermalConductionSolver using fvOptions. Please see the previous post Effect of adding source su =1, sp = 0 case If we keep su=1 in constant/tansportProperties, the source is modified from 9(-150 -80 -80 -70 0 0 -130 -60 -60) to 9(-150.01 -80.01 -80.01 -70.01 -0.01 -0.01 -130.01 -60.01 …

## gaussLaplacianScheme(1/3): Theory and implementation in OpenFOAM

How the discretisation of the laplacian term is done? explicit evaluations, orthogonal corrections … Notes made while reading through report by Jesper Roland. This report has detailed explanation on laplacianScheme abstract class, various macros like TypeName, New,… etc. Options for laplacian scheme A typical system/fvSchemes will read like below: Gauss is the only laplacian scheme …

## Source term linearisation and Under-relaxation

as I learned from the awesome book If properly handled, source term improves solution stability. Consider a discretised conservation equation for a general variable with source in element C written below: If the RHS is large compared to the rest of the terms, the rate of convergence will be affected. In such cases, the rate …

## gaussLaplacianScheme(2/3): A test case in OpenFOAM

as I learned from the awesome book and from several posts in cfdonline This article is an outcome of an effort to learn programming in OpenFOAM. A basic conduction solver is made for the learning purpose. It is decided to document the same for the future reference. Understanding the fvMatrix (“A” matrix of Ax = …

In order to apply these methods to a system , A should be Symmetric Positive definite For such cases, function f is defined such that, Then the gradient of f Hence, if f is minimised, then and it will make sure tat . It can be seen too in the other way around. Steepest descent …

## Iterative methods: Jacobi and Gauss Seidel methods

Generalised analysis Solution Step 1: Step 2: (Jacobi) Step 2: (Gauss Siedal) In a general way, Jacobi Gauss Siedal: Convergence and spectral radius Expression for error represents the exact solution. Now, taking (2) – (3) gives the error(). . Relating error with eigen value If are the eigen values of M and are the corresponding …

## Direct solvers

Direct solvers of system of algebraic equations. Gauss elimination Step 1:Making the first column zero Step 2:Making the second column elements (entries below diagonal) zero In general, kth column : Forward elimination: There are three loops in the forward elimination. Hence the order of computation is Backward substitution Algorithm for backward substitution: Here, the order …

## Basic time integration schemes

Consider the unsteady one dimensional heat conduction without any source term. We shall integrate LHS and RHS before discretisation. In LHS, the time integration carries out first. notating Now, in order to carryout the space integration, we need to have an assumption for variation of T with respect to time t. Assuming the “piecewise linear” …