Introduction ComputationalFluidDynamics
Introduction ComputationalFluidDynamics
Fluid Dynamics
Dr. Hainam Do
Outline
What is CFD?
Why use CFD?
Where is CFD used?
Physics
Modeling
Numerics
CFD process
Resources
2
What is CFD?
What is CFD and its objective?
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
Twin-screw extruder
– Power Generation modeling
– Sports
Shear rate distribution in twin-
screw extruder simulation 9
Where is CFD used? (HVAC&R)
– Power Generation
– Sports
Flow of lubricating
mud over drill bit 13
Where is CFD used? (Power Generation)
Continuity
u u u u p
x u x x u y x u z x xx yx z x g x
t x y z x x y z
Equation of motion
17
Navier-Stokes Equations
C.L. M. H. Navier, Memoire sur les Lois du Mouvements des Fluides, Mem. de l’Acad. d. Sci.,6, 398 (1822)
C.G. Stokes, On the Theories of the Internal Friction of Fluids in Motion, Trans. Cambridge Phys. Soc., 8, (1845)
Navier-Stokes Equations
(constant and m)
u x u x u x u x p 2 ux 2 ux 2 ux
ux uy uz m 2 2 2 g x
t x y z x x y z
y u u u u y p 2
u 2
u 2
uy
u x y
uy
y
uz m 2 2 2 g y
y y
t x y z y x y z
D
v p m 2v g
Dt 19
Navier–Stokes Example
u y u y u y u y p 2 u y 2 u y 2 u y
u x uy uz m 2 2 2 g y
t x y z y x y z
dp d 2uy
0 m 2 g
dy dx
duy x dp Fluid
Integrate g C1
dx m dy
x2 d p L
Integrate u y g C1 x C2
2m dy
B.C. u y 0 at x 0, u y 0 at x L
y
L dp
C1 C2 0
2m dy
g
x
1 dp
Final Expression u y g ( Lx - x 2
) Laminar Flow
2m dy Static Parallel Plates
20
Modeling
22
Finite Differences
u u i 1, j u i , j 2u x 3u x 2
2 3
x i, j x x i, j 2 x i, j 6
Methods of Solution
u 2u x 2 3u x 3
u i 1, j u i , j x 2 3
x i, j x i, j 2 x i, j 6
x
jmax
j+1
j
y Taylor’s Series Expansion
j-1
u i,j = velocity of fluid
o i-1 i i+1 imax x
Geometry description
Specification of flow conditions and properties
Selection of models
Specification of initial and boundary conditions
Grid generation and transformation
Specification of numerical parameters
Flow solution
Post processing: Analysis, and visualization
Uncertainty assessment
25
Geometry description
Typical approaches
– Make assumptions and
simplifications
– Engineering drawings
– Coordinates include Cartesian
system (x,y,z), cylindrical system (r,
θ, z), and spherical system(r, θ, Φ)
26
Flow conditions and properties
27
Selection of models for flow field
Direct Numerical Simulations (DNS) is to solve the N-S
equations directly without any modeling. Grid must be fine
enough to resolve all flow scales. Applied for laminar flow
and rare be used in turbulent flow.
Reynolds Averaged Navier-Stokes (NS) equations
(RANS) is to perform averaging of NS equations and
establishing turbulent models for the eddy viscosity. Too
many averaging might damping vortical structures in
turbulent flows
Large Eddy Simulation (LES), Smagorinsky’ constant
model and dynamic model. Provide more instantaneous
information than RANS did. Instability in complex
geometries
Detached Eddy Simulation (DES) is to use one single
formulation to combine the advantages of RANS and LES.28
Initial and boundary conditions
For steady/unsteady flow
– IC should not affect final solution, only convergence path,
i.e. iteration numbers needed to get the converged solution.
– Robust codes should start most problems from very crude
IC, . But more reasonable guess can speed up the
convergence.
Boundary conditions
– No-slip or slip-free on the wall, periodic, inlet (velocity
inlet, mass flow rate, constant pressure, etc.), outlet (constant
pressure, velocity convective, buffer zone, zero-gradient),
and non-reflecting (compressible flows, such as acoustics),
etc.
29
Grid generation
Grids can either be structured (hexahedral)
or unstructured (tetrahedral). Depends
upon type of discretization scheme and
application
– Scheme
Finite differences: structured
31
Grid generation and transformation
32
Numerical parameters & flow
solution
Numerical parameters are used to control
flow solution.
– Under relaxation factor, tridiagonal or
pentadiagonal solvers
– CFD Labs using FlowLab
Monitor residuals (change of results between iterations)
Number of iterations for steady flow or number of time
steps for unsteady flow
Flow solution
– Solve the momentum, pressure Poisson equations
and get flow field quantities, such as velocity,
turbulence intensity, pressure and integral
quantities (drag forces)
33
Numerical parameters & flow
solution
Typical time
history of
residuals
The closer the
flow field to the
converged
solution, the
smaller the speed
of the residuals
decreasing.
Solution converged, residuals do
not change after more iterations
34
Post-processing
Analysis, and visualization
– Calculation of derived variables
Vorticity
36
Software and resources
CFD software was built upon physics, modeling, numerics.
Two types of available software
– Commercial (e.g., FLUENT, CFX, Star-CCM, COMSOL)
– Research (e.g., CFDSHIP-IOWA, U2RANS)
More information on CFD can be got on the following website:
– CFD Online: http://www.cfd-online.com/
– CFD software
FLUENT: http://www.fluent.com/
COMSOL http://www.comsol.com/
CD-adapco: http://www.cd-adapco.com/
GridPro: http://www.gridpro.com/
– Visualization software
Tecplot: http://www.amtec.com/
Fieldview: http://www.ilight.com/ 37
Software and resources
38