Numerical Methods for Conservation Laws , WPI Spring 2006
Post on 13-Feb-2017
215 Views
Preview:
Transcript
Numerical Methods for ConservationLaws
WPI, January 2006
C. Ringhofer
ringhofer@asu.edu,C2b2
2 h2∂xu http://math.la.asu.edu/∼chris
Last update: Jan 24, 2006
1
LITERATURE
1. Numerical Methods for Conservation Laws, by Randall J.
LeVeque, Birkhauser-Verlag, Basel, 1990. ISBN 3-7643-
2464-3
2. J. Strickwerda: Finite difference schemes and partial dif-
ferential equations, Wadsworth and Brooks/Cole, 1992.
2
OUTLINE
6 lectures
Week 1: Mo 11:00-12:30, Tue 12:30-14:00 Wed 11:00-12:30
Week 2: Mo 11:00-12:30, Tue 12:30-14:00 Wed 12:30-14:00
Materials: http://math.la.asu.edu/ chris → Courses
Topics:
L1 Conservation laws and conservative formulation, Differ-
ence methods, Linear waves, Diffusion, Dispersion, CFL
3
conditions. Examples: Wave equations, diffusion equa-tions, Schroedinger equations.
L2 Nonlinear equations, Characteristics, Shocks, Weak so-lutions, The Rankine - Hugoniot condition. Examples:Traffic Flow.
L3 Godunov methods, Local Riemann problems, Shock cap-turing, Systems, local linearization and Roe matrices. Ex-amples: Traffic flow, Fluids, Compressible Euler.
L4 Higher order methods, TVD schemes.
L5 Convergence analysis, Stability and compactness.
L6 Topics: Random methods, Entropy, Boundary conditions.Examples: Boltzmann equations.
LECTURE 1
Conservation Laws
UΩ(t): amount of ’mass’ in Ω at time t
F : flux through the boundary ∂Ω
UΩ(t+∆t) = UΩ(t)−∆t∫∂Ω
F ·n dσ = UΩ(t)−∆t∫Ω∇x ·F dx
Size of |Ω| and ∆t → 0 :
∂tu+∇x · F = 0, UΩ(t) =∫Ωu(x, t) dx
Examples: F = b(u)u (transport), F = −a(u)∇xu (diffusion)
Wave speeds
Linear problems and plane wave solutions
F (u) = bu− a∇xu, u(x, t) = exp[iξ(x− vt)]
4
v : velocity, vξ : frequency
u(x, t) = exp[iξ(x− bt)− a|ξ|2t]
wave speed = b (property of the medium). amplitude dampedwith exp[−a|ξ|2t].
Dispersion:
∂tu+ i∆xu = 0, v = v(ξ) = ξ
wave speed dependent on the frequency!
hyperbolicity ⇐⇒ v only medium dependentdispersivity ⇐⇒ v frequency dependentparabolicity ⇐⇒ exponential damping
Systems: ∂tu+ ∂xj[Aju]
Difference methods always exhibit all three features,
regardless of the type of equation!
Difference methods for advection diffusion equations
A linear example:
∂tu+ ∂x[−a∂xu+ bu] = 0, u(x,0) = uI(x)
Discretization: Grid: xj = jh, j ∈ Z, tn = nk, n ∈ N, ap-
proximate u(xj, tn) ≈ U(xj, tn)
Difference approximation:
U(xj, tn+1) = U(xj, tn)+
k
h2[(a+
h
2b)U(xj−1, tn)− 2aU(xj, tn) + (a−
h
2b)U(xj+1, tn)]
U(xj, t0) = uI(xj)
advance in time: U(∗, tn) → U(∗, tn+1), tn+1 − tn = k
Notation: The translation operator:
Tu(x) = u(x+ h), T−1u(x) = u(x− h)
U(x, t+ k) = 1 +k
h2[(a+
h
2b)T−1 − 2a+ (a−
h
2b)T ]U(x, t)
Linear wave ansatz: U(x, t) = exp[iξ(x− vt)]
exp[−iξvk] = 1− a4k
h2sin2(
ξh
2)− ib
k
hsin(ξh)
e−iξv = qe−iξvr, vr ∈ R
U(x, t) = qt exp[iξ(x− vrt)]
q2k = [1−a4k
h2sin2(
ξh
2)]2+[b
k
hsin(ξh)]2, tan(ξkvr) =
bkh sin(ξh)
1− a4kh2 sin2(ξh2 )
Wave speeds always dependent on frequencies.
For a = 0 waves are always amplified (instability!)
Difference discretizations are always dispersive.
Explicit difference discretizations always need some amountof diffusion to be stable (artificial diffusion).
a = kα, c = kh, z = sin(ξh2 )
q2k = [1− 4αc2z1]2 + b2c2z2(1− z2) ≤ 1, ∀z ∈ [0,1]
⇒ b2c2 ≤ 2akc2 < 1
CFL condition: k|b|h < 1
Artificial diffusion: a = O(k)
Also true for nonlinear problems and problems with non
- constant coefficients!
LECTURE 2
CHARACTERISTICS AND SHOCKS
Characteristics for linear and scalar problems:
∂tu+ a(x, t)∂xu = 0, u(x,0) = uI(x)
Characteristic:
Try to find a solution of the form u(ξ(t), t) = const
d
dtξys(t) = a(ξys, t), ξys(s) = y,
⇒d
dtu(ξys(t), t) = 0, u(ξys(t), t) = u(y, s)
forward: u(ξy0(t), t) = uI(y),
backward: The solution u(x, t) is given by
u(y, s) = u(ξys(t), t) = uI(ξys(0)),
5
Conservative formulation:
∂tu+ ∂x[a(x, t)u] = 0, u(x,0) = uI(x)
Characteristic:
d
dtξys(t) = a(ξys, t), ξys(s) = y,
⇒d
dtu(ξys(t), t) = −u(ξys(t), t)∂xa(ξys(t), t),
d
dtξys(t) = a(ξys, t),
d
dtvys(t) = −vys∂xa(ξys, t),
vys(t) = u(ξys(t), t), ξys(s) = y, vys(s) = u(y, s),
forward:d
dtξy0 = a(ξy0, t),
d
dtvy0 = −vy0∂xa(ξy0, t),
ξy0(0) = y, vy0(0) = uI(y),
Characteristics can never intersect for linear problems!
Find the solution: Given (y, s)
backward solve:
ξ′ys(t) = a(ξys, t), ξys(s) = y → ξys(0) := ξ0ys
forward solve:
v′ys(t) = −∂xa(ξys, t)vys, vys(0) = uI(ξ0ys) → vys(s) = u(ξys(s), s) = u(y, s)
Example: ∂tu+ ∂x[xu] = 0
Nonlinear problems:
∂tu+ ∂xf(x, t, u) = 0, u(x,0) = uI(x)
d
dtξys = ∂uf(ξys, t, vys),
d
dtvys = −∂xf(ξys, t, vys),
For nonlinear problems characteristics can intersect. The
solution will develop a discontinuity (shock)!
Example: Burger’s equation ∂tu+∂xu2
2 = 0, u(x,0) = uI(x)
THE CONCEPT OF WEAK SOLUTIONS
∂tu+ ∂xf(u) = 0, u(x,0) = uI(x) (1)
u discontinuous ⇒ need to re- define derivatives
ψ sufficiently smooth test function, ψ ∈ C∞0
Definition: u is a weak solution of (1) iff∫ ∞0
dt∫dx [u∂tψ+ f(u)∂xψ] = −
∫dx [ψ(x,0)uI(x)] ∀ψ
Remark: u differentiable ⇒ u classical solution.
Example:
∂tu+ ∂x[H(x)u+1
2H(−x)u] = 0, u(x,0) = uI(x)
THE RANKINE - HUGONIOT CONDITION
Relates shockheight to shockspeed if there is a shock.
∂tu+ ∂xf(u) = 0,
Assume:
1. u differentiable away from the shock curve x = γ(t).
2. u is a weak solution.
Implies:
γ′(t)(u+ − u−)(γ(t), t) = (f+ − f−)(γ(t), t)
Example: Traffic flow
∂tu+ ∂x[c(1−u
u0)u] = 0, u(x,0) = uI(x) =
u0 for x > 012u0 for x < 0
LECTURE 3
GODUNOV’S METHOD
Scalar problems:
∂tu+ ∂xf(u) = 0
Equation for averages:
Unj =1
h
∫ xj+1
xju(x, tn)dx , F
nj =
1
k
∫ tn+1
tnf(u(xj, t))dt .
⇒ Un+1j − Unj +
k
h(Fnj+1 − Fnj ) = 0
Up to here exact!Numerical approximation: compute Fnj from Unj−1, U
nj
Piecewise constant approximation: Assume u(x, tn) = Unj forxj < x < xj+1.Solve problem with piecewise constant initial data (the Rie-mann problem) exactly.
6
THE RIEMANN PROBLEM
∂tu+ ∂xf(u) = 0, u(x,0) =
(UL for x < 0UR for x > 0
)
Compute F = 1k
∫ k0 f(u(0, t))dt .
Characteristics: x′ = f ′(u), u′ = 0
Shock curve according to Rankine - Hugoniot:
γ′(UR − UL) = f(UR)− f(UL)
Case 1: f ′(UR) > 0, f ′(UL) > 0 ⇒ F = f(UL)
Case 2: f ′(UR) < 0, f ′(UL) < 0 ⇒ F = f(UR)
Case 3: f ′(UR) < 0 < f ′(UL) and γ′ > 0 ⇒ F = f(UL)
Case 4: f ′(UR) < 0 < f ′(UL) and γ′ < 0 ⇒ F = f(UR)
Case 5: f ′(UL) < 0 < f ′(UR): rarefaction wave and the
Barenblatt solution.
THE BARENBLATT SOLUTION7
∂tu+ ∂xf(u) = 0, set u(x, t) = g(x
t) ⇒ f ′(g(z)) = z
u(x, t) = (f ′)−1(xt ) gives continuous solution in Case 5!
Case 5: f ′(UL) < 0 < f ′(UR) ⇒ F = f(us) with f ′(us) = 0.
us is called the sonic point and u(x, t) = (f ′)−1(xt ) is called a
rarefaction wave.
Godunov:
γ′ :=f(Unj )− f(Unj−1)
Unj − Unj−1
Case 1: f ′(Unj ) > 0, f ′(Unj−1) > 0 ⇒ Fnj = f(Unj−1)
Case 2: f ′(Unj ) < 0, f ′(Unj−1) < 0 ⇒ Fnj = f(Unj )
Case 3: f ′(Unj ) < 0 < f ′(Unj−1) and γ′ > 0 ⇒ Fnj = f(Unj−1)
Case 4: f ′(Unj ) < 0 < f ′(Unj−1) and γ′ < 0 ⇒ Fnj = f(Unj )
Case 5: f ′(Unj−1) < 0 < f ′(Unj ) ⇒ Fnj = f(us) with f ′(us) =
0.
SYSTEMS AND APPROXIMATE RIEMANN SOLVERS
∂tu+ ∂xf = 0, u ∈ RN
Un+1j − Unj +
k
h(Fnj+1 − Fnj ) = 0, Fnj = F (Unj−1, U
nj , v0),
8
Flux Approximation
Solution with approximate flux function fUL,UR
∂tv+ ∂xfUL,UR(v) = 0, v0 := v(xj, t)
Requirements on F and fUL,UR:
Conservation:
F (UL, UR, UL) = f(UL), F (UL, UR, UR) = f(UR),
Shock speeds:
fUL,UR(UR)− fUL,UR(UL) = f(UR)− f(UL) (2)
Set:
F (UL, UR, v) = fUL,UR(v) + f(UL)− fUL,UR(UL) (3)
= fUL,UR(v) + f(UR)− fUL,UR(UR)
Step 1: Find fUL,UR satisfying (2)
Step2: Solve approximate conservation law for v0.
Step3: Compute F according to (3).
Approximate Riemann solvers:
∂tv+∂xfUL,UR(v) = 0, v(x,0) = UL, x < 0, v(x,0) = UR, x > 0
Linear approximation: fUL,UR(v) = A(UL, UR)v
A : Roe matrix
Shock speeds:
A(UL, UR)(UR − UL) = f(UR)− f(UL)
diagonalize A and solve N scalar linear problems.
SOLVING THE CONSTANT COEFFICIENT RIEMANN
PROBLEM FOR SYSTEMS
A(UL, UR)rm = λmrm, Df(UL)rLm = λLmr
Lm, Df(UR)rRm = λRmr
Rm
expand UL, UR in eigenvectors
UL =∑mwLmrm, UR =
∑mwRmrm,
solve
∂twm + λm∂xwm = 0, wm(x,0) =
(wLm for x < 0wRm for x > 0
)
wm(0, t) =
(wLm for λm > 0wRm for λm < 0
), v(0, t) =
∑mwm(0, t)rm
Problem:
Only shock solutions, no rarefaction waves.
except: λLm < 0 < λRm (rarefaction wave)
replace by two shocks: wm(0, t) = ws
conservation:
wLm(kλLm+C)+kwsm(λRm−λLm)+wRm(C−kλRm) = wLm(kλm+C)+wRm(C−kλm)
wsm =wLm(λm − λLm) + wRm(λRm − λm)
λRm − λLm
This is sometimes called the ’sonic fix’.
SUMMARY
Roe matrix:
Anj = A(Unj−1, Unj ), Anj (U
nj − Un−1
j ) = f(Unj )− f(Unj−1)
9
Fnj = f(Unj−1) +Anj (v0 − Unj−1), v0 =
∑mw0mrm
w0m =
(wLm for λm > 0wRm for λm < 0
), Unj−1 =
∑mwLmrm, Unj =
∑mwRmrm
except for the sonic fix:
Df(Unj )rnjm = λnjmrnjm, m = 1, .., N
If λnj−1,m < 0 < λnj,m then
w0m =
wLm(λm − λnj−1,m) + wRm(λnj,m − λm)
λnj,m − λnj−1,m
ONE WAY TO FIND A ROE MATRIX
A(UL, UR) =∫ 1
0Df(UL + s(UR − UL))ds
Example 1: Burger’s equation, f(u) = 12u
2
Example 2: Isothermal flow
f(ρ, φ) =
φφ2
ρ + ρ
,
A(UL, UR) =
(0 1
1− v2 2v
), v =
√φ2LρL
+
√φ2RρR√
ρL +√ρR, vLR =
φLRρLR
LECTURE 4
ODE METHODS AND THEIR PDE COUNTERPARTS
ODE: dudt = f(u, t)
Euler’s method (explicit): U(t+ k) = U(t) + kf(U, t)
Higher order methods I: Runge Kutta
Idea: Write in integral form
u(t+ k) = u(t) + k∫ 1
0f(u, t+ sk) ds
Use integration rule for the integral
Euler:∫ 10 f(u, t+ sk) ds ≈ f(U, t)
Second order:∫ 10 f(u, t+ sk) ds ≈ f(U1/2, t+ k/2); compute
10
u1/2 by intermediate Euler step
U1/2 = U(t) +k
2f(U, t), U(t+ k) = U(t) + kf(U1/2, t+
k
2)
Equivalent for hyperbolic PDE’s: Lax-Wendroff in staggered
grid formulation
∂tu+∂xf(u) = 0, U(t+k) = U(t)−k
h(T1/2−T−1/2)f(U(t+
k
2))
U(t+k
2) =
1
2(T1/2 + T−1/2)U(t)−
k
2h(T1/2 − T−1/2)]f(U(t))
Higher order methods have less aritficial diffusion!
∂tu+b∂xu = 0: Godunov: C|b|2 h2∂xu Lax - Wendroff: C2b2
2 h2∂xu,
C = kh
Higher order methods II: Multi-step
du
dt= f(u, t), U(t+ k) =
S∑s=0
αsU(t− sk) + kβsf(U, t− sk)
Problem 1: needs start up!
Stability:
U(nk) = gnU(0), gn+1 =S∑s=0
αsgn−s + k...
g solution of polynomial of degree S + 1, S + 1 roots!
Example: Leapfrog for ∂tu+ ∂xf(u)
U(t+ k) = U(t− k)−bk
h(T − T−1)f(U(t)),
growth function g for ∂tf + b∂xf = 0:
g2 = 1 + 2igbC sin(ξh), C =k
h
For |b|C ≤ 1: |g12| = 1, no artificial diffusion!!! (weaklyunstable)
MONOTONICITY AND THE MAXIMUM PRINCIPLE
Difference scheme for general nonlinear problem
Uj(t+ k) = gj(U1(t), .., UN(t))
Consistency ⇒gj(u, ...., u) = u, ∀j (or gj(u, ...., u) = u(1 + O(k)), ∀j in the
presence of source terms).
Lemma:
∂gj
∂uk≥ 0 ∀j, k ⇒ ‖U(t+ k)‖∞ ≤ ‖U(t)‖∞,
Implicit schemes:
g+j (U(t+ k)) = g−j (U(t))
g+j (.., Us(t), ..) = g+j (.., Us(t), ..), ∀j
Define:
g+j (v) = G+j (.., v, v, ..), g−j (v) = G−j (.., v, v, ..)
Assume:
(A1)∂G+
j
∂Us≤ 0 for j 6= s,
∂G−j∂Us
≥ 0 ∀j, s
(A2) g+j (v) ≥ g−j (w) ⇒ v ≥ w ∀j
Lemma: Assumptions (A1),(A2) imply ‖U(t+k)‖∞ ≤ ‖U(t)‖∞
Monotone schemes build (nonlinear) averages over the solu-
tion with nonnegative coefficients!
Example: Lax - Wendroff
Methods of order higher than order 1 cannot be monotone!
THE TVD PROPERTY
The discrete W∞1 norm:
∫|∂xu| dx
Non-oscillatory schemes:
Definition: A scheme is TVD ⇐⇒∑j
|(T − 1)Un+1j | ≤
∑j
|(T − 1)Unj |
The linear case:
Write scheme solely in terms of derivatives.
Un+1 = Un − T−1(AnV n) +BnV n, V n := (T − 1)Un
Theorem:
A,B ≥ 0, A+B ≤ 1 ⇒ TV D
LECTURE 5
FLUX LIMITER METHODS
Un+1 = Un − c(T − 1)Fn
Idea:
Lower order method with numerical flux FL. Higher order
method with numerical flux FH. Lower order method non-
oscillatory.
Combine:
F = FL + Φ(FH − FL)
Smooth part: φ ≈ 1; Non-oscillatory otherwise, i.e. total
method is TVD.
11
Total method formally only first order but higher order in
smooth regions.
THE FLUX LIMITER
Condition 1: (Smooth order)
Φ = φ((1− T−1)U
(T − 1)U), φ(1) = 1
Condition 2: Choose φ such that total method is TVD.
Derive φ for linear case and use in general.
∂tu+ a∂xu = 0, a > 0
Example: Upwind and Lax Wendroff
FL = aT−1U, FH =a
2(1 + T−1)U −
ca2
2(1− T−1)U
FH − FL =a
2(1− ac)(1− T−1)U
Un+1 = 1− ν(1− T−1)[1 +φ
2(1− ν)(T − 1)]Un, ν := ac
Un+1 = Un−ν[1−(1− ν)
2T−1φ]T−1V n−ν
φ
2(1−ν)V n, V = (T−1)U
A = ν[1−(1− ν)
2φ] + ν
Tφ
2(1− ν)
TV
V
A = ν1 +(1− ν)
2(−φ+ Tφ
TV
V)
12
A ≥ 0 ⇒ |φ(θj)
θj− φ(θj−1)| ≤ 2, θj =
T−1V
V
Two standard choices:
1. Superbee:
φ(θ) = max0,min1,2θ,minθ,2
2. Van Leer:
φ(θ) =θ+ |θ|1 + |θ|
13
LECTURE 6
BOUNDARY CONDITIONS AND GHOSTPOINTS FOR
HYPERBOLIC SYSTEMS
∂tu+ ∂x[A(x, t)u] = 0, x ≥ 0, Bu(0, t) = ub,
u ∈ RN , B ∈ RK×N
Relation of B to A: Influx given in terms of outflux !
Diagonalization:
A(0, t) = EDE−1, D =
(D+ 00 D−
), D+ > 0, D− ≤ 0
Important!! dim(D) = K ×K
Projections: partition E
E = (E+, E−), E+ : N ×K, E−1 =
(R+R−
), R+ : K ×N
14
Necessary: ∃(BE+)−1
Ghostpoint:
R−U(−h, t) = R−(2U(0, t)− U(h, t))
R+U(−h, t) = (BE+)−1[ub −BE−R−(2U(0, t)− U(h, t))]
U(−h, t) = E
((BE+)−1
0
)ub+E
(−(BE+)−1BE−R−
R−
)(2U(0, t)−U(h, t))
top related