You are on page 1of 15

Different Methods for Discretization of Governing Equations

Finite Difference Method (FD)

Finite Volume Method (FV)

Finite Element Method (FE)

Professor Qing Xiao NM963 Theory and practice of marine CFD 1


FD vs. FV
u v
FD -- differential forms + =0
x y
✓ Approximation of nodal derivative
✓ Simple and effective, easy to derive
✓ Limited to (block-)structured meshes

FV -- integral forms
✓ Approximation of integrals
✓ Conservative by construction
✓ Suitable to arbitrary meshes

 

S
V  dS = 0

Professor Qing Xiao NM963 Theory and practice of marine CFD 2


Finite Difference Method (FD) (1/2)
FD discretise the governing differential equations directly

For example, for a 2D continuity equation, we can discretise it to

u v ui +1, j − ui , j vi , j +1 − vi , j
+ =0 + =0
x y x y

This is based on the Taylor series expansion. If we develop any (x0+x) at x0, as
a Taylor series in x, we obtain
 x 2  2
( x0 + x) = ( x0 ) + x + + ....
x x0 2 x x 2
0

With this, the 1st derivative of  can be approximated as y

 ( x0 + x) − ( x0 )
= + O(x) x
x x
Professor Qing Xiao NM963 Theory and practice of marine CFD 3
Finite Difference Method (FD) (2/2)
u  3u (x)3
ui +1, j − ui −1, j = 2( ) i , j x + 2( 3 ) i , j + .....
x x 6
u ui +1, j − ui −1, j
( )i , j = + O(x) 2
x 2x
vi , j − vi , j −1
+ O(y ) Backward difference
y
v vi , j +1 − vi , j
( )i , j = + O(y ) Forward difference
y y
vi , j +1 − vi , j −1
+ O(y ) 2 Cetral difference
2y
u v ui +1, j − ui −1, j vi , j +1 − vi , j −1
+ =0 + =0
x y 2x 2y

❑ For an uniformed grid with x=  y

ui +1, j − ui −1, j + vi , j +1 − vi , j −1 = 0
Professor Qing Xiao NM963 Theory and practice of marine CFD 4
FD Advantages & Disadvantages
Advantages
✓ Simplicity
✓ Possibility to easily obtain high-order approximations, and hence to
achieve high-order accuracy of the spatial discretisation

Disadvantages

✓ Structured grid based; generally be applicable to regular-shaped


domains

Professor Qing Xiao NM963 Theory and practice of marine CFD 5


Finite Volume Method (FV)
FV method discretise the integral form governing equations – it
directly utilizes the conservation laws.

Cell-centred storage; structured grid Cell indexing

Professor Qing Xiao NM963 Theory and practice of marine CFD 6


Finite Volume Method (FV)
FV method discretise the integral form governing equations – it
directly utilizes the conservation laws.

For example, the integral form of the continuity equation is


    


V  dS = 0 t V
(  ) dV + S ( V ) n  dS = S (  grad  ) n  dS +  S dV
S V

Discretise above equation for one control-volume cell shown


( uA) e − ( uA) w + ( vA) n − ( vA) s = 0
vn
❑ A – surface area uw ue
for a Cartesian mesh, Ae=Aw=y; An=As=x
vs y
❑ For an incompressible flow …. & uniformed
grid with dx=dy u − u + v − v = 0 x
e w n s

Professor Qing Xiao NM963 Theory and practice of marine CFD 7


FV Features

Compared to FD, FV is very flexible –FV is particular suitable for


the treatment of flows in complex geometries.

FV enforces physical variables conservation features.

FV is commonly used in fluid mechanics modelling

Professor Qing Xiao NM963 Theory and practice of marine CFD 8


Tutorial 2
Use Finite Difference Method to solve the velocity profile in Q1.
Assume the depth of the channel H=0.2 m, dynamic viscosity μ=10-
3 kg/m∙s, pressure drop per unit length in x axis direction is 0.04

Pa. The depth of the channel is divided into N (N=4 in this case)
equally-sized cells of dimension xy as shown, with the velocity
uj using a cell vertex storage.

3 H2 p  y2 
u( y) = ( )(− ) 1 − 
2 12 x  ( H / 2) 2 
p
pressure drop (known)
x
Professor Qing Xiao NM963 Theory and practice of marine CFD 9
Finite Volume Decomposition
Use Finite Volume Method to solve the velocity profile in Q1.
Assume the depth of the channel H=0.2 m, dynamic viscosity μ=10-
3 kg/m∙s, pressure drop per unit length in x axis direction is 0.04

Pa. The depth of the channel is divided into N (N=4 in this case)
equally-sized cells of dimension xy as shown, with the velocity
uj using a cell vertex storage.

Professor Qing Xiao NM963 Theory and practice of marine CFD 10


Finite-Volume Discretization
   

t V
(  )dV +  ( V)n  dS =  ( grad  )n  dS +  S dV
S S V

▪ Governing equation 𝜕𝑢 1 𝜕𝑝
ර 𝑑𝑆 = ර 𝑑𝑆
𝑆 𝜕𝑦 𝜇 𝑆 𝜕𝑥

▪ Integral at each cell surface


𝑑𝑢 𝑑𝑢 1 𝜕𝑝
− = ∙ ∆𝑦
𝑑𝑦 𝑛
𝑑𝑦 𝑠
𝜇 𝜕𝑥
▪ Discretization first derivative of u at cell faces

1 1 1 𝜕𝑝 𝑗 = 2…𝑁
𝑢𝑗+1 − 𝑢𝑗 − 𝑢𝑗 − 𝑢𝑗−1 = ∙ ∆𝑦
∆𝑦 𝑗+1 ∆𝑦 𝑗−1 𝜇 𝜕𝑥

Note: node j must be an internal node (not a boundary node)


Professor Qing Xiao NM963 Theory and practice of marine CFD 11
Assembled equations
▪ Discretized equation for each cell
1 𝜕𝑝
𝑢𝑗+1 − 2𝑢𝑗 + 𝑢𝑗−1 = ∙ ∆𝑦2 =D
𝜇 𝜕𝑥

▪ Matrix form of equations


𝜕𝑝
Given H=0.2 m; μ=10-3 kg/m∙s; = 0.04 Pa; n=4;  D=0.1
𝜕𝑥
1 0 0 0 0 𝑢1 0
1 −2 1 0 0 𝑢2 D This matrix is tri-diagonal
0 1 −2 1 0 𝑢3 = D
0 0 1 −2 1 𝑢4 D
0 0 0 0 1 𝑢5 0
𝑢1 = 0
𝑢2 = 0.15
▪ Final solution at each CFD grid 𝑢3 = 0.2
𝑢4 = 0.15
𝑢5 = 0
Professor Qing Xiao NM963 Theory and practice of marine CFD 12
Discussions

▪ The exact solution is 𝑢 𝑦 = 20𝑦 2 − 0.2

▪ The same solution from FV & FD

Professor Qing Xiao NM963 Theory and practice of marine CFD 13


Points to note
▪ Each control volume gives one equation ▪ Governing equations
discretization
▪ Each equation is a linear equation
connecting the central node and nodes ▪ Assembly equations
on either side ▪ Solving equations
▪ Boundary values are incorporated into
the equation

▪ The resulting matrix is tri-diagonal

Professor Qing Xiao NM963 Theory and practice of marine CFD 14


Practice
Heat conduction is a typical example of pure diffusion process. Assume
one building wall is infinite large, due to the temperature difference at the
surface of inside and outside wall, heat transfers across the thickness of
wall. Given that the heat transfer occurs in x-direction only, the
temperature at x=0 and x=L planes (walls) are T1 = 500 degree and T5
=100 degree, respectively. Assuming N=4 cells are used as CFD mesh,
use discretization method to prove that the temperate inside the wall are
T2=400, T3=300, T4=200.

Professor Qing Xiao NM963 Theory and practice of marine CFD 15

You might also like