# Computational Fluid Dynamics 2003

Document Sample

```					                          Computational Fluid Dynamics
FACE8 – Applied CFD

2003

Institute of Energy Technology
Aalborg University

1
Course outline
∙   1 MM
▫ Introduction to applied CFD
▫ Review of the finite volume method
▫ Geometry creation and CAD import
∙   2 MM
FACE8 – Applied CFD

▫   Grid generation
▫   Grid quality
▫   Grid adaption – static and dynamic
▫   Boundary conditions
∙   3 MM
▫ Solution methods
▫ Solution quality
∙   4 MM
∙   5 MM
▫ Post-processing
▫ Validation

2
Solver formulations

FACE8 – Applied CFD

▫ incompressible to mildly compressible flows
▫ has more physical models available

∙   Coupled solver
▫ highly compressible flows
▫ more memory intensive (factor of 1.5 to 2)

3
The segregated solver
FACE8 – Applied CFD

4
The segregated solver cont’d

∙   Solves for a single variable considering all cells at the
FACE8 – Applied CFD

same time using a point implicit (Gauss-Seidel) linear
solver in combination with an AMG method.
▫ the traditional line-by-line method is not applicable to
unstructured grids
▫ a little more on the AMG method later...

5
The coupled solved
FACE8 – Applied CFD

6
The coupled solver cont’d

∙   The coupled implicit solver:
FACE8 – Applied CFD

▫ Solves for all variables (p,u,v,w,T) in all cells at the same
time
▫ involves unknown variables
▫ uses a point implicit (block Gauss-Seidel) linear method

∙   The coupled explicit solver:
▫ Solves for all variable in one cell at the time
▫ involves only existing variables
▫ uses a multistage (Runge-Kutta) solver

7
The integrated equation
FACE8 – Applied CFD

8
Interpolation of face values
FACE8 – Applied CFD

∙   The diffusion term:
▫   Always discretised using second-order accurate central
differencing
∙   The convection term:
▫   The default interpolation scheme is a first-order
accurate upwind scheme (properties are constant
throughout cell)

9
Power law interpolation

∙    The solution to a 1-D convection-
diffusion equation is used to
determine face values (u, 
constant over dx)
FACE8 – Applied CFD

æ ÷   ö
çPe x ÷- 1
exp ç
f (x ) - f 0         ç L÷
è     ø
=
fL - f0          exp (Pe ) - 1

r uL
Pe =
G

▫    The power law scheme yields
similar accuracy as the upwind
scheme

10
Second-order upwind

∙   Second-order accuracy is achieved using a
multidimensional linear reconstruction approach:
r
f f = f + Ñ f ×D s
FACE8 – Applied CFD

▫ where  and  are the cell-centered value and its
gradient in the upstream cell, and s is the displacement
vector from the upstream cell center to the face center.
▫ The gradient is determined from the divergence theorem:
1
N faces      r
Ñf =
V
å f
f fA

▫ By default the face value is based on the average of the
neighbour cell center values.

11

∙   We need f in the discretised equations:
▫ simple average of two neighbour nodes:
FACE8 – Applied CFD

▫ Weighted average of all surrounding nodes:

▫ The latter is more accurate and can be selected in the
Define/Model/Solver panel

12
QUICK

∙   The QUICK scheme only applies to hexahedral and
▫ for mixed grids the second-order upwind scheme is used
FACE8 – Applied CFD

for non-hexahedral cells

Flow

13
Solution method (1)

∙   The discretized equation contains the unknown at the
cell center as well as in the surrounding neighbour cells.
This can be written in a linearized form as:

aPP  aEE  aWW  b   anbnb  b
FACE8 – Applied CFD

▫ the coefficients, a, contains the unknown itself
▫ we can solve this problem using the two approaches
mentioned previously:
◦ a segregated solution method
◦ a coupled solver method
▫ first we explore the segregated solver in more detail.

14
Solution method (2)

∙     The main problem in the overall solution procedure is
the momentum equations (here x-momentum)
FACE8 – Applied CFD

( u )                                 p
 div(  u u)  div(  grad u)     S
t                                     x

There is no specific equation for the pressure!

15
Pressure-velocity coupling in FLUENT

∙   Usually the continuity equation is rewritten to give an
equation for pressure.
FACE8 – Applied CFD

▫ the default scheme
▫ may improve the convergence rate compared to SIMPLE
▫ allows higher under-relaxation factors to be used

16
The SIMPLE algorithm outlined
FACE8 – Applied CFD

17
Under-relaxation

∙   To avoid divergence of the solution under-relaxation is
used in the iterative solution procedure when up-dating
the unknown variable:
FACE8 – Applied CFD

 NEW  (1   ) OLD    NEW
▫ the under-relaxation factor is a key-parameter in
obtaining a converged solution.

18
FLUENT Guidelines on under-relaxation

∙   The default parameters are suitable in most cases
▫ if residuals continue to increase after 4-5 iterations reduce
the under-relaxation factors
FACE8 – Applied CFD

▫ in combusting flow the following values may be more
suitable:
◦   pressure      0.2
◦   density       0.8
◦   momentum      0.5
◦   turbulence    0.4-0.5
◦   temperature   0.6

∙   Consult Section 24.19 for guidelines on convergence

19
Checkerboard effect

∙   Velocities and pressure are solved on co-located grids –
FACE8 – Applied CFD

no staggering
▫ A special averaging technique is used to determine face
values that suppresses the checkerboard effect (Rhie-
Chow interpolation).
▫ we also need a pressure interpolation scheme.

20
Pressure interpolation in FLUENT

∙   A number of schemes exists to calculate face pressure
▫ the standard scheme based on momentum equation
coefficients
FACE8 – Applied CFD

▫ a linear scheme
▫ a second-order scheme
▫ a body-force-weighted scheme
▫ the PRESTO scheme

∙   Consult Section 24.7 for recommondations on when to
use the different schemes

21
The coupled solver

∙   The coupled solver in FLUENT solves the governing
equations as a set or vector of equations.
▫ the governing equation is written in integral and cartesian
form:
¶
FACE8 – Applied CFD

¶t ò        Ñ
W dV + ò [F - G ]×dA = ò H dV
V                        V

▫ with the vectors W, F, and G defined as:

ì
ï     rV      ü
ï
ì r ü
ï    ï          ï
ï             ï
ï        ì
ï     0      ü
ï
ï ru ï
ï               ï r vu +               ï            ï
ï    ï
ï          ï
ï          pi ï
ˆï
ï        ï t
ï            ï
ï
ï
ï    ï          ï             ï        ï      xi    ï
ï rv ï ,
W = í    ï          ï
F = ï r vv +
ï
pj ï
ˆ ý,
ï
ï
G = í t yi
ï
ï
ý          í                                   ý
ï rwï
ï    ï          ï
ï             ï
ï        ï
ï t zi       ï
ï
ï    ï          ï r vw +     ˆï        ï            ï
ï
ï rEï
ï    ï
ï
ï
ï
ï
pk ï
ï
ï
ï
ït v +
ï ij j
ï
qï
ï
ï
î    ï
þ          ï
ï r vE +   p vï
ï        ï
î            ï
þ
ï
î             ï
þ
▫ H contains the source terms
22
The coupled solver cont’d

∙   A lot of math is involved in the solution of the set of
equations.
FACE8 – Applied CFD

∙   The procedure is different from the segregated solved in
a number of ways:
▫ there is no pressure-velocity coupling since all equations
are solved simultaneously.
▫ steady state problems are solved using a time-marching
technique – under-relaxation is not used as in the
segregated solver.

23
Multigrid methods

∙   The basic idea of Multigrid methods is to accellerate
convergence
▫ the number of iterations required is reduced
FACE8 – Applied CFD

▫ most efficient for large problems – large number of cells

∙   The need for multigrid method
▫ line-by-line techniques are not applicable
▫ matrix-inversion is not possible for realistic problems
▫ whole-field methods such as conjugate-gradient is not
robust
▫ Point implicit (Gauss-Seidel) solvers are currently the
method of choice

24
Multigrid methods cont’d

∙   Characteristics of point implicit solvers
▫ rapidly removes local (high-frequency) errors
▫ global (low-frequency) errors are reduced at a rate
FACE8 – Applied CFD

inversely proportional to the grid size!
▫ consequently, for large problems the convergence rate
becomes prohibitively slow.

∙   The idea behind the multigrid methods
▫ the global errors are eliminated using a series of
successively coarser grids
▫ global errors on the fine grid becomes local on the coarse
grids
▫ global corrections are communicated much faster on a
coarse mesh
▫ the coarse grids are not CPU intensive

25
Multigrid methods cont’d
FACE8 – Applied CFD

Level 1
Level 2
Level 3
26
Multigrid methods cont’d

∙   We consider the set of discretized linear equations:
A fe + b= 0
▫ here e is the exact solution. During iteration there will be
FACE8 – Applied CFD

a defect, d, associated with the approximate solution, :
A f +b= d
▫ we seek a correction  such that:

fe = f + y
▫ substituting this into the first expression:

A (f + y ) + b = 0
A y + (A f + b) = 0

27
Multigrid methods cont’d

▫ if we substitute:
A f +b= d
FACE8 – Applied CFD

▫ into:
A y + (A f + b) = 0
▫ we find that:

Ay + d = 0
▫ this is an equation for the correction in terms of the
original fine level operator A and the defect.
▫ if the local error have been sufficiently damped on the fine
grid the correction will be smooth.

28
Multigrid methods cont’d

∙   Solution method:
▫   to solve for the correction on the coarse level the defect must be
transferred down from the fine level (restriction), and then
transferred back to the fine level (prolongation).
FACE8 – Applied CFD

▫   the coarse level correction equation is written as:

AH y H + Rd = 0
▫   AH is the coarse level operator and R the restriction operator that
transfers the fine level defect to the coarse level.
▫   Subsequently the fine level solution is given by:
NEW
f         = f + PyH
▫   where P is the prolongation operator used to transfer the coarse
level correction to the fine level.

29
Multigrid methods cont’d

∙   Different ways of switching between the different grid
levels exist:
▫ v, w, and F cycles (details are given in Section 24.5)
FACE8 – Applied CFD

∙   Two multigrid methods are available in FLUENT
▫ AMG which is an algebraic multigrid method that uses
”virtual” coarse grid levels
▫ Full-Approximation-Storage (FAS) which uses ”true”
coarse grid levels based on coalescence of cells

30
Solution method
quality and trust

Be careful - definitions of residuals vary between codes!

If the solution fails to converge:
FACE8 – Applied CFD

- consult the manual for guidelines
- avoid changing too many parameters at a time

Guidelines:

- monitor the change in global parameters; drag, forces, heat flux etc.
- look at the solution at different levels of residuals to determine the influence
- check overall conservation of properties
- use visualization tool to look at residual distribution in the domain
- test the sensitivity to convergence level

31
Turbulence, introduction

Most flows of industrial relevance are turbulent!
FACE8 – Applied CFD

Inertia     uL
Re             
Visc osity   

Turbulence has a significant influence on for example:
- Shear stress (drag, pressure loss)
- Heat transfer

32
Examples of turbulence models 1
FACE8 – Applied CFD

Reynolds Average
Computational time

Mean flow
Navier Stokes
Modelling

Large scale turbulence
Large Eddy Simulation

Direct Numerical Simulation    All turbulent scales

33
Examples of turbulence models 2

•   Classification of turbulence
models:
Based on Boussinesq approximation        •   0 equation models
• Mixing length model       Algebraic expression
FACE8 – Applied CFD

•   1 equation models
Transport of k
• k-model
•   2 equation models
• k-epsilon model
• Realizable
• RNG                      Transport of k and epsilon

•   Reynolds stress models Transport equations for all stress terms
•   Algebraic stress models Algebraic transport equations

•   LES/VLES/DNS

34
Quality and trust
turbulence models

∙   Issues to consider:
▫ Turbulence modelling only becomes important when other
FACE8 – Applied CFD

sources of error have been minimised e.g. discretisation,
convergence etc.
▫ There is NO such thing as a universally valid turbulence
model
▫ Test the sensitivity to key parameters to turbulence
modelling
▫ Look for published weaknesses of the model
▫ Carfully select the near wall treatment

35
Turbulence - wall treatment 1

∙   Turbulent flow structure
▫ highly viscous boundary layer
▫ inviscid free stream/core
FACE8 – Applied CFD

36
Turbulence - wall treatment 2

Full resolution of BL                                 Model assumption for BL
FACE8 – Applied CFD

viscosity dominated
sub- & buffer-layers

• near wall region resolved                     • viscosity affected region is not resolved
• turbulence models must be valid to the wall   • high Re turbulence models are valid

37
Turbulence - wall treatment 3

∙      Boundary layer vs. grid density                 Main flow
▫ very often impossible to resolve             direction
boundary layer – first grid point
outside BL
▫ ->Wall functions
FACE8 – Applied CFD

38
Turbulence - wall treatment 4

For attached Couette flow with small pressure gradient: the log law

1
u        ln y   B       Constant
                    approx. 5.2
FACE8 – Applied CFD

u    u
u                            u* y
u*   w             
y 



Dimensionless                   Wall distance
velocity

• Wall functions account for the effect
of the boundary layer on the
turbulent flow field

• Wall functions are empirical

• Wall functions do not reflect
boundary layer build-up

39
Turbulence - wall treatment 5

∙   When the boundary layer is resolved
▫ the first node should be below y+ = 4 and preferably close
to unity
▫ sufficient number of nodes (5-10) in sub- and buffer-
layers (y+<20)
FACE8 – Applied CFD

▫ the turbulence model must be valid all the way to the
wall!
∙   Even with wall functions it is important to remember:
▫ wall functions bridge the gap between the sub-layer and
the turbulent region
▫ sufficient nodes (8-10) are required in the turbulent
▫ depending on the specific case this may not be possible
▫ wall function have limitations
▫ consult the code manual for specific values and
constraints
▫ wall roughness may be important (next)
∙   FLUENT guidelines in Section 10.9!

40
Turbulence - wall treatment 6

∙   If the wall roughness is significant (extend beyond sub-
layer):
FACE8 – Applied CFD

1
u        ln y   B
                       Modified constant

y
y 
z0
dimensionless with respect to
roughness height

▫ Influences heat transfer and shear stress (pressure loss)

41
FACE8 – Applied CFD                              DNS 1

   The most exact approach for
simulating turbulence
   Introduces no averaging or
approximation, other than
the numerical discretisation
   Three-dimensional and time                                   
dependent description of all
scales of the turbulent flow
Small Scales   Large Scales

42
DNS 2

∙   The size of the grid and the time step must be able to
capture the evolution of the smallest scales
(kolmogoroff)
FACE8 – Applied CFD

∙   DNS requires:
▫ Highly accurate code (4th order)
▫ Millions of cells (x+<10 , y+<1 , z+< 5)
▫ Very small time steps (CFL<1)
∙   Only for detailed investigations of the fundamental
mechanisms of turbulence.
▫ Reynolds numbers far less than 10,000
▫ Boundary layers, coherent structures, turbulent mixing
etc.

43
LES 1

The basic philosophy
in LES
FACE8 – Applied CFD

Directly simulation of
Taking into account the effect
3D time depending
of the small scales through
large scale turbulent
subgrid-scale (SGS)
motion
models

Separates large and small scales
through Filter Length 
(discretisation in FVM)
44
LES 2

Large Scales
FACE8 – Applied CFD

Small Scales                

   Simulating large scales
• 3D and time dependent
• Mesh resolution
• Discretisation schemes

45
Hands-on

symmetry
Outflow
=1                              =1
Outflow
FACE8 – Applied CFD

=0
=0
symmetry                                Outflow

∙     Try to change the differencing scheme to higher-order
∙     Look at heat transfer and pressure drop in a tube using
wall functions and boundary layer resolution.
∙     Use the post-processor to monitor local y+.

46

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 39 posted: 6/1/2010 language: English pages: 46
How are you planning on using Docstoc?