Escolar Documentos
Profissional Documentos
Cultura Documentos
Martin Skote
Assistant Professor
School of Mechanical & Aerospace Engineering
Contact: mskote@ntu.edu.sg
67904271, N3-02b-58
Computational Fluid
Dynamics: An Introduction
to; The Finite Volume
Method 2nd ed
Author
: H K Versteeg
W Malalasekera
Publisher : Pearson
ISBN
: 9780131274983
Lecture 1: Introduction
What is CFD.
What is numerical methods.
CFD software
Fluent, STAR-CCM+
Tutorials first
Layout of CAE Lab 2
CFD software
Shareware CFD
http://www.cfd-online.com/Links/soft.html
http://www.cfdreview.com/links.shtml#Software
Simple interactive example: Wtunnel app
Example: Sports
Swimming
10
Example: Sports
Cycling
11
12
13
Benefits of CFD
Ability to study systems where controlled experiments are difficult or
impossible to perform (e.g. climate change)
Ability to study systems under hazardous conditions at and beyond their
normal performance limits (e.g. accident scenarios)
Ability to simulate ideal conditions.
CFD provides the ability to isolate or exclude specific phenomena
(e.g. gravity set to zero).
Practically unlimited level of detail of results
Experiments only permit data to be extracted at a limited number of
locations in the system (e.g. pressure and temperature probes, heat flux
gauges, etc.).
CFD allows the analyst to examine a large number of locations in the
region of interest, and yields a comprehensive set of flow parameters for
examination.
14
Limitations of CFD
Physical models.
The CFD solutions can only be as accurate as the physical
models on which they are based. Is the PDE an accurate model of
the physics?
Numerical errors.
Solving equations on a computer introduces numerical errors
which will go to zero as the grid (mesh) is refined. (But we want as
coarse mesh as possible in order to save time).
15
Numerical methods
Translate physics to a mathematical formulation PDE
Transform the task of solving the PDE into a numerical problem
using a grid (mesh)
Apply the boundary conditions
Solve the numerical problem with computers
Present the results by plotting the value of variables
16
( x) =( x 4 ) + 2
2
17
1 at x1
2 at x2
3 at x3
4 at x4
5 at x5
18
20
PDE
a11
2
a1
0
0
0
a12
a22
a23
0
0
a32
a33
a34
0
0
a43
a44
a45
0 1 S 1
0 2 S 2
0 3 = S 3
a54 4 S 4
a55 5 S 5
22
0
0
a12
0
a32
a33
a34
a22
a23
0
0
a43
a44
a45
0 1 S 1
0 2 S 2
0 3 = S 3
a54 4 S 4
a55 5 S 5
Answer we get:
1
x1
x
2
2
3 at point x3
4
x4
5
x5
23
24
dx
26
Notation:
( xi ) = i
( xi 1 ) = i 1
d i i 1
=
dx i x xi xi 1
The smaller is, the better the approximation is. See Appendix
27
L1A.
d
=
dx
What we
seek are:
BC:
1
(=
x 0)= =
A
1
x1
x
2
2
3 at point x3
4
x4
5
x5
Grid:
=
x=0
L 1
= = 0.2
5 5
x1 0.1
x 0.3
2
x3 = 0.5
x4 0.7
x5 0.9
x=L=1
28
Example of discretization
Equation :
d
=
dx
BC:
1
(=
x 0)= =
A
Grid:
=
x=0
x=L=1
d
i =
dx i
i = 1, 2,3, 4,5
d i i 1
dx i xi xi 1
Using
i =
i i 1
xi xi 1
29
Example of discretization
Equation :
d
=
dx
BC:
Grid:
1
(=
x 0)= =
A
Discretized equation:
=
x=0
i =
i i 1
xi xi 1
i 1 =
A xi x=
x/2
i=1 ( Point 1) :=
i 1
i 1
i 2 =
1 xi x=
x
i=2 ( Point 2 ) :=
i 1
i 1
i 3 =
2 xi x=
x
i=3 ( Point 3) :=
i 1
i 1
i 4 =
3 xi x=
x
i=4 ( Point 4 ) :=
i 1
i 1
i 5 =
4 xi xi 1 = x
i=5 ( Point 5 ) :=
i 1
x=L=1
A
x/2
Point 2: 2 =2 1
x
Point 3: 3 =3 2
x
Point 4: 4 =4 3
x
Point 5: 5 =5 4
x
Point 1: 1 =1
30
Example of discretization
1. Collect the unknowns on the left hand side:
Point 1: 1 ( x / 2 1) =
A
Point 2: 1 + 2 ( x 1) =
0
Point 3: 2 + 3 ( x 1) =
0
Point 4: 3 + 4 ( x 1) =
0
Point 5: 4 + 5 ( x 1) =
0
2. Insert the
known values:
= 1
= 0.2
1 ( 0.1 1) =
1
1 + 2 ( 0.2 1) =
0
2 + 3 ( 0.2 1) =
0
3 + 4 ( 0.2 1) =
0
4 + 5 ( 0.2 1) =
0
0
0
0
0 1 1
0.9
1
0
0.8
0
0
0
2
0
1
0
0 3 = 0
0.8
0
0
1
0.8
0
4 0
0
0
1
0.8 5 0
0
1 1.1111
1.3889
2
3 = 1.7361
2.1701
4
5 2.7127
31
0
0
a12
a22
a23
0
0
0
a32
a33
a34
0
0
0
a43
a44
a45
0
0
0
0
0 0.9
0.8
0
0
0
0 1
1
0
0
0.8
0 = 0
0
1
0.8
0
a54 0
0
0
1
0.8
a55 0
S 1 1
2
S 0
S3 = 0
4
S 0
S 5 0
32
In principle yes.
This method is called the finite difference method (FDM).
A better method is the finite volume method (FVM).
We will use a similar approximation of the derivative in the derivation
of FVM coefficients.
The FVM will also generate a matrix problem:
a11
2
a1
0
0
0
a12
a22
a23
0
0
0
a32
a33
a34
0
0
0
a43
a44
a45
0 1 S 1
0 2 S 2
0 3 = S 3
a54 4 S 4
a55 5 S 5
For one-dimensional (1D) problems, FDM and FVM gives the same
matrix problem.
34
( xi ) = i
( xi +1 ) = i +1
( xi 1 ) = i 1
d i +1 i 1
=
dx i x xi +1 xi 1
Notation
Grid:
=
x=0
x=L
W: west
E: east
36
Notation
Equation:
d
=
dx
i P
d
d
dx
dx
d i +1 i 1 E W
=
2 x
dx i xi +1 xi 1
E W
d
=
P =
P
2 x
dx P
Before setting up the matrix problem, the equation for each point is formulated with
the indecs P E W replaced with the numbers for that point. Example (point 3):
=
P =
E 4=
W 2
3
37
Equation:
d 2
=
2
dx
d 2
2 = P
dx P
38
/2 /2
Write as one
derivative at a time
d 2 d d
=
2 =
P
dx P dx dx P
e w
d
=
=
x
dx P x
f
df
=
=
dx P x
fe f w
x
39
/2 /2
General expression:
Let
df d
=
f
=
dx P dx P
fe f w
x
d d
d
d d
dx e dx w
f =
=
x
dx
dx dx P
d d
d 2
dx
e dx w
P
=
P
2 =
x
dx P
40
With
/2 /2
d E P
=
dx
x
e
P W
d
=
x
dx w
we can rewrite
the equation as:
d 2
=
Equation:
2
dx
d d
dx e dx w
= P
x
E P P W
2P + W
x
x =
=
P E
P
2
x
x
E 2P + W
= P
2
x
41
42
Conclusion
Physical reality is modeled by PDEs.
CFD is the process of numerically solving the PDEs governing fluid
flow.
Numerical solution is an approximate solution which gets more
accurate the more points there is in the grid (mesh).
To translate the PDE to numerical problem we used the Finite
Difference Method.
In Lecture 3 onward we will use the Finite Volume Method.
43
Appendix L1A
For the motivated students
Not included in the exam
44
( x) =
x
x
d
=
dx x
given by
=
as 0
given by
=
as 0
Example: () = 2
i i 1 xi2 xi21
=
=
=
x xi xi 1 xi xi 1
x 2 ( x x )
x
Thus:
{ xi =
x; xi 1 = x x}=
x 2 x 2 + 2 xx x 2
=
= 2 x x 2 x as x 0
x
as x 0
x
dx
46