0.Introduction to CFD
0.Introduction to CFD
1
Overview of Fluid Mechanics
Mechanics
Statics Dynamics
Kinematics Kinetics
2
History: 18th and 19th century
◼ Much work focused on describing the motion of fluids:
Daniel Bernoulli (1700-1782) derived Bernoulli’s equation.
Leonhard Euler (1707-1783) proposed the Euler equations,
which describe conservation of momentum for an inviscid fluid,
and conservation of mass. He also proposed the velocity
potential theory.
Claude Louis Marie Henry Navier (1785-1836) and George
Gabriel Stokes (1819-1903) introduced viscous transport into the
Euler equations, which resulted in the Navier-Stokes equation.
This forms the basis of modern day CFD.
Other key figures were Jean Le Rond d’Alembert, Siméon-Denis
Poisson, Joseph Louis Lagrange, Jean Louis Marie Poiseuille,
John William Rayleigh, M. Maurice Couette, and Pierre Simon
de Laplace.
3
History: Osborne Reynolds - England (1842-1912)
◼ Most well-known for the
Reynolds number, which is the
ratio between inertial and
viscous forces in a fluid. This
governs the transition from
laminar to turbulent flow.
◼ His apparatus consisted of a
long glass pipe through which
water could flow at different
rates, controlled by a valve at the
pipe exit. The state of the flow
was visualized by a streak of dye
injected at the entrance to the
pipe.
4
History: First part of the 20th century
◼ Much work was done on boundary
layers and turbulence:
Ludwig Prandtl (1875-1953): boundary
layer theory, the mixing length concept,
compressible flows, the Prandtl number.
Theodore von Karman (1881-1963)
analyzed what is now known as the von
Karman vortex street.
Geoffrey Ingram Taylor (1886-1975):
statistical theory of turbulence and the
Taylor microscale.
Andrey Nikolaevich Kolmogorov (1903-
1987): the Kolmogorov scales and the
universal energy spectrum.
George Keith Batchelor (1920-2000):
contributions to the theory of
homogeneous turbulence.
5
History: Lewis Fry Richardson (1881-1953)
◼ In 1922, Lewis Fry Richardson developed the first
numerical weather prediction system.
Division of space into grid cells and the finite difference
approximations of Bjerknes's "primitive differential equations.”
His own attempt to calculate weather for a single eight-hour
period took six weeks and ended in failure.
◼ His model's enormous calculation requirements led to a
proposed solution called the “forecast-factory.”
The "factory" would have filled a vast stadium with 64,000
people.
Each one, armed with a mechanical calculator, would perform
part of the calculation.
A leader in the center, using colored signal lights and telegraph
communication, would coordinate the forecast.
6
History: 1930s to 1950s
◼ Earliest numerical solution: for flow past a cylinder (1933).
◼ Thom, A. 1933. ‘The Flow Past Circular Cylinders at Low Speeds’,
Proc. Royal Society, A141: 651-666.
◼ Kawaguti obtains a solution for flow around a cylinder, in
1953 by using a mechanical desk calculator, working 20
hours per week for 18 months.
◼ Kawaguti, M. 1953. ‘Numerical Solution of the NS Equations for the
Flow Around a Circular Cylinder at Reynolds Number 40’, J. Phy. Soc.
Japan, 8: 747-757.
7
History: 1960s and 1970s
◼ During the 1960s the theoretical division at Los Alamos
contributed many numerical methods that are still in use
today, such as the following methods:
Particle-In-Cell (PIC).
Marker-and-Cell (MAC).
Vorticity-Streamfunction Methods.
Arbitrary Lagrangian-Eulerian (ALE).
k- turbulence model.
9
Commercial Software
◼ CFD software
1. FLUENT: http://www.fluent.com
2. CFDRC: http://www.cfdrc.com
3. STAR-CD:http://www.cd-adapco.com
4. ANSYS/CFX:
http://www-waterloo.ansys. com/cfx
◼ Visualization software
1. Tecplot: http://www.amtec.com
2. Fieldview: http://www.ilight.com
10
Fluid Analysis
◼ Engineers have different kinds of tools available for
solving fluids engineering systems
Analytical Fluid Dynamics (AFD)
Experimental Fluid Dynamics (EFD)
Computational Fluid Dynamics (CFD)
11
Analytical Fluid Dynamics
◼ The theory of mathematical physics: problem &
formulation
◼ Control volume & differential analysis
◼ Exact solutions only exist for simple geometry and
conditions
◼ Approximate solutions for practical applications
Linear
Empirical relations using EFD data
12
Analytical Fluid Dynamics
◼ Example: laminar pipe flow
Assumptions: Fully developed, Low Re (<2000)
Approach: Simplify momentum equation, integrate, apply boundary conditions
(no-slip wall) to determine integration constants and use energy
equation to calculate head loss
Schematic
0
Du 0 p 2u 2u 0
=− + 2 + 2 + gx
Dt x x y
Exact solution:
u(r) = 1 (− p)(R2 − r 2)
4 x
8 du
Friction factor: f = 8 w = dy w = 64
V 2 V 2 Re
Head loss:
p1
+ z1 =
p2
+ z2 + h f L V 2 32 LV
hf = f =
D 2g D2
13
Computational Fluid Dynamics (CFD)
◼ Computational Fluid Dynamics is the science of
predicting fluid flow, heat transfer, mass transfer,
chemical reactions, and related phenomena by solving
mathematical equations that represent physical laws
using a numerical process
◼ CFD use computational methods for solving fluid
engineering systems, including modeling (mathematical
& Physics) and numerical methods (solvers, finite
differences, and grid generations, etc.).
◼ Rapid growth in CFD technology since advent of
computer
16
Experimental Fluid Dynamics (EFD)
Definition:
Use of experimental methodology and procedures for solving
fluids engineering systems, including full and model scales,
large and table top facilities, measurement systems
(instrumentation, data acquisition and data reduction),
uncertainty analysis, and dimensional analysis and similarity.
18
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive F18 Store Separation
Biomedical
Chemical Processing
HVAC&R
Hydraulics
Marine
Oil & Gas
Power Generation
Sports
20
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive
Biomedical
Chemical Processing
HVAC&R
External Aerodynamics Undercarriage
Hydraulics Aerodynamics
Marine
Oil & Gas
Power Generation
Sports
Interior Ventilation
Engine Cooling 21
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive
Biomedical
Chemical Processing
HVAC&R
Medtronic Blood Pump
Hydraulics
Marine
Oil & Gas
Power Generation
Sports Temperature and natural
convection currents in the eye
following laser heating.
22
Spinal Catheter
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive Polymerization reactor vessel - prediction
of flow separation and residence time
Biomedical effects.
Chemical Processing
HVAC&R
Hydraulics
Marine
Oil & Gas
Power Generation
Sports Twin-screw extruder
Shear rate distribution in twin-
modeling
screw extruder simulation
23
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive
Biomedical
Particle traces of copier VOC emissions
Chemical Processing colored by concentration level fall
behind the copier and then circulate
HVAC&R Streamlines for workstation
ventilation through the room before exiting the
exhaust.
Hydraulics
Marine
Oil & Gas
Power Generation
Sports
25
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive
Biomedical
Chemical Processing
HVAC&R
Hydraulics
Marine
Oil & Gas
Power Generation
Sports
26
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive Volume fraction of gas
Biomedical
Chemical Processing
HVAC&R Flow vectors and pressure Volume fraction of oil
distribution on an offshore oil rig
Hydraulics
Marine
Oil & Gas Volume fraction of water
Flow of lubricating
mud over drill bit
27
Applications of CFD
◼ Where is CFD used?
Aerospace
Appliances
Automotive
Biomedical
Chemical Processing
Flow in a
HVAC&R Flow around cooling
towers burner
Hydraulics
Marine
Oil & Gas
Power Generation
Sports
29
CFD Process
◼ Governing equations
Navier-Stokes equations (momentum), continuity equation, pressure
Poisson equation, energy equation, ideal gas law, combustions
(chemical reaction equation), multi-phase flows(e.g. Rayleigh
equation), and turbulent models (RANS, LES, DES).
◼ Coordinates
Cartesian, cylindrical and spherical coordinates result in different
form of governing equations
◼ Initial conditions
Initial guess of the solution
◼ Boundary Conditions
No-slip wall, free-surface, zero-gradient, symmetry, velocity/pressure
inlet/outlet
◼ Flow conditions
Geometry approximation, domain, Reynolds Number, and Mach
Number, etc.
30
How does a CFD code work?
◼ CFD codes are structured around the numerical
algorithms that can tackle fluid flow problems.
◼ In order to provide easy access to their solving power all
commercial CFD packages include sophisticated user
interfaces to input problem parameters and to examine
the results.
◼ Hence all codes contain three main elements:
(i) a pre-processor,
(ii) a solver and
(iii) a post-processor.
31
Pre-processor
◼ Definition of the geometry of the region of interest: the
computational domain
◼ Grid generation – the sub-division of the domain into a
number of smaller, non-overlapping sub-domains: a grid
(or mesh) of cells (or control volumes or elements)
◼ Selection of the physical and chemical phenomena that
need to be modelled
◼ Definition of fluid properties
◼ Specification of appropriate boundary conditions at
cells which coincide with or touch the domain boundary.
32
◼ The solution to a flow problem (velocity, pressure,
temperature etc.) is defined at nodes inside each cell.
The accuracy of a CFD solution is governed by the
number of cells in the grid.
33
Solver
◼ There are three distinct streams of numerical solution
techniques: finite difference, finite element and spectral
methods.
34
◼ In outline the numerical algorithm consists of the
following steps:
Integration of the governing equations of fluid flow
over all the (finite) control volumes of the domain
Discretisation – conversion of the resulting integral
equations into a system of algebraic equations
Solution of the algebraic equations by an iterative
method
35
Post-processor
◼ As in pre-processing, a huge amount of development
work has recently taken place in the post-processing
field. Due to the increased popularity of engineering
workstations, many of which have outstanding graphics
capabilities, the leading CFD packages are now
equipped with versatile data visualization tools.
◼ These include:
• Domain geometry and grid display
• Vector plots • Line and shaded contour plots
• 2D and 3D surface plots • Particle tracking
• View manipulation (translation, rotation, scaling etc.)
• Colour PostScript output
36
CFD Process
control
volume
tetrahedron pyramid
triangle
Mass: + u = 0
t
Du u
Momentum: + u u = −p + + S M
Dt t
= − p u + (k T ) + + S M
DT
Energy: c
Dt
Others: ( ) + (u ) = ( u ) + S
t
BCs/
Loading
Ax=b
System
Matrix
Variables
u, p, T, etc. 38
CFD Process
39
Example – 2D Aerodynamic Simulation
◼ Fluid property (air):
Density: 1.2 kg/m3
Viscosity: 2.0E–05 kg/ms
Speed of air: 20 m/s (72 km/h)
Specific heat: 1005 J/kgK
Heat conduction coefficient: 0.024 W/mK
40
Example: Boundary Settings
Neutral
Inflow
u0 = u0 Outflow
v0 = 0 p0 = 0
No slip
No slip
41
Example: Boundary Settings
Convective flux
Initial temperature
Temperature 300 K Convective
320 K flux
Thermal insulation
Thermal insulation
42
Example: Mesh
Whole Domain
Max. element size = 0.5
Refinement
recommended
Vehicle boundary
Max. element size = 0.05
Ground
Max. element size = 0.1
43
Example: Velocity Resolution & Vectors
44
Example: Pressure & Streamlines
45
Example: Temperature & Streamlines
heat
46
Case Study: Temperature & Streamlines
47
Case Study: Graphs for Surface Pressure
48
Case Study: Consider Revisions to the Model
◼ Are physical models appropriate?
Is flow turbulent?
Is flow unsteady?
Are there compressibility effects?
Are there 3D effects?
Are boundary conditions correct?
◼ Is the computational domain large enough?
Are boundary conditions appropriate?
Are boundary values reasonable?
◼ Is grid adequate?
Can grid be adapted to improve results?
Does solution change significantly with adaption, or is the
solution grid independent?
Does boundary resolution need to be improved?
49
Advantages of 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.
50
Advantages of 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.
51
Limitations of CFD
◼ Physical models.
CFD solutions rely upon physical models of real world processes
(e.g. turbulence, compressibility, chemistry, multiphase flow,
etc.).
The CFD solutions can only be as accurate as the physical
models on which they are based.
◼ Numerical errors.
Solving equations on a computer invariably introduces numerical
errors.
Round-off error: due to finite word size available on the
computer. Round-off errors will always exist (though they can be
small in most cases).
Truncation error: due to approximations in the numerical models.
Truncation errors will go to zero as the grid is refined. Mesh
refinement is one way to deal with truncation error.
52
Limitations of CFD
◼ Boundary conditions.
As with physical models, the accuracy of the CFD solution is
only as good as the initial/boundary conditions provided to the
numerical model.
Example: flow in a duct with sudden expansion. If flow is
supplied to domain by a pipe, a fully-developed profile should be
used for velocity rather than assume uniform conditions.
Computational Computational
Domain Domain
Fully Developed
Uniform Inlet Inlet Profile
Profile Poor Better
53
Conclusion
◼ CFD is a method to numerically calculate fluid flow and
heat transfer.