Vous êtes sur la page 1sur 57

Confidential 1

Computational Fluid Dynamics


2D Convection- Diffusion Problems
Pravin Nakod
Fluent India
pmn@fluent.co.in
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 |
|
+
c
| c
I
c
c
+
c
| c
I
c
c
= |
c
c
+ |
c
c
+ |
c
c
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 |
x
B
x
p
+
c
c

y
B
y
p
+
c
c

Pr

|
|
.
|

\
|
c
c
+
c
c
| + | + +
y
p
v
x
p
u T Qrad Qch
Cp
v
1
Sc

Sr No Equation |

I

S
|


1 Bulk Mass
Conservation
1 0 0
2 X -
Momentum
u
3 Y -
Momentum
v
4 Energy T
5 Species
Conservation
e
j
Rj
Confidential 5
2D Convection-Diffusion Problem
Assumptions:
1) AX = AY
2) Mesh is uniform
3) Flow is steady

|
+
c
| c
I
c
c
+
c
| c
I
c
c
= |
c
c
+ |
c
c
S )
y
(
y
)
x
(
x
) v (
y
) u (
x
Governing equation:
AY
P E W
S
N
AX
V
w
s
e
n
Confidential 6
|
=
c
| c
I |
c
c
+
c
| c
I |
c
c
S )
y
v (
y
)
x
u (
x
Lets define
( )
|
=
c
c
S q
x
i
x
i
i
i x
x
u q
i
c
| c
I |
I = 1, 2
Integrating over control volume
from w to e and
from s to n
Confidential 7
( )
} } } }
|
=
c
c
n
s
e
w
P x
n
s
e
w
i
dy dx S dy dx q
x
i
Assuming quantities are uniform at cell faces
( ) ( ) Y X S X q q Y q q
s y e n w x e x
A A | = A + A
AX AY = volume of the cell = AV
Lets define
e e
u Y Ce A
w w
u Y Cw A
n n
u X Cn A
s s
u X Cs A
These quantities represent mass flow rate at the cell faces
A
Confidential 8
Lets also define
X
Y
de
e
A
A I

X
Y
dw
w
A
A I

Y
X
dn
n
A
A I

Y
X
ds
s
A
A I

X x
P E
e
A
| |
=
c
| c
Disretization gives
Equation A reduces to
( ) | | ( ) | | ( ) | | ( ) | | V S ds Cs dn Cn dw Cw de Ce
s P s P N n W P w P E e
A = | | | | | | + | | | | | |
|
B
Confidential 9
For Bulk mass conservation
|= 1; I = 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
A
p
|
P
= A
E
|
E
+ A
W
|
W
+ A
N
|
N
+ A
S
|
S
+S| AV
A
p
|
P
= E A
i
|
i
+S| AV Required discretized equation
where,
i = E, W, N, S
A
P
=E A
i

A
E
=de - (1- +
e
) Ce
A
W
=dw ++
w
Cw
A
N
=dn - (1- +
n
) Cn
A
s
=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
d
c
Pc =
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
Assignment
Derive the discretized equation for 2D unsteady convection
diffusion problem.
Steps:
1. Consider unsteady term in the governing equation
2. Integrate the governing equation over
w to e
s to n and
t to t+At
3.We will get an unsteady term

) (
t
|
c
c
( ) dt dy dx
t
p
n
s
e
w
t t
t
} } }
A +
|
c
c
Confidential 13

( ) dy dx
n
s
e
w
O
P
O
P P P
} }
| | =
V Y X dy dx
n
s
e
w
A = A A =
} }
But,
( ) V
O
P
O
P P P
A | | =
As we have integrated over t to t+At, other terms will have At in their numerator.
Divide the whole equation by At
( )
t
V
O
P
O
P P P
A
A
| | =
Finally, discretization equation for 2D unsteady convection diffusion problem.
A
p
|
P
= E A
i
|
i
+S| AV + ( )
t
V
O
P
O
P
A
A
|
A
P
=E A
i
+
t
V
O
P
A
A

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
) ( ) (
x x
u
x c
c
I
c
c
=
c
c |
|
| = 1; I = 0
0 =
c
c
) u (
x
t tan Cons u =
I
Confidential 16
Integrate the governing equation I over w to e
P E W
AX
e
w
e
AX
w
( ) ( )
w e
w e
dx
d
dx
d
u u
|
.
|

\
|
|
I
|
.
|

\
|
|
I = | |
For the convection term, lets assume piecewise-linear profile of |
Therefore,
( )
( )
W P w
P E e
| + | = |
| + | = |
2
1
2
1
Assuming that the interfaces
are in midway
II
Confidential 17
( ) ( ) ( ) ( )
( ) ( )
|
|
.
|

\
|
A
| |
I
|
|
.
|

\
|
A
| |
I = | + | | + |
w
W P
w
e
P E
e W P w P E e
X X
u u
2
1
2
1
Value of I can be found out by Harmonic mean
Lets define
X
d
u C
A
I


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
A
p
|
P
= A
E
|
E
+ A
W
|
W
W E P
w
w W
e
e E
A A A
C
d A
C
d A
+ =
+ =
=
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 Scarboroughs
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


0
0
( | = |
) | = |
Ce if
Ce if
E e
P e
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 , A
B , A
0 0 , Ce , Ce Ce
E P e
| | = |
A
p
|
P
= A
E
|
E
+ A
W
|
W
W E P
w W
e E
A A A
, Cw d A
, Ce d A
+ =
+ =
+ =
0
0
Required equation
Confidential 21
The Exact Solution
Fortunately, the governing equation I has an exact solution, if we
assume I 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
, L x At
, x At
| = | =
| = | =
0
0
x
L
( ) 1
1
0
0

|
.
|

\
|
=
| |
| |
Pc exp
L
x Pc
exp
L
Confidential 22
Variation of | with x can be plotted for different values of Pc as
follows
Pc= 4
Pc= 2
Pc= 1
Pc= 0
Pc= -1
Pc= -2
Pc= -4
|
x
Pc
|
Confidential 23
The Power law
Ce ,
de
Ce .
, de Ae
.
+
|
|
.
|

\
|
= 0
1 0
1 0
5 0
For the power law,

Confidential 24
Second order UDS
For 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


0
0
( =
) =
Ce if
Ce if
E e
P e
| |
| |
0 > Ce
( )
x
X
X
X X
x
X X
P e
P e
P e P e
c
c
|
.
|

\
|
A
+ =
|
.
|

\
|
A
+ =
c
c
+ =
|
| |
|
| |
2
2
Confidential 25
( )
( ) ( )
( )
( )
2
4 4
2
W P
P e
W p
P E W P
P e
W E
X x
b
X x
a
| |
| |
| |
|
| | | |
| |
| | |

+ =
A

=
c
c

+ =
A

=
c
c
Confidential 26
QUICK
(Quadratic Upwind Interpolation for Convective Kinetics)
( )
( )
( )
( )
( ) ( )
8
2
4
2
2
2
! 2
2 2
2
2
2
2
P W E W E
P e
P W E
W E
P e
P e
P e P e
X x
X x
X
X X
x
X X
x
X X
| | | | |
| |
| | | |
| | |
| |
| |
+

+ =
A
+
=
c
c
A

=
c
c
|
.
|

\
|
A
+ =
c
c
+
c
c
+ =
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
u
g
x
y
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
AY
P E W
S
N
AX
V
w
s
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 approach
separately considered be To
x
P
i
=
c
c

x
B
x
p
y
u
y x
u
x
vu
y
uu
x
u
t
+
c
c

c
c
c
c
+
c
c
c
c
=
c
c
+
c
c
+
c
c
) ( ) ( ) ( ) ( ) (
Confidential 31
Checkerboard Pressure Field
e w
e
w
P P dx
x
P
=
c
c

}
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
2 2 2
E W P E W P
e w
e
w
P P P P P P
P P dx
x
P
=
+

+
= =
c
c

}
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 Equation
Similar kind of difficulty arises for the continuity equation
3 2 1 0 , , i
x
u
i
i
= =
c
c
0
2 2 2
=

=
+

+
= =
c
c
}
W E P W E P
e w
e
w
u u u u u u
u u dx
x
u
0 =
W E
u u
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
AY
P E W
S
N
AX
V
w
s
e
n
nn
nne
Ne
ne
se
Se
sse ss
nnE
NE
nE
ee
nw nW
CV for u
e
velocity
CV for v
n
velocity
CV for Pressure
Confidential 39
Discretized equation for u component of velocity
A
e
u
e
= A
ee
u
ee
+ A
w
u
w
+ A
Ne
u
Ne
+ A
Se
u
Se
+(P
P
P
E
)Area
e
+S
u
AV
A
e
u
e
= E A
i
u
i
+(P
P
P
E
)Area
e
+S
u
AV
where,
i = ee, w, Ne, Se
Area
e
is the area on which pressure difference acts (Here it is
given by AYx1)
The source term S
u
does not contain pressure gradient term as
we have considered it separately
Confidential 40
Discretized equation for v component of velocity
A
n
v
n
= A
nn
v
nn
+ A
s
v
s
+ A
nE
v
nE
+ A
nW
v
nW
+(P
P
P
N
)Area
n
+S
v
AV
A
n
v
n
= E A
i
v
i
+(P
P
P
N
)Area
n
+S
v
AV
where,
i = nn, s, nE, sW
Area
n
is the area on which pressure difference acts (Here it is
given by AXx1)
The source term S
v
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
A
e
u*
e
= E A
i
u*
i
+(P*
P
P*
E
)Area
e
+S
u
AV
A
n
v*
n
= E A
i
v*
i
+(P*
P
P*
N
)Area
n
+S
v
AV

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 E A
i
u
i

Therefore,


Pressure and velocity correction
A
e
u
e
= E A
i
u
i
+(P
P
P
E
)Area
e

A
n
v
n
= E A
i
v
i
+(P
P
P
N
)Area
n


A
e
u
e
= (P
P
P
E
)Area
e

u
e
= (P
P
P
E
)Area
e
/ A
e



Confidential 44
u
e
= u
e
* + u
e

= u
e
* +


Pressure and velocity correction
(P
P
P
E
)Area
e
/ A
e
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
v
n
= v
n
* + v
n

= v
n
* +


(P
P
P
N
)Area
n
/ A
n
Confidential 45
The Pressure-correction equation
The pressure - correction equation is obtained from
the continuity equation
Assumptions are
Density is not dependent on pressure
Density is uniform over the control volume
Velocities are uniform over the faces of the control volume
The continuity equation in 2D form is

0
) ( ) (
=
c
c
+
c
c
+
c
c
y
v
x
u
t

Confidential 46
The Pressure-correction equation
P
E
N
S
W
u
e
u
w
v
n
v
s
0
) ( ) (
=
c
c
+
c
c
+
c
c
} } } } } } } } }
A + A + A +
dy dx dt
y
v
dy dx dt
x
u
dy dx dt
t
t t
t
e
w
n
s
t t
t
e
w
n
s
t t
t
e
w
n
s

Integrate the governing
equation over
w to e
s to n and
t to t+At
Confidential 47
( )
( ) ( ) | | ( ) ( ) | | 0 = A + A +
A
A A
X v v Y u u
t
Y X
s n w e
P
o
P


( ) ' '
*
E P
e
e
e e
P P
A
Area
u u + = ( ) ' '
*
P W
w
w
w w
P P
A
Area
u u + =
( ) ' '
*
N P
n
n
n n
P P
A
Area
v v + =
( ) ' '
*
P S
s
s
s s
P P
A
Area
v v + =
Substituting,
Confidential 48
( )
( ) ( )
( ) ( ) 0 ' ' ' '
' ' ' '
* *
* *
=
(

+ A
(

+ A +
(

+ A
(

+ A +
A
A
P S
s
s
s s N P
n
n
n n
P W
w
w
w w E P
e
e
e e
P
o
P
P P
A
Area
v X P P
A
Area
v X
P P
A
Area
u Y P P
A
Area
u Y
t
V



( )
* * * *
' s s n n w w e e
P
P
o
P
Xv Xv Yu Yu
t
V
S A + A A + A
A
A
=

Let,
( ) ( )
( ) ( )
'
' ' ' '
' ' ' '
P P S
s
s
s N P
n
n
n
P W
w
w
w E P
e
e
e
S P P
A
Area
X P P
A
Area
X
P P
A
Area
Y P P
A
Area
Y
= A A +
A A


Therefore,
Confidential 49
| | | | | | | |
'
' ' ' '
'
P S
s
s
s N
n
n
n W
w
w
w E
e
e
e
P
s
s
s
n
n
n
w
w
w
e
e
e
S P
A
Area
X P
A
Area
X P
A
Area
Y P
A
Area
Y
P
A
Area
X
A
Area
X
A
Area
Y
A
Area
Y
+ A + A + A + A =
(

A + A + A + A


Collecting coefficients,
S N W E P
s
s
s S
n
n
n N
w
w
w W
e
e
e E
A A A A A
A
Area
X A
A
Area
X A
A
Area
Y A
A
Area
Y A
+ + +
A
A
A
A

Lets define,
Confidential 50
'
' ' ' ' '
P S S N N W W E E P P
S P A P A P A P A P A + + + + =
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

( )
s n w e
, , ,
' P
S
' P
S
( )
P
P
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
corrections
6. 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 E A
i
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!

Vous aimerez peut-être aussi