Вы находитесь на странице: 1из 13

CFD:

Computa1onal Fluid Dynamics


The applica1on of techniques of numerical analysis and
computer programming to the solu1on of the par1al dieren1al
equa1ons governing uid ow

Numerical analysis
Branch of applied mathema1cs that deals with issues of
accuracy, stability and convergence proper1es of numerical
schemes

- when a CFD code blows up, or


gives inaccurate solu1ons, relying
on numerical analysis is the only
op1on
- we do not dig deep into the
mathema1cal aspects. We will do
Engineering Numerical Analysis

The pay-o of studying CFD (properly)

The process of modelling


Physical phenomenon

(e.g. ow past an airfoil)

Mathema1cal formula1on

Governing equa1on
(an ODE or PDE)

(e.g.the Navier-Stokes equa1on)

Discre1sa1on

Algebraic equa1on

(a system of equa1ons solvable on a computer)

Programming

Numerical soRware

(e.g. Fluent, Open Foam, Abacus)

Sources of error in numerical modelling


Errors introduced BEFORE the computa1on
Error in the mathema1cal model: some physical features of the problem or
the system under study may be simplied or omiUed in the mathema1cal
model (e.g. viscosity is neglected)
Error in the empirical measurement: laboratory instruments have nite
precision; in addi1on, sta1s1cal error is always present in measurements

Errors introduced DURING the computa1on


Trunca1on error: the process of discre1sa1on (e.g. replacing deriva1ves by
nite dierences) introduce an error that depends on the grid mesh size
Rounding error: all non-integer numbers represented on computers are
rounded. This is due to the nite precision of computers

Absolute and rela1ve error


Absolute error = approximate value true value

E absolute = x approx x exact


Rela<ve error = absolute error / true value

E relative

x approx x exact
=
x exact

(for simple model problems the true value is the analy1cal solu1on
of the governing equa1on, which is not aected by trunca1on error)

Signicant gures (signicant digits) of a number are


those digits that carry meaning contribu1ng to its precision

1) All non-zero digits are considered signicant. For example, 91 has


two signicant gures (9 and 1), while 123.45 has ve signicant gures
(1, 2, 3, 4 and 5).
2) Zeros appearing anywhere between two non-zero digits are signicant.
Example: 101.1203 has seven signicant gures: 1, 0, 1, 1, 2, 0 and 3.

3) Leading zeros are not signicant. For example, 0.00052


has two signicant gures: 5 and 2.
4) Trailing zeros in a number containing a decimal point are signicant. For example,
12.2300 has six signicant gures: 1, 2, 2, 3, 0 and 0. The number 0.000122300 s1ll has
only six signicant gures (the zeros before the 1 are not signicant). In addi1on,
120.00 has ve signicant gures since it has three trailing zeros. This conven1on
claries the precision of such numbers; for example, if a measurement precise to four
decimal places (0.0001) is given as 12.23 then it might be understood that only two
decimal places of precision are available. Sta1ng the result as 12.2300 makes clear that
it is precise to four decimal places (in this case, six signicant gures)

Computer representa<on of numbers


Computers can store only a nite number of signicant digits in memory.
Numbers with a number of signicant digits larger than those that can be
stored are rounded. Hence, round-o or rounding error arises.
Example: a computer with 4 memory loca1ons (assume each loca1on can
store only a number between 0 and 9)

Largest number that can be represented: 9999


Smallest number that can be represented: .0001

How to store 2.7947 with 4 memory loca1ons?


Chop (also called round to zero): the small digits that do not t into the
memory loca1on are truncated; the number represented in computer will be
2.794
Round to nearest : the number is the rounded to the closest number that
can be represented on the computer. If the number ends with 5, the
computer number whose last digit is even is typically used. In our case,
the computer representa1on will be 2.795
This was just an example illustra1ng the origin of rounding error.
In computers, numbers are represented using a nota1on based on signicand,
base, and exponent (similar to a scien1c nota1on):

Computers use a binary system, where the only digits allowed are 0 and 1
Each binary number is stored in a bit. 8 bits make one byte
Single precision: 32 bits; double precision: 64 bits

Numbers represented on computers are also called oa1ng-point numbers

Exact number = oa1ng-point number + round-o error

Machine precision
The absolute value of the rela1ve error due to round-o is given by the
machine precision (also called machine epsilon):
oa$ng-point (computer) representa$on of x

fl(x) x
mach
x
a generic quan$ty (e.g. streamwise velocity)

Single precision: mach = 2-24 10-7

Double precision: mach = 2-53 10-16


Machine epsilon is a very small number, but large calcula1ons oRen involve
billions of grid nodes and tens of thousands of 1me-steps. Rounding error
cumulates, and can become important.

Test

u
2
( + u u) = p + u
t
1) Describe the physical meaning of the term in parenthesis

2
2) Write the Laplace operator in Cartesian coordinates

3) Write explicitly the x-component of the term

u u

(you can use the symbols u,v, and w to denote the x, y, and z components
of the velocity vector)

4) What is the Reynolds number?

5) Expand sin(x) in Taylor series around x=0 up to the linear term

Вам также может понравиться