Finite Volume: Basic Methodology
Finite Volume: Basic Methodology
Finite Volume: Basic Methodology
• • • •
• • • • • • •
• • • • • • •
• • •
Boundary node
Control volume
Computational node
2
Typical control volume
• The net flux through the control volume boundary is the sum of
integrals over the four control volume faces (six in 3D). The
control volumes do not overlap.
• The value of the integrand is not available at the control volume
faces and is determined by interpolation.
Dx
NW N NE
dyn
n
W P E
w e Dy
j,y,v
dys s
SW S SE
i,x,u
dxw dxe
3
Discretization example
• To illustrate how the conservation equations used in CFD can be
discretized we will look at an example involving the transport of a
chemical species in a flow field.
• The species transport equation (constant density, incompressible
flow) is given by:
c c
(ui c) D S
t xi xi xi
Notation
cN
Aw , An , Ae , As : areas of the faces
An,cn cw , cn , ce , cs : concentrations at the faces
cW cP cE
cW , cN , cE , cS : concentrations at the cell centers
Aw,cw Ae,ce
uw , un , ue , us , vw , vn , ve , vs : velocities at the faces
As,cs
uW , u N , uE , uS , vW , vN , vE , vS : velocities at the cell centers
cS
j,y,v S P : source in cell P
D: diffusion coefficient
i,x,u
5
Discretization example - continued
• The simplest way to determine the values at the faces is by using
first order upwind differencing. Here, let’s assume that the value
at the face is equal to the value in the center of the cell upstream
of the face. Using that method results in:
6
Discretization example - continued
• Rearranging the previous equation results in:
aP cP aW cW aN cN aE cE aS cS b
a
nb
c b
nb nb
• Here nb refers to the neighboring cells. The coefficients anb and b will be
different for every cell in the domain at every iteration. The species
concentration field can be calculated by recalculating cP from this
equation iteratively for all cells in the domain. 7
General approach
• In the previous example we saw how the species transport
equation could be discretized as a linear equation that can be
solved iteratively for all cells in the domain.
• This is the general approach to solving partial differential
equations used in CFD. It is done for all conserved variables
(momentum, species, energy, etc.).
• For the conservation equation for variable f, the following steps
are taken:
– Integration of conservation equation in each cell.
– Calculation of face values in terms of cell-centered values.
– Collection of like terms.
• The result is the following discretization equation (with nb
denoting cell neighbors of cell P):
aPfP anbfnb b
nb 8
General approach - relaxation
• At each iteration, at each cell, a new value for variable f in cell P
can then be calculated from that equation.
• It is common to apply relaxation as follows:
9
Underrelaxation recommendation
• Underrelaxation factors are there to suppress oscillations in the
flow solution that result from numerical errors.
• Underrelaxation factors that are too small will significantly slow
down convergence, sometimes to the extent that the user thinks
the solution is converged when it really is not.
• The recommendation is to always use underrelaxation factors
that are as high as possible, without resulting in oscillations or
divergence.
• Typically one should stay with the default factors in the solver.
• When the solution is converged but the pressure residual is still
relatively high, the factors for pressure and momentum can be
lowered to further refine the solution.
10
General approach - convergence
• The iterative process is repeated until the change in the variable
from one iteration to the next becomes so small that the solution
can be considered converged.
• At convergence:
– All discrete conservation equations (momentum, energy, etc.) are
obeyed in all cells to a specified tolerance.
– The solution no longer changes with additional iterations.
– Mass, momentum, energy and scalar balances are obtained.
• Residuals measure imbalance (or error) in conservation
equations.
• The absolute residual at point P is defined as:
11
Convergence - continued
• Residuals are usually scaled relative to the local value of the
property f in order to obtain a relative error:
a Pf P nb anbf nb b
RP , scaled
a Pf P
13
First order upwind scheme
• This is the simplest numerical
scheme. It is the method that we interpolated
f(x) value
used earlier in the discretization
example. fP fe
• We assume that the value of f at
the face is the same as the cell fE
centered value in the cell e
P E
upstream of the face.
• The main advantages are that it
is easy to implement and that it
results in very stable
calculations, but it also very Flow direction
diffusive. Gradients in the flow
field tend to be smeared out, as
we will show later.
• This is often the best scheme to
start calculations with. 14
Central differencing scheme
• We determine the value of f at
the face by linear interpolation interpolated
f(x) value
between the cell centered
values. fP
• This is more accurate than the fe
first order upwind scheme, but it fE
leads to oscillations in the e
P E
solution or divergence if the local
Peclet number is larger than 2.
The Peclet number is the ratio
between convective and diffusive
transport: uL
Pe
D
• It is common to then switch to
first order upwind in cells where
Pe>2. Such an approach is
called a hybrid scheme. 15
Power law scheme
• This is based on the analytical
solution of the one-dimensional
convection-diffusion equation.
f(x) interpolated
• The face value is determined value
fP
from an exponential profile
through the cell values. The
fe
exponential profile is fE
approximated by the following P e E
power law equation:
1 0.1Pe5
fe f P fE fP x
Pe
L
• Pe is again the Peclet number.
• For Pe>10, diffusion is ignored
and first order upwind is used.
16
Second-order upwind scheme
• We determine the value of f from
the cell values in the two cells
upstream of the face.
• This is more accurate than the
first order upwind scheme, but in
regions with strong gradients it fW
can result in face values that are f(x) interpolated
value
outside of the range of cell fP
values. It is then necessary to
apply limiters to the predicted fe
face values. fE
Flow direction
18
Properties of numerical schemes
• All numerical schemes must have the following properties:
– Conservativeness: global conservation of the fluid property f must
be ensured.
– Boundedness: values predicted by the scheme should be within
realistic bounds. For linear problems without sources, those would
be the maximum and minimum boundary values. Fluid flow is non-
linear and values in the domain may be outside the range of
boundary values.
– Transportiveness: diffusion works in all directions but convection
only in the flow direction. The numerical scheme should recognize
the direction of the flow as it affects the strength of convection versus
diffusion.
• The central differencing scheme does not have the
transportiveness property. The other schemes that were
discussed have all three of these properties.
19
Pressure
• We saw how convection-diffusion equations can be solved. Such
equations are available for all variables, except for the pressure.
• Gradients in the pressure appear in the momentum equations,
thus the pressure field needs to be calculated in order to be able
to solve these equations.
• If the flow is compressible:
– The continuity equation can be used to compute density.
– Temperature follows from the enthalpy equation.
– Pressure can then be calculated from the equation of state p=p(,T).
• However, if the flow is incompressible the density is constant and
not linked to pressure.
• The solution of the Navier-Stokes equations is then complicated
by the lack of an independent equation for pressure.
20
Pressure - velocity coupling
• Pressure appears in all three momentum equations. The velocity field
also has to satisfy the continuity equation. So even though there is no
explicit equation for pressure, we do have four equations for four
variables, and the set of equations is closed.
• So-called pressure-velocity coupling algorithms are used to derive
equations for the pressure from the momentum equations and the
continuity equation.
• The most commonly used algorithm is the SIMPLE (Semi-Implicit
Method for Pressure-Linked Equations). An algebraic equation for the
pressure correction p’ is derived, in a form similar to the equations
derived for the convection-diffusion equations:
23
Finite volume solution methods
• The finite volume solution method can either use a “segregated”
or a “coupled” solution procedure.
• With segregated methods an equation for a certain variable is
solved for all cells, then the equation for the next variable is
solved for all cells, etc.
• With coupled methods, for a given cell equations for all variables
are solved, and that process is then repeated for all cells.
• The segregated solution method is the default method in most
commercial finite volume codes. It is best suited for
incompressible flows or compressible flows at low Mach number.
• Compressible flows at high Mach number, especially when they
involve shock waves, are best solved with the coupled solver.
24
Segregated solution procedure
Update properties.
Converged?
No Yes Stop
25
Coupled solution procedure
• When the coupled solver is used for steady state calculations it
essentially employs a modified time dependent solution algorithm, using
a time step Dt = CFL/(u/L) with CFL being the user specified Courant-
Friedrich-Levy number, L being a measure of the size of the cell, and u
being a measure of the local velocities.
Update properties.
Converged?
No Yes Stop
26
Unsteady solution procedure
• Same procedure for segregated and coupled solvers.
• The user has to specify a time step that matches the time variation in the
flow.
• If a time accurate solution is required, the solution should be converged
at every time step. Otherwise, convergence at every time step may not
be necessary.
28