Introduction To Computational Fluid Dynamics (CFD)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 134

Introduction to

Computational Fluid Dynamics (CFD)

Le Thi Minh Nghia


Tran Tien Anh
Duong De Tai

1Facultyof Transportation Engineering, Ho Chi Minh City University of Technology (HCMUT),


Ho Chi Minh City, Vietnam.
2Vietnam National University Ho Chi Minh City (VNU-HCM), Ho Chi Minh City, Vietnam.
Learning outcome

After completing this course students will be able to:

1. Describe methods for numerical solution of compressible


and incompressible fluid mechanics problems
2. Identify system of equations: hyperbolic, parabolic or elliptic
equations
3. Analyze discretization, finite differences, finite volumes
4. Recognize stability of solutions
5. Construct computational grids
6. Describe multi-grid methods
7. Outline turbulent models

2021/03/03 CFD club@HCMUT 2


Textbooks

① Fluid mechanics_ Fundamentals and applications


(2020,4th,Çengel)
② Computational methods for fluid dynamics
(2020,4th,Ferziger)
③ An introduction to computational fluid dynamics_
The finite volume method (2007,2nd,Versteeg)

2021/03/03 CFD club@HCMUT 3


Textbooks

2021/03/03 CFD club@HCMUT 4


International journals

1. Numerical Heat Transfer, Part A- Applications; Part B Fundamentals


2. International Journal of Numerical Methods in Fluids.
3. Computer & Fluids
4. Journal of Computational Physics
5. International Journal of Numerical Methods in Engineering
6. International Journal of Numerical Methods for Heat and Fluid Flow
7. Computer Methods of Applied Mechanics and Engineering
8. Engineering Computations
9. Progress in Computational Fluid Dynamics
10. Computer Modeling in Engineering & Sciences (CMES)
11. ASME Journal of Heat Transfer
12. International Journal of Heat and Mass Transfer
13. ASME Journal of Fluids Engineering
14. International Journal of Heat and Fluid Flow
15. AIAA Journal

2021/03/03 CFD club@HCMUT 5


Contents

1. What is CFD
2. Why use CFD
3. Where is CFD used?
4. What are the advantages and limitations of CFD?
5. Physics of Fluid
6. Numerical methods
7. Discretization for equations
8. Modeling
9. Types of CFD codes
10. CFD process
11. CFD Educational Interface
12. Example of CFD analysis process

2021/03/03 CFD club@HCMUT 6


1 What is CFD?

2021/03/03 CFD club@HCMUT 7


What is CFD?

• CFD is the simulation of fluids engineering systems using modeling


(mathematical physical problem formulation) and numerical methods
(discretization methods, solvers, numerical parameters, and grid generations,
etc.)
• Historically only Analytical Fluid Dynamics (AFD) and Experimental Fluid
Dynamics (EFD).
• CFD made possible by the advent of digital computer and advancing with
improvements of computer resources
(500 flops, 194720 teraflops, 2003 1.3 pentaflops, Roadrunner at Las
Alamos National Lab, 2009.)

2021/03/03 CFD club@HCMUT 8


What is CFD?

• What is CFD and its objective?

– Computational Fluid Dynamics


– Historically Analytical Fluid Dynamics (AFD) and EFD
(Experimental Fluid Dynamics) was used. CFD has become
feasible due to the advent of high speed digital computers.
– Analysis of such a system based on computer simulation for
prediction fluid-flow, heat transfer or chemical reactions
phenomena.
– The objective of CFD is to model the continuous fluids with
Partial Differential Equations (PDEs) and discretize PDEs into
an algebra problem (Taylor series), solve it, validate it and
achieve simulation based design.

2021/03/03 CFD club@HCMUT 9


What is CFD?

• Computational fluid dynamics (CFD) is the science of predicting fluid


flow, heat transfer, mass transfer, chemical reactions, and related
phenomena by solving the mathematical equations which govern
these processes using a numerical process
 We are interested in the forces (pressure , viscous stress etc.)
acting on surfaces (Example: In an airplane, we are interested in the
lift, drag, power, pressure distribution etc)
 We would like to determine the velocity field (Example: In a race
car, we are interested in the local flow streamlines, so that we can
design for less drag)
 We are interested in knowing the temperature distribution
(Example: Heat transfer in the vicinity of a computer chip)

2021/03/03 CFD club@HCMUT 10


What is CFD?

• Simply put, CFD is the calculation of properties of a


flowing fluid.
• Practical problems may include energy flow, chemical
reactions, phase changes, …
• Domain is often ( irregular ) 3D, plus time.
• Results may be scalar, but more often are n-D
• Relevant industries include automotive, chemical
processing, aerospace, HVAC, . . .

2021/03/03 CFD club@HCMUT 11


What is CFD?

Fluid
Problem Comparison &
Fluid Mechanics Analysis

Simulation Results
Physics of Fluid
C
Mathematics Computer
F
Navier-Stokes Equations
D Computer Program
Programming
Numerical
Methods Language
Geometry
Discretized Form Grids

2021/03/03 CFD club@HCMUT 12


2 Why use CFD?

2021/03/03 CFD club@HCMUT 13


Why use CFD?

• Analysis and design


1. Simulation-based design instead of “build & test”
More cost effective and more rapid than EFD
CFD provides high-fidelity database for diagnosing flow field
2. Simulation of physical fluid phenomena that are difficult
for experiments
Full scale simulations (e.g., ships and airplanes)
Environmental effects (wind, weather, etc.)
Hazards (e.g., explosions, radiation, pollution)
Physics (e.g., planetary boundary layer, stellar evolution)
• Knowledge and exploration of flow physics

2021/03/03 CFD club@HCMUT 14


Why use CFD?

• Why use CFD?


– Analysis and design
• Simulation-based design instead of “build & test”
– More cost effectively and more rapidly than with experiments
– CFD solution provides high-fidelity database for interrogation of
flow field
• Simulation of physical fluid phenomena that are difficult to be
measured by experiments
– Scale simulations (e.g., full-scale ships, airplanes)
– Hazards (e.g., explosions, radiation, pollution)
– Physics (e.g., weather prediction, planetary boundary layer,
stellar evolution)
– Knowledge and exploration of flow physics

2021/03/03 CFD club@HCMUT 15


Why use CFD?

Simulation(CFD) Experiment
Cost Cheap Expensive

Time Short Long

Scale Any Small/Middle

Information All Measured Points

Repeatable All Some

Security Safe Some Dangerous

2021/03/03 CFD club@HCMUT 16


3 Where is CFD used?

2021/03/03 CFD club@HCMUT 17


Where is CFD used?

Where is CFD used? (Aerospace)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
F18 Store Separation
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports Wing-Body Interaction Hypersonic Launch
Vehicle
2021/03/03 CFD club@HCMUT 18
Where is CFD used?

Aeronautics

2021/03/03 CFD club@HCMUT 19


Where is CFD used?

NASA Ames’ virtual wind tunnel

2021/03/03 CFD club@HCMUT 20


Where is CFD used?

Where is CFD used? (Appliances)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas Surface-heat-flux plots of the No-Frost
refrigerator and freezer compartments helped
– Power Generation Bosch- Siemens engineers to optimize the
– Sports location of air inlets.

2021/03/03 CFD club@HCMUT 21


Where is CFD used?

Where is CFD used? (Automotive)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing External Aerodynamics Undercarriage
Aerodynamics
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports
Interior Ventilation
2021/03/03 CFD club@HCMUT Engine Cooling 22
Where is CFD used?

Automotive aerodynamics . . .

2021/03/03 CFD club@HCMUT 23


Where is CFD used?

. . . Internal combustion engine

2021/03/03 CFD club@HCMUT 24


Where is CFD used?

Where is CFD used? (Biomedical)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
Medtronic Blood Pump
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
Temperature and natural
– Power Generation convection currents in the eye
following laser heating.
– Sports
2021/03/03 Spinal
CFD Catheter
club@HCMUT 25
Where is CFD used?
Where is CFD used? (Chemical processing)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical Polymerization reactor vessel - prediction
of flow separation and residence time
effects.
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
Twin-screw extruder
– Power Generation modeling

– Sports
Shear rate distribution in twin-
screw extruder simulation
2021/03/03 CFD club@HCMUT 26
Where is CFD used?

Process engineering

2021/03/03 CFD club@HCMUT 27


Where is CFD used?
Where is CFD used? (HVAC&R)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
Particle traces of copier VOC emissions
– Biomedical colored by concentration level fall
Streamlines for workstation behind the copier and then circulate
– Chemical Processing ventilation through the room before exiting the
exhaust.
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports Flow path lines colored by
pressure quantify head loss
Mean age of air contours indicate
2021/03/03 CFD club@HCMUT in ductwork 28
location of fresh supply air
Where is CFD used?

. . . And interior comfort . . .

2021/03/03 CFD club@HCMUT 29


Where is CFD used?

HVAC

2021/03/03 CFD club@HCMUT 30


Where is CFD used?
Where is CFD used? (Hydraulics)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports
2021/03/03 CFD club@HCMUT 31
Where is CFD used?
Where is CFD used?

• Where is CFD used? Hydraulics


• Aerospace
• Automotive
• Biomedical
• Chemical Processing
• HVAC
• Hydraulics
• Marine
• Oil & Gas
• Power Generation
• Sports

2021/03/03 CFD club@HCMUT 32


Where is CFD used?
Where is CFD used? (Marine)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports
2021/03/03 CFD club@HCMUT 33
Where is CFD used?
Where is CFD used?

Marine (movie)

• Where is CFD used?


• Aerospace
• Automotive
• Biomedical
• Chemical Processing
• HVAC
• Hydraulics
• Marine
• Oil & Gas
• Power Generation
• Sports

2021/03/03 CFD club@HCMUT 34


Where is CFD used?
Where is CFD used? (Oil & Gas)

• Where is CFD used?


– Aerospace
Volume fraction of gas
– Appliances
– Automotive
– Biomedical
Flow vectors and pressure Volume fraction of oil
– Chemical Processing distribution on an offshore oil rig
– HVAC&R
– Hydraulics
Volume fraction of water
– Marine
Analysis of multiphase
– Oil & Gas separator

– Power Generation
– Sports
Flow of lubricating
2021/03/03 CFDmud over drill bit
club@HCMUT 35
Where is CFD used?
Where is CFD used? (Power generation)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
Flow around cooling Flow in a
– Chemical Processing towers burner
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports Path lines from the inlet
Flow pattern through a water colored by temperature
turbine. during standard
2021/03/03 CFD club@HCMUT operating conditions 36
Where is CFD used?
Where is CFD used? (Sports)

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports

2021/03/03 CFD club@HCMUT 37


Where is CFD used?
Where is CFD used?

• Where is CFD used? Sports


• Aerospace
• Automotive
• Biomedical
• Chemical Processing
• HVAC
• Hydraulics
• Marine
• Oil & Gas
• Power Generation
• Sports

2021/03/03 CFD club@HCMUT 38


Where is CFD used?

Applications

• Car safety thermal imaging using CFD


• Heat exchanger imaging
• Imaging of missile prototypes

2021/03/03 CFD club@HCMUT 39


Where is CFD used?

Visualization examples

2021/03/03 CFD club@HCMUT 40


4 What are the advantages
and limitations of CFD?

2021/03/03 CFD club@HCMUT 41


What are the advantages and limitations of CFD?

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.

2021/03/03 CFD club@HCMUT 42


What are the advantages and limitations of CFD?

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.

2021/03/03 CFD club@HCMUT 43


What are the advantages and limitations of CFD?

Advantages

• Relatively low cost.


– 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.
• Ability to simulate real conditions.
– CFD provides the ability to theoretically simulate any
physical condition.
• Comprehensive information.
– 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.
2021/03/03 CFD club@HCMUT 44
What are the advantages and limitations of CFD?
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.

2021/03/03 CFD club@HCMUT 45


What are the advantages and limitations of CFD?

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, you should use a fully-
developed profile for velocity rather than assume uniform
conditions.
Computational Domain Computational Domain

Fully Developed Inlet


Profile
Uniform Inlet
Profile

poor better
2021/03/03 CFD club@HCMUT 46
What are the advantages and limitations of CFD?

Limitations

• The CFD solutions can only be as accurate as the physical models


on which they are based.
• 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.
• 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.

2021/03/03 CFD club@HCMUT 47


5 Physics of Fluid

2021/03/03 CFD club@HCMUT 48


Physics of fluid

 Fluid = Liquid + Gas


 Density ρ
const incompressible
 
variable compressible

Viscosity μ:
resistance to flow of a fluid
 Ns 
   3   ( Poise)
m 
Substance Air(18ºC) Water(20ºC) Honey(20ºC)
Density(kg/m3) 1.275 1000 1446
Viscosity(P) 1.82e-4 1.002e-2 190

2021/03/03 CFD club@HCMUT 49


Components of fluid mechanics

Fluid mechanics

Inviscid Viscous

Laminar Turbulence

Internal External
Compressible Incompressible (airfoil, ship)
(pipe, valve)
(air, acoustic) (water)

2021/03/03 CFD club@HCMUT 50


Conservation Law

m in m out
in M out

dM
 m in  m out
dt

m in  m out
Mass
dM Momentum
0
dt Energy

2021/03/03 CFD club@HCMUT 51


Governing equations

(Equations based on “average” velocity)

   
  ux   uy   uz  0
t x y z
Continuity

 u ux ux ux   p     


 x      g
  ux  uy  uz        
 t x y z  x  x xx y yx z zx  x
 

Equation of motion

2021/03/03 CFD club@HCMUT 52


Navier- Stokes equations

Claude-Louis Navier George Gabriel Stokes

2021/03/03 CFD club@HCMUT 53


Navier-Stokes equations (constant r and m)

 u ux ux ux  p  2 u  2


u  2
u 
 x   x x x 
  ux  uy  uz      2   2 
 g x
 t x y z  x  x y 2
z 

 u uy uy uy  p  2 u  2
u  2
u 
 y   y y y 
  ux  uy  uz      2   2 
 g y
 t x y z  y  x y 2
z 

 u uz uz uz  p  2 u  2
u  2
u 
 z     z z z   g
  ux  uy  uz    2   2 
 t x y z  z  x y 2
z  z

D
 v  p  2v   g
Dt

2021/03/03 CFD club@HCMUT 54


6 Numerical methods

2021/03/03 CFD club@HCMUT 55


Three basic methods and their relations

Analytical

Experimental Numerical

2021/03/03 CFD club@HCMUT 56


Basic idea for numerical solution

① Discretization for a domain


② Discretization for equations
③ Solution of the algebraic equations
④ Analysis of results

2021/03/03 CFD club@HCMUT 57


So how is CFD calculated ?

2021/03/03 CFD club@HCMUT 58


Classic differential equations


• Navier-Stokes: u   1 2 1 
  u   u   P  g u  F
t  
• Continuity:

• Cons. Energy:   (vn)dA  t   dV  0
 Q  Ws  W  P 
     e   (vn)dA   e  dV
dt dt dt   t

2021/03/03 CFD club@HCMUT 59


Fourth order Runge-Kutta

k1  hf (x n , yn )
h k1
k2  hf (x n  , yn  )
2 2
h k2
k3  hf (x n  , yn  )
2 2
k 4  hf (x n  h, yn  k3 )
k1 k2 k3 k 4
yn 1  yn      O(h 5 )
6 3 3 6

2021/03/03 CFD club@HCMUT 60


7 Discretization for equations

2021/03/03 CFD club@HCMUT 61


Discretization

Discretization
Analytical Equations Discretized Equations

 Discretization Methods
 Finite Difference
Straightforward to apply, simple, sturctured grids
 Finite Element
Any geometries
 Finite Volume
Conservation, any geometries

2021/03/03 CFD club@HCMUT 62


Finite Volume I
General Form of Navier-Stokes Equation

      
  U i      q    1, U j , T 
t xi  xi 
Local change with time Flux Source

Integrate over the 


Control Volume(CV) V xi dV  S   ni dS

Integral Form of Navier-Stokes Equation


      
V t dV  S  U i    xi   ni dS  V q dV
Local change Flux Over Source in CV
with time in CV the CV Surface

2021/03/03 CFD club@HCMUT 63


Finite Volume II
Conservation of Finite Volume Method
      
V t dV  S  U i    xi   ni dS  V q dV

A B

A B

2021/03/03 CFD club@HCMUT 64


Finite Volume III
UP UE
Approximation of Volume Integrals

m    dV   pV ; mu   i ui dV   Pu PV
Vi Vi

Approximation of Surface Integrals ( Midpoint Rule)

 P dV   P dS   Pk S k k  n, s, e, w
Ue Vi Si
k

Interpolation
 
U P if (U  n ) e  0
Upwind Ue    
U E if (U  n ) e  0

Central xe  x P
U e  U E e  U P (1  e ) e 
xE  xP

2021/03/03 CFD club@HCMUT 65


One Control Volume
aPuP  aN uN  aS uS  aW uW  aE uE  0
Whole Domain
 a11 a12 a1l   u1  0 
a a22 a23 a2,l 1   u  0 
 21   2   
 . . . .   .  .
     
 . . . .   .  .
 ak 1 . . . al 1,n 1   .  .
    
 ak 1,2 . . . al ,n   .  .
 . . . .   .  .
     
 . . . .   .  .
 an 1,n  k 1 an 1,n  2 an 1,n 1 an 1,n  u   0 
   n 1   
 an ,n  k an ,n 1 ann   un  0 

Discretization of
Continuity Equation
2021/03/03 CFD club@HCMUT 66
FV Discretization of Incompressible N-S Equation

Muh  0
duh
  C (uh )uh  Duh  Mqh  0
dt
Unsteady Convection Diffusion Source

 Time Discretization


n 1
f (u n Explicit
du h  h)

dt  f (uhn , uhn 1 ) Implicit

Discretization of
Navier-Stokes Equation
2021/03/03 CFD club@HCMUT 67
8 Modelling

2021/03/03 CFD club@HCMUT 68


Modeling

• Modeling is the mathematical physics problem formulation in


terms of a continuous initial boundary value problem (IBVP)
• IBVP is in the form of Partial Differential Equations (PDEs) with
appropriate boundary conditions and initial conditions.
• Modeling includes:
1. Geometry and domain
2. Coordinates
3. Governing equations
4. Flow conditions
5. Initial and boundary conditions
6. Selection of models for different applications

2021/03/03 CFD club@HCMUT 69


Modeling (geometry and domain)

• Simple geometries can be easily created by few geometric


parameters (e.g. circular pipe)
• Complex geometries must be created by the partial differential
equations or importing the database of the geometry(e.g. airfoil)
into commercial software
• Domain: size and shape
• Typical approaches
• Geometry approximation
• CAD/CAE integration: use of industry standards such as
Parasolid, ACIS, STEP, or IGES, etc.
• The three coordinates: Cartesian system (x,y,z), cylindrical
system (r, θ, z), and spherical system(r, θ, Φ) should be
appropriately chosen for a better resolution of the geometry
(e.g. cylindrical for circular
2021/03/03 pipe).
CFD club@HCMUT 70
Modeling (coordinates)

z Cartesian z Cylindrical z Spherical


(x,y,z) (r,,z) (r,,)

z
y y y
 r  r
x x x

General Curvilinear Coordinates General orthogonal


Coordinates

2021/03/03 CFD club@HCMUT 71


Modeling (governing equations)

• Navier-Stokes equations (3D in Cartesian coordinates)


u u u u pˆ   2u  2u  2u 
  u  v  w    2  2  2 
t x y z x  x y z 
v v v v  pˆ   2v  2v  2v 
  u  v  w    2  2  2 
t x y z y  x y z 
w w w w pˆ  2w 2w 2w 
  u  v  w     2  2  2 
t x y z z  x y z 

Local Convection Piezometric pressure gradient Viscous terms


acceleration
    u     v     w 
    0 Continuity equation
t x y z
p  RT Equation of state
D 2R 3 DR 2 pv  p
R  ( )  Rayleigh Equation
Dt 2 2 Dt L
2021/03/03 CFD club@HCMUT 72
Modeling (flow conditions)

• Based on the physics of the fluids phenomena, CFD can be distinguished into
different categories using different criteria
• Viscous vs. inviscid (Re)
• External flow or internal flow (wall bounded or not)
• Turbulent vs. laminar (Re)
• Incompressible vs. compressible (Ma)
• Single- vs. multi-phase (Ca)
• Thermal/density effects (Pr, g, Gr, Ec)
• Free-surface flow (Fr) and surface tension (We)
• Chemical reactions and combustion (Pe, Da)
• etc…

2021/03/03 CFD club@HCMUT 73


Modeling (initial conditions)

• Initial conditions (ICS, steady/unsteady flows)


• ICs should not affect final results and only affect convergence
path, i.e. number of iterations (steady) or time steps (unsteady)
need to reach converged solutions.
• More reasonable guess can speed up the convergence
• For complicated unsteady flow problems, CFD codes are
usually run in the steady mode for a few iterations for getting a
better initial conditions

2021/03/03 CFD club@HCMUT 74


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, zero-gradient), and non-reflecting (for compressible
flows, such as acoustics), etc.

No-slip walls: u=0,v=0

Inlet ,u=c,v=0 Outlet, p=c


r Periodic boundary condition in
v=0, dp/dr=0,du/dr=0 spanwise direction of an airfoil
o x
Axisymmetric
2021/03/03 CFD club@HCMUT 75
Boundary conditions

 Typical Boundary conditions


No-slip (Wall), Axisymmetric, Inlet, Outlet, Periodic

No-slip walls: u=0,v=0

Inlet ,u=c,v=0 Outlet, du/dx=0


dv/dy=0,dp/dx=0
r
v=0, dp/dr=0,du/dr=0
o x
Periodic boundary condition in
Axisymmetric
spanwise direction of an airfoil

2021/03/03 CFD club@HCMUT 76


Modeling (selection of models)

• CFD codes typically designed for solving certain fluid


phenomenon by applying different models
• Viscous vs. inviscid (Re)
• Turbulent vs. laminar (Re, Turbulent models)
• Incompressible vs. compressible (Ma, equation of state)
• Single- vs. multi-phase (Ca, cavitation model, two-fluid
model)
• Thermal/density effects and energy equation
(Pr, g, Gr, Ec, conservation of energy)
• Free-surface flow (Fr, level-set & surface tracking model) and
surface tension (We, bubble dynamic model)
• Chemical reactions and combustion (Chemical reaction
model)
• etc…
2021/03/03 CFD club@HCMUT 77
Modeling (Turbulence and free surface models)

• Turbulent flows at high Re usually involve both large and small scale
vortical structures and very thin turbulent boundary layer (BL) near the wall
• Turbulent models:
• DNS: most accurately solve NS equations, but too expensive
for turbulent flows
• RANS: predict mean flow structures, efficient inside BL but excessive
diffusion in the separated region.
• LES: accurate in separation region and unaffordable for resolving BL
• DES: RANS inside BL, LES in separated regions.
• Free-surface models:
• Surface-tracking method: mesh moving to capture free surface,
limited to small and medium wave slopes
• Single/two phase level-set method: mesh fixed and level-set
function used to capture the gas/liquid interface, capable of
studying steep or breaking waves.
2021/03/03 CFD club@HCMUT 78
Examples of modeling (Turbulence and free surface models)

URANS, Re=105, contour of vorticity for turbulent


flow around NACA12 with angle of attack 60 degrees

DES, Re=105, Iso-surface of Q criterion (0.4) for


turbulent flow around NACA12 with angle of attack 60
degrees

URANS, Wigley Hull pitching and heaving

2021/03/03 CFD club@HCMUT 79


Numerical methods

• The continuous Initial Boundary Value Problems (IBVPs) are


discretized into algebraic equations using numerical methods.
Assemble the system of algebraic equations and solve the system
to get approximate solutions
• Numerical methods include:
1. Discretization methods
2. Solvers and numerical parameters
3. Grid generation and transformation
4. High Performance Computation (HPC) and post-
processing

2021/03/03 CFD club@HCMUT 80


Discretization methods

• Finite difference methods (straightforward to apply, usually for


regular grid) and finite volumes and finite element methods
(usually for irregular meshes)
• Each type of methods above yields the same solution if the grid is
fine enough. However, some methods are more suitable to some
cases than others
• Finite difference methods for spatial derivatives with different
order of accuracies can be derived using Taylor expansions, such
as 2nd order upwind scheme, central differences schemes, etc.
• Higher order numerical methods usually predict higher order of
accuracy for CFD, but more likely unstable due to less numerical
dissipation
• Temporal derivatives can be integrated either by the explicit
method (Euler, Runge-Kutta, etc.) or implicit method (e.g. Beam-
Warming method)
2021/03/03 CFD club@HCMUT 81
Discretization methods (cont’d)

• Explicit methods can be easily applied but yield conditionally


stable Finite Different Equations (FDEs), which are restricted by
the time step; Implicit methods are unconditionally stable, but
need efforts on efficiency.
• Usually, higher-order temporal discretization is used when the
spatial discretization is also of higher order.
• Stability: A discretization method is said to be stable if it does not
magnify the errors that appear in the course of numerical solution
process.
• Pre-conditioning method is used when the matrix of the linear
algebraic system is ill-posed, such as multi-phase flows, flows with
a broad range of Mach numbers, etc.
• Selection of discretization methods should consider efficiency,
accuracy and special requirements, such as shock wave tracking.

2021/03/03 CFD club@HCMUT 82


Discretization methods (example)

• 2D incompressible laminar flow boundary layer


(L,m+1)
y
u v m=MM+1
 0 (L-1,m) (L,m) m=MM
x y
2 m=1
u u   p u m=0
u v     2 (L,m-1) L-1 L
x
x y x  e  y
u uml
u  uml  uml 1   2u 
x x  2  2 uml 1  2uml  uml 1 
y y
u vml
v  uml 1  uml  FD Sign( v l )<0 2nd order central difference
y y m
i.e., theoretical order of accuracy
vml Pkest= 2.
 uml  uml 1  BD Sign( l )>0
y vm
1st order upwind scheme, i.e., theoretical order of accuracy Pkest= 1
2021/03/03 CFD club@HCMUT 83
Discretization methods (example)

B
 B2 1  3 B1
 ul  FD  l l
 y 2    v    v 
 m  vml  2  uml   2  m FD  uml 1   2  m BD  uml 1
 x 1
BD y   y y   y y 
 y 
uml l 1 
 um  ( p / e)lm
 l
x x
Bu l
1 m 1
l
Bu Bu
2 m
l
3 m 1 Bu l 1
4 m   p / e m B4
x
l
 l 1   p   Solve it using
l  B4u1    
 B2 B3 0 0 0 0 0 0   u1   x  e 1  Thomas algorithm
B B B 0 0 0 0 0    
 
 1 2 3      
      
     
     
 0 0 0 0 0 B 1 B2 B3     

 0 0 0 0 0 0 B1 B2  umm   l
  p 
l
l 1
 B4umm    
To be stable, Matrix has to be  x  e  mm 
Diagonally dominant.
2021/03/03 CFD club@HCMUT 84
Solvers and numerical parameters

• Solvers include: tridiagonal, pentadiagonal solvers, PETSC solver,


solution-adaptive solver, multi-grid solvers, etc.
• Solvers can be either direct (Cramer’s rule, Gauss elimination, LU
decomposition) or iterative (Jacobi method, Gauss-Seidel method, SOR
method)
• Numerical parameters need to be specified to control the calculation.
• Under relaxation factor, convergence limit, etc.
• Different numerical schemes
• Monitor residuals (change of results between iterations)
• Number of iterations for steady flow or number of time steps for
unsteady flow
• Single/double precisions

2021/03/03 CFD club@HCMUT 85


Numerical methods (grid generation)
• Grids can either be structured (hexahedral) or
unstructured (tetrahedral). Depends upon structured
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 unstructured
geometries
Unstructured grids permit automatic
adaptive refinement based on the
pressure gradient, or regions
interested (FLUENT)

2021/03/03 CFD club@HCMUT 86


Grids
 Structured Grid
+ all nodes have the same number of elements around
it
– only for simple domains

 Unstructured Grid
+ for all geometries
– irregular data structure

 Block Structured Grid

2021/03/03 CFD club@HCMUT 87


Numerical methods (grid transformation)
y h

Transform

o x o x
Physical domain Computational domain

•Transformation between physical (x,y,z) f f x f h f f


and computational (x,h,z) domains,    xx  hx
x x x h x x h
important for body-fitted grids. The partial
f f x f h f f
derivatives at these two domains have the    x y  h y
y x y h y x h
relationship (2D as an example)

2021/03/03 CFD club@HCMUT 88


High performance computing
• CFD computations (e.g. 3D unsteady flows) are usually very expensive which
requires parallel high performance supercomputers (e.g. IBM 690) with the
use of multi-block technique.
• As required by the multi-block technique, CFD codes need to be developed
using the Massage Passing Interface (MPI) Standard to transfer data
between different blocks.
• Emphasis on improving:
• Strong scalability, main bottleneck pressure Poisson solver for incompressible flow.
• Weak scalability, limited by the memory requirements.

Figure: Weak scalability of total times without I/O for CFDShip-Iowa V6


Figure: Strong scalability of total times without I/O for CFDShip-
and V4 on IBM P6 (DaVinci) and SGI Altix (Hawk) are compared with
Iowa V6 and V4 on NAVO Cray XT5 (Einstein) and IBM P6
ideal scaling.
(DaVinci) are compared with ideal scaling.
2021/03/03 CFD club@HCMUT 89
Post- processing

• Post-processing:
 1. Visualize the CFD results (contour, velocity vectors, streamlines, path lines,
streak lines, and iso-surface in 3D, etc.), and
 2. CFD UA: verification and validation using EFD data (more details later)
• Post-processing usually through using commercial software

Figure: Isosurface of Q=300 colored using piezometric pressure, free=surface colored using z for fully appended Athena,
Fr=0.25, Re=2.9×108. Tecplot360 is used for visualization.

2021/03/03 CFD club@HCMUT 90


9 Types of CFD codes

2021/03/03 CFD club@HCMUT 91


CFD code

• CFD codes typically designed for representation of


specific flow phenomenon
– Viscous vs. inviscid (no viscous forces) (Re)
– Turbulent vs. laminar (Re)
– Incompressible vs. compressible (Ma)
– Single- vs. multi-phase (Co)
– Thermal/density effects and energy equation (Pr, g, Gr, Ec)
– Free-surface flow and surface tension (Fr, We)
– Chemical reactions, mass transfer
– etc…

2021/03/03 CFD club@HCMUT 92


How does a CFD code work?

All codes contain three main elements:


•A pre-processor
•A solver and
•A post-processor

2021/03/03 CFD club@HCMUT 93


Types of CFD codes

• Commercial CFD code: FLUENT, Star-CD,


CFDRC, CFX/AEA, etc.
• Research CFD code: CFDSHIP-IOWA
• Public domain software (PHI3D, HYDRO,
and WinpipeD, etc.)
• Other CFD software includes the Grid
generation software (e.g. Gridgen, Gambit)
and flow visualization software (e.g.
Tecplot, FieldView)

CFDSHIPIOWA
2021/03/03 CFD club@HCMUT 94
CFD Educational Interface

2021/03/03 CFD club@HCMUT 95


10 CFD process

2021/03/03 CFD club@HCMUT 96


CFD process

• Purposes of CFD codes will be different for different applications:


investigation of bubble-fluid interactions for bubbly flows, study of wave
induced massively separated flows for free-surface, etc.
• Depend on the specific purpose and flow conditions of the problem, different
CFD codes can be chosen for different applications (aerospace, marines,
combustion, multi-phase flows, etc.)
• Once purposes and CFD codes chosen, “CFD process” is the steps to set up
the IBVP problem and run the code:
1. Geometry
2. Physics
3. Mesh
4. Solve
5. Reports
6. Post processing

2021/03/03 CFD club@HCMUT 97


CFD process

Geometry Physics Mesh Solve Reports Post-


Processing

Select Heat Transfer Unstructured Steady/ Forces Report Contours


Geometry ON/OFF (automatic/ Unsteady (lift/drag, shear
manual) stress, etc)

Compressible Structured Iterations/ XY Plot Vectors


Geometry ON/OFF (automatic/ Steps
Parameters manual)

Domain Flow Convergent Verification Streamlines


Shape and properties Limit
Size

Viscous Precisions Validation


Model (single/
double)

Boundary Numerical
Conditions Scheme

Initial
Conditions

2021/03/03 CFD club@HCMUT 98


Geometry

• Selection of an appropriate coordinate


• Determine the domain size and shape
• Any simplifications needed?
• What kinds of shapes needed to be used to best resolve the
geometry? (lines, circular, ovals, etc.)
• For commercial code, geometry is usually created using
commercial software (either separated from the commercial
code itself, like Gambit, or combined together, like FlowLab)
• For research code, commercial software (e.g. Gridgen) is used.

2021/03/03 CFD club@HCMUT 99


Physics

• Flow conditions and fluid properties


1. Flow conditions: inviscid, viscous, laminar, or
turbulent, etc.
2. Fluid properties: density, viscosity, and
thermal conductivity, etc.
3. Flow conditions and properties usually presented in
dimensional form in industrial commercial CFD software,
whereas in non-dimensional variables for research codes.
• Selection of models: different models usually fixed by codes,
options for user to choose
• Initial and Boundary Conditions: not fixed by codes, user needs
specify them for different applications.

2021/03/03 CFD club@HCMUT 100


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.

2021/03/03 CFD club@HCMUT 101


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)

2021/03/03 CFD club@HCMUT 102


Reports

• Reports saved the time history of the residuals of the velocity,


pressure and temperature, etc.
• Report the integral quantities, such as total pressure drop,
friction factor (pipe flow), lift and drag coefficients (airfoil flow),
etc.
• XY plots could present the centerline velocity/pressure
distribution, friction factor distribution (pipe flow), pressure
coefficient distribution (airfoil flow).
• AFD or EFD data can be imported and put on top of the XY plots
for validation

2021/03/03 CFD club@HCMUT 103


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

2021/03/03 CFD club@HCMUT 104


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:

Error: S  S  T   SM   SN Uncertainty: U S2  U SM
2 2
 U SN
• Verification: process for assessing simulation numerical
uncertainties USN and, when conditions permit, estimating the sign
and magnitude Delta δ*SN of the simulation numerical error itself and
the uncertainties in that error estimate USN
J
 SN   I   G   T   P   I    j 2
U SN  U I2  U G2  U T2  U P2
j 1
I: Iterative, G : Grid, T: Time step, P: Input parameters

• Validation: process for assessing simulation modeling uncertainty


USM by using benchmark experimental data and, when conditions
permit, estimating the sign and magnitude of the modeling error δSM
itself.
2 2 2
E  D  S    (   ) U V  U D  U SN
D SM SN

D: EFD Data; UV: Validation Uncertainty E  UV Validation achieved


2021/03/03 CFD club@HCMUT 105
Post-processing (UA, verification)

• Convergence studies: Convergence studies require a minimum of


m=3 solutions to evaluate convergence with respective to input
parameters. Consider the solutions corresponding

to fine , 
medium ,and coarse Smeshes Sk2 Sk3
k1

    Monotonic Convergence

 k 21  Sk 2  Sk1  k 32  Sk 3  Sk 2
Rk   k 21  k 32
(i). Monotonic convergence: 0<Rk<1
(ii). Oscillatory Convergence: Rk<0; | Rk|<1 Monotonic Divergence Oscillatory Convergence

(iii). Monotonic divergence: Rk>1


(iv). Oscillatory divergence: Rk<0; | Rk|>1

• Grid refinement ratio: uniform ratio of grid spacing between meshes.

rk  xk 2 xk1  xk3 xk 2  xk m xk m1


2021/03/03 CFD club@HCMUT 106
Post-processing (Verification, RE)

• Generalized Richardson Extrapolation (RE): For monotonic


convergence, generalized RE is used to estimate the error δ*k and
order of accuracy pk due to the selection of the kth input
parameter.
• The error is expanded in a power series expansion with integer
powers of xk as a finite sum.
• The accuracy of the estimates depends on how many terms are
retained in the expansion, the magnitude (importance) of the
higher-order terms, and the validity of the assumptions made in
RE theory

2021/03/03 CFD club@HCMUT 107


Post-processing (Verification, RE)
*
 SN   SN   SN εSN is the error in the estimate
*
SC  S   SN SC is the numerical benchmark
Finite sum for the kth
Power series expansion parameter and mth solution
J
p k i 
Sˆk  S k   I  S C   k    *jm
* * n
m m km m  k*   xk
m m
 g ki 
j 1, j  k
i 1
pk(i )

n pk( i ) J
Sˆkm  SC   xkm   g k(i )   *
jm
order of accuracy for the ith term
i 1 j 1, j  k

J J
Sˆk1  SC  xk1   pk(1)
g (1)
k   *
j1 
Sˆk 2  SC  rk xk1  pk(1)
g (1)
k  *
 j2

j 1, j  k j 1, j  k

J
pk(1)

Sˆk3  SC  r xk1 k
2
 g (1)
k   *
j3 Three equations with three unknowns
j 1, j  k

pk 

ln  k32  k21  * *
k
   21

lnrk  k1 REk 1
rkpk  1
2021/03/03 CFD club@HCMUT 108
Post-processing (UA, verification, cont’d)

• Monotonic Convergence: Generalized Richardson Extrapolation

ln   k 32  k 21  rkpk  1  9.6 1  C 2  1.1  * 1  Ck  0.125


Ck  
U k    REk 1
k
pk  rk
pkest
1
ln  rk  *
  2 1  Ck  1  REk1
1  Ck  0.125
1. Correction  k 21
 2.4 1C 2  0.1  RE
*
factors  RE  pk k
* 1  Ck  0.25
k1
r k 1 U kc    1C 1  * * k1

pkest is the theoretical order of accuracy, 2 for 2nd


[|1 kCk |] RE| k 1RE | k1
| 1  C k | 0.25

order and 1 for 1st order schemes U k is the uncertainties based on fine mesh
Ck is the correction factor solution,U kc is the uncertainties based on
numerical benchmark SC
2. GCI approach *
U kc  Fs  1  RE
U k  Fs  RE k1
*
k1
FS: Factor of Safety
• Oscillatory Convergence: Uncertainties can1 be estimated, but without
signs and magnitudes of the errors. U k  SU  S L 
• Divergence 2
• In this course, only grid uncertainties studied. So, all the variables with
subscribe symbol k will be replaced by g, such as “Uk” will be “Ug”

2021/03/03 CFD club@HCMUT 109


Post-processing (UA, verification, cont’d)

• Verification for velocity profile using AFD: To avoid ill-defined


ratios, L2 norm of the G21 and G32 are used to define RG and PG

RG   G21 G pG 

ln  G32
2
G 21 2

2 32 2
ln rG 
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.

2021/03/03 CFD club@HCMUT 111


Post-processing (Verification: Iterative convergence)

•Typical CFD solution techniques for obtaining steady state solutions


involve beginning with an initial guess and performing time marching or
iteration until a steady state solution is achieved.
•The number of order magnitude drop and final level of solution residual
can be used to determine stopping criteria for iterative solution techniques
(1) Oscillatory (2) Convergent (3) Mixed oscillatory/convergent

(a) 1 (b)
UI  ( 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)
2021/03/03 CFD club@HCMUT 112
Post-processing (UA, validation)

• Validation procedure: simulation modeling uncertainties


was presented where for successful validation, the comparison
error, E, is less than the validation uncertainty, Uv.
• Interpretation of the results of a validation effort
E  U V Validation achieved E  D  S   D  ( SM   SN )
2
U V  E Validation not achieved U V  U SN  U D2

• Validation example
Example: Grid study
and validation of
wave profile for
series 60

2021/03/03 CFD club@HCMUT 113


11 Example of CFD process
using CFD Educational Interface

2021/03/03 CFD club@HCMUT 114


Example of CFD process using CFD Educational Interface (Geometry)

• Turbulent flows (Re=143K) around Clarky airfoil with


angle of attack 6 degree is simulated.
• “C” shape domain is applied
• The radius of the domain Rc and downstream length Lo
should be specified in such a way that the domain size
will not affect the simulation results
2021/03/03 CFD club@HCMUT 115
Example of CFD process (Physics)
No heat transfer

2021/03/03 CFD club@HCMUT 116


Example of CFD process (Mesh)

Grid need to be refined near the


foil surface to resolve the boundary
layer
2021/03/03 CFD club@HCMUT 117
Example of CFD process (Solve)

Residuals vs. iteration

2021/03/03 CFD club@HCMUT 118


Example of CFD process (Reports)

2021/03/03 CFD club@HCMUT 119


Example of CFD process (Post-processing)

2021/03/03 CFD club@HCMUT 120


12 Example of CFD
analysis process

2021/03/03 CFD club@HCMUT 121


CFD analysis process
1. Formulate the Flow Problem
2. Model the Geometry
3. Model the Flow (Computational) Domain
4. Generate the Grid
5. Specify the Boundary Conditions
6. Specify the Initial Conditions
7. Set up the CFD Simulation
8. Perform and Monitor the CFD Simulation
9. Examine and Process the CFD Results
10. Further Analysis?
11. Report the Findings

The objective is confidence that the CFD results provide accurate,


credible, and useful information.

2021/03/03 CFD club@HCMUT 122


Formulate the flow problem

Determine the following:


1. What is the objective?
Engineering quantities
Performance
Proof of concept
2. What is known?
Free stream conditions
Geometry ONERA M6 Wing
Configuration - Section coordinates and wing tip shape
- Tunnel test section: M, Re, Tt
3. What is best analysis approach? - Wing: 
Steady or unsteady flow? - Aerodynamics quantities to determine:
Are viscous forces important? Static pressure distributions (loading)
Are shocks present? Lift and drag coefficients
What equations to solve?
What other flow models are needed?

2021/03/03 CFD club@HCMUT 123


Model the geometry

Determine the following:


1. What geometric features are significant?
Steps, leading edges, trailing edges
2. Any simplification of the geometry needed?
Smooth over small steps
3. What computational format for geometry?
Lines, curves, surfaces
CAD file format (IGES, Step, …)

ONERA M6 Wing
- Table of airfoil coordinates
- Drawing of planform shape
- Develop a CAD model of wing

2021/03/03 CFD club@HCMUT 124


Model the flow domain

The flow (computational) domain is the


Wing
control volume (bounded by the control
surface) in which the flow field is computed. Reflection
Plane Outflow
• Body is part of surface of flow domain.
• The geometry of the flow domain is also
computationally modeled (CAD).
• Shape of the flow domain usually considers
the grid topology (this is especially true of
structured grids).
• Extent of flow domain depends on choice of
boundary conditions. Farfield
- Subsonic flow boundaries need to be farther
out since waves travel in all directions. ONERA M6 Wing
- Wing surface part of domain boundary
- Supersonic flow boundaries can be closer to
body if one considers wave motion. - Reflection plane at root of wing
- Farfield boundaries out 15 chord lengths
- Reflection (flow symmetry) planes can
- Outflow boundary downstream
effectively reduce the size of the flow domain.

2021/03/03 CFD club@HCMUT 125


Generate the grid

A grid is generated within the flow domain.


• The grid consists of finite-volume cells on
which the CFD equations are approximated.
• The flow domain may be divided into zones
for various reasons:
- Simplify grid generation.
- Reduce memory requirements.
- Divide grid for parallel computation.
• Grids can be structured or unstructured.
• Software packages are available for grid
generation: Gridgen, ICEM CFD, VGRID.
• WIND assumes grid has been
generated. ONERA M6 Wing
- Single-zone C-grid wrapped about the wing
- Cluster grid normal to wall (y+30)
- Clustering downstream helps resolve wake
- Stretch grid away from wing (15-20%)

2021/03/03 CFD club@HCMUT 126


Specify the boundary conditions

Numerical conditions need to be applied at Viscous Wall BC


the boundaries of the flow domain and
zones. Reflection BC
Outflow BC
• Specify types of boundary condition:
Viscous (no-slip) wall
Inflow / outflow
Reflection
Coupled

• Zone-to-zone boundaries and overlapped


zones require topology and coupling
specifications. Free stream BC
• Specification of boundary conditions may be ONERA M6 Wing
part of grid generation package. - Free stream BC at farfield boundary
• Additional inputs may be required in the - Outflow BC at outflow boundary
flow code input process (i.e. flow rates, - No-slip, adiabatic wall BC at wing surface
- Reflection BC at reflection plane
pressures,…).

2021/03/03 CFD club@HCMUT 127


Specify the initial conditions

Marching numerical methods require


a flow field from which to start.
• One choice is to start with a uniform flow
field with conditions of the freestream or
inflow conditions.
• Initial transients in the flow at the start of
the marching may inhibit convergence
and perhaps cause the simulation to fail.
• An auxiliary program can be developed to
approximate the final solution to enhance
convergence.
• An initial solution that satisfies mass ONERA M6 Wing
conservation helps simulations of internal - Initialize flow with tunnel flow conditions
flows.

2021/03/03 CFD club@HCMUT 128


Set up the CFD simulation

The simulation requires several input files:


Grid file
Initial solution file
Input data file
Auxiliary files (i.e. multi-processor, local boundary
conditions, chemistry,…)

Input Data File


Reference state Numerical algorithm inputs
Free stream flow conditions (Mach, p, T, Re) Time-marching / space-marching
Configuration (angle-of-attack & sideslip) Explicit / implicit operators
Damping schemes
Physical model inputs
Convergence acceleration
Dimensionality (3D, 2D, axisymmetric)
Convergence monitoring
Flow equations (RANS, PNS, Euler)
Turbulence model
Gas model / chemistry ONERA M6 Wing
Common Grid File (m6wing.cgd)
Common Solution File (m6wing.cfl)
Input Data File (m6wing.dat)
Multi-Processor Control File (m6wing.mpc)

2021/03/03 CFD club@HCMUT 129


Perform and monitor the CFD simulation

• Simulations typically require CPU times


on the order of hours and days.
• Marching methods are monitored to
determine iterative convergence.
• Residuals of conservation equations
should approach zero as the number of Lift on the M6 wing
iterations increases.
• Satisfaction of conservation statements
(mass, momentum, energy, …) are also
useful for monitoring iterative
convergence. ONERA M6 Wing
• Convergence to design / performance Monitored the residuals, as well as, the
lift and drag on the wing with number of
quantity (lift, drag, recovery) is often a
iterations.
critical test for iterative convergence.

2021/03/03 CFD club@HCMUT 130


Examine and process the CFD results

Visualization: Static pressures on the M6 wing


• View flow properties (Mach, pressure, vectors) to get
overall view of flow (CFD: Colorful Fluid Dynamics).
• Various packages: FAST, Fieldview, Ensight, TecPlot,
CFPOST.

Solution Processing:
• Extract data (lift, drag, recovery, spillage, etc…) useful
for iterative convergence monitoring and engineering
design (CFPOST).

2021/03/03 CFD club@HCMUT 131


Further analysis?

Once a simulation has reached iterative convergence and the results


examined and processed, there may be various reasons to make changes and
continue with another simulation:
• Change of physical model parameters to examine sensitivity.
Turbulence model / parameters
Gas / chemistry model
• Change of numerical algorithm parameters to examine sensitivity.
Implicit or explicit method
Time step parameters
Numerical flux parameters
• Change or refine the grid to examine grid sensitivity.
• Change the geometry as part of design parametric study.
• Change initial solution to examine iterative convergence.

2021/03/03 CFD club@HCMUT 132


Report the findings

CFD results, like any other data, should be reported along with some idea of the
level of error that it contains and indications of how much confidence one has in
the data.
• What are engineering results and uncertainty of those results?
• How much error is there in the iterative convergence?
• How much error is there in the grid convergence?
• How sensitive are the results to model parameters (turbulence, etc…)
• How sensitive are the results to algorithm parameters (CFL, etc…)
• How do the results compare to similar experimental or theoretical data?
• Statistical analysis may be useful for reporting such information.

2021/03/03 CFD club@HCMUT 133


Conclusions

① Computational Fluid Dynamics is an important tool in many


branches of science and engineering.
② Results are typically n-D, over 3-D plus time.
③ CFD calculations require simultaneous solution of many sets of
differential equations, typically involving 4th order Runge-Kutta in
3-D space.
④ Visualization of CFD data is an important and challenging problem,
requiring clever use of all available visualization tools and skills.

2021/03/03 CFD club@HCMUT 134

You might also like