Introduction To CFD
Introduction To CFD
Introduction To CFD
Wangda Zuo
FAU Erlangen-Nrnberg
JASS 05, St. Petersburg
Computational Fluid Dynamics (CFD) is the simulation of fluids engineering systems using
modeling (mathematical physical problem formulation) and numerical methods (discretization
methods, solvers, numerical parameters, and grid generations, etc.). The process is as figure 1.
Figure 1
Firstly, we have a fluid problem. To solve this problem, we should know the physical properties of
fluid by using Fluid Mechanics. Then we can use mathematical equations to describe these physical
properties. This is Navier-Stokes Equation and it is the governing equation of CFD. As the
Navier-Stokes Equation is analytical, human can understand it and solve them on a piece of paper.
But if we want to solve this equation by computer, we have to translate it to the discretized form.
The translators are numerical discretization methods, such as Finite Difference, Finite Element,
Finite Volume methods. Consequently, we also need to divide our whole problem domain into
many small parts because our discretization is based on them. Then, we can write programs to solve
them. The typical languages are Fortran and C. Normally the programs are run on workstations or
supercomputers. At the end, we can get our simulation results. We can compare and analyze the
simulation results with experiments and the real problem. If the results are not sufficient to solve
the problem, we have to repeat the process until find satisfied solution. This is the process of CFD.
Experiment
Cost
Cheap
Expensive
Time
Short
Long
Scale
Any
Small/Middle
Information
All
Measured Point
Repeatable
Yes
Some
Safety
Yes
Some Dangerous
Table 1
M
V
kg
m 3
(1)
The viscosity (2) is an internal property of a fluid that offers resistance to flow. For example, to stir
water is much easier than to stir honey because the viscosity of water is much smaller than honey.
Ns
= 3 = [Posie]
m
(2)
Table 2 shows the densities and viscosities of air, water and honey.
Substance
Air (18C)
Water (20C)
Honey (20C)
Density (kg/m3)
1.275
1000
1446
Viscosity (P)
1.82e-4
1.002e-2
190
2. 2. Navier-Stokes Equations
dM
= m& in m& out
dt
(3)
dM
=0
dt
(4)
M = const
(5)
Which means
Continuity Equation
D
U i
+
=0
Dt
xi
(7)
Momentum Equation
U j
P ij
+ U i
=
+ g j
3
x j xi {
t
xi
12
{
V
1424
3
{
I
U j
II
III
(8)
IV
Where
U j
ij =
xi
I:
II:
III:
IV:
V:
U i 2
U k
+ ij
x j 3
xk
(9)
Energy Equation
U j
T
T
U
2T
+ cU i
= P i + 2 ij
t
xi
xi
xi
xi
123
1424
3
123
123
123
I:
II:
III:
IV:
V:
II
III
IV
(10)
If the fluid id compressible, we can simplify the continuity equation and momentum equation as
follows.
Continuity Equation
U i
=0
xi
Momentum Equation
(11)
2U j
P
+ g j
=
+ U i
xi2
xi
x j
t
U j
U j
(12)
( )
+
t
xi
= q
U i
x
i
(13)
When = 1, U j , T , we can respectively get continuity equation, momentum equation and energy
equation.
dV = ni dS
(14)
( )
ni dS = q dV
dV + U i
xi
t
S
V
(15)
To approximate the the volume integral, we can multiply the volume and the value at the center of
the control volume. For example, we have a 2D domain as fig 2. To approximate the mass and
momentum of control volume P, we have
m = dV pV ,
Vi
mu = i ui dV P u PV
(16)
Vi
Si
P dS Pk S k
k = n, s, e, w
(17)
Normally we store our variables at the center of control volume, so we need to interpolate them to
get Pk , which are located at the surface of control volume.
Typically, we have two types of interpolations, one is upwind interpolation, and the other one is
central interpolation.
UE
UP
Ue
Figure 2
Upwind Interpolation
U P
Ue =
U E
r r
if (U n ) e > 0
r r
if (U n ) e < 0
Central Interpolation
U e = U E e + U P (1 e )
e =
xe xP
xE xP
That is the reason why finite volume is preferred in computational fluid dynamics.
4. Grids
There are three types of grids: structured grids, unstructured grids and block structured grids.
The simplest one is structured grid (fig 3). This type of grids, all nodes have the same number of
elements around it. We can describe and store them easily. But this type of grid is only for the
simple domain.
If we have a complex domain, we can use unstructured grid. For example, fig 4 is an airfoil. The
structure of airfoil is very complex. The flow near the object is very important and complex, we
need very fine grid at this region. Far away from the airfoil, the flow is comparably simple, so we
can use coarse grid. Generally, unstructured grid is suitable for all geometries. It is very popular in
CFD. The disadvantage is that because the data structure is irregular, it is more difficult to describe
and store them.
Block structure grid is a compromising of structured and unstructured grid. The idea is, firstly,
divide the domain into several blocks, then use different structured grids in different blocks.
Figure 3
Structured Grids
Figure 4
Unstructured Grids
5. Boundary Conditions
To solve the equation system, we also need boundary conditions. The typical boundary conditions
in CFD are No-slip boundary condition, Axisymmetric boundary condition, Inlet, outlet boundary
condition and Periodic boundary condition.
For example, fig 5 is a pipe, the fluid flows from left to right. We can use inlet at left side, which
means we can set the velocity manually. At the right side, we use outlet boundary condition to keep
all the properties constant, which means all the gradients are zero.
At the wall of pipe, we can set the velocity to zero. This is no-slip boundary condition.
At the center of pipe, we can use axisymmetric boundary condition.
No-Slip B.C
Outlet B.C.
Inlet B.C.
Axisymmetric B.C.
Figure 5