Professional Documents
Culture Documents
Pre-processing:
– creating geometry
– grid-generation
– governing equations
– boundary conditions
Solving
Post-processing
Pre-processing
Solving:
– discretisation
– solution of equations
Post-processing
1
Pre-processing
Solving
Post-processing:
– analysis
– visualisation
CFD Codes
Commercial Codes:
– STAR-CCM+
– Fluent
– FLOW3D
– PowerFLOW
– COMSOL
Open source:
– OpenFOAM
– CodeSaturne
General portals:
– www.cfd-online.com
2
Mesh Generation
Function:
– to decompose the domain into control volumes
Constraints:
– flow geometry
– capabilities of the solver
Output:
– cell vertices (x, y, z)
– connectivity data
Mesh Arrangements
Staggered / co-located
…
Storage Locations
cell-centred cell-vertex
u p
staggered
3
Cell Shapes
hexahedron tetrahedron
Face Areas
Triangles s2
A
A 12 s1 s 2
s1
A
r4
Quadrilaterals r3
4 points are not necessarily coplanar
Vector area is independent of spanning surface
A
A 12 d13 d24 12 (r3 r1 ) (r4 r2 )
r2
r1
4
Some Vector Calculus (Not Examinable)
( , , ) is both a vector and a differential operator
x y z
Gradient: grad () ( , , )
x y z
f x f y f z
Divergence: div f f
x y z
i j k
Curl: curl f f
x y z
fx fy fz
Integral Theorems
f dA
Gauss’ Divergence Theorem: f dV
V
V
f dA f ds
Stokes’ Theorem:
A A
Volumes
Position vector: r ( x, y, z )
x y z
Divergence: r 3
x y z
V
1
r dA
3 V
Volumes
V
1
Arbitrary volume: r dA
3 V
1
General polyhedron: V r f A f
3 faces
Tetrahedron Hexahedron
s3
s1
s2
V s1 s 2 s 3
1
6
V 13 r
faces
f Af
r f 14 (r1 r2 r3 r4 )
5
2-D Case
Cell-Averaged Derivatives
1 1 1
1
dV (e x ) dV e x dA dAx
x av V V x V V V
V
V
V
1
x
(,0,0)
x av V
faces
f A fx
1
( av
1
dA
() av
V
f Af
V faces
V
An
Hexahedra:
1 Aw n
() av w A w e A e s A s n A n b Ab t At ) w e
V
s Ae
As
Cartesian cell:
e w e Α w Α 1
area A
x
Δx
AΔx
(e Αex w Αwx )
V
V
x
Example
A tetrahedral cell has vertices at A(2, –1, 0), B(0, 1, 0), C(2, 1, 1) and D(0, –1, 1).
(a) Find the outward vector areas of all faces. Check that they sum to zero.
(b) Find the volume of the cell.
(c) If the values of at the centroids of the faces (indicated by their vertices) are
BCD = 5, ACD = 3, ABD = 4, ABC = 2,
find the volume-averaged derivatives , ,
x av y av z av
6
Example
d a
Find:
(-2,-3)
(a) the area of the pentagon; e
(2,-4)
(b) the cell-averaged derivatives ,
x av y av
Example
The figure shows the vertices of a single triangular cell in a 2-d unstructured finite-
volume mesh. The accompanying table shows the pressure p and velocity (u,v) on
the faces marked a,b,c at the end of a steady, incompressible flow simulation.
(3,5)
edge p u v
a 3 5 –1 c
b 5 7 –5 b
c 2 uc –6 y, v
Find: (1,1)
a
(a) the area of the triangle; x, u (4,0)
(b) the net pressure force (per unit depth) on the cell;
(c) the outward volume flow rate (per unit depth) for all faces;
(d) the missing velocity component uc;
(e) the cell-averaged velocity gradients u/x, u/y, v/x, v/y.
(f) Define, mathematically, the acceleration (material derivative) Du/Dt. If the
velocity at the centre of the cell is u = (16/3,–4), use this and the gradients from
part (e) to calculate the acceleration.
Structured Grids
Control volumes indexed by (i, j, k)
Cartesian Curvilinear
7
Unstructured Grids
P
a F F
0
aP large number
f=0
f=1 0<f<1
f=0
8
Fitting Complex Boundaries
− Curvilinear (Body-Fitted) Grids
Curvilinear Grids
d
(amount) (advection diffusion ) source
dt faces
=
const.
Diffusion: con
st.
E =
– also requires derivatives parallel to cell faces
P
P
Γ A Γ E A
n Δ PE
v
Advection: u
– all velocity components contribute to mass flux
2 3 4 2 3 4
1 5 1 6 7 8 5
6 7 8
4 5
1 2 3
Multiple structured blocks
Grid lines may or may not match at block boundaries
Arbitrary interfaces allow non-coincident grid vertices
Sliding grids used for rotating machinery (pumps; turbines)
9
Fitting Complex Boundaries
− Overset (Chimera) Grids
10
Richardson Extrapolation
Order n error Δn
Δ * CΔn
2Δ * C (2Δ) n
Example
(b) estimate the error at this point using the mesh-A solution.
11
Summary of Grids
Dictated by:
– flow geometry
– solver capabilities
Boundary Conditions
Boundary Conditions
Inlet:
– velocity inlet
– stagnation / reservoir inlet
Outlet:
– standard outlet
– pressure boundary
– radiation boundary
Wall:
– non-slip (rough/smooth; moving/stationary; adiabatic/heat-transfer)
– slip (inviscid case)
Symmetry plane
Periodic boundary
Free surface
12
Flow Visualisation
Types of Plot
13
x-y Graphs
x-y Graphs
− Assessment
• Simple
• Widely-available software
Contour Plots
14
Contour Plots
− Assessment
Vector Plots
Vector Plots
− Assessment
15
Streamline Plots
Calculating Streamlines
dx
3D: integrate a particle path u
dt
2 2 dψ u dy v dx volume flux
volume flux
dy u
ψ ψ
dx u , v
1
1 y x
-v
Example
(a) Two adjacent cells in a 2-dimensional Cartesian mesh are shown below, along
with the cell dimensions and some of the velocity components (in m s–1) normal
to cell faces. The value of the stream function at the bottom left corner is
A = 0. Find the value of the stream function at the other vertices B to F. (You
may use either sign convention for the stream function.)
D E 2 F
2 3 1 0.1 m
5
A B C
0.3 m 0.2 m
(b) Sketch the pattern of streamlines across the two cells in part (a).
16
Mesh Plots
Composite Plots
Composite Plots
17
Composite Plots
18