Solution Methods

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

Week 5 - Solution Methods

Computational Fluid Dynamics

© André Bakker (2002-2005) 1


© Fluent Inc. (2002)
Solution methods
• Focus on finite volume method.
• Background of finite volume method.
• Discretization example.
• General solution method.
• Convergence.
• Accuracy and numerical diffusion.
• Pressure velocity coupling.
• Segregated versus coupled solver methods.
• Multigrid solver.
• Summary.

2
Numerical Schemes

3
Numerical schemes: finding face values
• Face values of f and f/x are found by making assumptions
about variation of f between cell centers.
• Number of different schemes can be devised:
– First-order upwind scheme.
– Central differencing scheme.
– Power-law scheme.
– Second-order upwind scheme.
– QUICK scheme.
• We will discuss these one by one.

4
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. 5
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. 6
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.1Pe 5 
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.

7
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

• There are many different ways to W P e E


implement this, but second-order
upwind with limiters is one of the
more popular numerical
schemes because of its
combination of accuracy and Flow direction
stability. 8
QUICK scheme
• QUICK stands for Quadratic
Upwind Interpolation for
Convective Kinetics.
• A quadratic curve is fitted fW
through two upstream nodes and f(x) interpolated
one downstream node. value
fP
• This is a very accurate scheme,
but in regions with strong
fe fE
gradients, overshoots and
undershoots can occur. This can e
W P E
lead to stability problems in the
calculation.

Flow direction

9
Accuracy of numerical schemes
• Each of the previously discussed numerical schemes assumes some
shape of the function f. These functions can be approximated by Taylor
series polynomials:

f ' ( xP ) f ' ' ( xP ) f n ( xP )


f ( xe )  f ( x P )  ( xe  x P )  ( xe  xP )  .... 
2
( xe  xP ) n  ...
1! 2! n!

• The first order upwind scheme only uses the constant and ignores the
first derivative and consecutive terms. This scheme is therefore
considered first order accurate.
• For high Peclet numbers the power law scheme reduces to the first
order upwind scheme, so it is also considered first order accurate.
• The central differencing scheme and second order upwind scheme do
include the first order derivative, but ignore the second order derivative.
These schemes are therefore considered second order accurate.
QUICK does take the second order derivative into account, but ignores
the third order derivative. This is then considered third order accurate.
10
Accuracy of Numerical Schemes
Accuracy and false diffusion (1)
• False diffusion is numerically introduced diffusion and arises in
convection dominated flows, i.e. high Pe number flows.
• Consider the problem below. If there is no false diffusion, the
temperature will be exactly 100 ºC everywhere above the
diagonal and exactly 0 ºC everywhere below the diagonal.
• False diffusion will occur due to the oblique flow direction and
non-zero gradient of temperature in the direction normal to the
flow.
• Grid refinement coupled
with a higher-order
Diffusion set to zero
interpolation scheme will
k=0
minimize the false Hot fluid
diffusion as shown on T = 100ºC
the next slide.
Cold fluid 12
T = 0ºC
Accuracy and false diffusion (2)

First-order Upwind Second-order Upwind

8x8

64 x 64

13
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.
14
Solution accuracy
• Higher order schemes will be more accurate. They will also be
less stable and will increase computational time.
• It is recommended to always start calculations with first order
upwind and after 100 iterations or so to switch over to second
order upwind.
• This provides a good combination of stability and accuracy.
• The central differencing scheme should only be used for transient
calculations involving the large eddy simulation (LES) turbulence
models in combination with grids that are fine enough that the
Peclet number is always less than one.
• It is recommended to only use the power law or QUICK schemes
if it is known that those are somehow especially suitable for the
particular problem being studied.

15
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.

16
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:

aP p'   anb p'  b'


nb
• Each iteration, the pressure field is updated by applying the pressure
correction. The source term b’ is the continuity imbalance. The other
coefficients depend on the mesh and the flow field.
17
Principle behind SIMPLE
• The principle behind SIMPLE is quite simple!
• It is based on the premise that fluid flows from regions with high
pressure to low pressure.
– Start with an initial pressure field.
– Look at a cell.
– If continuity is not satisfied because there is more mass flowing into
that cell than out of the cell, the pressure in that cell compared to the
neighboring cells must be too low.
– Thus the pressure in that cell must be increased relative to the
neighboring cells.
– The reverse is true for cells where more mass flows out than in.
– Repeat this process iteratively for all cells.
• The trick is in finding a good equation for the pressure correction
as a function of mass imbalance. These equations will not be
discussed here but can be readily found in the literature.
18
Improvements on SIMPLE
• SIMPLE is the default algorithm in most commercial finite volume
codes.
• Improved versions are:
– SIMPLER (SIMPLE Revised).
– SIMPLEC (SIMPLE Consistent).
– PISO (Pressure Implicit with Splitting of Operators).
• All these algorithms can speed up convergence because they
allow for the use of larger underrelaxation factors than SIMPLE.
• All of these will eventually converge to the same solution. The
differences are in speed and stability.
• Which algorithm is fastest depends on the flow and there is no
single algorithm that is always faster than the other ones.

19
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.

20
Segregated solution procedure

Update properties.

Solve momentum equations (u, v, w velocity).

Solve pressure-correction (continuity) equation. Update


pressure, face mass flow rate.

Solve energy, species, turbulence, and other scalar equations.

Converged?
No Yes Stop

21
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 t = 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.

Solve continuity, momentum, energy, and species


equations simultaneously.

Solve turbulence and other scalar equations.

Converged?

No Yes Stop
22
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.

Execute segregated or coupled procedure, iterating to convergence

Update solution values with converged values at current time

Requested time steps completed?

Take a time step No Yes Stop


23
The multigrid solver
• The algebraic equation aPfP  nb anbfnb  b can be solved by
sweeping through the domain cell-by-cell in an iterative manner.
• This method reduces local errors quickly but can be slow in
reducing long-wavelength errors.
• On large grids, it can take a long time to see the effect of far away
grid points and boundaries.
• Multigrid acceleration is a method to speed up convergence for:
– Large number of cells.
– Large cell aspect ratios (e.g. x/y > 20).
– Large differences in thermal conductivity such as in conjugate heat
transfer problems.

24
The multigrid solver
• The multigrid solver uses a sequence of grids going from fine to
coarse.
• The influence of boundaries and far-away points is more easily
transmitted to the interior on coarse meshes than on fine meshes.
• In coarse meshes, grid points are closer together in the
computational space and have fewer computational cells between
any two spatial locations.
• Fine meshes give more accurate solutions.

original grid coarse grid coarse grid


level 1 level 2
25
The multigrid solver
• The solution on the coarser meshes is used as a starting point for
solutions on the finer meshes.
• The coarse-mesh solution contains the influence of boundaries
and far neighbors. These effects are felt more easily on coarse
meshes.
• This accelerates convergence on the fine mesh.
• The final solution is obtained for the original (fine) mesh.
• Coarse mesh calculations only accelerate convergence and do
not change the final answer.

corrections
fine coarse
mesh mesh
summed equations
(or volume-averaged
solution)
26
Finite volume method - summary
• The FVM uses the integral conservation equation applied to
control volumes which subdivide the solution domain, and to the
entire solution domain.
• The variable values at the faces of the control volume are
determined by interpolation. False diffusion can arise depending
on the choice of interpolation scheme.
• The grid must be refined to reduce “smearing” of the solution as
shown in the last example.
• Advantages of FVM: integral conservation is exactly satisfied and
the method is not limited to grid type (structured or unstructured,
Cartesian or body-fitted).
• Always ensure proper convergence.

27
Flow over a backward-facing step

• Flow expands and leaves a


recirculating vortex behind
the step
• Maintain laminar flow
• How long does the domain 2H
have to be to ensure that
the solution is valid x1 H
– Upstream?
– Downstream? x2
• Hint: try
x1=2H, 5H, 10H Re = 500, ν = 10-6,
x2=5H, 10H, 15H H=25mm, u=0.01m/s
• Solution: 1st order or 2nd
order?

You might also like