You are on page 1of 5

School of Mechanical Aerospace and Civil Engineering

Advanced Modelling & Simulation: CFD


Body-Fitted Grids
T. J. Craft
George Begg Building, C41
Contents:
Review of basic FV method
Pressure-velocity coupling
Body-tted coordinate systems
Unsteady problems
Turbulence and other physical
modelling
Reading:
J. Ferziger, M. Peric, Computational Methods for Fluid
Dynamics
H.K. Versteeg, W. Malalasekara, An Introduction to
Computational Fluid Dynamics: The Finite Volume
Method
S.V. Patankar, Numerical Heat Transfer and Fluid Flow
Notes: http://cfd.mace.manchester.ac.uk/tmcfd
- People - T. Craft - Online Teaching Material
Body-Fitted Grids
In previous lectures we have examined how to apply nite volume
procedures on rectangular grids.
For more general problems, the scheme needs to have greater
geometrical exibility. Consider a curved boundary:
Approximating the boundary by a series of
rectangular steps as shown would lead to
signicant errors close to the wall and large
deciencies in the predictions.
x
1
x
2
A better solution is to use a body-tted grid,
that follows the domain geometry.
However, integration over the control volume
is now not so straightforward, since cell
edges are not aligned with the x
1
and x
2
axes.
x
1
x
2
Body-Fitted Grids 2010/11 2 / 20
One solution is to use a curvilinear
orthogonal grid, dening local orthogonal
coordinate axes (
1
,
2
) for each cell and
integrating (in (
1
,
2
) space) as before.

1
2
x
x
1
2
However, the physical direction of the velocity components (U

1
, U

2
)
changes from cell to cell.
The restriction that grid lines should
intersect orthogonally makes grid
generation time-consuming and often
difcult.
It can also be difcult to obtain
appropriate grid renement where it is
needed, particularly if the boundary
surface is far from planar.
x
1
x
2
Body-Fitted Grids 2010/11 3 / 20
Non-Orthogonal Grids
A more exible approach is to allow the grid lines to be non-orthogonal.
This makes the mesh easier to generate, and avoids some of the
problems of being forced to place grid lines where they are not needed.
For now we restrict attention to a structured grid
arrangement, where the mesh resembles an array
of quadrilateral control volumes.
x
x
1
2
2

1
For more complex geometries, the domain can be decomposed into a
number of sub-regions, each of which is covered by such a structured
mesh. This is referred to as a multi-block grid.
Body-Fitted Grids 2010/11 4 / 20
For a general non-orthogonal quadrilateral control
volume, we can dene a local set of coordinates
(
1
,
2
) which correspond to the directions of the
grid lines passing through the node P.
x
x
1
2
2

1
The governing differential equations can then be expressed in terms of
derivatives with respect to
1
and
2
, instead of x
1
and x
2
.
For the velocity components, one has a choice of working with the
velocity components in the
1
and
2
directions, or the Cartesian
components U
1
and U
2
.
In many situations it is more convenient to retain the Cartesian
decomposition of the velocity, meaning that one uses the governing
equations for the Cartesian components U
1
and U
2
(but these are now
treated as functions of
1
and
2
).
Here we outline how the nite volume method can be applied on
non-orthogonal grids, to appreciate particular problems and effects on
stability and accuracy that should be considered when using such grids.
Body-Fitted Grids 2010/11 5 / 20
Coordinate Transformations
To transform the governing equations to use
1
and
2
as coordinates,
one needs to know how to transform derivatives with respect to x
1
and x
2
into ones with respect to
1
and
2
.
Using the chain rule, one gets

x
1
=

1
x
1
+

2
x
1

x
2
=

1
x
2
+

2
x
2
(1)
However, it is not easy to evaluate the derivatives

1
/x
1
, etc., whereas it is simple to approximate
x
1
/
1
etc. from the grid geometry:
x
1

(x
1
)
e
(x
1
)
w

1
(2)
s
n

e
w
x2
2
1
1 x
We thus start by applying the chain rule to express
1
and
2
derivatives
in terms of x
1
and x
2
ones:

1
=

x
1
x
1

1
+

x
2
x
2

2
=

x
1
x
1

2
+

x
2
x
2

2
(3)
Body-Fitted Grids 2010/11 6 / 20
These transformations can be written in matrix form:
_

2
_
=
_
x
1

1
x
2

1
x
1

2
x
2

2
__

x
1

x
2
_
(4)
Inverting this system gives
_

x
1

x
2
_
=
1
|J|
_
x
2

2

x
2

x
1

2
x
1

1
__

2
_
=
1
|J|
_

11

12

21

22
__

2
_
(5)
where the Jacobian |J| is given by
|J| =
x
1

1
x
2

x
2

1
x
1

2
(6)
Thus we can write

x
1
=
1
|J|
_

11

1
+
12

2
_
=
1
|J|
_

1
(
11
) +

2
(
12
)
_
(7)

x
2
=
1
|J|
_

21

1
+
22

2
_
=
1
|J|
_

1
(
21
) +

2
(
22
)
_
(8)
Body-Fitted Grids 2010/11 7 / 20
These transformations are easily extended to 3-D, and can be written in
general as

x
i
=
1
|J|
_

ij

j
_
=
1
|J|

j
_

ij

_
(using summation convention) (9)
where
ij
are the cofactors of the transformation matrix
_
_
_
_

3
_
_
_
_
=
_
_
_
_
x
1

1
x
2

1
x
3

1
x
1

2
x
2

2
x
3

2
x
1

3
x
2

3
x
3

3
_
_
_
_
_
_
_
_

x
1

x
2

x
3
_
_
_
_
(10)
The cofactors are dened as
ij
= (1)
i +j
D
ij
where D
ij
is the determinant
of the 22 matrix formed by omitting row i and column j from the
transformation matrix.

11
= (a
22
a
33
a
23
a
32
)

23
=(a
11
a
32
a
12
a
31
)
etc. . .
a
11
a
12
a
13
a
21
a
31
a
22
a
a
32
a
33
23
Body-Fitted Grids 2010/11 8 / 20
The terms x
1
/
1
, x
1
/
2
, x
2
/
1
, x
2
/
2
etc. are simply
geometry-related quantities, which can be computed numerically from the
grid, and stored at the beginning of a simulation:
x
1

1
=
(x
1
)
e
(x
1
)
w

1
etc. (11)
s
n

e
w
x2
2
1
1 x
To obtain the nite volume formulation, one can now proceed to integrate
the transformed equations over the control volume.
Although we will work mostly in 2-D below, the method and results are
readily extended to 3-D.
Body-Fitted Grids 2010/11 9 / 20
Convection Terms
The convection terms for a variable can be written (using summation
convention) as
U
j

x
j
=
U
j
|J|

jk

k
=
_

U
k
/|J|
_

k
=
1
|J|
(

U
k
)

k
(12)
where the transformed convective velocity

U
k
/|J| =U
j

jk
/|J|.
Integrating convection terms over the control volume gives:
___
(U
j
)
x
j
dx
1
dx
2
dx
3
=
___
1
|J|
(

U
k
)

k
|J|d
1
d
2
d
3
(13)
=
___
(

U
k
)

k
d
1
d
2
d
3
(14)
which can be approximated in a similar manner to the Cartesian case
already considered.
Body-Fitted Grids 2010/11 10 / 20
In 2-D, we have
__

1
_

U
1

_
+

2
_

U
2

_
d
1
d
2
=
_
_

U
1
d
2
_
e
w
+
_
_

U
2
d
1
_
n
s
(15)

U
1

2
_
e
w
+
_

U
2

1
_
n
s
(16)


U
1
and

U
2
essentially give the velocity components normal to the cell
faces, so the convection terms again become
C
e

e
C
w

w
+C
n

n
C
s

s
where C
e
, C
w
, C
n
, C
s
are the mass uxes through the cell faces.
The same schemes (upwind, QUICK, etc) can again be used to
approximate the cell face values
e
,
w
etc.
Body-Fitted Grids 2010/11 11 / 20
Diffusion Terms
The diffusion terms for a variable can be written as

x
j
_


x
j
_
=
1
|J|

i
_

ji

x
j
_
(17)
=
1
|J|

i
_

|J|

ji

jk

k
_
=
1
|J|

i
_

|J|
B
ik

k
_
(18)
where B
ik
=
ji

jk
.
Again, these can now be integrated in a similar way to the Cartesian
case:
___

x
j
_


x
j
_
dx
1
dx
2
dx
3
=
___
1
|J|

i
_

|J|
B
ik

k
_
|J|d
1
d
2
d
3
(19)
=
___

i
_

|J|
B
ik

k
_
d
1
d
2
d
3
(20)
Body-Fitted Grids 2010/11 12 / 20
However, the result is not as simple as for the convection terms. In 2-D
we get
__

1
_

|J|
_
B
11

1
+B
12

2
__
+

2
_

|J|
_
B
21

1
+B
22

2
__
d
1
d
2
=
_
_

|J|
_
B
11

1
+B
12

2
_
d
2
_
e
w
+
_
_

|J|
_
B
21

1
+B
22

2
_
d
1
_
n
s
(21)

_

|J|

2
_
B
11

1
+B
12

2
__
e
w
+
_

|J|

1
_
B
21

1
+B
22

2
__
n
s
(22)

_
B
11

2
|J|
_
e

1e

_
B
11

2
|J|
_
w

1w
+
_
B
12

2
|J|

2
_
e
w
+
_
B
22

1
|J|
_
n

2n

_
B
22

1
|J|
_
s

2s
+
_
B
21

1
|J|

1
_
n
s
(23)
Body-Fitted Grids 2010/11 13 / 20
In contrast to the orthogonal case, where one simply gets the terms
which can be treated implicitly, we now have additional terms, which must
usually be evaluated explicitly and added to the source terms of the
discretized equation.
The additional terms, those involving
(/
2
)
e
etc., can be approximated by
interpolating to cell corners:
_

2
_
e


ne

se

2e
(24)
x
2
1
x

1
ne
nw
sw
se
P
E
N
W
S
The diffusion terms as a whole now give rise to an expression of the form
a
d
e

E
+a
d
w

W
+a
d
n

N
+a
d
s

S
a
d
p

P
+S
d
u
(25)
where S
d
u
includes all the contributions from the non-orthogonal diffusion
terms.
Body-Fitted Grids 2010/11 14 / 20
When all terms are combined into a set of discretized equations of the
form
a
p

P
=a
e

E
+a
w

W
+a
n

N
+a
s

S
+S
u
(26)
the source term S
u
now contains the additional terms arising from
approximating the diffusion terms on the nonorthogonal grid.
As the grid becomes more skewed and non-orthogonal, these additional
source terms become greater, and the diffusion effects included implicitly
in the coefcients a
e
, a
w
, a
n
and a
s
become smaller. This results in a
stiffer set of equations, meaning less numerical stability and slower
convergence.
Body-Fitted Grids 2010/11 15 / 20
Cell-Face Interpolation Errors
When deriving the nite volume scheme, we
typically approximate
_
e
fdS f
e
S (27)
where f
e
is evaluated at the centre of the
face, by interpolating from nodes P and E.
P
E
e
S
In a highly non-orthogonal grid, as shown, the approximation
f
e
(f
P
+f
E
)/2 may not give a very accurate estimate of f at the face
centre. In extreme cases the interpolation point might not even lie on the
face.
Highly non-orthogonal grids thus introduce errors via these routes, as
well as the approximation of diffusion terms outlined above.
Body-Fitted Grids 2010/11 16 / 20
Near-Wall Grids
The use of non-orthogonal grids does allow more complex geometrical
domains to be considered.
However, it is as well to try keeping the non-orthogonality as small as
possible, to minimize the stability and numerical accuracy problems
outlined above.
The above is a particularly important point to consider near a wall.
A ne grid is usually required in the direction
normal to the wall, typically leading to large
aspect ratio cells.
This, in itself, tends to lead to slow convergence as a result of the
coefcients in the wall-normal direction being considerably larger than
those associated with the direction parallel to the wall.
Body-Fitted Grids 2010/11 17 / 20
Block-structured grids can sometimes be used to retain nearly orthogonal
grid lines around a surface, despite having signicant non-orthogonalities
in the outer ow regions.
For example, the grid below could be used for computing ow through a
blade cascade (see lab exercise).
Body-Fitted Grids 2010/11 18 / 20
Unstructured Grids
The use of the non-orthogonal quadrilateral (or hexahedral in 3-D) cells
outlined above does allow great exibility in the handling of complex
geometries, particularly when used in a multi-block solver.
However, it is sometimes desirable to not have the restriction of a
structured mesh.
In an unstructured mesh, there is no pre-dened ordering of the cells, as
there is with a structured grid.
Techniques such as local grid renement
thus become somewhat easier, as adding
cells in one region of the domain need not
have a great impact on the grid density in
other regions.
On an unstructured grid, integration of the governing equations over a
control volume again leads to a discretized equation relating the value of
at P to the values of at the neighbouring nodes.
Body-Fitted Grids 2010/11 19 / 20
However, many of the same
accuracy and stability issues
encountered above when
considering non-orthogonal
grids arise in this case also.
It is, therefore, again true that,
the more skewed the grid cells
are, the slower and less stable
the convergence often is.
Another consideration when using an unstructured grid is that it is often
difcult to use high order convection schemes. For example, the QUICK
scheme introduces
EE
,
WW
etc. into the computational stencil, but in an
unstructured grid we cannot always identify such nodes.
Body-Fitted Grids 2010/11 20 / 20

You might also like