You are on page 1of 47

Chapter 11:

Unstructured Grids

Ibrahim Sezai
Department of Mechanical Engineering
Eastern Mediterranean University

Fall 2015-2016

Introduction
When the solution domain is not rectangular Cartesian grids
cannot be used.
When the boundary does not coincide with the co-ordinate
lines we can use stepwise approximation near the boundary.

Such an approximation is tedious and time consuming.


Introduces errors in the computation of wall shear stresses
and heat transfer.
Cells in the solid cylinder do not take part in the
calculations  waste of computer storage.
ME555 : Computational Fluid Dynamics 2 I. Sezai – Eastern Mediterranean University

1
Body fitted grids
CFD methods for complex geometries:
1. Structured curvilinear grids (body fitted grids)
2. Unstructured grids
Structured curvilinear grids are based on mapping of the
flow domain onto a computational domain.
It is very difficult to find viable mappings when the
geometry is complex.
In such cases the domain may be sub-divided into several
sub-regions or blocks.  Block structured grids.
For the most complex geometries unstructured grids are
used.
Most commercial packages use unstructured grids.
ME555 : Computational Fluid Dynamics 3 I. Sezai – Eastern Mediterranean University

Body fitted grids

An example of an
orthogonal curvilinear mesh
for calculating flow around
an aerofoil

Use of a non-orthogonal
body-fitted grid
arrangement for the
prediction of flow over
a half-cylinder

ME555 : Computational Fluid Dynamics 4 I. Sezai – Eastern Mediterranean University

2
Cartesian vs. curvilinear grids
Flow over a heat
exchanger tube bank Body fitted grids give
(only a part shown)  better results with no
waste of grids

(a) Cartesian grid using an approximated (a) Non-orthogonal body-fitted grid for the
profile to represent cylindrical surfaces; same problem;
(b) predicted flow pattern using a 40 X 15 (b) predicted flow pattern using a 40 X 15
Cartesian grid structured body-fitted grid
ME555 : Computational Fluid Dynamics 5 I. Sezai – Eastern Mediterranean University

Curvilinear grids - Difficulties


The governing equations in curvilinear co-ordinate system are much
more complex. The equations in 2-D are:
 
Continuity  U    V   0 (11.1)
 
(u)  
x-momentum J
t

 
 Uu   Jg 11u  
 
 Vu   Jg 22u  (11.2)
p p  
  y  y     Jg u  
12
   Jg u   JSu
12

     
 (  υ)  
y-momentum J
t

 
 Uυ   Jg 11υ  
 
 Vυ   Jg 22 υ  (11.3)
p p  
  x  x     Jg 12 υ      Jg 12 υ   JS υ
     

 g12  ( x x  y y ) / J 2 η

 g  ( x  y ) / J
11 2 2 2
Metric coefficients 
 g 22  ( x2  y2 ) / J 2

Jacobian of transformation J  x y  x y
ξ
Contravariant velocities U  y u  x υ V  x υ  y u
ME555 : Computational Fluid Dynamics 6 I. Sezai – Eastern Mediterranean University

3
Curvilinear grids - difficulties
Body-fitted grids are structured, so grid refinement
is generally not local.

The refinement needed to resolve the boundary


layers persists in the interior mesh, which represents
a waste of computer storage.
ME555 : Computational Fluid Dynamics 7 I. Sezai – Eastern Mediterranean University

Curvilinear grids - difficulties


To generate curvilinear meshes it is necessary to map the
physical geometry into a computational geometry.

Mapping of physical
geometry to
computational (a) physical grid in x-y co-ordinates
geometry in
structured meshes.

Mapping may be a tedious


task if the domain is more
complex. (b) the mapped structure for (a) in
the computational domain
ME555 : Computational Fluid Dynamics 8 I. Sezai – Eastern Mediterranean University

4
Curvilinear grids - difficulties
For complex geometries structured grid generation may be
very difficult resulting in skewed cells, which can lead to
stability problems for CFD solvers.

A structured non-orthogonal mesh for a pent-roof i.c. engine geometry

ME555 : Computational Fluid Dynamics 9 I. Sezai – Eastern Mediterranean University

Curvilinear grids - difficulties


Problems encountered with structured grids:
Still difficult and time consuming to generate
If the geometry cannot be readily mapped into a
rectangle (in 2D) or parallellepiped (3D) this can
result in skewed grid lines.
Unnecessary grid resolutions can result when
mapping is difficult
Mapping is sometimes impossible with complex 3D
geometries with internal objects/parts.

ME555 : Computational Fluid Dynamics 10 I. Sezai – Eastern Mediterranean University

5
Block-structured grids
In block-structured grids the domain is sub-divided into
regions, each of which has a structured mesh.
Such meshes are more flexible than (single block)
structured meshes.
The block structured approach allows the use of fine grids
in regions where greater resolution is required.

ME555 : Computational Fluid Dynamics 11 I. Sezai – Eastern Mediterranean University

Block-structured grids

Block-structured mesh arrangement for an engine geometry,


including inlet and exhaust ports, used in engine simulations with
KIVA-3V
ME555 : Computational Fluid Dynamics 12 I. Sezai – Eastern Mediterranean University

6
Unstructured grids
There is no implicit structure of co-ordinate lines in
unstructured grids.
The mesh can easily be concentrated where necessary
without wasting computer storage.
Control volumes can be of any shape.

ME555 : Computational Fluid Dynamics 13 I. Sezai – Eastern Mediterranean University

Unstructured grids
A mixture of different cell shapes can be used.

Unstructured mesh generation is fairly


straightforward.
Complex domains can be meshed.
Mesh refinement and adaption (in regions with high
gradients) are much more easier.
ME555 : Computational Fluid Dynamics 14 I. Sezai – Eastern Mediterranean University

7
Discretisation in unstructured grids
There are two ways of defining CV’s in
unstructured grids:
1. Cell-centered control volumes
2. Vertex-centered control volumes.

(a) cell-centred control volumes (b) vertex-centred control volumes

We will use cell-centered method.


ME555 : Computational Fluid Dynamics 15 I. Sezai – Eastern Mediterranean University

Discretisation in unstructured grids


The general transport equation (2.39) is
 (  )
 div(  v )  div( grad  )  s (11.4)
t
Integrating Eq. (11.4) over a 3-D control volume
 (  )
CV t dV  CV div(  v)dV CV div( grad  )dV  CV s dV (11.5)

For a vector a Gauss’ divergence theorem states


 div adV  n  adA
CV A
(11.6)
n.a  component of vector a in the direction of the outward unit
vector n normal to infinitesimal surface element dA.

ME555 : Computational Fluid Dynamics 16 I. Sezai – Eastern Mediterranean University

8
Discretisation in unstructured grids
Application of Gauss’ divergence theorem to equation (11.4) gives
 
   dV    n  (  v )dA   n  ( grad  )dA   s dV (11.7)
t  CV  A A CV

Using A =An, where A = Axi+Ayj+Azk, A = |A| = ( Ax2  Ay2  Az2 )1/ 2


n = nxi+nyj+nzk (unit vector normal to surface)
A = surface area vector
A = magnitude of the surface area

 
   dV    (  v )  dA   ( grad  )  dA   s dV (11.8)
t  CV
   A
  
A


CV

Transient term Convection term Diffusion term Source term

Let us discretize each term separately

ME555 : Computational Fluid Dynamics 17 I. Sezai – Eastern Mediterranean University

Transient term
Using first order time derivative,
  ( V ) P  ( V )oP
   dV  
N2
f2
t  CV  t N1
N3 P f1
f3

Superscript o refers to previous time step


f 4

Terms with no superscript refer to present N 4

time.
Cell volume VP can be calculated by applying Gauss theorem on the
identity 1 = div(xi):
V   dV   div( xi )dV   xi  ndA   x f Afx (11.9)
V V A
f
f → refers to cell faces. For the cell of node P the summation is
over the faces f1, f2, f3 and f4.
Afx  x-component of the cell face surface vector.
xf = x-component of the position vector of the center of face f
ME555 : Computational Fluid Dynamics 18 I. Sezai – Eastern Mediterranean University

9
Volumes and surface areas
A f  Af n  Afx i  Afy j  Afz k (11.10)
Instead of xi, one can also use yj or zk, that is:
V   y f Afy  z f Afz (11.11)
f f

ME555 : Computational Fluid Dynamics 19 I. Sezai – Eastern Mediterranean University

Surface areas
A1
Consider the cell of node P. Let the top v4 v3
surface be f1 with vertices v1,v2,v3,v4,v5.
v5
f1
Calculation of area of surface f1: v2

Decompose the surface f1 into triangles v1

with one common vertex. For example


choose common vertex to be v1.
The surface normal vector of the whole cell face f1 is
the sum of the surface vectors of all triangles.
1 Nv
A1    ri 1  r1    ri  r1 
2 i 3 
(11.12)
Nv = number of vertices in the cell face (5 vertices for face f1)
ri = position vector of vertex i
Note that there are (Nv – 2) triangles. Also note that the numbering of
the vertices is counter-clockwise when looking from outside the cell.
ME555 : Computational Fluid Dynamics 20 I. Sezai – Eastern Mediterranean University

10
The cell face center can be found by averaging the
coordinates of the vertices of the face.
Nv
1
( xc ) f 
Nv
x
i 1
i
(11.13)
Nv
1
( yc ) f 
Nv
y
i 1
i
(11.14)

Nv
1
( zc ) f 
Nv
z
i 1
i (11.15)

ME555 : Computational Fluid Dynamics 21 I. Sezai – Eastern Mediterranean University

Diffusion term
The diffusion term is approximated as

 ( grad  )  dA    f  f .A f
N2
(11.17) f2
N1
A f  nb ( P ) N3 P f1
f3
where the summation is over the faces of a
cell. (over the faces f1, f2, f4, f4 for cell P in f4
N4
the figure).
Define: PN = rN – rP (11.18)
Af
rP , rN: position vector of
centroids of cells P and N et n
ePN θ
ePN : unit vector along line PN P f PN N
n: unit normal vector of surface f
Af: surface area vector
We wish to approximate the diffusive flux D f   f  f  A f at the
surface
ME555 : Computational Fluid Dynamics 22 I. Sezai – Eastern Mediterranean University

11
Diffusion term
The gradient expression should involve Af
At

centroids P and N of the cells. et n


θ
ePN
PN
By definition e PN  d PN  PN (11.19) P f N Ad
d PN
The gradient in the direction of e can be written as
 f   P
 f .e PN   N (11.20)
ePN d PN
If the surface vector Af is written as the sum of two vectors Ad and At
A f  A d  At (11.21)
where Ad is in the direction of line PN, then
 f .A f   f .A d   f .A t  A d  f .e PN   f .A t (11.22)
  P
 f .A f  A d N   f .A t (11.23)
d 
 

PN
non-orthogonal
orthogonal term (cross diffusion) term

Cross diffusion term is treated as source term.


ME555 : Computational Fluid Dynamics 23 I. Sezai – Eastern Mediterranean University

Diffusion term
Several options can be used in defining the direction of At.
Af Af Af
At At At
et n et n et n
ePN θ ePN θ ePN θ

P f N Ad P f N Ad P f N Ad

(a) Minimum correction (b) Orthogonal correction (c) overrelaxed correction


(a) Set At to be perpendicular to Ad (minimum correction).
A d  Af cos  e PN  ( A f .e PN )e PN (11.24)
A t  A f  A d  Af (n  cos  e PN )  A f  ( A f .e PN )e PN (11.25)
(b) Set At such that |Ad| is equal to |Af| (orthogonal correction).
A d  A f e PN A t  A f  A d  Af (n  e PN ) (11.26)
(c) Set At to be parallel to et (overrelaxed correction).
Af Af Af (11.27)
Ad  e PN  e PN
cos  A f  e PN
Af Af Af (11.28)
At  A f  A d  A f  e PN  A f  e PN
cos  A f  e PN
ME555 : Computational Fluid Dynamics 24 I. Sezai – Eastern Mediterranean University

12
Diffusion term
Substituting the terms in Eq.(11.28) for the overrelaxed approach into Eq. (11. 23)

  P
 f .A f  Ad N     f .A t (11.29)
d PN  
 non-orthogonal
orthogonal term (cross diffusion) term
Af Af
where Ad  A d  A t  A f  Ad e PN
A f  e PN
The overbar term in Eq. (11.29) is obtained via linear interpolation from the
adjacent nodal values:

 f  (1  f P )P  f P N (11.30)


Pf Pf  e PN Pf  e PN Linear interpolation
fP  or preferably: f P  
 PN  PN  factor
1/2
PN PN
A more accurate approximation is to use Eq. (11.33)
Note that Ad is the magnitude of area vector Ad. Also note that Ad is in the direction
of PN and At is perpendicular to Af.
ME555 : Computational Fluid Dynamics 25 I. Sezai – Eastern Mediterranean University

Gradient at a Cell Face


Gradient vector of a variable  at a cell face can be decomposed into two components
along directions d and t, where d is along PN and t is tangential (perpendicular) to d.
 f   d  f   t  f (11.31)  
 f  
 t f  
ePN f
 N '  P '  N  P P' N' 
 f 
d
e PN  e PN  f
d
 
rPN rPN P N 
(N  P )  PP '
 e PN (11.32a)
rPN
where P '  P  P  PP ', N '  N  N  NN ', NN '  PP '
  f  ( f e PN )e PN
d

t f   f   d  f   f  ( f e PN )e PN (11.32b)


Substituting Eq. (11.32a) and (11.32b) into Eq. (11.31),
 N  P (N  P )  PP '
 f  e PN   f  ( f  e PN )e PN  e PN (11.33)
rPN rPN
 f is obtained via linear interpolation from adjacent nodal values using Eq. (11.30)
ME555 : Computational Fluid Dynamics 26 I. Sezai – Eastern Mediterranean University

13
Diffusion term
Orthogonal term is treated implicitly, whereas the cross
diffusion term is treated as a source term in a deferred
correction approach.
Overrelaxed approach (method (c)) is preferred, because
the coefficient of the implicit term is greater than that of
methods (a) and (b), and it increases with the skew angle θ.
Thus, the diagonal dominance of the coefficient matrix is
enhanced.

ME555 : Computational Fluid Dynamics 27 I. Sezai – Eastern Mediterranean University

Correction for the Diffusion Term


If line PN does not pass through the face center, then a correction is needed for
diffusion flux for higher accuracy.
 f .A f   f .A d   f .A t Af At
et n
 A d  f .e PN   f .A t P'
f θ N' β
Ad
P N
N '  P ' ePN fo f1

 Ad   f .A t
d PN
using P '  P  P  PP ', N '  N  N  NN ', NN '  PP '
 N  P (N  P )  PP '
 f .A f  Ad   f .A t  Ad (11.34)
d d PN
PN  
orthogonal term non-orthogonal
(cross diffusion term)
fο f Af Ad
where PP '  f1f et , sin =   f1f  fo f ,
f1 f Ad Af
Ad Af Af
fo f  Pf  Pfo  Pf  (Pf  e PN )ePN , 
d PN A f  PN
ME555 : Computational Fluid Dynamics 28 I. Sezai – Eastern Mediterranean University

14
Calculation of Gradients
Calculation of Gradient at Nodal Points
An expression is required to calculate gradient at points P and N in equation
(11.29). One popular method is to use Gauss’ rule as:
nf
1 1 1
 P  v
V V s
 dV   dA  V  f 1
f Af (11.31)
f2
N2
P
where f is calculated from N3 f1
N1
P
f3 rNf
 f   f   f fof
o o
(11.32) rPf

f4
where
Pf  e PN N4
 f  (1  f P )P  f PN , fP 
 PN  PN 
o 1/2

 fo  (1  f P )P  f P N f
P N
fof  Pf  Pfo  Pf  (Pf  e PN )e PN
ePN f
o
An iterative process is required to calculate gradients:
Step 1: Calculate gradient from Eq. (11.31)
Step 2: Calculate f from Eq. (11.32)
Step 3: Repeat steps 1 and 2 until convergence. (4-5 repetitions required )
ME555 : Computational Fluid Dynamics 29 I. Sezai – Eastern Mediterranean University

Diffusion source term


Note that in the general transport equation (11.4), only part of the
diffusion term appears explicitly. The other part is buried in the source
term:
 (  )
 div(  v )  div( grad  )  s
t
For example, in the x-momentum equation (2.32a) the diffusion term is
  u     u v      v w  
 2   div u              
x  x  y   y x   z   z x  
  u    u    u  div(  grad u )
      
x  x  y  y  z  z 
   u    v    w   
          ( div u)
sMx
 x  x  y  x  z  x   x
 div(  grad u )  sMx

For incompressible fluids divu = 0. If further, μ = constant, then sMx = 0


(from discussion just after equation (2.34)).
ME555 : Computational Fluid Dynamics 30 I. Sezai – Eastern Mediterranean University

15
Diffusion source term
However, sometimes μ may be a function of temperature. Morever, in the momentum
equations of turbulence models, μ is replaced by (μ + μt), where μt is the turbulent
viscosity, which is not constant at all. For those cases, sMx will not be zero.
The source term sMx can be expressed in vector form as
sMx  div(  gradu  i )  div(  x u)
  
where  x is the x-component of the gradient operator   i  j  k
and u  ui  vj  wk is the velocity vector. x y z
Integrating over the control volume gives:
Sudiff   div(  u)dV   ( u)  ndA   (  x u ) f Afx  (  x v) f Afy  (  x w) f Afz
x x

CV S f  nb ( P )

Similarly, the corresponding terms for the y- and z-momentum equations are
Svdiff   div( u)dV   ( u)  ndA   (  y u ) f Afx  (  y v) f Afy  (  y w) f Afz
y y

CV S f  nb ( P )

  div(  u)dV   ( u)  ndA   (  z u ) f A fx  (  z v) f Afy  (  z w) f Afz


diff z z
S w
CV S f  nb ( P )
(11.33)
The gradients u , v and w at the nodal points are found using Gauss rule
(eqn.(11.31) and their face values are found via linear interpolation using eqn. (11.30).
ME555 : Computational Fluid Dynamics 31 I. Sezai – Eastern Mediterranean University

Convection term
The convection term is approximated as
n fP n fP N2

 (  v)  dA   (  v  A) f  f   m f  f
f2
(11.33) N1
A f 1 f 1 N3 P f1
f3

nfP: number of faces of cell P, (faces f1, f2, f3, f4 for cell f4
P in the figure). N4

m f  (  v  A) f (Mass flow rate through face f) (11.34)


To calculate mf , vf at the cell faces should be found. vf is calculated using the
momentum interpolation method (MIM) of Rhie and Chow, to be discussed later.

Defining convective flux as


F fc  m f  f
where f is the value of a scalar at the cell face f , the convection term can also be
expressed as n fP

 (  v )  d A   Ffc f 1
(11.35)
A

ME555 : Computational Fluid Dynamics 32 I. Sezai – Eastern Mediterranean University

16
Calculation of scalar f for Convection Terms
a) First order methods
1) Upwind difference method (UD)

 f  P for m f  0
(11.36)
 f  N for m f  0

The convective flux for the upwind difference method can be written
as

FfU  max(m f , 0.)P  min(m f , 0.)N (11.37)

ME555 : Computational Fluid Dynamics 33 I. Sezai – Eastern Mediterranean University

High Order Methods


1) Linear Upwind Difference Scheme (LUD),
or 2nd order Upwind Difference Scheme (SOU) f2
N2

N1
f1
LUD formulation along a line in 1-D is: N3
f3 P
rPf
rNf

 P  U  1
 f   Uf    x
f4

 x  2
N4

where subscript U refers to upwind node. This can be extended to


3D space using Taylor series expansion around point U:
 f   Uf  U rU (11.38)
where  Uf  P , U  P , rU  rPf  r f  rP for m f  0
 Uf  N , U  N , rU  rNf  r f  rN for m f  0
or  f  P  P  rPf for m f  0
(11.39)
 f  N  N  rNf for m f  0
In Eq. (11.39) P and N are calculated using Eq. (11.31)
ME555 : Computational Fluid Dynamics 34 I. Sezai – Eastern Mediterranean University

17
Method of Deferred Correction
The convection term Ff  m  f  f for high order methods at the cell faces is
implemented as the sum of the upwind value and other higher order terms which are
evaluated at the previous iteration:
Ff  FfU  ( FfH  FfU )old (11.40)
Subscript U → refers to upwind (φcalculated using first order upwind method)
Subscript H → refers to a high order method such as CD or LUD.
Substituting FfU from Eqn. (11.37) into Eqn. (11.40)
old
Ff  max(m f , 0.)P  min(m f , 0.)N   m f  fH  max(m f , 0.)P  min(m f , 0.)N 
Then, convection term in Eqn. (11.35) becomes
n f ( P) n f ( P)

 (  v)  dA   max(m
f 1
, 0.)P   min(m f , 0.)N
f 1
f
A      
implicit implicit
old
n f ( P) 

   m f  fH  max(m f , 0.)P  min(m f , 0.)N  
 f 1
  
explicit

ME555 : Computational Fluid Dynamics 35 I. Sezai – Eastern Mediterranean University

Source term
Source term in Eq. (11.8) is discretized as
 s dV  sV
CV
P p P )VP
 ( sceqn  s eqn
p
(11.41)

For x-momentum equation: sc   x  (p) P , p 0


eqn x
s eqn
p
For y-momentum equation: sc    (p) P , p 0
eqn y
s eqn
y
p p
where p  i  j  (p) x i  (p) y j
x y
Using Gauss’ rule (Eq. (11.31 with (11.32)):
n
1 1 1 f
p P   pdV   pdA   p f A f (Coservative form) (11.42)
V v V s VP f 1
1  nf
 1  nf

pP    p f A xf  i    p f A yf  j  (p) x i  (p) y j (Noncoservative form)
VP  f 1  V  f 1
 P 

 n
p f

 s dV  sV P VP  (p ) Px VP   p f A xf for x-momentum equation


CV
x f 1 (11.43)
nf
p
CV s dV  sVP  y VP  (p) P VP  
y
p f A yf for y-momentum equation
f 1

ME555 : Computational Fluid Dynamics 36 I. Sezai – Eastern Mediterranean University

18
Substituting the discretized forms of the transient, convection and diffusion terms
into the general equation (11.8)

( V ) P  ( V )0P


n f ( P) nf (P) nf (P)
 F Ad
t
  max(m
f 1
f , 0.)P   min(m
f 1
f , 0.)N  
f 1 d PN
(N  P )
n 1
nf (P)
 (N  P )  PP ' 
       f .A t   f
d PN
Ad   sVP
f 1  f

n f ( P)
n 1
  m 
f 1
f
H
f  max( m f , 0.)P  min( m f , 0.)N 

(11.44)

ME555 : Computational Fluid Dynamics 37 I. Sezai – Eastern Mediterranean University

Equation (11.44) can be written in the form of


aP P  
N nb( P)
aNN  S
(11.45)
S  sceqnVP  S trans  S dc  S pres = (source in differential equation + transient + deferred correction + pressure) terms
 f Ad  PVP
aN 
d PN
 min  m f , 0  , aP  
N  nb ( P )
aN 
t
 s eqn
p VP ,

 P0VP
S trans  aPoPo , aPo 
t
nf (P)
n 1
S dc
    m f   max( m f , 0.)P  min(m f , 0.)N 
H
f
f 1
n 1
n f (P)
 (N  P )  PP ' 
       f .A t   f
d PN
Ad  ,
(11.46)
f 1  f

 nf

 (p ) P VP   p f A f
x x
for x -momentum equation
 f 1
S pres   nf
 (p ) y V   p A y
 P P  f f for y -momentum equation
 f 1

A A A Af Af Af
PP '  f1f et , f1f  fof d , fof  Pf  Pfo  Pf  ( Pf  e PN )e PN , d  f , A t  A f  Ad e PN , Ad  A d 
Af d PN A f  PN A f  e PN

p   source terms per unit volume in the differential equation


s eqn = sceqn  s eqn
= body forces per unit volume in momentum equations
= energy generation rate per unit volume in energy equation
S  sV

ME555 : Computational Fluid Dynamics 38 I. Sezai – Eastern Mediterranean University

19
For a degree of implicitness θ, Equation (11.44) can be written in the form of
aP P   
N nb( P)
aNN  S   1 for fully implicit,   0.5 for Crank-Nicolson,   0 for explicit scheme

S  sceqnVP  S trans  S dc  S pres +S imp  (source in d.e. + transient + deferred correction + pressure + degree of implicitness) terms
 f Ad  PVP
aN 
d PN
 min  m f , 0  , aP   
N  nb ( P )
aN 
t
  s eqn
p VP ,

 P0VP
S trans  aPoPo , aPo 
t
nf (P)
n 1
S dc     m f  fH  max( m f , 0.)P  min(m f , 0.)N 
f 1
n 1
n f (P)
 (N  P )  PP ' 
       f .A t   f
d PN
Ad  ,
f 1  f

 nf

 (p ) P VP   p f A f
x x
for x-momentum equation
 f 1
S pres
 nf
 (p ) y V   p A y
 P P  f f for y -momentum equation
 f 1

S imp  (1   )  aN (N0  P0 )  (1   ) sPeqnP0


N  nb ( P )

p   source terms per unit volume in the differential equation


s eqn = sceqn  s eqn
= body forces per unit volume in momentum equations
= energy generation rate per unit volume in energy equation
S  sV

ME555 : Computational Fluid Dynamics 39 I. Sezai – Eastern Mediterranean University

In above equations superscripts:


n–1 → refers to previous iteration values
o → refers to previous time step values

In solving steady flows, Eq. (11.45) is relaxed as


aP aP

P  
N  nb ( P )
aN N  S  (1   )

Pn 1 (11.47)
0 ≤ α ≤ 1 underrelaxation factor.
In that case, the terms in Eq. (11.46) are redefined as
 aP n 1
 S  S  (1   )  P
 (11.48)
 a  aP
 P 
where superscript n–1 refers to the previous iteration value.
ME555 : Computational Fluid Dynamics 40 I. Sezai – Eastern Mediterranean University

20
MIM method
To find mf in Eq.(11.34), velocity vector vf at cell faces are calculated using the
momentum interpolation method (MIM) originally proposed by Rhie and Chow.
Rewriting the momentum
u
equations for a 2D flow in the form of Eq. (11.45)
aP

uP  
N  nb ( P )
aNu u N  bPu  V (p ) P .i
(11.49)
v
a (11.50)

P
vP  
N  nb ( P )
aNv vN  bPv  V (p ) P .j
Where, b is the source terms excluding pressure source. Above Eqns can be written as,
u P   H [u ]P   D[u ]P 0   (p ) P  i 
       (11.51)
v
 P  H [ v ] P  0 D[v]P  (p ) P  j
where

N  nb ( P )
aN N  bP
V (11.52)
H [ ]P  D[ ]P 
aP /  aP / 
Defining the vector forms of the above operators as
 H [u ] P   D[u ]P 0   (P) P  i  (P ) Px 
H[ v ]P    DP  
D[v]P 
(P) P    y (11.53)
 H [ v ]P   0 (P) P  j (P ) P 
For point P, the momentum equation in vector form becomes
v P  H[ v ]P  D P (p ) P (11.54)
ME555 : Computational Fluid Dynamics 41 I. Sezai – Eastern Mediterranean University

MIM method
Similarly, for point N
v N  H[ v]N  D N (p) N
Eq. (11.54) can be written at the cell face f as
v f  H f  D f (p) f (11.55)
Assuming that the term Hf can be approximated by using an interpolation between
points P and N, that is
Hf  Hf
where the overbar indicates linear average between point P and N. Then, Eq. (11.55)
becomes
v f  H f  D f (p) f (11.56)

The linearly averaged form of Eq.(11.55) is


H f  v f  D f p f (11.57)
Using, D f p f  D f p f

Eq (11.57) becomes, H f  v f  D f p f (11.58)


ME555 : Computational Fluid Dynamics 42 I. Sezai – Eastern Mediterranean University

21
Mass flow rate
where v f  (1  f P ) v P  f P v N
D f  (1  f P )D P  f P D N
p f  (1  f P )(p) P  f P (p) N
Df  Df
where, fP is the geometric interpolation factor defined as
Pf Pf  e PN Pf  e PN
fP  or preferably: f P  
 PN  PN 
1/2
PN PN
A more accurate interpolated value can be found using Eqn. (11.32).
Substituting eq (11.58) into eq (11.56)

v f  v f  D f (p ) f  D f p f  (11.59)
Mass flow rate: m f  (  v  A) f
Substituting Eq. (11.59) for vf :


m f   f v f  A f   f D f p f  A f   f D f (p ) f  A f  (11.60)

ME555 : Computational Fluid Dynamics 43 I. Sezai – Eastern Mediterranean University

Mass flow rate


The term p f .A f is discretized using Eq. (11.34)

p N  pP (pN  pP )  PP ' (11.61)


p f .A f  Ad  p f .A t  Ad
d PN d PN
where the overbar denotes linear interpolation between the two cells straddling the
surface f.
Substituting into Eq. (11.60)
m f   f v f  A f   f D f (p ) f  A f
(11.62)
 p  pP (PN  PP )  PP ' 
 f Df  N  
Ad  p .( A t ) f  Ad 
 d PN f d PN 
Ad A f  A f
or using 
d PN A f  PN
(D f A f )  A f
m f   f v f  A f   f D f (p) f  A f   f  p N  pP    f ( D f p f )  ( A t ) f
A f  PN (11.63)
(D f A f )  A f
 f (pN  pP )  PP '  aNp from Eq. (11.77)
A  PN
f

ME555 : Computational Fluid Dynamics 44 I. Sezai – Eastern Mediterranean University

22
SIMPLE Algorithm
Consider the momentum equations in Eq. (11.56) rewritten at the face f as

v f  H[ v] f   D f (p) f (11.64)

Let p', u', v' be the correction needed to correct the guessed pressure and velocity
fields, i.e.

p  p *  p and v  v *  v (11.65)

For a guessed pressure field p* the corresponding velocity can be written as

v*f  H[ v* ] f  D f (p* ) f
(11.66)

Subtracting Eq. (11.66) from Eq. (11.64) yields


vf  H[ v] f  D f (p) f (11.67)

ME555 : Computational Fluid Dynamics 45 I. Sezai – Eastern Mediterranean University

SIMPLE Algorithm
In SIMPLE method the second term on the left hand side of Eq. (11.67) is neglected.
Then, Eq. (11.67) becomes
vf   D f pf (11.68)
The discretized continuity equation is

(  P   Po )
VP   m f  0 where m f   v f  A f (11.69)
t f  nb ( P )

(  P   Po )
or VP   m *f   m f  0 (11.70)
t f  nb ( P ) f  nb ( P )

where m f  (  v) f  A f

Substituting v'f from Eq. (11.68)

m f  (  v) f  A f    f (D f pf )  A f (11.71)

ME555 : Computational Fluid Dynamics 46 I. Sezai – Eastern Mediterranean University

23
SIMPLE Algorithm
The term pf .A f is discretized using Eq. (11.34)

pN  pP (pN  pP )  PP '


pf .A f  Ad  pf .A t  Ad (11.72)
d PN d PN

Substituting Eq. (11.72) into Eq. (11.71) gives

(D f A f )  A f (D f A f )  A f
m f    f
A f  PN
 
( pN  pP )   f D f p .( At ) f   f
f A f  PN
(pN  pP )  PP '
(11.73)
Substituting Eq. (11.73) into Eq. (11.70) , the continuity equation becomes

(D f A f )  A f (  P   Po )

f  nb ( P )
f
A f  PN
( pN  pP )  
f  nb ( P )
m *f 
t f  nb ( P )
f
 
VP    f D f p .( A t ) f (11.74)
(D f A f )  A f
 
f  nb ( P )
f
A f  PN
(pN  pP )  PP '

Equation (11.74) is also called the pressure correction equation.


ME555 : Computational Fluid Dynamics 47 I. Sezai – Eastern Mediterranean University

SIMPLE Algorithm
The pressure correction equation (11.74) can be written as:
aPp pP  
N  nb ( P )
aNp pN  bPp (11.77)

(D f A f )  A f
aNp   f
A f  PN
p
a 
P 
N  nb ( P )
aNp

(  P   Po )
bPp   VP   m *f    f D f pf  ( A t ) f
t f  nb ( P ) f  nb ( P )

(D f A f )  A f
 
f  nb ( P )
f
A f  PN
(pN  pP )  PP '

The last term on the right hand side of bP term can be neglected.
 Du 0 
Df   f  (11.78)
 0 D vf 

ME555 : Computational Fluid Dynamics 48 I. Sezai – Eastern Mediterranean University

24
SIMPLE Algorithm
From Eq. (11.73), the mass correction is

 
m f  aNp ' ( pN  pP )   f D f p .( At ) f  aNp ' (pN  pP )  PP '
f
(11.79)

After solving the p' field from Eq. (11.77) the mass flow rate at the surfaces are
corrected by using Eq. (11.79)

m f  m *f  aNp ( pN  pP )   f D f pf  ( At ) f  aNp ' (pN  pP )  PP ' (11.80)

The nodal velocities are corrected as


v P  v*P  vP  v*P  D P pP (11.81)
and the pressure field is corrected by using
pP  pP*   p pP (11.82)
αp = pressure under-relaxation factor

ME555 : Computational Fluid Dynamics 49 I. Sezai – Eastern Mediterranean University

SIMPLE Algorithm
Step 1: Solve the discretized transport equation (11.47) for  = u and  = v
aP aP

P 
N  nb ( P )
 aN N  S  (1   )
 P
 n 1
Step 2: Calculate mass flow rate at cell faces (Eqn. (11.63))
m f   f v f  A f   f D f (p) f  A f  aNp '  pN  pP    f (D f p f )  ( A t ) f  aNp ' (pN  pP )  PP '

Step3: Solve pressure correction equation (11.77)


aPp pP  
N  nb ( P )
aNp pN  bPp
Step 4: Correct velocities and pressure at points P using Eqn’s (11.81), (11.82)
v P  v*P  vP  v*P  D P pP pP  pP*   p pP
Step 5: Correct mass flow rate using equation (11.80) :
m f  m *f  aNp ( pN  pP )   f D f pf  ( A t ) f  aNp ' (pN  pP )  PP '
Step 6: Solve the discretized transport equation (11.47) for other unknowns (i.e. for
 = Temperature) a
a
P
   a   S  (1   ) P Pn 1
 P N  nb ( P ) N N 
Step 7: Repeat steps 1 to 6 until convergence.

ME555 : Computational Fluid Dynamics 50 I. Sezai – Eastern Mediterranean University

25
Modifications to original MIM method
In the original MIM method proposed by Rhie and Chow, using equations (11.56-
11.57) for the face values Hf and Df , makes the solution to depend on the relaxation
parameter α as well as the time step size Δt. To overcome this, Eqns (11.49-11.50)
are written as (Bo Yu et al. , Numer. Heat Transf., Part B, v42, pp. 141-166, 2002) :
  
vP  HP  VP (p ) P  (1   ) v nP1  aPo v oP  VP (sbody ) P
aP aP aP
where (a)
  
H P   a P1   a N v N   (Sbc ) P  (S dc ) P 
 N  nb ( P )  
Note that the source terms resulting from relaxation, unsteady term and body forces
has been separated from H term. Sbc is the source due to boundary conditions.
The corresponding equation at the face is
   (b)
v f  H f  V f (p ) f  (1   ) v nf 1  ( aPo ) f v of  V f (sbody ) f
af af af
or

v f  H f  D f (p ) f  (1   ) v nf 1  ( aPo ) f v of  D f (sbody ) f
af (c)

ME555 : Computational Fluid Dynamics 51 I. Sezai – Eastern Mediterranean University

Modifications to original MIM method


where
H f  (1  f P )H P  f P H N

Following the procedure as in Rhie and Chow method, the face velocity can be
expressed as
v f  v f   D f (p) f  D f (p ) f 
(d)
 (1   )  v nf 1  v nf 1 
 
  (a f ) 1 (aPo ) f v of  (aPo ) f v of 
 
  D f (sbody ) f  D f (sbody ) f 
 
where
1 1 1
 (1  f P )  f P
af aP aN
VP
aPo 
t
ME555 : Computational Fluid Dynamics 52 I. Sezai – Eastern Mediterranean University

26
Modifications to original MIM method
Then, using Eqn. (d), mass flow rate through face f can be written as

  n 1   f v nf 1  A f 
f  (1   ) m f
m f  m RC
 
 f (D f A f )  A f o

t A f  A f
 
m f   f  (a f ) 1 (aPo ) f v of  A f (e)

  f  D f (sbody ) f  D f (sbody ) f   A f
 

where
m RC
f = mass flow rate calculated from Eqn. (11.63) using Rhie-Chow method.
m of = mass flow rate at face f during previous time step.
m nf 1= mass flow rate at face f during previous iteration step.

n 1
 f is used during the current iteration so that no extra storage is
Note that m
needed for m nf 1 . However, storage is needed for m of .
ME555 : Computational Fluid Dynamics 53 I. Sezai – Eastern Mediterranean University

Modifications to original MIM method


body
The linearly averaged value of (s ) f is estimated using
(sbody ) f  (1  f P )(sbody ) P  f P (sbody ) N (f)

and the face value is estimated as:


1 body 1
(sbody ) f  ((s ) P  (s body ) N )  ( (s body ) P  rPf  (sbody ) N  rNf ) (g)
2 2
where the gradient at the nodal point P can be calculated using the Gauss' rule.

The use of the neighboring cell source values for the estimation of (sc)f, is expected
to circumvent the convergence difficulties encountered in flows with large source
terms.

It should be noted that Eqn. (d) is equivalent to Eqn. (c). However, Eqn (d) may be
preferred since extra storage is required for Hf in Eqn (c).

ME555 : Computational Fluid Dynamics 54 I. Sezai – Eastern Mediterranean University

27
Gradient reconstruction using Least-Squares method
One popular method for calculating the gradient at points P and N is
to use Gauss’ method given by Eqn’s (11.31-11.32). Another possible
way is to use least-squares method.
Consider a control volume and its neighbors:

In LUD scheme for the case m f  0 , the value of  at a face f can be


calculated from Eqn. (11.39) as:
 f  P  P rPf
A similar equation can be written between P and its neighbor points
A, B, C and D:
ME555 : Computational Fluid Dynamics 55 I. Sezai – Eastern Mediterranean University

     
i  0    ( xi  x0 )    ( yi  y0 )
x
 0  y 0
or
     
i  0    xi    yi
 x 0  y 0
where i → 1, 2, 3, 4,…, or A, B, C, D,...
For each node around “0” (0 →P) we have
     
1  0    x1    y1
 x 0  y 0
     
2  0    x2    y2
 x 0  y 0
     
3  0    x3    y3
x
 0  y 0
     
N  0    xN    y N
 x 0  y 0

This set of equations can be written in matrix form as

ME555 : Computational Fluid Dynamics 56 I. Sezai – Eastern Mediterranean University

28
 x1 y1   1  0 
 x    
 2 y2      2  0 
 x 0 
 x3 y3     3  0 
      
 
 : :      : 

  y 0 
 xN yN  N  0 

This represents an overdetermined system of equations, in the form


AX  B
which may be solved for X=[(∂/∂x)0, (∂/∂y)0] using least-squares
approach. Multiplying both sides of the eqn by the transpose AT
 x x2 x3 .. xN 
AT   1
 y1 y2 y3 .. y N 
we obtain

A T AX  A T B

ME555 : Computational Fluid Dynamics 57 I. Sezai – Eastern Mediterranean University

or    
  
 a11 a12   x 0   b1 
a 
 a22      b2 
21
    
AT A


y 0  ATB

where X

a11  (x1 ) 2  ( x2 ) 2  (x3 ) 2  ...  (xN ) 2


a12  a21  (x1 )(y1 )  (x2 )(y2 )  (x3 )(y3 )  ...  (xN )(y N )
a22  (y1 ) 2  (y2 ) 2  (y3 ) 2  ...  (yN ) 2
b1  (x1 )(1  0 )  (x2 )(2  0 )  (x3 )(3  0 )  ...  (xN )(N  0 )
b2  (y1 )(1  0 )  (y2 )(2  0 )  (y3 )(3  0 )  ...  (y N )(N  0 )

It can be observed that the matrix ATA is a 2×2 matrix which can be
easily inverted to solve for X, i.e.
X  ( A T A) 1 A T B
For 3D problems, X=[(∂/∂x)0, (∂/∂y)0, (∂/∂z)0] and ATA is a 3×3
matrix.

ME555 : Computational Fluid Dynamics 58 I. Sezai – Eastern Mediterranean University

29
Performing the inversion we obtain
     NB (0) x 
     C j ( j  0 ) 
 0
 
  x   x 0   j 1 
     NB (0) y 


y 
0

y

( )0          C j ( j  0 ) 
 0   j 1 
  z  
 0

      
  NB (0) 
 C j ( j  0 ) 
 z 0   j 1
z


where the C terms are
r12
C jx   j ,1   j ,2  j ,3
r11
r23
C jy   j ,2   j ,3
r22
C jz   j ,3

and x j 1  r12 
 j ,1  ,  j ,2   y j  x j 
r112 r222  r11 
1  r23  r12 r23  r13 r22
 j ,3   z j  y j  x j  , 
r332  r22  r11r22

ME555 : Computational Fluid Dynamics 59 I. Sezai – Eastern Mediterranean University

and NB (0)
1 NB (0)

  x    x  y 
2
r11  j , r12  j j
j 1 r11 j 1

NB (0) NB (0)
1
  x  z ,   y 
2
r13  j j r22  j  r122
r11 j 1 j 1

NB (0) NB (0)
1
  y  z   r   z 
2
r23  j j 12 13r , r33  j  ( r132  r232 )
r22 j 1 j 1

where NB(0) refers to neighbor nodes around “0” (0 →P).


Implementation of the least-squares gradient reconstruction requires
that six r values (r11, r22, r33, r12, r13, r23) be stored at each node P.
The calculation needs to be performed only once for each node.

ME555 : Computational Fluid Dynamics 60 I. Sezai – Eastern Mediterranean University

30
Gradient reconstruction using Least-Squares with weighting coefficients
In the above least-squares method each neighbor node contributes
equally to the gradient reconstruction irrespective of its distance to the
central point P.
The accuracy of the method may detorriate on highly distorted
meshes.
It is possible to give different weights to the contribution of each
neighbor node to gradient reconstruction. This yield the following set
of equations for 2D problems:
 w1x1 w1y1   w1 (1  0 ) 
 w x w2 y2       w (   ) 
 2 2   x 0   2 2 0 
 w3x3 w3 y3      w (   ) 
        3 3 0 
 : :      : 
 wN xN   y 0  
wN y N   wN (N  0 ) 

where wi is the weighting factor of neighbor node i.


ME555 : Computational Fluid Dynamics 61 I. Sezai – Eastern Mediterranean University

The wi’s can be selected as a function of the geometry or the solution.


Geometrical weights can be chosen in the form
1
wi  t
t  0,1, 2.
ri  rP
For inverse distance weighting t = 1, → wi  1/ xi  yi  zi
2 2 2

The gradient using the weighted least-squares reconstruction becomes

     NB (0) x 
      C j w j ( j  0 ) 

 0

  x   x 0   j 1 
      NB (0) 
 
( )0    y        C jy w j ( j  0 ) 
 0
 y 0   j 1 
 
  z  
 
0    
  NB (0)
     C jz w j ( j  0 ) 

 z 0   j 1 

ME555 : Computational Fluid Dynamics 62 I. Sezai – Eastern Mediterranean University

31
where the C terms are the same as that of the unweighted method:
r12 r23
C jx   j ,1   j ,2  j ,3 , C jy   j ,2   j ,3 , C jz   j ,3
r11 r22
The α and r terms are
w j x j 1  r 
 j ,1  2
,  j ,2  2 
w j y j  12 w j x j 
r 11 r22  r11 
1  r23  r12 r23  r13 r22
 j ,3   w j z j  w j y j  w j x j  , 
r332  r22  r11r22
NB (0) NB (0)
1
  w x    w x  w y 
2
r11  j j , r12  j j j j
j 1 r11 j 1

NB (0) NB (0)
1
  w x  w z ,   w y 
2
r13  j j j j r22  j j  r122
r11 j 1 j 1

NB (0) NB (0)
1
  w y  w z   r   w z 
2
r23  j j j j r ,
12 13 r33  j j  (r132  r232 )
r22 j 1 j 1

ME555 : Computational Fluid Dynamics 63 I. Sezai – Eastern Mediterranean University

TVD Schemes in Unstructured Grids: 1) Flux Limiters


For Cartesian grids, for ue > 0, using a TVD scheme, e may be written as
e
1 P
e  P   (r )(E  P ) (11.83) W
E

2
where P  W w e

r WW W P E EE

E  P ve

ψ = flux limiter function


ψ = 0 for UD scheme
ψ = 1 for CD scheme
ψ = r for LUD scheme
ψ = 0.25r + 0.75 for QUICK scheme

However, in unstructured grids, for face f1 of cell P, the


upwind point U is not available.
N2
f2
N1
N3
f3 P

There are methods to construct U, but these are costly.


f1
U

f4

In the absence of U, the method proposed by Darwish N4

and Moukalled (2003) will be used


ME555 : Computational Fluid Dynamics 64 I. Sezai – Eastern Mediterranean University

32
TVD Schemes in Unstructured Grids : 1) Flux Limiters
Since the index based notation used above is not suitable for unstructured grids, a more
appropriate notation proposed by Darwish and Moukalled (2003) will be adopted.

(N)
U: upwind node around face f
f
N2
(P)
v
D D: downwind node around face f
f2 U
N1 UU: (virtual) upwind node far
N3 P f1
UU
upstream
f3

(N)
f UU
f4 (P) U
N4 D v Locate UU such that r(UU)D = 2rUD

Using this notation:


1
 f  U   (rf )(D  U ) (11.84)
2
U  UU
where rf  (11.85)
D  U
The main difficulty in using TVD schemes in unstructured grids lies in the need for
defining a virtual node UU.
ME555 : Computational Fluid Dynamics 65 I. Sezai – Eastern Mediterranean University

Exact r Formulation
Returning to the definition of r:
U  UU D  (U  UU )  D (D  UU )  (D  U ) (11.86)
rf   
D  U D  U D  U
Note that D and U are the nodes straddling the interface and thus are readily available.
For node UU we can write:
(D  UU )  U  r(UU ) D  (2U  rUD ) (11.87)

since r(UU)D = 2rUD (U is at the center of the (UU)D segment). Other positions of UU
could also be chosen but with a loss of accuracy as the nodal gradient yields a second
order accuracy only when the difference is centered at U.
The formulation of rf becomes
(2U  rUD )  (D  U ) (2U  rUD ) (11.88)
rf   1
D  U D  U
After calculating rf from Eq. (11.88) find ψ(rf) from a TVD scheme (chapter 5) and
then calculate f from Eq. (11.84).
ME555 : Computational Fluid Dynamics 66 I. Sezai – Eastern Mediterranean University

33
Exact r Formulation
Note that this r-formulation can also be used for any high order
scheme without TVD. For example for QUICK scheme:
ψ(rf) = 0.25rf + 0.75

Then, the application of high order convection schemes with TVD in


a deferred correction manner, is added as a source term to Sdc in
accordance with Eq. (11.46) as
n 1
n f ( P) 
S dc

    m f  fH  max(m f , 0.)P  min(m f , 0.)N   (11.89)
 f 1 

where, fH is the f value computed from Eq. (11.84).

ME555 : Computational Fluid Dynamics 67 I. Sezai – Eastern Mediterranean University

TVD Schemes in Unstructured Grids: 2) Gradient Limiters


For structured grids flux limiters are used. For unstructured grids, the
gradient or slope limiters are used. Instead of limiting the flux at the
cell face, in this method the gradient P at cell center P, is limited.
Barth and Jespersen (1989) introduced the first gradient limiter for
unstructured grids.
The scheme consists of finding the value of  in a CV by limiting the
gradient such that no extrema of  is formed:
 (r )  P  P  (r  rP ) (11.90)
 = gradient limiter for the control volume at P, r = position vector.
That is, to prevent formation of extrema in the CV,  limits the
gradient such that the value of (r) calculated in the CV (and at the
faces) should satisfy the following:
(r) < max(P, Ni), i = 1, n and
(r) > min(P, Ni), i = 1, n where n is the number of neighbors of P
ME555 : Computational Fluid Dynamics 68 I. Sezai – Eastern Mediterranean University

34
Using the limited gradient , then the value of  at any cell face is
found from
 f  P  P rPf (11.91)
where rPf is the position vector from P to the face center f.
Point f is called the reconstruction point. (f is reconstructed from its
gradient at P)
However it should be noted that reconstruction points may also be
chosen to be the vertices of the face, which is common in vertex-based
unstructured grid methods.
The advantage of gradient limiters over the flux limiters is that, not
only the convection fluxes, but diffusion fluxes are also limited, since
these fluxes contain gradients of .

ME555 : Computational Fluid Dynamics 69 I. Sezai – Eastern Mediterranean University

Barth and Jespersen’s gradient limiter


The following procedure is used by Barth and Jespersen:
1) Find the largest negative (Δmin = min  P) and positive (Δmax = max
 P) difference between the neighbors and the current CV.
2) Compute the value of fi for face i from the unlimited expression
 fi  P  P  rPfi (11.92)
3) Next, define the ratio yi for each face i of CV as:
  max
 if  fi  0
 fi
N2
 f2
yi   min if  fi  0
  fi
(11.93) N3
N1
P f1
1 if  fi  0
f3


where f4

 max  max  P ,  min  min  P ,  fi   fi  P N4

max  max(P , N ), i  1, n
i

min  min(P , N ), i  1, n
i

ME555 : Computational Fluid Dynamics 70 I. Sezai – Eastern Mediterranean University

35
3) Compute a maximum allowable value of fi for each face i of CV:
 fi  min(1, yi )
4) Select
 BJ  min( fi ), i  1, n (11.94)
for the node P, where n  number of faces of the CV
That is, the gradient limiter of Barth-Jespersen, BJ, is defined as the
minimum of all the neighboring face limiters fi.
A compact formulation of Barth-Jespersen’s limiter is given by Wang
(1998) as
  max      min Ni  P 
 min 1,  ,   (11.95)
Ni P i 1, n i 1, n
 BJ
  max  fi  P   min  fi  P 
  i 1, n   i 1, n 

ME555 : Computational Fluid Dynamics 71 I. Sezai – Eastern Mediterranean University

The function fi proposed by Barth and Jespersen is non-


differentiable. This adversely affects the convergence of the solver.
Venkatakrishnan, (1995) proposed modifications that replace the
discontinuous limiter function with a smoothly varying function.
While the new limiter does not strictly enforce monotonicity of the
reconstructed fluxes, it has better convergence properties.
y2  2 y
 fi ( y )  (11.96)
y2  y  2
where  
y  max if  fi  0 and y = min if  fi  0
 fi  fi
Although this new function is differentiable, it has the disadvantage of
reducing the gradient even in regions where no new extrema are
formed (i.e. for y < 2 as can be seen in the following figure).

ME555 : Computational Fluid Dynamics 72 I. Sezai – Eastern Mediterranean University

36
 fi

Venkatakrishnan’s smooth approximation to min(1, y)


However, for smooth flows (where  is nearly uniform) on a uniform
mesh, y is expected to be  2 and this method introduces an error
which is on the order of truncation.
To avoid applying the limiter in regions of nearly uniform flow
Venkatakrishnan introduced a modification to the method.
ME555 : Computational Fluid Dynamics 73 I. Sezai – Eastern Mediterranean University

The modification eliminates the effect of the limiter when


f  P  (KΔx)1.5 (11.97)
where Δx is a characteristic length for the CV (Δx = (VCV)1/3)
K is a tunable parameter (K = 0.12, but usually K = 0.3 is used).
The modified limiter of Venkatakrishnan is
 1 ( 2max   2 ) fi  2 2fi  max
 if  fi  0
  fi  2max  2 2fi   max  fi   2
 (11.98)
 1 ( 2min   2 ) fi  2 2fi  min
 fi   if  fi  0
  fi  2min  2 2fi   min  fi   2
1 if  fi  0


where ε2 = (KΔx)3
With K > 0, this modification does not maintain strict monotonicity.
ME555 : Computational Fluid Dynamics 74 I. Sezai – Eastern Mediterranean University

37
Limiter of Michalac and Ollivier-Gooch
Venkatakrishnan’s limiter does not provide sufficient accuracy even
in smooth regions without any local extrema.
While the Barth-Jespersen limiter does satisfy these conditions,
convergence to steady state solution is difficult due to lack of
differentiability of min(1, y).
Michalac and Olliver-Gooch (2008) proposed a new approximation
for min(1, y) in the limiter function of Barth-Jespersen that will be
monotone and differentiable:
 P ( y ) y  yt (11.99)
 fi  
1 y  yt
where 1 < yt < 2 is a threshold and P(y) is a polynomial satisfying
P 0  0, P y 1
t

dP dP
 1, 0
dy 0 dy yt

ME555 : Computational Fluid Dynamics 75 I. Sezai – Eastern Mediterranean University

A third degree polynomial of the from


P ( y )  a3 y 3  a2 y 2  a1 y  a0 (11.100)
can satisfy the above requirements with coefficients:
a3  ( yt  2) / yt3 , a2  (1  3a3 yt2 ) / (2 yt ), a1  1, a0  0
Barth-Jespersen
Michalac-Ollivier, yt = 1.5
Michalac-Ollivier, yt = 1.75
 fi

The resulting limiters for yt = 1.5, 1.75 are plotted in the above figure.
For yt = 1.5 accuracy is better. For yt = 1.75 convergence is better.
ME555 : Computational Fluid Dynamics 76 I. Sezai – Eastern Mediterranean University

38
Modifications to Limiter in uniform regions
In regions of flow which are nearly uniform, extrema will occur
frequently in the transient solution.
Therefore, it is desirable to switch-off the limiter in those regions.
Michalac and Ollivier-Gooch suggest to switch the limiter off when
  ( max   min )  ( K x)3/ 2 (11.101)
To maintain differentiability, a modified limiter, BJ-mod , is proposed:
 BJ  mod    (1   ) BJ (11.102)
where BJ is Barth-Jespersen’s limiter calculated from Eqn. (11.94)
and  is 1 for ( ) 2  ( K x)3
 (11.103)
   s( ) for ( K x)3  ( )2  2( K x)3
0 for ( ) 2  2( K x)3

where the transition function s() is
( )2  ( K x)3
s ( )  2 3  3 2  1,  (11.104)
( K x)3
ME555 : Computational Fluid Dynamics 77 I. Sezai – Eastern Mediterranean University

s()

The transition
function s()

The transition function s() is used to smoothly disable the limiter in nearly uniform
meshes.
In this way, the cells with  = 1 have new = 1.
As a result  need not be calculated in nearly uniform flow regions since from
(11.102)     (1   )
BJ  mod BJ

This decreases the computer time.

ME555 : Computational Fluid Dynamics 78 I. Sezai – Eastern Mediterranean University

39
Sensitivity of results to K
Consider transonic flow at Mach 0.8 across an airfoil shown
in the figure. (Michalac and Olliver-Gooch (2009))
The sensitivity of total pressure loss across the shock near
the leading edge of the airfoil, to the tuning parameter K, is
shown in the figure below.

Venkatakrishnan’s limiter, V Barth-Jespersen’s modified limiter, BJ-mod

The modified limiter exhibits almost no sensitivity to K before the shock.


Downstream the shock the results using K = 0.25 and K =1 are indistinguishable.
ME555 : Computational Fluid Dynamics 79 I. Sezai – Eastern Mediterranean University

Unstructured Mesh generation


Commercial CFD packages such as
FLUENT
CFX
STAR-CD
PHOENICS
FLOW3D
have their own mesh generation tools together with their geometry
modelers.
They also have facilities to import data from solid modeler packages
such as
PARASOLID, PRO/ENGINEER
SOLID EDGE, SOLID WORKS
UNIGRAPHICS

ME555 : Computational Fluid Dynamics 80 I. Sezai – Eastern Mediterranean University

40
There are also free mesh generation packages such as
GMSH
SALOME
Some of these free mesh generation packages can also import
geometry files from solid modelers.
A geometric model of the solution domain is first developed.
Then, meshes are created on this geometric model.
Salome seems to have a better GUI (graphics user interface) and is
more user friendly than GMSH for the time being (as of 2015).
The mesh file created by the mesh generator software consists of two
parts which give information for nodes and elements. That is:
1) x, y and z coordinates of each node in the mesh
2) list of nodes of each element together with its element type and
region (zone) number.
ME555 : Computational Fluid Dynamics 81 I. Sezai – Eastern Mediterranean University

An example drawing created by GMSH

Drawing 1

The drawing of a 2-D square domain created by GMSH is shown in


the figure.
The physical region number of each boundary is denoted by numbers
from 1 to 4.
1 → bottom, 2 → right, 3 → top, 4 → left boundaries.
The surface is indicated by dashed lines and has a physical region
number of 6.

ME555 : Computational Fluid Dynamics 82 I. Sezai – Eastern Mediterranean University

41
The mesh of drawing 1 created by GMSH
$Nodes $Elements
13 24
1000 1121115
24 23 2100 2121152
22 3110 3122226
9 15 4010 4122263
5 0.4999999999986718 0 0 5123337
21
6 1 0.4999999999986718 0 6123374
10 12 16 14 7 0.5000000000013305 1 0 7124448
8 0 0.5000000000013305 0 8124481
17
9 0.5013711139750536 0.4999926352623462 0 9 2 2 99 6 4 8 11
13 10 0.3339866124247404 0.3331457930147393 0 10 2 2 99 6 8 10 11
11
18 11 0.3343386761842688 0.6672116118139605 0 11 2 2 99 6 8 1 10
19 20 12 0.6682287346435727 0.6666784466453495 0 12 2 2 99 6 11 10 9
13 0.6678219567120327 0.3329201164922819 0 13 2 2 99 6 2 6 13
$EndNodes 14 2 2 99 6 6 12 13
15 2 2 99 6 6 3 12
There are 13 nodes (blue colors) and 24 elements. 16 2 2 99 6 13 12 9
17 2 2 99 6 9 10 13
First 8 elements are boundary elements (line elements, elm type = 1). 18 2 2 99 6 10 5 13
19 2 2 99 6 10 1 5
Elements 9-24 are interior elements (triangular elmnts, elm type = 2). 20 2 2 99 6 13 5 2
In nodes data: 1st column is node number, columns 2-4 are x, y, z 21 2 2 99 6 9 12 11
22 2 2 99 6 12 7 11
coordinates of nodes. 23 2 2 99 6 12 3 7
24 2 2 99 6 11 7 4
In elements data: first column is element number, column 2 → elm $EndElements
type, column 3 → number of tags, columns 4-5 → tags, (tag1 →
physical region number, tag 2 → elementary region number), the rest
of columns (columns 6-7 or 6-8) → nodes of element.
ME555 : Computational Fluid Dynamics 83 I. Sezai – Eastern Mediterranean University

Unstructured Grid Element Numbering Conventions


For an unstructured grid, the element connectivity cannot be easily
built, so this additional information is generally added to the data file.
The element information typically includes the element type or shape,
and the list of nodes for each element.
Unstructured grid element numbering convention of CGNS (CFD
General Notation System) will be given here.
CGNS provides a general, portable, and extensible standard for the
storage and retrieval of CFD analysis data.
In an unstructured zone, the nodes are ordered from 1 to N, where N is
the number of nodes in the zone.
An element is defined as a group of one or more nodes, where each
node is represented by its index.
The elements are indexed from 1 to M within a zone, where M is the
total number of elements defined for the zone.
ME555 : Computational Fluid Dynamics 84 I. Sezai – Eastern Mediterranean University

42
CGNS supports eight element shapes – points, lines, triangles,
quadrangles, tetrahedra, pentahedra, pyramids, and hexahedra.
Elements describing a volume are referred to as 3-D elements.
Those defining a surface are 2-D elements.
Line and point elements are called 1-D and 0-D elements,
respectively.
In a 3-D unstructured mesh, the cells are defined using 3-D elements,
while the boundary patches may be described using 2-D elements.
Each element shape may have a different number of nodes, depending
on whether linear or quadratic interpolation is used.
Therefore the name of each type of element is composed of two parts;
the first part identifies the element shape, and the second part the
number of nodes.

ME555 : Computational Fluid Dynamics 85 I. Sezai – Eastern Mediterranean University

Element types in CGNS

Element Types in CGNS


Dimensionality Shape Linear Quadratic
Interpolation Interpolation

0-D Point NODE NODE


1-D Line BAR_2 BAR_3
2-D Triangle TRI_3 TRI_6
Quadrangle QUAD_4 QUAD_8, QUAD_9
3-D Tetrahedron TETRA_4 TETRA_10
Pyramid PYRA_5 PYRA_14
Pentahedron PENTA_6 PENTA_15, PENTA_1
8
Hexahedron HEXA_8 HEXA_20, HEXA_27

ME555 : Computational Fluid Dynamics 86 I. Sezai – Eastern Mediterranean University

43
1-D line elements

BAR_2 BAR_3

Face Definition
Oriented edge Corner nodes Mid node
E1 N1,N2 N3

ME555 : Computational Fluid Dynamics 87 I. Sezai – Eastern Mediterranean University

2-D (surface) elements


CGNS supports two shapes of 2-D elements - triangles and quadrangles.

TRI_3 TRI_6
Edge Definition
Oriented edges Corner nodes Mid node
E1 N1,N2 N4
E2 N2,N3 N5
E3 N3,N1 N6

Face Definition
Face Corner nodes Mid-edge nodes Oriented edges
F1 N1,N2,N3 N4,N5,N6 E1,E2,E3

N1,...,N6 Grid point identification number. Integer ≥ 0 or blank, and no two values may be
the same. Grid points N1, N2, and N3 are in consecutive order about the triangle.
E1,E2,E3 Edge identification number.
F1 Face identification number.
ME555 : Computational Fluid Dynamics 88 I. Sezai – Eastern Mediterranean University

44
Quadrilateral elements

QUAD_4 QUAD_8 QUAD_9

Edge Definition
Oriented Corner nodes Mid node
edges
E1 N1,N2 N5
E2 N2,N3 N6
E3 N3,N4 N7
E4 N4,N1 N8

Face Definition
Face Corner nodes Mid-edge nodes Mid-face node Oriented edges

F1 N1,N2,N3,N4 N5,N6,N7,N8 N9 E1,E2,E3,E4

ME555 : Computational Fluid Dynamics 89 I. Sezai – Eastern Mediterranean University

3-D volume elements


CGNS supports four different shapes of 3-D elements - tetrahedra, pyramids,
pentahedra, and hexahedra.

TETRA_4 TETRA_10

Edge Definition Face Definition


Oriented Corner Mid node Face Corner nodes Mid-edge nodes Oriented edges
edges nodes
E1 N1,N2 N5
E2 N2,N3 N6 F1 N1,N3,N2 N7,N6, N5 -E3,-E2,-E1
E3 N3,N1 N7 F2 N1,N2,N4 N5,N9, N8 E1, E5,-E4
E4 N1,N4 N8 F3 N2,N3,N4 N6,N10,N9 E2, E6,-E5
E5 N2,N4 N9 F4 N3,N1,N4 N7,N8, N10 E3, E4,-E6
E6 N3,N4 N10

ME555 : Computational Fluid Dynamics 90 I. Sezai – Eastern Mediterranean University

45
Pyramid elements

PYRA_14
PYRA_5

Edge Definition Face Definition


Oriented Corner Mid node Face Corner nodes Mid-edge nodes Mid-face Oriented edges
edges nodes node
E1 N1,N2 N6 F1 N1,N4,N3,N2 N9,N8, N7, N6 N14 -E4,-E3,-E2,-E1
E2 N2,N3 N7 F2 N1,N2,N5 N6,N11,N10 E1, E6,-E5
E3 N3,N4 N8 F3 N2,N3,N5 N7,N12,N11 E2, E7,-E6
E4 N4,N1 N9 F4 N3,N4,N5 N8,N13,N12 E3, E8,-E7
E5 N1,N5 N10 F5 N4,N1,N5 N9,N10,N13 E4, E5,-E8
E6 N2,N5 N11
E7 N3,N5 N12
E8 N4,N5 N13

ME555 : Computational Fluid Dynamics 91 I. Sezai – Eastern Mediterranean University

Pentahedral elements

PENTA_6 PENTA_15 PENTA_18


Edge Definition
Oriented Corner Mid node
edges nodes Face Definition
E1 N1,N2 N7 Face Corner nodes Mid-edge nodes Mid-face Oriented edges
E2 N2,N3 N8 node
E3 N3,N1 N9 F1 N1,N2,N5,N4 N7, N11,N13,N10 N16 E1, E5,-E7,-E4
E4 N1,N4 N10 F2 N2,N3,N6,N5 N8, N12,N14,N11 N17 E2, E6,-E8,-E5
E5 N2,N5 N11 F3 N3,N1,N4,N6 N9, N10,N15,N12 N18 E3, E4,-E9,-E6
E6 N3,N6 N12 F4 N1,N3,N2 N9, N8, N7 -E3,-E2,-E1
E7 N4,N5 N13 F5 N4,N5,N6 N13,N14,N15 E7, E8, E9
E8 N5,N6 N14
E9 N6,N4 N15

ME555 : Computational Fluid Dynamics 92 I. Sezai – Eastern Mediterranean University

46
Hexahedral elements

Hexa_8 Hexa_20 Hexa_27


Edge Definition
Oriented Corner Mid
edges nodes node
E1 N1,N2 N9
E2 N2,N3 N10 Face Definition
E3 N3,N4 N11 Face Corner nodes Mid-edge nodes Mid-face Oriented edges
E4 N4,N1 N12 node
E5 N1,N5 N13 F1 N1,N4,N3,N2 N12,N11,N10,N9 N21 -E4,-E3, -E2, -E1
E6 N2,N6 N14 F2 N1,N2,N6,N5 N9, N14,N17,N13 N22 E1, E6, -E9, -E5
E7 N3,N7 N15 F3 N2,N3,N7,N6 N10,N15,N18,N14 N23 E2, E7, -E10,-E6
E8 N4,N8 N16 F4 N3,N4,N8,N7 N11,N16,N19,N15 N24 E3, E8, -E11,-E7
E9 N5,N6 N17 F5 N1,N5,N8,N4 N13,N20,N16,N12 N25 E5,-E12,-E8, E4
E10 N6,N7 N18 F6 N5,N6,N7,N8 N17,N18,N19,N20 N26 E9, E10, E11, E12
E11 N7,N8 N19
E12 N8,N5 N20

ME555 : Computational Fluid Dynamics 93 I. Sezai – Eastern Mediterranean University

References in addition to that of the textbook


Venkatakrishnan, V. (1993), On the accuracy of limiters and convergence to steady-
state solutions, AIAA paper 93-0880, Jan.
Barth, T.J. and Jespersen, D.C. (1989). The design and application of upwind
schemes on unstructured meshes, AIAA paper 89-0366, Jan.
Michalak M. and Ollivier-Gooch C. (2008), Limiters for unstructured higher-order
accurate solutions of the Euler equations, In Forty-sixth Aerospace Sciences
Meeting.
Michalak M. and Ollivier-Gooch C. (2009), Accuracy preserving limiter for the
high-order accurate solution of the Euler equations, Journal of Computational
Physics, vol. 228, pp. 8693-8711.
Wang, Z.J. (1998), A quadtree-based adaptive Cartesian/quad grid flow solver for
Navier-Stokes equations, Computers and Fluids, Vol. 27, pp. 529-549.

ME555 : Computational Fluid Dynamics 94 I. Sezai – Eastern Mediterranean University

47

You might also like