LectureNotesWeek1 IntroToCFD 2014-2015

Embed Size (px)

DESCRIPTION

intro to CFD

Citation preview

  • Numerical analysis

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

    CFD: Computa1onal Fluid Dynamics

    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)

  • Physical phenomenon

    Governing equa1on (an ODE or PDE)

    Algebraic equa1on

    (e.g. ow past an airfoil)

    (e.g.the Navier-Stokes equa1on)

    (a system of equa1ons solvable on a computer)

    Mathema1cal formula1on

    Discre1sa1on

    Numerical soRware

    Programming

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

    The process of modelling

  • 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 error = approximate value true value

    Rela

  • 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
  • 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):

  • Numbers represented on computers are also called oa1ng-point numbers

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

    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

  • The absolute value of the rela1ve error due to round-o is given by the machine precision (also called machine epsilon):

    Single precision: mach = 2-24 10-7

    Double precision: mach = 2-53 10-16

    fl(x) xx mach

    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.

    oa$ng-point (computer) representa$on of x

    Machine precision

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

  • Test

    (ut +u u) = p +

    2u

    1) Describe the physical meaning of the term in parenthesis

    2) Write the Laplace operator in Cartesian coordinates

    3) Write explicitly the x-component of the term

    2

    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