Lecture1 Introduction 2 2020 PDF
Lecture1 Introduction 2 2020 PDF
Computer Modelling
Techniques
Lecture 1
Introduction to CFD and
Navier-Stokes Equations
Dr Cheng Xinwei
[email protected]
MMME3093 Computer Modelling Techniques 1
MMME3093 Computer Modelling Techniques
Governing equations
Mass
𝜕𝜌
+ 𝛻 ∙ 𝜌𝒖 = 0
𝜕𝑡
𝜕𝜌𝑤 𝜕𝑝
+ 𝛻 ∙ 𝜌𝑤𝒖 = − + 𝛻 ∙ 𝜇𝛻𝑤 + 𝑆𝑀𝑧
𝜕𝑡 𝜕𝑧
Governing equations
Energy
𝜕𝜌𝑖
+ 𝛻 ∙ 𝜌𝑖𝒖 = −𝑝𝛻𝑢 + 𝛻 ∙ 𝑘𝛻𝑇 + Φ + 𝑆𝑖
𝜕𝑡
Equation of state
𝑝 = 𝑝 𝜌, 𝑇 𝑎𝑛𝑑 𝑖 = 𝑖 𝜌, 𝑇
General scalar
The conservation laws can be represented in a uniform
format.
Rate change Convective
𝜕(𝜌𝜑)
+ 𝛻 ∙ 𝜌𝜑𝒖 = 𝛻∙ 𝛤𝛻𝜑 + 𝑆𝜑
𝜕𝑡
Diffusive Source term
Boundary conditions
Slip condition
To allow velocity at the wall to have an inviscid condition.
Boundary layer
u u
1st cell
boundary
wall
A wall function is used to get over
the laminar sub-layer. Enhanced wall treatment.
Grid is coarse such that the laminar Refined grid closer to the wall such
and transition parts of the turbulent that the boundary layer is
development are contained in the represented by about 10 cells in
cell layer in contact with the wall. order to see the velocity growth
MMME3093 Computer Modelling Techniques 8
MMME3093 Computer Modelling Techniques
Boundary layer
There are 2 fluid characteristics at the wall to describe the growth
of boundary layer.
Where 𝜏𝑤 is the shear stress at the wall due to the flow and 𝜌 is the fluid
density.
MMME3093 Computer Modelling Techniques 10
MMME3093 Computer Modelling Techniques
Worked example
Air flow in a duct is turbulent with a wall shear stress of 0.01 N/m2.
Given that the density of air is 1.2 kg/m3 and viscosity is 1.846 x
10-5 kg /(m s) and the cell height adjacent to the wall is 2 mm,
determine which wall treatment is appropriate for developing the
boundary layer.
Flow inlet
Velocity inlet
Typically, we specify a uniform velocity over the inlet and this boundary
condition allows Dirichlet specification of the velocity boundary condition.
It is possible to provide a function for the velocity profile but with serious
consideration if the inlet influences the flow structure significantly.
Flow inlet
Pressure inlet condition
Specifies the pressure across the inlet.
Allows the downstream flow from the inlet to influence the velocity profile
at inlet and does not rigidly fix the velocity.
Flow inlet
Turbulent velocity profile at inlet
If there is a pipe flow upstream of a vessel, it is desirable to model the
vessel only but not the pipe.
1ൗ
𝑟 7
𝑢 = 𝑢𝑚𝑎𝑥 1−
𝑅
Flow outlet
Pressure outlet
Similar to pressure inlet.
Allows variation of velocity across the boundary surface.
There may be velocity gradients at the exit i.e. in the direction of flow,
which may give unrealistic answers.
Outflow
Solves for continuity and therefore, mass flux is balanced.
Only suitable for flows without gradients of pressure or velocity in the
duct direction.
Computational mesh
• CFD techniques are executed on a desired geometry that is divided into a
number of smaller domains (cells), which is known as a computational
mesh.
• In the computational mesh, a set of interconnected nodes and cells at
which the variables are “stored” and where these variables are solved for.
• On this mesh, different numerical methods are applied to convert the
governing PDEs into difference/algebraic equations.
tetrahedron hexahedron
geometry
Computational mesh
Computational mesh
Computational mesh
• Finite volume method can work on both structured and
unstructured meshes.
• Thus, it is possible to generate multi-block structured mesh for
some complex shapes.
Mesh quality
Skewness implies angular acuteness in cells.
𝑆𝑘𝑒𝑤𝑛𝑒𝑠𝑠
𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒 − 𝑎𝑐𝑡𝑢𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒
=
𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒
Cell size is area for 2D, while volume is used for 3D.
Mesh quality
Aspect ratio is a measure of the stretching of a cell.
For example, the aspect ratio should be controlled such that the
gradient of velocity in the parallel is well represented.
Δy
Δx
MMME3093 Computer Modelling Techniques 20
MMME3093 Computer Modelling Techniques
Mesh quality
Good skewness
and aspect ratio
Discretisation
• The transport equations (in integral forms) cannot be
solved as they are, you need to discretise the temporal
and spatial terms.
• Discretisation involves the substitution of finite
difference approximations for the terms in the integral
equations and then converts the integral equations into
a system of algebraic equations.
• The PDE discretisation technique used for CFD is
• Finite volume method (FVM)- developed based on finite
difference.
Spatial discretisation
Taylor expansion of a function
f ' (a ) f '' (a ) f (3) (a )
f (x ) = f (a ) + (x − a ) + (x − a ) + (x − a )3 + ...
2
1! 2! 3!
f ' (x ) f '' (x ) f (3 ) ( x )
f (x + dx ) = f (x ) + dx + (dx ) + (dx )3 + ...
2
1! 2! 3!
x 2dx
MMME3093 Computer Modelling Techniques 23
MMME3093 Computer Modelling Techniques
𝑓 ′′ 𝑥
𝑓 𝑥 + 𝑑𝑥 = 𝑓 𝑥 + 𝑓 ′ 𝑥 𝑑𝑥 + 𝑑𝑥 2 +⋯
2!
𝜕𝜑 𝜕2𝜑 𝑑𝑥 2
𝜑𝐸 = 𝜑𝑃 + 𝑑𝑥 + 2
+⋯
𝜕𝑥 𝑃
𝜕𝑥 𝑃
2!
𝜕𝜑 𝜑𝐸 − 𝜑𝑃
∴ = + 𝑂 𝑑𝑥
𝜕𝑥 𝑝
𝑑𝑥
Order of accuracy
𝑓 ′′ 𝑥
𝑓 𝑥 − 𝑑𝑥 = 𝑓 𝑥 − 𝑓 ′ 𝑥 𝑑𝑥 + 𝑑𝑥 2 −⋯
2!
𝜕𝜑 𝜕2𝜑 𝑑𝑥 2
𝜑𝑊 = 𝜑𝑃 − 𝑑𝑥 + 2
+⋯
𝜕𝑥 𝑃
𝜕𝑥 𝑃
2!
𝜕𝜑 𝜑𝑃 − 𝜑𝑊
∴ = + 𝑂(𝑑𝑥)
𝜕𝑥 𝑃
𝑑𝑥
− f (x ) + f '
( x )dx − f ''
(x ) (dx )2 +
f (3 )
(x ) (dx )3 + ..
2! 3!
f (3 ) ( x )
= 2 f ( x )dx + 2
'
(dx )3 + ...
3!
f (x + dx ) − f (x − dx )
f ' (x ) = + O(dx )
2
Thus
2dx
𝜕𝜑 𝜑𝐸 − 𝜑𝑊
∴ = + 𝑂(𝑑𝑥)2
𝜕𝑥 𝑃
2𝑑𝑥
f ( x + dx ) − f ( x ) f ( x ) − f ( x − dx )
−
2
f '' ( x ) = 2 + O(dx )
f dx dx 2
x dx
2
f (x + dx ) − 2 f (x ) + f (x − dx )
f '' (x ) = 2 ( )
f
+
2
O dx
x (dx)2
d 2 u du
2
+ +u = 0
dx dx
Conclusions
This section covers the following aspects of numerical
modelling technique:
• General procedure of numerical modelling
• Derivation of transport equations
• Meshing and related properties
• Spatial discretisation with examples
References
• Lecture notes from UK Campus
• Versteeg, H.K. and Malalasekera W. An introduction to
computation fluid dynamics: the finite volume method.
Pearson, 2007