You are on page 1of 15

2.

29 Numerical Fluid Mechanics



Fall 2011 Lecture 15

REVIEW Lecture 14:

Finite Difference: Boundary conditions


Different approx. at and near the boundary => impacts linear system to be solved

Finite-Differences on Non-Uniform Grids and Uniform Errors: 1-D


If non-uniform grid is refined, error due to the 1st order term decreases faster than
that of 2nd order term
Convergence becomes asymptotically 2nd order (1st order term cancels)

Grid-Refinement and Error estimation


Estimation of the order of convergence and of the discretization error
Richardsons extrapolation and Iterative improvements using Roombergs algorithm

Fourier Analysis of canonical PDE

f n f
d f k (t )
n
n
Generic PDE:
n , with f ( x, t ) f k (t ) ei kx
ik f k (t ) f k (t ) for ik
t x
dt
k

Differentiation, definition and smoothness of solution for order n of spatial

operators

2.29

Numerical Fluid Mechanics


1

PFJL Lecture 15,

Outline for TODAY (Lecture 15):

FINITE DIFFERENCES, Contd

Fourier Analysis and Error Analysis


Stability
Heuristic Method
Energy Method

Von Neumann Method (Introduction): 1st order linear convection/wave eqn

Hyperbolic PDEs and Stabilty


Example: 2nd order wave equation and waves on a string
Effective numerical wave numbers and dispersion

CFL condition:
Definition
Examples: 1st order linear convection/wave eqn, 2nd order wave eqn
Other FD schemes

Von Neumann examples: 1st order linear convection/wave eqn


Tables of schemes for 1st order linear convection/wave eqn
2.29

Numerical Fluid Mechanics


2

PFJL Lecture 15,

References and Reading Assignments



Lapidus and Pinder, 1982: Numerical solutions of PDEs in
Science and Engineering. Section 4.5 on Stability.
Chapter 3 on Finite Difference Methods of J. H. Ferziger
and M. Peric, Computational Methods for Fluid Dynamics.
Springer, NY, 3rd edition, 2002
Chapter 3 on Finite Difference Approximations of H. Lomax,

T. H. Pulliam, D.W. Zingg, Fundamentals of Computational


Fluid Dynamics (Scientific Computation). Springer, 2003
Chapter 29 and 30 on Finite Difference: Elliptic and Parabolic
equations of Chapra and Canale, Numerical Methods for
Engineers, 2010/2006.

2.29

Numerical Fluid Mechanics


3

PFJL Lecture 15,

Fourier Error Analysis: 1st derivatives


In the decomposition:

f ( x, t )

Exact

All components are of the form:


1st

f k (t ) ei kx

f k (t ) ei kx

f k (t ) ei kx

order spatial derivative:


f k (t ) ik ei kx f k (t ) ik ei kx
x

However, if we apply the centered finite-difference (2nd order accurate):


f j1 f j1
f

x
2x

j
ei kx
e


x j

i k (x j x )

where keff

e
2x

i k (x j x )

i kx

e i kx e
2x

sin(k x )

i kx j

sin(kx) i kx j
i kx
e i keff e j
x

(uniform grid resolution x)

keff = effective wavenumber



For low wavenumbers (smooth functions): keff

sin(k x )
k 3x 2

k
...
x
6

Shows the 2nd order nature of center-difference approx. (here, of k by keff)


2.29

Numerical Fluid Mechanics


4

PFJL Lecture 15,

Fourier Error Analysis, Contd:

Effective Wave numbers



Different approximations

ei kx
x

have different effective wavenumbers

3
2
sin(k

x
)
k
x
CDS,
order: keff
k
...
x
6
CDS, 4th order: keff sin(k x) 4 cos(kx)
3x
Pade scheme, 4th order: i keff 3 i
sin(kx)
2 cos(k x ) x

2nd

kmax x

Note that keff is bounded: 0 keff k max

Springer. All rights reserved. This content is excluded


from our Creative Commons license. For more information,
see http://ocw.mit.edu/fairuse.
Source: Lomax, H., T. Pulliam, and D. Zingg.
Fundamentals of Computational Fluid Dynamics. Springer, 2001.

k max

2.29

Numerical Fluid Mechanics

PFJL Lecture 15,

Fourier Error Analysis, Contd



Effective Wave Speeds

Different approximations

ei kx
x also

lead to different effective wave speeds:

f
f

c
0
Consider linear convection equations:
t

i k x t
f (x, t ) f k (0) e
f k (0) ei k (x c t )
For the exact solution:
k

For the numerical sol.: if f f

num .
k

(t )e

i kx

num.
k

df

dt

i kx j

num.
k

(since i k c)

ei kx
i kx j
num .
(t ) c

f
i
k
e
(
t
)
c
k
eff

x j

which we can solve exactly (our interest here is only error due to spatial approx.)

f knum. (t ) f k (0)e i keff c t

f numerical ( x, t )

ceff
c

eff keff

f k (0) ei k x i keff c t

ceff

f k (0) ei k (x ceff t )

(defining eff i keff c i k ceff

Often, ceff / c < 1 => numerical solution is too slow.


Since ceff is a function of the effective wavenumber,
the scheme is dispersive (even though the PDE is not)

2.29
Numerical Fluid Mechanics

Springer. All rights reserved. This content is excluded


from our Creative Commons license. For more information,
see http://ocw.mit.edu/fairuse.
Source: Lomax, H., T. Pulliam, and D. Zingg.
Fundamentals of Computational Fluid Dynamics. Springer, 2001.

PFJL Lecture 15,

Evaluation of the Stability of a FD Scheme


Recall: x L ( ) Lx ( ) Lx ( ) Stability:

Heuristic stability:

Lx1 Const. (for linear systems)

Stability is defined with reference to an error (e.g. round-off) made in


the calculation, which is damped (stability) or grows (instability)
Heuristic Procedure: Try it out
Introduce an isolated error and observed how the error behaves

Requires an exhaustive search to ensure full stability, hence mainly
informational approach

Energy Method
Basic idea:

n
Find a quantity, L2 norm e.g. j

Shows that it remains bounded for all n

Less used than Von Neumann method, but can be applied to


nonlinear equations and to non-periodic BCs

Von Neumann method (Fourier Analysis method)


2.29

Numerical Fluid Mechanics


7

PFJL Lecture 15,

Evaluation of the Stability of a FD Scheme


Energy Method Example


Consider again:

0
c
t
x

A possible FD formula (upwind scheme for c>0):


(t = nt, x = jx) which can be rewritten:
jn 1 (1 ) jn jn1 0 with

jn1 jn
t

n
jn j1

t
c t
x

For the rest of this derivation, please see equations 2.18 through 2.22 in
Durran, D. Numerical Methods for Wave Equations in Geophysical Fluid
Dynamics. Springer, 1998. ISBN: 9780387983769.

2.29

Numerical Fluid Mechanics


8

PFJL Lecture 15,

Evaluation of the Stability of a FD Scheme


Energy Method Example


For the rest of this derivation, please see equations 2.18 through 2.22 in
Durran, D. Numerical Methods for Wave Equations in Geophysical Fluid
Dynamics. Springer, 1998. ISBN: 9780387983769.

2.29

Numerical Fluid Mechanics


9

PFJL Lecture 15,

Von Neumann Stability


Widely used procedure
Assumes initial error can be represented as a Fourier Series and
considers growth or decay of these errors
In theoretical sense, applies only to periodic BC problems and to
linear problems
Superposition of Fourier modes can then be used

Again, use, f ( x, t )

f k (t ) e

i kx

but for the error: ( x, t )

ix

(
t
)
e

Being interested in error growth/decay, consider only one mode:


( t ) e i x e t e i x

where is in general complex and function of : ( )

Strict Stability: for the error not to grow in time,

e t 1

in other words, for t = nt, the condition for strict stability can be written:
e t 1 or for e t ,

von Neumann condition

Norm of amplification factor smaller than 1


2.29

Numerical Fluid Mechanics


10

PFJL Lecture 15,

10

Evaluation of the Stability of a FD Scheme


Von Neumann Example


0
c
t
x

Consider again:

A possible FD formula (upwind scheme)


(t = nt, x = jx) which can be rewritten:

jn1 jn
t

jn 1 (1 ) jn jn1 with

jn nj1
x

0
n+1

c t
x

n
j-1

Consider the Fourier error decomposition (one mode) and discretize it:

( x, t ) (t ) ei x e t ei x nj e nt ei jx

Insert it in the FD scheme, assuming the error mode satisfies the FD:

n1
(1 ) nj nj1
j

e (n1) t ei jx (1 ) e nt ei jx e nt ei ( j1)x

Cancel the common term (which is nj e nt ei jx ) and obtain:


e t (1 ) e i x
2.29

Numerical Fluid Mechanics


11

PFJL Lecture 15,

11

Evaluation of the Stability of a FD Scheme


von Neumann Example


The magnitude of e t is then obtained by multiplying with its


complex conjugate:

ei x e i x
(1 ) e
(1 ) e 1 2 (1 ) 1

ei x e i x
x
Since
cos( x) and 1 cos( x) 2sin 2 (
)
2
2

x
2
1 2 (1 ) 1 cos( x ) 1 4 (1 ) sin 2 (
)
2
2

i x

i x

Thus, the strict von Neumann stability criterion gives


1 1 4 (1 )sin 2 (

Since sin 2 (

x
2

) 0

x
2

) 1

1 cos( x) 0

we obtain the same result as for the energy method:


c t
1 (1 ) 0 0
1
x
2.29

Numerical Fluid Mechanics


12

c t
(
)
x

Equivalent to the
CFL condition
PFJL Lecture 15,

12

Partial Differential Equations



Hyperbolic PDE:
B2 - 4 A C > 0

(from Lecture 12)

Examples:

2
2u
2 u
c
(1)
x 2

t 2
u
u

(2)
c
0
t
x
u
(3)
(U ) u g
t

Wave equation, 2nd order


Sommerfeld Wave/radiation equation,
1st order
Unsteady (linearized) inviscid convection
(Wave equation first order)

(4) (U ) u g

Steady (linearized) inviscid convection

Allows non-smooth solutions

Information travels along characteristics, e.g.:


For (3) above:

d xc
U( x c (t ))
dt

For (4), along streamlines:

d xc
U
ds

Domain of dependence of u(x,T) = characteristic path


e.g., for (3), it is: xc(t) for 0< t < T

Finite Differences, Finite Volumes and Finite Elements


2.29

Numerical Fluid Mechanics


13

x, y
PFJL Lecture 15,

13

Partial Differential Equations



Hyperbolic PDE

(from Lecture 12)

Waves on a String
2u ( x, t )
t 2

2u( x, t )
c
0 x L, 0 t
x 2
Initial Conditions
2

uL,t)

u0,t)

Boundary Conditions

Wave Solutions
u(x,0), ut(x,0)

Typically Initial Value Problems in Time, Boundary Value Problems in Space

Time-Marching Solutions: Explicit Schemes Generally Stable

2.29

Numerical Fluid Mechanics


14

PFJL Lecture 15,

14

MIT OpenCourseWare
http://ocw.mit.edu

2.29 Numerical Fluid Mechanics


Fall 2011

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

You might also like