Lecture Notes
Lecture Notes
Dr Aidan Wimshurst
Table of Contents
Disclaimer 3
How To Use This Course 4
Chapter 1: Verification and Validation 5
Chapter 2: Presenting Data 35
011011001001101101000110101111001010101010101100101101001101100100110110
110110010011011010001101011110010101010101011001011010011011001001101101
110110010011011010001101011110010101010101011001011010011011001001101101
011011001001101101000110101111001010101010101100101101001101100100110110
110110010011011010001101011110010101010101011001011010011011001001101101
Disclaimer
011011001001101101000110101111001010101010101100101101001101100100110110
001101100100110110100011010111100101010101010110010110100110110010011011
011011001001101101000110101111001010101010101100101101001101100100110110
011011001001101101000110101111001010101010101100101101001101100100110110
001101100100110110100011010111100101010101010110010110100110110010011011
The exercises, software, code, figures, tables, explanations and equations in this
1 0 0 1 1 0 1 1 0 0 course
1 0 0 1 are
1 0 1for
1 0educational
1 0 0 0 1 1 0 and
1 0 1demonstrative
1 1 1 0 0 1 0 1 0purposes
1 0 1 0 1 only.
0 1 0 1They
1 0 0should
1 0 1 1 not
0 1 0be
0 1used
1011001001101
0 1 0 0 1 1 0 1 1 0 to
0 1analyse,
0 0 1 1 0 design,
1 1 0 1 0accredit
0 0 1 1 0or
1 0validate
1 1 1 1 0real
0 1 scientific
0 1 0 1 0 1/0 engineering
1010110/ 0 1mathematical
01101001101100100110
1 0 0 1 1 0 1 1 0 0 structures
1 0 0 1 1 0 1and
1 0 flow
1 0 0 systems.
0 1 1 0 1 0For
1 1 such
1 1 0 applications,
0 1 0 1 0 1 0 1 appropriate
0 1 0 1 0 1 1 0trained,
0 1 0 1 1qualified
0 1 0 0 1and
1011001001101
accredited (SQEP) engineers / scientists should be consulted along with the
100110110010011011010001101011110010101010101011001011010011011001001101
appropriate documentation and engineering standards. Fluid Mechanics 101 and
0 1 0 0 1 1 0 1 1 0 Dr.
0 1 0Aidan
0 1 1 0Wimshurst
1 1 0 1 0 0 0are
1 1not
0 1 accountable
0 1 1 1 1 0 0 1or0 1liable
0 1 0in
1 0any
1 0 form
1 0 1 for
1 0 0the
1 0use
1 1 of
0 1misuse
001101100100110
1 0 0 1 1 0 1 1 0 0 of
1 0the
0 1 information
1 0 1 1 0 1 0 0contained
0 1 1 0 1 0in1 this
1 1 1 course
0 0 1 0 beyond
1 0 1 0 1the
0 1 0specific
1 0 1 1 educational
0 0 1 0 1 1 0 1and
0011011001001101
0 1 0 0 1 1 0 1 1 0 demonstrative
0 1 0 0 1 1 0 1 1 purposes
0 1 0 0 0 1for
1 0which
1 0 1 1it1 was
1 0 0intended.
1010101010101100101101001101100100110
101001101100100110110100011010111100101010101010110010110100110110010011
010011011001001101101000110101111001010101010101100101101001101100100110
010011011001001101101000110101111001010101010101100101101001101100100110
101001101100100110110100011010111100101010101010110010110100110110010011
010011011001001101101000110101111001010101010101100101101001101100100110
010011011001001101101000110101111001010101010101100101101001101100100110
101001101100100110110100011010111100101010101010110010110100110110010011
010011011001001101101000110101111001010101010101100101101001101100100110
010011011001001101101000110101111001010101010101100101101001101100100110
101001101100100110110100011010111100101010101010110010110100110110010011
010011011001001101101000110101111001010101010101100101101001101100100110
001101100100110110100011010111100101010101010110010110100110110010011011
100110110010011011010001101011110010101010101011001011010011011001001101
001101100100110110100011010111100101010101010110010110100110110010011011
001101100100110110100011010111100101010101010110010110100110110010011011
100110110010011011010001101011110010101010101011001011010011011001001101
001101100100110110100011010111100101010101010110010110100110110010011011
100110110010011011010001101011110010101010101011001011010011011001001101
010011011001001101101000110101111001010101010101100101101001101100100110
100110110010011011010001101011110010101010101011001011010011011001001101
100110110010011011010001101011110010101010101011001011010011011001001101
010011011001001101101000110101111001010101010101100101101001101100100110
100110110010011011010001101011110010101010101011001011010011011001001101
100110110010011011010001101011110010101010101011001011010011011001001101
010011011001001101101000110101111001010101010101100101101001101100100110
100110110010011011010001101011110010101010101011001011010011011001001101
100110110010011011010001101011110010101010101011001011010011011001001101
010011011001001101101000110101111001010101010101100101101001101100100110
How To Use This Course
As you proceed through this course, a series of suggested exercises are provided.
These exercises are intended to improve your understanding of the course material
and should only take five to ten minutes to complete. You can either attempt the
exercises as you read through the course, or at the end of the chapter. The exercises
are not essental but are highly recommended to improve your understanding of the
course material. An example of a suggested exercise is provided below in the red box.
The answers to the exercises can be found in the other PDF document provided
with this course. In addition to the answers, you will find Excel spreadsheets and
python source code that can be used for some of the exercises. For the exercises
where calculation is required, you can use either the Excel spreadsheets or python
code to complete the exercises. The aim of the course is not to develop knowledge
of a specific CFD code or programming language but to learn and understand the
overall process. Therefore, you should use whichever approach is more appealing and
straightforward for you to use. You can even use the equations in the text to write
your own code or scripts if you prefer!
Calculate the area of a right-angled triangle with side lengths of 3m, 4m and 5m.
Hint: The area of a right-angled triangle is half the base length multipled by the
height.
Chapter 1
Verification and Validation
Chapter 1
Verification and Validation
Quantity of Interest ( )
Relative Error
Welcome to my CFD for Professionals course! The aim of this course is to provide you with
some new concepts and skills that you can apply to your CFD simulations to significantly improve
their quality. I anticipate that you may have come across some of the course content before, but
the majority of the content is likely to be new and will be incredibly useful for you. This course
does not cover how CFD codes work, or provide a tutorial for how to carry out specific actions in
a CFD code. It is assumed that you have access to a CFD code and are comfortable with running
CFD simulations with the code. The lessons provided in this course are general and can be applied
to any CFD code. It is left to you to implement the lessons in your own CFD code. If you have
difficulties with implementing the lessons in your CFD code, it is recommended that you either visit
the manual of your CFD code, or contact a representative from the code vendor (ANSYS or Siemens
for example). Now we are ready to begin the course!
I Verification is the process of checking that the CFD model has been setup correctly, with the
correct boundary conditions, equations and parameter values.
I Validation is the process of assessing the accuracy of the results of the model and comparing
these with experimental measurements.
When using a commercial CFD code such as ANSYS Fluent, ANSYS CFX or Star CCM+, the
equations and solution algorithms will have been verified internally by the code vendor (ANSYS or
Siemens for example). Therefore, it can be assumed that the equations and solution algorithms have
been implemented correctly, as described in the user manual/s. Open source codes like OpenFOAM,
Fluidity, SU2 and Code Saturne are also subject to regular verification by the developers. These
verification tasks are published in the release notes and do not need to be repeated by the user.
While the majority of the verification tasks are carried out by the code vendor, the author still
has to carry out verification tasks when carrying out a CFD investigation. These verification tasks
include:
I Checking that the correct boundary conditions have been applied to the model.
I Checking that the correct physical models (turbulence, buoyancy, multi-phase treatment etc.)
have been selected.
I Checking that any additional user-defined functionality has been implemented correctly.
I Checking that the calculation has been run for enough iterations that the residuals have reduced
considerably and the solution has converged.
These verification checks can be carried out by the author themselves (self-checking) or by other
members of the engineering team / research group. The verification process is an essential part
of all CFD investigations, to ensure that the work is free from errors in the model setup. It is
strongly encouraged that the author follows the verification process and guidelines of their company
/ university / institution or industry to ensure that the analysis is free from errors. The verification
process is not the focus of this course and will not be considered further, as it is assumed that the
author has verified their work, following the guidelines of their company / university / institution or
industry.
In addition to verifying that the CFD model has been setup correctly, the CFD model must also
be validated to assess the accuracy of the model. The validation process often involves:
I Comparing the results of the CFD model with experimental measurements, to assess how well
the CFD model computes real quantities that can be measured.
I Comparing the results of the CFD model with the same CFD calculation carried out by different
authors in the literature.
I Running the same CFD model with different turbulence models and other numerical parameters,
to see which models give the closest representation of reality.
I Choosing a turbulence model which was not calibrated for the given application.
As there are many sources of error, it is not clear in what order and how the sources of error should
be considered. This course presents some simple methods that can be used for a first investigation
of the level of accuracy and how to demonstrate this to the reader. Of course, this course is limited
in scope and cannot consider all possible sources of error. Therefore, the methods presented here are
only intended to be used as a starting point and further studies may be required.
Before starting, it should be emphasised that for real life engineering applications the methods
presented in this course are not sufficient on their own to assess the safety and reliability of a system.
The reader should always consult appropriate documentation, engineering standards and
suitably qualified engineering personnel for guidance with real applications. The methods
presented in this course should never be used on their own and are only intended for teaching purposes.
This course is divided into two main chapters. The first chapter discusses methods which can be
used as part of a validation exercise to assess the level of accuracy in a CFD analysis. The second
chapter presents several data presentation techniques, which can be used to clearly present the results
of the CFD analysis to the reader.
I Choosing a turbulence model which was not calibrated for the given application.
These sources of error (and others which are not mentioned) all affect the accuracy of the CFD
solution. If the error arising from each of these sources can be quantified, then the CFD results
can be used with greater confidence. However, it is not straightforward to assess the error in CFD
calculations, as the error from all the sources is combined together in the final CFD solution. The
most straightforward approach to assessing the different sources of error is to consider each of them
independently. This is the approach that will be adopted in this course. The error arising from
the mesh resolution will be considered first, as this source of error is most common. To finish the
chapter, the error arising from the choice of turbulence model and other numerical parameters will
be considered.
Background
Consider a flow quantity φ that is computed by the CFD code. φ could represent velocity, temperature,
pressure or any other variable that is computed by the CFD code. φ will vary in space and time,
throughout the CFD domain. As an example, Figure 1 shows an example of a real temperature profile
at a location in a CFD domain. The temperature profile in Figure 1 has a complicated shape and it
is not possible for the CFD code to compute this function exactly. In CFD codes, the flow variables
vary (at best) linearly across the cells in the mesh. Therefore, the CFD code computes a piecewise
linear approximation to the temperature profile.
Over a small distance x, the real temperature profile φ can be represented by a Taylor Series
expansion:
φ = c0 + c1 x + c2 x2 + c3 x2 + ... (1)
where c1 , c2 , c3 , ... are coefficients that are used to fit the polynomial to the real temperature profile
and x is the distance from the sampling point. A diagram of the Taylor Series expansion is shown in
Figure 2.
Figure 1: An example of a real temperature profile and the piecewise linear solution computed with
a CFD code.
Figure 2: A Taylor Series expansion over a small distance x can be used to represent the real
temperature profile.
The CFD domain is discretised by a mesh of cells. Within these cells, the flow profiles vary (at
best) linearly across the cells. Therefore, over a small distance x, the CFD solution (φCFD ) is:
φCFD = c0 + c1 x (2)
The discretisation error e is the difference between the CFD solution and the real flow profile.
e = φ − φCFD (3)
e = c2 x2 + c3 x3 + c4 x4 ... (4)
Notice that the error is proportional to the distance squared (x2 ). Hence, if the distance is reduced by
1/2, then the error is reduced by a factor proportional to 1/4 (at best). The distance over which the
linear approximation is made in CFD codes is the distance between cell centroids h. Therefore, as the
cell size is reduced, the error can reduce by (at best) a factor proportional to the distance between
cell centroids squared. Hence, ideal CFD solutions are often described as second-order accurate, even
though the variation across the cell is linear. This is equivalent to stating that the order of accuracy
p is equal to 2.
As an example of the discretisation error, Figure 3 shows the velocity profile computed with two
different CFD meshes. The error is the red shaded area between the CFD solution and the real profile.
As the mesh is refined, the error reduces and the CFD solution is a better approximation to the real
profile.
Real
CFD
Error
Figure 3: As the mesh is refined, the discretisation error (shaded in red) reduces. If the variation
across the cell is linear, then the error reduces proportional to h2 where h is the distance between
cell centroids.
I Upwind differencing
I Gradient limiters
An example of how each of these modifications reduces the order of accuracy, will now be provided.
Figure 4 shows a comparison of upwind differencing and central differencing. Upwind differening
and central differencing are interpolation algorithms used by the CFD code to compute the value
at the face centre from the values at the cell centroids. With central differencing, the value at the
face centre is taken as the average of the upstream centroid and the downstream centroid. This
allows the flow variable to vary linearly between the cell centroids. With upwind differencing, the
value at the face centre is only taken from the upstream cell centroid, rather than the average of the
upstream and downstream cell centroids. This results in a variation across the cell which constant,
not linear. Hence, when the mesh is refined, the error no longer reduces proportional to h2 . This
why the majority of CFD codes recommend linear-upwind differencing instead of upwind differencing
for an accurate solution.
Figure 5 shows the variation of turbulent kinetic energy across cells in the mesh. Turbulent kinetic
energy cannot be negative (it is a bounded variable). Hence, even though the computed values at
the cell centroids are positive, the gradient must be limited to prevent a negative value on the cell
face. Gradient limiters reduce the order of accuracy of the solution, as the original linear variation
across the cell is modified.
Figure 6 shows a diagram to illustrate the source of the skewness error. The value at the face
centre is calculated by drawing a line between the cell centroids. By allowing the flow quantity φ to
vary linearly along this line, the value on the face can be interpolated from the cell centroid values
Centroid Centroid
Figure 4: A comparison of 1st order upwind differencing and central differencing. With upwind
differencing, face values are calculated from the values at the upstream centroid. As a result, the
flow variables are constant across the cell, which reduces the order of accuracy of the solution (p).
Turbulent Kinetic Energy
0 0
Figure 5: Gradient limiters reduce the local gradient to prevent solution variables (like turbulent
kinetic energy) from becoming unbounded.
on either side of the face. However, if the face is skewed, this line does not coincide exactly with
the face centre. Hence, interpolating along the line does not calculate the value at the face centre
exactly, and there is a small error. This source of error is called the skewness error. As the mesh is
refined, the overall error will not reduce proportional to h2 , as there is a small error in the calculated
value at the face centre.
Due to upwind differencing, gradient limiters and other sources of reduced accuracy, real CFD
solutions are less than second order accurate (p < 2). The actual order of accuracy will vary on a case-
by-case basis, as all CFD calculations use different meshes and are solved using different numerical
methods. It follows that because gradient limiters, upwind differencing and other numerical methods
affect the order of accuracy, the order of accuracy cannot be determined before the CFD calculations
are carried out. The order of accuracy can only be determined after the CFD calculations have been
carried out. The order of accuracy and the discretisation error are typically calculated as part of a
mesh refinement study. In the next section, the process of carrying out a mesh refinement study will
be described, along with the order of accuracy and discretisation error.
Face
Centre
Cell Centroid
Cell Centroid
Figure 6: The interpolation between cell centroids may not coincide with the face centre when the
mesh is highly skewed. This is called the skewness error and reduces the order of accuracy.
Figure 7: A diagram to show the different methods for calculating the representative length for
different 2D meshes. N is the number of cells in the mesh and Ap is the area of the cell.
where Ap is the area of the cell and N is the number of cells in the mesh. If the cells are uniform
(have the same shape and size), then this formula reduces to h = A1/2 p . Furthermore, if the cells are
1/2
all uniform squares, then this formula reduces to h = 1/N .
For 3D meshes, take the cube root of the cell volume to calculate the representative length instead
1.18 0.72
0 0.004 0.008 0.012 0.016 0.020 0 0.004 0.008 0.012 0.016 0.020
Representative Cell Length (h) [m] Representative Cell Length (h) [m]
Figure 8: An example of mesh convergence plots for lift coefficient and point velocity. The solution
for an infinitely fine mesh (h = 0) is unknown and we do not know the error in the fine mesh.
I How close is the fine mesh to the solution on an infinitely fine mesh (what is the error)?
I How fast are the results converging to the infinitely fine mesh value?
The most popular method of addressing these questions is based on an extrapolation method
proposed by Richardson (1910, 1927). This method is popular in the CFD community and is rec-
ommended by the Journal of Fluids Engineering, amongst others. In the next section, Richardson
Extrapolation will be explained and used to answer the three remaining questions in the list above.
φ = φ0 + c1 h + c2 h2 + c3 h3 + ... (8)
Ideal CFD calculations are second order accurate and φ varies in proportion to h2 . Hence, we could
just use a second order polynomial:
φ = φ0 + c2 h2 (9)
However, real CFD calculations do not achieve second-order accuracy in practice, as discussed in the
previous section. Therefore, the fitting function needs to allow φ to vary at a rate that is lower than
h2 . Hence, it would be better to use a power-law function:
φ = φ0 + chp (10)
where p is a positive real number and c is a constant that is used to fit the function to the data. The
power-law function can be used for the ideal case where p = 2 and also real CFD cases where p is
less than 2. The parameter p is referred to as the order of convergence or the order of accuracy of
the mesh refinement study.
Once the power-law function has been fitted to the mesh refinement study, it can be used to
estimate the solution on an infinitely fine mesh (φ0 ) by extrapolation. However, in order to perform
the extrapolation, the order of convergence (p) must have been calculated. For now, assume that p
is known and we will return to this later on.
To determine φ0 , use the values of φ that have been calculated on the fine and medium meshes.
These values will be referred to as φ1 and φ2 , where the subscript 1 denotes the fine mesh and the
subscript 2 denotes the medium mesh. As φ1 and φ2 are known (they have been calculated in the
mesh refinement study), the power law can be used to write two equations with two unknowns (c
and φ0 ):
1.24 0.80
1.22 0.76
1.20 0.74
1.18 0.72
0 0.004 0.008 0.012 0.016 0.020 0 0.004 0.008 0.012 0.016 0.020
Representative Cell Length (h) [m] Representative Cell Length (h) [m]
Legend
Ideal (p = 2)
Real CFD (p = 1.5)
Real CFD (p = 1.1)
Figure 10: A diagram to demonstrate how the order of convergence (p) affects the mesh
refinement plot.
p
φ1 (r21 − 1) φ1 − φ2
φ0 = p + p (16)
r21 − 1 r21 − 1
φ1 − φ2
φ0 = φ1 + p (17)
r21 −1
This equation allows the solution on an infinitely fine mesh (φ0 ) to be calculated from the solution
on the fine and medium meshes (φ1 and φ2 ). φ0 can then be added to the mesh convergence plots
to give a more complete picture of the convergence behaviour of the solution, as shown in Figure 9.
However, before we can do this, the order of convergence (p) needs to be calculated.
Order of Convergence
Before calculating the order of convergence (p), it is worth understanding the effect of the order of
convergence on the mesh refinement study. Figure 10 shows a comparison of three different mesh
refinement studies, each with a different order of convergence p. As the order of convergence increases
from 1 to 2, the gradient increases and the solution approach the infinitely fine value (φ0 ) faster.
Hence, for the same representative cell length h (the same mesh), the mesh with the higher order
of convergence will give a result that is closer to φ0 (it is more accurate). However, it should be
Ideal (p = 2)
Real CFD (p = 1.5)
Real CFD (p = 1.1)
Figure 11: The shaded error indicates 5% error relative to φ0 . The points indicate the
representative cell length required to achieve an error of less than 5%. Notice that p = 1.1 requires
a much finer mesh to achieve the same accuracy as p = 2.
emphasised that a CFD study with a low order of convergence is not necessarily worse than a CFD
study with a high order of convergence. The most important thing is that the solution is close to
φ0 (the error is small). For a CFD solution with a low order of convergence, the same accuracy can
be achieved but a finer mesh is required. For example, Figure 11 shows the same mesh convergence
studies as Figure 10 but with a shaded region to indicate a 5% error relative to φ0 . The CFD solution
with the lower order of convergence is still able to be achieve a solution that is within 5% of φ0 , but
the representative cell length has to be smaller (the mesh has to be finer).
To determine the order of convergence, start with the general power law function for φ:
φ = φ0 + chp (18)
Take the base-10 logarithm of both sides of the equation:
This is the same form as the general equation of a straight line y = mx + C. Hence, we can
plot φ against h on a logarithmic axis and the gradient gives the order of convergence (p). Generally,
only two points are required to calculate the gradient. Hence, only two meshes (fine and medium)
are required to determine the order of convergence. However, this approach is only sufficient if the
convergence is monotonic. Some quantities may experience oscillatory convergence as the grid is
refined, rather than monotonic convergence. Figure 12 shows a schematic diagram to illustrate the
difference between monotonic and oscillatory convergence.
It is not possible to use the plotting method to determine the order of convergence when the
convergence is oscillatory. For this reason, Celik et al. (2008) propose a more general method to
determine the order of convergence which is applicable to both monotonic and oscillatory convergence.
First determine the difference in the solution between the fine mesh and the medium mesh (21 ) and
the difference in solution between the medium mesh and the coarse mesh (32 ):
Quantity of Interest ( )
Representative Cell Length (h) Representative Cell Length (h)
Monotonic Oscillatory
If the ratio is positive, then 21 and 32 have the same sign the convergence is monotonic. If the
ratio is negative, then 21 and 32 have opposite signs and the convergence is oscillatory. Regardless
of whether the convergence is monotonic or oscillatory, the order of convergence can be calculated
by solving the following two coupled equations proposed by Celik et al. (2008):
rp − s
!
1
p= |ln|32 /21 | + q| q = ln 21
p (22)
ln (r21 ) r32 −s
There are two equations and two unknowns (p and q). A simple method of solving the coupled
equations is to combine them and rearrange into the following form:
rp − s
!
1
ln|32 /21 | + ln 21
p −p=0 (23)
ln (r21 ) r32 −s
This is the general form of a non-linear equation that can be solved with a root finding algorithm
f (p) = 0. Some examples of root finding algorithms that can be used to solve the equation are the
bisection method, secant method and the Newton-Raphson method. The attached python script
and Excel spreadsheets contain a simple bisection method that you can use to solve the non-linear
equation for p. Once the order of convergence has been calculated, return to either equation 14 or 17,
so that the extrapolated value of φ0 can be calculated. Once φ0 and p have both been determined, the
error in the mesh refinement study can be calculated. The calculation of the error will be discussed
in the next section.
φ2 − φ1
e21 = (24)
φ1
This metric is known as the relative error. It is not the most reliable metric for quantifying the
error because it does not account for how close the fine mesh solution is to the infinitely fine mesh
solution (φ0 ). However, as we have used Richardson Extrapolation, an estimate of φ0 is available.
This value can be used to give a better estimate of the error:
Quantity of Interest ( )
Representative Cell Length (h) Representative Cell Length (h)
Figure 13: A graphical comparison of the relative error and the extrapolated relative error.
φ1 − φ0
eextr
21 = (25)
φ0
This metric is known as the extrapolated relative error. It is more useful than the relative error,
as the error is expressed relative to the estimated solution on an infinitely fine mesh, rather than the
difference between meshes that we happened to have created. Figure 13 shows a graphical comparison
of the relative error and the extrapolated relative error, to illustrate the difference. From Figure 13
it is clear that the extrapolated relative error is a better metric to quantify the error in the mesh
refinement study.
In some instances, the author may have not have used Richardson Extrapolation to estimate φ0 .
For these cases, Roache (1994) proposed an alternative measure of the error known as the Grid
Convergence Index (GCI21 ). To derive the formula for GCI21 , start with the following definition for
the error:
φ0 − φ1
GCI21 = (26)
φ1
Eliminate φ0 from this equation by substituting in Equation 17.
!
φ1 − φ2 1
GCI21 = φ1 + p − φ1 (27)
r21 − 1 φ1
φ1 − φ2
GCI21 = p (28)
φ1 (r21 − 1)
We can substitute e21 = (φ1 − φ2 )/φ1 (the relative error) into the equation:
e21
GCI21 = p (29)
−1 r21
By writing the equation in this form, it is clear that GCI21 represents an improvement on the
p
relative error e21 . The relative error is scaled by a factor of 1/(r21 − 1). This scaling accounts for the
order of convergence of the solution, which the definition of the relative error does not. To complete
the definition of the GCI21 , Roache (1994) applies a factor of safety of 1.25:
1.25e21
GCI21 = (30)
rp − 1
Figure 14: A schematic diagram of 2D flow over a backwards facing step, showing the
reattachment length xr .
I Richardson Extrapolation is only able to estimate φ0 . The factor of safety accounts for φ0 only
being an estimate.
I To be useful for real engineering applications, the error estimate should be conservative and
over-predict the real error.
In this Section, three different error estimates have been presented: the relative error e21 , the
extrapolated relative error eextr
21 and the Grid Convergence Index GCI21 . As these metrics are all
estimates, most authors present all three metrics with their mesh sensitivity results along with a
reference to Celik et al. (2008), so that the reader can follow the method if required. In the next
Section, a complete worked example will be provided to demonstrate how the error estimates can be
calculated and presented.
Worked Example
Figure 14 shows a schematic diagram of flow over a backwards facing step. A mesh refinement study
has been carried out to determine the distance downstream of the step where the separation bubble
reattaches (xr ). Three different 2D meshes were used to calculate the reattachment length. All three
meshes are structured and use square elements throughout the entire domain. Table 1 shows the
computed values of the reattachment length and the number of cells in each mesh.
The first stage in the Richardson Extrapolation procedure is to calculate the representative cell
length h for each of the three meshes. As the cells are all 2D uniform squares:
1 1 1
h1 = √ = 0.0074m h2 = √ = 0.0112m h3 = √ = 0.0149m (31)
18000 8000 4500
The refinement ratios for the three meshes are:
Table 2: Results of the mesh sensitivity study for dimensionless reattachment length xr .
0.0112 0.0149
r21 = = 1.50 r32 = = 1.33 (32)
0.0074 0.0112
The refinement ratios are both greater than 1.3, indicating that the meshes are sufficiently different
for a good mesh sensitivity study. The flow quantity of interest (φ) is the dimensionless reattachment
length (xr /H). Hence φ1 , φ2 and φ3 are assigned to the fine mesh, the medium mesh and the coarse
mesh:
φ2 − φ1 φ1 − φ0 e21
e21 = = 1.50% eextr
21 = = 1.71% GCI21 = p = 2.17% (38)
φ1 φ0 r21 −1
The results of the mesh sensitivity study and Richardson Extrapolation procedure are shown in
Table 2 and Figure 15. The results in Table 2 show that the fine mesh is well converged in terms of
the relative error and the GCI21 . As an error of 2.17% is likely to be acceptable for most engineering
studies, the solution on an infinitely fine mesh can be used with confidence. Furthermore, the order
of convergence p is 1.53. While this is less than the ideal order of convergence of 2.0, the order of
)
6.1
Reattachment Length (
6.0
5.9
5.8
0.000 0.005 0.010 0.015 0.020
Representative Cell Length (h) [m]
Figure 15: Results of the mesh sensitivity study for the dimensionless reattachment length xr .
convergence is greater than linear (1.0). Hence, any further mesh refinement is likely to give noticeable
improvements in accuracy and could be worthwhile if the computational cost is reasonable.
Calculate the order of convergence p, relative error e21 , relative extrapolated error eextr
21 and
grid convergence index GCI21 for the following mesh sensitivity study. The mesh is 3D and
uses uniform cube shaped elements.
References
Celik I, Ghia U, Roache P and Freitas C, (2008) ’Procedure for Estimation and Reporting of Uncer-
tainty due to Discretisation in CFD Applications’, Journal of Fluids Engineering, 130(7), 078001.
Richardson L. F. (1910), ’The approximate arithmetical solution by finite differences of physical prob-
lems involving difference equations, with an application to stresses in a Masonary Dam’, Transactions
of the Royal Society of London, Ser. A. 210, pp. 307 - 357.
Richardson L. F. and Gaunt J. A (1927), ’The deferred approach to the limit’, Transactions of the
Royal Society of London Ser. A. 226, pp. 299 - 361.
Roache P. J. (1994), ’Perspective: A method for uniform reporting of grid refinement studies’, Journal
of Fluids Engineering, 116, pp. 405-413.
There is no general consensus for how to assess the remaining source of error. Therefore, a pragmatic
approach will be presented that will be useful for most studies.
∂ (ρk) µt
+ ∇ · (ρU k) = ∇ · µ + ∇k + Pk + Pb − ρ + Sk (39)
∂t σk
∂ (ρ) µt 2
+ ∇ · (ρU ) = ∇ · µ + ∇ + C1 (Pk + C3 Pb ) − C2 ρ + S (40)
∂t σ k k
The empirical coefficients for the standard k − model are shown in Table 3. These coefficients
were calibrated in the original papers to give good performance for a variety of test cases (Jones and
Launder (1972)). However, it is unlikely that your CFD case is the same as one of the test cases
that were used to originally calibrate the turbulence model. Hence, there will be some error in the
CFD calculations and different turbulence models will show better / worse agreement in different
situations.
Quantity of Interest ( )
Experiment
CFD
Figure 16: An example of a completed mesh refinement study. Even with an infinitely fine mesh,
the CFD results do not match the experimental measurements.
Table 3: Model coefficients for the standard k − model (from Jones & Launder (1972).
Experiment
Quantity of Interest ( )
Legend
Experiments
Spalart Allmaras
Figure 17: An example of a completed mesh refinement study. The fine mesh has also been
computed with the k − ω SST and Spalart Allmaras turbulence models.
One approach to address the error would be to modify the model coefficients (such as those in
Table 3) so that the turbulence model gives better agreement with the experimental measurements
in your case. However, calibrating the model coefficients can have unintended consequences and is
not recommended for inexperienced users of CFD. Therefore, turbulence models are usually treated
as ’black boxes’ (a system where only the inputs and outputs are known) and the original coefficients
are not modified.
A simpler approach is to compare different turbulence models side-by-side, as complete units.
Figure 17 shows an example of a completed mesh sensitivity study, where the fine mesh has been
computed with a selection of different turbulence models. In Figure 17, the k − ω SST turbulence
model gives the closest agreement with the experimental measurements. Therefore, it would be
reasonable to select the k − ω SST turbulence model in this investigation.
References
Jones W. and Launder B. ’The prediction of Laminarization with a Two-Equation Turbulence Model’,
Int. J. Heat Mass Transfer, 1972, 15, pp. 301-314.
I Reynolds Stress Transport Models for flows which have high swirl and anisotropy.
I The k − kL − ω and γ − Reθ for flows with laminar and transitional flow regions.
I Large Eddy Simulation (LES) if the calculation is feasible with the available computing re-
sources.
However, these models may not necessarily give better performance than the k − and k − ω SST
models! Make sure to compare the results to the experiments and make the judgement yourself.
3. Make an estimate of the most likely value of the parameter (best estimate).
5. Carry out a CFD calculation with each of these values and record the results.
Figure 18 shows an example of how results can be displayed when there is a degree of uncertainty
in a single parameter. Figure 18 shows the heat transfer coefficient for a hot component for a range
of freestream flow rates. There is a degree of uncertainty in the thermal conductivity of the fluid. To
account for this uncertainty, additional calculations were carried out with the maximum and minimum
values of the thermal conductivity at a flow rate of 2.0 kg/s. The calculated values are shown as
error bars in Figure 18. As an alternative to error bars, the same information could be shown as a
separate plot. Figure 19 shows the results of the same investigation, but with the uncertainty shown
on a separate plot rather than with error bars. The advantage of this approach is that a greater range
of thermal conductivities can be shown on a separate plot. Error bars are limited to only showing
the maximum, minimum and best estimate values. This is not the case with a separate plot, as a
greater range of values can be investigated, if desired. While the majority of CFD authors tend to
prefer error bars, either method can be adopted and this is left to the authors preference.
Max Conductivity
18
17 Min Conductivity
16
15
1.4 1.6 1.8 2.0 2.2
Mass Flow Rate [kg/s]
Figure 18: An example of the heat transfer coefficient for a hot component in a flow driven by a
pump or fan. The uncertainty in the thermal conductivity is shown with error bars.
Heat Transfer Coeff. [W/m2K]
18 18
17 17
16 16
15 15
1.4 1.6 1.8 2.0 2.2 Min Best Guess Max
Mass Flow Rate [kg/s] Thermal Comductivity [W/mK]
Figure 19: An example of the heat transfer coefficient for a hot component in a flow driven by a
pump or fan. The uncertainty in the thermal conductivity is shown in a separate plot.
I The geometry may be too large / too small to be practical for an experiment to be possible.
I It may not be possible to create an experiment at the target Reynolds / Mach / Froude number.
I It may not be possible to take measurements at the points of interest in the flow field.
I The geometry may not have been built / fully designed yet.
If experimental measurements are not available, then it is not possible to directly assess the accuracy
of the CFD results. However, the author can still provide confidence in the CFD results by either
carrying out:
I Similarity Validation
Figure 20: An example of piecewise validation for a novel tidal turbine design. The key
components of a tidal turbine are: the aerofoils, the vertical cylinder and the bluff body
Each of these components can be analysed with a separate CFD calculation, in isolated domains:
2. Flow around a vertical circular cylinder (representing the flow around the support shaft)
These isolated CFD calculations can be compared with experimental measurements (particularly
the aerofoil and circular cylinder) to assess their accuracy, and determine an appropriate level of
mesh resolution. If experimental measurements are not available for the component, then a similar
geometry can be chosen where experimental measurements are available. For example, if experimental
measurements of the aerofoil shape that makes up the blade are not available, then the author could
choose to analyse a similar aerofoil, where experimental measurements are available. As an example
of this substitution, Figure 21 shows the drag coefficient for an aerofoil that is similar to the tidal
turbine blade. In this example, the CFD results over-predict the drag on the 2D aerofoil. It follows
that if the same meshing and turbulence modelling approach is used on the full tidal turbine, the
drag on the blades will also be over-predicted. This is a useful conclusion that can be used to provide
confidence in the CFD analysis of the full tidal turbine.
The key to carrying out a piecewise validation successfully is to be able to break down the CFD
analysis into its essential components. This is a skill which often requires practice and experience!
Figure 22 shows some common components that make up many CFD analyses. You may be surprised
to find that many cases can be broken down into the simple components in Figure 22!
Drag Coefficient [ - ]
0.014
Legend
0.012
CFD
0.01 Experiment
0.008
0 2 4 6 8 10
o
Angle of Attack [ ]
Figure 21: Drag coefficient on an aerofoil section that is similar to the blade profile used in the
tidal turbine.
Similarity Validation
Similarity validation can be used when experimental measurements are not available for the case
of interest but are available for a case that has similar geometry, Reynolds number or operating
conditions. It is common to use similarity validation when:
I Making small design changes to an existing geometry.
I Experimental measurements have been carried out on a scale model of the real geometry.
I There is a well regarded validation case that many authors use for the given application.
Similarity validation is preferred to piecewise validation because:
I The interaction between different components in the CFD analysis is captured.
I Only a single set of calculations is required. You don’t have to carry out separate CFD calcu-
lations for the different parts of the geometry.
As an example, consider the same tidal turbine example that was used in the previous section. If
experimental measurements were available for a complete tidal turbine that was similar to the novel
tidal turbine, then a similarity validation approach could be used. The author could carry out a CFD
investigation of this tidal turbine and compare the results with the experimental measurements. The
results of this investigation would indicate the magnitude of the error (using Richardson Extrapolation)
and an appropriate level of mesh resolution to use for the CFD calculation of the novel tidal turbine.
This approach provides more confidence than the piecewise validation approach, as the interaction
of the swirling flow field around the blades and the vertical support arm is captured. The overall
number of calculations is also reduced as the author does not need separate calculations for the
aerofoil, vertical cylinder and bluff body.
Figure 22: Many CFD cases can be constructed from these key components. Compare your CFD
case against these components, and see if you can identify the key components.
Consider wind flow approaching a tall building with a square cross-section. The wind flow
takes a sheared velocity profile. You are going to use CFD to calculate the drag force
on the building. However, before you do this you would like to do a validation exercise
to estimate the error in the drag and determine an appropriate level of mesh resolution.
Component 1 Component 2
a. Piecewise validation, assuming that you did not have access to experimental measure-
ments of a scale model. Figure 22 might be useful to help you choose the components
of the piecewise validation study.
One of the components in your piecewise validation study is a circular cylinder. You would
like to carry out a CFD investigation of the flow over this cylinder at a Reynolds number of 1
Million (1e6), but you do not have any experimental measurements yourself.
a. How could you obtain some experimental measurements that could be used for validation?
Time Velocity
0.0 2.1
1.0 2.2
2.0 2.3
There are a variety of methods that can be used to post-process and present CFD solution data.
Contour plots, line graphs and tables are the most popular and are sufficient for the majority of CFD
analyses. While the majority of authors are familiar with these techniques, there is little guidance for
how to use these techniques effectively. An effective post-processing technique:
1. Helps the reader understand the physical nature of the solution (what the flow is doing).
If the data is not presented clearly, it can be difficult for the reader to understand the physical nature
of the solution and assess its accuracy.
I Contour plots
I Line plots
I Tables
In each section, some simple methods are covered that can be used to improve the clarity of the
presented data. The methods are general and can be applied to most CFD analyses. Of course, the
methods are not exhaustive and additional methods may be appropriate for different applications.
1. It can be difficult to assess the accuracy of the results from a contour plot.
In this section, some simple techniques will be presented that improve the clarity of contour plots.
Before these techniques are presented, some brief background information will be provided.
Background
Computers use a variety of methods to display colours on screen. One popular method of displaying
colours is the RGB (red, green, blue) colour scheme. In the RGB colour scheme, a vector of 3 values
gives the amount of red, green and blue in a given pixel on the screen. For example, the vector (100,
120, 240) indicates that the pixel contains 100/256 red, 120/256 blue and 240/256 green. This will
be shown on screen as a soft shade of blue.
Open up either Microsoft Word, Excel, PowerPoint, Paint or another suitable program.
Change the colour of a line, text or object to an RGB value of (100, 120, 240), rather than
using the default colour picker.
Hint: You may need to search the internet or consult the software manual to find out
how to do this in some software programmes.
CFD post-processors use a colour map, which is a numerical function that converts the value of
a field variable (a pressure of 10 Pa for example) to a colour code (an RGB value of (100, 120, 240)
for example). The colour code is then used to colour the cell in the mesh that has a pressure of 10
Pa. Repeating this process for all cells in the mesh produces a colourful contour plot, which is shown
on screen.
Different colour maps will produce different colour codes. For example, one colour map may
convert a pressure of 10 Pa to a colour code of (100, 120, 240), which will colour the mesh a soft
shade of blue. Another colour map may convert a pressure of 10 Pa to a colour code of (210, 20,
60), which will colour the mesh a soft shade of red. A diagram to illustrate this process is shown in
Figure 23. The values of the computed pressure field are passed through a colour map and converted
to RGB colour values, which are used to colour the cells in the contour plot.
Field Value
RGB (210,30,60)
Figure 23: A schematic diagram to illustrate how two different colour maps convert field values to
different RGB colour values. This results in contour plots with different colours.
Blue-Red
Rainbow / Jet
Black-Body Radiation
Viridis
Figure 24: Some example colour maps that are available in most post-processors.
the contour plots in the document. When choosing a colour map, the first choice to make is whether
to adopt continuous (smooth) or discrete bands for the colour map. Figure 25 shows a comparison
of contours of static pressure around an aerofoil, with (a) continuous and (b) discrete colour bands.
In aerodynamics, an aerofoil generates lift through the action of negative pressure (suction) on
the top surface and positive pressure on the bottom surface of the aerofoil. Contour plots of static
Figure 25: A comparison of continuous and discrete contour bands. The 0 Pa pressure contour is
easy to pick out with discrete colour bands but difficult with continuous colour bands.
pressure are useful because they can be used to visually observe locations of positive and negative
pressure. In Figure 25, the blue contours indicate negative pressure (suction) and the orange and red
contours indicate positive pressure. The green contours are of particular importance, as they indicate
the transition between positive and negative pressure. With continuous contour bands (Figure 25
(a)), it is difficult to visually pick out the location where pressure transitions from positive to negative.
This is why discrete colour bands are always preferred. They allow the reader to visually pick out
discrete values of the field from the contour plot.
Figure 26: A comparison of the static pressure field around an aerofoil using (a) Rainbow and (b)
Blue-Red colour maps. With the Blue-Red colour map, positive pressure is shown in red and
negative pressure (suction) in shown in blue. In this case, Blue-Red colour map is preferred as it is
easier to identify the 0 pressure contour.
as white is visually different to blue and red. Other variables that are centred around a central value
can also benefit from a diverging colour map. The components of the velocity field (Ux , Uy and Uz )
for example, are implicitly centred around 0 m/s. Positive velocity components indicate that the fluid
is moving in one direction, while negative velocity components indicate that the fluid is moving in
the other direction. As shown in Figure 27, a diverging red-blue colour map is an excellent choice for
velocity components, as red and blue immediately indicate the direction of the flow, while the colour
saturation (strength of the colour) indicates the strength of the velocity field.
Some variables in CFD are not distributed around a central value. Turbulent kinetic energy (k)
and temperature (T ) for example, are distributed continuously and do not have a central value. For
these variables, a diverging colour scheme (like blue-red) does not offer a significant advantage over
other colour maps like rainbow. The authors personal preference can be used for these variables,
as the choice of colour map does not detract significantly from the clarity of the contour plot. For
continuously distributed variables, some authors like to use sequential colour maps. In a sequential
colour map, the colours vary smoothly from one colour to another. These colour maps are useful
because they can be selected to physically represent the variable that is being plotted. For example,
there are many red and yellow based colour maps (heat maps) that are popular for plotting temper-
ature (T ). Inferno, Black Body Radiation and Autumn are three popular examples. Figure 28 shows
a comparison of Rainbow and Black Body Radiation colour maps for the temperature in an enclosed
cavity.
Black and white contour plots have limited use in modern science and engineering. However, some
journal papers and conference proceedings require images and contour plots to be printed in black
and white. For these limited applications, black and white contour plots should be used. Otherwise
there is little justification for black and white contour plots and a colour based contour plots are
always preferred.
Table 4 summarises some common CFD variables and their recommended colour maps.
Figure 27: A schematic diagram to demonstrate how a diverging colour map works for the velocity
field, which is centred around 0 m/s. Red contours indicate that the flow is moving left to right,
while blue contours indicate that the flow is moving right to left.
Temperature Temperature
100 150 200 250 300 100 150 200 250 300
Figure 28: A comparison of the temperature field in an enclosed cavity using (a) Rainbow and (b)
Black Body Radiation colour maps.
levels of 20 Pa. Hence, the reader can count the contour levels in the Figure and establish the static
pressure at any point on the contour plot. Try it for yourself!
Hint: The 60 Pa contour band is below the aerofoil between the 80 Pa and 40 Pa
contour bands. Notice that it is easier to locate the 60 Pa contour band when the labels are
provided.
Some post-processors (like TecPlot 360 for example) can generate contour labels automatically.
If your post-processor does not have this functionality, then you can add the contour labels manually
in an image editing programme (like MS Paint, Inkscape or CorelDRAW) using text boxes.
When you add labels, ensure that the labels are not added on top of the main areas of interest, as
this can block the view. In Figure 29, the labels have been added far away from the aerofoil surface,
so the pressure distribution is still visible.
When generating these Figures, it is essential that the range of the colour bars (the maximum and
minimum levels) are the same. If the colour bars do not use the same range, it can be difficult for
the reader to make a back-to-back comparison of different contour plots in the same Figure. As
an example, Figure 30 shows contours of static pressure on an aerofoil at angles of attack of (a)
0 degrees and (b) 8 degrees. The top set of contours have different ranges for the static pressure,
while the bottom contours have the same range. As the ranges of the top contours are different, the
Original
Image
Pressure (Pa)
Add Labels
-200 -100 0 100 200
Manually
Read Into
Image Editor
0
-80 -80
-40 -40
0
+
0
Add Labels 40
80
Manually
40
Figure 29: An example of how contour labels can be added to a contour plot. You do not need to
label every contour. The contour labels should be sufficient for the reader to deduce others if
necessary.
individual contour levels are different. This makes a back-to-back comparison difficult. Try picking
out the 100 Pa contour for yourself. It is considerably easier in the bottom set of contours!
By default most post-processing software sets the contour range to the maximum and minimum
value of the CFD solution. Make sure to adjust the contour range when you are comparing multiple
contours plots, to ensure that the contours in the Figure have the same range.
Figure 30: Contours of static pressure at angles of attack of (a) 0 degrees and (b) 8 degrees. The
top contours have different ranges, and are difficult to compare. The bottom contours have the
same range and are easier to compare.
Original
Image
Add Labels
Recirculation Region
Manually
Measurement Location
Figure 31: Turbulent flow over a backwards facing step. A dashed line has been added to indicate
the recirculation region and grey circles have been added to indicate the location where
measurements were taken.
make these additions you will need to save the contour plot as an image (PNG, JPEG, EPS or PDF)
and open it in an image editing programme. In the image editing programme you can add the labels,
boxes and lines to the Figure and then save it as a new image file. Have a go at adding lines and
labels to your contour plots yourself using MS Paint, Inkscape, or CorelDRAW. They can significantly
improve the quality of Figures in your document.
1.0
0.8
0.6
0.4
0.2
0.0
0.0 0.4 0.8
Figure 32: A contour plot of axial velocity (Ux ) over a backwards facing step. The velocity has
been normalised by the inlet velocity (Uin ) and the vertical coordinate (y) has been normalised by
the height of the channel.
As an example, Figure 32 shows contours of axial velocity (Ux ) over a backwards facing step.
The contour lines which separate the advancing flow from the recirculation region are close together,
as the velocity changes rapidly over a small distance. It can be difficult for the reader to assess the
changes in the velocity field in this region from the contour plot alone.
One approach that can be used to add clarity to the contour plot is to add a line plot through
the region of steep gradient. In Figure 32, a line plot has been added in the same Figure as the
contour plot. The line plot passes directly through the shear layer. This allows the velocity profile
to be observed more clearly than from the contour plot alone. In turn, the contour plot allows the
reader to see exactly where the line plot has been taken from and provides context for the overall
flow field. The combination of contour plots and line plots together is useful for presenting complex
CFD solution data.
Figure 33: Free surface flow of water over an obstacle. A volume fraction of 1 indicates that the
cell is filled with water. A volume fraction of 0 indicates that the cell is filled with air. The contour
range is limited in the plot on the right to highlight the location of the free surface.
Figure 34: Free surface flow of water over an obstacle. A volume fraction of 1 indicates that the
cell is filled with water. A volume fraction of 0 indicates that the cell is filled with air. The 0.5
contour has been extracted to highlight the location of the free surface.
range is to extract a single contour from the contour plot. Figure 34 shows an example of how the
0.5 contour can be extracted from the contour plot and plotted alongside the original to show the
location of the free surface.
It is important to remember that the location of the free surface can only ever be resolved to
1.0 1.0
0.0 1.0
0.0
0.0 1.0 1.0
0.0 1.0
0.0
0.0
1.0 1.0
0.0 1.0
0.0
0.0 1.0 1.0
0.0 1.0
0.0
0.0
Figure 35: A diagram to show the mesh in the vicinity of the free surface. The location of the free
surface is indicated with an arrow. The free surface can only be resolved to within a cell.
within a cell in the CFD mesh, even if interface compression algorithms are adopted. Therefore to
produce a more accurate calculation of the free surface, the mesh should be refined in the vicinity of
the free surface. As an example, Figure 35 shows the volume fraction field computed on two meshes.
In Figure 35 (a), the free surface is predicted to reside in the second row of cells from the top. By
refining the second row of cells, Figure 35 (b) shows that the free surface actually resides slightly
lower down in the cell than predicted in Figure 35 (a). Hence, in addition to the method chosen to
present the free surface to the reader, care should be taken to ensure that the mesh is sufficiently
refined in the location of the free surface / shock wave.
1. Use your post-processor to create two separate images. The first image is the overall Figure
and the second image is the zoomed region.
2. Import both images into an image editor (MS Paint, Inkscape or CorelDRAW for example).
4. Add a rectangle to the main image to show where the zoom box is located.
Try experimenting with zoom boxes for yourself. They are particularly useful for highlighting areas
of detail in complex Figures and diagrams.
Original
Images
Smaller Figure
Pressure (Pa)
-200 -100 0 100 200
Add box to show
where zoom box is
Combined
Images
Figure 36: Pressure distribution in the vicinity of an aerofoil. A zoom box is used to highlight the
stagnation point.
Use either the snipping tool / screen capture programme to save the two mesh im-
ages below. Import them into an image editor and create a Figure with a zoom box.
Hint: Remember to add a rectangle to show where the zoom box is located!
40
30
Thrust [kN]
Original 20
Image
10
0
0 5 10 15 20 25
Wind Speed [m/s]
20
+
10
0
Add shaded 0 5 10 15 20 25
regions
Wind Speed [m/s]
Figure 37: Thrust on a wind turbine as a function of wind speed. A shaded region is added to
highlight the wind speeds where the thrust is greater than 30 kN.
Thrust [kN] 20
Spalart Allmaras
10
0
0 5 10 15 20 25
Wind Speed [m/s]
40
Medthod 2: Dividiing Line
Legend
30
Thrust [kN]
20
Spalart Allmaras
10
0
0 5 10 15 20 25
Wind Speed [m/s]
Figure 38: Thrust on a wind turbine as a function of wind speed with three different RANS
turbulence models.
the area of interest. Make sure to give the rectangle some opacity (translucency), so that the reader
can see through the rectangle!
While shaded areas have limited use for single line plots, they are increasingly useful when multiple
lines are used on the same plot. Figure 38 shows the thrust on a wind turbine as a function of wind
speed with three different RANS turbulence models. With the red shaded area it is clear that the
maximum permissible wind speed is slightly higher with the Spalart Allmaras turbulence model than
with the k − and k − ω SST turbulence models. The red shaded area makes it easier to compare
the intersection of different line plots with the maximum permissible thrust of 30 kN.
As an alternative to a shaded area, the maximum permissible thrust can be indicated with a
dividing line (Figure 38). However, with multiple lines on the same plot, it can be difficult for the
reader to determine the intersection point when using a dividing line. For this reason, shaded areas
are usually preferred to dividing lines when multiple lines are used on the same plot.
30
28
26
12.4 12.6 12.8 13.0 13.2 13.4
Legend
40
Combined Images
30 Spalart Allmaras
Thrust [kN]
20 34
10 32
30
0
0 5 10 15 20 25 28
Wind Speed [m/s] 26
12.4 12.6 12.8 13.0 13.2 13.4
Figure 39: Thrust on a wind turbine as a function of wind speed with three different RANS
turbulence models.
Figure 39 shows the same plot as Figure 37 and 38, but with a zoom box to highlight the region
where the red lines enter the shaded area. Notice that for this zoom box, the legend and axis labels
are not needed, so they have been removed. The axis range has also been adjusted to focus on
the area of interest. The zoom box shows that k − ω SST model enters the red shaded area at a
wind speed of 12.5 m/s, the k − model at 12.8 m/s and the Spalart Allmaras turbulence model at
13.2 m/s. This is much clearer than the original plot and allows the reader to specify the maximum
permissible wind speed with greater accuracy.
Figure 40: Lift coefficient on an aerofoil. Each of the data points was computed from a separate
CFD simulation using the same model. This is an example of a parameter space.
Figure 41: Lift coefficient on an aerofoil. Additional data points have been added around the
maximum lift coefficient.
coefficient actually occurs at an angle of attack of 9.5◦ , which is a more accurate calculation than
the original 10◦ .
When carrying out additional CFD simulations to increase the resolution of the parameter space,
it is not necessary to add additional data points at lower angles of attack, as these are far away from
the maximum lift coefficient (the point we are interested in). This allows us to limit the total number
of CFD simulations that are run. CFD simulations can be expensive and take a long time to run, so
it is important to choose the your simulations carefully!
As an example of an investigation where a curve fit is required, Figure 43 shows the pressure
drop across an orifice plate, as a function of the upstream velocity. An orifice plate is a circular
plate with a small hole in the centre. They are used in piping systems as control and measurement
devices. As the velocity upstream of the orifice plate increases, the pressure drop across the orifice
plate increases. To capture this behaviour, a CFD model can be constructed and used to calculate
the pressure drop across the orifice plate at a range of upstream velocities (U ). For each simulation,
the upstream velocity is changed and the CFD model is solved to calculate the pressure drop. The
calculated results are shown as data points in Figure 43.
In general, the pressure drop across an internal flow component can be described with the following
equation:
Figure 42: For the majority of CFD analyses, line segments should be used to join data points in
parameter spaces.
1
∆p = K ∗ ρU 2 (41)
2
where ∆p is the pressure drop, ρ is the upstream density, U is the upstream velocity and K is an
inertial loss coefficient. We would like to derive an inertial loss coefficient (K) for the orifice plate,
using the data points computed with the CFD code. To extract this coefficient from the data, a
curve fit is required. Hence, instead of connecting the data points with line segments, a quadratic
curve (2nd order polynomial) is fit to the data in Figure 43 instead:
∆p = cU 2 (42)
The coefficient c from the curve fit can then be used to determine the loss coefficient (c = 1/2ρK).
Notice that the curve fit in Figure 43 has been included in the legend, so that the reader is aware that
a curve fit has been used, rather than line segments. The value of K is also provided in the caption,
so the reader is aware of the functional form of the curve fit and can reproduce it, if necessary. If
multiple curve fits are carried out, then it is often more convenient to record the values in a table,
rather than the Figure caption.
Flow
Legend
Curve Fit
Velocity
Figure 43: Pressure drop across an orifice plate as a function of velocity. The curve fit computed
using the CFD data points is shown as a dashed line. For the curve fit shown, K = 0.5.
1.4
Legend
Lift Coefficient [ - ]
1.2
1.0 CFD Data Points
0.8 Author et al. (2020)
Original
0.6
Image Extra Legend Entry
0.4
0.2
Data Points for Comparison
0
0 2 4 6 8 10 12
Angle of Attack
Figure 44: Lift coefficient computed on an aerofoil for a range of angles of attack. The blue data
points have been extracted from a journal paper and added to the plot.
1. Contact the author by email and ask for the data points, so that you can use them directly.
2. Print the document and measure the data points using a ruler.
3. Use software to extract the data points from the document for you.
Regardless of the method that you choose, you should always credit the author (by referencing their
work) to avoid claims of plagiarism, and so that others can find the data set and make comparisons
for themselves.
Figure 45: The 3 methods of extracting data from a paper in the literature
Figure 46: A diagram of flow of water in a channel with the free surface open to the atmosphere.
H is the height of the channel.
If you choose option 3, WebPlotDigitizer is an excellent online tool that can make data extraction
from scientific papers much easier. You can access the tool on any internet browser by searching for
WebPlotDigitizer in a search engine (like google). You can use the tool to extract individual data
points and even entire line plots for comparative studies! To extract data from a plot, you will need
to first extract the plot from the document as an image (you can use the snipping tool or screen
capture program to do this). You can then import the image into WebPlotDigitizer and extract the
data from the image. If you do not like / cannot get access to WebPlotDigitizer, then MATLAB and
python also contain functionality for extracting data points from images.
1.5
Original
Image
1.0
0.5
0
0 0.5 1.0 1.5 2.0 2.5 3.0
1.0
Quantities
0.8
Dimensionless Profile
[-]
0.6
Original
0.4
Image
0.2
0
0 0.2 0.4 0.6 0.8 1.0 1.2
[-]
Figure 47: Velocity profile in a channel. z is the distance from the floor, H = 3.0 m is the height
of the channel and Ub = 2.4 m/s is the bulk velocity.
these dimensions being relatively simple, the top Figure can be difficult to interpret. For example:
I How much larger is the free surface velocity than the bulk velocity, as a percentage?
I What is the velocity at 60% of the channel depth?
I How would we compare the shape of the velocity profile with the profile at a higher flow rate?
The velocity profile is significantly easier to interpret when using dimensionless quantities. The
bottom plot in Figure 47 shows the same velocity profile but with the vertical coordinate normalised
by the height of the channel and the velocity normalised by the bulk velocity. With this plot it is
easier to see that the velocity at the free surface is ∼ 7% greater than the bulk velocity and the
velocity at 60% of the depth is ∼ 5% greater than the bulk velocity. With this approach it would
also be easier to add more velocity profiles to the same plot and to make direct comparisons.
In general, you should always attempt to normalise the data in your line plots and contour plots.
In addition to making the plots easier to interpret, it allows the reader to compare your results with
others in the literature. Table 5 shows some common methods of normalising variables in CFD.
Before attempting to normalise your data, you should first check how other researchers in the field
(journal papers, conference papers and theses) present their data. It is usually a good idea to adopt
the same normalisation that they do. Have a look at the papers and see what quantities other people
in your field use.
Results Tables
Technique 1: Formatting
When presenting your results in a table, the majority of journals and scientific conferences recommend
the following:
I Use increased line spacing so there is sufficient space between the rows
I Keep units (like m/s or N/m2 ) in the column headers rather than the table itself
I Do not omit the 0 before a decimal. For example, use 0.1 and not .1
These standards can be difficult to follow, especially as Microsoft Word and Excel insert vertical lines
into tables by default. Table 6 shows examples of good and bad table formatting. Notice that the
bottom Table in Table 6 is much easier to read than the top Table. It does not use any vertical lines,
the units (m/s and ◦ C) are in the column headers and the line spacing has been increased between
the rows.
If you read through journal papers, conference papers and textbooks in your field, you will find
that the majority of authors use these techniques to improve the clarity of their tables. Have a go for
yourself and see if you can recreate some of your existing tables without any vertical lines and other
bad formatting choices.
U [m/s] T [◦ C]
Table 6: Examples of badly formatted tables (top) and well formatted tables (bottom)
Hint: You will need to remove the vertical lines and move the units into the column headers.
I The static or total pressure drop across a component in an internal flow system
As an example, Table 7 shows the lift coefficient on an object computed with three different turbulence
models. It is clear from the table that the k − ω SST model shows the closest agreement with the
experimental measurements. However, it is not clear how close the models are to the experimental
measurements, or how close the models are to each other.
Experiment 1.23
k − ω SST 1.17
k− 1.06
Spalart Allmaras 1.34
Table 7: Lift coefficient for an object calculated with three different turbulence models
Experiment 1.23
k − ω SST 1.17 -4.9
k− 1.06 -13.8
Spalart Allmaras 1.34 8.9
Table 8: Lift coefficient for an object calculated with three different turbulence models. An
additional column has been added to show the percentage difference with the experiments.
A simple addition to this table can make a significant improvement to its readability. Figure 8
shows the same table but with an additional column for the percentage difference between the CFD
results and the experimental measurements. With the additional column it is now much clearer that
the k − ω SST model shows the closest agreement with the experiments. Many readers will be more
comfortable with percentage differences than absolute values, particularly if the quantity is small.
For example, skin friction coefficients of 0.0021 and 0.0028 appear to be close together, but actually
have a percentage difference of 25%! The sign of the difference (positive or negative) also shows the
reader whether the model over-predicts or under-predicts the target value at a glance.
It may also be useful to include an extra table with the results of the mesh sensitivity study
(as described in the previous Chapter). This will give the reader an indication of how much of the
percentage difference is likely to be due to the mesh refinement and how much is due to the choice
of turbulence model.
Figure 48: A comparison of a) vector and b) bitmap image file formats that can be exported from
post-processing software.
1. Line plots are created using a vector file format (PDF or EPS), as vector images preserve
resolution when zooming in on the image.
2. Contour plots are created using a bitmap file format (PNG, JPEG or TIFF), as vector contour
plots have a very large file size.
For bitmap images (Contour plots), all of the main publishers (Elsevier, Wiley, Taylor and Francis)
recommend that images are produced with a minimum resolution of 300 dpi. For vector images (line
plots), you do not need to specify a resolution for vector images, as the images are constructed from
a series of mathematical objects.
Try saving a graph as a bitmap image (PNG, JPEG, BMP or TIF) with resolutions of 72 dpi
and 300 dpi. Import the images into a document and compare the resolution.
Hint: You will notice that the 72 dpi image has noticeably worse resolution. It may
appear blurry and difficult to read.
Try saving a graph as a bitmap image (PNG, JPEG, BMP or TIF) and as a vector image
(PDF, EPS or SVG). Import the images into a document and zoom in on the images.
Hint: You will notice that the bitamp image loses resolution as you zoom in on the
image. The vector image does not lose resolution.
But what about images with annotations? When annotations are added to an image in an image
editor, the annotations are created as vector objects on top of the original image (which could be
a vector or a bitmap image). It is recommended that the annotated image is saved as a vector
image (PDF, EPS or SVG). This will ensure that any annotations that were created are saved as
mathematical objects (vectors), while the original image that was imported into the image editor is
preserved in its original format.