Professional Documents
Culture Documents
David W. Zingg
1. Godunov’s Method
3. Higher-Order Reconstruction
6. Total-Variation-Diminishing Conditions
1
Godunov’s Method
Godunov’s Method
2
Godunov’s Method
3
Godunov’s Method
∫ b ∫ b
u(x, tn+1 )dx − u(x, tn )dx = −∆t{f¯[u(b, t)] − f¯[u(a, t)]}
a a
Gives
∆t ¯
un+1
j − unj = − {f [u(xj+1/2 , t)] − f¯[u(xj−1/2 , t)]}
∆x
4
Godunov’s Method
Gives the following left and right states at the j + 1/2 interface:
Define (x )
u∗ , uL , uR
t
as the exact solution to the local Riemann problem given by
u = uL x<0
u = u R
x≥0
5
Godunov’s Method
∆x
|amax |∆t <
2
6
Godunov’s Method
7
Godunov’s Method
∂u ∂u
+a =0
∂t ∂x
Exact solution provides solution to Riemann problem:
u(x, t) = un (x − a(t − tn ))
a∆t ≤ ∆x
8
Godunov’s Method
9
Godunov’s Method
∆t [ ]
un+1
j = unj − f (u∗ (0, unj , unj+1 )) − f (u∗ (0, unj−1 , unj ))
∆x
Godunov’s method can therefore be written in the generic form:
∆t ˆ
un+1
j = unj − (fj+1/2 − fˆj−1/2 )
∆x
with the numerical flux function
10
Godunov’s Method
Semi-discrete form:
duj 1 ˆ
=− (fj+1/2 − fˆj−1/2 )
dt ∆x
Godunov’s numerical flux function for the linear convection equation
1 1
fˆj+1/2 = (a + |a|)unj + (a − |a|)unj+1
2 2
Gives upwind flux for both positive and negative a
11
Godunov’s Method
∂u 1 ∂u2
+ =0
∂t 2 ∂x
1 2
2 uj+1 if uj , uj+1 are both ≤ 0
1 2
uj , uj+1 are both ≥ 0
2 uj if
fˆj+1/2 = 0 if uj ≤ 0 ≤ uj+1
1 2
uj > 0 ≥ uj+1 and |uj | ≥ |uj+1 |
2 uj if
1 2
2 uj+1 if uj ≥ 0 > uj+1 and |uj | ≤ |uj+1 |
12
Roe’s Approximate Riemann
Solver
Roe’s Approximate Riemann Solver
∂Q ∂Q
+A =0
∂t ∂x
∂Q ∂Q
+ Ā =0
∂t ∂x
13
Roe’s Approximate Riemann Solver
f R − f L = A(Q̄)(QR − QL )
14
Roe’s Approximate Riemann Solver
Decoupled form:
∂W ∂W
+Λ =0
∂t ∂x
Recouple to get
[ ]
1 1
fˆj+1/2 = X (Λ + |Λ|)Wj + (Λ − |Λ|)Wj+1
2 2
[ ]
1 −1 1 −1
= X (Λ + |Λ|)X Qj + (Λ − |Λ|)X Qj+1
2 2
1 1
= XΛX −1 (Qj + Qj+1 ) + X|Λ|X −1 (Qj − Qj+1 )
2 2
1 1
= Ā(Qj + Qj+1 ) + |Ā|(Qj − Qj+1 )
2 2
15
Roe’s Approximate Riemann Solver
Replace the first term with a standard centered flux to get the numerical
flux function for Roe’s method
1 1
fˆj+1/2 = (fj + fj+1 ) + |Ā|(Qj − Qj+1 )
2 2
16
Roe’s Approximate Riemann Solver
u2j+1 u2
− 2j
2 1
āj+1/2 = = (uj + uj+1 )
uj+1 − uj 2
1 1 2 1 2 1 1
fˆj+1/2 = ( uj + uj+1 ) − | (uj + uj+1 )|(uj+1 − uj )
2 2 2 2 2
2 uj+1 if āj+1/2 ≤ 0
1 2
=
1 2
2 uj if āj+1/2 > 0
17
Roe’s Approximate Riemann Solver
18
Higher-Order Reconstruction
High-Order Reconstruction
Thus far we have based our numerical flux at the interface on the states
uj and uj+1
These are the left and right states at the interface if piecewise constant
reconstruction is used, leading to schemes that are first order in space
For higher order we generalize to
fˆj+1/2 = fˆ(uL R
j+1/2 , uj+1/2 )
where uL R
j+1/2 and uj+1/2 are determined from the reconstruction in cells
j and j + 1, respectively
19
High-Order Reconstruction
20
High-Order Reconstruction
( )
uj+1 − uj−1
u(x) = uj + α (x − xj )
2∆x
( )
uj+1 − 2uj + uj−1 ∆x2
+β [(x − xj )2 − ]
2∆x2 12
21
High-Order Reconstruction
Substitute x = xj + ∆x/2 into the reconstruction in cell j to get
1
j+1/2 = uj + [(α − β/3)(uj − uj−1 ) + (α + β/3)(uj+1 − uj )]
uL
4
1
j+1/2 = uj+1 − [(α + β/3)(uj+1 − uj ) + (α − β/3)(uj+2 − uj+1 )]
uR
4
Substitute into
fˆj+1/2 = fˆ(uL R
j+1/2 , uj+1/2 )
duj 1 ˆ
=− (fj+1/2 − fˆj−1/2 )
dt ∆x
22
High-Order Reconstruction
1
j+1/2 = uj + (uj+1 − uj−1 )
uL
4
Semi-discrete form
( )
du a
=− (uj+1 + 3uj − 5uj−1 + uj−2 )
dt j 4∆x
23
High-Order Reconstruction
1
uL
j+1/2 = (2uj+1 + 5uj − uj−1 )
6
Semi-discrete form
( )
du a
=− (2uj+1 + 3uj − 6uj−1 + uj−2 )
dt j 6∆x
24
Conservation Laws and Total
Variation
Conservation Laws and Total Variation
25
Conservation Laws and Total Variation
26
Monotone and
Monotonicity-Preserving
Schemes
Monotone and Monotonicity-Preserving Schemes
∂H
(u−l , . . . , u+l ) ≥ 0 for all −l ≤i≤l
∂ui
Limited to first-order accuracy
27
Monotone and Monotonicity-Preserving Schemes
un+1
j = Cn unj−1 + (1 − Cn )unj
where
a∆t
Cn =
∆x
∂H ∂H
= Cn = 1 − Cn
∂uj−1 ∂uj
28
Monotone and Monotonicity-Preserving Schemes
1 ah n
un+1 = unj − (u − unj−1 )
j
2 ∆x j+1
( )2
1 ah
+ (unj+1 − 2unj + unj−1 )
2 ∆x
Cn Cn
un+1
j = (1 + Cn )unj−1 + (1 − Cn2 )unj + (Cn − 1)unj+1
2 2
Monotone condition violated even for Cn ≤ 1
29
Monotone and Monotonicity-Preserving Schemes
30
Total-Variation-Diminishing
Conditions
Total-Variation-Diminishing Conditions
31
Total-Variation-Diminishing Conditions
−
Cj+1/2 ≥0 +
and Cj−1/2 ≥0
32
Total-Variation-Diminishing Conditions
∆t −
un+1 = unj + [C (un − unj ) − Cj−1/2
+
(unj − unj−1 )]
j
∆x j+1/2 j+1
we have the following additional condition:
∆t −
1− (C +
+ Cj−1/2 )≥0
∆x j+1/2
33
Total-Variation-Diminishing Conditions
a∆t n
un+1 = unj − (u − unj−1 )
j
∆x j
∆t
= unj + [0 · (uj+1 − uj ) − a(uj − uj−1 )]
∆x
First two conditions are met
Third condition coincides with the requirement for stability
If Cn ≤ 1, the scheme is TVD
34
Total-Variation-Diminishing Conditions
Not TVD
35
Total-Variation-Diminishing Conditions
and nonmonotonic if
uj−1 − uj−2
>3
uj − uj−1
36
Total-Variation-Diminishing
Schemes with Limiters
Total-Variation-Diminishing Schemes with Limiters
duj a
= − (3uj − 4uj−1 + uj−2 )
dt 2∆x
a 1 1
= − [(uj − uj−1 ) + (uj − uj−1 ) − (uj−1 − uj−2 )]
∆x 2
| {z2 }
for second−order accuracy
37
Total-Variation-Diminishing Schemes with Limiters
38
Total-Variation-Diminishing Schemes with Limiters
Recall that whether or not the TVD condition is violated depends on the
ratio
uj−1 − uj−2
uj − uj−1
ψj = ψ(rj ) ≥ 0
39
Total-Variation-Diminishing Schemes with Limiters
Substituting in we obtain
[ ]
duj 1 1 1 ψ(rj−1)
=− a 1 + ψ(rj ) − (uj − uj−1 )
dt ∆x 2 2 rj−1
| {z }
+
Cj−1/2
ψ(rj−1 )
− ψ(rj ) ≤ 2
rj−1
ψ(rj−1 ) ≤ 2rj−1
40
Total-Variation-Diminishing Schemes with Limiters
41
Total-Variation-Diminishing Schemes with Limiters
Minmod
min(r, 1) r>0
ψ=
0 r≤0
Superbee
van Leer
r + |r|
ψ(r) =
1+r
42
Total-Variation-Diminishing Schemes with Limiters
van Albada
r 2 +r
1+r 2 r>0
ψ=
0 r≤0
43
Total-Variation-Diminishing Schemes with Limiters
Diagram showing the second-order TVD region for limiters and several
well-known limiter functions
44
Total-Variation-Diminishing Schemes with Limiters
1 1
f+ = (a + |a|)u f− = (a − |a|)u
2 2
duj 1 1 1
=− [(fj+ − fj−1
+
) + ψ(rj )(fj+ − fj−1
+
) − ψ(rj−1 )(fj−1
+
− fj−2
+
)]
dt ∆x 2 2
( ) ( )
1 1 1 1 1
− [(f − − fj− ) + ψ −
(fj+1 − fj− ) − ψ −
(fj+2 −
− fj+1 )]
∆x j+1 2 rj 2 rj+1
45
Total-Variation-Diminishing Schemes with Limiters
1
fˆj+1/2 = a[uj + ψ(rj )(uj − uj−1 )]
2
[ ]
1 2(uj − uj−1 )
= a uj + ψ(rj ) (uj+1 − uj−1 )
4 (uj+1 − uj−1 )
[ ]
1 2
= a uj + ψ(rj ) (uj+1 − uj−1 )
4 rj + 1
46
Total-Variation-Diminishing Schemes with Limiters
Gives
2
ϕ(r) = ψ(r)
r+1
47
Total-Variation-Diminishing Schemes with Limiters
∆+ = uj+1 − uj ∆− = uj − uj−1
48
Total-Variation-Diminishing Schemes with Limiters
4∆+ ∆−
ϕj =
(∆+ + ∆− )2
2(uj − uj−1 )
∆x
49
Total-Variation-Diminishing Schemes with Limiters
2(uj+1 − uj )
∆x
Hence in these limits the van Leer limiter produces a slope that is twice
that resulting from the minmod limiter
50
Total-Variation-Diminishing Schemes with Limiters
• limiter chatter
• systems of equations
• multiple dimensions
• time marching methods
51