Sie sind auf Seite 1von 6

School of Mechanical Aerospace and Civil Engineering

Introduction

MSc/4th Year Advanced CFD

A number of CFD modelling and solution methods have been studied.

All involve some level of approximation.

Here we aim to collect together main areas where errors arise in CFD
solutions, and how these can be avoided, or their effects minimized.

Error in this context is rather general it mainly refers to differences we


might get between a set of CFD results and real-life observations or
measurements.

Trust and Quality in CFD


T. J. Craft
George Begg Building, C41

Cp Around Cylinder (k-e, Re=140000)

Reading:
J. Ferziger, M. Peric, Computational Methods for Fluid
Dynamics
H.K. Versteeg, W. Malalasekara, An Introduction to Computational Fluid Dynamics: The Finite Volume Method
S.V. Patankar, Numerical Heat Transfer and Fluid Flow
Notes:
Blackboard
and
CFD/TM
web
server:
http://cfd.mace.manchester.ac.uk/tmcfd
- People - T. Craft - Online Teaching Material

-2
Cp

-4
Omega=0
Omega=2
Omega=1

-6

-8

100

200

300

Theta

Trust and Quality in CFD

2011/12

1 / 21

Trust and Quality issues in CFD become important as it is widely used in


design and analysis, and its quantitative results used in critical
applications.
It can be relatively easy to get results out of a CFD code, but how do we
ensure they make sense and can be trusted?

Trust and Quality in CFD

Errors, inaccuracies, and differences between CFD results and laboratory


or real-life measurements arise from a number of sources.

Some errors can, at least in principle, be systematically reduced.

In order to answer these, we need to have a good understanding of where


errors and inaccuracies can arise in the modelling and solution process.

Trust and Quality in CFD

2011/12

3 / 21

Need to understand the limits of turbulence and other models.

Other mismatches can arise from incomplete or uncertain problem


definition.

Need to understand how these arise, and check for their influence.

Some mismatches between CFD results and measurements may be due


to mathematical models not fully representing the flow physics.

What steps should be taken to check for accuracy and reliability of CFD
results?

2 / 21

Sources of Errors in CFD

2011/12

Need to understand the problem physics, and boundary conditions.

Errors arising from software, or incorrect use of software, can be present.

Need to understand the simulation process well, enabling one to


check for implementation or usage errors.

Trust and Quality in CFD

2011/12

4 / 21

Numerical Errors

Discretization Errors

These generally refer to differences between the CFD solution and the
exact solution of the governing differential equations and boundary
conditions.

Can broadly be put into two categories:

U
Ue Uw

x
x

Convergence errors: the discretized equations not being solved


exactly.


b1
a11 . . . a1n
1
..
.. .. ..
.
. . .
an1

. . . ann

bn

Trust and Quality in CFD

Analytical derivatives and integrals are approximated in terms of discrete


nodal variable values.

2011/12

5 / 21

Taylor series expansions can give the order of accuracy of these


approximations.

Order of accuracy does not tell us the accuracy of one particular solution
it indicates how rapidly errors decrease as the grid spacing (or time
step) is refined.

Note that this convergence rate with grid or time step size will only be
observed for sufficiently small grid spacing or time step.

Trust and Quality in CFD

2011/12

6 / 21

Richardson Extrapolation

If we write a Taylor series expansion as




 
(x )2 2

+
+
e = P + x
x P
2!
x2 P

Two numerical solutions, obtained with discretization scheme of order n,


on grids of spacing x and x /2, result in solution estimates:

1 = exact + B(x )n + O((x )n+1 )


2 = exact + B(x /2)n + O((x )n+1 )

Grid and time step refinement can reduce discretization errors to


negligible levels (provided the discretizaton is consistent).

Multiplying the second by 2n , and subtracting from the first, gives

1 2n 2 = (1 2n )exact + O((x )n+1 )

Richardson extrapolation can sometimes be used to get higher order


estimates of integral solution quantities (Cl , Cd , Nu, . . . ), but it is not
always very practical for complex flows.

or

exact =

Trust and Quality in CFD

Ue Uw
U

x
x
U (n+1) U (n)
U

t
t

then the leading order error term is only the largest contribution if x is
small enough that x | 2 / x 2 | << | / x |.

Discretization errors: the discretized equations not representing the


differential ones exactly.
W

2011/12

7 / 21

1 2n 2
+ O((x )n+1 )
1 2n

To apply this, we need two solutions with uniform grid refinement, and the
grids must be fine enough to show convergence rates proportional to the
schemes order of accuracy.

Trust and Quality in CFD

2011/12

8 / 21

Convergence Errors

Best solution is to monitor the residual error:


Res = ||ap P ai i s ||

The discretized equations are


usually solved in an iterative
fashion.
Convergence errors often relate to
this process being stopped when
the result is still not sufficiently
close to the exact solution of the
discretized equation set.

The difficulty in quantifying this is that we cannot measure the error norm,
|| exact ||, since we do not know exact .

Simply performing a fixed number of iterations, or continuing until the


solution changes by only some small amount does not guarantee that the
error will be small.

Trust and Quality in CFD

2011/12

9 / 21

Mathematical Modelling Errors

Non-dimensionalizing the residual by some physical quantities associated


with the flow problem definition helps to assess convergence levels.

For example, mass residuals can be normalized by an inlet mass flux,


and momentum equation residuals by the inlet momentum flux.

As a rule of thumb, residuals normalized as above should often be


brought down to around 104 to give sufficient convergence.

The level of convergence required can be checked by reducing the


residuals further and then comparing the solutions obtained.

Trust and Quality in CFD

These relate to how well the governing differential equations represent


the real flow physics.

For single phase laminar flows the equations can generally be regarded
as exact.

2011/12

10 / 21

Validation studies, and model performances in many general classes of


flows can often be found in the open research literature.

- : k - ;
: Basic RSM+GL;
- - -: Basic RSM+CL;
: TCL RSM

z
x

Mathematical models are often needed to account for turbulence,


chemical reaction and combustion, and other processes,

These models all have some limits of applicability, and some will perform
better or worse than others in particular flow situations.

Choosing the appropriate model(s) for a particular case depends on user


experience, and a knowledge and understanding of the models and flow
physics present in the particular problem.

Model validation, usually by comparison with measured data, in a range


of flows is therefore vital.

Trust and Quality in CFD

2011/12

11 / 21

Trust and Quality in CFD

2011/12

12 / 21

Grid Quality

If applying CFD to a new field, validation studies are needed in order to


give confidence in the solutions obtained.

Sensitivity of the solution to models can be tested by simulating the flow


using different schemes (eg. using different turbulence models).

A good quality grid is essential in reducing discretization errors.

Poorly constructed grids can introduce significant discretization errors,


and can lead to poor, or very slow, convergence.

High aspect ratio cells should be avoided, particularly when not aligned
with the flow (eg.away from near-wall regions).

Non-uniform grids should be


used to give smaller cells in
critical flow regions (near walls,
around sharp corners, across
shocks,. . . ).

In some cases the choice of model is linked with spatial grid and time
step choices. For example, the use of wall-functions for resolving
near-wall regions, or the relatively fine grids and small time steps
required for models such as LES that resolve some turbulence structures.

Trust and Quality in CFD

2011/12

Sudden changes in grid size introduce interpolation


and other errors. Cell growth ratios greater than
around 1.2 should certainly be avoided.

Poor grid angles also cause interpolation errors, and may require
deferred correction methods for gradient reconstruction, etc.

13 / 21

Grid cells not aligned with the flow direction tend to lead to numerical
diffusion, so grids should be aligned with the expected flow direction
where possible.

Some codes allow the use of hanging nodes, and other non-matching
cell interfaces. Avoid these if possible particularly in critical flow regions.

Trust and Quality in CFD

2011/12

15 / 21

Trust and Quality in CFD

2011/12

14 / 21

Some grid generators, solvers and post-processing software can report


measures of grid quality, eg. cell aspect ratios, cell skewness, etc.

Grid independence checks should always be performed, so it is best to


use grid topologies that can be significantly refined without seriously
degrading grid quality.

For example, as shown below, grid refinement can lead to high aspect
ratio cells normal to the flow direction.

Trust and Quality in CFD

2011/12

16 / 21

Problem Definition Errors

These generally arise from making assumptions in the problem set-up


which change the characteristics or behaviour of the flow.

Examples include smoothing out crucial geometrical features, imposing


periodicity or symmetries not present in the real flow, or assuming a
steady state when the flow is unsteady.

Flow around a circular cylinder:

Assuming symmetry will prevent the


above pattern from developing.

Performing a steady state


calculation will also not give the
correct pattern (and it may be
difficult to obtain convergence).

Wrong assumptions may be made for inlet or other boundary conditions.

For example, fully developed inlet flow


profiles should not be specified when
there is only a short entry pipe/duct.

A Von-Karman vortex street develops in real flows.

Trust and Quality in CFD

2011/12

17 / 21

Problem Definition Uncertainties

Detailed turbulence statistics might not have been measured, or reported.

Unfortunately, many fluids problems can be rather sensitive to inputs


such as inlet conditions.

These errors cannot be easily removed, but sensitivity tests can be


performed running a number of simulations with different inlet
conditions.

This is routinely done in weather prediction, for example, where detailed


measurements for boundary conditions are not available, yet results can
be highly sensitive to local flow details.

Trust and Quality in CFD

2011/12

18 / 21

User Errors

In some cases flow conditions are not known exactly, and assumptions
must be made for boundary conditions etc.
Inlet conditions are often not known in
great detail a flow rate might be given,
but not the detailed velocity distribution.

Trust and Quality in CFD

2011/12

19 / 21

Mainly arise from user inexperience or lack of planning.

Incorrect usage of software, or errors in setting flow parameters or


boundary conditions may fall into this category.

Incorrect post-processing of results also leads to errors.

These type of errors can usually be avoided by ensuring users know how
to run software tools correctly, and understand the flow problem and
process of modelling it.

Trust and Quality in CFD

2011/12

20 / 21

Software Errors

Nearly all software has some bugs in it.

These can include coding errors, and differences between documentation


and actual implementation.

Suitable verification tests can usually identify such problems.

Again, user experience and knowledge of the flow and modelling can
help to identify where such errors may be present.

Trust and Quality in CFD

2011/12

21 / 21

Das könnte Ihnen auch gefallen