0% found this document useful (0 votes)
55 views

Lecture1 Introduction 2 2020 PDF

This document discusses computational fluid dynamics and the Navier-Stokes equations. It introduces the governing equations of mass, momentum, and energy. It describes initial and boundary conditions such as Dirichlet, Neumann, and Cauchy conditions. It discusses practical boundary conditions like non-slip and slip conditions. It also covers topics like boundary layer growth, wall functions, flow inlets, and turbulent velocity profiles.

Uploaded by

Lucas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Lecture1 Introduction 2 2020 PDF

This document discusses computational fluid dynamics and the Navier-Stokes equations. It introduces the governing equations of mass, momentum, and energy. It describes initial and boundary conditions such as Dirichlet, Neumann, and Cauchy conditions. It discusses practical boundary conditions like non-slip and slip conditions. It also covers topics like boundary layer growth, wall functions, flow inlets, and turbulent velocity profiles.

Uploaded by

Lucas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

MMME3093

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
𝜕𝑡

Momentum (x, y, z directions)


𝜕𝜌𝑢 𝜕𝑝
+ 𝛻 ∙ 𝜌𝑢𝒖 = − + 𝛻 ∙ 𝜇𝛻𝑢 + 𝑆𝑀𝑥
𝜕𝑡 𝜕𝑥
𝜕𝜌𝑣 𝜕𝑝
+ 𝛻 ∙ 𝜌𝑣𝒖 = − + 𝛻 ∙ 𝜇𝛻𝑣 + 𝑆𝑀𝑦
𝜕𝑡 𝜕𝑦

𝜕𝜌𝑤 𝜕𝑝
+ 𝛻 ∙ 𝜌𝑤𝒖 = − + 𝛻 ∙ 𝜇𝛻𝑤 + 𝑆𝑀𝑧
𝜕𝑡 𝜕𝑧

MMME3093 Computer Modelling Techniques 2


MMME3093 Computer Modelling Techniques

Governing equations
Energy
𝜕𝜌𝑖
+ 𝛻 ∙ 𝜌𝑖𝒖 = −𝑝𝛻𝑢 + 𝛻 ∙ 𝑘𝛻𝑇 + Φ + 𝑆𝑖
𝜕𝑡

Equation of state
𝑝 = 𝑝 𝜌, 𝑇 𝑎𝑛𝑑 𝑖 = 𝑖 𝜌, 𝑇

We have 5 flow equations, 2 further algebraic equations and


Newtonian viscosity model. In total, 7 unknowns need to be
determined.
The system is mathematically closed, provided that auxiliary, initial
and boundary conditions are given.

MMME3093 Computer Modelling Techniques 3


MMME3093 Computer Modelling Techniques

Couette flow example


Consider a steady, incompressible laminar flow of a Newtonian fluid in the
narrow gap between 2 infinite parallel plates. Top plate is moving at a velocity V
and bottom plate is stationary. Distance between two plates is h, gravity acts in
the negative z-direction. No applied pressure other than hydrostatic pressure.
Find the velocity and pressure fields.
MMME3093 Computer Modelling Techniques

General scalar
The conservation laws can be represented in a uniform
format.
Rate change Convective

𝜕(𝜌𝜑)
+ 𝛻 ∙ 𝜌𝜑𝒖 = 𝛻∙ 𝛤𝛻𝜑 + 𝑆𝜑
𝜕𝑡
Diffusive Source term

MMME3093 Computer Modelling Techniques 5


MMME3093 Computer Modelling Techniques

Initial and boundary conditions


• Initial conditions are easily defined based on the physical
background of the problem.
• Boundary conditions are conditions specified at the boundaries
of a domain but can be user-specified.

Boundary conditions

Dirichlet Neumann Cauchy


(First-type) (Second-type) (Third-type)
Directly specifies the Specifies the values An equation involving
values that a solution that the derivative of a both function value and
needs to take on the solution is to take on normal derivative are
boundary of the domain the boundary of the specified on the
domain boundary of the
MMME3093 Computer Modelling Techniques
domain 6
MMME3093 Computer Modelling Techniques

Practical boundary conditions


Velocity at wall
Non-slip condition
The real characteristic of a wall bound flow, where the molecules of fluid are
bound at the wall to have zero relative velocity.

Slip condition
To allow velocity at the wall to have an inviscid condition.

Boundary layer growth


Law of the wall model
To prescribe a standardised velocity profile over the first cell away from the wall.

Enhanced wall treatment


Flow is resolved to the wall such that cells next to the wall demonstrate the
growth of velocity in the boundary layer.

MMME3093 Computer Modelling Techniques 7


MMME3093 Computer Modelling Techniques

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

Selection of wall function


The value of 𝑦 + on the first cells adjacent to the wall determines
the applicable wall function type.

Choose a method with an initial cell size and then check 𝑦 + to


ensure that it is appropriate.

For 𝑦 + > 30, standard wall function.

For 𝑦 + < 1, enhanced wall function and there should be about 10


cells within the boundary layer.

MMME3093 Computer Modelling Techniques 9


MMME3093 Computer Modelling Techniques

Boundary layer
There are 2 fluid characteristics at the wall to describe the growth
of boundary layer.

Wall Reynolds number, 𝑦 +



+
𝑢 𝑦
𝑦 =
𝑣

Where 𝑦 is the first cell thickness, 𝑣 is the kinematic viscosity and 𝑢∗ is


the shear velocity.
𝜏𝑤
𝑢∗ =
𝜌

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.

MMME3093 Computer Modelling Techniques 11


MMME3093 Computer Modelling Techniques

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.

However, it forces the velocity profile across the inlet to be fixed. As


such, specifying a single value across the inlet may not reflect the reality
if there are upstream effects to be considered.

It is possible to provide a function for the velocity profile but with serious
consideration if the inlet influences the flow structure significantly.

MMME3093 Computer Modelling Techniques 12


MMME3093 Computer Modelling Techniques

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.

However, if there are influences upstream which are desired in the


model, then it may be best to prescribe a known velocity profile.

MMME3093 Computer Modelling Techniques 13


MMME3093 Computer Modelling Techniques

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.

The pipe exit velocity can be represented at the boundary as a fully


turbulent pipe profile according to the following equation.

1ൗ
𝑟 7
𝑢 = 𝑢𝑚𝑎𝑥 1−
𝑅

MMME3093 Computer Modelling Techniques 14


MMME3093 Computer Modelling Techniques

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.

MMME3093 Computer Modelling Techniques 15


MMME3093 Computer Modelling Techniques

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

pyramid prism or wedge

mesh triangle quadrilateral

MMME3093 Computer Modelling Techniques 16


MMME3093 Computer Modelling Techniques

Computational mesh
Computational mesh

Structured mesh Unstructured mesh

• Easier for numerical • Complex for numerical


implementation, but difficult implementation, but easy to
to generate for complex generate for complex
geometries geometries
• Quadrilateral in 2D and • Triangles in 2D and tetrahedral
hexahedral in 3D in 3D

MMME3093 Computer Modelling Techniques 17


MMME3093 Computer Modelling Techniques

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.

MMME3093 Computer Modelling Techniques 18


MMME3093 Computer Modelling Techniques

Mesh quality
Skewness implies angular acuteness in cells.

Applies to triangles and tetrahedral only.

𝑆𝑘𝑒𝑤𝑛𝑒𝑠𝑠
𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒 − 𝑎𝑐𝑡𝑢𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒
=
𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑐𝑒𝑙𝑙 𝑠𝑖𝑧𝑒

Optimal refers to regular shape i.e. equilateral, rectangular in 2D or


cuboid, tetrahedron in 3D.

Cell size is area for 2D, while volume is used for 3D.

Cells with high skewness can decrease accuracy.

MMME3093 Computer Modelling Techniques 19


MMME3093 Computer Modelling Techniques

Mesh quality
Aspect ratio is a measure of the stretching of a cell.

It is the ratio of longest to the shortest side in a cell.

Depends on the gradients in the long and short directions.

A large aspect ratio is fine as long as the gradients in the largest


direction are small.

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

Bad skewness and


aspect ratio

MMME3093 Computer Modelling Techniques 21


MMME3093 Computer Modelling Techniques

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.

MMME3093 Computer Modelling Techniques 22


MMME3093 Computer Modelling Techniques

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!

Finite difference method


f f (x + dx ) − f (x )
f ' (x ) = = + O(dx )
x dx
f f (x + dx ) − f (x − dx )
f ' (x ) = = + O(dx )
2

x 2dx
MMME3093 Computer Modelling Techniques 23
MMME3093 Computer Modelling Techniques

Spatial discretisation- First-order accuracy


Forward differencing

𝑓 ′′ 𝑥
𝑓 𝑥 + 𝑑𝑥 = 𝑓 𝑥 + 𝑓 ′ 𝑥 𝑑𝑥 + 𝑑𝑥 2 +⋯
2!
𝜕𝜑 𝜕2𝜑 𝑑𝑥 2
𝜑𝐸 = 𝜑𝑃 + 𝑑𝑥 + 2
+⋯
𝜕𝑥 𝑃
𝜕𝑥 𝑃
2!

𝜕𝜑 𝜑𝐸 − 𝜑𝑃
∴ = + 𝑂 𝑑𝑥
𝜕𝑥 𝑝
𝑑𝑥

Order of accuracy

MMME3093 Computer Modelling Techniques 24


MMME3093 Computer Modelling Techniques

Spatial discretisation- First-order accuracy


Backward differencing

𝑓 ′′ 𝑥
𝑓 𝑥 − 𝑑𝑥 = 𝑓 𝑥 − 𝑓 ′ 𝑥 𝑑𝑥 + 𝑑𝑥 2 −⋯
2!

𝜕𝜑 𝜕2𝜑 𝑑𝑥 2
𝜑𝑊 = 𝜑𝑃 − 𝑑𝑥 + 2
+⋯
𝜕𝑥 𝑃
𝜕𝑥 𝑃
2!

𝜕𝜑 𝜑𝑃 − 𝜑𝑊
∴ = + 𝑂(𝑑𝑥)
𝜕𝑥 𝑃
𝑑𝑥

MMME3093 Computer Modelling Techniques 25


MMME3093 Computer Modelling Techniques

Spatial discretisation- Second order accuracy


f ( x + dx ) − f ( x − dx ) = f ( x ) + f '
( x )dx + f ''
(x ) (dx )2 +
f (3 )
(x ) (dx )3 + ...
2! 3!

− 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𝑑𝑥

This is known as Central Differencing Scheme (CDS), which is


second order accurate because the quadratic dependence of the error
reduces faster than that of first order
MMME3093 Computer Modelling Techniques 26
MMME3093 Computer Modelling Techniques

Spatial discretisation- Second derivative

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

MMME3093 Computer Modelling Techniques 27


MMME3093 Computer Modelling Techniques

Spatial discretisation- Worked examples


i

d 2 u du
2
+ +u = 0
dx dx

Discretise the governing equation using


• Backward differencing
• Central differencing

MMME3093 Computer Modelling Techniques 28


MMME3093 Computer Modelling Techniques

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

MMME3093 Computer Modelling Techniques 31


MMME3093 Computer Modelling Techniques

References
• Lecture notes from UK Campus
• Versteeg, H.K. and Malalasekera W. An introduction to
computation fluid dynamics: the finite volume method.
Pearson, 2007

MMME3093 Computer Modelling Techniques 32

You might also like