Professional Documents
Culture Documents
Numerical Solution Algorithms For Compressible Flows
Numerical Solution Algorithms For Compressible Flows
Numerical Solution Algorithms For Compressible Flows
Hrvoje Jasak
Faculty of Mechanical Engineering
and Naval Architecture
Introduction
Introduction: CFD in
Aeronautical Applications
Introduction
• Aerospace industry is the first and most prevalent in the use of numerical
techniques, including Computational Fluid Dynamics (CFD)
• In most phases of the process, it was the aerospace industry driving the
CFD development to answer to its needs
Early adpotion of numerical modelling in aerospace applications has brought
with it some interesting consequences: living with expensive computer hardware
and limited memory space leads to simplified modelling techniques and carefully
tuned solution algorithms for the set of problems under consideration. Example:
1-equation turbulence models for airfoil calculations, e.g. Baldwin-Lomax.
• Some problems still hit issues with level of performance increase: how much
is the difference in results quality between steady 2-D RANS and 3-D LES
for single airfoil design
2.1 Modern Aircraft Design and CFD 13
The only truly revolutionary new technology on its way to (military) aircraft
is a scram-jet engine: air-breading jet engine without a compressor or a tur-
bine, where shock management in supersonic flow is used to create the necessary
compression.
• Boeing and Airbus totally dominate the commercial airliner market. Num-
ber of smaller players on the edges and in business/regional jet business:
ATR, Gulfstream, Raytheon etc.
• NASA. In the latest budget statement, claims that all of its critical problems
are associated with managing fluid flow: the space bit in the middle is not
nearly that difficult.
• High-speed car aerodynamics: highly specialised, very rich, with very clear
requirements. Often bundled with aerospace: wings are turned upside-
down, creating down-force instead of lift; concerns about drag very differ-
ent than in standard car industry. However, the aerodynamics problem is
much more complex than in aircraft. Example: proximity to the ground:
important boundary layer effects; trying to organise a much more complex
flow pattern
• Aircraft design also includes other flow physics and auxiliary component
simulations
My flow classification
• Rough flows: flow regime is uncertain, the main object of design is not
flow management, but flow may still have critical effect on performance.
Example: electronics cooling, passenger compartment comfort in aircraft,
swimsuit of Olympic swimmers
Scope of Simulations
u, m/s
jet
1000 general
aircraft
aviation
model
100
airplanes
10
1 gliders
insects airships
0.1
dust
0.01
0 1 2 3 4 5 6 7 8 9 log(Re)
Process of performing a CFD simulation has evolved through the years, with
maturing numerical simulation tools and transition of the design work from the
drafting board to a Computer-Aided Desegn (CAD) system. This is still ongoing:
over the last few years, providers of CAD solutions have started talking about
Product Lifetime Management (PLM) solutions, moving the complete cycle under
a single IT-based system. Even in a relatively modern field like CFD, legacy
practices still act as a stumbling block. Example: traditionally, a meshing tool
and CFD solver are two separate software components; add to this the problem of
transferring geometrical data from a CAD package into a mesher and attempting
to run an optimisation simulation in this manner. From the moves in the market,
it is expected that software convergence may happen over the next 5-10 years (one
generation of CFD software tools. Note that the similar problem in structural
2.1 Modern Aircraft Design and CFD 17
analysis has already been overcome: compared to fluid flow, physics involved in
structural simulation is significantly simpler.
• Physics setup. Select the governing equations and specify the material
properties and boundary conditions involved. Second level of engineering
judgement: how much does the knowledge of detailed material behaviour
improve the final result. Example: specific heat capacity of water as a
function of temperature; thermal expansion coefficient of water as a function
of temperature T .
• Boundary condition setup. This includes both the location and type of
boundary conditions used. The role of boundary conditions is to include
the influence of the environment to the solution. In “big box” cases, this is
easier than is other engineering simulations
• Small experimental codes: playing around with physics and numerical meth-
ods
• Software getting increasingly complex: you need a PhD to join the game
• Aerospace atypical for the general CFD picture: early adopter with lots of
experience in-house and specific tools targeted to applications
• In-house codes extremely important and integrated into the design process.
However, currently approaching “vintage” status
• There are problems with in-house codes: development effort more complex,
people with knowledge move on, process of acceptance and validation very
long
Remaining Challenges
• Mesh generation, especially parallel mesh generation
• Handling massively parallel simulations
• Integration into the CAD-based design process
• Fluid-structure interaction and aeroacoustics
• On the cusp between two generations of general-purpose CFD solvers: pro-
cedural programming, Fortran and C against object orientation
• The push for bigger, faster, more accurate simulations in external aerody-
namics not so strong in the aerospace market: meshes are already suffi-
ciently large. Also, extensive experience of the required size of the model,
mesh resolution and locally fine meshes from the days when computer power
was expensive
• In aircraft engine design, the opposite is the case. ASC Project (Advanced
Simulation and Computing), US Dept of Energy, Los Alamos, Livermore,
Sandia, Stanford University and other partners
http://www.stanford.edu/group/cits/research/index.html
http://www.llnl.gov/PAO/news/asc/
– Tip-to-toe simulation of a turbo-fan aircraft engine, including fan,
turbo compressor, combustion chambers and turbine. Preferred mod-
elling technique: Large Eddy Simulation
– Integrated Multicode Simulation Framework
– As a part of the project, world’s biggest parallel computers have been
built:
∗ ASC Red, Sandia 1996
∗ ASC Blue Livermore, Los Alamos, 1998
∗ ASC White, Livermore, 2001
∗ ASC Q, Los Alamos, 2003
∗ ASC Red Storm, Sandia, 2004, 40-TeraOps
∗ ASC Purple, Livermore, 2005, 100-TeraOps
∗ ASC Blue Gene Livermore, Los Alamos, : 130 000 CPUs and 360
TeraFlops performance.
– For comparison, ASC Linux, 960 node-linux box with 1920 processors
and 3.8 TB produces peak performance of 9.2 TeraFlops/s
– The idea of doing a complete engine is somewhat abandoned: not
enough power for LES on compressor or turbine. Using combined
RANS/LES simulation approach with coupling on interfaces.
2.2 Scope of Computational Efforts 21
Aerodynamic Drag
• Drag varies with the velocity squared: major influence at aerospace speed.
Narrow improvements in drag lead to considerable advances:
Cd = 0.47 Cd = 0.80
Sphere Angled cube
Cd = 0.42 Cd = 0.82
Half sphere Long cylinder
Cd = 0.50 Cd = 1.15
Cone Short cylinder
Cd = 1.05 Cd = 0.04
Cube Streamlined body
• Simulations include functional subset cases, e.g. airfoils, wings, tails config-
uration, nacelle-to-wing assembly, but also full aircraft models
High-Lift Aerodynamics
• High-lift wing configuration very important: lower take-off and landing
speed, higher pay-load etc.
• Study of multi-element airfoil configuration: high flow curvature, flow sepa-
ration, wakes from upstream elements, laminar-to-turbulent boundary layer
transition etc.
• High-lift devices added to wings include flaps and slats (common), but also
leading edge extensions, vortex generators and blown flaps
Unsteady Aerodynamics
Rotary Aerodynamics
• Similar effects, but at lower speeds can be found in other devices, e.g. wind
turbines, propeller design, turbo-machinery
High-Speed Aerodynamics
• At high speed, the equation of state and ideal gas assumptions break down.
In other aspects, the flow is becoming easier to handle. Generally refers to
speed of Ma = 5 and above
• For high speed, and due to the real gas effects we speak of aerothermody-
namics rather than aerodynamics.
– Perfect gas. Flow regime still Mach number independent, but there
are problems with adiabatic wall conditions
– Two-temperature ideal gas. Rotational and vibrational motion
of the molecules needs to be separated and leads to two-temperature
models. Used in supersonic nozzle design
– Dissociated gas. Multi-molecular gases begin to dissociate at the
bow shock of the body.
– Ionised gas. The ionised electron population of the stagnated flow
becomes significant, and the electrons must be modelled separately:
electron temperature. Effect important at speeds of 10 − 12km/s
• Stability analysis takes into account the effects of uncertainly (noise) in the
input parameters. Example: how much will the lift coefficient on the airfoil
change with a 5% change in the angle of attack?
Fluid-Structure Interaction
• The first step in modelling is to choose the domain of interest. In simple
situations, this will cover only a single material or a single governing law.
Unfortunately, this is not always the case
• Example: wing flutter
– Aerodynamic forces from fluid flow determine the load on the wing.
Wing itself is an elastic structure and deforms under load
– Deflection of the elastic wing changes the flow geometry: a new solu-
tion produces different surface load
– Interaction between the two may be stable or unstable: flutter
26 Introduction: CFD in Aeronautical Applications
• Fluid-structure simulations involve both the fluid and solid domain. Care
must be given to the coupling methods and stability of the algorithm
• Lattice Gas and Lattice Boltzmann methods claim to simulate the flow
equations from basic principles of molecular dynamics instead of using the
continuum equations. Clearly, averaging over sufficient number of latice
operations will yield the original PDEs and producing the required solution.
Attractions of this method follow from simplifications of latice operations
to very primitive accuracy (e.g. 3 velocity levels) and simplifications in
complex geometry handling
• Euler Flow Solver. Neglects the viscous effects but the compressibility
physics can be handled in full.
Chapter 3
CFD Methodology
• Examples:
• Geometry and flow conditions are simplified to help with simulation set-up
• Axi-symmetric geometry with a straight intake manifold and fixed valve lift
36 CFD in Automotive Applications
Physical Modelling
• New physical models quickly find their use, e.g. free surface flows
Lessons Learned
• Numerical simulation tools will be adopted only when they fit the product
development process: robust, accurate and validated solver, rapid turn-over
• True impact of simulation tools is beyond the obvious uses: industry will
drive the research effort to answer its needs
Part II
Mesh Handling
4.1 Introduction
When presenting a continuum mechanics problem for computer simulation, one
needs to establish not only the mathematical model but also the computational
domain. While the choice of physics is relatively general, numerical description
of the domain of interest is considerably more complex. Looking at the area of
external aerodynamics in aerospace, compressible Navier-Stokes equations for an
ideal gas with typically suffice, while the wealth of geometrical shapes defies even
basic classification.
In most cases, shape of the spatial domain is of primary interest: capturing it
in all relevant detail is essential. In transient simulations, handling the temporal
axis is considerably simpler. Due to uni-directional nature of interaction, it is
sufficient to split the time interval into a finite number of time-steps and march
the solution forward in time.
It quickly becomes clear that fidelity of geometrical description of an engi-
neering object plays an important role. For example, in a heat exchanger, it is
necessary to capture active surface area with some precision in order to correctly
calculate the total heat transfer. At the same time, it is a question of engineering
judgement to decide which geometrical features are important for the result and
which may be omitted.
A computational mesh splits the space into a finite number of elements (cells,
control volumes or similar), bounded by faces and supported by points. Compu-
tational locations are located in the cells or on the points in a regular manner.
The idea of mesh support is to discretise the governing equations over each cell
and handle cell-to-cell interaction. Some mesh validity criteria follow directly
from the above:
Every discretisation method bring its own mesh validity criteria and measures
of mesh quality. In general terms, a mesh that visually pleasing is also likely to
support a quality solution. Our second concern is the interaction between the
mesh resolution and (known or implied) solution characteristics. Features such
as shocks, boundary layers and mixing planes require higher resolution that a
“far field” section of the domain. Construction of a quality mesh is usually a
question of experience and use of quality mesh generation tools. An ideal mesh
would be the one uniformly distributing the discretisation error in the solution
volume and producing “user-independent” (or, more precisely, user-experience-
independent) result. The quest for fast and robust automatic mesh generators
iteratively sensitised to the solution is still ongoing.
• Mesh-less methods are possible (though not popular): the issue of describ-
ing the domain of interest to the computer still remains
– Small mesh for model experimentation and quick games: 100 to 50k
cells. Fast turn-around and qualitative results. Note that a number of
flow organisation problems may be solved on this mesh resolution
– 2-D geometry: 10k to 1m cells. Low-Re turbulent simulations may
require more, due to near-wall mesh resolution requirements
– 3-D geometry: 50k to several million cells
– Complex geometry, 3D, industrial size, 100k to 10-50 million cells.
Varies considerably depending on geometry and physics, steady/transient
flow etc.
– Large Eddy Simulation (LES) 3-D, transient, 1-10 million cells. LES
requires very long transient runs and averaging (20-50k time steps),
which keeps the mesh resolution down
4.2 Complex Geometry Requirements 43
– Full car aerodynamics, Formula 1: 20-200 million cells for routine use.
Large simulations under discussion: 1 billion cells!
• On very large meshes, problem swith the current generation of CFD soft-
ware becomes a limiting factor: missing parallel mesh generation, data file
read/write, post-processing of results, hardware and software prices
• In cases where the surface description is not discrete, a surface mesh may
be created first
• The main role of the volume mesh is to capture the 3-D geometry
• The cells should not overlap and should completely fill the computational
domain. Additionally, some convexness criteria (FVM) or a library of pre-
defined cell shapes (FEM) is included.
• Quality of the mesh critical for a good solution and is not measured only
in mesh resolution
• Supported mesh structure may severely limit the use of a chosen discreti-
sation method
Cartesian Mesh
• Simple to define, efficient and can be used with any type of discretisation
• Severe limitation on the geometry that can be handled: a box within a box
• The use of contravariant coordinates for the solution vectors was quickly
abandoned
Multi-Block Mesh
• In FVM, special coding is done on block interfaces, where the mesh con-
nectivity cannot be implicitly established
• Much more control over mesh grading and local resolution. However, mesh
generation in 3-D for relatively complex shapes is still hard and time-
consuming: meshes need to match
4.3 Mesh Structure and Organisation 47
• From the numerical simulation point of view, this is a major step forward.
Geometries of industrial interest can now be tackled with a detailed de-
scription, which satisfies the design engineer
• Tetrahedral mesh are not good from the numerics point of view
• In a solver can support tetrahedral meshes, mesh generation time for com-
plex geometry reduces from weeks to hours.
The rest of the domain is filled with tetrahedra. A combined tet-hex mesh
is a great improvement in quality
• On the negative side, cell count for a tetrahedral mesh of equivalent res-
olution is higher than for hexahedra. A part of the price is paid in lower
accuracy of the solver on tetrahedra: limited neighbourhood connectivity.
• Used for cases where a simple solver is used for complex cases or parts of
geometry move relative to each other
• H-mesh
4.4 Manual Meshing: Airfoils 51
e
e40
e
e27
e
e35
e
e25 e
e40 e
e34
e
e37
e
e19 e
e35
ee6
e
e12
e11 e
e69 e19
e10
e e
e4 e
e66 e4
eee11
e10
ee12
e
e16 e e30
e
e
e37
e
e6 e
e39
e
e39 e
e69 e
e41
e
e41 e
e16
e
e68 e
e66
e
e20 e
e30
e
e38 e
e20
e42e17
e e
e42
e5
e e
ee8
e9
ee7 e
e38 e
e17
ee3
e e
e68 e
e31
e
e31
e
e15 e5
eee8
e9 e e15
ee7
ee3e e
e26
e
e33
e
e1
e
e1
e
e32
e
e32
e
e25
e
e29
e
e28
e
e29
e
e77
e
e76
e
e13
e
e27 e
e26
e
e34
e
e77
e
e13
e
e76
e
e33
e
e22
e
e28
• Tessalated mesh
Pi
V1
P1
Voronoi vertex
Y
4.5 Adaptive Mesh Refinement 53
Examples
Mesh Resolution
• Mesh structure specifies where the computational points are located. Dis-
cretisation practice postulates the shape of solution between the computa-
tional points, which is the main source of discretisation error
• r-refinement: re-organise the existing points such that more points fall into
the region of interest
4.5 Adaptive Mesh Refinement 55
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCC
CCCCCCCCCCCC BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCC
CCCCCCCCCCCC BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC BBBBBBBBBBB
BBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
BBBBB
CCCCCCCCCCCCCCC BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
BBBBB
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCC BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
BBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC BBBBBBBBBBB
BBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
BBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCCCCC BBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC BBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
Error- or Indicator-Driven Adaptivity
• There exist cases where the shape of the domain varies during the calcula-
tion. Boundary motion may be prescribed in advance as a part of the case
setup or be a part of the solution itself
• Shape changes are performed by point motion: the connectivity and struc-
ture of the mesh remains unchanged
– Attach/detach boundary
– Cell layer addition/removal
– Sliding interface
4.6 Dynamic Mesh Handling 59
5.1 Introduction
The importance of a scalar transport equation in the standard form lies in the fact
that it contains typical forms of rate-of change, transport and volume source/sink
terms present in continuum governing laws. These include convective trans-
port, based on the convective velocity field, gradient-driven diffusive trans-
port, rate-of-change terms and localised volume sources and sinks. Understand-
ing the behaviour of various terms and their interaction will help the reader
comprehend even the most complex physical models.
Governing equations of physical interest regularly take the form of the scalar
transport equation. The derivation and modelling rationale is straightforward:
the rate of change and convection terms follow directly from The Reynolds Trans-
port Theorem, while the diffusive transport is the simplest gradient-based model
of surface sources and sinks. A good example of generalisation of the scalar
transport equation is the density-based compressible flow solver, often written as
a “scalar” transport of a composite variable [ρ, ρu, ρE].
In what follows, we will offer a brief overview of the background and derivation
of the scalar transport equation, its initial and boundary conditions and various
often-encountered generalisations.
• Scalar transport equation in the standard form will be our model for dis-
cretisation. Conservation laws, governing the continuum mechanics adhere
62 Transport Equation in the Standard Form
• Standard form is not the only one available: modelled equations may be
more complex or some source/sink terms can be recognised as transport.
This leads to other forms, but the basics are still the same
• Moving away from physics, almost identical equations can be found in other
areas: for example financial modelling
• The common factor for all equations under consideration is the same set
of operators: temporal derivative, gradient, divergence, Laplacian, curl, as
well as various source and sink terms
Nomenclature
– Scalars in lowercase: a
– Vectors in bold: a = ai
– Tensors in bold capitals: A = Aij
• All vectors will be written in the global Cartesian coordinate system and
in 3-D space
• Inner and outer product of vectors and tensors. Vector notation will be
used – feel free to shadow in the Einstein notation in the notes and I will
help
– Scalar product: ab = a bi
– Inner vector product, producing a scalar: a•b = ai bi
– Outer vector product, producing a second rank tensor: ab = ai bj
– Inner product of a vector and a tensor (mind the index)
∗ product from the left: a•C = ai Cij
∗ product from the right: C•a = aj Cij
• Field algebra
– From the field definition φ = φ(x, t), which means that we can define
the spatial and temporal derivative
• Divergence and gradient
– For convenience, we need to define the gradient operator ∇• to extract
the spatial component of the derivative as a vector. Formally this
would be ∂φ
∂x
∂ ∂ ∂ ∂
∇= = i+ j+ k (5.1)
∂x ∂x ∂y ∂z
Thus, for a scalar φ, ∇φ is a vector
∂φ
∇φ = (5.2)
∂x
• If we imagine φ defined in a 2-D space as a 2-D surface, for each point the
gradient vector points in the direction of the steepest ascent, i.e. up the
slope
• For vector and tensor fields, we define the inner and outer product with the
gradient operator. Please pay attention to the definition of the gradient:
multiplication from the left!
• Gradient operator for a vector u creates a second rank tensor
∂ ∂uj
∇u = uj = (5.3)
∂xi ∂xi
• Divergence operator for a vector u creates a scalar
∂ui
∇•u = (5.4)
∂xi
dS
00
11
n
inflow 11
00
00
11 outflow
00
11
Mathematically:
Z Z I
d ∂φ
φ dV = dV + φ(n•u)dS (5.5)
dt Vm Vm ∂t Sm
Z Z · ¸
d ∂φ
φ dV = + ∇•(φu) dV (5.6)
dt V V ∂t
• Apart from convection (above), we can have local sources and sinks of φ.
qs
dS
00
11
n
inflow 11
00
00
11 outflow
00
11
Qv
Z Z I
d
φ dV = qv dV − (n•qs )dS (5.7)
dt V V S
∂φ
+ ∇•(φu) = qv − ∇•qs (5.8)
∂t
Diffusive Transport
• Taking into account that ∇φ point up the concentration slope, and the
transport will be in the opposite direction, we can define the following
diffusion model
qs = −γ ∇φ, (5.9)
• Assembling the above yields the transport equation in the standard form
∂φ
+ ∇•(φu) − ∇•(γ∇φ) = qv (5.10)
∂t
|{z} | {z } | {z } |{z}
convection term diffusion term source term
temporal derivative
• Sources and sinks account for non-transport effects: local volume produc-
tion and destruction of φ
Conservation Equations
∂ρ
+ ∇•(ρu) = 0 (5.11)
∂t
∂(ρu)
+ ∇•(ρuu) = ρg + ∇•σ (5.12)
∂t
∂(ρe)
+ ∇•(ρeu) = ρg.u + ∇•(σ.u) − ∇•q + ρQ (5.13)
∂t
5.3 Initial and Boundary Conditions 67
Boundary Conditions
• The role of boundary conditions is to isolate the system from the rest of
the Universe. Without them, we would have to model everything
Symmetry plane
Wall
Wall
0.
5D Wall
H
5D
0.
Developed inlet profile Outlet
X
H
– Heated wall: fixed value velocity, zero gradient pressure, fixed gradient
temperature (fixed heat flux)
Initial Condition
• Initial field should in principle satisfy the governing equation and physical
bounds. Importance of this will depend on the robustness of the algo-
rithm. Example: initialise the flow simulations using the potential flow
solver to satisfy continuity. In practice, robust solvers only care about
physical bounds
• When transport equations are assembled, they represent real physical prop-
erties. A set of equations under consideration relies on the fact that physical
5.4 Physical Bounds in Solution Variables 71
variables obey certain bounds: if the bounds are violated, the system ex-
hibits unrealistic behaviour
• Examples of variables with physical bounds
– Negative density value: −3 kg/m3
– Negative absolute temperature
– Negative kinetic energy (to turbulent kinetic energy
– Concentration value below zero or above one: Two phase flow, using
a scalar concentration φ to indicate the presence of fluid A
qs = −γ ∇φ,
Examples
• Convection-dominated problems
• Diffusion problems
• A transport equation for a vector and tensor quantity very similar to the
scalar form: φ becomes d. However, having d as a transported variable
allows the introduction of some interesting new terms
• For now, we can consider the question of coupling: are the components of
the transported vector coupled or decoupled?
5.5 Complex Equations: Introducing Non-Linearity 73
∂(ρ b)
+ ∇•(ρu b) = −ρSt |∇b| (5.14)
∂t
Non-Linear Transport
• As mentioned before, for bounded scalar variables, source and sink terms
need to tend to zero as φ approaches its bounds. Therefore, cases where qv
is a function of φ are a rule rather than exception
qv = qu − qp φ, (5.15)
and
– ǫ-equation:
∂ǫ ǫ ǫ2
+ ∇•(u ǫ) − ∇•(µt ∇ǫ) = C1 G − C2 , (5.19)
∂t k k
• The coupling looks very complex but is benign: the most critical part is
the treatment of sink terms to preserve the boundedness during an iterative
solution sequence. Example: sink term in the k-equation
ǫold
ǫ= knew (5.20)
kold
6.1 Introduction
In this chapter we will lay out the HJ HERE!!!
• The Calculus form can be easily obtained from the Method (by evaluating
the expression), but this is not computationally efficient
2. Stability: a solution method is stable if it does not magnify the errors that
appear during the numerical solution process
Discretisation Methodology
2. Describe space and time: a computational mesh for the spatial domain
and time-steps covering the time interval
5. Use the spatial and temporal variation to interpret the operator in discrete
terms
6.3 Discretisation of the Scalar Transport Equation 79
• For some purposes, e.g. face flux, different data is required – in this case it
will be a field over all faces in the mesh
rP
z
y VP
• For the cell, there is one neighbouring cell across each face. Neighbour cell
and cell centre will be marked with N.
df = P N (6.2)
80 Polyhedral Finite Volume Method
• The face centre f is defined in the equivalent manner, using the centroid
rule:
Z
(x − xf ) dS = 0. (6.3)
Sf
• The fact that the face centroid does not necessarily lay on the plane of
the face is not worrying: we are dealing with surface-integrated quantities.
However, we shall require the cell centroid to lay within the cell
• When operating on a single cell, assume that all face area vectors sf point
outwards of cell P
where φt = φ(t)
6.3 Discretisation of the Scalar Transport Equation 81
• In contrast, FEM specifies various forms for shape function for various
shapes and provides options for higher order elements. Example: 27-node
brick. However, I am not aware of the possible FEM formulation which s
shape independent
• Each term contains volume or surface integral. Evaluate the integrals, using
the prescribed variation in space
• Volume integral
Z Z
φ dV = [φP + (x − xP )•(∇φ)P ] dV
V Z V Z
= φP dV + (∇φ)P • (x − xP )dV = φP VP
V V
• Surface integral splits into a sum over faces and evaluates in the same
manner
I XZ XZ
n φ dS = nφf dSf = n[φf + (x − xf )•(∇φ)f ]
S f Sf f Sf
X
= sf φf
f
• The above integrals show how the assumption of linear variation of φ and
the selection of P in the centroid eliminate the second part of the integral
and create second-order discretisation
82 Polyhedral Finite Volume Method
W P E
• Looping structure
– Option 1: For all cells, visit East, West, North, South and sum up the
values. Not too good: each face value calculated twice. Also, poor
optimisation for vector computers we want to do a relatively short
operation for lots and lots of cells
– Option 2:
∗ For all cells, do East face and add to P and E
∗ For all cells, do North face and add to P and N
Better, but stumbles on the boundary. Nasty tricks, like “zero-volume
boundary cells” on the W and S side of the domain.
– OK, I can do a box. How about implementing a boundary condition:
on E, W , N and S. Ugly!
• Block-structured mesh. Same kind of looping as above
6.4 Face Addressing 83
• Repeated code is very bad for your health: needs to be changed consistently,
much more scope for errors, boring and difficult to keep running properly.
3
2
4
sτ1
• Mixed cell types. When mixed types are present, we will re-use the un-
structured mesh idea, but with holes: a tetrahedron only has 4 neighbours
and a brick has got six
– Option 1: For all cells, visit all neighbours. Woops: short loop inside
a long loop AND all face values calculated twice
– Option 2:
∗ For all neighbours, up to max number of neighbours
∗ For all cells
∗ . . . do the work if there is a neighbour
Works, but not too happy: I have to check if the neighbour is present
84 Polyhedral Finite Volume Method
Face Addressing
• Thinking about the above, all I want to do is to visit all cell faces and then
all boundary faces. For internal face, do the operation and put the result
into two cells around the face
• Orient face from P to N: add to P and subtract from N (because the face
area vector points the wrong way)
• Addressing slightly different: for each internal face, record the left and right
(owner and neighbour) cell index. Owner will be the first one in the cell
list
• Much cleaner, compact addressing, fast and efficient (some cache hit issues
are hidden but we can work on that)
• Most importantly, it no longer matters how many faces there is in the cell:
nothing special is required for polyhedral cells
Gauss’ theorem
• Gauss’ theorem is a tool we will use for handing the volume integrals of
divergence and gradient operators
• Divergence form
Z I
∇•a dV = ds•a (6.8)
VP ∂VP
• Gradient form
Z I
∇φ dV = ds φ (6.9)
VP ∂VP
• Note how the face area vector operates from the same side as the gradient
operator: fits with our definition of te gradient of for a vector field
• In the rest of the analysis, we shall look at the problem face by face. A
diagram of a face is given below for 2-D. Working with vectors will ensure
no changes are required when we need to switch from 2-D to 3-D.
• A non-orthogonal case will be considered: vectors d and s are not parallel
f
d
P N
6.5 Operator Discretisation 85
∂φ φn − φo
=
∂t ∆t
3 n
∂φ φ − φo + 21 φoo
= 2
∂t ∆t
VP
– Diagonal value: aP = ∆t
VP ,φo
– Source contribution: rP = ∆t
86 Polyhedral Finite Volume Method
• Exercise: what needs to be done if the time step is not constant between
the two old time levels?
φf = fx φP + (1 − fx )φN (6.17)
φf
+
φf
− φC
φU
− +
U f C f D
Matrix Coefficients
– Diagonal value: aP = 12 F
– Off-diagonal value: aN = 21 F
– Source contribution: in our case, nothing. However, some other schemes
may have additional (gradient-based) correction terms
– Note that, in general the P -to-N coefficient will be different from the
N-to-P coefficient: the matrix is asymmetric
Diffusion Operator
Matrix Coefficients
Non-Orthogonal Correction
• We wish to keep the part with coefficient creation as above even for non-
orthogonal meshes . . . but this would not be correct
– Decompose the s vector into a component parallel with d and the rest.
– For the parallel component, same as above
– Correction = k•(∇φ)f . The missing gradient will be calculated at cell
centres and interpolated, just as γf above
s k
f
d ∆
P N
• In general, qv may be a function of space and time, the solution itself, other
variables and can be quite complex. In complex physics cases, the source
term can carry the main interaction in the system. Example: complex
chemistry mechanisms. We shall for the moment consider only a simple
case.
6.6 Numerical Boundary Conditions 91
qv (φ) = qu + qd φ (6.30)
∂qv (φ)
where qd = ∂φ
and for cases where qd < 0 (sink), treated separately
Matrix Coefficients
• Boundary conditions will contribute the the discretisation through the pre-
scribed boundary behaviour
• . . . but we will study them term by term to make the problem simpler
φb − φP
n•(∇φ)b = (6.31)
|db |
• Convection term: evaluate the boundary value of φ from the internal value
and the known gradient
Use the evaluated boundary value as the face value. This creates a source
and a diagonal contribution
Mixed Condition
Symmetry Plane
• Above boundary conditions were the same for scalars. vectors and tensors.
On a symmetry plane, there will be a different condition on scalar (zero
gradient), vector (zero normal component and zero-gradient condition on
the tangential component
• For vectors, draw a “ghost cell” on the opposite side of the boundary with
the value the same as in P but with mirror transformation and do the
discretisation as usual
• Note: symmetry plane boundary condition for a vector couples the compo-
nents
y x
N
P
y
x N’
Explicit Schemes
• The algorithm uses the calculus approach, sometimes said to operate on
residuals
• In other words, the expressions are evaluated using the currently available
φ and the new φ is obtained from the time term
• Courant number limit is the major limitation of explicit methods: infor-
mation can only propagate at the order of cell size; otherwise the algorithm
is unstable
• Quick and efficient, no additional storage
• Very bad for elliptic behaviour
94 Polyhedral Finite Volume Method
Implicit Schemes
• A new solution takes into account the new values in the complete domain:
ideal for elliptic problems
• Exercise: how does all this relate to the discretisation of the Euler equation
described in the previous lectures?
6.10 Examples
• Forms of convection discretisation and kinds of error they introduce
where [A] contain matrix coefficients, [φ] is the value of φP in all cells and
[r] is the right-hand-side
• . . . but very few coefficients are non-zero. The matrix connectivity is always
local, potentially leading to storage savings if a good format can be found
• Dense matrix format. All matrix coefficients have are stored, typically
in a two-dimensional array
7.2 Matrix Storage Formats 97
}
}
– A cell value depends on other cell values only if the two cells share
a face. Therefore, a correspondence exists between the off-diagonal
matrix coefficients and the mesh structure
– In practice, the matrix is assembled by looping through the mesh
7.3 Linear Solver Technology 99
Solution Approach
• Direct solver. The solver algorithm will perform a given number of oper-
ations, after which a solution will be obtained
• Iterative solver. The algorithm will start from an initial solution and
perform a number of operations which will result in an improved solution.
Iterative solvers may be variants of the direct solution algorithm with spe-
cial characteristics
• Explicit method. New solution depends on currently available values of
the variables. The matrix itself is not required or assembled; in reality, the
algorithm reduces to point-Jacobi or Gauss-Seidel sweeps
• Fortunately, the FVM matrices are ideally suited (read: carefully con-
structed) for use with iterative solvers
• With this in mind, we can choose to use partial convergence, update the
non-linearity and solve again: capability of obtaining an intermediate solu-
tion at a fraction of the cost becomes beneficial
• The most important property from the numerical point of view is that the
number of operations required for the solution is known and intermediate
solutions are of no interest
• Matrix fill-in. When operating on a large sparse matrix like the one from
discretisation methods, the direct solver will create entries for coefficients
that were not previously present. As a consequence, formal matrix storage
requirement for a direct solver is a full matrix for a complete system: huge!
This is something that needs to be handled in a special way
7.3 Linear Solver Technology 101
• Advantage of direct solvers is that they can handle any sort of well-posed
linear system
• In reality, we additionally have to worry about pollution by the round-off
error. This is partially taken into account through the details of the solution
algorithm, but for really bad matrices this cannot be helped
Gaussian Elimination
• Gaussian elimination is the easiest direct solver: standard mathematics.
Elimination is performed by combining row coefficients until a matrix be-
comes triangular. The elimination step is followed by backwards substitu-
tion to obtain the solution.
• The number of operations in direct solvers scales with the number of equa-
tions cubed: very expensive!
Multi-Frontal Solver
• When handling very sparse systems, the fill-in is very problematic: leads
to a large increase in storage size and accounts for the bulk of operations
• The window approach may reduce the cost of direct solvers by several or-
ders of magnitude: acceptable for medium-sized systems. The number of
operations scales roughly with N M 2 , where N is the number of equations
and M is the maximum size of the solution window
• The first step in the implementation is control of the window size: the
window changes its width dynamically and in the worst case may be the
size of the complete matrix
• Maximum size of the window depends on the matrix connectivity and or-
dering of equation. Special optimisation software is used to control the
window size: matrix renumbering and ordering heuristics
Matrix Properties
Residual
This is how direct solvers operate: number of operations required for the
inversion of [A] is fixed and until the inverse is constructed we cannot get
[φ]
Residual is a vector showing how far is the current estimate [φ]k from the
exact solution [φ]. Note that for [φ], [e] will be zero
• [e] defines a value for every equation (row) in [A]: we need a better way
to measure it. A residual norm ||r|| can be assembled in many ways, but
usually
N
X
||r|| = |rj | (7.12)
j=1
In CFD software, the residual norm is normalised further for easier com-
parison between the equations etc.
• Point-Jacobi solution
• Gauss-Seidel solver
• If the mesh is coarser, the error is both eliminated faster and in fewer
iterations.
• In terms of matrices and linear solvers, the same principle should apply:
our matrices come from discretisation! However, it would be impractical to
build a series of coarse meshes just to solve a system of linear equations
• At the same time, we can readily recognise that all the information about
the coarse mesh (and therefore the coarse matrix) already exists in the fine
mesh!
• Other cycles, e.g. W-cycle or F-cycle are a variation on the V-cycle theme
• We can make the simulation run faster either by devising a better solution
algorithm (hard!) or by performing operations and handling data faster
• The subject here is rarely the solution algorithm itself: the design of solvers
is typically left to mathematicians. Instead, we are looking for operations
that can be efficiently executed on computers
108 Algebraic Linear System and Linear Solver Technology
Vector Operations
• We can simplify numerous solver operations into vector-matrix multiply
c = a*x + b
Parallelisation
• The idea of parallelisation is to split the large loop of
between a number of CPUs, with each CPU responsible for its own part
• Iterative solvers parallelise well: operations have weak data dependency and
few synchronisation points. It is relatively easy to establish the necessary
communication pattern for data dependency between CPUs
• The nature of coupling is not usually examined in general terms: all our
equations look very similar
• Additionally, the nature and strength of coupling depends not only on the
equation but also on the state of the system and material properties. Exam-
ple: change of viscosity in the fluid flow equations. Typically, such changes
are described in terms of dimensionless groups, e.g. Reynolds number Re
• Inappropriate scale is usually chosen for efficiency: the actual scale of the
physical phenomenon may be very fast and lead to extremely long simula-
tion times
• Darcy’s law, combined with the mass conservation equation for the incom-
pressible liquid creates the Laplace equation which controls the system
∇•(γ∇p) = 0 (8.2)
Velocity field is obtained from the pressure distribution in a post-processing
step.
• Cases where γ is a scalar field represent uniform flow resistance in all di-
rections: isotropic porous medium
• For directed Darcy’s law, the flow resistance may be depend on spatial
direction, e.g. “flow straighteners”. This produces an orthotropic resistance
tensor:
u = −γ∇p (8.3)
where
γxx 0 0
γ = 0 γyy 0 (8.4)
0 0 γzz
• Momentum equation:
∂u
+ ∇•(uu) − ∇• (ν∇u) = −∇p (8.8)
∂t
• Continuity equation:
∇•u = 0 (8.9)
• Continuity equation:
∂ρ
+ ∇•(ρu) = 0 (8.10)
∂t
• Momentum equation:
µ ¶
∂(ρu) £ ¡ T
¢¤ 2
+∇•(ρuu)−∇• µ ∇u + (∇u) = ρg −∇ P + µ∇•u (8.11)
∂t 3
• Energy equation:
µ ¶
∂(ρe) 2
+ ∇•(ρeu) − ∇•(λ∇T ) = ρg•u − ∇•(P u) − ∇• µ(∇•u) u
∂t 3 (8.12)
£ ¡ T
¢ ¤
+∇• µ ∇u + (∇u) •u + ρQ,
• Equation of state
ρ = ρ(P, T ) (8.13)
λ = λ(P, T ), (8.14)
µ = µ(P, T ). (8.15)
k − ǫ Turbulence Model
• k-equation:
∂k
+ ∇•(u k) − ∇•(µt ∇k) = G − ǫ, (8.16)
∂t
with
k2
µ t = Cµ (8.17)
ǫ
G = µt [∇u + (∇u)T ] : ∇u (8.18)
• ǫ-equation:
∂ǫ ǫ ǫ2
+ ∇•(u ǫ) − ∇•(µt ∇ǫ) = C1 G − C2 , (8.19)
∂t k k
Chemical Reactions
3 C1 → C2 + 2 C3 + 9 H (8.20)
C2 → AH + 2 H (8.21)
15 C3 → 2 C12 A7 + C2 + 21CH + 66H (8.22)
∂C1 2 44 4
+ ∇•(ρC1 u) − ∇•(γc ∇C1 ) = −3C1 S1 + C2 S2 + C3 S3 + C2 S2
∂t 3 15 45
(8.23)
∂C2
+ ∇•(ρC2 u) − ∇•(γc ∇C2 ) = −2C2 S2 (8.24)
∂t
∂C3 22 2
+ ∇•(ρC3 u) − ∇•(γc ∇C3 ) = − C3 S3 + C2 S2 (8.25)
∂t 5 15
• The option of solving all equations together always exists, but it is very
expensive and in most cases unnecessary
• The objective is to treat “important” and “nice” terms implicitly and han-
dle the coupling algorithmically whenever possible
Under-Relaxation
• Types of under-relaxation
• For cases of strong coupling between the components of a vector, the com-
ponents can be solved as a block variable: (ux , uy , uz ) will appear as
variables in the same linear system
• In spite of the fact that the system is much larger, the coupling pattern still
exists: components of u in cell P may be coupled to other components in
the same point or to vector components in the neighbouring cell
• With this in mind, we can still keep the sparse addressing defined by the
mesh: if a variable is a vector, a tensorial diagonal coefficients couples the
vector components in the same cell. A tensorial off-diagonal coefficient
couples the components of uP to all components of uN , which covers all
possibilities
8.4 Matrix Structure for Coupled Algorithms 117
Nature of Coupling
• Block matrix represents complete coupling for a block variable
W P E
• We still have freedom to organise the matrix by ordering entries for various
components of φ. Also, the matrix connectivity pattern may be changed
by reordering the computational points
118 Solution Methods for Coupled Equation Sets
Coupling Coefficient
• Consider a linear dependence between two vectors m and n. We can write
a general form as
m = Ab (8.30)
We shall evaluate the shape of A for various levels of coupling. We shall
think of A as a matrix coefficient in the block matrix. The diagonal matrix
entry is termed AP and the off-diagonal as AN . Matrix connectivity is
dictated by the mesh structure
• Component-wise coupling describes the case where mx depends only on nx ,
my on ny and mz on nz
1. Scalar component-wise coupling
2. Vector component-wise coupling
3. Full (block) coupling
• Explicit methods do not feature here because it is not necessary to express
them in terms of matrix coefficients
• For reference, the linear equation for each cells featuring in the matrix reads
X
AP mP + AN mN = R (8.31)
N
8.4 Matrix Structure for Coupled Algorithms 119
Scalar-Implicit Coupling
• In most terms
or
A = aI (8.34)
• In this case, the “block system” represents 3 equations written together but
not interacting: the block notation for the system is misleading for the level
of coupling present in discretisation
• Thus:
• Such cases are relatively rare and typically appear from tensorial diffusion
problems and in some cases of rotational coupling
Composite Variables
• In some equations, the system will be coupled not only across the compo-
nents of vectors and tensors, but also across different variables. In such
cases, we may write a composite variable formulation, where all equations
are grouped together into a single equation
• Note that U above holds 5 scalar values: 1 for the density, 3 momentum
components (ρux , ρuy , ρuz ) and one for energy
• This tactics makes sense only if the variables are strongly coupled to each
other. Thus, full block coupling typically appears for such systems
Non-Linear Coupling
• Additional complications will arise for cases where the matrix coefficients
are also a function of the solution: non-linearity
• Example: convection term in the momentum equation ∇•(u u). Here, com-
ponents of AP and AN depend on the solution itself, thus creating a non-
linear system
∂u
+ ∇•(uu) − ∇• (ν∇u) = −∇p (8.43)
∂t
– Continuity equation:
∇•u = 0 (8.44)
Note the absence of entries for p in the diagonal matrix! Off diagonal
blocks actually represent the discretised form of the gradient and divergence
operator, multiplied by p and u, respectively. The diagonal block [Au ]
contains the discretised form of the momentum equation, excluding the
pressure gradient term
• While there exists a large set of zero diagonal entries, this matrix can be
solved. However, naive solution method would require a direct linear equa-
tion solver, making it extremely expensive. We shall look for cheaper and
faster solution methods
• The nature of equation dictates that every point in the domain influences
every other point: elliptic nature of the equation. This can be seen in the
operation of iterative solvers – large number of sweeps due to the fact that
the information is global
• The significant new term in the system is ∇•[µ(∇d)T ]. It can be shown that
it represents rotation, coupling the components of d to each other
• In solid body rotation, the components of the vector change together: strong
inter-dependency of vector components
Incompressible Navier-Stokes
• Simple solution methods will not work due to a zero diagonal block in
pressure equations: need specialised pressure-velocity coupling algorithms
124 Solution Methods for Coupled Equation Sets
Compressible Navier-Stokes
• Complex coupling:
• Close coupling between the equations recognised in the block form. Rewrit-
ing the same equations to emphasise strong coupling:
∂U
+ ∇•F − ∇•V = 0 (8.46)
∂t
where the solution variable U is:
ρ
U = ρu (8.47)
ρe
• The above emphasises the fact that the face flux of the system (mass, mo-
mentum, energy) needs to be evaluated together: it depends on (ρ, u, e)lef t
and (ρ, u, e)right
• At the same time, the coupled system hides the issues with the coupling
at low speed. For example, a pressure difference of 3 − 5 Pa can drive a
significant amount of flow. The associated density difference (air at atmo-
spheric conditions) is of the order of 5 × 10−5 kg/m3 at mean density of
1.176829 kg/m3 , which causes numerical problems
k − ǫ Turbulence Model
• Both equations source-dominated, with relatively short time-scales: turbu-
lence transported from elsewhere quickly dissipates
• Left on its own (no mean shear), the system quickly tends to the “no
turbulence” solution: k = 0, ǫ = 0
• In most turbulence models, local balance of turbulence production and
destruction dominates over the transport: equations are said to be source-
dominated. This makes them easy to solve: local effect
• Equation coupling is highly non-linear. Generation term
k2
G = Cµ [∇u + (∇u)T ] : ∇u (8.50)
ǫ
ǫ-equation sources and sinks:
ǫ ǫ2
Sǫ = C1 G − C2 , (8.51)
k k
Note various k 2 and ǫ2 terms in the equations!
• Non-linearity if further (massively) complicated bu the introduction of the
momentum equation, influenced through effective viscosity µef f = µ + µt
and
k2
µ t = Cµ (8.52)
ǫ
• In segregated solution methods, two equations are solved consecutively
without major coupling problems. In reality, either k or ǫ will over-shoot
and stabilise the system
• In external aerodynamics (aerospace) flows with coupled solvers and large
time-steps, it sometimes pays to solve the equations in a coupled manner.
However, the nature of equations indicates the largest benefit from local
source coupling, followed by a transport step: see Multi-Step Approach
below
Chemical Reactions
• Coupling dependent on the reaction rate. For systems with fast reactions,
interaction between local quantities may totally dominate
• Stiffness and behaviour of the system critically depends on the choice of
reactions, species (or pseudo-species) and the time-step
• In most cases, the system is source-dominated, but inter-equation coupling
issues may be extremely severe. Depending on the problem, use of non-
linear stiff system solvers may be required
126 Solution Methods for Coupled Equation Sets
Multi-Step Approach
• At the same time, the transport part of the system is easy to solve. However,
a combination of non-linear source coupling and transport would result in
a very large and strongly non-linear system
Pressure-Velocity Coupling
In this chapter, we will revisit the governing equations of fluid flow and various
levels of simplification in engineering practice. Some simplifications are voluntary
(e.g. steady-state) and some follow from the physical behaviour or flow charac-
teristics (e.g. incompressible flow, turbulence).
All simplified forms and levels of approximation shown below are used in fluid
flow simulations. Simpler forms are not only quick and easy to compute, but can
be used as an initial guess for more complete level of approximation.
• Continuity equation:
∂ρ
+ ∇•(ρu) = 0 (9.1)
∂t
– Rate of change and convection: mass transport. The two terms are
sometimes grouped into a substantial derivative
– Mass sources and sinks would appear on the r.h.s.
– Note the absence of a diffusion term: mass does not diffuse
– Coupling with the momentum equation: rate of change of ρ depends
on the divergence of ρu
• Momentum equation:
µ ¶
∂(ρu) £ ¡ T
¢¤ 2
+ ∇•(ρuu) − ∇• µ ∇u + (∇u) = ρg − ∇ P + µ∇•u (9.2)
∂t 3
130 Governing Equations of Fluid Flow
– Substantial derivative
– Non-linear convection term: ∇•(ρuu). This terms provides the wealth
of interaction in fluid flows
– Diffusion term contains viscous effects
• Energy equation:
µ ¶
∂(ρe) 2
+ ∇•(ρeu) − ∇•(λ∇T ) = ρg•u − ∇•(P u) − ∇• µ(∇•u) u
∂t 3 (9.3)
£ ¡ T
¢ ¤
+∇• µ ∇u + (∇u) •u + ρQ,
• Equation of state
: ρ = ρ(P, T ) (9.4)
λ = λ(P, T ), (9.5)
µ = µ(P, T ). (9.6)
– Properties of real gasses and liquids rarely used in tabular form. In-
stead, measured data is curve fitted be standard sources: JANAF,
NIST, etc.
– Variation of material properties is usually a smooth function and does
not introduce significant non-linear problems. Issues sometimes occur
when the state changes significantly in a single time-step. Here, the
initial guess for the new state may be far away from the solution,
causing excessive number of search iterations
• Velocities to compare are the convective velocity and the speed with which
a weak pressure wave travels through the medium
• When the convective speed reaches and exceeds the speed of sound, the
mode of propagation of information changes significantly: shocks
Transonic Flow
• Inlet/outlet conditions typically subsonic, but with pockets of supersonic
flow
• Because of the mix of elliptic and hyperbolic nature, transonic cases are
usually the most difficult to compute
132 Governing Equations of Fluid Flow
Supersonic Flow
Hypersonic Flow
• On very high speed, simple formulation of the equation of state breaks down
and more complex laws are needed
– Perfect gas. Flow regime still Mach number independent, but there
are problems with adiabatic wall conditions
– Two-temperature ideal gas. Rotational and vibrational motion
of the molecules needs to be separated and leads to two-temperature
models. Used in supersonic nozzle design
– Dissociated gas. Multi-molecular gases begin to dissociate at the
bow shock of the body.
– Ionised gas. The ionised electron population of the stagnated flow
becomes significant, and the electrons must be modelled separately:
electron temperature. Effect important at speeds of 10 − 12km/s
• For some transient cases, with a well ordered time response, additional
time-response simplifications are possible. Example: frequency-based de-
composition in turbomachinery simulations, where frequency is determined
from the number of stator and rotor passages
∇•u = 0 (9.8)
• In order to resolve the flow to all of its details, full range of scales need
to be simulated. The range of scales in turbulent flow on high Re is well
beyond the capabilities of modern computers, which leads to turbulence
modelling
Level of Approximation
• Direct Numerical Simulation (DNS). Full range of scales is simulated:
transient simulation with averaging. 3-D and time-dependent simulations,
with the need for averaging
• Reynolds Averaged Navier-Stokes Equations (RANS). Velocity and
pressure (density) are decomposed into the mean and oscillating component
u = u + u′ (9.10)
p = p + p′ (9.11)
Substituting the above into the Navier-Stokes equations and eliminating
second-order terms yields the equations in terms of mean properties: u
and p, with a closure problem.
• Large Eddy Simulation (LES). LES recognises the fact that turbu-
lence on larger scales depends on the geometry and flow details and smaller
scales acting mainly as the energy sink. By nature, smaller scales are more
isotropic and homogenous and thus easier to model. Therefore, we shall aim
to decompose the flow into larger scales, which are resolved and model the
effect of smaller scales. Simulation is 3-D and time-resolved and requires
averaging.
• This is a substantial reduction in simulation cost and has allowed the adop-
tion industrial of CFD. RANS models are the mainstay of industrial CFD
and likely to remain so until the next change in computing power of ap-
proximately 2 orders of magnitude
• Turbulence models are just models (!) and their physical justification is
often more limited than for the fundamental equations
∂u
+ ∇•(u u) − ∇• (ν∇u) = −∇p + ∇•R (9.12)
∂t
∇•u = 0 (9.13)
Here, R is the Reynolds stress tensor:
R = u′ u′ (9.14)
where νt is the eddy viscosity. In short, the formula specifies that the
Reynolds stress tensor is aligned with the velocity gradient. Eddy viscosity
is assembled through dimensional analysis, based on a characteristic length-
and time-scale
9.7 Turbulent Flow Approximations 137
Mathematical Machinery
• Simulations remains 3-D and unsteady, with the need for averaging. How-
ever, demands for spatial and temporal resolution are considerably reduced,
due to the fact that smallest scales are to be modelled
∂u
+ ∇•(u u) − ∇• (ν∇u) = −∇p + ∇•τ (9.17)
∂t
138 Governing Equations of Fluid Flow
∇•u = 0 (9.18)
Here, τ is the sub-grid stress tensor, arising from the fact that u u 6= u u:
τ = uu − uu (9.19)
= (u + u′ ) (u + u′ ) (9.20)
= (u u − u u) + (u u′ + u′ u) + u′ u′ (9.21)
• The idea of LES is to separate the scales of turbulence such that only small
scales are modelled, whereas energetic and geometrical scales are resolved
by simulation. Small scale turbulence is closer to isotropic and homogenous,
making it easier to model
• In practice, most SGS models are based on eddy viscosity, sometimes with
additional transport or back-scatter effects
• At the same time, it is the role of the SGS model to control the energy
dissipation at the correct physical rate – this would imply the importance
of reducing numerical errors to a minimum
• Older school of LES required the same accuracy of spatial and temporal
discretisation as in DNS. Recent studies show this is excessive: higher mo-
ments are typically not of interest.
Pressure-Velocity Coupling
Momentum Equation
∂u
+ ∇•(uu) − ∇• (ν∇u) = −∇p (10.1)
∂t
140 Pressure-Velocity Coupling
• The limiting factor is the pressure gradient: ∇p appears as the source term
and for known p there would be no issues.
Continuity Equation
• Continuity equation states that mass will neither be created nor destroyed.
In incompressible flows, by definition ρ = const., resulting in the incom-
pressible form of the continuity equation:
∇•u = 0 (10.2)
• Note: this is a scalar field equation in spite of the fact that u is a vector
field!
• Counting the equations and unknowns, the system seems well posed: 1
vector and 1 scalar field governed by 1 vector and 1 scalar equation
∇•u = 0 (10.4)
10.2 Density-Based Block Solver 141
• Examining the role of the pressure, it turns out that the spherical part
of the stress tensor, extracted in the pressure term directly relates to the
above condition on the velocity. Viscous stress is modelled on the basis of
the velocity gradient:
£ ¤
σ = −pI + µ ∇u + (∇u)T , (10.5)
∂U
+ ∇•F − ∇•V = 0 (10.6)
∂t
where the solution variable U is:
ρ
U = ρu (10.7)
ρe
• Looking at the second row of the flux expression we can recognise the
convective contribution and the pressure driving force (note ∇•(pI) = ∇p).
In high-speed flows, the first component is considerably larger than the
second
• In the low-speed limit, a pressure difference of 3−5Pa can drive considerable
flow; however, in this case, the pressure gradient will dominate. As shown
before, this implies a density change of approximately 5 × 10−5 kg/m3 for
the mean density of 1kg/m3 . Equivalent calculation for a liquid (water),
would produce even more extreme result (due to the higher speed of sound)
• Equation governing pressure effects in this case is the continuity, through
density transport and the equation of state. Therefore, for accurate pressure
data we need to capture density changes of the order of 1 × 10−5 , with
reference level of 1, together with the velocity changes of the order of 1 and
energy level of 2 × 105 (e = ρCv T ). Note that all properties are closely
coupled, which means that matrix coefficients vary to extreme levels
• The speed of sound in general is given as
s
∂p
c= (10.9)
∂ρ
– Implicit solver
– Geometric multigrid
• Implicit solver
• Multigrid acceleration
Gradient Operator
• We shall only show the discretisation for the Gauss gradient; least square
and other techniques can be assembled in an equivalent manner
• Discretised form of the Gauss theorem splits into a sum of face integrals
Z I X
∇φ dV = nφ dS = sf φf (10.14)
VP S f
φf = fx φP + (1 − fx )φN (10.15)
where
1 − fx
aN = sf (10.17)
VP
and
P
f fx sf
aP = (10.18)
VP
• Note that both aP and aN are vectors: multiplying a scalar field φ produces
a gradient (vector field)
• For
P a uniform mesh (fx = const.), aP = 0! This is because for a closed cell
f sf = 0
Divergence Operator
where
1 − fx
aN = sf (10.21)
VP
and
P
f fx sf
aP = (10.22)
VP
• Note that the coefficients are equivalent to the gradient operator, but here
we have the inner product of two vectors, producing a scalar
• The system can be readily solved using the direct solver (note the zeros on
the diagonal of the pressure matrix). However, this is massively expensive
and we need to find a better way to handle the system
Solver Technology
• There exists a set of iterative techniques for saddle systems which may be of
use. Typically, they combine a Krylov-space solver (operating on residual
vectors) with special preconditioners for saddle systems
• In any case, the first step would be a derivation of the pressure equation,
which will be examined below
• This structure will arise naturally when trying to solve a block system of
equations
Ax + By = a (10.24)
Cx + Dy = b (10.25)
• The Schur complement arises when trying to eliminate x from the system
using partial Gaussian elimination by multiplying the first row with A−1 :
and
• Let us repeat the same set of operations on the block form of the pressure-
velocity system, attempting to assemble a pressure equation. Note that
the operators in the block system could be considered both as differential
operators and in a discretised form
· ¸· ¸ · ¸
[Au ] [∇(.)] u 0
= (10.29)
[∇•(.)] [0] p 0
[∇•(.)][A−1
u ][∇(.)][p] = 0 (10.30)
Here, A−1
u represent the inverse of the momentum matrix in the discretised
form, which acts as diffusivity in the Laplace equation for the pressure.
• From the above, it is clear that the governing equation for the pressure is
a Laplacian, with the momentum matrix acting as a diffusion coefficient.
However, the form of the operator is very inconvenient:
– While [Au ] is a sparse matrix, its inverse is likely to be dense
– Discretised form of the divergence and gradient operator are sparse
and well-behaved. However, a triple product with [A−1
u ] would result
in a dense matrix, making it expensive to solve
• The above can be remedied be decomposing the momentum matrix before
the triple product into the diagonal part and off-diagonal matrix:
where [Du ] only contains diagonal entries. [Du ] is easy to invert and will
preserve the sparseness pattern in the triple product. Revisiting Eqn. (10.29
before the formation of the Schur complement and moving the off-diagonal
component of [Au ] onto r.h.s. yields:
· ¸· ¸ · ¸
[Du ] [∇(.)] u −[LUu ][u]
= (10.32)
[∇•(.)] [0] p 0
A revised formulation of the pressure equation via a Schur’s complement
yields:
• We shall now rewrite the above derivation formally without resorting to the
assembly of Schur’s complement in order to show the identical result
For simplicity, we shall introduce the H(u) operator, containing the off-
diagonal part of the momentum matrix and any associated r.h.s. contribu-
tions:
X
H(u) = r − auN uN (10.35)
N
and
• Note the implied decomposition of the momentum matrix into the diagonal
and off-diagonal contribution, where auP is an coefficient in [Du ] matrix and
H(u) is the product [LUu ][u], both appearing in the previous derivation
• Pressure equation has been derived from the continuity condition and the
role of pressure is to guarantee a divergence-free velocity field
150 Pressure-Velocity Coupling
F = sf •u (10.40)
Therefore, conservative face flux should be created from the solution of the
pressure equation. If we substitute expression for u into the flux equation,
it follows:
• A part of the above, (auP )−1 sf •∇p appears during the discretisation of the
Laplacian, for each face. This is discretised as follows:
|sf |
(auP )−1 sf •∇p = (auP )−1 (pN − pP ) = apN (pN − pP ) (10.42)
|d|
|s |
Here, apN = (auP )−1 |d|f is equal to the off-diagonal matrix coefficient in the
pressure Laplacian
• Note that in order for the face flux to be conservative, assembly of the flux
must ba completely consistent with the assembly of the pressure equation
(e.g. non-orthogonal correction)
• Sequence of operations:
3. Calculate the new pressure based on the velocity field. This is called
a pressure correction step
£ ¤ £ ¤
∇• (auP )−1 ∇p = ∇• (auP )−1 H(u) (10.44)
5. Repeat to convergence
• Corrected velocity field may be obtained by substituting the new pressure
field into the momentum equation:
Under-Relaxation
• The algorithm in its base form produces a series of corrections on u and p.
Unfortunately, in the above form it will diverge!
• Divergence is due to the fact that pressure correction contains both the
pressure as a physical variable and a component which forces the discrete
fluxes to become conservative
• In order to achieve convergence, under-relaxation is used:
p∗∗ = p∗ + αP (p − p∗ ) (10.47)
and
u∗∗ = u∗ + αU (u − u∗ ) (10.48)
where p and u are the solution of the pressure and momentum equations
and u∗ and p∗ represent a series of pressure and velocity approximations.
Note that in practice momentum under-relaxation is implicit and pressure
(elliptic equation) is under-relaxed explicitly
auP 1 − αU u ∗
uP = H(u) − ∇p∗ + aP uP (10.49)
αU αU
0 < αP ≤ 1 (10.50)
0 < αU ≤ 1 (10.51)
αP + αU ≈ 1 (10.52)
152 Pressure-Velocity Coupling
αP = 0.2 (10.53)
αU = 0.8 (10.54)
PISO Algorithm
• PISO is very useful in kinds of simulations where the time-step is con-
trolled by external issues and temporal accuracy is important. In such
cases, assumption of slow variation over non-linearity holds and the cost of
momentum assembly and solution can be safely avoided. Example: Large
Eddy simulation
• Sequence of operations:
1. Use the available pressure field p∗ from previous corrector or time-step.
Conservative fluxes corresponding to p∗ are also available
2. Discretise the momentum equation with the available flux field
3. Solve the momentum equation using the guessed pressure. This step
is called momentum predictor
auP uP = H(u) − ∇p∗ (10.55)
4. Calculate the new pressure based on the velocity field. This is called
a pressure correction step
£ ¤
∇• (auP )−1 ∇p = ∇•((auP )−1 H(u)) (10.56)
5. Based on the pressure solution, assemble conservative face flux F
F = sf •H(u) − apN (pN − pP ) (10.57)
6. Explicitly update cell-centred velocity field with the assembled mo-
mentum coefficients
uP = (auP )−1 (H(u) − ∇p) (10.58)
7. Return to step 4 if convergence is not reached
8. Proceed from step 1 for a new time-step
• Functional equivalent of the PISO algorithm is alo used as a preconditioner
in Krylov space saddle-point solvers
154 Pressure-Velocity Coupling
Checkerboarding Error
• As shown above, the derived form of the pressure equation contains a
Laplace operator
£ ¤
∇• (auP )−1 ∇p = ∇•((auP )−1 H(u))
• We have also derived the matrix equivalent of the pressure equation using
Schur’s complement in the following form:
[∇•(.)][Du−1 ][∇(.)][p] = [∇•(.)][Du−1 ][LUu ][u]
10.4 Segregated Pressure-Based Solver 155
In both cases, the (auP )−1 or [Du−1 ] acts as a diffusion coefficient and can be
safely neglected as a pre-factor
Here, the last term may require the interpolation of the pressure gradient.
Computational Molecule
Pressure gradient
• Points around the cell P will appear in computational molecules for both
interpolated gradients appearing in the ∇•. operator for cell P . Since the
face area vectors point in opposite direction for two faces, the coefficients
for the intermediate points will exactly cancel out!
156 Pressure-Velocity Coupling
Face interpolated
pressure gradient
P N
• The issue of checkerboarding arises from the fact that interpolated velocity
in the divergence operator contains a cell-centred pressure gradient. This
results in an expanded molecule for the discretised Laplacian
• At the time, the FVM was strictly a (2-D) structured mesh technique and
the offered solution was to stagger the computational locations where p and
u are stored.
uy
ux
p
• Note that components of the velocity vectors are now stored in separate
locations and both are staggered: they formally represent face flux as well
as the velocity component
• There exist a pressure-flux formulation but this is beyond our scope at this
time
The face gradient is then used in the dot-product with the face area vector,
s•(∇p)f
• In the discretisation of the Laplace operator we have also come across the
expression s•(∇p)f which was discretised as follows:
|s|
s•(∇p)f = (pN − pP ) (10.61)
|d|
This formula results in compact support of the Laplacian and resolves the
problem
• We can arrive to the collocated in several ways:
– Delayed discretisation of the pressure gradient. Recognising that
the pressure equation contains a Laplace operator, we shall delay the
discretisation of the ∇p term in the momentum equation. Once the
pressure equation is assembled, the Laplace operator is discretised in
the usual way
– Rhie-Chow interpolation. In order to manufacture the coefficients
for compact pressure support, we will create a special formula for
velocity interpolation, which will separate the gradient term. Thus:
· ¸
u −1 pN − pP
uf = fx uP + (1 − fx )uN + (aP )f n̂ n̂•(∇p)f − (10.62)
|d|
Here, (auP )−1
f is the face interpolate of the diagonal coefficient of the
momentum equation, n̂ is a unit-normal vector in the direction of inter-
est (parallel with the direction of interpolation, d) and the expression
in brackets represents two ways of evaluating the face-based pressure
gradient
∗ Interpolated cell-centred pressure:
∗ Face-normal gradient
pN − pP
n̂•(∇p)f = (10.64)
|d|
• Note that the pressure equation is derived from a global continuity condition
∇•u = 0 (10.66)
This condition should be satisfied for each cell and for the domain as a
whole
Compressible Pressure-Based
Solver
Compressibility Effects
• Compressible form of the continuity equation introduces density into the
system
∂ρ
+ ∇•(ρu) = 0 (11.1)
∂t
• In the analysis, we shall attempt to derive the equation set in general terms.
For external aerodynamics, it is typical to use the ideal gas law as the
constitutive relation connecting pressure p and density ρ:
P
ρ= = ψP (11.2)
RT
where ψ is compressibility:
1
ψ= (11.3)
RT
162 Compressible Pressure-Based Solver
The principle is the same for more general expressions. In this case, pres-
ence of density also couples in the energy equation because temperature T
appears in the constitutive relation
∂(ρe)
+ ∇•(ρeu) − ∇•(λ∇T ) = ρg•u − ∇•(P u)
∂t µ ¶ (11.4)
2 £ ¡ ¢ ¤
− ∇• µ(∇•u) u + ∇• µ ∇u + (∇u)T •u + ρQ,
3
£ ¤
• In the incompressible form, the ∇• µ(∇u)T term was dropped due to ∇•u =
0:
£ ¤
∇• µ(∇u)T = ∇u•∇µ + µ∇(∇•u) (11.6)
where the first term disappears for µ = const. and the second for ∇•u = 0.
In compressible flows, this is not the case and the term remains
• Substituting this into the continuity equation will not yield the pressure
equation directly: we need to handle the density-pressure relation
11.2 Derivation of the Pressure Equation in Compressible Flows 163
• The first step is the transformation of the rate-of-change term. Using the
chain rule on ρ = ρ(p, . . .), it follows:
∂ρ ∂ρ ∂P
= (11.9)
∂t ∂P ∂t
∂ρ
=ψ (11.10)
∂P
• Looking at the divergence term, we will substitute the expression for u and
try to present ρ in terms of P as appropriate
£ ¤ £ ¤
∇•(ρu) = ∇• ρ(auP )−1 H(u) − ∇• ρ (auP )−1 ∇P (11.11)
• The first term is under divergence and we will attempt to convert it into a
convection term. Using ρ = ψ P , it follows:
£ ¤ £ ¤
∇• ρ(auP )−1 H(u) = ∇• ψ P (auP )−1 H(u) = ∇•(Fp P ) (11.12)
• Combining the above, we reach the compressible form of the pressure equa-
tion:
∂(ψ P ) £ ¤ £ ¤
+ ∇• ψ(auP )−1 H(u) P − ∇• ρ (auP )−1 ∇P = 0 (11.14)
∂t
∂(ψ P ) £ ¤
+ ∇•(Fp P ) − ∇• ρ (auP )−1 ∇P = 0 (11.17)
∂t
• Depending on the kind of physics and the level of coupling, the energy
equation may or may not be added to the above. It is in standard form but
contains source and sink terms which need to be considered with care
Coupling Algorithm
• In the limit of zero Ma number, the pressure equation reduces to its in-
compressible form
Boundary Conditions
Turbulence
• Coupled equations are solved together: flux formulation enforces the cou-
pling and entropy condition
11.5 Comparison of Pressure-Based and Density Based Solvers 167
Pressure–Based Solver
• Equation segregation implies that matrices are created and inverted one at
a time, re-using the storage released the storage from the previous equation.
This results is a considerably lower overall storage requirement
• To follow the discussion, note that the cost of solving an elliptic equation
(characterised by a symmetric matrix) is half of the equivalent cost for the
assymetric solver
• Mathematically, after more than 100 years of trying, we are nowhere near
to describing turbulence the way we wish to
170 Turbulence Modelling for Aeronautical Applications
Energy
Taylor scale
Inertial range
Dissipation
Wavenumber
– Large scale vortices, influenced by the shape of flow domain and global
flow field. Large scale turbulence is problematic: it is difficult yo decide
which of it is a coherent structure and which is actually turbulence
– Energy-containing vortices, which contain the highest part of the tur-
bulent kinetic energy. This scale is described by the Taylor scale
– Inertial scale, where vortex stretching can be described by inertial
effects of vortex breakup
– Small vortices, which contain low proportion of overall energy, but
contribute most of dissipation. This is also the smallest relevant scale
in turbulent flows, characterised by the Kolmogorov micro-scale
Turbulence Modelling
• DNS is, strictly speaking, not a turbulence model at all: we will simulate
all scales of interest in a well-resolved transient mode with sufficient spatial
and temporal resolution
u = u + u′ (12.1)
p = p + p′ (12.2)
• Substitute the above into original equations. Eliminate all terms containing
products of mean and fluctuating values
∂u
+ ∇•(u u) − ∇• (ν∇u) = −∇p + ∇•(u′ u′ ) (12.3)
∂t
∇•u = 0 (12.4)
174 Turbulence Modelling for Aeronautical Applications
R = u′ u′ (12.5)
Modelling Paradigms
• In order to close the system, we need to describe the unknown value, R as
a function of the solution. Two ways of doing this are:
1. Write an algebraic function, resulting in eddy viscosity models
R = f (u, p) (12.6)
R = f (S) (12.7)
where
1£ ¤
S= ∇u + (∇u)T (12.8)
2
Under divergence, this will produce a ∇•(∇u) kind of term, which makes
physical sense and is numerically well behaved
• Using dimensional analysis, it turns out that we need a pre-factor of dimen-
sions of viscosity: for laminar flows, this will be [m2 /s] and because of its
equivalence with laminar viscosity we may call it turbulent viscosity νt
12.3 Reynolds-Averaged Turbulence Models 175
Two-Equation Model
• Other choices also exist. For example, the Wilcox model uses eddy turnover
time ω as the second variable, claiming better behaviour near the wall and
easier modelling
Standard k − ǫ Model
• This is the most popular 2-equation model, now on its way out. There
exists a number of minor variants, but the basic idea is the same
∂ǫ ǫ ǫ2
+ ∇•(uǫ) − ∇•[(νef f )∇ǫ] = C1 G − C2 (12.17)
∂t k k
• Turbulent viscosity
k2
νt = Cµ (12.18)
ǫ
• Reynolds stress
· ¸
1 T
R = νt (∇u + ∇u ) (12.19)
2
Standard Closure
• Reynolds stress transport equation
∂R ǫ 2
+∇•(uR)−∇•[(αR νt + νl )∇R] = P−C1 R+ (C1 −1)Iǫ−C2 dev(P)+W
∂t k 3
(12.20)
where
178 Turbulence Modelling for Aeronautical Applications
• In cases where the two tensors are not aligned, Reynolds closure results are
considerably better
• Presence of the wall constrains the vortices, giving them orientation: effect
on turbulent length-scales
• Most seriously of all, both velocity and turbulence properties contain very
steep gradients near the wall. Boundary layers on high Re are extremely
thin. Additionally, turbulent length-scale exhibits complex behaviour: in
order for the model to work well, all of this needs to be resolved in the
simulation
• If the resolution requirement is not satisfied, models will typically blow up.
On stabilisation, velocity profile and wall drag will be wrong
Wall Functions
• In engineering simulations, we are typically not interested in the details of
the near-wall region. Instead, we need to know the drag
• This allows us to bridge the troublesome region near the wall with a coarse
mesh and replace it with an equilibrium model for attached flows: wall
functions
• Wall functions bridge the problematic near-wall region, accounting for drag
increase and turbulence. A typical resolution requirement is y + = 30 − 50,
but coarser meshes can also be used
180 Turbulence Modelling for Aeronautical Applications
• Wall functions split the region of operation below and above y + = 11.6 and
revert to laminar flow for below it. Here, increased mesh resolution may
result in less accurate drag prediction – this is not a well-behaved model
• Note that wall functions are used with high-Re bulk turbulence models,
reducing the need for high resolution next to the wall
• Low-Re models are aimed at capturing the details of the near-wall flow,
characterised by lower Re
• A low-Re turbulence model is not appropriate for low-Re flows away from
the wall: the results will be wrong!
• RANS equations are derived by separating the variable into the mean and
fluctuation around it. In simple situations, this implies a well-defined mean-
ing: mean is (well,) mean – implying time-independence and the fluctuation
carries the transient component
• In other cases, the difference between the mean and fluctuation may become
even more complex: consider a vortex shedding behind a cylinder at high
Re, where large shed vortices break up into turbulence further downstream
12.4 Large Eddy Simulation 181
• Simulations can still be 2-D where appropriate and the answer is typically
analysed in terms of a mean and coherent structure behaviour
Transitional Flows
• Apart from the fact that a low-Re flow is difficult to model in RANS,
additional problem stems from the fact that k = ǫ = 0 is the solution to
the model: thus if no initial or boundary turbulence is given, transition will
not take place
• Idea of LES comes from the fact that large-scale turbulence strongly de-
pends on the mean, geometry and boundary conditions, making it case-
dependent and difficult to model. Small-scale turbulence is close to ho-
mogenous and isotropic, its main role is energy removal from the system,
it is almost universal (Re dependence) and generally not of interest
• Mesh resolution requirements are imposed by the small scales, which are
not of interest anyway
• For this purpose, we need to make the equations understand scale, us-
ing equation filtering: a variable is decomposed into large scales which
are solved for and modelled small scales. To help with the modelling, we
wish to capture a part of the inertial range and model the (universal) high
wavenumber part of the spectrum
• Various forms of the filter functions can be used: local Gaussian distri-
bution, top-hat etc. with minimal differences. The important principle is
localisation
• After filtering, the equation set looks very similar to RANS, but the meaning
is considerably different
∂u
+ ∇•(u u) − ∇• (ν∇u) = −∇p + ∇•τ (12.30)
∂t
∇•u = 0 (12.31)
with
τ = (u u − u u) + (u u′ + u′ , u) + u′ u′ = L + C + B (12.32)
12.4 Large Eddy Simulation 183
• The first term, L is called the Leonard stress. It represents the interaction
between two resolved scale eddies to produce small scale turbulence
• The second term, C (cross term), contains the interaction between resolved
and small scale eddies. It can transfer energy in either direction but on
average follows the energy cascade
• The third term represents interaction between two small eddies to create
a resolved eddy. B (backscatter) represents energy transfer from small to
large scales
• The scene in LES has been set to ensure that single turbulence models work
well: small-scale turbulence is close to homogenous and isotropic
• Typical models in use are of Smagorinsky model type, with the fixed or
dynamic coefficients. In most models, all three terms are handled together
• Amazingly, most models work very well: it is only important to remove the
correct amount of energy from resolved scales
• In the past, research on LES has centred on sub-grid scale modelling and
the problem can be considered to be resolved
• Two problematic areas in LES are the inlet conditions and near-wall treat-
ment
Energy-Conserving Numerics
• For accurate LES simulation, it is critical to correctly predict the amount
of energy removal from resolved scale into sub-grid. This is the role of a
SGS model
• In order for the SGS model to perform its job, it is critical that the rest
of implementation does not introduce dissipative errors: we need energy-
conserving numerics
• In short, good RANS numerics is not necessarily sufficient for LES simula-
tions. In RANS, a desire for steady-state and performance of RANS models
masks poor numerics; in LES this is clearly not the case
• Resolved LES fields contain a combination of mean (in the RANS sense)
and large-scale turbulence. Therefore, it is extremely useful in studying the
details of flow structure
• A good LES code will provide a set of on-the-fly averaging tools to assemble
data of interest during the run
• Flow instability and actual vortex dynamics will be more visible in the
instantaneous field
• Data post-processing
New Challenges
• Problematic region is also found around the trailing edge: flow detachment
Choice of Models
• 2-equation models are also used regularly. A very popular model is the
k − ω because of its performance close the the wall
• Bluff body flows (e.g. complete aircraft, automobile, submarine) are con-
siderably more complex, both in the structure of boundary layers and in
the wake
Choice of Models
• Future trends are quite clear: moving from the RANS modelling to LES on
a case-by-case basis and depending on problems with current models and
available computer resources
• DNS remains out of reach for all engineering use, but provides a very good
base for model development and testing
188 Turbulence Modelling for Aeronautical Applications
Chapter 13
Large-Scale Computations
13.1 Background
In this chapter, a computing background for CFD simulations in engineering will
be examined. In 1965, Gordon Moore, Director of Fairchild Semiconductor’s Re-
search and Development Laboratories, wrote an article on the future development
of semiconductor industry with a sentence on computing power at fixed cost is
doubling every 18 months.
Increasing computer power is the driving force behind the expansion of nu-
merical simulation tools. Every new level of performance brings a possibility of
tackling new problems, using more advanced models or achieving higher simula-
tion fidelity.
• CFD simulations are among the largest users of CPU time in the world.
Even for a relative novice, it is easy to devise and set up a very large
simulation that would yield relevant results
• In all cases, the point is how to achieve maximum with the available com-
puting resources rather than how to perform the largest simulation. A small
simulation with equivalent speed, accuracy etc. is preferred
Simulation Time
• In many cases, the limiting factor is not feasibility, but time to market:
a Formula 1 car must be ready for the next race (or next season)
Scope
• Our objective is to examine the architecture requirements, performance and
limitations of large-scale CFD simulations today
• There is no need to understand the details of high performance program-
ming or parallel communications algorithms: we wish to know what paral-
lelism means, how to use it and how it affects solver infrastructure
• Crucially, we will examine the mode of operation of parallel computers
choice of algorithms and their tuning
• The first step is classification of high-performance computer platforms in
use today
Vector Computers
• Computationally intensive part of CFD algorithms involves performing
identical operations on large sets of data. Example: calculation of face
values from cell centres for grading calculation in cell-centred FVM:
φf = fx φP + (1 − fx )φN (13.1)
• φP and φN belong to the same array over all cells. The result, φf belongs to
an array over all faces. Subscripts P , N and f will be cell and face indices:
192 Large-Scale Computations
• In vector computers, the idea is that performing the same operation over a
large set can be made faster: create special hardware with lots of identical
(floating point) units under unified control
1. Set up instruction registers. This is done only once for the complete
data set
2. Assume the data is located in a contiguous memory space. Fetching
the start of the list grabs the whole list
3. Perform the operation on a large data set simultaneously
• A number of joint units is called the vector length. It specifies how many
operations can be performed together. Typical sizes would be 256 or 1024:
potentially very fast!
– Do-if structure
phiFace[i] =
0.5*(phiCell[owner[i]] + phiCell[neighbour[i]]);
}
else
{
phiFace[i] =
fx[i]*phiCell[owner[i]]
+ (1 - fx[i])*phiCell[neighbour[i]];
}
}
• Today, vector computers are considered “very 1970-s”. The principle works,
but loss of performance due to poor programming or compiler problems is
massive
• Compilers and hardware are custom-built: cannot use off-the shelf compo-
nents, making the computers very expensive indeed
• There is a chance that vector machines will make a come-back: the principle
of operation is sound but we need to make sure things are done more cleverly
and automatically
Parallel Computers
• Idea of massive parallelism is that a large loop (e.g. cell-face loop above)
could be executed much faster if it is split into bits and each part is given
to a separate CPU unit to execute. Since all operations are the same, there
is formally no problem in doing the decomposition
– Shared memory machines, where a single node can see the com-
plete memory (also called addressing space) with “no cost overhead”
– Distributed memory machines, where each node represents a self-
contained unit, with local CPU, memory and disk storage. Commu-
nication with other nodes involved network access and is associated
with considerable overhead compared to local memory access
• In reality, even shared memory machines have variable access speed and
special architecture: other approaches do not scale well to 1000s of nodes.
Example: CC-NUMA (Cache Coherent Non-Uniform Memory Access)
decomposition
Subdomain 3 Subdomain 4
13.3.1 Components
Functionality
• In order to perform a parallel FVM simulation, the following steps are
performed:
– Computational domain is split up into meshes, each associated with a
single processor. This consists of 2 parts:
∗ Allocation of cells to processors
∗ Physical decomposition of the mesh in the native solver format
Optimisation of communications is important: it scales with the sur-
face of inter-processor interfaces and a number of connections. Both
should be minimised. This step is termed domain decomposition
– A mechanism for data transfer between processors needs to be devised.
Ideally, this should be done in a generic manner, to facilitate porting
of the solver between various parallel platforms: a standard interface
to a communications package
– Solution algorithm needs to be analysed to establish the inter-dependence
and points of synchronisation
• Additionally, we need a handling system for a distributed data set, simula-
tion start-up and shut-down and data analysis tools
• Keep in mind that during a single run we may wish to change a number
of available CPUs and may wish to resume or perform data analysis on a
single node
• Modes of communication
– Load balance: all processing units should have approximately the same
amount of work between communication and synchronisation points
– Minimum communication, relative to local work. Performing local
computations is orders of magnitude faster than communicating the
data
• Achieving the above is not trivial, especially if the computing load varies
during the calculation
Mesh Support
• For purposes of algorithmic analysis, we shall recognise that each cell be-
longs to one and only one processor
Gradient Calculation
• Using Gauss’ theorem, we need to evaluate face values of the variable. For
internal faces, this is done trough interpolation:
φf = fx φP + (1 − fx ) φN (13.2)
• Note that all processors perform identical duties: thus, for a processor
boundary between domain A and B, evaluation of face values can be done
in 3 steps:
1. Collect internal cell values from local domain and send to neighbouring
processor
2. Receive neighbour values from neighbouring processor
3. Evaluate local face value using interpolation
13.3 Domain Decomposition Approach 199
• Note: it is critical that both sides of a parallel interface calculate the iden-
tical coefficient. If consistency is not ensured, simulation will fail
• Sources, sinks and temporal schemes all remain unchanged: each cell be-
longs to only one processor
Synchronisation
• Parallel domain decomposition solvers operate such that all processors fol-
low identical execution path in the code. In order to achieve this, some
decisions and control parameters need to be synchronised across all proces-
sor
Fluid-Structure Interaction
– Note that the energy equation is solved in all parts in a strongly cou-
pled manner: single equation encompassing all heat transfer physics
• From above, it follows that a number of equation sets will be solved to-
gether, with some equations covering multiple parts of the domain: Fluid-
structure interaction
• This does not necessarily involve only fluids and structures: we can speak
of multi-physics or, more accurately: physics!
– Turbo-fan
– Compressor
– Fuel supply and injection system
– Combustion chambers
– Turbine
– Afterburner
and
• Analysis of the coupling allows us to judge which effects are important and
which should be solved together
14.1 Scope of Simulations 203
Coupling Data
• Consider a case of wing flutter: fluid flow around an elastic wing
– Fluid flow creates forces on the wing surface. Since the wing is not
rigid, forces result in a deflection of the wing
– Wing deflection changes the shape of the fluid domain in the critical
region: next to the wing. Details of the flow field, including lift and
drag forces change feeding back to the interaction
– Adding a transient effect and natural frequency of oscillation for the
structure further complicates the problem
• In the example above, fluid forces are transferred to the solid, followed by
transfer of displacement onto the boundary of the fluid domain
• Note that in structural simulations domain motion is determined as a part
of the solution. In fluids, deformation of the domain needs to be handled
separately
204 Fluid-Structure Interaction
• Level of coupling
• In such cases, engineering judgement is used after the simulation: how can
we interpret the results or study the problem in a decoupled manner
Choice of Discretisation
• Ideally, discretisation for each set of equations is chosen for optimal accuracy
and efficiency
• In cases of FSI, this would usually employ the FEM for structural analysis
and FVM for fluid flow (why?)
• In explicit or implicit coupling, one needs to describe (boundary) data trans-
fer between the two: interpolation
• Additional care is required for implicit solution: are the methods compatible
and what are the properties of a coupled system
Data Mapping
• Boundary data mapping involves interpolation. This, by necessity includes
a discretisation error: one set of data points describing a continuous field
is translated into a different set
• Example: FSI, with transfer of forces from fluid to structure
– At the completion of the fluid flow step, we can calculate forces (pres-
sure + shear) on the wall boundary. The force is available for each
boundary face of a fluid domain
– Wall pressure represents external load onto the structure. However,
discrete representation of a structures mesh and location of solution
points is not identical: interpolation is needed
– It is critical that integral properties (total force) is preserved: typically
done by global re-scaling of the profile
• In FEM, one can find terms like profile-conserving or flux-conserving
interpolation. In reality, we need both
206 Fluid-Structure Interaction
14.4 Examples
Bibliography