Professional Documents
Culture Documents
Numerical Solution Algorithms For Compressible Flows: Hrvoje Jasak
Numerical Solution Algorithms For Compressible Flows: Hrvoje Jasak
Numerical Solution Algorithms For Compressible Flows: Hrvoje Jasak
Hrvoje Jasak
Faculty of Mechanical Engineering
and Naval Architecture
University of Zagreb, Croatia
Contents
I
1 Introduction
11
11
21
26
29
II
39
4 Mesh Handling
4.1 Introduction . . . . . . . . . . . .
4.2 Complex Geometry Requirements
4.3 Mesh Structure and Organisation
4.4 Manual Meshing: Airfoils . . . . .
4.5 Adaptive Mesh Refinement . . . .
4.6 Dynamic Mesh Handling . . . . .
.
.
.
.
.
.
41
41
42
45
50
53
57
.
.
.
.
.
.
.
.
61
61
61
63
65
67
70
72
74
77
77
77
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
CONTENTS
6.3
6.4
6.5
Equation
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
78
82
85
85
86
86
87
89
90
91
93
94
94
94
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
95
95
96
99
100
102
105
107
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
111
111
111
115
115
116
117
122
126
III
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
127
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
129
129
130
132
133
133
CONTENTS
9.6
9.7
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
10 Pressure-Velocity Coupling
10.1 Nature of Pressure-Velocity Coupling . . . . . . . . . . . . . .
10.2 Density-Based Block Solver . . . . . . . . . . . . . . . . . . .
10.3 Pressure-Based Block Solver . . . . . . . . . . . . . . . . . . .
10.3.1 Gradient and Divergence Operator . . . . . . . . . . .
10.3.2 Block Solution Techniques for a Pressure-Based Solver
10.4 Segregated Pressure-Based Solver . . . . . . . . . . . . . . . .
10.4.1 Derivation of the Pressure Equation . . . . . . . . . . .
10.4.2 SIMPLE Algorithm and Related Methods . . . . . . .
10.4.3 PISO Algorithm . . . . . . . . . . . . . . . . . . . . . .
10.4.4 Pressure Checkerboarding Problem . . . . . . . . . . .
10.4.5 Staggered and Collocated Variable Arrangement . . . .
10.4.6 Pressure Boundary Conditions and Global Continuity .
11 Compressible Pressure-Based Solver
11.1 Handling Compressibility Effects in Pressure-Based Solvers
11.2 Derivation of the Pressure Equation in Compressible Flows
11.3 Pressure-Velocity-Energy Coupling . . . . . . . . . . . . .
11.4 Additional Coupled Equations . . . . . . . . . . . . . . . .
11.5 Comparison of Pressure-Based and Density Based Solvers .
12 Turbulence Modelling for Aeronautical Applications
12.1 Nature and Importance of Turbulence . . . . . . . . . . . .
12.2 Direct Numerical Simulation of Turbulence . . . . . . . . .
12.3 Reynolds-Averaged Turbulence Models . . . . . . . . . . .
12.3.1 Eddy Viscosity Models . . . . . . . . . . . . . . . .
12.3.2 Reynolds Transport Models . . . . . . . . . . . . .
12.3.3 Near-Wall Effects . . . . . . . . . . . . . . . . . . .
12.3.4 Transient RANS Simulations . . . . . . . . . . . . .
12.4 Large Eddy Simulation . . . . . . . . . . . . . . . . . . . .
12.5 Choosing a Turbulence Model . . . . . . . . . . . . . . . .
12.5.1 Turbulence Models in Airfoil Simulations . . . . . .
12.5.2 Turbulence Models in Bluff-Body Aerodynamics . .
12.6 Future of Turbulence Modelling in Industrial Applications
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
134
134
135
136
137
.
.
.
.
.
.
.
.
.
.
.
.
139
139
141
144
144
146
147
147
150
152
154
157
159
.
.
.
.
.
161
161
162
164
165
166
.
.
.
.
.
.
.
.
.
.
.
.
169
169
172
173
174
177
179
180
181
185
185
186
187
CONTENTS
13 Large-Scale Computations
13.1 Background . . . . . . . . . . . . . . .
13.1.1 Computer Power in Engineering
13.2 Classification of Computer Platforms .
13.3 Domain Decomposition Approach . . .
13.3.1 Components . . . . . . . . . . .
13.3.2 Parallel Algorithms . . . . . . .
14 Fluid-Structure Interaction
14.1 Scope of Simulations . . . . .
14.2 Coupling Approach . . . . . .
14.3 Discretisation of FSI Systems
14.4 Examples . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. . . . . . . .
Applications
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
189
189
189
191
196
196
198
.
.
.
.
201
201
204
205
206
Part I
Introduction to Modern CFD
Chapter 1
Introduction
Computational Fluid Dynamics
Definition of CFD, from Versteeg and Malalasekera: An Introduction
to Computational Fluid Dynamics
Computational Fluid Dynamics or CFD is the analysis of systems involving fluid flow, heat transfer and associated phenomena
such as chemical reactions by means of computer-based simulation.
CFD is also a subset of Computational Continuum Mechanics: fundamentally identical numerical simulation technology is used for many sets of
simular partial differential equations
Numerical stress analysis
Electromagnetics, including low- and high-frequency phenomena
Weather prediction and global oceanic/atmosphere circulation models
Large scale systems: galactic dynamics and star formation
Complex heat and mass transfer systems
Fluid-structure interaction and similar coupled systems
In all cases, equations are very similar: capturing conservation of mass,
momentum, energy and associated transport phenomena
10
Introduction
Chapter 2
Introduction: CFD in
Aeronautical Applications
2.1
In this section we will explore the role and history of Computational Fluid Dynamics in the aerospace industry. Problems of aerospace design were leading the
technological push for a long period in the 20th, dictating areas of research and,
together with nuclear research, expanding the use of numerical modelling.
Even today, aerospace and related technology (e.g. rocket design) is considered
sufficiently serious to limit the access to latest design by world powers to other
governments: however, major parts of technology may be considered more than
50 years old. Example: Chuck Yeager and the first supersonic flight, 1947?
In NASA, the new push towards manned space exploration and reach-out
towards a manned Mars mission involves mainly fluid dynamics challenges. The
mission requirements beyond Earths orbit are more or less settled.
New work in aircraft design concentrates on optimising the existing technology
with very few revolutionary new ideas. Main area of work still follws traditional
functional decomposition of functions on an airplane: wings for lift, rudder for
steering, body as useful volume. However, new simulation techniques allow us to
re-visit functionally interesting alternatives: flying wind configuration has been
revived recently in the B-2 bomber after 50 years from the first attempt.
Introduction
Aerospace industry is the first and most prevalent in the use of numerical
techniques, including Computational Fluid Dynamics (CFD)
Early beginning of CFD in early 1960s
First successes came to prominence in the 1970s
12
13
Challenges in aircraft design moving elsewhere: systems integration, control components (e.g. electro-hydraulics), packaging, computer support and
battlefield integration, advanced materials (single-crystal turbine blades)
etc.
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 turbine, where shock management in supersonic flow is used to create the necessary
compression.
State of the market
Boeing and Airbus totally dominate the commercial airliner market. Number of smaller players on the edges and in business/regional jet business:
ATR, Gulfstream, Raytheon etc.
Military situation a bit more diverse: BAE Systems, Lockheed Martin,
Sukhoi and a number of smaller manufacturers
I also count missile systems and aircraft engine manufacturers (General
Electric, Rolls Royce, Pratt and Whitney)
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 upsidedown, creating down-force instead of lift; concerns about drag very different 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
In order to understand the requirements of various uses of CFD, let us introduce a simple flow classification, based on how tightly managed is the flow
field.
My flow classification
Smooth flows: engineering machinery specifically organises the flow for
maximum stability and efficiency. Design conditions are clearly defined and
14
their variation is relatively small. Fractional changes in flow characteristics have profound performance effects (detached flow, small recirculations,
turbulence. Example: aircraft at cruising speed, turbo-machinery blades,
yacht design
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
In aerospace, we mostly deal with smooth flows
Scope of Simulations
Traditionally, experimental studies in aerospace are important, but fullscale models are more and more out of the question. This creates ideal
scope for numerical studies
Questions we look to answer with numerical simulation techniques range
from simple lift and drag studies to extremely complex physical problems:
stall characteristics, stability in manoeuvres, sensitivity and robust design,
optimisation, aero-acoustic noise. A number of new techniques stem from
use of CFD in aerospace and are still spreading through the rest of CFD
and industry
The baseline physics involved is relatively simple: compressible Newtonian flows of an ideal gas
. . . complications easy to add: incompressible to hypersonic flow regime
Speed Range
low subsonic
high subsonic
transonic
supersonic
hypersonic
Mach Number
< 0.3
0.3 0.6
0.6 1.1
15
>5
15
jet
aircraft
general
aviation
1000
model
airplanes
100
10
1
gliders
insects
airships
0.1
dust
0.01
0
9 log(Re)
Even in simplest flows, we do not have an easy job: turbulence complicates the situation immensely! The problem of turbulence modelling for
engineering applications is still unsolved; however, the physics is straightforward and well understood
Away from the baseline, physics can get considerably more complex: combustion, de-icing, multi-phase flow etc.
There is significant penetration of general purpose CFD tools into the
aerospace companies, but this is still considered a massive untapped market
from the commercial CFD point of view. It is unclear that general purpose
tools will be sufficiently good to do the job.
Numerical simulation software
You dont do CFD without computers! Early efforts with pieces of paper
and rooms of people date from UK Metheorological office, running large
scale weather forecasting simulations
In the last 10 years, CFD performance and use coming together
Computers power is a cheap commodity. Massively parallel computers
are commonplace today and can be easily handled in software
In aerospace, understanding the physics is typically not a problem
Numerical methods cleaned up of systemic errors and gross failures
Sufficient experience in research departments
Validation against trusted experimental data
Understanding of simplifications and assumptions
In other industries, roll-out of numerical simulation tools limited by experience. Phases of integration of CFD in the design process:
16
17
analysis has already been overcome: compared to fluid flow, physics involved in
structural simulation is significantly simpler.
Phases of a CFD Simulation
Description of the geometry. Airfoil curve data, CAD surface or anywhere in between. External aerodynamics = geometry of interest located
in a large domain (atmosphere)
Extraction of the fluid domain. In cases where a CAD description is
given, a considerable amount of clean-up may be required. This is not easily
done, no reliable automatic tools.
Mesh generation. Based on the given fluid domain, a computational mesh
is created. Tools range form manual (points and cells), semi-automatic
(block splitting, template geometries, surface wrapping (adaptation of a
mesh template to a given surface) to fully automatic (tetrahedral and hexahedral/polyhedral automatic mesh generators). Mesh generation is the
most demanding and time-consuming process today. Significant push to
automatic tools. In spite of automatic tools, there is room for engineering judgement, as a quality solution can be obtained more cheaply by constructing a quality mesh. A good mesh takes into account what the solution
should look like.
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
Solver setup and simulation. Choice of discretisation parameters and
numerical solution procedure: differencing schemes, relaxation parameters,
multigrid, convergence tolerance etc..
Data post-processing and analysis of results. Not always straightforward.
Integral studies. In simple lift and drag studies, we could be looking
at a small number of integral properties.
18
Flow organisation, where global characteristics of the flow are controlled to achieve stability or a desired pattern
Management of detailed flow structure. Example: remove the vortex
depositing dirt on a part of the windshield
Sensitivity and robust design studies. Usually cannot be seen in results
without experience or require specialised simulations.
Advanced visualisation tools are a part of the game: provides a way of
managing the wealth of data.
20 years ago, leading CFD tools were developed at Universities, centred
around strong research groups and attracting significant funding from the industry. As a response to deployment problems, large aerospace companied develop
their own research teams and in-house expertise.
Today, CFD software development at Universities is winding down significantly: the components a good research platform requires are substantial and
very few groups can afford to finance the effort (there is little research value and
publishable results in writing a new known technology CFD code. Majority of
groups rely on commercial CFD software to do their research.
In-house software development in large companies suffers a similar fate: the
work that can be done by commercial software is migrated to commercial CFD
codes and sometimes even outsorced. Apart from financial pressures, this is
related to software development, maintenance and validation work required to
keep in-house codes working and up-to-date with technology.
The above pushes larg-scale software work to commercial organisation, which
have grown from small companies in late 1980s and early 1990s to large organisations. Current trend towards large packages that can satisfy all simulation needs
to all customers under the same hood acts as a counter-weight for this state
of affairs. Specialised software for specialised needs and technology components
giving competitive advantage will be kept separate.
CFD Software Development
Small experimental codes: playing around with physics and numerical methods
In-house general CFD solver development
In-house custom-written software for specific purposes: e.g. wing-nacelle engine system, turbine blade optimisation, simulation of unstable manoeuvres
in military jets, calculation of directional derivatives and solution stability,
matching computations with measured data sets etc.
Complex and tuned panel method codes
19
20
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: procedural programming, Fortran and C against object orientation
The push for bigger, faster, more accurate simulations in external aerodynamics not so strong in the aerospace market: meshes are already sufficiently 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 modelling technique: Large Eddy Simulation
Integrated Multicode Simulation Framework
As a part of the project, worlds biggest parallel computers have been
built:
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.
21
2.2
The level and fidelity of numerical simulation is tailored to the design process:
it will cover everything form preliminary design tools running in 1-2 seconds to
full transient CFD studies for complex physics simulations. The use of analytical
and pedestrian methods in early design phases cannot be ignored: laying out
the initial set-up of a jet engine compressor is done using precisely the techniques
taught in University turbomachinery courses. Once, the basic design is laid down,
more detailed tools will be used to satisfy design requirements and optimise the
performance.
Aerodynamic Drag
Drag varies with the velocity squared: major influence at aerospace speed.
Narrow improvements in drag lead to considerable advances:
A 15% drag reduction on the Airbus A340-300B would yield a
12% fuel saving, other parameters being constant.
(Mertens, 1998)
Chasing drag improvements in highly optimised shapes is only of marginal
interest
Cd = 0.47
Sphere
Cd = 0.80
Angled cube
Cd = 0.42
Half sphere
Cd = 0.82
Long cylinder
Cd = 0.50
Cone
Cd = 1.15
Short cylinder
Cd = 1.05
Cube
Cd = 0.04
Streamlined body
Simulations include functional subset cases, e.g. airfoils, wings, tails configuration, nacelle-to-wing assembly, but also full aircraft models
Subjects of interest include shock-boundary layer interaction: effects of
shocks on standard turbulence model prediction is still in question.
22
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 separation, 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
23
24
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
Rudder and Steering Diagrams
In automated steering/targeting systems, the aircraft/missile is controlled
by a computer: given target or flight path
Automatic control systems rely on the diagrams showing the response on
steering commands: in practice, large look-up tables or fitted functional
data. Consider a case of a rotating missile with 2 4 control surfaces.
The steering data created by computation: combinations of control configurations with lift, drag, pitch, yaw orientation and force response. This
typically involves 5-10 thousand simulations, done automatically on massively parallel computers. Automatic mesh generation, massive parallelism
and controlled accuracy are essential.
http://people.nas.nasa.gov/ aftosmis/home.html
Internal Flows and Auxiliary Devices
Internal flows: incompressible, low speed, aerodynamics forces typically of
no consequence
Example: passenger compartment comfort, heating, cooling and ventilation. Closer to standard CFD and usually handled by general-purpose
CFD packages
Stability and Robust Design
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?
Away from stall point: lift is stable to small change in conditions
25
26
Fluid-structure simulations involve both the fluid and solid domain. Care
must be given to the coupling methods and stability of the algorithm
2.3
27
28
Euler Flow Solver. Neglects the viscous effects but the compressibility
physics can be handled in full.
Chapter 3
CFD in Automotive Applications
CFD Methodology
Numerous automotive components involve fluid flow and require optimisation. This opens a wide area of potential of CFD use in automotive
industry
CFD approaches the problem of fluid flow from fundamental equations:
no problem-specific or industry-specific simplification
A critical step involves complex geometry handling: it is essential to
capture real geometrical features of the engineering component under consideration
Traditional applications involve incompressible turbulent flow of Newtonian
fluids
While most people think of automotive CFD in terms of external aerodynamics simulations, reality of industrial CFD use is significantly different
30
31
32
33
34
35
It is quickly recognised that the needs of automotive industry and (potential) capabilities of CFD solvers are well beyond contemporary experimental
work
Focus of early numerical work is on performance-critical components: internal combustion engines and external aerodynamics
Geometry and flow conditions are simplified to help with simulation set-up
Example: Intake Valve and Manifold
2-D steady-state incompressible turbulent fluid flow
Axi-symmetric geometry with a straight intake manifold and fixed valve lift
36
37
38
Physical Modelling
New physical models quickly find their use, e.g. free surface flows
Looking at more complex systems in transient mode and in 3-D: simulation
of a multi-cylinder engine, with dynamic effects in the intake and exhaust
system
Computing power brings in new areas of simulation and physical modelling
paradigms. Example: Large Eddy Simulation (LES) of turbulent flows
Integration into a CAE Environment
Computer-Aided Design software is the basis of automotive industry
Historically, mesh generation and CFD software are developed separately
and outside of CAD environment, but the work flow is CAD based!
Current trend looks to seamlessly include CFD capabilities in CAD
Summary: Automotive CFD Today
CFD is successfully used across automotive product development
Initial landing target of external aerodynamics and in-cylinder engine
simulation still not reached (!) sufficient accuracy difficult to achieve
Lessons Learned
The success of CFD in automotive simulation is based on providing industry needs rather than choosing problems we may simulate: find a critical
broken process and offer a solution
Numerical simulation tools will be adopted only when they fit the product
development process: robust, accurate and validated solver, rapid turn-over
Experimental and numerical work complement each other even if sufficient
accuracy for predictive simulations cannot be achieved
Validation of simulation results understanding experimental set-up
Parametric studies: speeding up experimental turn-over
True impact of simulation tools is beyond the obvious uses: industry will
drive the research effort to answer its needs
Part II
The Finite Volume Method
Chapter 4
Mesh Handling
4.1
Introduction
42
Mesh Handling
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-experienceindependent) result. The quest for fast and robust automatic mesh generators
iteratively sensitised to the solution is still ongoing.
4.2
Computational Mesh
A computational mesh represents a description of spatial domain in the
simulation: external shape of the domain and highlighted regions of interest,
with increased mesh resolution
Mesh-less methods are possible (though not popular): the issue of describing the domain of interest to the computer still remains
Mesh generation is the current bottle-neck in CFD simulations. Fully automatic mesh generators are getting better and are routinely used. At the
same time, requirements on rapid and high-quality meshing and massively
increased mesh size are becoming a problem
Routinely used mesh size today
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
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 software becomes a limiting factor: missing parallel mesh generation, data file
read/write, post-processing of results, hardware and software prices
Handling Complex Geometry
In aerospace applications, geometrical information is usually available before the simulation. In general, this is not the case: for simple applications,
a mesh may be the only available description of the geometry
Domain description is much easier in 2-D: real complications can only be
seen in 3-D meshes
Geometrical data formats
2-D boundary shape: airfoils. Usually a detailed map of xy locations
on the surface. Sometimes defined as curve data
http://www.ae.uiuc.edu/m-selig/ads/coord database.html
Stereo Lithographic Surface (STL): a surface is represented by a set
of triangular facets. Resolution can be automatically adjusted to capture the surface curvature or control points. Creation of STL usually
available from CAD packages
Native CAD description: Initial Graphics Exchange Specification (IGES),
solid model etc. In most cases, the surface is represented by NonUniform Rational B-Splines or approximated by quadric surfaces. Typically, both are too expensive for the manipulations required in mesh
generation and either avoided or simplified
Geometry clean-up. Very rarely is the CAD description built specifically
for CFD in most cases, CAD surfaces (wing, body, nacelle) are assembled
from various sources, with varying quality and imperfect matching. Surface
clean-up is time-consuming and not trivial. In some cases, the mesh generator may be less sensitive to errors in surface description, which simplifies
the clean-up
Feature removal. CAD description or STL surface may contain a level
of detail too fine to be captured by the desired mesh size, causing trouble
with 3-D mesh generation. Feature removal creates an approximation of
the original geometry with the desired level of detail
44
Mesh Handling
4.3
45
46
Mesh Handling
Multi-Block Mesh
Mesh created as a combination of multiple body-fitted blocks. All block
and cells are still hexahedral
In FVM, special coding is done on block interfaces, where the mesh connectivity 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 timeconsuming: meshes need to match
47
48
Mesh Handling
From the numerical simulation point of view, this is a major step forward.
Geometries of industrial interest can now be tackled with a detailed description, which satisfies the design engineer
At this stage, numerical simulation in an industrial setting really takes off.
Handling airfoils and single wing or even wing-fuselage assembly is not too
difficult. Hand-built meshes for a complete aircraft are still quite difficult
49
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 resolution is higher than for hexahedra. A part of the price is paid in lower
accuracy of the solver on tetrahedra: limited neighbourhood connectivity.
50
Mesh Handling
4.4
51
e
e40
e
e27
e
e35
e
e34
e
e40
e
e25
e
e37
e
e19
e
e12
ee6
e11
e10
e
e
e4
e
e35
e
e69
e19
e4
e
ee11
e10
ee12
e
e
e66
e
e16
e
e41
e
e68
e
e69
e
e16
e
e66
e
e20
e
e30
e
e38
e42e17
e
e
e
e38
e5
e
ee8
e9
ee7
ee3
e
e
e68
e
e31
e
e15
e30
e
e
e39
e
e41
e
e37
e
e6
e
e39
e
e20
e
e42
e
e17
e
e31
e
e5
e
ee8
e9
ee7
ee3
e e15
e
e26
e
e33
e
e1
e
e1
e
e32
e
e32
e
e25
e
e29
e
e28
e
e29
e
e77
e
e13
e
e76
e
e27
e
e34
e
e26
e
e77
e
e13
e
e76
e
e33
e
e22
e
e28
52
Mesh Handling
Pi
V1
Voronoi vertex
X
Y
P1
53
Examples
3rd AIAA CFD Drag Prediction Workshop
http://aaac.larc.nasa.gov/tsab/cfdlarc/aiaa-dpw/
4.5
From the above examples it can be seen how the structure and quality of the
mesh influences the solution. In first approximation, the number and distribution of computational points determines out picture of the solution even in the
absence of computational errors. In places where the solution varies rapidly or
54
Mesh Handling
55
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
BBBBB
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
BBBBB
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCC BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
BBBBB
CCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
BBBBB
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
BBBBB
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
CCCCCCCCCCCCCCC
CCCCCCCCCCCC
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBB
CCCCCCCCCCCCCCC
BBBBBBBBBBB
CCCCCCCCCCCCCCC BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBB
Error- or Indicator-Driven Adaptivity
In strongly shocked flows, it is relatively easy to identify regions of interest:
shocks, boundary layer, contact discontinuities. In more complex situations
or in presence of flow features of different strength, this is much more difficult. Mesh-induced discretisation errors (poor mesh quality or insufficient
resolution) also needs to be taken into account.
A region of interest can usually be recognised by high gradients: rapidly
varying solution
56
Mesh Handling
57
0.0
4.6
0.5
1.0
1.5
2.0
2.5
3.0
Many relevant simulations in continuum mechanics involve the cases where the
shape of computational domain changes during the simulation, either in a manner prescribed up front or as a function of the solution. As we will show later,
handling such cases generalises the discretisation practice to some form of Arbitrary Lagrangian-Eulerian practice, combining the view from the Lagrangian
and Eulerian reference frame. This is usually terms dynamic mesh handling,
coming in a number of different guises.
From the point of view of mesh handling, we can recognise two distinct situations:
Mesh deformation, where the structure and connectivity of the mesh
remains unchanged, but the position of points supporting its shape changes.
Mesh deformation is characterised by the fact that the number of point,
faces, cells and boundary faces remains constant, as does the connectivity
between the shapes;
In a topologically changing mesh, the number of points, faces and cells
or their connectivity varies during the simulation.
It will be shown that standard discretisation methods handle cases of mesh
deformation without loss of accuracy, while topological changes may (depending
58
Mesh Handling
59
60
Mesh Handling
Chapter 5
Transport Equation in the
Standard Form
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 transport, based on the convective velocity field, gradient-driven diffusive transport, rate-of-change terms and localised volume sources and sinks. Understanding 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 Transport 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.
5.2
Background
Scalar transport equation in the standard form will be our model for discretisation. Conservation laws, governing the continuum mechanics adhere
62
63
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
x
x
y
z
(5.1)
(5.2)
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
u =
uj
uj =
xi
xi
(5.3)
5.2.1
ui
xi
(5.4)
64
dS
00
11
11
00
00
11
00
11
inflow
n
outflow
dV =
(nu)dS
dV +
dt Vm
Vm t
Sm
d
dt
dV =
V
Z
V
+ (u) dV
t
(5.5)
(5.6)
65
qs
dS
00
11
inflow
Qv
11
00
00
11
00
11
n
outflow
d
dt
dV =
V
qv dV
(nqs )dS
+ (u) = qv qs
t
5.2.2
(5.7)
(5.8)
Diffusive Transport
Gradient-based transport plays a very different role from the Reynolds Transport Theorem terms derived above. One should keep in mind that diffusion is
a physical model for the behaviour of surface terms rather that a result of direct mathematical manipulation. However, its generality and special mathematical properties are much deeper. Gradient-based transport si observed regularly
in many physical phenomena, from conductive heat transfer to equilibration of
species concentration. It can be seen as the effect of molecular dynamics on the
macro-scale, in presence of sufficient scale separation.
Diffusive Transport
Gradient-based transport is a model for surface source/sink terms
Consider a case where is a concentration of a scalar variable and a closed
domain. Diffusion transport says that will be transported from regions of
high concentration to regions of low concentration until the concentration
is uniform everywhere.
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 = ,
where is the diffusivity.
(5.9)
66
t
|{z}
temporal derivative
(u)
| {z }
convection term
() =
| {z }
diffusion term
qv
|{z}
(5.10)
source term
+ (u) = 0
t
(5.11)
(5.12)
(5.13)
5.3
67
The role of boundary conditions is to isolate the system under consideration from
the external environment. Location and type of boundary conditions depends on
our knowledge about flow and physical conditions and their influence on the
solution. Boundary conditions can be classified as numerical and physical
boundary conditions.
Numerical boundary conditions can be considered at the equation level. Main
types are the fixed value or Dirichlet condition, zero (Neumann) or fixed gradient
condition (flux condition) and a mixed or Robin condition.
Physical boundary conditions are related to the model under consideration
and involves combinations of individual equations under consideration. This
reduces to numerical boundary conditions between various equations, where the
fixed value, flux or their combination are updated in a physically meaningful
sense.
Examples of physical boundary conditions in fluid flows are flow inlets and
outlets, wall, symmetry planes and far field conditions.
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
Position of boundaries and specified condition requires engineering judgement. Badly placed boundaries will compromise the solution or cause numerical problems. Example: locating an outlet boundary across a recirculation zone.
Incorporating the knowledge of boundary conditions from experimental
studies or other sources into a simulation is not trivial: it is not sufficient
to pick up some arbitrary data and force in on a simulation. Choices need
to be based on physical understanding of the system
Numerical Boundary Conditions
Dirichlet condition: fixed boundary value of
Neumann: zero gradient or no flux condition: nqs = 0
Fixed gradient or fixed flux condition: nqs = qb . Generalisation of the
Neumann condition
Mixed condition: Linear combination of the value and gradient condition
68
69
Wall
Wall
5D
0.
0.
5D
Wall
Outlet
Symmetry plane
H
Symmetry plane
X
70
Heated wall: fixed value velocity, zero gradient pressure, fixed gradient
temperature (fixed heat flux)
Initial Condition
Boundary conditions are only a part of problem specification. Initial conditions specify the variation of each solution variable in space. In some
cases, this may be irrelevant:
Steady-state simulation result should not depend on the initial condition
In oscillatory transient cases (e.g. vortex shedding), the initial condition is irrelevant
5.4
An important property of physical variables are their natural bounds. Examples here would include kinetic energy, which always remains positive; species
concentration, bounded between 0 and 1 (100 %) and many others.
Physical bounds may be implied from the nature of the variable, but also from
the differential equations governing the system. A good test of understanding of
the equation systems involves the analysis of boundedness from the source and
sink terms and their interaction.
Enforcing Physical Bounds
When transport equations are assembled, they represent real physical properties. A set of equations under consideration relies on the fact that physical
71
variables obey certain bounds: if the bounds are violated, the system exhibits 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
= 1.05, 1 = 1 kg/m3 , 2 = 1000 kg/m3
= 1 + (1 ) 2
= 1.05 1 + (1 1.05) 1000
= 1.05 0.05 1000 = 1.05 50 = 48.95 kg/m3
Physical bounds on solution variables are easily established. However, our
task is not only to recognise this in the original equations but to enforce it
during the iterative solution process. If at any stage we obtain a locally negative density, the convergence of the iterative algorithm will be disrupted:
this is not trivial
For vector and tensor variables, the physical bounds are not as straightforward and may be more difficult to enforce
Diffusion coefficient and stability. An example of how the iterative
process breaks down is a case of negative diffusion introducing positive
feed-back in the system. The diffusion model:
qs = ,
assumes positive value of : the gradient transport will act to decrease
the maximum value of in the domain and tend towards the uniform
distribution. For negative , the process is reversed and is accumulated
at the location of highest , which tends to infinity in an unstable manner.
If you encounter cases where is genuinely negative (e.g. financial modelling
equations), there is still a way to solve them: marching in time backwards!
Bounding source and sink terms. Looking at a scalar variable with
bounds, e.g. 0 1, governed by a generic transport equation, a sanity
check can be performed on the volumetric source term: as approaches
its bounds, the value of qv must tend to zero. This is how the form of the
differential equation preserves the sanity of the variable; the same property
needs to be achieved in the discretised form of the equation
72
Examples
Convection-dominated problems
Diffusion problems
Negative diffusion coefficient
Convection-diffusion and Peclet number
Source and sink terms: preserving the boundedness
5.5
Scalar transport equation in its standard form represents a relatively simple physical system, including convective and diffusive transport and linearised source and
sink terms. The equation is sufficiently easy to fathom to provide a number of analytical solutions (e.g. line source in cross flow) but does not capture the richness
and complexity of may real-life phenomena.
We shall now look at a series of seemingly simple modifications to the form
of various terms and their effect. An important property of good discretisation is
to enforce physical bounds on all relevant variables not only on convergence but
also on intermediate solution on the iterative process.
Vector and Tensor Transport
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
Variable convected by itself: (d d)
73
(5.14)
(5.15)
74
5.6
Inter-Equation Coupling
(5.16)
where
t = C
k2
(5.17)
75
and
G = t [u + (u)T ] : u.
(5.18)
-equation:
+ (u ) (t ) = C1 G C2 ,
t
k
k
(5.19)
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
kold
(5.20)
76
Chapter 6
Polyhedral Finite Volume
Method
6.1
Introduction
6.2
Discretisation
Generic transport equation can very rarely be solved analytically: this is
why we resort to numerical methods
Discretisation is a process of representing the differential equation we wish
to solve by a set of algebraic expressions of equivalent properties (typically
a matrix)
Two forms of discretisation operators. We shall use a divergence operator
as an example.
Calculus. Given a vector field u, produce a scalar field of u
Method. For a given divergence operator , create a set of matrix
coefficients that represent u for any given u
The Calculus form can be easily obtained from the Method (by evaluating
the expression), but this is not computationally efficient
Properties A discretised form of equation needs to consistently represent the
original equation
78
6.3
79
sf
df
f
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.
Delta vector for the face f is defined as
df = P N
(6.2)
80
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
In practice, cell volume and face area calculated by decompositions into
triangles and pyramids
Types of faces in a mesh
Internal face, between two cells
Boundary face, adjacent to one cell only and pointing outwards of
the computational domain
When operating on a single cell, assume that all face area vectors sf point
outwards of cell P
Spatial and Temporal Variation
Postulating spatial variation of : second order discretisation in space
(x) = P + (x xP )()P
(6.5)
(t + t) = + t
t
t
where t = (t)
(6.6)
81
dV + (nu) dS (n) dS =
qv dV
(6.7)
V t
S
S
V
Each term contains volume or surface integral. Evaluate the integrals, using
the prescribed variation in space
Volume integral
Z
dV =
[P + (x xP )()P ] dV
Z
Z
= P
dV + ()P (x xP )dV = P VP
V
Surface integral splits into a sum over faces and evaluates in the same
manner
I
XZ
XZ
n[f + (x xf )()f ]
nf dSf =
n dS =
S
Sf
Sf
sf 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
6.4
Face Addressing
Software Organisation
Assuming that f depends on the values of in the two cells around the face,
P and N, let us attempt to calculate a surface integral for the complete
mesh. Attention will be given on how the mesh structure influences the
algorithm
Structured mesh. Introducing compass notation: East, West, North,
South
The index of E, W , N and S can be calculated from the index of P : n + 1,
n 1, n + colDim, n colDim
S
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
83
3
2
s1
84
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 =
dsa
(6.8)
Gradient form
Z
I
dV =
ds
(6.9)
VP
VP
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
s
f
P
85
6.5
Operator Discretisation
6.5.1
Temporal Derivative
(6.10)
n = (t = tnew )
(6.11)
n o
=
t
t
3 n
o + 21 oo
= 2
t
t
Thus, with volume integral:
Z
n o
dV =
VP
t
t
(6.12)
VP
t
Source contribution: rP =
VP ,o
t
86
6.5.2
(6.13)
2
t2
using three
2
2n 5o + 4oo ooo
=
.
t2
t2
(6.14)
Exercise: what needs to be done if the time step is not constant between
the two old time levels?
6.5.3
Gauss Theorem
Evaluation of the gradient is a direct application of the Gauss Theorem
Z
I
dV =
ds
(6.15)
VP
VP
(6.16)
It still remains to evaluate the face value of . Consistently with secondorder discretisation, we shall assume linear variation between P and N
f = fx P + (1 fx )N
Gradient evaluation almost exclusively used as a calculus operation
(6.17)
87
(6.18)
(6.19)
1
|dN |
(6.20)
(6.21)
(6.22)
This produces a second-order accurate gradient irrespective of the arrangement of the neighbouring points
6.5.4
Convection Term
88
(6.24)
(6.25)
(6.26)
where fx = f N/P N
Upwind differencing: taking into account the transportive property of
the term: information comes from upstream. No oscillations, but smears
the solution
f = max(F, 0) P + min(F, 0) N
(6.27)
D
f
+
89
Matrix Coefficients
In the convection term, f depends on the values of in two computational
points: P and N.
Therefore, the solution in P will depend on the solution in N and vice
versa, which means weve got an off-diagonal coefficient in the matrix.
In the case of central differencing on a uniform mesh, a contribution for a
face f is
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
6.5.5
Diffusion Term
(n) dS
Sf
f sf ()f
N P
|df |
(6.28)
90
Matrix Coefficients
For an orthogonal mesh, a contribution for a face f is
Diagonal value: aP = f
|sf |
|df |
Off-diagonal value: aN = f
|sf |
|df |
f
P
6.5.6
(6.29)
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.
91
qv ()
(6.30)
Matrix Coefficients
Source and sink terms do not depend on the neighbourhood
Diagonal value created for qd < 0: boosting diagonal dominance
Explicit source contribution: qu
6.6
b P
|db |
(6.31)
92
(6.32)
Use the evaluated boundary value as the face value. This creates a source
and a diagonal contribution
Diffusion term: boundary-normal gb gradient can be used directly. Source
contribution only
Mixed Condition
Combination of the above
Very easy: times Dirichlet plus (1 ) times Neumann.
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 scalars, the surface-normal gradient is zero
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 components
Cyclic, Periodic and Other Coupled Conditions
Cyclic and periodic boundary conditions couple near-boundary cells to cells
on another boundary
A coordinate transformation is applied between the two sides: N to N and
vise-versa; the rest of the discretisation is performed as if this is an internal
face of the mesh
93
P
y
x
6.7
Time-Marching Approach
Time Advancement
Having completed the discretisation of all operators we can now evolve the
solution in time
There are two basic types of time advancement: Implicit and explicit
schemes. Properties of the algorithm critically depend on this choice, but
both are useful under given circumstances
There is a number of methods, with slightly different properties, e.g. fractional step methods,
Temporal accuracy depends on the choice of scheme and time step size
Steady-state simulations
If equations are linear, this can be solved in one go!
For non-linear equations or special discretisation practices, relaxation
methods are used, which show characteristics of time integration (we
are free to re-define the meaning of time
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: information 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
Implicit Schemes
The algorithm is based on the method: each term is expressed in matrix
form and the resulting linear system is solved
A new solution takes into account the new values in the complete domain:
ideal for elliptic problems
Implicitness removed the Courant number limitation: we can take larger
time-steps
Substantial additional storage: matrix coefficients!
6.8
Equation Discretisation
6.9
6.10
Examples
Chapter 7
Algebraic Linear System and
Linear Solver Technology
7.1
Matrix Assembly
Assembling the terms from the discretisation method
Time derivative: depends on old value
Convection: u provided; f depends on P and N
Diffusion: sf ()f depends on P and N
Thus, the value of the solution in a point depends on the values around
it: this is always the case. For each computational point, we will create an
equation
X
aP P +
aN N = r
(7.1)
N
96
(7.2)
(7.4)
where [A] contain matrix coefficients, [] is the value of P in all cells and
[r] is the right-hand-side
[A] is potentially very big: N cells N cells
This is a square matrix: the number of equations equals the number of
unknowns
. . . 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
What about non-linearity?
7.2
97
98
}
}
Good for cases where coefficients are present in each row
Symmetric matrix cannot be recognised easily
Arrow format. Arbitrary sparse format. Diagonal coefficients typically
stored separately
Coefficients stored in 2-3 arrays: diagonal, upper triangle, lower triangle (if needed)
Diagonal addressing implied
Off-diagonal addressing stored in 2 arrays: owner or row index array
and neighbour or column index array. Size of addressing arrays equal
to the number of off-diagonal coefficients
The matrix structure (fill-in) is assumed to be symmetric: presence of
aij implies the presence of aji
If the matrix coefficients are symmetric, only the upper triangle is
stored a symmetric matrix is easily recognised and stored only half
of coefficients
Coding [b] = [A] [x] with arrow addressing
vectorProduct(b, x)
{
int c0, c1;
for (int n = 0; n < coeffs.size(); n++)
{
c0 = owner(n);
c1 = neighbour(n);
b[c0] = upperCoeffs[n]*x[c1];
b[c1] = lowerCoeffs[n]*x[c0];
}
}
Matrix Format and Discretisation Method
Relationship between the FV mesh and a matrix:
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
99
7.3
100
7.3.1
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 becomes triangular. The elimination step is followed by backwards substitution to obtain the solution.
Pivoting: in order to control the discretisation error, equations are chosen
for elimination based on the central coefficient
Combination of matrix rows leads to fill in
Gaussian elimination is one of the cases of I-L-U decomposition solvers and
is rarely used in practices
The number of operations in direct solvers scales with the number of equations 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
Window approach: modern implementation of direct solvers
Looking at the structure of the sparse system, it can be established
that equation for P depends only on a small subset of other nodes:
in principle, it should be possible to eliminate the equation for P just
by looking at a small subset of the complete matrix
If all equations under elimination have overlapping regions of zero offdiagonal coefficients, there will be no fill-in in the shared regions of
zeros!
Idea: Instead of operating on the complete matrix, create an active
window for elimination. The window will sweep over the matrix,
adding equations one by one and performing elimination immediately
The window matrix will be dense, but much smaller than the complete
matrix. The triangular matrix (needed for back-substitution) can be
stored in a sparse format
102
The window approach may reduce the cost of direct solvers by several orders 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
Implementing Direct Solvers
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 ordering of equation. Special optimisation software is used to control the
window size: matrix renumbering and ordering heuristics
Example: ordering of a Cartesian matrix for minimisation of the band
Most expensive operation in the multi-frontal solver is the calculation of
the Schurs complement: the difference between the trivial and optimised
operation can be a factor of 10000! In practice, you will not attempt this
(cache hit rate and processor-specific pre-fetch operations)
Basic Linear Algebra (BLAs) library: special assembly code implementation for matrix manipulation. Code is optimised by hand and sometimes
written specially for processor architecture. It is unlikely that a handwritten code for the same operation achieves more than 10 % efficiency of
BLAs. A good implementation can now be measured in how much the code
spends on operations outside of BLAs.
7.3.2
Iterative solvers
Performance of iterative solvers depends on the matrix characteristics.
The solver operates by incrementally improving the solution, which leads to
the concept of error propagation: if the error is augmented in the iterative
process, the solver diverges
The easiest way of analysing the error is in terms of eigen-spectrum of
the matrix
One categorisation of iterative solvers is based on their smoothing characteristics:
103
(7.5)
(7.6)
N
X
|aij | ; j 6= i
(7.7)
j=1
N
X
|aij | ; j 6= i
(7.8)
j=1
Residual
Matrix form of the system we are trying to solve is
[A][] = [r]
(7.9)
104
(7.10)
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
[]
Iterative solvers start from an approximate solution []0 and generates a
set of solution estimates []k , where k is the iteration counter
Quality of the solution estimate is measured through a residual, or error
e:
[e] = [r] [A][]k
(7.11)
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
||r|| =
N
X
|rj |
(7.12)
j=1
In CFD software, the residual norm is normalised further for easier comparison between the equations etc.
Convergence of the iterative solver is usually measured in terms of residual
reduction. When
||rk ||
<
||r0||
(7.13)
105
7.3.3
Algebraic Multigrid
106
107
7.4
Solver Performance
Time spent in the solvers is a significant amount of the total simulation
time. Therefore, efficiency of solvers and choice of algorithm is critical for
the overall performance
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
109
between a number of CPUs, with each CPU responsible for its own part
Problem decomposition can be done in several ways
Algorithmic decomposition, or decomposition over the numerical
procedure, with each CPU being responsible for its own part of the
algorithm
Decomposition over time steps or Time decomposition
Domain decomposition, where each CPU is responsible for its part
of the computational domain
Fine-grain decomposition decomposes the solver on a loop-by-loop basis:
typically done by the compiler
A critical part of the parallel solution approach is to ensure that every
CPU has approximately the same amount of work; otherwise, CPUs end
up waiting for each other
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
In direct solvers, the problem is more serious: multiple solution windows
can propagate the solution front independently on each CPU, but problems
arise when two windows on two separate CPUs need to merge
110
Chapter 8
Solution Methods for Coupled
Equation Sets
8.1
Nature of Coupling
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. Example: change of viscosity in the fluid flow equations. Typically, such changes
are described in terms of dimensionless groups, e.g. Reynolds number Re
In principle, difficult systems of equations encompass a large range of space
and time-scales. In fact, the equations are not the culprit: we are trying to
assemble the solution on an inappropriate scale
Inappropriate scale is usually chosen for efficiency: the actual scale of the
physical phenomenon may be very fast and lead to extremely long simulation times
Example: chemical reactions in fully premixed flames
8.2
In the next paragraphs, we shall review several mathematical models from the
point of view of equation interaction.
112
(8.1)
Darcys law, combined with the mass conservation equation for the incompressible liquid creates the Laplace equation which controls the system
(p) = 0
(8.2)
(8.3)
where
xx 0
0
= 0 yy 0
0
0 zz
(8.4)
(8.5)
(8.6)
and
=
1
d + (d)T
2
(8.7)
113
(8.8)
Continuity equation:
u = 0
(8.9)
+ (u) = 0
t
(8.10)
Momentum equation:
2
(u)
T
+(uu) u + (u)
= g P + u (8.11)
t
3
Energy equation:
(e)
2
+ (eu) (T ) = gu (P u)
(u) u
t
3
(8.12)
T
+ u + (u) u + Q,
Equation of state
= (P, T )
(8.13)
(8.14)
(8.15)
114
k Turbulence Model
Solution variables: turbulence kinetic energy k and its dissipation
k-equation:
k
+ (u k) (t k) = G ,
t
(8.16)
with
k2
t = C
G = t [u + (u)T ] : u
(8.17)
(8.18)
-equation:
2
+ (u ) (t ) = C1 G C2 ,
t
k
k
(8.19)
Chemical Reactions
Example set of chemical reactions
3 C1 C2 + 2 C3 + 9 H
C2 AH + 2 H
15 C3 2 C12 A7 + C2 + 21CH + 66H
(8.20)
(8.21)
(8.22)
Ei
Si (T ) = A exp
RT
(8.26)
8.3
115
We shall review the options of handling the coupled vector variables or coupled
equation sets in a numerical solution algorithm.
Coupled solution algorithms are designed to handle systems of equations in
the most efficient way possible
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 handle the coupling algorithmically whenever possible
Numerically well behaved terms help with the stability of discretisation
Time derivative: inertial behaviour
Diffusion: smoothing: no new minima or maxima are introduced
Convection: coordinate transformation
Linear and bounded sources and sinks: control of boundedness
8.3.1
Segregated Approach
116
Under-Relaxation
In order to improve the convergence, we sometimes use under-relaxation.
Here, only a part of the correction is added, potentially slowing down convergence but increasing stability
Types of under-relaxation
Explicit under-relaxation: when a new solution p is obtained, the
value for the next iteration will only use a part of the correction
new = old + (p old )
(8.27)
N
When convergence is reached P = old
P and the two terms cancel out
The form of under-relaxation is equivalent to time-stepping, but the
time step size is not equal for all cells in the mesh
Note that under-relaxation may sometimes be counter-intuitive or slow
down the solution process.
8.3.2
Block Matrix
For cases of strong coupling between the components of a vector, the components 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
117
8.4
S
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
(8.30)
119
Scalar-Implicit Coupling
In scalar implicit coupling, components of m at P do not depend on each
other. Thus, AP and AN is a diagonal tensor:
axx 0
0
A = 0 ayy 0
(8.32)
0
0 azz
In most terms
axx = ayy = azz = a
(8.33)
A = aI
(8.34)
or
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
This leads towards a segregated method: we have three independent equations written together. Lack of off-diagonal coefficients indicate the absence
of component-to-component coupling
Example of scalar coefficient terms: temporal derivative, diagonal and offdiagonal of convection and diffusion with scalar diffusivity
Block-Point Implicit Coupling
In block-point implicit coupling the components of a vector variable m
depend on each other in the same computational point, but each individual component depends only of the neighbouring value of the same
component
Thus:
In point P , mx depends on self, my and mz . Thus, the diagonal
coefficient ap would be a full 3 3 matrix
(8.35)
120
axx 0
0
AN = 0 ayy 0
(8.36)
0
0 azz
As before, in most cases, the diagonal components are identical.
AN = a I
(8.37)
axx 0
0
AP = 0 ayy 0
(8.38)
0
0 azz
and
(8.39)
Such cases are relatively rare and typically appear from tensorial diffusion
problems and in some cases of rotational coupling
Full Block Coupling
In full block coupling, each component of m depends on all other components both in the local and neighbouring computational points. Thus, both
the diagonal and off-diagonal coefficient take full tensor form:
121
U = u
e
(8.42)
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, components of AP and AN depend on the solution itself, thus creating a nonlinear system
Standard methods, line the Newton linearisation require the evaluation of
the Jacobian, which is complex and costly. In reality, simple linearisation
is used most often: evaluate AP and AN based on the current value of u
and re-calculate u.
Saddle Block Systems
A system of equations central to our interest (incompressible Navier-Stokes
equations) has a worrying property: wrong equations!
122
(8.43)
Continuity equation:
u = 0
(8.44)
[Au ] [(.)] u
0
=
(8.45)
[(.)]
[0]
p
0
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 equation solver, making it extremely expensive. We shall look for cheaper and
faster solution methods
In compressible flows, the density-pressure relationship replaces the zero
diagonal block. However, as we approach the incompressibility limit, the
system approaches the saddle point form
8.5
123
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
For directed resistance, may be different in different directions, but the
above still holds
Linear Stress Analysis
The equation is linear and easy to solve. No convection term = symmetric
matrix
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
Note that a segregated solution approach is very detrimental in this case.
This would imply decoupling the vector components of d and lagging crosscomponent coupling. As a result, an initially linear problem is nonlinearised, potentially massively increasing solution cost
Incompressible Navier-Stokes
Velocity coupled to itself: non-linear convection term
Pressure coupled to velocity in a linear way
Notes on the form of the pressure
Stress term is modelled using the velocity gradient u
Pressure is the spherical part of the stress tensor
The continuity equation specifies the condition on the divergence of
velocity, which is the trace of the gradient tensor
Thus, the role of the pressure is to make sure the velocity is divergence
free
Simple solution methods will not work due to a zero diagonal block in
pressure equations: need specialised pressure-velocity coupling algorithms
124
Compressible Navier-Stokes
Complex coupling:
Density appears in the momentum equation and velocity in the continuity equation
Compressibility effect (speed of sound) changes the nature of the densitymomentum coupling
energy affects density through the equation of state, with feed-back
both directly through the density and the momentum
Close coupling between the equations recognised in the block form. Rewriting the same equations to emphasise strong coupling:
U
+ F V = 0
t
(8.46)
U = u
e
(8.47)
u
F = uu + pI
(e + p)u
0
V =
u q
(8.48)
(8.49)
The above emphasises the fact that the face flux of the system (mass, momentum, 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 atmospheric conditions) is of the order of 5 105 kg/m3 at mean density of
1.176829 kg/m3 , which causes numerical problems
Note that in the limit of incompressibility, decoupling between density and
pressure complicates the numerical approach
125
k Turbulence Model
Both equations source-dominated, with relatively short time-scales: turbulence 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 sourcedominated. This makes them easy to solve: local effect
Equation coupling is highly non-linear. Generation term
k2
G = C [u + (u)T ] : u
2
S = C1 G C2 ,
k
k
Note various k 2 and 2 terms in the equations!
(8.50)
(8.51)
126
8.6
Part III
Numerical Simulation of Fluid
Flows
Chapter 9
Governing Equations of Fluid
Flow
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 characteristics (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.
9.1
+ (u) = 0
t
(9.1)
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:
2
(u)
T
= g P + u (9.2)
+ (uu) u + (u)
t
3
130
Substantial derivative
Non-linear convection term: (uu). This terms provides the wealth
of interaction in fluid flows
Diffusion term contains viscous effects
Energy equation:
2
(e)
+ (eu) (T ) = gu (P u)
(u) u
t
3
(9.3)
T
+ u + (u) u + Q,
(9.4)
(9.5)
(9.6)
Properties of real gasses and liquids rarely used in tabular form. Instead, 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
9.2
131
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
Speed Range
low subsonic
high subsonic
transonic
supersonic
hypersonic
Mach Number
< 0.3
0.3 0.6
0.6 1.1
15
>5
132
Supersonic Flow
Boundary conditions are typically supersonic, with pockets of subsonic flow.
Subsonic regions are usually captured close to walls or moving obstacles
Hypersonic Flow
On very high speed, simple formulation of the equation of state breaks down
and more complex laws are needed
Apart from increasingly complex equation of state, the flow is basically
supersonic, with the same limitations on the specification of boundary conditions
Forms of equation of state:
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
In engineering machinery, this flow regime is achieved by dropping the speed
of sound (rarefied gas), or in space vehicle re-entry aerodynamics
9.3
Steady-State or Transient
133
9.4
Incompressible Formulation
Decoupling dependence of density on pressure, also resulting in the decoupling of the energy equation from the rest of the system
Equations can be solved both in the velocity-density or velocity-pressure
formulation
Velocity-density formulation does not formally allow for Ma = 0 (or
c = ), but formally this is never the case. In practice, matrix preconditioning techniques are used to overcome zero diagonal coefficients
Velocity-pressure formulation does not suffer from low-Ma limit, but
performs considerably worse at high Ma number
9.5
u
+ (uu) (u) = p
t
(9.7)
u = 0
(9.8)
Inviscid Formulation
134
9.6
9.7
Turbulent Flow
Navier-Stokes equations represent fluid flow in all necessary detail. However, the span of scales in the flow is considerable
Nature of turbulent flow is such that it is possible to separate the mean
signal from turbulence interaction
Example: turbulent flow around Airbus A380
Largest scale of interest is based on the scale of engineering machinery:
overall length (79.4 m), wing span (79.8 m). In practice, wake behind
the aircraft is also of interest
In turbulent flows, energy is introduced into large scales and through
the process of vortex stretching transferred into smaller scales. Most
dissipation of turbulence energy into heat happens at smallest scales
The size of smallest scale of interest is estimated from the size of a
vortex which would dissipate the energy it contains in one revolution.
The scale depends on Re number, but an estimate would be obtained
from the Kolmogorov micro-scale:
=
41
(9.9)
135
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
p = p + p
(9.10)
(9.11)
9.7.1
Main source of comparison data for simple and canonical flows (e.g. homogenous isotropic turbulence, incompressible and compressible turbulent
boundary layer, simple geometries)
DNS has completely replaced experimental methods at this level because it
provides complete information and numerics has proven sufficiently accurate
Current push towards compressible flows and simple chemical reactions,
e.g. interaction between turbulent mixing and flame wrinkling in premixed
combustion
Typical level of discretisation accuracy: 6th order in space and 10th order
in time. Critical for accurate high-order correlation data
Extremely expensive simulations: pushing the limits of computing power
136
9.7.2
Reynolds Averaging
Reynolds averaging removes a significant component of unsteady behaviour:
all transient effects that can be described as turbulence are removed by
the manipulation of equations
Note that u and p are still time-dependent (separation of scales): time
dependent RANS
It is now possible to solve directly for the properties of engineering interest:
mean flow field, mean drag etc. For cases which are 2-D in the mean, it
makes sense to perform 2-D simulations irrespective of the nature of turbulence
A turbulence model is required for closure: describe the effect of sub-grid
scales on the resolved flow based on resolved flow characteristics
This is a substantial reduction in simulation cost and has allowed the adoption industrial of CFD. RANS models are the mainstay of industrial CFD
and likely to remain so until the next change in computing power of approximately 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
t
(9.12)
u = 0
(9.13)
(9.14)
R = t u + (u)T
(9.15)
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 lengthand time-scale
137
9.7.3
The first step in Large Eddy Simulation (LES) modelling approach is the separation of the instantaneous value of a variable into the resolved and unresolved
(modelled) component.
Mathematical Machinery
Scale separation operation is achieved through filtering. Imagine a separation of space into small pockets of space and performing local averaging.
Averaging operation is mathematically defined as:
Z
u = G(x, x ) u(x )dx ,
(9.16)
where G(x, x ) is the localised filter function. This can be interpreted as
a local spatial average
Effect of filtering the Navier-Stokes equations is very similar to the Reynolds
averaging, but the meaning of the filtered values is considerably different
Simulations remains 3-D and unsteady, with the need for averaging. However, 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 +
t
(9.17)
138
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)
Chapter 10
Pressure-Velocity Coupling
In this chapter, we shall examine the nature of pressure-velocity coupling and
review numerical algorithms to handle fluid flow equations in the most efficient
manner. The algorithms can be divided into pressure- and density- based algorithms, with segregated and coupled solution methods.
10.1
(10.1)
140
Pressure-Velocity Coupling
(10.2)
Note: this is a scalar field equation in spite of the fact that u is a vector
field!
Pressure Momentum Interaction
Counting the equations and unknowns, the system seems well posed: 1
vector and 1 scalar field governed by 1 vector and 1 scalar equation
Linear coupling exists between the momentum equation and continuity.
Note that u is a vector variable governed by the vector equation. Continuity
equation imposes an additional criterion on velocity divergence (u). This
is an example of a scalar constraint on a vector variable, as u is a scalar
Non-linear u u interaction in the convection is unlikely to cause trouble:
use an iterative solution technique. In practice
(uu) (uo un )
(10.3)
(10.4)
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)
postulating the equivalence between the mechanical and thermodynamic
pressure. Therefore, the pressure term is related to the tr(u) = u,
which appears in the continuity equation. In other words, pressure distribution should be such that the pressure gradient in the momentum equation
enforces the divergence-free condition on the velocity field.
If the pressure distribution is known, the problem of pressure-velocity coupling is resolved. However, it is clear that pressure and velocity will be
closely coupled to each other.
10.2
Density-Based Algorithm
In previous lectures, we have shown a block coupled form of the densitybased flow solver. Noting that all governing equations fit into the standard
form and all variables are fully coupled, the compressible Navier-Stokes
system can be written as:
U
+ F V = 0
t
(10.6)
U = u
e
(10.7)
u
F = uu + pI
(e + p)u
(10.8)
142
Pressure-Velocity Coupling
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 35Pa can drive considerable
flow; however, in this case, the pressure gradient will dominate. As shown
before, this implies a density change of approximately 5 105 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 105 , 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)
(10.10)
Here, R is the convection-diffusion residual residual (A higher-order timeintegration technique may also be used)
This leads to a fundamentally explicit time-integration method, with
the associated Courant number (Co) limit: time-step is limited by the size
of the smallest cell
143
F = F (UP , UN ) =
(10.11)
(10.12)
(uu+pI)
A = (u)
(10.13)
((e+p)u)
(e)
144
Pressure-Velocity Coupling
Full Approximation Storage (FAS) Multigrid performs this process on several levels simultaneously, using a hierarchy of corse grids.
This allows us to use a very large Co number (100 1 000 or higher)
without falling foul of the Co criterion: significant part of information
transfer occurs on coarse grids without violating the stability criterion
Additional complication in multigrid simulation is the requirement for
a hierarchy of coarse grids for the geometry of interest. Additional
problems, related to the geometric representation and specification of
boundary conditions on coarse grids
In practice, coarse grids are assembled be agglomerating fine grid cells
into clusters
10.3
Rationale
We have shown there exists a fundamental limitation of density-based solvers
close to the incompressibility limit. At the same time, based on the flow
classification based on Ma number, for Ma < 0.3 the compressibility effects
are negligible. This covers a large proportion of flow regimes
Idea: assemble the solution algorithm capable of handling the low Mach
number limit and extend it to compressible flow. Formally, such a method
should be able to simulate the flow at all speeds
A critical part here is handling the incompressibility limit: this is what we
will examine below
Block Pressure-Momentum Solution
Looking at basic discretisation techniques, we can handle the momentum
equation without any problems, apart from the pressure gradient term. If
pressure were known, its gradient could be easily evaluated; however, we
need to create an implicit form of the operator
The same applies for the velocity divergence term with an additional complication: u needs to be expressed in terms of pressure as a working
variable
This technique leads to the saddle-point system mentioned above
10.3.1
Repeating the discretisation of the gradient and divergence term given above, we
shall now repeat the procedure, attempting to assemble an implicit form
145
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
It still remains to evaluate the face value of . Consistently with secondorder discretisation, we shall assume linear variation between P and N
f = fx P + (1 fx )N
(10.15)
(10.16)
where
aN =
1 fx
sf
VP
(10.17)
aP =
(10.18)
and
f
fx sf
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
The divergence operator is assembled in an equivalent manner. A divergence of a vector field u is evaluated as follows:
Z
I
X
u dV =
nu dS =
sf u
(10.19)
VP
146
Pressure-Velocity Coupling
aN uN
(10.20)
where
aN =
1 fx
sf
VP
(10.21)
aP =
(10.22)
and
fx sf
VP
Note that the coefficients are equivalent to the gradient operator, but here
we have the inner product of two vectors, producing a scalar
10.3.2
10.4
147
10.4.1
A B
(10.23)
C D
This structure will arise naturally when trying to solve a block system of
equations
Ax + By = a
Cx + Dy = b
(10.24)
(10.25)
The Schur complement arises when trying to eliminate x from the system
using partial Gaussian elimination by multiplying the first row with A1 :
A1 Ax + A1 By = A1 a
(10.26)
x = A1 a A1 By.
(10.27)
and
(10.28)
148
Pressure-Velocity Coupling
Let us repeat the same set of operations on the block form of the pressurevelocity 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
Formally, this leads to the following form of the pressure equation:
[(.)][A1
u ][(.)][p] = 0
(10.30)
Here, A1
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 [A1
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:
[Au ] = [Du ] + [LUu ],
(10.31)
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:
[LUu ][u]
[Du ] [(.)] u
(10.32)
=
0
p
[(.)]
[0]
A revised formulation of the pressure equation via a Schurs complement
yields:
[(.)][Du1 ][(.)][p] = [(.)][Du1 ][LUu ][u]
(10.33)
149
auN uN = r p
(10.34)
For simplicity, we shall introduce the H(u) operator, containing the offdiagonal part of the momentum matrix and any associated r.h.s. contributions:
X
H(u) = r
auN uN
(10.35)
N
(10.36)
uP = (auP )1 (H(u) p)
(10.37)
and
Substituting the expression for uP into the incompressible continuity equation u = 0 yields
(10.38)
150
Pressure-Velocity Coupling
(10.39)
(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:
F = (auP )1 sf p + (auP )1 sf H(u)
(10.41)
|sf |
(pN pP ) = apN (pN pP )
|d|
(10.42)
|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)
10.4.2
SIMPLE Algorithm
This is the earliest pressure-velocity coupling algorithm: Patankar and
Spalding, 1972 (Imperial College London)
SIMPLE: Semi-Implicit Algorithm for Pressure-Linked Equations
Sequence of operations:
1. Guess the pressure field p
2. Solve the momentum equation using the guessed pressure. This step
is called momentum predictor
auP uP = H(u) p
(10.43)
151
3. Calculate the new pressure based on the velocity field. This is called
a pressure correction step
(10.45)
5. Repeat to convergence
Corrected velocity field may be obtained by substituting the new pressure
field into the momentum equation:
uP = (auP )1 (H(u) p)
(10.46)
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)
u = u + U (u u )
(10.48)
and
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
1 U u
auP
uP = H(u) p +
aP uP
U
U
(10.49)
(10.50)
(10.51)
(10.52)
152
Pressure-Velocity Coupling
(10.53)
(10.54)
10.4.3
PISO Algorithm
153
(10.55)
4. Calculate the new pressure based on the velocity field. This is called
a pressure correction step
(10.57)
6. Explicitly update cell-centred velocity field with the assembled momentum coefficients
uP = (auP )1 (H(u) p)
(10.58)
154
Pressure-Velocity Coupling
10.4.4
Checkerboarding Error
As shown above, the derived form of the pressure equation contains a
Laplace operator
155
In both cases, the (auP )1 or [Du1 ] acts as a diffusion coefficient and can be
safely neglected as a pre-factor
The matrix equivalent can, as a triple product be read as follows:
Create the discretisation for the gradient term
Interpolate it to the face (and multiply by the diffusion)
Assemble the divergence term with the interpolated pressure
An equivalent procedure can be seen when taking the (discrete) divergence
of the discretised momentum equation:
uP = (auP )1 H(u) (auP )1 p /.
(10.59)
Here, the last term may require the interpolation of the pressure gradient.
Computational Molecule
The cause of checkerboarding error becomes clear when we examine the
implied discretised form.
A cell-centred gradient is evaluated using the values in neighbouring cells.
Note that for (p)P the cell centre P does not appear in the discretisation
Pressure gradient
156
Pressure-Velocity Coupling
Face interpolated
pressure gradient
157
10.4.5
uy
p
ux
158
Pressure-Velocity Coupling
There exist a pressure-flux formulation but this is beyond our scope at this
time
Collocated Variable Arrangement
The second approach to resolving the staggering problem is to recognise
that the issue boils down to the calculation of the face-based pressure gradient In the original form (above), the face pressure gradient is obtained by
interpolation:
(p)f = fx (p)P + (1 fx )(p)N
(10.60)
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(p)f =
|s|
(pN pP )
|d|
(10.61)
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:
pN pP
u 1
n
(p)f
uf = fx uP + (1 fx )uN + (aP )f n
(10.62)
|d|
Here, (auP )1
f is the face interpolate of the diagonal coefficient of the
is a unit-normal vector in the direction of intermomentum equation, n
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:
(p)f = fx (p)P + (1 fx )(p)N
(10.63)
159
Face-normal gradient
(p)f =
n
pN pP
|d|
(10.64)
10.4.6
(10.65)
160
Pressure-Velocity Coupling
(10.66)
This condition should be satisfied for each cell and for the domain as a
whole
Looking at the formulation of the pressure-velocity system in incompressible
flows, we can establish that the absolute pressure level does not appear in
the equations: it is the pressure gradient that drives the flow
In some situations it is possible to have a set of boundary conditions where
the pressure level is unknown from its boundary conditions. In such cases,
two corrections are needed:
Undeterminate pressure level implies a zero eigen-value in the pressure
matrix. In order to resolve such problems, the level of pressure will be
artificially fixed in one computational point
In order for the continuity equation to be satisfied for each cell, it also
needs to be satisfied for the complete domain. When a pressure level
is fixed by a boundary condition, global continuity will be enforced as
a part of the pressure solution. However, when this is not the case,
one needs to explicitly satisfy the condition after solving the pressure
equation.
Adjusting global continuity
1. Sum up the magnitude of all fluxes entering the domain
X
Fin =
|F |; F < 0
(10.67)
(10.68)
Chapter 11
Compressible Pressure-Based
Solver
11.1
In this Chapter we shall repeat the derivation of the pressure-based solver for
compressible flows. The idea of a behind the derivation is that a pressure-based
algorithm and pressure-velocity coupling does not suffer from singularity in the
incompressible limit and may behave better across the range of speeds. Memory
usage for a segregated solver is also considerably lower than the coupled one,
which may be useful in large-scale simulations.
The issue that remains to be resolved is the derivation of the pressure equation
and momentum-pressure-energy coupling procedure
Compressibility Effects
Compressible form of the continuity equation introduces density into the
system
+ (u) = 0
t
(11.1)
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
RT
where is compressibility:
=
1
RT
(11.2)
(11.3)
162
The principle is the same for more general expressions. In this case, presence of density also couples in the energy equation because temperature T
appears in the constitutive relation
(e)
+ (eu) (T ) = gu (P u)
t
2
(u) u + u + (u)T u + Q,
3
(11.4)
2
(u)
T
+(uu) u + (u)
= g P + u (11.5)
t
3
(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
11.2
(11.7)
uP = (auP )1 (H(u) P )
(11.8)
and
Substituting this into the continuity equation will not yield the pressure
equation directly: we need to handle the density-pressure relation
163
The first step is the transformation of the rate-of-change term. Using the
chain rule on = (p, . . .), it follows:
P
=
t
P t
(11.9)
=
P
(11.10)
Looking at the divergence term, we will substitute the expression for u and
try to present in terms of P as appropriate
(11.11)
The first term is under divergence and we will attempt to convert it into a
convection term. Using = P , it follows:
(11.12)
Fp = (auP )1 H(u)
(11.13)
( P )
+ (auP )1 H(u) P (auP )1 P = 0
t
(11.14)
164
11.3
Pressure-Velocity-Energy Coupling
(11.15)
(11.16)
Pressure equation is derived by substituting the expression for u and expressing density in terms of pressure
( P )
+ (Fp P ) (auP )1 P = 0
t
(11.17)
(11.18)
P
= P
RT
(11.19)
or from the continuity equation. Note that at this stage the face flux (=
velocity field) is known and the equation can be explicitly evaluated for
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
The pressure-velocity coupling issue in compressible flows is identical to its
incompressible equivalent: in order to solve the momentum equation, we
need to know the pressure, whose role is to impose the continuity constraint
on the velocity
165
In the limit of zero Ma number, the pressure equation reduces to its incompressible form
With this in mind, we can re-use the incompressible coupling algorithms:
SIMPLE and PISO
In cases of rapidly changing temperature distribution (because of the changes
in source/sink terms in the energy equation), changing temperature will
considerably change the compressibility . For correct results, coupling
between pressure and temperature needs to be preserved and the energy
equation is added into the loop
Boundary Conditions
We have shown that for incompressible flows boundary conditions on pressure and velocity are not independent: two equations are coupled and badly
posed set of boundary conditions may result in an ill-defined system
In compressible flows, we need to account for 3 variables (, u, e) handled
together. The issue is the same: number of prescribed values at the boundary depends on the number of characteristics pointing into the domain:
Supersonic inlet: 3 variables are specified
Subsonic inlet: 2 variables
Subsonic outlet 1 variable
Supersonic outlet: no variables
Inappropriate specification of boundary conditions or location of boundaries
may result in an ill-defined problem: numerical garbage
11.4
166
Turbulence
Simple turbulence models are based on the Boussinesq approximation, where
t acts as turbulent viscosity. Coupling of turbulence to the momentum
equation is relatively benign: the Laplace operator will handle it without
trouble
In all cases, momentum to turbulence coupling will thus be handled in a
segregated manner
In 2-equation models, the coupling between two equations may be strong
(depending on the model formulation). Thus, turbulence equations may
be solved together keep in mind that only linear coupling may be made
implicit
A special case is Reynolds stress transport model: the momentum equation
is formally saddle-point with respect to R; R is governed by its own equation. In most cases, it is sufficient to handle RSTM models as an explicit
extension of the reduced 2-equation model (note that k = tr(R)). From
time to time, the model will blow up, but careful discretisation usually
handles is sufficiently well
Chemistry and Species
Chemical species equations are coupled to pressure and temperature, but
more strongly coupled to each other. Coupling to the rest of the system is
through material properties (which depend on the chemical composition of
the fluid) and temperature.
Only in rare cases it is possible to solve chemistry in a segregated manner:
a coupled chemistry solver is preferred
The second option is a 2-step strategy. Local equilibrium solution is sought
for chemical reactions using an ordinary differential equation (ODE) solver,
which is followed be a segregated transport step
11.5
Density-Based Solver
Coupled equations are solved together: flux formulation enforces the coupling and entropy condition
167
The solver is explicit and non-linear in nature: propagating waves. Extension to implicit solver is approximate and done through linearisation
Limitation on Courant number are handled specially: multigrid is a favoured
acceleration technique
Problem exist at the incompressibility limit: formulation breaks down
PressureBased Solver
Equation set is decoupled and each equation is solved in turn: segregated
solver approach
Equation coupling is handled by evaluating the coupling terms from the
available solution and updating equations in an iteration loop
Density equation is reformulated as an equation for the pressure. In the
incompressible limit, it reduces to a the pressure-velocity system described
above: incompressible flows are handled naturally
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
Flux calculation is performed one equation at a time, consistent with the
segregated approach. As a consequence, the entropy condition is regularly
violated (!)
Variable Density or Transonic Formulation
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
For low Mach number or variable compressibility flows, it is known in advance that the pressure equation is dominated by the Laplace operator.
Discretised version of it creates a symmetric matrix
In subsonic high-Ma or transonic flows, importance of convection becomes
more important. However, changed nature of the equation (transport is
local) makes it easier to solve
Variable compressibility formulation handles the convection explicitly:
the matrix remains symmetric but total cost is reduced with minimal impact
on accuracy
168
Chapter 12
Turbulence Modelling for
Aeronautical Applications
12.1
170
171
Energy
Taylor scale
Kolmogorov
scale
Energy scales
Inertial range
Dissipation
Wavenumber
172
Turbulence modelling is therefore about manipulating equations and creating closed models in the form that allows us to simulate turbulence interaction under our own conditions. For example, a set of equations describing
mean properties would allow us to perform steady-state simulations when
only mean properties are of interest
We shall here examine three modelling frameworks
Direct Numerical Simulation (DNS)
Reynolds-Averaged Navier-Stokes Equations (RANS), including eddy viscosity models and higher moment closure. For compressible flows with significant compressibility effects, the averaging is actually of the Favre type
Large Eddy Simulation (LES)
12.2
173
12.3
Reynolds Averaging
The rationale for Reynolds averaging is that we are not interested in the
part of flow solution that can be described as turbulent fluctuations:
instead, it is the mean (velocity, pressure, lift, drag) that is of interest.
Looking at turbulent flow, it may be steady in the mean in spite of turbulent
fluctuations. If this is so, and we manage to derive the equations for the
mean properties directly, we may reduce the cost by orders of magnitude:
It is no longer necessary to perform transient simulation and assemble
the averages: we are solving for average properties directly
Spatial resolution requirement is no longer governed by the Kolmogorov
micro-scale! We can tackle high Reynolds numbers and determine the
resolution based on required engineering accuracy
Reynolds Averaged Navier-Stokes Equations
Repeating from above: decompose u and p into a mean and fluctuating
component:
u = u + u
p = p + p
(12.1)
(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 )
t
(12.3)
u = 0
(12.4)
174
(12.5)
(12.6)
2. Add more differential equations, i.e. a transport equation for R, producing Reynolds Transport Models. A note of warning: as we
keep introducing new equations, the above problem will recur. At the
end, option 1 will need to be used as some level of closure
Both options are in use today, but the first one massively out-weights the
second in practicality
12.3.1
Dimensional Analysis
Looking at R, the starting point is to find an appropriate symmetric second
rank tensor. Remember that the terms acts as diffusion of momentum,
appears in the equation under divergence and appears to act as diffusion
Based on this, the second rank tensor is the symmetric velocity gradient S:
R = f (S)
(12.7)
where
S=
1
u + (u)T
2
(12.8)
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 dimensions 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
175
1
(12.9)
R = t u + (u)T
2
and
U
t = A
(12.10)
2
k
1
T
+ (uk) [(ef f )k] = t
(u + u )
t
2
(12.11)
(12.12)
k2
= C
(12.13)
(12.14)
176
Two-Equation Model
Two-equation models are the work-horse of engineering simulations today.
Using the k equation from above, the system is closed by forming an equation for turbulent dissipation and modelling its generation and destruction
terms
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
Two-equation models are popular because it accounts for transport of moth
the velocity and length-scale and can be tuned to return several canonical
results
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
Turbulence kinetic energy equation
k
+ (uk) [(ef f )k] = G
t
(12.15)
where
G = t
1
(u + uT )
2
(12.16)
2
+ (u) [(ef f )] = C1 G C2
t
k
k
(12.17)
Turbulent viscosity
t = C
k2
Reynolds stress
1
T
R = t (u + u )
2
Model constants are tuned to canonical flows. Which?
(12.18)
(12.19)
12.3.2
177
Background
Transport equation for Reynolds stress R = f (u, p) is derived in a manner
similar to the derivation of the Reynolds-averaged Navier-Stokes equation.
We encounter a number of terms which are physically difficult to understand
(a pre-requisite for the modelling)
Again the most difficult term is the destruction of R, which will ba handled
by solving its own equation: it is unreasonable to expect a postulated or
equilibrium length-scale to be satisfactory
Analytical form of the (scalar) turbulence destruction equation is even more
complex: in full compressible form it contains over 70 terms
The closure problem can be further extended by writing out equations for
higher moments etc. but natural closure is never achieved: the number
of new terms expands much faster that the number of equations
Modelling Reynolds Stress Equation
Briefly looking at the modelling of the R and equations, physical understanding of various terms is relatively weak and uninteresting. As a result,
terms are grouped into three categories
Generation terms
Redistribution terms
Destruction terms
Each category is then modelled as a whole
Original closure dates from 1970s and in spite of considerable research efforts, it always contained problems
Currently, Reynolds transport models are used only in situations where
it is a-priori known that eddy viscosity models fails. Example: cyclone
simulations
Standard Closure
Reynolds stress transport equation
2
R
+(uR)[(R t + l )R] = PC1 R+ (C1 1)IC2 dev(P)+W
t
k
3
(12.20)
where
178
(12.21)
k2
(12.22)
1
tr(R)
2
(12.23)
1
tr(P)
2
(12.24)
+ (u) [( t + l )] = C1 G C2
t
k
k
(12.25)
(12.26)
1
tr(P)
2
(12.27)
1
u + (u)T
2
(12.28)
This would represent local equilibrium: compare with equilibrium assumptions for k and above
In cases where the two tensors are not aligned, Reynolds closure results are
considerably better
. . . but at a considerable cost increase: more turbulence equations, more
serious coupling with the momentum equation
12.3.3
179
Near-Wall Effects
180
12.3.4
181
12.4
182
Idea of LES comes from the fact that large-scale turbulence strongly depends on the mean, geometry and boundary conditions, making it casedependent and difficult to model. Small-scale turbulence is close to homogenous 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
In LES we shall therefore simulate the coherent structures and largescale turbulence and model small-scale effects
For this purpose, we need to make the equations understand scale, using 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
Unlike transient RANS, a LES simulation still captures a part of turbulence
dynamics: a simulation must be 3-D and transient, with the results obtained
by averaging
Filtered Navier-Stokes Equations
Equation averaging is mathematically defined as:
Z
u = G(x, x ) u(x )dx ,
(12.29)
(12.30)
u = 0
(12.31)
= (u u u u) + (u u + u , u) + u u = L + C + B
(12.32)
with
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
Sub-Grid Scale (SGS) Modelling
The scene in LES has been set to ensure that single turbulence models work
well: small-scale turbulence is close to homogenous and isotropic
The length-scale is related to the separation between resolved and unresolved scales: therefore, it is related to the filter width
In LES, implicit filtering is used: separation between resolved and unresolved scales depends on mesh resolution. Filter size is therefore calculated
as a measure of mesh resolution and results are interpreted accordingly
Typical models in use are of Smagorinsky model type, with the fixed or
dynamic coefficients. In most models, all three terms are handled together
Advanced models introduce some transport effects by solving a subgrid kequation, use double filtering to find out more about sub-grid scale or create
a structural picture of sub-grid turbulence from resolved scales
Amazingly, most models work very well: it is only important to remove the
correct amount of energy from resolved scales
LES Inlet and Boundary Conditions
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 treatment
Modelling near-wall turbulence A basic assumption of LES is energy
transfer from large towards smaller scales, with the bulk of dissipation taking place in small vortices. Near the wall, the situation is reversed: small
vortices and streaks are rolled up on the wall and ejected into the bulk
184
185
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
It is no longer trivial to look and understand the LES results, especially
in terms of vortex interaction: we typically use special derived fields,
e.g. enstrophy (magnitude of curl of velocity), invariants of the strain
tensor etc.
Looking at LES results takes some experience and patience: data sets
will be very large
12.5
Background
There exists a wide range of turbulence models in various approaches to the
problem. A role of a good engineer is to choose the best for the problem at
hand
Important factors are the goal of simulation, available computer resources
and required accuracy
In what follows, we will give short overview of traditional choices
12.5.1
186
New Challenges
Laminar-to turbulent transition occurs along the airfoil; in multiple airfoil
configuration, upstream components trigger transition downstream
In order to handle transition, new models are being developed (currently:
useless!)
Problematic region is also found around the trailing edge: flow detachment
LES is prohibitively expensive: from steady-state 2-D RANS to unsteady
3-D with averaging
Choice of Models
Zero-equation and one-equation turbulence models for aeronautics
Balwdin-Lomax model, Cebeci-Smith are the usual choices. Spalart-Allmaras
model represents the new generation and across all models the performance is very good
This is a very popular set of cases for low-Re RANS models
2-equation models are also used regularly. A very popular model is the
k because of its performance close the the wall
12.5.2
Background
Bluff body flows (e.g. complete aircraft, automobile, submarine) are considerably more complex, both in the structure of boundary layers and in
the wake
Abandoning local equilibrium: transport of turbulence and length-scale
A standard choice of model would be 2-equation RANS with wall functions.
Currently moving to transient RANS
Choice of Models
k model and its variants; k model represent normal industrial
choice. There are still issues with mesh resolution for full car/aeroplane
aerodynamics: meshes for steady RANS with wall functions can be of the
order of 100 million cells and larger
187
12.6
Future Trends
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
RANS is recognised as insufficient in principle because the decomposition
into mean and fluctuation. Also, models are too diffusive to capture detailed
flow dynamics. Research in RANS is scaled down to industrial support;
everything else is moving to LES
Transient RANS is a stop-gap solution until LES is not available at reasonable cost
DNS remains out of reach for all engineering use, but provides a very good
base for model development and testing
188
Chapter 13
Large-Scale Computations
13.1
Background
13.1.1
Background
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
Other computational fields with similar level of requirements include
Numerical weather forecasting. Currently at the level of first-order
models and correlations tuned to the mesh size. Large facilities and
efforts at the UK Met Office and in Japan
Computational chemistry: detailed atom-level study of chemical reactions from first principles
Global climate modelling. This includes ocean and atmosphere models, vapour in atmosphere and polar ice caps effects. Example: global
climate model facility (Earth Simulator)
190
Large-Scale Computations
191
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 programming or parallel communications algorithms: we wish to know what parallelism 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
13.2
(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
193
phiFace[i] =
0.5*(phiCell[owner[i]] + phiCell[neighbour[i]]);
}
else
{
phiFace[i] =
fx[i]*phiCell[owner[i]]
+ (1 - fx[i])*phiCell[neighbour[i]];
}
}
194
Large-Scale Computations
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
Taking a step back, we may generalise:
A complete simulation can be split into separate bits, where each
bit is given to a separate computer. Solution of separate problems
is then algorithmically coupled together to create a solution of the
complete problem.
Parallel Computer Architecture
Similar to high-performance architecture, parallel computers differ in how
each node (CPU) can see and access data (memory) on other nodes. The
basic types are:
Shared memory machines, where a single node can see the complete memory (also called addressing space) with no cost overhead
Distributed memory machines, where each node represents a selfcontained unit, with local CPU, memory and disk storage. Communication 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)
For distributed memory machines, a single node can be an off-the-shelf
PC or a server node. Individual components are very cheap, the approach
scales well and is limited by the speed of (network) communication. This
is the cheapest way of creating extreme computing power from standard
components at very low price
Truly massively parallel supercomputers are an architectural mixtures of
local quasi-shared memory and fast-networked distributed memory nodes.
Writing software for such machines is a completely new challenge
Coarse- and Fine-Grain Parallelisation
We can approach the problem of parallelism at two levels
195
Subdomain 1
Subdomain 2
Subdomain 3
Subdomain 4
decomposition
196
13.3
Large-Scale Computations
In this section we will review the impact of parallel domain decomposition to various parts of the algorithm. A starting point is a computation mesh decomposed
into a number of sub-domains.
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 surface 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, simulation 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
Parallel Communication Protocols
Today, Message Passing Interface (MPI) is a de-facto standard (http://wwwunix.mcs.anl.gov/mpi/). A programmer does not write custom communications routines. The standard is open and contains several public domain
implementation
On large or specialist machines, hardware vendor will re-implement or tune
the message passing protocol to the machine, but the programming interface
is fixed
197
Modes of communication
Pairwise data exchange, where processors communicate to each other
in pairs
Global synchronisation points: e.g. global sum. Typically executed as
a tree-structured gather-scatter operation
Communication time is influenced by 2 components
Latency, or a time interval required to establish a communication
channel
Bandwidth, or the amount of data per second that can be transferred
by the system
Mesh Partitioning Tools
The role of mesh a partitioner is to allocate each computational point (cell)
to a CPU. In doing so, we need to account for:
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
Handling Parallel Computations and Data Sets
The purpose of parallel machines is to massively scale up computational
facilities. As a result, the amount of data handled and preparation work is
not trivial
Parallel post-processing is a requirement. Regularly, the only machine
capable of handling simulation data is the one on which the computation has
been performed. For efficient data analysis, all post-processing operations
also need to be performed in parallel and presented to the user in a single
display or under a single heading: parallelisation is required beyond the
solver
On truly large cases, mesh generation is also an issue: it is impossible to
build a complete geometry as a single model. Parallel mesh generation
is still under development
198
Large-Scale Computations
13.3.2
Parallel Algorithms
(13.2)
199
f
|df |
(13.3)
200
Large-Scale Computations
Chapter 14
Fluid-Structure Interaction
14.1
Scope of Simulations
202
Fluid-Structure Interaction
Note that the energy equation is solved in all parts in a strongly coupled manner: single equation encompassing all heat transfer physics
From above, it follows that a number of equation sets will be solved together, with some equations covering multiple parts of the domain: Fluidstructure interaction
This does not necessarily involve only fluids and structures: we can speak
of multi-physics or, more accurately: physics!
With this in mind, single-physics simulations are a simplification of a
complete machine, where the influence of other components is neglected or
handled by prescribed boundary conditions
Components of Fluid-Structure Interaction Simulation
In order to perform an FSI simulation, we first need to handle each bit of
physics separately: ideally in a single simulation code
Simulations should be performed side-by-side and allow for coupling effects
Care should be taken to isolate parts of the simulation depending on nature of coupling and engineering judgement. Example: fan-to-afterburner
analysis of a jet engine:
Turbo-fan
Compressor
Fuel supply and injection system
Combustion chambers
Turbine
Afterburner
and
Fluid flow and heat transfer
Structural integrity: thermal and structural stresses
Vibration modes, natural frequencies, modes of excitement
Analysis of the coupling allows us to judge which effects are important and
which should be solved together
203
204
14.2
Fluid-Structure Interaction
Coupling Approach
Level of Coupling
Some level of coupling exists in every physical situation. Engineering judgement decides if coupling is critical for the performance or can be safely
neglected
Level of coupling
Decoupled simulations. Each physical phenomenon can be studied
in isolation, using boundary conditions or material properties to handle
the dependence to external phenomena. Feed-back effects are small or
limited
Explicit coupling approach. Two simulations are executed sideby-side, exchanging boundary data in a stationary or transient mode.
Dynamic coupling effects can be captured, but with uncertainties in accuracy of simulation. Capable of simulating weakly coupled phenomena. This is currently state-of-the-art for industrial fluid-structures
simulations
Implicit coupling: single matrix. Here, multiple physical phenomena are discretised separately and coupling is also described in an
implicit manner. All matrices are combined into a single linear system
and solved in a coupled manner.
Block implicit solution is more stable then in explicit coupling, but
poses requirements on software design: need to access matrix data
directly. Currently used in conjugate heat transfer simulations
Single equation approach. Recognising the fact that equation set
represents identical conservation equation and only governing laws
vary from material to material, we can describe the complete system
as a single equation. Governing equations are rewritten in a consistent
and compatible manner with a single working variable.
Single equation represents closest possible coupling. However, there
are issues with consistency on interfaces and simulation accuracy in
regions of rapidly changing solution (e.g. boundary layers). Resulting
equations are not necessarily known in type or well behaved and may
require special solution algorithms. This mode of coupling is a current
research topic
In many engineering situations, software limitations are a significant factor:
when tools cannot handle all the physics or software design does not allow
choice or level of coupling, we are forced to use simplifications
205
In such cases, engineering judgement is used after the simulation: how can
we interpret the results or study the problem in a decoupled manner
14.3
206
14.4
Fluid-Structure Interaction
Examples
Bibliography