cfd refresher course
DESCRIPTION
CFD NewTRANSCRIPT
Confidential 1
Computational Fluid DynamicsComputational Fluid Dynamics2D Convection- Diffusion Problems2D Convection- Diffusion Problems
Pravin NakodFluent [email protected]
Confidential 2
Overview
• Generalized 2D N-S Equation for • 2D Convection-Diffusion Problem • Discretization Schemes• Example of 2D Convection-Diffusion • Checkerboard Pressure Field• Staggered Grid Approach• Pressure Correction Equation• SIMPLE (Semi Implicit Method for Pressure Linked
Equation)• Types of Mesh and Quality of Mesh
Session-1
Confidential 3
Generalized 2D N-S Equation for
S)
y(
y)
x(
x)v(
y)u(
x)(
t
1 2 3 4
1 => Transient Term
2 => Convective Term
3 => Diffusion Term
4 => Source Term
Confidential 4
Generalized 2D N-S Equation for
xBxp
yByp
Pr
ypv
xpuTQradQch
Cp v1
Sc
Sr No Equation S
1 Bulk Mass Conservation
1 0 0
2 X - Momentum
u
3 Y - Momentum
v
4 Energy T
5 Species Conservation
j Rj
Confidential 5
2D Convection-Diffusion Problem
Assumptions:
1) X = Y
2) Mesh is uniform
3) Flow is steady
S)
y(
y)
x(
x)v(
y)u(
x
Governing equation:
YP EW
S
N
X
V
ws
e
n
Confidential 6
S)
yv(
y)
xu(
x
Lets define
) Sqx ix
i
iix x
uqi
I = 1, 2
Integrating over control volume
from w to e and
from s to n
Confidential 7
) n
s
e
wPx
n
s
e
w i
dydxSdydxqx i
Assuming quantities are uniform at cell faces
) ) YXSXqqYqq syenwxex
X Y = volume of the cell = V
Lets define
ee uYCe ww uYCw
nn uXCn ss uXCs These quantities represent mass flow rate at the cell faces
A
Confidential 8
Lets also define
XYde e
XYdw w
YXdn n
YXds s
XxPE
e
Disretization gives
Equation A reduces to
) ) ) ) VSdsCsdnCndwCwdeCe sPsPNnWPwPEe
B
Confidential 9
For Bulk mass conservation
= 1; = 0; S= 0
de = dw = dn = ds = 0
Equation B gives
Ce – Cw + Cn – Cs = 0 Equation of Conservation of mass
Let
e= e P + (1- e ) E
w= w W + (1- w ) W
n= n P + (1- n ) N
s= s S + (1- s ) P
Confidential 10
Where 0 < < 1 based on interpolation scheme used. There are different schemes to calculate valve of , which will be covered later on
Substituting values of e , w , n and s in equation B, we get
Ap P = AE E + AW W + AN N + AS S + S V
Ap P = Ai i + S V Required discretized equationwhere,
i = E, W, N, S
AP = Ai
AE= de - (1- e ) Ce
AW= dw +w Cw
AN= dn - (1- n ) Cn
As= ds +s Cs
If velocities in x and y directions are zero then the problem will become a simple conduction or diffusion problem
Confidential 11
Peclet number (Pc) is defined as
dcPc
Peclet number (Pc)
If Pc is based on cell length scale, it is referred as Cell Peclet number. Peclet number (Pc) is measure of relative dominance of convection and diffusion in the transport of
Confidential 12
AssignmentDerive the discretized equation for 2D unsteady convection diffusion problem.Steps:1. Consider unsteady term in the governing equation2. Integrate the governing equation over
w to e s to n and
t to t+t
3.We will get an unsteady term
)(t
) dtdydxt p
n
s
e
w
tt
t
Confidential 13
) dydx
n
s
e
w
OP
OPPP VYXdydx
n
s
e
w
But,
) VOP
OPPP
As we have integrated over t to t+t, other terms will have t in their numerator. Divide the whole equation by t
)tVO
PO
PPP
Finally, discretization equation for 2D unsteady convection diffusion problem.
Ap P = Ai i + S V + )tVO
PO
P
AP = Ai + tVO
P
Confidential 14
Schemes for Discretization
1. Central Difference Scheme
2. Upwind Difference Scheme
3. Exponential Scheme
4. Hybrid Scheme
5. Power Law
6. Second Order UDS
7. QUICK
Confidential 15
Central Difference Scheme
For steady one- dimensional convection diffusion problem without source, the governing differential equation reduces to
For continuity equation
)()(xx
ux
= 1; = 0
0 )u(x
ttanConsu
I
Confidential 16
Integrate the governing equation I over w to e
P EW
Xe
w e
Xw
) )we
we dxd
dxduu
For the convection term, lets assume piecewise-linear profile of
Therefore, )
)WPw
PEe
2121
Assuming that the interfaces are in midway
II
Confidential 17
) ) ) ) ) )
w
WPw
e
PEeWPwPEe XX
uu21
21
Value of can be found out by Harmonic mean
Lets define
Xd
uC
As earlier, C indicated the mass flow rate at the face and d is the diffusion conductance
d always positive, whereas C can be positive or negative depending on the direction of flow
Confidential 18
Ap P = AE E + AW W
WEP
wwW
eeE
AAA
CdA
CdA
2
2
The discretization equation represents the implications of the piecewise-linear profile for . This form of the discretization is known as Central Difference Scheme (CDS)
Required equation
Confidential 19
Upwind Difference Scheme
In the CDS we have difficulty of not satisfying the Scarborough’s criterion. The remedy for such difficulties is the First order Upwind difference Scheme (UDS)
In UDS, the formulation of diffusion term is left unchanged, but the convection term is calculated from the following assumption
The value of at an interface is equal to the value of at the grid point on the upwind side of the face.
Thus,
The value of w can be defined similarly
00
CeifCeif
Ee
Pe
Confidential 20
Lets define a new operator to denote a greater of A and B
For example, if A = 10 and B = 8 then means A
Then upwind scheme implies,
When this is done, discretized equation becomes
where,
B,AB,A
00 ,Ce,CeCe EPe
Ap P = AE E + AW W
WEP
wW
eE
AAA
,CwdA
,CedA
0
0
Required equation
Confidential 21
The Exact Solution
Fortunately, the governing equation I has an exact solution, if we assume as constant.
Lets take a domain as shown in the figure with following boundary conditions
The solution of the equation becomes
where,
Pc is the peclet number
L,LxAt,xAt
00
xL
) 1
1
0
0
PcexpL
xPcexp
L
Confidential 22
Variation of with x can be plotted for different values of Pc as
follows
Pc= 4Pc= 2
Pc= 1Pc= 0
Pc= -1Pc= -2
Pc= -4
x
Pc
Confidential 23
The Power law
Ce,deCe.
,deAe.
0
1010
50
For the power law,
Confidential 24
Second order UDSFor first order UDS, we have assumed
We may assume higher order profiles, such as linear or quadratic to derive a set of upwind weighted higher order schemes
When , we can write a Taylor series expansion up to linear term for in the neighborhood of the upwind point P as
00
CeifCeif
Ee
Pe
0Ce
)
xX
XXX
xXX
Pe
Pe
PePe
2
2
Confidential 25
)
) )
)
)2
44
2
WPPe
Wp
PEWPPe
WE
Xxb
Xxa
Confidential 26
QUICK (Quadratic Upwind Interpolation for Convective Kinetics)
) )
)
)
) )8
24
22
2
!2
22
2
22
2
PWEWEPe
PWE
WE
Pe
PePePe
Xx
Xx
XXX
xXX
xXX
Confidential 27
Overview
• Generalized 2D N-S Equation for • 2D Convection-Diffusion Problem • Discretization Schemes• Example of 2D Convection-Diffusion • Checkerboard Pressure Field• Staggered Grid Approach• Pressure Correction Equation• SIMPLE (Semi Implicit Method for Pressure Linked
Equation)• Types of Mesh and Quality of Mesh
Session-2
Confidential 28
Example of 2D Convection-Diffusion
Ts
To V
L
g
x
y
s
Aim: To obtain equations for velocity and temperature profiles for a liquid film flowing over a hot plate
Assumptions: (1) Fully developed
(2) Steady
(3) Incompressible
Confidential 29
Overview
• Generalized 2D N-S Equation for • 2D Convection-Diffusion Problem • Discretization Schemes• Example of 2D Convection-Diffusion • Checkerboard Pressure Field• Staggered Grid Approach• Pressure Correction Equation• SIMPLE (Semi Implicit Method for Pressure Linked
Equation)• Types of Mesh and Quality of Mesh
Session-3
Confidential 30
Checkerboard Pressure Field
YP EW
S
N
X
V
ws
e
n
• Pressure gradient is really a source term, but let us consider it separately since it is not known a priori
• Consider 2D uniform Cartesian mesh
• Store (tentatively) u, v, P at cell centroids
• This procedure is called co-located grid approachseparatelyconsideredbeTo
xP
i
xBxp
yu
yxu
xvu
yuu
xu
t
)()()()()(
Confidential 31
Checkerboard Pressure Field
ew
e
w
PPdxxP
Integrating pressure gradient term over the control volume in x-direction
• We need pressure on faces, but it is available only on cell centroids
• Interpolating to face:
Confidential 32
Checkerboard Pressure Field
222EWPEWP
ew
e
w
PPPPPPPPdxxP
Thus,
1. The momentum equation contains the pressure difference between two alternate grid points and not between adjacent ones
2. Sometimes if the pressure field is zig - zag, still the momentum equation will feel it as uniform for any grid point P
3. Similar pressure field would be produce for two dimensional case
Confidential 33
Checkerboard Pressure Field
100 300 100 300 100
5 27 5 27 5
10 300 100 300 100
5 27 5 27 5
This type of pattern will produce no pressure force in x or y direction, Thus highly non-uniform field would be treated as uniform pressure field by particular discretized form of momentum equation.
Such pressure distribution is referred as Checkerboard Pressure Field
Confidential 34
Continuity EquationSimilar kind of difficulty arises for the continuity equation
3210 ,,ixu
i
i
0222
WEPWEP
ew
e
w
uuuuuuuudxxu
0 WE uu
Thus, the discretized continuity equation demands the equal velocities at alternate grid points and not at adjacent ones
Confidential 35
Staggered Grid Approach - a Remedy These difficulties in the velocity components and pressure
field must be resolved before formulating a numerical method
We can employ a different grid for each dependent variable
Sometimes it is not beneficial to employ different grid for all the variables
But, in case of velocity component, significant benefit is obtained by using different grids for velocity component and other quantities
This approach is called Staggered grid approach
Confidential 36
Staggered Grid Approach - a Remedy• Store pressure at main cell centroids• Store velocities on staggered control volumes• The control volumes are staggered in such a way that the
velocity components are calculated at the faces of the main control volume
Confidential 37
• Mass flow rates across the control faces can be calculated without any interpolation for the relevant velocity components
• The discretized continuity equation contains the differences of the adjacent velocity components and the wavy velocity field would be prevented
• Pressure difference between two adjacent grid points now becomes the driving force for the velocity component located between these grid points
• Thus, non uniform pressure field will no longer be treated as uniform field in staggered grid approach
Advantages of Staggered Grid Approach
Confidential 38
Nomenclature of Staggered Grid
YP EW
S
N
X
V
w
s
e
n
nn nne
Ne
ne
se
Se
ssess
nnE
NE
nE
ee
nwnW CV for ue velocity
CV for vn velocity
CV for Pressure
Confidential 39
Discretized equation for u component of velocity
Ae ue = Aeeuee + Aw uw + ANe uNe + ASeuSe + (PP – PE )Areae
+SuV
Ae ue = Ai ui + (PP – PE )Areae +Su V
where,
i = ee, w, Ne, Se• Areae is the area on which pressure difference acts (Here it is
given by Yx1)• The source term Su does not contain pressure gradient term as
we have considered it separately
Confidential 40
Discretized equation for v component of velocity
An vn = Annvnn + As vs + AnE vnE + AnWvnW + (PP – PN )Arean
+SvV
An vn = Ai vi + (PP – PN )Arean +Sv V
where,
i = nn, s, nE, sW• Arean is the area on which pressure difference acts (Here it is
given by Xx1)• The source term Sv does not contain pressure gradient term as
we have considered it separately
Confidential 41
• For three dimensional case, similar equation for w velocity can be written
• Unless the correct pressure field is obtained, the resulting velocities from the solution of above equations do not satisfy continuity equation
• The pressure field is not known a priori. Thus, at the start of the solution, we have to guess a pressure field
• Lets called the guessed pressure as P* and the velocities, thus, obtained as u*, v*, w*
• These “starred” velocity field will result from solution of following discretized equations
Pressure and velocity correction
Confidential 42
Ae u*e = Ai u*i + (P*P – P*E )Areae +Su V
An v*n = Ai v*i + (P*P – P*N )Arean +Sv V
Pressure and velocity correction
• Our aim is to find a way of improving the guessed pressure P* such that the resulting starred velocities will progressively get closer to satisfy the continuity equation
• Lets say that the correct pressure is
P = P* + P’where, P’ is the pressure correction
• Similar corrections can be introduced for the velocity components
u = u* + u’ v = v* + v’
Confidential 43
• If we subtract the discretized equation of “starred” quantities from the discretised equation of absolute quantities, the resulting equation for the “primed” quantities would be
• At the convergence, the u’ will approach to zero• Thus, for the time being we may drop the term Ai u’i
Therefore,
Pressure and velocity correction
Ae u’e = Ai u’i + (P’P – P’E )Areae
An v’n = Ai v’i + (P’P – P’N )Arean
Ae u’e = (P’P – P’E )Areae
u’e = (P’P – P’E )Areae/ Ae
Confidential 44
ue = ue* + ue’
= ue* +
Pressure and velocity correction
(P’P – P’E )Areae/ Ae
• Thus, the “starred” velocities are to be corrected by the correction in the pressure to produce the absolute velocities
• Now, we shall obtain the discretized equation for the pressure correction, P’
vn = vn* + vn’
= vn* + (P’P – P’N )Arean/ An
Confidential 45
The Pressure-correction equation
• The pressure - correction equation is obtained from the continuity equation
• Assumptions areDensity is not dependent on pressureDensity is uniform over the control volumeVelocities are uniform over the faces of the control volume
• The continuity equation in 2D form is
0)()(
yv
xu
t
Confidential 46
The Pressure-correction equation
P E
N
S
Wueuw
vn
vs
0)()(
dydxdtyvdydxdt
xudydxdt
t
tt
t
e
w
n
s
tt
t
e
w
n
s
tt
t
e
w
n
s
Integrate the governing equation over
w to e s to n andt to t+t
Confidential 47
) ) ) ) ) 0
XvvYuut
YXsnwe
Po
P
)''*EP
e
eee PP
AAreauu )''*
PWw
www PP
AAreauu
)''*NP
n
nnn PP
AAreavv )''*
PSs
sss PP
AAreavv
Substituting,
Confidential 48
) ) )
) ) 0''''
''''
**
**
PSs
sssNP
n
nnn
PWw
wwwEP
e
eee
Po
P
PPA
AreavXPPA
AreavX
PPA
AreauYPPA
AreauYt
V
) ****' ssnnwwee
PPo
P XvXvYuYut
VS
Let,
) )
) ) '''''
''''
PPSs
ssNP
n
nn
PWw
wwEP
e
ee
SPPA
AreaXPPA
AreaX
PPA
AreaYPPA
AreaY
Therefore,
Confidential 49
'''''
'
PSs
ssN
n
nnW
w
wwE
e
ee
Ps
ss
n
nn
w
ww
e
ee
SPA
AreaXPA
AreaXPA
AreaYPA
AreaY
PA
AreaXA
AreaXA
AreaYA
AreaY
Collecting coefficients,
SNWEP
s
ssS
n
nnN
w
wwW
e
eeE
AAAAAA
AreaXA
AAreaXA
AAreaYA
AAreaYA
Lets define,
Confidential 50
'''''' PSSNNWWEEPP SPAPAPAPAPA Required Equation for Pressure Correction
Since the density is normally available at main control volume, the interface densities may be calculated by any interpolation scheme
The term in the pressure correction equation represents the discretized continuity equation in terms for starred velocities
If is zero, it means that the starred velocities along with the available value of do satisfy the continuity equation and no pressure correction is needed
)snwe ,,,
'PS
'PS )PP
o
Confidential 51
Overview
• Generalized 2D N-S Equation for • 2D Convection-Diffusion Problem • Discretization Schemes• Example of 2D Convection-Diffusion • Checkerboard Pressure Field• Staggered Grid Approach• Pressure Correction Equation• SIMPLE (Semi Implicit Method for Pressure Linked
Equation)• Types of Mesh and Quality of Mesh
Session-4
Confidential 52
Semi Implicit Method for Pressure Linked Equation(SIMPLE)
1. Guess the pressure field P*2. Solve the momentum equation to obtain u*, v*, w*3. Solve the equation for P’4. Calculate P by adding P’ in P*5. Calculate the u and v from their starred values and their
corrections6. Solve the discretized equations for the other variables like
temperature, turbulence, species concentrations, etc if these quantities affect the flow field (the equations for variables, which do not affect the flow field can be solved once the converged solution for the flow is obtained)
The SIMPLE Algorithm
Confidential 53
7. Treat the corrected pressure as guessed pressure P* and return to step 2 and repeat the whole procedure until the converged solution is obtained
The words Semi-Implicit in the name SIMPLE is used to acknowledge the omission of the term Ai u’i. This term represents an indirect or implicit influence of the pressure correction on velocity; pressure correction at the nearby locations can alter the neighboring velocities and thus cause the velocity correction at the point under consideration. We do not include this influence and thus work with scheme that is only partially and not totally implicit (Semi-Implicit)
The SIMPLE Algorithm
Confidential 54
Types of Mesh
Regular and body-fitted meshes (Orthogonal Mesh)
Stair-stepped representation of complex geometry
Confidential 55
Types of Mesh
Non-conformal mesh
Hybrid mesh
Confidential 56
Cell shapes
a: Triangle, b: tetrahedron, c: quadrilateral
d: Hexahedron, e: Prism and f: Pyramid
Confidential 57
Thank you!