Beruflich Dokumente
Kultur Dokumente
These slides are based on the recommended textbook: Culbert B. Laney. Computational
Gas Dynamics, CAMBRIDGE UNIVERSITY PRESS, ISBN 0-521-62558-0
Outline
1 Conservative Finite Difference Methods in One Dimension
2 Forward, Backward, and Central Time Methods
3 Domain of Dependence and CFL Condition
4 Linear Stability Analysis
5 Formal, Global, and Local Order of Accuracy
6 Upwind Schemes in One Dimension
7 Nonlinear Stability Analysis
8 Multidimensional Extensions
Recall that scalar conservation laws are simple scalar models of the Euler equations that can
be written in strong conservation form as
u
f (u)
+
=0
t
x
(1)
Suppose that a 1D space is divided into grid points xi and cells [xi1/2 , xi+1/2 ], where
xi+1/2 is called a cell edge
n
\
u
n
n
= (fi+1/2 fi1/2 )
t i
(2)
where the subscript i designates the point xi , the superscript n designates the time t n , a
hat designates a time-approximation, and
=
t
,
x
t = t
n+1
t ,
x = xi+1/2 xi1/2
xi+1/2
[u(x, t n+1 ) dx
u(x, t n )] dx
xi1/2
1
x
t n+1
tn
[f u(xi+1/2 , t) f u(xi1/2 , t) ] dt
=
=
\
u
n
n
n+1
n+1
(uiK
, ..., ui+K
; uiL
, ..., ui+L
)
1
2
1
2
t
n
n
n+1
n+1
f(uiK
+1 , ..., ui+K ; uiL +1 , ..., ui+L )
1
(3)
(4)
=
=
\
u
n
n
(uiK
, ..., ui+K
; uin+1 )
1
2
t
n
n
f(uiK
+1 , ..., ui+K )
1
u(x, 0)
0
1
0
if x < 0
if x 0
ui0
where as before, =
n
(1 + a)uin aui+1
1 if i < 0
u(ix, 0) =
0 if i 0
t
x
AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS
Then
ui1
ui2
1
1 + a
if i 2
if i = 1
if i 0
1
if i 3
(1 + a)(1 a) if i = 2
=
(1 + a)(1 + a) if i = 1
0
if i 0
and so forth
The first two time-steps reveal that FTFS moves the jump in the
wrong direction (left rather than right!) and produces spurious
oscillations and overshoots
Furthermore, the exact solution yields u(0, t) = 1, but FTFS yields
u01 = 0!
AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS
t
=
on the left by a line of slope
and on the right by a line of slope
K1 x
K1
t
=
K2 x
K2
a
K2 a K1
which requires that waves travel no more than K1 points to the right or K2
points to the left during a single time-step
AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS
In 1D, the Euler equations have three families of waves that define
the physical domain of dependence
For each family of waves, a CFL condition of a given numerical
method can be established as in the case of a scalar conservation
law: Then, the overall CFL condition is the most restrictive of all
established CFL conditions
For example, if K1 = K2 = K , A is the Jacobian matrix of the
conservative flux vector, and (A) denotes
its spectral radius
(A) = max (|vx a|, |vx |, |vx + a| , the CFL condition
of an
explicit forward-time method becomes recall (22)
(A) K
(A) is called the CFL number or the Courant number
(A) K
For supersonic flows, all waves travel in the same direction, either
left or right the minimum stencil allowed by the CFL condition
n
contains either Wi1
and Win for right-running supersonic flow, or
n
Win and Wi+1
for left-running supersonic flow
For subsonic flows, waves travel in both directions, and the
n
n
minimum stencil should always contain Wi1
, Win , and Wi+1
Hence, a smart or adaptive stencil can be useful for the case of the
Euler equations!
The Fourier series for the continuous (in space) solution u(x, t n ) on
any spatial domain [a, b] is
X
X
x a
x a
n
n
+
u(x, t n ) = a0n +
am
cos 2m
bm
sin 2m
ba
ba
m=1
m=1
(5)
For the discrete solution uin u(xi , t n ), the Fourier series is obtained
by sampling (5) as follows
X
X
xi a
xi a
n
n
uin = a0n +
am
cos 2m
+
bm
sin 2m
(6)
ba
ba
m=1
m=1
Assume xi+1 xi = x = cst, x0 = a, and xN = b xi a = ix
and b a = Nx: This transforms (6) into
X
i
i
n
n
uin = a0n +
am
cos 2m
+ bm
sin 2m
(7)
N
N
m=1
AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS
a0n
N/2
X
2mi
2mi
n
n
+ bm sin
+
am cos
N
N
m=1
N/2
X
Cmn e I
2mi
N
m=N/2
N/2
X
uinm
(8)
m=N/2
From (7), (8), and Eulers formula e I = cos + I sin it follows that
C0n = a0n ,
Cmn =
n
n
am
Ibm
,
2
n
Cm
=
n
n
am
+ Ibm
2
2mi
N
) = C n e I m i
m
2m
and m = N/2, , N/2
N
Because of linearity the amplification factor
where m =
Gm =
Cmn+1
= Gm ()
Cmn
Cmn
Cm2 Cm1 0 I m i
C e
= Gm Gm Cm0 e I m i = Gmn Cm0 e I m i
Cm1 Cm0 m
Cmn1
n
AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS
t
x
Application (in class): apply the von Neumann analysis to determine
the stability of the FTFS scheme for the linear advection equation
Each of the above conclusion can be re-written in terms of =
where
u n = M n ()u 0
Suppose that M is diagonalizable
M() = Q 1 ()Q,
Then
M n () = Q 1 n Q (Qu)n = n ()(Qu)0
Conclusions
the linear approximation is linearly stable if (M()) < 1
it is neutrally linearly stable if (M()) = 1
it is linearly unstable if (M()) > 1
(9)
suppose that B is diagonalizable and transform equation (9) into the set of
independent scalar equations
dvi
+ i (x)vi = 0,
dt
i = 1, , N
Cx
p
Other error measures can be obtained by using the 1-norm, 2-norm,
or any vector norm, or if the error is measured pointwise
for some constant Cx and the related constant Ct =
log(ke2 k /ke1 k )
log(ke2 k /ke1 k )
=
log(x2 /x1 )
log(t2 /t1 )
t
, and the
Now, let t 0 and x 0 while maintaining =
x
initial and boundary conditions fixed: Then, a method is said to
have local p-th order of accuracy (in space and time) if
k
ei k Cx x p = Ct t p
Cx
for some constant Cx and the related constant Ct = p
Upwinding does not ensure shock avoidance if the shock does not
reverse the wind
downwinding on the right above avoids the shock but violates the
CFL condition and thus would create larger errors than crossing the
shock would
General remarks
upwind methods are popular because of their excellent shock
capturing ability
among simple FT or BT methods, upwind methods outdo centered
methods: However, higher-order upwind methods often have no
special advantages over higher-order centered methods
du
f + (u) + f (u)
df
0,
0
du
This is the case only for scalar conservation laws away from sonic
points, and for the supersonic regime in the Euler equations
f +
Assume that
is discretized with a leftward bias so that the
x
approximation at x = xi is centered or biased towards x = xi1/2
f +
x
+
fi1/2
+
for some fi1/2
f
Assume that
is discretized with a rightward bias so that the
x
approximation at x = xi is centered or biased towards x = xi+1/2
f
x
fi+1/2
Proof
(10)
+
uin+1 = uin (fi1/2
+ gin gin + fi+1/2
)
n
n
compare with the conservation form uin+1 = uin (fi+1/2
fi1/2
)
n
= fi+1/2
= fi+1/2
+ gin ,
n
+
fi1/2
= fi1/2
+ gin
n
= fi+1/2
= fi+1/2
gin ,
+
n
fi1/2
= fi1/2
+ gin
+
n
= fi+1/2
+ fi+1/2
= gi+1
gin
u2
u
u
= max(0, u) + min(0, u)
2
2
|
{z
} | {z 2}
f + (u)
f (u)
(max(0, u)u)
x
x
i
f
a forward-space approximation of
gives
x
n
n
n
min(0, ui+1
)ui+1
min(0, uin )uin
(min(0, u)u)
x
x
i
combining these with a FT approximation yields
n
n
)ui1
)
uin+1 = uin (max(0, uin )uin max(0, ui1
2
n
n
(min(0, ui+1
)ui+1
min(0, uin )uin )
2
AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS
1 n 2
(ui )
2
df
u = a(u)u
du
a+ (u)
a+ (u) + a (u)
0,
a (u) 0
u
Assume that a+
is discretized with a leftward bias so that the
x
approximation at x = xi is centered or biased towards x = xi1/2
n
n
uin ui1
+n
+ u
a
ai1/2
x i
x
u
Assume that a
is discretized with a rightward bias so that the
x
approximation at x = xi is centered or biased towards x = xi+1/2
n
n
ui+1
uin
u
n
a
ai+1/2
x i
x
Using forward Euler to perform the time-discretization leads to
n
+
n
n
uin+1 = uin ai+1/2
(ui+1
uin ) ai1/2
(uin ui1
)
The flux split form and wave speed form are connected via
n
n
fi+1/2
= ai+1/2
(ui+1
uin )
+
n
n
(ai+1/2
+ ai+1/2
)(ui+1
uin ) = gi+1
gin for some flux function gin
(11)
+n
n
n
fi1/2
= ai1/2
(uin ui1
) + gin
(12)
+
n
n
uin+1 = uin ai+1/2
(ui+1
uin ) ai1/2
(uin ui1
)
The above notation for the wave speed split form is the standard
notation when wave speed splitting is used to derive new
approximation methods
Wave speed split form is also often used as a preliminary step in
nonlinear stability analysis, in which case the standard notation is
n
+
n
n
uin+1 = uin + Ci+1/2
(ui+1
uin ) Ci1/2
(uin ui1
)
Hence
n
+
Ci+1/2
= ai+1/2
,
+
+
Ci1/2
= ai1/2
Ci+1/2
= ai+1/2
(13)
C + (u) 0, C (u) 0
+
n
n
(Ci+1/2
Ci+1/2
)(ui+1
uin ) = (gi+1
gin )
+
n
n
fi+1/2
= Ci+1/2
(ui+1
uin )+gin ,
n
n
fi1/2
= Ci1/2
(uin ui1
)+gin
i=
t2 t1
n
|ui+1
uin |
i=
+
n
n
uin + Ci+1/2
(ui+1
uin ) Ci1/2
(uin ui1
)
+
Ci+1/2
and Ci+1/2
0
Ci+1/2
0
+
and Ci+1/2
+ Ci+1/2
1 i
(14)
n
uin+1 = uin + Ci+1/2
(ui+1
uin ) Ci1/2
(uin ui1
)
+
n
where Ci+1/2
= ai+1/2
and Ci1/2
=0
+
n
hence Ci+1/2 + Ci+1/2 = ai+1/2 and therefore the condition (14)
n
becomes in this case 1 ai+1/2
0
also, note that the positivity condition is in this case equivalent to
the CFL condition
2D structured grid
W
Fx
Fy
+
(W ) +
(W ) = 0
t
x
y
For the above 2D Euler equations, the equivalent of equation (2) on
a 2D structured grid is
\n
W
= x (Fxni+1/2,j Fxni1/2,j ) y (Fyni,j+1/2 Fyni,j1/2 )
t
t i,j
where
x
xi
t
t
, y =
xi
yj
xi+1/2,j xi1/2,j j,
yj = yi,j+1/2 yi,j1/2 i
1
(vx2 )i+1,j + (vx2 )i,j + pi+1,j + pi,j
1
(vx vy )i,j+1 + (vx vy )i,j
=
2
2