Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

Finite Volume Method

2020.02.11
Kei

08/22/2023 1
Content

Transport equation
Mesh and element
Gauss theorem
Finite volume method
fvSchemes dict
Some comments

© 2002-2018 TechnoStar Co.,Ltd. 2


Transport equation

General transport equation

-The variable we want to solve is Φ.


-Starting from this equation we can write down the Navier-Stokes
equations (NSE).
-Assume that dependent variables are assumed to vary linearly
around a point P (centroid of element) in space and instant t in time.

08/22/2023 3
Mesh and element

Mesh
-Let us divide the solution domain into a finite number of arbitrary
control volumes or cells, such as the one illustrated below.
-Inside each control volume the solution is sought
-The control volumes can be of any shape (e.g., tetrahedrons,
hexes, prisms, pyramids, dodecahedrons, and so on).
-The only requirement is that the elements need to be convex and
the faces that made up the control volume need to be planar .

08/22/2023 4
Mesh and element

Element (cell)

08/22/2023 5
Mesh and element

Element (cell)
-Assume that the values of all variables are computed and stored in
the centroid of the control volume VP and that they are represented by
a piecewise constant profile (the mean value)

08/22/2023 6
Gauss theorem

Gauss (Divergence) theorem

08/22/2023 7
Finite volume method

Flow chart
Apply Gauss theorem to
volume integral

Apply Mid point rule to


surface integral

Apply Mid point rule to


surface integral

Apply Temporal
discretization

Solve system of linear


algebraic equations

08/22/2023 8
Finite volume method

Apply Gauss theorem to governing equation

08/22/2023 9
Finite volume method

Apply Gauss theorem to governing equation

08/22/2023 10
Finite volume method

Apply Gauss theorem to governing equation

08/22/2023 11
Finite volume method

Equation for FVM

-Convective flux:
-Diffusive flux:

-Recall that all variables are computed and stored at the


centroid of the control volumes.

08/22/2023 12
Finite volume method

Temporal discretization
-We calculate temporal derivative as follow:

-Governing equation can be rewrite as

-At this stage, we can use any time discretization scheme, e.g.,
Crank-Nicolson, Euler implicit, forward Euler…

08/22/2023 13
Finite volume method

-In every control volume of the domain VP, a system of linear


algebraic equations for the transported quantity is assembled,

-This system can be solved by using any iterative or direct method.

08/22/2023 14
Interpolation schemes

Interpolation of the convective fluxes

-This type of interpolation scheme is known as linear interpolation


or central differencing and it is second order accurate.
-However, it may generate oscillatory solutions (unbounded
solutions).

08/22/2023 15
Interpolation schemes

Interpolation of the convective fluxes

-This type of interpolation scheme is known as upwind differencing


and it is first order accurate.
-This scheme is bounded (non-oscillatory) and diffusive.

08/22/2023 16
Interpolation schemes

Interpolation of the convective fluxes – Unstructured


meshes

In this case, we compute the face


values by using gradient of the
cells.

The problem now turns in the accurate evaluation of the gradients at


the cell and face centers

08/22/2023 17
Interpolation schemes

Interpolation of diffusive fluxes in a orthogonal mesh

-This is a central difference approximation of the first order


derivative. This type of approximation is second order accurate.

08/22/2023 18
Interpolation schemes

Interpolation of diffusive fluxes in a non-orthogonal


mesh

08/22/2023 19
Interpolation schemes

Interpolation of diffusive fluxes in a non-orthogonal


mesh
-In order to maintain second order accuracy, and to avoid
unboundedness, we need to correct non-orthogonality and skewness
errors

08/22/2023 20
fvSchemes dict

fvSchemes in OpenFOAM
The fvSchemes dictionary contains the
information related to the discretization
schemes for the different terms appearing in
the governing equations.
Time discretization

Gradient term discretization

Convective term discretization

Laplacian term discretization

Method used to interpolate values


from cell centers to face centers
Surface normal gradients term
discretization

08/22/2023 21
fvSchemes dict

Time discretization scheme


-Keyword: ddtSchemes
-Some common schemes:
• Euler: time dependent first order (implicit/explicit), bounded (mostly
used).

• backward: time dependent second order (implicit), bounded/unbounded.


• CrankNicolson: time dependent second order (implicit),
bounded/unbounded.

08/22/2023 22
fvSchemes dict

Gradient scheme
-Keyword: gradSchemes
-Some common schemes:
Gauss linear: 2nd order.
leastSquares: 2nd order, more accurate than Gauss linear but also more
unstable.

-Gradient limiters:
Available limiters

Example of gradScheme with limiter: cellMDLimited leastSquares 1.0;


Blending factor

08/22/2023 23
fvSchemes dict

Scheme of divergence terms


-Keyword: divSchemes
-These are the convective discretization schemes that you will use
most of the times:
upwind: first order accurate.
linearUpwind: second order accurate, bounded.

linear: second order accurate, unbounded (usually use for diffusive


terms).
vanLeer: TVD, second order accurate, bounded (vanLeer is usually used
for multiphase case).
limitedLinear: second order accurate, unbounded, but more stable than

pure linear. Recommended for LES simulations.

08/22/2023 24
fvSchemes dict

Scheme of divergence terms

-Some notifications:
First order methods are bounded and stable but diffusive.
Second order methods are accurate, but they might become oscillatory.

The final solution should be solved by Second order methods.


Common strategy:
-Run case by 1st order method firstly.
-Change to 2nd order method after the solution get to stable state.
-The order of scheme of convection term is very important. Try to get the final
solution by using 2nd order scheme for convective term.

-If the case is too unstable, try to reduce the schemes of turbulence terms to 1 st
order.

08/22/2023 25
fvSchemes dict

Scheme of Laplacian terms


-Keyword: laplacianSchemes
-General syntax:
Gauss <interpolation scheme> <snGrad scheme>
- Available Laplacian Schemes

-The most used schemes is Gauss linear limited corrected Ψ.

08/22/2023 26
fvSchemes dict

InterpolationSchemes and snGradSchemes


-Follow laplacianSchemes.

08/22/2023 27
Some comments
-Check mesh again and again, only run case when you have a
mesh with acceptable qualities.
-Select a good initial conditions. A good initial condition can
improve the stability and convergence rate.
-Start the simulation by using a first order scheme and then switch
to a high order scheme.
-To accelerate the iterative convergence, you can change the
convergence criterion of the linear solvers on-the-fly.
-You can start using a not so tight convergence criterion with a
robust numerical scheme, and as the simulation runs you can tighten
the convergence criterion to increase the accuracy.
-Remember to always check the time step continuity errors. This
number should be small (negative or positive), if it increases in time
for sure something is wrong.

08/22/2023 28
Some comments

-Never get a final solution using first order schemes. They are too
diffusive, which means they will under predict the forces and smear
the gradients.
-You can start using a first order scheme, and then switch to a high
order scheme. Remember, you can change the parameters on the fly.
-This means, start robustly and end with accuracy.

08/22/2023 29

You might also like