Introduction to CFD
Dr. G. Kumaresan
Institute for Energy Studies
Anna University, Chennai
[email protected]
1
What is computational fluid dynamics?
• Computational fluid dynamics (CFD) is a branch of continuum
mechanics which deals with numerical simulation of fluid flow and
heat transfer
• The result of CFD analyses is relevant engineering data used in:
– Conceptual studies of new designs.
– Detailed product development.
– Troubleshooting.
– Redesign.
• CFD analysis complements testing and experimentation.
– Reduces the total effort required in the laboratory.
2
Knowledge Prequisite
• Fluid dynamics
• Numerical Methods
• Heat transfer
Knowledge on Specific topics are required for specific applications
• Combustion
• Mass transfer with multispecies and multiphase
• Melting and solidification
• Rotodynamics
• Heat exchangers
• Aerospace
• Automotive
3
Fluid dynamics
• Fluid dynamics is the science of fluid motion.
• Fluid flow is commonly studied in one of three ways:
– Experimental fluid dynamics (EFD).
– Theoretical fluid dynamics (TFD).
– Numerically: computational fluid dynamics (CFD).
4
Numerical Vs Analytical Vs Experimental
• Experimental Investigations:
- full scale
• expensive and often impossible
• measurement errors
- on a scaled model
• simplified
• difficult to extrapolate results
• measurement errors
• Theoretical calculation:
- analytical solutions
• exist only for a few cases (example)
• sometimes complex
- numerical solutions
5
• for almost any problem
Modelling
• Advantages of modelling:
- cheaper
- more complete information
- capable of solving any complex problem
• Disadvantages of modelling:
- deals with a mathematical description not with reality
- multiple solutions can exist
6
Why use CFD?
• Relatively low cost.
– Using physical experiments and tests to get essential engineering
data for design can be expensive.
– CFD simulations are relatively inexpensive, and costs are likely to
decrease as computers become more powerful.
• Speed.
– CFD simulations can be executed in a short period of time.
– Quick turnaround means engineering data can be introduced early in
the design process.
• Ability to simulate real conditions.
– Many flow and heat transfer processes can not be (easily) tested,
e.g. hypersonic flow.
– CFD provides the ability to theoretically simulate any physical
condition.
7
Why use CFD?
• Ability to simulate ideal conditions.
– CFD allows great control over the physical process, and provides the
ability to isolate specific phenomena for study.
– Example: a heat transfer process can be idealized with adiabatic,
constant heat flux, or constant temperature boundaries.
• Comprehensive information.
– 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, LDV, 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.
8
Boundary conditions
Prescribed Temperature BC (First kind) Dirichlet conditions
Prescribed Heat Flux BC (Second kind) Neumann conditions
Convection BC (Third kind) Robbins cinditions
9
Boundary conditions cont…
10
Boundary conditions cont…
11
Boundary conditions cont…
12
Where is CFD used?
• Where is CFD
used?
• Aerospace
• Automotive
• Biomedical
• Chemical
Processing
• HVAC
• Hydraulics
• Marine
• Turbomachine
• Power Generation
• Sports
Temperature and natural
convection currents in the eye
following laser heating. 13
Where is CFD used?
Chemical Processing
• Where is CFD used?
• Aerospacee
• Automotive
• Biomedical
• Chemical
Processing
• HVAC
• Hydraulics
• Marine
• Turbomachine
• Power Generation
• Sports
Streamlines for workstation
ventilation
14
Where is CFD used?
Sports
Marine (wave pattern)
• Where is CFD used?
• Aerospace
• Automotive
• Biomedical
• Chemical Processing
• HVAC
• Hydraulics
• Marine
• Turbomachine Turbomachine
• Power Generation
• Sports
Power Generation
15
Three main elements of CFD Software
Solver
Pre processor Transport equation
•Mass
Physical Model
• Creation of geometry •Momentum •Turbulence
• Mesh generation •energy •Combustion
• Material properties •Equation of state •Radiation
• Boundary conditions •Supporting models •Other processes
Post processor Solver settings
•X-Y graph •Initialization
•Contour •Solution control
•Velocity vectors •Monitoring solution
•others •Convergence criteria
16
CFD - how it works (2)
• CFD applies numerical methods (called
discretization) to develop approximations of
the governing equations of fluid mechanics in
the fluid region of interest.
– Governing differential equations: algebraic.
– The collection of cells is called the grid.
– The set of algebraic equations are solved
numerically (on a computer) for the flow field
variables at each node or cell.
– System of equations are solved
simultaneously to provide solution.
• The solution is post-processed to extract
quantities of interest (e.g. lift, drag, torque, Mesh for bottle filling
heat transfer, separation, pressure loss, etc.). problem.
17
Discretization
• Domain is discretized into a finite set of control volumes
or cells. The discretized domain is called the “grid” or the “mesh.”
• General conservation (transport) equations for mass, momentum,
energy, etc., are discretized into algebraic equations.
• All equations are solved to render flow field.
( )
+ div( u ) = div( grad ) + S
t
t V
dV + V dA = dA + S dV Fluid region of
A A V pipe flow
unsteady convection diffusion generation discretized into
control
finite set of
volume
Eqn. control volumes
continuity 1 (mesh).
x-mom. u
y-mom. v Other Discretization methods:
energy h
FDM, FEM 18
Discretization Methods cont…
Classification of PDE
Elliptic, Parabolic & Hyperbolic Eqns
2 2 2
a 2 +b +c 2 +d +e +f +g = 0
x xy y x y
where coefficients are constants or fn's of the independent variables
b 2 − 4ac 0 elliptic
b 2 − 4ac = 0 parabolic
Transient in nature
b − 4ac 0 hyperbolic
2
(a) Elliptic PDE
2 2 2 2
+ 2 = 0 Laplace eqn & + 2 = g(x, y) Poisson's eqn
x 2
y x 2
y
where, b=0, a=1 and c=1 b 2 − 4ac = −4 0
19
Discretization Methods cont…
Classification of PDE
(b) Parabolic PDE
2
= 2 (heat conduction or diffusion equation)
t x
where is thermal diffusivity and b=0, c=0, a=
b 2 − 4ac = 0
(c) Hyperbolic PDE
2 2
2
= (wave equation)
t 2
x 2
where 2 is a constant and a= 2 , b=0, c=-1
b 2 − 4ac = 4 2 which is >0
Example:
20
Discretization Methods cont…
Classification of PDE
21
Discretization Method
Finite Difference Method
22
Finite Difference Method cont…
23
Finite Difference Method cont…
24
Finite Difference Method cont…
25
Finite Difference Method cont…
26
Finite Difference Method cont…
27
Finite Difference Method cont…
28
Finite Difference Method cont…
(eq. A)
−4 1 1 0 T1 −100
1 −4 0 1 T −30
2 =
1 0 −4 1 T3 −100
0 1 1 − 4 T
4 − 30 29
FDM
30
Forward difference approximation of ∂f/ ∂x of order (Δx)
Taylor series of expansion of f (x+Δx) about x
If the subscript index ‘ i ’ is used to represent the discrete points in the x - direction
* The process of transforming a PDE into a set of
linear equations is termed discretisation. 31
Backward difference approximation of ∂f/ ∂x of order (Δx)
Taylor series of expansion of f (x- Δx) about x
Central difference approximation of ∂f/ ∂x of order (Δx)2
32
Central difference approximation of ∂f/ ∂x of order (Δx)2 cont…
Forward difference approximation of ∂2f/ ∂x2 of order (Δx)
w.k.t
(Eq. 3) – (Eq. 1 x 2)
33
Forward difference approximation of ∂2f/ ∂x2 of order (Δx) cont…
Backward difference approximation of ∂2f/ ∂x2 of order (Δx)
w.k.t
(Eq. 3) – (Eq. 1 x 2)
34
Central difference approximation of ∂2f/ ∂x2 of order (Δx)2
How to get 2nd order accurate (Δx)2 for first order derivative ∂f/ ∂x
using Forward difference scheme?
Taylor series of expansion of f (x+Δx) about x
35
How to get 2nd order accurate (Δx)2 for first order derivative ∂f/ ∂x using cont…
Forward difference scheme?
36
Consolidation
+
+ +
+ + +
37
cont…
Consolidation
38
Consolidation cont…
39
Uniform and non-uniform grid
Non uniform grid size discretization Region of interest
aΔx Δx
40
Standard 5 point formula & Diagonal 5 point formula
Laplace eqn. uxx+uyy = 0
using CD method,
(a) Std. 5 point formula
(b) Dia. 5 point formula
(a) (b) 41
Standard 5 point formula & Diagonal 5 point formula Cont..
Solve Laplace eqn. for the given domain.
Step 1: Diagonal 5 point formula
Step 2: Standard 5 point formula
Gauss-Seidal method ]
Jacobi’s method ]
42
Standard 5 point formula & Diagonal 5 point formula Cont..
Solve Laplace eqn. for the given domain. Use Gauss-Seidal iterative
method.
43
Standard 5 point formula & Diagonal 5 point formula Cont..
Solution:
44
Standard 5 point formula & Diagonal 5 point formula Cont..
Solution:
45
Useful Web links
46
Useful Text books
1] “An Introduction to CFD – The Finite Volume Method” by
H K Versteeg & W Malalasekara , Publication:: Pearson Education Ltd
2] “Numerical Heat Transfer and Fluid Flow” by Suhas V. Patankar,
Publication:: Taylor & Francis
3] “Computer simulation of Flow and Heat Transfer” by P.S. Ghoshdastidar,
Publication:: TMH
4] “CFD A Practical Approach” by Jiyuan Tu, Guan Yeoh & Chaoqun Liu,
Publication:: Elsevier
4] “The FEM for Fluid Dynamics” by O.C. Zienkiewicz, R.L. Taylor &
P. Nithiarasu, Publication:: Elsevier
47