Sunteți pe pagina 1din 32

Computational Fluid Dynamics

II. Basic Discretization Methods


C.-D. Munz
Universitt Stuttgart, Institut fr Aerodynamik und
Gasdynamik
Pfaffenwaldring 21, 70550 Stuttgart
Tel. +49-711/685-63401 (Sekr.)
Fax +49-711/685-63438
e-mail munz@iag.uni-stuttgart.de
Contents
I. Equations
II. Basic Discretization Methods
1. Finite Difference Schemes
2. Finite Volume Schemes
3. Finite Element Schemes
4. Grids Discretization in Space
III. Numerical Gasdynamics and Finite Volume
Schemes
VI. Numerical Solution of Incompressible and Weakly
CompressibleFluid Flow
1. Finite Difference (FD) Schemes
x
u(x) x) u(x
lim (x) u
0 x
+
=

1. Step: Discretize computational domain (Grid)


2. Step: Choose finite differences and replace
derivatives by finite differences
3. Step: Order the difference equations
4. Step: Solve the system of difference equations
Basic idea:
Replace derivatives by difference quotients
PDE,ODE System of algebraic equations
PDE: partial differential equation, ODE: ordinary differential equation
Finite Differences
Taylor expansions
(1)
(2)
( ) ( ) ( ) ( ) ( ) K +

=
i
3
i
2
i i 1 i
x u
6
x
x u
2
x
x u x x u x u
( ) ( ) ( ) ( ) ( ) K +

+ =
+ i
3
i
2
i i 1 i
x u
6
x
x u
2
x
x u x x u x u
Difference quotient for derivative: (2) (1)
( ) ( ) ( ) ( ) ( )
5
i
3
i 1 i 1 i
x O x u
6
x 2
x u x 2 x u x u +

=
+
( ) ( )
( ) ( )
2
i
1 i 1 i
x O x u
x 2
x u x u
+

+
( ) ( )
( ) ( ) x O x u
x
x u x u
i
i 1 i
+

+
( ) ( )
( ) ( ) x O x u
x
x u x u
i
1 i i
+


central difference 2nd order
right-sided difference 1st order
left-sided difference 1st order
Finite difference for 2nd derivative: (1) + (2) + 2y(x
i
)
( ) ( ) ( )
( ) ( )
2
i
2
1 i i 1 i
h O x u
h
x u x 2u x u
+

=
+

+
( ) ( ) ( ) ( )
( )
( ) ( )
2
i
IV
4
i
2
1 i i 1 i
h O x u
12
h
x u h x u x 2u x u + +

= +
+
central difference quotient, 2nd order.
Finite differences of higher order need more than 3 points
Taylor expansion gives consistency = guarantee of
approximation assumption: u smooth enough
Conclusion Finite Differences
Approximate values are values at grid points
Simple coding also for complicated equations
Multidimensional extension is straightforward on Cartesian
grids
Extension to structured grids
Solution has to be smooth enough and can be approximated
by a smooth approximation
u
x
2. Finite Volume (FV) Schemes
( ) [ ] T , 0 D in 0 u f u
t
= +
smooth piecewise C boundary
k j fr C C , C D
j
k j j
j

= =
U
i
C
Discretization of space
Grid
Numerical scheme for conservation equations
( ) ( ) dt dS n t , x u f u C u C
1 n
n j
t
t C
n
j j
1 n
j j

+

+
=
r
[ ]
1 n n j
t , t C over n Integratio
+

Evolution equations for integral mean values


Direct approximation of the integral conservation law
Basic Basic Basic Basic parts parts parts parts:
1. Discretization in space (quite general grids)
2. Reconstruction of local values
3. Appropriate approximation of the flux, numerical flux
Finite Volume Scheme in One Space Dimension

+ +

+ +

= +
1 n
n
1/2 i
1/2 i
1 n
n
1/2 i
1/2 i
t
t
x
x
x
t
t
x
x
t
0 dxdt t)) f(u(x, t)dx (x, u
( ) 0 u f u
x t
= +
Conservation equation
t
1 i
x
i
x
1 + i
x
1 n
t
+
n
t
x
t
2 / 1 i
x

2 / 1 i
x
+ i
x
Integration over [x
i-1/2
,x
i+1/2
]x[t
n
,t
n+1
]:

+ +

= +
+ +
1 n
n
1/2 i
1/2 i
t
t
1/2 i 1/2 i
x
x
n 1 n
0 t))dt , f(u(x - t)) , f(u(x )dx t u(x, - ) t u(x,
) g - (g
x
t
u u
n
1/2 - i
n
1/2 i
n
i
1 n
i +
+
=
flux numerical called is g
1/2 i+
Conclusions Finite Volume Schemes
Approximation of integral values
Consistent with integral conservation
No continuity assumption approximation of the integral
conservation law
Flux calculation is the basic building block based on
local wave propagation - Shock-capturing possible
Reconstruction to get local data
general grids
stable approximation of
underresolved phenomena
u
x
3. Finite Element (FE) Schemes
Approximation is a function usually continuous

=
=
N
1 i
i i h
(x) (t) c t) (x, u
basis functions
DOF
The DOFs are determined in such a way that the trial
function becomes a good approximation
Discretization in function space
here, for time
dependent problems
DOF = degrees of freedom (time dependent)
trial function
Often Used Basis Functions
Basis functions are defined to be local, e.g.,
nodal basis: DOF are values at some points of the grid cell
hat functions
modal basis: Coefficients of polynomials
= (x)
i
i 1 i i
x x x fr ) x (x
h
1
1 < < +

1 i i i
x x x fr ) x (x
h
1
1
+
< <
otherwise 0
Approximate Solution (Piecewise Linear)
Calculation of DOFs
Method of Ritz
The problem may be formulated as a
variational problem, too. Solve the variational
problem for the trial function
Collocation
The approximate solution solves the problem
at some points exactly:
Number of points = number of DOFs
Method of weighted residuals: Trial function
is inserted, DOFs are determined to minimize
the residual with respect to
Galerkin method: Orthogonality
Least squares method: Least sqare deviation
Calculation of DOFs
Method of Ritz
The problem may be formulated as a
variational problem, too. Solve the variational
problem for the trial function
Collocation
The approximate solution solves the problem
at some points exactly:
Number of points = number of DOFs
Method of weighted residuals: Trial function
is inserted, DOFs are determined to minimize
the residual with respect to
Galerkin method: Orthogonality
Least squares method: Least sqare deviation
Conclusion Finite Elements
- Data as degrees of freedom
of a trial function
- Difficult coding
- General grids
- Problems at strong gradients
- Continuous solutions and
approximations
u
Very recent approach: Discontinuous Galerkin schemes
for future aerodynamic codes ?
4. Grids Discretization in Space
The use of the grid may be different for different discretizaiton
methods
Finite differences
grid points with
approximate values
Finite volumes
Grid cells with
approximate
integral means
Finite elements
Support of trial
function


n
1
i i
a
Cartesian Grids
Simple generation
Good data management
Adaptation difficult
Limited to simple geometries
Curved boundary treatment on Cartesian
meshes possible, but difficult
equidistant non equidistant
Transformation of the equations from physical to logical space
( ) ( ):
r
)
r
u x u
2 , 1 with
2
2
1
1
=

m u
x
x
u
x
x
u
m m m

2 m
2
1 m
1
m
x x x

Derivatives:
Example continuity equation:
( )
( ) ( )
0

0
2
1
2
2
1
1
2
1
=

=
=
m
m
m
m
m
m
m
m
u
x
u
x t
x
u
t



Boundary-fitted Structured Grids
Requirement: Bijective transformation to a Cartesian grid
) , ( ) x , x ( : T
2 1 2 1

Function:
physical coordinates
logical coordinates
Boundary-fitted Structured Grid (H-Grid)
Transformation to a Cartesian grid

y
x
a b c d a b c d

y
x
e
a = a c b = b
d
f
f d e
a a c b b
Boundary-fitted Structured Grid (C-Grid)

y
x
d a = a b c = c
c c d
a a b
Boundary-fitted Structured Grid (O-Grid)
Unstructured Grids
Best approach for complex geometries
Usual triangles and quadrilaterals in 2D or tetrahedrons
and hexahedrons in 3D
Dual Grid
Grid cell edges of the dual grid cell is
defined by the lines between
barycenters and midpoints of edges of
the primal grid
e.g., implemented in Tau-Code of DLR
Airbus code for unstructured grids
flow direction
fan
spinner
Noise calculation of the inlet of turbo engine by solving
the linearized Euler equations
mean flow given by
RANS simulation
Source terms are
given by LES
Cooperation with
F. Thiele, Berlin
Numerical Results
Block-Structured Chimera-Type
Finite Difference (FD) Mesh
(5,469,928 points / DOF)
Mesh generation time: days
Fully Unstructured Tetrahedral
Discontinuous Galerkin (DG) Mesh
(123,304 elements 2,466,080 DOF)
Mesh generation time: 55 s.
FD results (6.0 CPUh / ms) DG results (2.2 CPUh / ms)
Numerical Methods on Unstructered Grids
Methods for unstructered grids:
Finite volumes
Finite elements
The data management needs much more
overhead: Information about neighbors, edges, ..
Adaptation technically simple
Fluid Flow around a Sphere
Flexibility of Discontinuous Galerkin Schemes
our calculations
Literatur - Grundlagen
C.-D. Munz, T. Westermann: Numerische Behandlung
von gewhnlichen und partiellen Differenzial-
gleichungen, Springer-Verlag 2009, auch als e-book
ohne CD erhltlich
C.Hirsch: Numerical Computation of Internal and
External Flows, 2nd edition, Elsevier John Wiley and
Sons 2007
K. A. Hoffmann, S. T. Chiang: Computational Fluid
Dynamics for Engineers, Vol. I

S-ar putea să vă placă și