Professional Documents
Culture Documents
Computational Fluid
Dynamics
(CFD)
Tao Xing and Fred
Stern
IIHRHydroscience & Engineering
C. Maxwell Stanley Hydraulics Laboratory
The University of Iowa
58:160 Intermediate Mechanics of Fluids
http://css.engineering.uiowa.edu/~me_160/
Sept. 7, 2007
Outline
1.
2.
3.
4.
5.
6.
7.
8.
What is CFD?
Aerospace
used?
Aerospace
Automotive
Biomedical
Chemical
Biomedical
F18 Store Separation
Processing
HVAC
Hydraulics
Marine
Oil & Gas
Power Generation
Sports
Automotive
Aerospacee
Automotive
Biomedical
Chemical
Processing
HVAC
Hydraulics
Marine
Oil & Gas
Power Generation
Sports
Hydraulics
HVAC
Streamlines for workstation
ventilation
Sports
Aerospace
Automotive
Biomedical
Chemical Processing
HVAC
Hydraulics
Marine
Oil & Gas
Power Generation
Sports
Oil & Gas
Flow of lubricating
mud over drill bit
Power Generation
Flow around cooling
towers
Modeling
Modeling is the mathematical physics
Modeling (coordinates)
z
Cartesian
(x,y,z)
Cylindrical
(r,,z)
z Spherical
(r,,)
z
y
x
y
x
General orthogonal
Coordinates
10
Modeling (governing
equations)
Navier-Stokes equations (3D in Cartesian coordinates)
2u 2 u 2u
u
u
u
u
p
u
v
w
2 2
2
t
x
y
z
x
y
z
x
2v 2v 2v
v
v
v
v
p
u
v
w
2 2
2
t
x
y
z
y
y
z
x
2w 2w 2w
w
w
w
w
p
u
v
w
2 2
2
t
x
y
z
z
x
y
z
Local
acceleration
Convection
Viscous terms
u v w
0 Continuity equation
t
x
y
z
p RT
D 2 R 3 DR 2
pv p
R
(
)
Dt 2
2 Dt
L
Equation of state
Rayleigh Equation
11
(Re)
12
Modeling(boundary
conditions)
Boundary conditions:
No-slip or slip-free
on walls, periodic, inlet (velocity inlet, mass flow
rate, constant pressure, etc.), outlet (constant
pressure, velocity convective, numerical beach, zerogradient), and non-reflecting (for compressible flows,
such as acoustics), etc.
Inlet ,u=c,v=0
r
v=0, dp/dr=0,du/dr=0
Axisymmetric
14
Modeling (selection of
models)
CFD codes typically designed for solving
certain fluid
phenomenon by applying different models
(Re)
model)
15
vortical structures and very thin turbulent boundary layer (BL) near
models:
theTurbulent
wall
resolving BL
Free-surface
models:
DES: RANS inside
BL, LES in separated regions.
Surface-tracking method: mesh moving to capture free
surface,
limited to small and medium wave slopes
17
Numerical methods
The continuous Initial Boundary Value
18
Discretization methods
Finite difference methods (straightforward to apply,
19
Discretization methods
(Contd)
Explicit methods can be easily applied but yield
20
Discretization methods
(example)
2D incompressible laminar flow boundary layer
(L,m+1)
u v
0
x y
(L-1,m)
u
u
p
2u
u
v
2
x
y
x e
y
u uml
uml uml 1
u
x x
u vml
uml 1 uml
v
y y
vml
uml uml 1
y
m=MM+1
m=MM
(L,m)
m=1
m=0
(L,m-1)
L-1
2u
21
Discretization methods
(example)
B
B2
3
1
B1
FD
l
uml
2 l
vml
vml
y
l
vm
2 um
FD um 1
BD
uml 1
2
2
1
x
y
y
y y
BD y
l
p
/
e
m
x
uml l 1
um ( p / e)lm
x
x
B4
B2
B
1
B3
B2
0
0
0
0
0
B3
0
0
0
0
0
0
0
0
0
0
0
0
B1
0
0
0
B2
B1
0
u
B3
B2
umm
p
l 1
B4u1
x e 1
l
1
Bu
p
x e mm
l
l 1
4 mm
Solve it using
Thomas algorithm
22
23
(hexahedral) or unstructured
(tetrahedral). Depends upon type of
discretization scheme and application
Scheme
Finite differences: structured
Finite volume or finite element:
structured or unstructured
Application
Thin boundary layers best resolved
with highly-stretched structured
grids
Unstructured grids useful for
complex geometries
Unstructured grids permit
automatic adaptive refinement
based on the pressure gradient, or
regions interested (FLUENT)
structured
unstructured
24
Transform
o
Physical domain
Computational domain
f f f
f
f
x
x
x x x
y
y
derivatives at these two domains have the
y y y
25
26
CFDSHIPIOWA
27
Lab3: Diffuser
1. Boundary conditions
2. Effect of order of accuracy
on verification results
3. Effect of grid generation
topology, C and O
Meshes
4. Effect of angle of
attack/turbulent models on
flow field
5. Verification and Validation
using EFD
28
CFD process
Purposes of CFD codes will be different for different
CFD Process
Geometry
Physics
Mesh
Solve
Reports
PostProcessing
Select
Geometry
Heat Transfer
ON/OFF
Unstructured
(automatic/
manual)
Steady/
Unsteady
Forces Report
Contours
Compressible
ON/OFF
Structured
(automatic/
manual)
Iterations/
Steps
XY Plot
Vectors
Flow
properties
Convergent
Limit
Verification
Streamlines
Viscous
Model
Precisions
(single/
double)
Validation
Boundary
Conditions
Numerical
Scheme
Geometry
Parameters
Domain
Shape and
Size
(lift/drag, shear
stress, etc)
Initial
Conditions
30
Geometry
Physics
Flow conditions and fluid properties
32
Mesh
Meshes should be well designed to resolve
important flow features which are dependent
upon flow condition parameters (e.g., Re), such as
the grid refinement inside the wall boundary layer
Mesh can be generated by either commercial
codes (Gridgen, Gambit, etc.) or research code
(using algebraic vs. PDE based, conformal
mapping, etc.)
The mesh, together with the boundary conditions
need to be exported from commercial software in
a certain format that can be recognized by the
research CFD code or other commercial CFD
software.
33
Solve
Setup appropriate numerical parameters
Choose appropriate Solvers
Solution procedure (e.g. incompressible flows)
Solve the momentum, pressure Poisson
equations and get flow field quantities, such
as velocity, turbulence intensity, pressure
and integral quantities (lift, drag forces)
34
Reports
Reports saved the time history of the
35
Post-processing
Analysis and visualization
Calculation of derived variables
Vorticity
Wall
shear stress
Calculation of integral parameters: forces,
moments
Visualization (usually with commercial
software)
Simple 2D contours
3D contour isosurface plots
Vector plots and streamlines (streamlines
are the lines whose tangent direction is the
same as the velocity vectors)
Animations
36
Post-processing (Uncertainty
Assessment)
Simulation error: the difference between a simulation
result S and the truth T (objective reality), assumed
composed of additive modeling SM and numerical SN
errors:
2
2
2
S S T SM SN
U S U SM U SN
U
j
SN
I
G
T
P
that error estimate UScN j 1
37
solutions corresponding
,and S k 3
S k 1 to fineS k 2 , medium
coarse meshes
k 21 Sk 2 S k1
k 32 Sk 3 Sk 2
Rk k 21 k 32
(i). Monotonic convergence: 0<Rk<1
(ii). Oscillatory Convergence: Rk<0; | Rk|<1
(iii). Monotonic divergence: Rk>1
(iv). Oscillatory divergence: Rk<0; | Rk|>1
38
Post-processing (Verification:
Iterative Convergence)
(b)
UI
1
( SU S L )
2
Iteration history for series 60: (a). Solution change (b) magnified view of total
resistance over last two periods of oscillation (Oscillatory iterative convergence)
39
km
Skm SC xkm
i 1
Sk1 S C xk1
pk(1)
pk
ln k32 k21
ln rk
pk(1)
(1)
k
pk( i )
(1)
k
j 1, j k
*
k1
g
(i )
k
j 1, j k
j 1, j k
j 1, j k
k*m xkm
n
g k i
Sk 2 S C rk xk1
*
j3
pk i
i 1
*
jm
*
j1
*
REk 1
pk(1)
(1)
k
j 1, j k
*
j2
k21
pk
rk 1
41
1. Correction
factors
pkest
Ck
*
RE
k1
Ck
rkpk 1
pkest
k
k 21
rkpk 1
nd
9.6 1 C 2 1.1 *
k
REk 1
Uk
*
2 1 Ck 1 RE
k1
U kc 1C 1 * *
[| 1 kC k |] |REkRE1 |
k1
1 Ck 0.125
1 Ck 0.125
1 Ck 0.25
| 1 C k | 0.25
*
U kc Fs 1 RE
k1
Oscillatory Convergence: Uncertainties can1 be estimated, but without
signs and magnitudes of the errors. U k SU S L
2
Divergence
In this course, only grid uncertainties studied. So, all the variables with
subscribe symbol k will be replaced by g, such as U k will be Ug
2. GCI approach
*
U k Fs RE
k1
42
Post-processing (Verification,
Asymptotic Range)
Asymptotic Range: For sufficiently small xk,
the solutions are in the asymptotic range
such that higher-order terms
are negligible
i
i
gk
pk
and the assumption
that
and
are
independent of xk is valid.
pk
When Asymptotic Range reached,
will be
pk
close to the theoretical
value
, and the
Ck
correction
factor
est
will be close to 1.
To achieve the asymptotic range for practical
geometry and conditions is usually not
possible and m>3 is undesirable from a
resources point of view
43
To avoid
ill-defined ratios, L2 norm of the G21 and G32 are used to
define RG and PG
ln G
G
RG G21
G32
pG
32
ln rG
21
Where <> and || ||2 are used to denote a profile-averaged quantity (with ratio of
solution changes based on L2 norms) and L2 norm, respectively.
NOTE: For verification using AFD for axial velocity profile in laminar pipe flow (CFD
Lab1), there is no modeling error, only grid errors. So, the difference between CFD and
AFD, E, can be plot with +Ug and Ug, and +Ugc and Ugc to see if solution was
verified.
44
E D S D ( SM SN )
2
U V U SN
U D2
Validation example
Example: Grid study
and validation of
wave profile for
series 60
45
47
49
50
processing)
51
Lab1:
Pipe Flow
Sept. 7
Schedu
le
Lab 2:
Airfoil Flow
Lab3:
Diffuser
Sept. 24
Oct. 15
Lab4:
Ahmed car
Nov. 12
52