MMME3093 Computer Modelling Techniques: Introduction To CFD and Navier-Stokes Equations
MMME3093 Computer Modelling Techniques: Introduction To CFD and Navier-Stokes Equations
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
Learning Outcomes
• Introduction to CFD
• Review the governing equations for thermo-fluids
• Understand boundary and initial conditions
• Understand numerical schemes (spatial)
• Pressure-velocity coupling
• Viscous models
Reading List
1. Versteeg, H. K., and W. Malalasekera. An introduction to
computional fluid dynamics: The Finite Volume Method.
Pearson.
2. Ferziger, Joel H., and Milovan Peric. Computational
methods for fluid dynamics. Springer.
MMME3093 Computer Modelling Techniques 2
MMME3093 Computer Modelling Techniques
Topics covered
• Governing equations
• Boundary conditions
• Meshing
• Discretisation schemes
• Finite volume method
• Diffusive, convective-diffusive flows
• Pressure-velocity coupling
• Viscous modelling
A B C
Navier-stokes equations
• A set of equations to describe mathematically how
velocity, pressure, temperature and density of a moving
fluid are related and including the effects of viscosity on
the flow.
• This is a maths problem but can be used to describe
such as
• Water flowing from a smaller to a larger pipe
• An airplane flying faster than the speed of sound
• Air flows in lungs
• Solution depends on the fluid properties i.e. viscosity,
density and also the boundary conditions of the domain.
MMME3093 Computer Modelling Techniques 5
MMME3093 Computer Modelling Techniques
What is CFD?
• CFD stands for Computational Fluid Dynamics.
• Relies on modelling of fluid mechanic equations of
motion i.e. fluid flow, heat transfer and associated
phenomena like chemical reactions.
• The computational aspect comes into it from finding a
numerical method to solve the equations.
• The equations involved are complex, inhomogeneous
partial differential equations (PDE) in 4 dimensions i.e.
3 space and 1 time.
Why CFD?
• Provides an insight of flow patterns that are
expensive or difficult to be studied using
experiment
• Cheaper, faster, parallel, multi-purpose
• However, CFD simulation cannot be 100%
reliable
WHY??
• Input data involve guessing
• Accuracy of results depends on computing power
• Mathematical model is inadequate
CFD software
CFD applications
CFD processes
Differential Differential
Physical Numerical
/algebraic /algebraic
processes results
equations equations
Modelling Numerical
Computers
techniques techniques
Numerical solution
Mathematical notations
Gradient (𝛻): A vector pointing in the direction of the greatest
rate of increment (to the greatest increasing direction).
𝜕𝑓 𝜕𝑓 𝜕𝑓
𝛻𝑓 = ∙ 𝑖Ԧ + ∙ 𝑗Ԧ + ∙ 𝑘 = 𝑔𝑟𝑎𝑑 (𝑓)
𝜕𝑥 𝜕𝑦 𝜕𝑧
Governing principles
Like any physical system, the thermo-fluid system obeys
the 3 famous laws of conservation:
• Conservation of mass
• Conservation of momentum
• Conservation of energy
Conservation of mass
Conservation of mass
𝜕(𝜌𝑤)
𝜕(𝜌𝑣) 𝜌𝑤 + 𝑑𝑧
𝜌𝑣 + 𝑑𝑦 𝜕𝑧
𝜕𝑦
𝜕(𝜌𝑢)
𝜌𝑢 + 𝑑𝑥
𝜕𝑥
𝜌𝑢
𝜌𝑣
𝜌𝑤
𝜕𝜌 𝜕(𝜌𝑢)
𝑑𝑥𝑑𝑦𝑑𝑧 = 𝜌𝑢𝑑𝑦𝑑𝑧 − 𝜌𝑢 + 𝑑𝑥 𝑑𝑦𝑑𝑧
𝜕𝑡 𝜕𝑥
𝜕(𝜌𝑣)
+ 𝜌𝑣𝑑𝑥𝑑𝑧 − 𝜌𝑣 + 𝑑𝑦 𝑑𝑥𝑑𝑧
𝜕𝑦
𝜕(𝜌𝑤)
+ 𝜌𝑤𝑑𝑥𝑑𝑦 − 𝜌𝑤 + 𝑑𝑧 𝑑𝑥𝑑𝑦
𝜕𝑧
MMME3093 Computer Modelling Techniques 15
MMME3093 Computer Modelling Techniques
Conservation of mass
𝜕𝜌 𝜕(𝜌𝑢) 𝜕(𝜌𝑣) 𝜕(𝜌𝑤)
∴ + + + =0
𝜕𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧
𝜕𝜌
Or + 𝛻 ∙ (𝜌𝒖) = 0
𝜕𝑡
Given that 𝒖 = 𝑢𝒊 + 𝑣𝒋 + 𝑤𝒌
If the flow is incompressible, i.e. 𝜌= constant
𝜕𝑢 𝜕𝑣 𝜕𝑤
∴ + + =0
𝜕𝑥 𝜕𝑦 𝜕𝑧
Conservation of momentum
Rate of increase of Net rate of
= Sum of forces for a
momentum in a + momentum flow in a
control volume
control volume control volume
𝐷𝑈
𝑚 = 𝐹Ԧ
𝐷𝑡
𝑒𝑥𝑡𝑒𝑟𝑛𝑎𝑙
𝑑(𝑚𝑢)
+ 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑚𝑜𝑚𝑒𝑛𝑡𝑢𝑚𝑜𝑢𝑡 − 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑚𝑜𝑚𝑒𝑛𝑡𝑢𝑚𝑖𝑛 = 𝐹Ԧ
𝑑𝑡
𝑒𝑥𝑡𝑒𝑟𝑛𝑎𝑙
Conservation of momentum
𝑑(𝑚𝑢)
+ 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑚𝑜𝑚𝑒𝑛𝑡𝑢𝑚𝑜𝑢𝑡 − 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑚𝑜𝑚𝑒𝑛𝑡𝑢𝑚𝑖𝑛 = 𝐹Ԧ
𝑑𝑡
𝑒𝑥𝑡𝑒𝑟𝑛𝑎𝑙
𝜕𝜌𝑢𝑤
𝜌𝑢𝑤 + 𝑑𝑧 𝑑𝑥𝑑𝑦
𝜕𝑧
𝜕𝜌𝑢𝑣
𝜌𝑢𝑣 + 𝑑y 𝑑𝑦𝑑𝑧
𝜕𝑦
𝜌𝑢𝑣 𝑑𝑦𝑑𝑧
𝜌𝑢𝑤 𝑑𝑥𝑑𝑦
𝑑(𝑚𝑢)
+ 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑚𝑜𝑚𝑒𝑛𝑡𝑢𝑚𝑜𝑢𝑡 − 𝑟𝑎𝑡𝑒 𝑜𝑓 𝑚𝑜𝑚𝑒𝑛𝑡𝑢𝑚𝑖𝑛
𝑑𝑡
𝜕(𝜌𝑢) 𝜕(𝜌𝑢𝑢) 𝜕(𝜌𝑢𝑣) 𝜕(𝜌𝑢𝑤)
= + + + 𝑑𝑥𝑑𝑦𝑑𝑧
𝜕𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧
MMME3093 Computer Modelling Techniques 18
MMME3093 Computer Modelling Techniques
Conservation of momentum
Using the definition of Divergence (𝛻), we can rewrite the continuity and
convective terms in the Navier-Stokes equation in the following way:
Velocity vector: 𝒖 = 𝑢𝒊 + 𝑣𝒋 + 𝑤𝒌
(u ) (v ) (w)
+ + 𝛻 ∙ (𝜌𝒖)
x y z
𝜕(𝜌𝑢) 𝜕(𝜌𝑢𝑢) 𝜕(𝜌𝑢𝑣) 𝜕(𝜌𝑢𝑤) 𝜕(𝜌𝑢)
+ + + 𝑑𝑥𝑑𝑦𝑑𝑧 = + 𝛻 ∙ 𝜌𝑢𝒖 𝑑𝑥𝑑𝑦𝑑𝑧
𝜕𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧 𝜕𝑡
Conservation of momentum
Rate of increase of Net rate of
Sum of forces for a
momentum in a + momentum flow in a = control volume
control volume control volume
2 types of forces
Conservation of momentum
As an example, the net force in the x-direction is the sum of the
force components on every surface acting in that direction.
Conservation of momentum
Equating this equation to the rate of increase of momentum in
the x-direction derived earlier
Rate of increase of Net rate of
Sum of forces for a
momentum in a + momentum flow in a =
control volume
control volume control volume
Navier-Stokes equations
For Newtonian fluids, viscous stresses are proportional to the
both linear deformation rate and volumetric deformation rate.
𝜕𝑢 𝜕𝑢 𝜕𝑢
𝜏𝑥𝑥 = 𝜇 + + λ 𝛻 ∙ 𝒖 = 2𝜇 +λ𝛻∙𝒖 𝜕𝑢 𝜕𝑣
𝜕𝑥 𝜕𝑥 𝜕𝑥 𝜏𝑥𝑦 = 𝜏𝑦𝑥 = 𝜇 +
𝜕𝑦 𝜕𝑥
𝜕𝑣 𝜕𝑣 𝜕𝑣 𝜕𝑢 𝜕𝑤
𝜏𝑦𝑦 =𝜇 + + λ 𝛻 ∙ 𝒖 = 2𝜇 +λ𝛻∙𝒖 𝜏𝑥𝑧 = 𝜏𝑧𝑥 = 𝜇 +
𝜕𝑧 𝜕𝑥
𝜕𝑦 𝜕𝑦 𝜕𝑦
𝜕𝑣 𝜕𝑤
𝜕𝑤 𝜕𝑤 𝜕𝑤 𝜏𝑦𝑧 = 𝜏𝑧𝑦 = 𝜇 +
𝜕𝑧 𝜕𝑦
𝜏𝑧𝑧 = 𝜇 + + λ 𝛻 ∙ 𝒖 = 2𝜇 +λ𝛻∙𝒖
𝜕𝑧 𝜕𝑧 𝜕𝑧
Navier-Stokes equations
For compressible Newtonian flow
𝜕𝜌 𝜕(𝜌𝑢) 𝜕(𝜌𝑣) 𝜕(𝜌𝑤)
Continuity equation: + + + =0
𝜕𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧
Navier-Stokes equations:
𝜕(𝜌𝑢) 𝜕(𝜌𝑢𝑢) 𝜕(𝜌𝑢𝑣) 𝜕(𝜌𝑢𝑤)
𝜕𝑡
+
𝜕𝑥
+
𝜕𝑦
+
𝜕𝑧
=
𝜕𝑝 𝜕2𝑢 𝜕2 𝑢 𝜕2𝑢 𝜕 𝜕𝑢 𝜕𝑣 𝜕𝑤
− +𝜇 + + + + + + 𝑆𝑀𝑥
𝜕𝑥 𝜕𝑥 2 𝜕𝑦 2 𝜕𝑧 2 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑧
𝜕(𝜌𝑣) 𝜕(𝜌𝑢𝑣) 𝜕(𝜌𝑣𝑣) 𝜕(𝜌𝑣𝑤)
𝜕𝑡
+
𝜕𝑥
+
𝜕𝑦
+
𝜕𝑧
=
𝜕𝑝 𝜕 2 𝑣 𝜕 2 𝑣 𝜕 2 𝑣 𝜕 𝜕𝑢 𝜕𝑣 𝜕𝑤
− +𝜇 + + + + + + 𝑆𝑀𝑦
𝜕𝑦 𝜕𝑥 2 𝜕𝑦 2 𝜕𝑧 2 𝜕𝑦 𝜕𝑥 𝜕𝑦 𝜕𝑧
𝜕(𝜌𝑤) 𝜕(𝜌𝑢𝑤) 𝜕(𝜌𝑣𝑤) 𝜕(𝜌𝑤𝑤)
+ + + =
𝜕𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧
𝜕𝑝 𝜕 2 𝑤 𝜕 2 𝑤 𝜕 2 𝑤 𝜕 𝜕𝑢 𝜕𝑣 𝜕𝑤
− +𝜇 + + + + + + 𝑆𝑀𝑧
𝜕𝑧 𝜕𝑥 2 𝜕𝑦 2 𝜕𝑧 2 𝜕𝑧 𝜕𝑥 𝜕𝑦 𝜕𝑧
MMME3093 Computer Modelling Techniques 24
MMME3093 Computer Modelling Techniques
Navier-Stokes equations
For incompressible flow
𝜕𝑢 𝜕𝑣 𝜕𝑤
Continuity equation: + + =0
𝜕𝑥 𝜕𝑦 𝜕𝑧
Energy equation
•The Navier-Stokes energy equation can be derived
using similar concept to that of momentum equation.
•It is based on the First of Law of Thermodynamics
(Conservation of Energy).
Energy equation
Rate of increase Net rate of heat Net rate of work
of energy of fluid = added to fluid + done on fluid
particle particle particle
𝐷𝐸
𝜌 𝑑𝑥 𝑑𝑦 𝑑𝑧
𝐷𝑡
𝑝𝑢 𝜕(𝑝𝑢)
𝑝𝑢 + 𝑑𝑥
τ𝑥𝑥 𝑢 𝜕𝑥
𝜕(τ𝑥𝑥 𝑢)
τ𝑥𝑥 𝑢 + 𝑑𝑥
𝜕𝑥
τ𝑧𝑥 𝑢
MMME3093 Computer Modelling Techniques 28
MMME3093 Computer Modelling Techniques
Where
𝜕(𝑢𝑝) 𝜕(𝑣𝑝) 𝜕(𝑤𝑝)
−𝑑𝑖𝑣 (𝜌𝒖) = − − −
𝜕𝑥 𝜕𝑦 𝜕𝑧
Net rate of heat transfer to the fluid particle due to heat flow in the x-
direction is given by
𝜕(𝑞𝑧 )
𝑞𝑧 + 𝑑𝑧
𝜕𝑧
𝜕(𝑞𝑦 )
𝑞𝑦 + 𝑑y
𝜕𝑦
𝑞𝑥 𝜕(𝑞𝑥 )
𝑞𝑥 + 𝑑𝑥
𝜕𝑥
𝑞𝑦
MMME3093 Computer Modelling Techniques
𝑞𝑧 31
MMME3093 Computer Modelling Techniques
Sum of these per unit volume gives the total rate of heat added to
the fluid particle.
q = - k grad T
Thus, the rate of heat addition to the fluid particle per unit volume
due to heat conduction across element boundaries becomes
Energy equation
The energy equation per unit volume thus becomes
𝐷𝐸 𝜕𝑢 τ𝑥𝑥 𝜕(𝑢𝜏𝑦𝑥 ) 𝜕(𝑢𝜏𝑧𝑥 )
𝜌 = − 𝑑𝑖𝑣 𝑝𝒖 + [ + +
𝐷𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧
𝜕(𝑣τ𝑥𝑦 ) 𝜕(𝑣τ𝑦𝑦 ) 𝜕(𝑣τ𝑧𝑦 ) 𝜕𝑤(τ𝑥𝑧 ) 𝜕(𝑤τ𝑦𝑧 ) 𝜕(𝑤τ𝑧𝑧 )
+ + + + + + ]
𝜕𝑦 𝜕𝑦 𝜕𝑧 𝜕𝑥 𝜕𝑦 𝜕𝑧
+ div (k grad T) + 𝑆𝐸
Energy equation
The change between energy equation and kinetic energy equation
yields the equation for internal energy.
𝐷𝑖 𝜕𝑢 𝜕𝑢 𝜕𝑢
𝜌 = − 𝑝 𝑑𝑖𝑣 𝒖+ div (k grad T) + 𝜏𝑥𝑥 + 𝜏𝑦𝑥 + 𝜏𝑧𝑥
𝐷𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧
𝜕𝑣 𝜕𝑣 𝜕𝑣 𝜕𝑤 𝜕𝑤 𝜕𝑤
+ 𝜏𝑥𝑦 + 𝜏𝑦𝑦 + 𝜏𝑧𝑦 + 𝜏𝑥𝑧 + 𝜏𝑦𝑧 + 𝜏𝑧𝑧 + 𝑆𝑖
𝜕𝑥 𝜕𝑦 𝜕𝑧 𝜕𝑥 𝜕𝑦 𝜕𝑧
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
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