Modified Equation - MIT OpenCourseWare · PDF fileModified Equation Idea: ... RK3-TVD in...
Click here to load reader
Transcript of Modified Equation - MIT OpenCourseWare · PDF fileModified Equation Idea: ... RK3-TVD in...
18.336 spring 2009 lecture 16 02/19/08
Modified Equation
Idea: Given FD approximation to PDE
Find another PDE which is approximated better by FD scheme. Learn from new PDE about FD scheme.
Ex.: ut = cux Un+1
j − Ujn Uj
n +1 − Un Uj
n +1 − 2Uj
n + Un
Lax-Friedrichs: Δt
− c 2Δx
j−1 − 2Δt
j−1 = 0
1 1 1 1 Taylor: ut+
2 uttΔt−cux −
6 cuxxxΔx 2 −
2ΔtuxxΔx 2 −
24ΔtuxxxxΔx 4+. . . � 2 �1 Δx
= (ut − cux) + utt Δt − uxx + . . . 2 ���� Δt
2=c uxx� 2 �1 Δx= (ut − cux) + c 2Δt − uxx
2 ΔtModified equation:
Δx2 cΔt ut − cux = (1 − r 2)uxx r =
2Δt ΔxAdvection-diffusion equation with diffusion constant
Δx22D = ( 1 r )���� ����2Δt
− added diffusion antidiffusion by central differencing
Ex.: Upwind: ut − cux =
21 cΔx(1 − r)uxx (exercise)
Compare:
For c = 1, r = 21 DLF =
43 Δx , DUW =
41 Δx−→
Upwind less diffusive than LF.
Ex.: Lax-Wendroff ut − cux = 1 cΔx2(r2 − 1)uxxx (uxx cancels by construction)
6
Advection-dispersion equation with dissipation constant
µ = −61 cΔx2(1 − r2)
Disturbances behave like Airy’s equation
Message:
First order methods behave diffusive. Second order methods behave dispersive.
1
� �� �
More on Advection Equation
ut + cux = 0
So far:
1. Upwind: ⎧⎪⎪⎪⎨
⎫⎪⎪⎪⎬Un
j − Ujn −1 −c
Δx c > 0
Ujn+1 − Uj
n
e = O(Δt) + O(Δx)= →⎪⎪⎪⎩⎪⎪⎪⎭
Δt Un
−c j+1
Δ
−
x
Ujn
c < 0
2. Lax-Friedrichs/Lax-Wendroff:
Ujn+1 − Uj
n
= Uj
n +1 − Uj
n −1
+ θUj
n +1 − 2Uj
n + Ujn −1
Δt 2Δx (Δx)2
LF: θ = (Δx)2
e = O(Δt) + O(Δx 2)2Δt
→
LW: θ =Δt
c 2 e = O(Δt2) + O(Δx 2)2
→
Semidiscretization:
Central: ux = Uj+1 − Uj−1
+ O(Δx 2)2Δx ⎤⎡⎤⎡ ⎤⎡0 1 −1
(ux)1 u1⎢⎢⎢⎣
⎥⎥⎥⎦
. .1 . .−1⎢⎣
⎥⎦⎢⎣
⎥⎦. ....
...Matrix = ·2Δx . .. . . . 1(ux)k uk
1 −1 0
=A
AT = −A ⇒ eigenvalues purely imaginary
Need time discretization that is stable for u̇ = λu with λ = iµ, µ ∈ R
Linear Stability for ODE:
Region of absolute stability = {λ ∈ C : method stable for u̇ = λu}
2
Ex.:
Forward Euler Backward Euler Trapezoidal un+1 = un + λΔtun
n+1 1 n n+1 1 + 21 λΔt
u = u u = = (1 + λΔt)un 1 − λΔt 1 −
21 λΔt
Stable if |1 + λΔt| ≤ 1
RK4 RK2 Adams-Bashforth 3
Can also use higher order discretization of ux
(up to spectral). If central need ODE solver for timestep ⇒that is stable for u̇ = iµu.
Spurious Oscillations
Stable does not imply “no oscillations.”
Ex.: Lax-Wendroff
Overshoots remain bounded stable.⇒Still bad (e.g. density can become negative)
3
Image by MIT OpenCourseWare.
� � Total Variation:
TV (u) = |uj+1 − uj | ≈ |ux(x)|dx “total up and down” j
Method total variation diminishing (TVD), ifTV (un+1) ≤ TV (un).
Bad News: Any linear method for advection that is TVD,is at most first order accurate.
[i.e.: high order spurious oscillations]→
Remedy: Nonlinear Methods:
1. Flux-/Slope- Limiters
� conservation laws; limit flux TVD→
2. ENO/WENO
(weighted) essentially non-oscillatory(essentially TVD; no noticeable spurious oscillations)
ENO/WENO
Approximate ux by interpolation.
ENO: At each point consider multiple interpolating polynomials (through various choices of neighbors). Select the most “stable” one to define ux.
WENO: Define ux as weighted average of multiple interpolants. Higher order when u smooth, no overshoots when u non-smooth.
4
� �
Ex.: Fifth order WENO
s1 = 13 (v1 − 2v2 + v3)2 + 1 (v1 − 4v2 + 3v3)
2 12 4
s2 = 13 (v2 − 2v3 + v4)2 + 1 (v2 − v4)
2 12 4
= 13 + 1 (3v3 − 4v4 + v5)2 =
Uj+1 − Ujs3 12 (v3 − 2v4 + v5)
24 vj
Δx a1 = 1 /(� + s1)
2 10 6 2)a2 = 10 /(� + s2)
2 � = 10−6 max(vj· j
3 a3 = 10 /(� + s3)
2
sa = a1 + a2 + a3 a1w1 = sa
a2w2 = sa
a3w3 = sa
w = 1 (2v1 − 7v2 + 11v3) + w2 · (−v2 + 5v3 + 2v4) + w3 · (2v3 + 5v4 − v5))6 (w1 ·
Left sided approximation to ux at x4
Right sided approximation to ux at x3
ut + cux = 0
Upwind WENO with FE:
Ujn+1 − Uj
n � −c WENOleft Uj
n > 0 �
= ·
Δt −c WENOright Ujn ≤ 0·
TVD time stepping
Consider method that is TVD with FE. Is it also TVD with high order time stepping? In general: “no.” But for special class of ODE schemes: “yes.” Strong Stability Preserving (SSP) methods
5
Image by MIT OpenCourseWare.
Ex.: FE (un) = un + Δtf(un)
RK3-TVD 1 2 3 1n+1 un + un + FE(FE(un)))FE (u =3 3 4 4
Convex combination of FE steps ⇒ Preserves TVD property
Compare: Classical RK4 cannot by written this way. It is not SSP.
Popular approach for linear advection:ut + cux = 0
RK3-TVD in time, upwinded WENO5 in space.
2D/3D: Tensor product in space.
WENO5-stencil
6
Image by MIT OpenCourseWare.
MIT OpenCourseWarehttp://ocw.mit.edu
18.336 Numerical Methods for Partial Differential Equations Spring 2009
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.