Sie sind auf Seite 1von 113

Computational Fluid Dynamics

Dr.Eng. Reima Iwatsu


Phone: 0355 69 4875
e-mail: iwatsu@las.tu-cottbus.de
NACO Building Room 53-107

Time Summer Term


Lecture: Tuesday 7:30-9:00 (every two weeks) LG4/310
Exercise: Tuesday 7:30-9:00 (every four weeks)LG4/310
Evaluation: 10% Attendance 90% Exercise and Report 90%
Speeking time Tuesday 9:00-10:30

Lehrstuhl Aerodynamik und Strömungslehre (LAS)


Fakultät 3, Maschinenbau, Elektrotechnik und Wirtschaftsingenieurwesen
Brandenburgische Technische Universität Cottbus
Karl Liebknecht-Straße 102,D-03046 Cottbus
Terminplanung für die Vorlesung „Computational Fluid Dynamics“
(Di., 7:30 – 9:00 Uhr, LG 4 Raum 310)
• Date Contents of the lecture
• 3. 4. 2001 Introduction
The mathematical nature of the flow equations
• 17. 4. 2001 Finite Difference Method (FDM)
Finite Element Method (FEM)
Finite Volume Method (FVM), Fourier/Spectral method
• 24. 4. 2001 Exercise
• 8. 5. 2001 Time integration, Stability analysis
• 22. 5. 2001 Iterative methods for algebraic systems
Convection-diffusion equation
• 29. 5. 2001 Exercise
• 5. 6. 2001 Incompressible Navier Stokes(NS) equations
Some remarks on incompressible fows
• 12. 6. 2001 Heat and fluid flow
Turbulence model
Grid generation
• 19. 6. 2001 Exercise
• 26. 6. 2001 Example CFD results
• 3. 7. 2001 Lecture from Dr.Ristau

Contents of the lecture
Mathematical Property of the PDEs
1 Introduction
2 The Mathematical Nature of the Flow Equations
Various Discretization Method
3 Finite Difference Method (FDM)
4 Finite Element Method (FEM)
5 Finite Volume Method (FVM)
6 Fourier/Spectral Method
Numerical Method for Time Marching and System of Equations
7 Time Integration
8 Stability Analysis
9 Iterative Methods for Algebraic Systems
10 Convection-Diffusion Equation
Incompressible Flows
11 Incompressible Navier Stokes(NS) Equations
12 Some Remarks on Incompressible Fows
13 Heat and Fluid Flow
14 Turbulence Model
Grid Generation / CFD Examples
15 Grid Generation
16 Example CFD Results
17 Lecture on Applicational Computation (Dr. Ristau)
Contents of the lecture for today
• 1 Introduction
• 1.1 Introductnion
– 1.1.1 Motivation
– 1.1.2 Computational Fluid Dynamics: What is it?
– 1.1.3 The Role of CFD in Modern Fluid Dynamics
– 1.1.4 The Objective of This Course
• 1.2 The Basic Equations of Fluid Dynamics
– 1.2.1 Fluid and Flow
– 1.2.2 Mathematical Model
– 1.2.3 Conservation Law
– 1.2.4 The Continuity Equation
– 1.2.5 The Momentum Equation: Navier-Stokes Equations
– 1.2.6 The Energy Equation
– 1.2.7 Thermodynamic Considerations
– 1.2.8 Submodel
• 2 The Mathematical Nature of the Flow Equatnions
• 2.1 Linear Partical Differential Equations(PDEs)
– 2.1.1 Classification of the Second Order Linear PDEs
– 2.1.2 General Behaviour of the Different Classes of PDEs
• 2.2 The Dynamic Levels of Approximation
– 2.2.1 Inviscid Flow Model: Euler Equations
– 2.2.2 Parabolized Navier-Stokes Equations, Boundary Layer Approximation
– 2.2.3 Potential Flow Model, Incompressible Fluid Flow Model
1.1 Introduction
Motivation: Why should you be motivated to learn CFD?
The flowfield over a supersonic blunt-nosed body Artist's conception of next generation supersonic aircraft
Vehicle aerodynamics, combustion and DNS of turbulence
Some More Examples

http://www2.icfd.co.jp
Computational Fluid Dynamics

• Computational Fluid Dynamics (CFD) is a discipline that solves a


set of equations governing the fluid flow over any geometrical
configuration. The equations can represent steady or unsteady,
compressible or incompressible, and inviscid or viscous flows,
including nonideal and reacting fluid behavior. The particular
form chosen depends on the intended application. The state of the
art is characterized by the complexity of the geometry, the flow
physics, and the computer time required to obtain a solution.

• http://fmad-www.larc.nasa.gov/aamb/
• Fluid Mechanics and Acoustics Division
• NASA Langley Research Center in Hampton, VA.
Computational Fluid Dynamics: What is it?
• The physical aspects of any fluid flow are governed by the following
fundamental principles:
(a) mass is conserved
(b) F = ma (Newton‘s second law)
(c) energy is conserved.

• These fundamental principles are expressed in terms of mathematical


equations (partial differential equations).

• CFD is the art of replacing the governing equations of fluid flow with numbers,
and advancing these numbers in space and/or time to obtain a final numerical
description of the complete flow field of interest.

• The high-speed digital computer has allowed the practical growth of CFD.
The Role of CFD in Modern Fluid Dynamics

Pure Pure
experiment theory

Computational
Fluid
dynamics
Fig. The “three dimensions“ of
fluid dynamics

• A new „third approach“.


• Equal partner, but never replace either.
The Objective of This Course

• To whom:
The completely uninitiated student
• To provide what:
(a) an understanding of the governing equations
(b) some insight into the philosophy of CFD
(c) a familiarity with various popular solution techniques;
(d) a working vocabulary in the discipline
• At the conclusion of this course:
will be well prepared to understand the literature in this field,
to follow more advanced lecture series,
and to begin the application of CFD to your special areas of
concern.
I hope...
1.2 The Basic Equations of Fluid Dynamics
Fluid and Flow
Gas, air, fuel, oxigen, CO2
Fluid: Liquid water, oil, liquid metal that flows
(Solid) (geophysical flows)
Eulerian and Lagrangian framework
Eulerian description of the flow
the velocity of the fluid u at the position x at time t
u (x , t ) u (x , t )

Lagrangian labels
the state and motion of the point particles
a = (a1,a2,a3) Lagrangian labels
u (x , t ) = u ( X (a, t ) , t ) = U (a, t ) a
b U (a, 0 )

U (a, t )
Mathematical Model
Finite Control Volume
A closed volume in a finite region of the flow: a controle volume V;
a controle surface S, closed surface which bounds the volume

Control surface S S

Control volume V V

fixd in space moving with the fluid


Infinitesimal Fluid Element
An infinitesimally small fluid element with a volume dV

volume dV
The Material Derivative
The velocity of a point particle = the rate of change of its position X

substantial, material, or convective derivative and is denoted by D/Dt

The Lagrangian set (a, t ) and the Eulerian set (x , t )


The relationship between the partial derivatives of a function f

The chain rule

(material (temporal & spatial derivatives


derivative) with respect to the Eulerian variables)
The Continuity Equation
Control Volume Fixed in Space Physical principle: Mass is conserved.

(Integral form)

Gauss Divergence Theorem


The Continuity Equation (continued)
Control Volume Moving with the Fluid

The relationship between the divergence


of Vand dV
The Continuity Equation (summary)

The meaning of divergence V


The Momentum equation

Physical principle: F=ma (Newton‘s second law)

Navier Stokes Equations


The Momentum equation
The Energy Equation
Physical principle: Conservation of energy
E: total energy (= e + V 2/2 ) , e: internal energy
Thermodynamic Considerations
Unknown flow-field variables: /rho, p, u, v, w, E( or e)
Closure conditions for state variables
( e: specific internal energy, s: entropy, p: pressure, /rho: density, T: temperature)
Equation of State
Ideal Gas (a perfect gas)
pV = nR T ( p = ¥rho R T ) (1)
V: volume,
n:number of kilomoles,
R=8.134 KJ: Universal Gas Constant,
T: temperature [K].
pv = RT, R = R / w( p = ¥rho RT ) (1#)
v : specific volume (=V/m, V: Volume, m: mass. v=1/ ¥rho )
w: relative molecular mass, m = n w,
R: Specific Gas Constant.
a thermodynamic relation
e = e(T,p) (2)
a perfect gas
e = c vT (2#)
cv: spesific heat at constant volume
2 The Mathematical Nature of the Flow
Equatnions
2.1 Linear Partial Differential Equations (PDEs)

Second Order
Linear PDEs

Navier Stokes
Equations

Second Order PDEs


2.1.1 Classification of the Second Order Linear PDEs
• F(x,y)
aFxx + bFxy + cFyy +dFx + eFy + g = 0

b2 – 4ac > 0 hyperbolic

b2 – 4ac = 0 parabolic
b2 – 4ac < 0 elliptic
2.1.2
General Behaviour of the Different Classes of
PDEs
• Hyperbolic Equations
• Characteristic curves

Region II
Domain of influence Left-running characteristic
y

a P Region I
Influenced by point p
-Region of influence-
Initial data upon which p
depends

Right-running characteristic
c
Region influenced by
x
point c
Hyperbolic Equations

(x,y,z)

Characteristic surface
y

P Volume
Initial data in the yz Volume which influences influenced by point p
plane upon which p point p
depends

z
Parabolic Equations
• Only one characteristic direction,
• Marching-type solutions

y Boundary conditions known


c d
Initial data line P
a Region
influenced by P

Boundary conditions known b

y y

x=0 x=t
Elliptic Equations
• No limited regions of influence;
• information is propagated everywhere in all directions (at once).

y
b c

a b x
• Boundary conditions
• A specification of the dependent variables along the boundary. Dirichlet condition
• A specification of derivatives of the dependent variables along the boundary. Neumann
condition
• A mix of both Dirichlet and Neumann conditions.
2.2 The Dynamic Levels of Approximation
2.2.1 Inviscid Flow Model: Euler Equations
Steady inviscid supersonic flows

Wave equation
2.2.2 Parabolized Navier-Stokes Equations, Boundary
Layer Approximation
Unsteady thermal conduction

Boundary-layer flows

Parabolized viscous flows


2.2.3 Potential Flow Model, Incompressible Fluid Flow
Model
Physical picture consistent with the behavior of elliptic equations
Potential Flow: Steady, subsonic, inviscid flow

Flow over an airfoil


Incompressible Fluid Flow: the Mach number M = V/c 0

Flow over a cylinder cylinder


Discretization techniques route map
PDFs Æ System of allgebraic equations

Finite Difference Finite Element Finite Volume Fourier /


Method (FDM) Method (FEM) Method (FVM) Spectral Method

Basic derivations

Discretization errors

Types of solutions:
Time integration Iterative methods
Explicit and implicit
Initial value problem Boundary value problem
I.V.&B.V. problem
Stability analysis
2 Finite Difference Method
2.1 Basic Concept
> to discretize the geometric domain > to define a grid
> a set of indices (i,j) in 2D, (i,j,k) in 3D
> grid node values
The definition of a derivative
2.2 Approximation of the first derivative
2.2.1 Taylor series expansion

Expansion at xi+1

Expansion at xi-1

Using eq. at both xi+1 and xi-1


Truncation error
The Forward (FDS), backward (BDS) and central difference (CDS)
Approximations truncating the series

Truncation errors

>for small spacing the leading term is the dominant one


>The order of approximation m, m-th order accuracy

Second order approximation


2.2.2 Polynomial fitting

To fit the function an interpolation curve and differentiate it;


Piecewise linear interpolation: FDS, BDS
A parabola:

A cubic polynomial and a polynomial of degree four:

Third order BDS, third order FDS and fourth order CDS
2.3 Approximation of the second derivative
Approximation from xi+1, xi
second derivative
2.4 Approximation of mixed derivatives

¾non-orthogonal coordinate system


¾combining the 1D approximations
¾The order of differentiation can be changed
2.5 Implementation of boundary conditions
2.6 Discretization errors
Truncation error (the imbalance due to the truncation of Taylor series)

The exact solution of Lh

Discretization error

Relationship between the truncation error and the discretization error

Richardson extrapolation
for sufficiently small h

the exact solution:

the exponent p (order of the scheme):

Approximation for the discretization error on grid h:


3 Finite Element Method
3.1 Interpolation function
Approximation by linear combinations of basis functions
(shape, interpolation or trial functions)

Mehods based on defining the interpolation function on the whole domain:


trigonometric functions: collocation and spectral methods
loccaly defined polynomials: standard finite element methods
One dimensional linear function
3.2 Method of weighted residuals
4 Finite Volume Method

• 4.1 Introduction
4.2 Approximation of surface integrals
4.3 Approximation of volume integrals
4.4 Interpolation practices
Linear interpolation
Quadratic Upwind Interpolation (QUICK)
Higher-order schemes
5 Spectral Methods
5.1 Basic concept
A discrete Fourier series

Fourier series for the derivative:

Method of evaluating the derivative


-- Given f(x), use (36) to compute ^f ;
-- Compute the Fourier coefficient of df/dx ; ikq ^f (kq) ;
-- Evaluate the series (37) to obtain df/dx at the grid points.

++ higher derivatives; d2f/dx2 ; - kq2^f (kq).


++ The error in df/dx decreases exponentially with N when N is „large“.
++ The cost of computing ^f scales with N2(expensive!).
The method is made practical by a fast method of computing Fourier transform (FFT);
N log2 N.
5.2 A Fourier Galerkin method for the wave equation
Example
Error
7 Time integration
Unsteady flows Initial value problem (Initial boundary value problem)

Steady flows Boundary value problem

t Solution at
time t=t

time t=0
t=0 Initial condition Steady solution

Boundary condition

Initial value problem Boundary value problem


7.1 Methods for Ordinary Differential Equation (ODE)

Two-level methods
Two-level methods
Predictor-Corrector method
Mutipoint methods

Adams-Bushforth methods
Runge-Kutta methods
The second order Runge-Kutta method

The fourth order Runge-Kutta method


Other methods

An implicit three-level second order scheme


8 Stability analysis
One dimensional convection equation

Finite difference equation;


forward in time, centered in space
Q: Does a solution of FDE converges to the solution of
PDE?

approximate
PDE FDE

Æ0
Solution of PDE Solution of FDE
?

Ans.: „Even if we solve the FDE that approximate the PDE appropriately, the solution
may not always be the correct approximation the exact solution of PDE.
8.1 Consistency, stability and convergence
Consistency
Æ0
PDE FDE

Stability

Convergence
Lax‘s equivalence theorem

consistent
PDE FDE

stable
Æ0
Solution of PDE Solution of FDE
convergent

L : linear operator
Truncation error
8.2 Von Neumann‘s method
Fourier representation of the error on the grid points
FTCS method for 1D convection equation
Fourier series of the error

Amplification factor G

|G| > 1: Unconditionally unstable


Forward in time, forward in space(upwind scheme)

CFL (Courant Freedrichs, Levey) condition


BTCS method (Backward in time, centered in space)

|G| < 1: Unconditionally stable


Stability limit of 1D diffusion equation
8.3 Hirt‘s method
8.4 The matrix method
Matrix form

Spectral radius of the matrix C (maximum eigenvalue of C)


9 Iterative methods for algebraic systems
Linear equations : matrix form
9.0 Direct methods
9.0.1 Gauß elimination

A= A21/A11

Forward elimination
upper triangular matrix

Back substitution

+ The number of operations (for large n) ~ n3 / 3 (n2 / 2 in back substitution)


+ pivoting (not sparse large systems)
9.0.2 LU decomposition

Solution of
Ax = Q (0)
Factorization into lower (L) and upper (U) triangular matrices
A = LU (1)
Into two stages:
Ux=y (2)
Ly=Q (3)
9.0.3 Tridiagonal matrix
Thomas algorithm / Tridiagonal Matrix Algorithm (TDMA)

+ the number of operations ~ n (cf n3 ,Gauß elimination)


Iterative methods : Basic concept

Matrix representation of the algebraic equation


Au=Q (1)

After n iterations approximate solution u n , residual r n :


rn =Q-Aun (2)

The convergence error:


e n= u – u n (3)

Relation between the error and the residual:


A e n= r n (4)

The purpose: to drive r n to zero. e n Æ0


Iterative procedure
Au=Q
Iterative scheme
M u n+1 = N u n + B (5)

Obvious property at convergence : u n+1 = un


A = M – N, B=Q (6)

More generally,
PA = M – N, B = PQ (7)
P : pre-conditioning matrix
An alternative to (5): -M u n
M (u n+1 – u n ) = B – (M –N) u n (8)
or
Mdn =rn
d n = u n+1 – u n : correction
9.1 Jacobi, Gauß-Seidel, SOR method
Poisson equation
u=f
(u i+1,j –2 u i,j + u i-1,j)+(u i,j+1 –2 u i,j + u i,j-1)=f i,j h2

9.1.1 Jacobi method


9.1.2 Gauß-Seidel method

9.1.3 SOR method


9.1.4 SLOR method

9.1.5 Red-Black SOR method


9.1.5 Zebra line SOR method
9.1.6 Incomplete LU decomposition : Stone’s method

Idea : an approximate LU factorization as the iteration matrix M

M = LU = A + N

Strongly implicit procedure (Stone)

N (non-zero elements on diagonals corresponding to all non-zero diag. of LU )


Nu~0
u*NW ~ a ( uW + uN – uP ), u*SE ~ a ( uS + uE – uP )
a<1
9.1.7 ADI method
Elliptic problem Æ parabolic problem

trapezoidal rule in time and CDS in space

at time step n+1

The last term ~ O((dt)3)

alternating direction implicit (ADI) method

splitting or approximate factorization methods


9.2 Conjugate Gradient (CG) method
Non-linear solvers Newton-like methods
global methods descent method

Minimization problem

A: positive definite
Steepest descents
Conjugate gradient method

with p1 and p2 conjugate

condition number of A

preconditioning
C-1AC-1Cp=C-1Q
9.3 Multi Grid method
Spectral view of errors
Fourier modes
Restriction
Interpolation
Coarse grid scheme
V-cycle, W-cycle & FMV scheme
9.4 Non-linear equations and their solution
9.4.1 Newton‘s method
linearization

new estimate

y
y = f(x)

x0

o
x1 x
Newton‘s method
System of non-linear equations

linearization

Matrix of the system: the Jacobian

The system of equations


9.4.2 Other techniques
Picard iteration approach

Newton‘s method
9.5 Examples
Transonic flow over an airfoil
11 Incompressible Navier Stokes (NS) equations
11.1.0 Incompressible fluid

Incompressible fluid flow Compressible fluid flow


Ma < 0.3 Ma > 0.3

density variation d ~ Ma2


Mach number Ma = (v/c)
v : velocity, c : sound speed
ex.
Ma < 0.3
c air (101.3hPa, 300K) ~ 340 m/s, v < 100 m/s ( 360 km/h ),
c water ~ 1000 m/s, v < 300 m/s.
11.1.1 Dynamic similitude

Reynolds number
ρul ul
Re = =
η ν
u : velocity scale, l : length scale, v : kinematic viscosity
ex.
U = 10 m/s, L = 1 m, v = 0.15 St, Re ~ 105.
U = 0.1 m/s, L = 100 m, Re ~ 105.
11.2 The pressure Poisson equation method
Governing equations

Navier-Stokes equations

Explicit Euler method

Pressure Poisson equation


11.3 The projection method
A system of two component equations

The pressure P Æ a projection function

The projection step (BTCS)

Poisson equation with the Neumann boundary condition :


11.4 Implicit Pressure-Correction method
The momentum equations (implicit method) Discrete Poisson equation for the pressure :

Outer iteration (iterations within one time step):


Pressure-correction

Modification of the pressure field


The relation between the velocity and pressure
The (tentative) velocity at node P
corrections :

For convenience,

The discretized continuity equation Pressure-correction equation :

The (final) corrected velocities and pressure :


Common practice; neglect unknowns ~u‘
SIMPLE algorithm
more gentle way Æ
Implicit Pressure-Correction method
Approximate u‘ by a weighted mean of the Neglect ~u‘ in the first correction step.
neighbour values The second correction to the velocity u‘‘ :

Approximate ~u‘ by : The second pressure correction equation:

Approximate relation between u‘ and p‘ : Essentially an iterative method for pressure-


correction equation with the last term treated
explicitly;
PISO algorithm
The coefficient in the pressure-correction
equation A Æ A + ...
And the last term disappears. Pressure-correction with the last term neglected.
SIMPLEC algorithm p‘ Æ correct the velocity field to obtain umi.
The new pressure field is calculated from
pressure equation using ~ umi instead of ~ um*i
SIMPLER algorithm (Patankar 1980)
Implicit Pressure-Correction method
The SIMPLE algorithm does not converge rapidly due to the neglect of ~u‘ in the pressure-
correction equation.It has been found by trial and error that convergence can be improved if :

SIMPLEC, SIMPLER and PISO do not need under-relaxation of the pressure-correction.


An optimum relation between the under-relaxation factors for v and p :
The velocities are corrected by

i.e., ~u‘ is neglected. By assuming that the final pressure correction is app‘ :

By making use of correction equation, expression for ap:

If we use the approximation used in SIMPLEC, the equation reduces to :

In the absence of any contribution from source terms, if a steady solution is sought,
ap = 1 - av
which has been found nearly optimum and yields almost the same convergence rate as
SIMPLEC method.
11.5 Other methods
11.5.1 Streamfunction-vorticity methods

Stream function

Kinematic equation

Vorticity transport equation

-NS equations have been replaced by a set of two PDEs.


-A problem : the boundary conditions, especially in complex geometries.
-The values of the streamfunction at boundaries.
-Vorticity at the boundary is not known in advance.
-Vorticity is singular at sharp corners.
11.5.2 Artificial compressibility methods
Artificial continuity equation

beta : an artificial compressibility parameter


The pseudo-sound speed:

should be much much faster than the vorticity spreadsÆcriterion on the


lowest value of beta. Typical values are in the range between 0.1 and 10.
Obviously,

should be small.
12 Some remarks on incompressible flows

Das könnte Ihnen auch gefallen