13.07.2015 Views

Numerical Methods for Hyperbolic Conservation Laws (AM257)

Numerical Methods for Hyperbolic Conservation Laws (AM257)

Numerical Methods for Hyperbolic Conservation Laws (AM257)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Numerical</strong> <strong>Methods</strong> <strong>for</strong> <strong>Hyperbolic</strong> <strong>Conservation</strong> <strong>Laws</strong>(<strong>AM257</strong>)by Chi-Wang ShuSemester I 2006, Brown. Send corrections to kloeckner@dam.brown.edu. Any mistakes or omissionsin these notes are certainly due to my typing.Table of contentsTable of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Theory of One-Dimensional Scalar <strong>Conservation</strong> <strong>Laws</strong> . . . . . . . . . . . . . . . . . . . . . . . . 12 Numerics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.1 Examples of conservative schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.1.1 The Godunov Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.1.2 The Lax-Friedrichs Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.3 The local Lax-Friedrichs Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.4 Roe Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.5 Engquist-Osher Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.6 Lax-Wendroff Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.7 MacCormack Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.2 Higher-order TVD Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2.1 General Framework of a Conservative Finite-Volume Scheme . . . . . . . . . . . . . . . . . . 152.2.2 Generalized MUSCL Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.3 Essentially Non-Oscillatory Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.4 Weighted ENO Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.5 Finite Difference <strong>Methods</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.5.1 Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.5.2 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Two Space Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.1 FV methods in 2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.1.1 The Linear Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.1.2 The Nonlinear Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.2 Finite Difference <strong>Methods</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 Systems of <strong>Conservation</strong> <strong>Laws</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.1 A First Attempt: Generalize <strong>Methods</strong> from AM255 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.2 How to Generalize Scalar Higher-Order Schemes to Systems . . . . . . . . . . . . . . . . . . . . . . 284.3 The Nonlinear Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Discontinuous Galerkin method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.1 Some Theoretical Properties of the Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 Theory of One-Dimensional Scalar <strong>Conservation</strong> <strong>Laws</strong>u t + f(u) x = 0, (1)where u is a function of x and t.∫bdu(x, t)dx = f(u(b, t)) − f(u(a, t))dt ais the integral <strong>for</strong>m of (1). {ut + f(u) x ,u(x, 0)=u 0 (2)(x).1


2 Section 1Characteristics: Define a function x(t) by{dx(t)= f ′ (u(x(t), t)),dtx(0) =x 0 .Thendu(x(t), t)= u x x ′ (t)+u t = u x f ′ (u(x(t), t)+u t = f(u) x + u t =0.dtSo u(x(t), t)=u(x(0), 0)=u 0 (x 0 ).All that holds under the assumption that we have a smooth solution. Which we don’t. :(Consider Burgers’ Equation: ⎧ ( ) ⎨ u 2u t + =0, 2 x⎩ u(x, 0) = sin(x).(3)Consider the characteristics at π/2 and 3π/2. → They intersect and propagate different values, so theabove theory breaks down. ⇒ There is no global (in x and t) solution to (3). The concept of “weak solution”helps us out now. Reconsider the integral <strong>for</strong>m:ddtFor C 1 solutions, (1) ⇔ (4). Attempts at defining weak solutions:∫abu(x, t)dx = f(u(a, t)) − f(u(b, t)) (4)• If u satisfies (4) <strong>for</strong> almost all (a, b) then in u is called a weak solution to (1). (physically meaningful,correct)• If <strong>for</strong> any ϕ ∈ C 1 0 (R 2 ),∫−∞0∞ ∫ −∞∫∞(uϕ t + f(u)ϕ x )dx dt − u 0 (x)ϕ(x, 0)dx=0,−∞then in u is called a weak solution to (1). (more meaningful mathematically–motivated by multiplicationby test function and integration by parts.)It turns out the two are equivalent. (Not proven here.) Now, assume a solution that has two C 1 segmentsseparated by a curve on which no regularity is demanded of u.Then0 = d ∫bu(x, t)dx+ f(u(b, t)) − f(u(a, t))dt[ a∫= d x(t)∫ ]bu(x, t)dx + u(x, t)dx + f(u(b, t)) − f(u(a, t))dt ax(t)∫= u(x(t − ), t)x ′ x(t)∫(t)+ u t (x, t)dx −u(x(t + ), t)x ′ b(t)+ u t (x, t) + f(u(b, t)) − f(u(a, t))ax(t)∫∫= u(x(t − ), t)x ′ (t) − f(u) x dx − u(x(t + ), t)x ′ (t)+ f(u) x dx + f(u(b, t)) − f(u(a, t))ax(t)= u(x(t − ), t)x ′ (t) − f(u(x(t − ), t)) + f(u(a, t)) − u(x(t + ), t)x ′ (t) − f(u(b, t)) − f(u(x(t + ), t)) + f(u(b,x(t)bt)) − f(u(a, t))= u(x(t − ), t)x ′ (t) − f(u(x(t − ), t) −u(x(t + ), t)x ′ (t)+ f(u(x(t + ), t).Now use the shorthandand writeNow distinguish two cases:• u − = u + : This is fine.u −4u(x(t − ), t)u +4u(x(t + ), t)0= f(u + ) − f(u − ) − x ′ (t)(u + −u − ).


Theory of One-Dimensional Scalar <strong>Conservation</strong> <strong>Laws</strong> 3• u −u + : We get the Rankine-Hugoniot jump condition:x ′ (t) = f(u+ ) − f(u − )u + − u −If u is piecewise C 1 and is discontinuous only along isoated curves, and if u satisfies the PDE when it isC 1 , and the Rankine-Hugoniot (RH) condition along all discontinuous cruves, then u is a weak solution of(1).Example 1. Consider the following Riemann problem:⎧ ( )⎪⎨ u 2u t + = 0 2 x⎪⎩ u(x, 0)= { 1 x 0.The IC is just propagated in time to <strong>for</strong>m a weak solution. (a shock)Example 2. Now flip the initial conditions:⎧ ( )⎪⎨ u 2u t + = 0 2 x⎪⎩ u(x, 0)= { −1 x 0.The propagated ICs also <strong>for</strong>m a weak solution. But consider⎧⎨ −1 x −t,u(x, t)= x/t − t < x < t,⎩1 x > t.This is also a weak solution. (a rarefaction wave)Oops. So, we need a third category of solutions, called entropy solutions, where neither uniqueness norexistence poses a big problem. Consider adding an artificial viscosity:u ε t + f(u ε ε) x = εu x,xwith a very small 0


4 Section 1DCT allows taking the limit. We get the entropy inequality∫∞U(u)ϕ t +F(u)ϕ x dxdt 0.Homework #1:0∞ ∫ −∞• On a domain [0, 2π], with periodic BCs, consider⎧ ( )⎨ u 2u t + = 0 2 x⎩ u(x, 0) = 1 + sin x 2Find the maximum T ∗ such that u(x, t) ∈C 1 <strong>for</strong> t < T ∗ .• Write a code to solve <strong>for</strong> u when t < T ∗ . (Hint: Look <strong>for</strong> equation implicitly defining u, maybe useNewton’s method). Test the code <strong>for</strong> (0.1, 0.1), (1, 0.08), (π, 0.09).Definition 3. A conservation law is called genuinely nonlinear iff f ′′ (u)0. If f ′′ (u) > 0, it is calledconvex, if f ′′ (u)


Theory of One-Dimensional Scalar <strong>Conservation</strong> <strong>Laws</strong> 5Oleinik entropy condition: For all u between u − and u + , we need to havef(u) − f(u − )u −u −x ′ (t) f(u) − f(u+ )u − u ?s+ ,where s is the shock speed, known from the Rankine-Hugoniot condition.Lax’s entropy condition:f ′ (u − ) >s > f ′ (u + ).tx=x(t)u −u +xFigure 2. Illustration of Lax’s entropy condition. Characteristics are going “into” shocks.It is easy to see that the Oleinik condition implies Lax’s condition. Un<strong>for</strong>tunately, the converse doesnot hold. Lax’s entropy condition does not guarantee uniqueness–but it is a necessary condition. However,if f ′′ (u) ≷ 0 uni<strong>for</strong>mly (i.e. the conservation law is genuinely nonlinear), then Lax’s entropy condition issufficient <strong>for</strong> u to be the entropy solution.For f ′ (u) >0, Lax’s condition becomes even simpler. Considerf ′ (u − )s= f(u)u f ′ (u + )and note that f ′ (u) is monotonically increasing, such that the middle part is automatically satisfied.Thus, Lax’s condition becomesf ′ (u − ) f ′ (u + ).I.e. looking towards the right, we can only jump down.Theorem 4. The solutions to{u ε t + f(u ε ε) x =εu x,x ,u ε (x, 0) =u 0 (x)are L 1 -contractive. I.e. let v ε be the solution of{v ε t + f(v ε ε) x = εv x,x ,v ε (x, 0)=v 0 (x).Then‖u ε ( · , t) − v ε ( · , t)‖ L 1 ∥ ∥u 0 −v 0∥ ∥L 1.Proof. We need to show0 d dt∫∞−∞|u ε (x, t) − v ε (x, t)|dx.


6 Section 1u ε − v εI j (t)x j+1/2xx j −1/2Figure 3.Let s j be the sign of u ε − v ε on I j and consider, using Leibniz’s rule, the following:∫∞d|u ε (x, t) − v ε (x, t)|dxdt −∞= d ∑∫x j+1/2|u ε (x, t) − v ε (x, t)|dxdtj x j −1/2= ∑ []s j (t) u ε (x j+1/2 (t), t) −v ε ′(x j+1/2 (t), t) x j+1/2 (t)j?0[]− s j (t) u ε (x j+1/2 (t), t) − v ε ′(x j+1/2 (t), t) x j+1/2 (t)?0∫x j+1/2+′ sj (t)(u ε (x, t) − v ε (x, t))dxx j −1/2?0∫x j+1/2+ sj (t)(u ε t (x, t) −v ε t (x, t))dxx∫ j −1/2x j+1/2sj (t)(u ε t (x, t) − v ε t (x, t))dx= ∑ jx j −1/2= ∑ ∫x j+1/2sj (t)[ − f(u ε ε(x, t)) x +εu x,x (x, t)+ f(v ε ε(x, t)) x −εv x,x (x, t)]dxjx j −1/2= ∑ {s j (t) − f(u ε (x j+1/2 (t), t))+ f(u ε (x j −1/2 (t), t))+ f(v ε (x j+1/2 (t), t)) − f(v ε (x j −1/2 (t), t))j?0ε [ u ε x (x j+1/2 (t), t) − u ε x (x j −1/2 (t), t) − v ε x (x j+1/2 (t), t) +v ε x (x j −1/2 (t), t) ]}+ 0.To see why the orange and blue parts together each arex j ±1/2 . 0, just look at what’s happening at the□The entropy solution has a non-increasing total variation.∫ ∣ ∣∣∣ u(x+h) − u(x)TV(u)4suph h ∣ dx.because ...?TV(u( · , t))TV(u 0 ),


Numerics 72 NumericsConsiderThe entropy solution is⎧⎨⎩u t + ( u2 ) x 2 = 0u(x, 0)= { 1 x 1 t. 2Note also that the analytic solution satisfies a maximum principle, i.e.minxu 0 (x)u(ξ, t) maxxu0 (x).Remember <strong>for</strong> u t +au x =0, we wrote down an upwind scheme:u n+1 j =u n j −a· ∆t∆x (un nj − u j −1 ).Let’s write a direct generalization, <strong>for</strong> the (equivalent...?) PDE u t + uu x =0:u n+1 j = u n j − ∆t∆x un j(u n nj − u j −1 ).But <strong>for</strong> j0, u 0 0j − u j −1 =0, and <strong>for</strong> j = 0, u 0 j = 0. Altogether,Bad.u j n+1 =u j n .Definition 5. A scheme to solve conservation laws is called conservative iff it can be written asu n+1 j = u n j − ∆t []fˆj+1/2 − fˆj −1/2 ,∆xwhere fˆ is1. Lipschitz continuous,2. fˆ(u,,u)= f(u) (consistency).Theorem 6. (Lax-Wendroff) If the solution {u j n } to a conservative scheme converges (as ∆t, ∆x → 0)boundedly a.e. to a function u(x, t), then u is a weak solution of the conservation law.Proof. Let ϕ j n = ϕ(x j , t n ) <strong>for</strong> ϕ ∈C 0 1 . Then0 =∑ ∑n= − ∑ nj(u j n+1 − u jn∆t(∑ ϕ n n−1j − ϕ jj∞∫ ∞ ∫ DCT,Conservativity→0 −∞Remark 7. Above, we used partial summation:∆t+ fˆj+1/2 − fˆj −1/2∆x)ϕ j n ∆x∆tu n j + ϕ n nj − ϕ j −1fˆj+1/2∆x(ϕ t u+ ϕ x f(u))dxdt = 0.)∆x∆t□∑j 2(a j+1 − a j )b j − a j1 b j −1 + a j2 b j2 .j 2a j (b j − b j −1 ) = − ∑ j=j 1j=j 1


8 Section 22.1 Examples of conservative schemes2.1.1 The Godunov SchemeThe Godunov scheme <strong>for</strong> the conservation law{ut + f(u) x = 0,u(x, 0) =u 0 (x)was derived from the fact that the Riemann problem{ut + f(u) x = 0,u(x, 0) = { u l x u r ,⎧u(x, t) = ⎨ u l x < u lt,x/t u ⎪⎩ lt x < u rt, u l < u r ,where⎩u rx u rt,s = f(u 1r) − f(u l )=[u 2 r 2 −u 2 l ]= 1 u r − u l u r − u l 2 (u l + u r ).The same technique would work <strong>for</strong> all convex (f ′′ (u) > 0) or concave conservation laws. (Also cf. book byToro–500 pages of Riemann solutions.) Note that conservation laws have finite propagation speed. Supposewe choose a scheme where we consider the solution constant in each cell (Conceptually, imagine thatthis value ū j is the cell average of cell I j –this is also how you arrive at ū j 0 .) If we choose ∆x and ∆t suchthatmax |f ′ (u)|∆t


Numerics 92.1.2 The Lax-Friedrichs SchemeThe numerical flux here iswhere α = max u |f ′ (u)|.2.1.3 The local Lax-Friedrichs SchemeThe numerical flux here isfˆj+1/2 = 1 2 [f(u j) + f(u j+1 ) − α(u j+1 − u j )],fˆj+1/2 = 1 2[ f(uj ) + f(u j+1 ) − α j+1/2 (u j+1 − u j ) ] ,where α j+1/2 = max (uj ,u j+1 ) |f ′ (u)| (where we note that (u j , u j+1 ) is meant as a non-empty interval nomatter which end of the interval is greater).2.1.4 Roe SchemeThe numerical flux here iswherefˆj+1/2 =is the speed of the solution as given by the RHC.2.1.5 Engquist-Osher SchemeThe numerical flux here iswhere2.1.6 Lax-Wendroff SchemeConsiderf + (u) =f − (u) ={f(u j ) a j+1/2 0,f(u j+1 ) a j+1/2 < 0,a j+1/2 = f(u j+1) − f(u j )u j+1 − u jfˆj+1/2 = f + (u j )+ f − (u j+1 ),∫∫u0u0max (f ′ (u), 0)du + f(0),min (f ′ (u), 0)du.u t = − f(u) xu t,t = − f(u) x,t = − (f(u) t ) x = − (f ′ (u)u t ) x =(f ′ (u)f(u) x ) x .The general idea is:• Repeatedly replace time by space derivatives by using the PDE,• Discretize space derivatives by (2nd order central) FD <strong>for</strong>mulae.Derivation:u n+1 = u n + ∆t u n t + ∆t22 u nt,t= u n −∆t f(u n ) x + ∆t22 (f ′ (u)f(u) x ) xu n+1 nj = u j − ∆t f(u n nj+1) − f(u j −1 )2∆xf ′ n(u j −1/2 ) f(u ]/n nj − f(u j −1 )∆x,∆xwherenu j+1/2+= u n nj + u j+1.2[∆t 22f ′ n(u j+1/2) f(u nj+1) − f(u n j )∆x−


Numerics 11Theorem 9. Good properties of monotone schemes:1. u j v j <strong>for</strong> all j (“uv”) implies G(u) j G(v) j <strong>for</strong> all j.2. Local maximum principle:min u iG(u) j max u i.i∈stencil around j i∈stencil around j3. L 1 -contraction: (this was already obtained <strong>for</strong> the PDE)‖G(u) − G(v)‖ L 1‖u − v‖.4. This immediately implies the Total Variation Diminishing (TVD) property:‖G(u)‖ BV ‖u‖ BV.Proof. 1 is just the definition.2. Fix j. Take{maxk∈stencilv i =arond i u k if i ∈ stencil around j,u iotherwise.Then clearly u i v i <strong>for</strong> all i, so thatOther way around runs in an analogous fashion.3. DefineThen letWe haveby property 1. ThenThusThere<strong>for</strong>eG(u) j G(v) j = v j = max u i.i∈stencil around ja ∨b=max (a, b), a ∧b=min (a, b), a + = a ∧0, a − = a ∨0.∑(G(u) j − G(v j )) + ∑ jjw j4u j ∨v j = v j + (u j − v j ) + . ( ∗ )G(u) j G(w) j G(v) j∀j{ 0 ∀j,G(w) j − G(v) j G(u j ) −G(v j ) ∀j.G(w) j −G(v) j (G(u) j − G(v) j ) + .because we are treating a conservation law, meaning∑u n+1 j = ∑ jj(G(w) j −G(v)) (∗∗) j =∑ ju j n , ( ∗ ∗)w j − v (∗) j =∑ j(u j − v j ) + .which holds <strong>for</strong> conservative schemes. (Why?) Also consider∑|G(u) j − G(v) j | = ∑ (G(u) j −G(v) j ) + + ∑ (G(u) j − G(v) j ) −jjj ∑ (u j − v j ) + + ∑ (v j −u j ) +jj= ∑ j|u j − v j |.(This is also called the Crandall-Tartar lemma.)4: Take v j = u j+1 in 3. □


12 Section 2Theorem 10. Solutions to monotone schemes satisfy all entropy conditions.Proof. We’ll prove a particular case, namely<strong>for</strong> any c ∈ R. Thenand U ′′ (u)=2δ(x −c) 0.U(u) = |u −c|{− 1 u c(Recall that entropy conditions were of the <strong>for</strong>m, “pick an entropy function U ′′ (u) 0, thenU(u) t + F(u) x = 0”, where F is the entropy flux∫uF(u)= U ′ (u)f ′ (u)dusatisfying F ′ (u) =U ′ (u)f ′ (u).)Here we letWe claim that the cell entropy inequality is true, i.e.wherecF(u) = sign(u − c)(f(u) − f(c)).U(u j n+1 ) − U(u j n )∆tObserve that we’ve abused notation a bit, i.e.+ Fˆj+1/2 −Fˆj −1/2∆xFˆ = fˆ(c ∨u) − fˆ(c ∧u). 0,First step: Try to showfˆ(α)4fˆ(α, α,,α).|u j n −c| −λ(Fˆj+1/2 − Fˆj −1/2) = G(c ∨ u) j − G(c ∧u) j .Now consider:Next, note thatI − II:I: G(c ∨ u) j = (c ∨u j ) − λ(fˆ(c ∨u) j+1/2 ) − fˆ(c ∨ u j −1/2 ))II: G(c ∧ u) j = (c ∧u j ) − λ(fˆ(c ∧u) j+1/2 ) − fˆ(c ∧ u j −1/2 ))0G(c ∨u) j − G(c ∧ u) j = |u j −c| −λ(Fˆj+1/2 − Fˆj).c = ∗ G(c,,c)G(c ∨u) j ,u j n+1 = G(u n ) j G(c ∨ u) j ,⇒ c ∨u j n+1 G(c ∨u n ) j ,where the step “ ∗ ” is true because if the arguments of G are constant, then only the u j n term comes intoplay, just yielding back the argument.AlsoThen−c∨u j n+1 − G(c ∧u n ) j .U(u n+1 j ) = |u n+1 j −c| G(c ∨ u n ) j − G(c ∧u n ) j= |u n j − c| − λ(Fˆj+1/2 − Fˆj −1/2).?U(u n j )□Theorem 11. (Godunov) Monotone schemes are at most first-order accurate.


Numerics 13After this depressing result, we will have to look <strong>for</strong> different classes of schemes. For example, in orderof decreasing strength:• Monotone: see above.• TVD: A scheme is TVD ifTV(u n+1 ) TV(u n ).• Monotonicity-preserving: A scheme is monotonicity-perserving ifn{u j+1 u n j ∀j} ⇒ {u n+1 j+1 u n+1 j ∀j}.Let’s prove that the above is actually in order of decreasing strength, i.e.Theorem 12. A TVD scheme is monotonicity-preserving.nProof. Assume u j+1 u n j <strong>for</strong> all j. If there exists a j 0 such that u n+1 j0+1 < u n+1 j0. Modify u to be constantoutside the stencil used to compute u n+1 j0and u n+1 j0+1. But the reversal of the order of these two valuesmeans that the TVD property is violated.□Later in this class, a theorem by Godunov will show that all the above properties are actually thesame, and thus first-order, and thus useless. :-/Definition 13. A scheme is called a “linear scheme” if it is linear when applied to a linear PDE:where a is a constant.A linear scheme <strong>for</strong>can be written asu t + a u x = 0,u t + u x = 0 (5)u n+1 j = ∑ kl=−kc l (λ)u n j −l ,where c l (λ) are constants which may depend on λ=∆t/∆x. A linear scheme <strong>for</strong> (5) is monotone iffc l (λ)0This is why they are also called “positive schemes”.Theorem 14. For linear schemes, monotonicity-preserving ⇒ monotone.Corollary 15. For linear schemes, monotonicity-preserving and TVD schemes are at most first orderaccurate.Proof. (of Theorem 14) If the above linear scheme is monotonicity-perserving, then consider{0 i −α,u i =1 i > −α.This is a monotone function. Then(I) − (II):∀l.(I) u n+1 j+1 = ∑ k(II)l=−kku j n+1 = ∑l=−kk∆u j n+1 = ∑l=−knc l (λ)u j+1nc l (λ)u j −lnc l (λ)∆u j −l


14 Section 2where we note that ∆u α n = 1 if m = −α, and zero otherwise.∆u n+1 0 = ∑ kl=−kc l (λ)∆u n −l = c α (λ) 0,due to the requirement of monotonicty-preserving-ness, meaning all c α (λ) 0, such that the scheme ismonotone.□So, we havemonotonicity-preserving (MP)⇒ ∗ monotone ⇒ TVD ⇒ MPwhere the implication “ ∗ ” only holds <strong>for</strong> linear schemes.For a scheme to be consistent, τ j n = 0 if u is a constant solution (where τ j n is the local truncationerror). For a scheme to be at least first order accurate, τ j n = 0 if u is a linear solution of the PDE.Consider a linear schemePlug a constant in there, and we obtainPlug a linear term in there, and obtainu j n+1 = ∑ l1 = ∑ lc l u n j −l .c l .j∆x −(n +1)∆t = ∑ lc l ((j − l)∆x − n∆t)For a quadratic term, we would get− ∆t = ∆x ∑∑ll c l = λl∑l 2 c l = λ 2 .l( − l)c lSo, now try to derive a contradiction between any two of the above to refute second-order. To that end,define√ k√ ka = (l c l)l=−k, b =( c l)l=−kand now use Cauchy-Schwarz:λ 2 = |a · b| 2 ∗( ∑ )( ∑l 2 c ll lc l)= λ 2 ,where equality in “ ∗ ” holds only if a and b are linearly dependent, i.e.√ √l c l = α cl,where α is just some constant independent of l.Theorem 16. (Godunov) A linear monotone (TVD) scheme is at most first-order accurate.2.2 Higher-order TVD SchemesConsideru t + f(u) x =0,where we will worry about the computation of the spatial derivative now and about the time derivativelater. Then we can use backward differencesf(u j ) − f(u j −1 )∆x


Numerics 15<strong>for</strong> first-order accuracy or<strong>for</strong> second-order accuracy or<strong>for</strong> third-order.f(u j+1 ) − f(u j −1 )2∆x32 f(u j) − 2f(u j −1 )+ 1 2 f(u j −2)∆x2.2.1 General Framework of a Conservative Finite-Volume SchemeConsider our conventional notation of I j = [x j −1/2 , x j+1/2 ], where ∆x j = x j+1/2 − x j −1/2 . Now integratethe PDE:∫xd j+1/2udx + f(u(xj+1/2 )) − f(u(xdtj −1/2 )) =0x j −1/2Denoteū j = 1 ∫x j+1/2u dx.∆x x j −1/2ThenA finite volume scheme is of the <strong>for</strong>mwhere fˆj+1/2 is the numerical flux. We wantddt ū j + 1∆x j[f(u(x j+1/2 , t)) − f(u(x j −1/2 , t)).ddt ū j + 1 []fˆj+1/2 − fˆj −1/2 ,∆x jfˆj+1/2 ≈ f(u(x j+1/2 , t)).For the time being, let’s assume f ′ (u) 0 and fˆj+1/2 = f(ū j ), which is the numerical flux <strong>for</strong> Godunov,Roe, Engquist-Osher. See below <strong>for</strong> the case of unknown sign.fˆj+1/2 = fˆ(ū j , ū j+1 ),where fˆ(↑, ↓). So, we can try to compute u j+1/2 using the in<strong>for</strong>mation {ū j , ū j+1 } as(1)u j+1/2(2)u j+1/2= 1 2 (ū j +ū j+1 ),= 3 2 ū j − 1 2 ū j −1,so that(1)fˆj+1/2(2)fˆj+1/2)(1) 1= f(u j+1/2) = f(2 (ū j + ū j+1 ) ,(2) 1= f(u j+1/2) = f(2 (3ū j − ū j −1 )).The above fluxes are 2nd order accurate, and are called the 2nd order central and upwind flux, respectively.(u (1) is gained from the line connecting the cell centers at the cell averages of I j and I j+1 . u (2) isthe same <strong>for</strong> I j and I j −1 .)The step from {ū j } → {u j+1/2 } is called reconstruction.⎛⎞(1)fˆj+1/2(2)fˆj −1/2= f⎜⎝ ū j + 1 2 (ū j+1 −ū j ) ⎟⎠ ,(1)?ũ⎛j⎞= f⎜⎝ ū j + 1 2 (ū j − ū j −1 ) ⎟⎠ .?ũ j(2)


16 Section 2ũ (i) (1)j measures the distance from the cell average ū j to u j+1/2. Now defineand setThen consider⎨ a |a| < |b|, a b > 0,minmod(a, b)4⎧ b |b| < |a|, a b > 0,⎩0 a b 0( )ũ j4minmod ũ (1) (2)j , ũ j .(3)fˆj+1/2 = f(ū j +ũ j ).Lemma 17. (Harten) If a scheme can be written asū j+1 =ū j +λ ( C j+1/2 ∆ + ū j − D j −1/2 ∆ − ū j )with C j+1/2 0, D j+1/2 0, 1 − λ(C j+1/2 + D j+1/2 ) 0 and λ = ∆t/∆x, then it is TVD. As a matter ofnotation, we haveProof. WriteThus∑∆ + u j = u j+1 − u j ,∆ − u j = u j −u j −1 .∆ + ū n+1 j = ∆ + ū n j + λ(C j+3/2 ∆ + ū n j+1 − D j+1/2 ∆ + ū n j −C j+1/2 ∆ + ū n j + D j −1/2 ∆ − ū n j )= [1 − λ(C j+1/2 + D j+1/2 )]∆ + ū n nj +λC j+3/2 ∆ + ū j+1 +λD j −1/2 ∆ − ū n j .|∆ + ū n−1 j | [ 1 −λ(C j+1/2 + D j+1/2 ) ] |∆ + ū n j | + λC j+3/2 |∆+ū j+1 + λD j −1/2 |∆ − ū n j | .?C j ′ +1/2 |∆ + ū n j ′ |n |[ 1 − λ(Cj+1/2 + D j+1/2 )+λC j+1/2 + λD j+1/2] |∆+ ū j n |?D j ′′ +1/2 |∆ + ū n j ′′ |j|∆ + ū n−1 j | ∑ jTV(ū n+1 j ) TV(u n j ),which proves the claim.□Next, prove that the scheme we designed above is TVD using Harten’s Lemma. Rewriteū j n+1 = ū j −λ[f(ū j +ũ j ) − f(ū j −1 + ũ j −1 )] = ū j − λ [ − D j −1/2 ∆ − ū j ],withD j −1/2 = f(ū j + ũ j ) − f(ū j −1 + ũ j −1 )= f ′ (ξ) ū j − ū j −1 + ũ j −ũ j −1⎡ū j −ū j −1⎤ū j − ū j −1ũ jũ j −1= f ′ (ξ) ⎢⎣ 1+ − ⎥ū j −ū j −1 ū j −ū j −1 ⎦ 0?0·?0· 1 1 22Thus our scheme is TVD.We also get a condition <strong>for</strong> the CFL number.□which comes fromD j −1/2 3/2f ′ (ξ) 3 2 max |f ′ (ξ)|,1 −λD j −1/2 1− 3 2 λ max |f ′ (ξ)| 0⇐ λ max |f ′ (ξ)| 2 3 .If we use a 2nd order Runge-Kutta method likeū (1) = L(ū n ),ū n+1 = 1 ( )ū2n + L(ū (1) ) ,


Numerics 17thenTV(ū (1) ) TV(ū n )TV(ū n+1 ) 1 2 TV(ū n ) + 1 2 TV(L(ū (1) )) 1 2 TV(ū n ) + 1 2 TV(ū (1) ) 1 2 TV(ū n ) + 1 2 TV(ū n )= TV(ū n ).The scheme treated here is called MUSCL (“monotone upstream scheme <strong>for</strong> conservation laws”).Homework #3:1. Prove: Conservative montone schemes are at most first order accurate.2. Prove: For every convex entropyU ′′ (u)0and a conservative monotone scheme, there exists a consistent (Fˆ(u,, u) = Fˆ(u)) entropy fluxFˆj+1/2 such that the following cell entropy inequality holdswhere(We proved this <strong>for</strong> U(u) = |u − c|.)3. Code:U(u j n+1 ) − U(u j n )∆t+ Fˆj+1/2 −Fˆj −1/2∆x 0,u n+1 j = u n j − λ(fˆj+1/2 − fˆj −1/2)=H(u j −p ,,u j+q ).⎧ ( )⎨ u 2u t + =0 2 x⎩ u(x, 0)=1+ 1 sin(x) 2on 0 x2π to (i) t = 1.0 and (ii) t = 3.0. Use a uni<strong>for</strong>m grid with N = 20, 40, 80, 160, 320. Usei. First order Godunov (upwinding)ii. 2nd order central (ũ (1) )iii. 2nd order upwind (ũ (2) )iv. MUSCL (minmod)For (i): tables of L 1 errors and orders. For (ii): Figures <strong>for</strong> N = 40.2.2.2 Generalized MUSCL SchemeWe are still consideringwith a scheme of the <strong>for</strong>mū n+1 j =ū n −j − λ[fˆ(u j+1/2u t + f(u) x =0,+, u j+1/2 ) − fˆ(u j −1/2 , u j −1/2 )],where fˆ(↑, ↓) is a monotone flux. Be<strong>for</strong>e we can seriously start considering the above scheme, we need tospecify the reconstruction step, which achieves the mapping−n↑+n↑Procedure:±{ū j }{ū j+1/2 }.


18 Section 2From {ū j }, we obtain the reconstructed functions P j (x) defined on I j = (x j −1/2 , x j+1/2 ) and−+then take u j+1/2 =P j (x j+1/2 ), u j+1/2 =P j+1 (x j+1/2 ). Conditions on P j :1 ∫•∆x I jP j (x)dx =ū j ,∫• PI j (x)dx =ū j+l <strong>for</strong> some set of l0. (accuracy)j+l1∆x3rd order reconstruction <strong>for</strong>mulas:(1)u j+1/2(2)u j+1/2= 1 3 ū j −2 − 7 6 ū j −1 + 116 ū j,= − 1 6 ū j −1 + 5 6 ū j − 1 3 ū j+1.We could then choose(3)u j+1/2−u j+1/2= 1 3 ū j + 5 6 ū j+1 − 1 6 ū j+2.(2)=u j+1/2+, u j+1/2(3)= u j+1/2and once more obtain a linear scheme, which is third order accurate and, by Godunov’s theorem, shouldbe oscillatory. Now defineor equivalently−ũ j = u j+1/2 − ū j ,+ũ˜j+1 = u j+1/2 + ū j+1 ,−u j+1/2+u j+1/2= ū j + ũ j ,= ū j+1 − ũ˜j+1 .Then, remember our previous modification of the reconstruction and do something analogous:and with thatũ j mod = minmod(ũ j , ū j+1 −ū j , ū j − ū j −1 ),ũ˜jmod = minmod(ũ˜j, ū j+1 −ū j , ū j − ū j −1 )u −,modj+1/2u +,modj+1/2= ū j + ũ jmod= ū j −ũ˜j+1mod .To show that this modification does not destroy much accuracy and is in fact TVD, considerū n+1 j = ū n j −λ[fˆ(u −,mod j+1/2, u +,mod j+1/2) − fˆ(u −,mod j+1/2, u j −1/2+,mod )+ fˆ(u −,mod j+1/2, u +,mod j −1/2) − fˆ(u −,mod j −1/2, u j −1/2+,mod )],?(2)?(1)where these terms correspond to the marked terms in the assumption of Harten’s lemma:()ū j+1 =ū j + λ C j+1/2 ∆ + ū j − D j −1/2 ∆ − ū j .?(2)?(1)Now considerD j −1/2 = fˆ(u −,mod j+1/2, u +,mod j −1/2) − fˆ(u −,mod j −1/2, u +,mod j −1/2)ū j − ū j −1mod= fˆ1(ξ, u +,mod j −1/2) ū j + ũ mod j − ū j −1 −ũ j −1⎡ū j −ū j −1= fˆ1(ξ, ?+,mod u j −1/2 ) · ⎢⎣ 1 +0 (monotonicity) 0.ũ j mod−ū j − ū j −1?0·1?0·2ũ modj −1ū j − ū j −1?0·1⎤⎥⎦.


Numerics 19Claim:In smooth and monotone regions the scheme maintains its original high order accuracy.Consider the following Taylor expansions:−u j+1/2= u(x j+1/2 )+O(∆x r ), r 2= u(x j )+u x (x j ) ∆x2 + O(∆x2 ).ū j = 1 ∫u(x)dx∆x I j= 1(x − x[u(x j ) +u x (x −x j )+u j )x,x∆x∫I 2j2= u(x j )+O(∆x 2 ).−ũ j = u j+1/2 − ū j= u x (x j ) ∆x2 + O(∆x2 ).ū j+1 − ū j = u(x j+1 ) − u(x j )+O(∆x 2 )= u x (x j )∆x +O(∆x 2 )ū j − ū j −1 = u x (x j )∆x +O(∆x 2 ).]+ O(∆x 3 ) dxObserve that the second and third arguments of the minmod function–it is about half as big as the firstone. The monotonicity assumption above has the consequence that we may neglect the second-orderterms in favor of the first-order one.Theorem 18. (Osher) TVD schemes are at most first-order accurate near smooth extrema.A simple argument by Harten shows something similar. Why are we restricted near smooth extrema?Suppose we are considering u t +u x =0.Consider what TVD means here:∆x 2At most first order!initial conditionexact solution after ∆tFigure 4. Why TVD schemes don’t do so well near smooth extrema.What routes can we take out of this dilemma? Relax TVD: Only demand TVB.TV(ū n+1 )(1 +C∆t)TV(ū n )


20 Section 2orBoth have the consequence thatTV(ū n+1 ) TV(ū n )+C∆t.TV(ū n ) C(T)<strong>for</strong> n∆t T . TVD/TVB is also an important theoretical property: The space of all TVB functions is precompact,which has important consequences <strong>for</strong> convergence results.This leads us to using a modified minmod function (min-mod-mod? min-mod 2 ? :-) ReplacebywithWe get the following properties:• The scheme is TVB:where N is the total number of cells.minmod(ũ j , ū j+1 − ū j , ū j − ū j −1 )minmod(ũ j , ū j+1 − ū j , ū j − ū j −1 )minmod(a, b, c)4{ a |a| M∆x2m(a, b, c) otherwise.TV(ū n+1 ) TV(ū n+1 )+CM ∆x 2 N TV(ū n )+C∆t• The scheme maintains its high-order accuracy in smooth regions including at local extrema.ũ j =u x (x j ) ∆x2 +O(∆x2 )=O(∆x 2 )near smooth extrema. The choice of M represents a tradeoff between oscillation and accuracy. Oneanalysis of DG was carried out using M = 2 3 |u x,x| at extrema.Discussion of HW#3, Problem 2: Here’s how to show the CEI in the semidiscrete case. Let f(↑, ↓) andU ′′ (u)0, andu∫F(u)=∫U ′ (u)f ′ Integration by parts u(u)du = U ′ (u)f(u) − U ′′ (u)f(u).ThenDefineThenThendu jdt + 1 []fˆ(u j , u j+1 ) x − fˆ(u j −1 , u j ) = 0∆x+ 1 []∆x U ′ (u j ) fˆ(u j , u j+1 ) − fˆ(u j −1 , u j ) = 0.ujFˆj+1/2 =U ′ (u j )fˆ(u j , u j+1 ) −∫U?′′ (u)f(u)du.dU(u j )+ 1 []Fˆj+1/2 − Fˆj −1/2 + 1dt ∆x∆x Θ j = 0.“junky” :)dU(u j )dtΘ j ====∫ uj∫ uj −1U ′′ (u)f(u)du − U ′ (u j )fˆ(u j −1 , u j )+U ′ (u j −1 )fˆ(u j −1 , u j ) − U ′′ (u)f(u)du∫∫∫u jU ′′ (u)f(u)du − (U ′ (u j ) −U ′ (u j −1 )fˆ(u j −1 , u j )u j∫u jU ′′ (u)f(u)du − U ′′ (u)dufˆ(u j −1 , u j )u j −1u j −1u j −1u j −1u j ]U (u)[′′ f(u) − fˆ(u j −1 , u j ) du 0.


Numerics 21Then1. u j −1 < u j . u j −1 u jf(u) − fˆ(u j −1 , u j ) = fˆ(u, u) − fˆ(u j −1 , u j )...and then he cleaned the blackboard.(End of HW discussion)2.3 Essentially Non-Oscillatory SchemesThis scheme goes back to the idea of the MUSCL scheme,−u j+1/2 ← ū j + 1 2 minmod(ū j+1 − ū j , ū j − ū j −1 ).?∆ +?∆ −Recap: Newton interpolation. Suppose we have n points x j with values y j . Look <strong>for</strong> polynomial of degreen − 1 such that p(x j ) = y j . First review Lagrange polynomials and Lagrange interpolation (l i (x j = δ i,j ).(omitted) Next up, Newton interpolation:y[x i ] = y iy[x i , x i+1] = y[x i+1] − y[x i ]x i+1 −x iy[x i , x i+1 , x i+2 ] = y[x i+1, x i+2 ] − y[x i , x i+1 ]x i+2 − x iThenp(x)= y[x 0 ] + y[x 0 , x 1 ](x − x 0 )+ y[x 0 , x 1 , x 2 ](x − x 0 )(x −x 1 ) + y[x 0 , x 1 , x 2 , x 3 ](x −x 0 )(x − x 1 )(x −x 2 ).But we are doing reconstruction, not interpolation. How can we convert reconstruction to interpolation?Consider that we’re looking <strong>for</strong> a p(x) such that∫x1 j+1/2p(x)=ūj <strong>for</strong> j = 1, 2,m.∆x x j −1/2Then define∫xP(x)= p(ξ)dξand observex 1/2∫x j+1/2P(x j+1/2 )= p(ξ)dξ = ∑ j ∫x l+1/2∆xl ū lx 1/2l=1x l−1/2j = 0,,m.So how do we implement this? (Aargh, Fortran.) This algorithm works only <strong>for</strong> a uni<strong>for</strong>m mesh:1. Given the cell averages ū 0 , ū 1 , ū 2 ,as ub(0),ub(1),...2. Compute the un-divided differences of ū .do i=1,nu(i,0)=ub(1)enddodo l=1,mdo i =1,n-lu(i,l)=u(i+1,l-1)-u(i,l-1)enddoenddo−3. At each location j + 1/2, to compute u j+1/2 , doa. Find the origin is(j) of the ENO stencilis(j)=j


22 Section 2b.do l=1,mif (abs( u(is(j)-1,l) ) .lt. abs( u(is(j),l) ) ) is(j) = is(j)-1enddoun(j)−?u j+1/2is(j)+m= ∑l=is(j)c(l-is(j),j-is(j-1))ub(1)(consider that l-is(j),j-is(j) ∈ {0,,m}).2.4 Weighted ENO SchemesAside: Why is an interpolation polynomial monotone in the cell containing the discontinuity of a jumpfunction? Suppose we’re using 6 points, with the discontinuity in the middle cell. Then the polynomial isof degree five. The mean value theorem tells us that the derivative has zeros in the cells away from thediscontinuity, of which there are four. But the derivative is of degree four, so it can at most have fourzeros: Nice! There isn’t one in the middle cell! (End aside)Idea: Don’t choose stencils like ENO, use a weighted sum.Do it like this:−u j+1/2(1)= w 1 u j+1/2(2)+ w 2 u j+1/2(3)+ w 3 u j+1/2+,(i)where w 1 + w 2 + w 3 += 1 and u j+1/2are the higher-order linear reconstructions above. The goal is to(i)choose the weights such that a higher order than just with u j+1/2is achieved, if the desired smoothness isavailable. Choose α i such that the linear combination of smaller stencils adds up to a high-order stencil.• w i =α i + O(∆x 2 ) in smooth regions• If the stencil S i contains a discontinuity, then we would like to have w i = O(∆x 4 ).We define a “smoothness indicator”, β i to measure the smoothness of the function in stencil s i .αw˜i = i(ε + β i ) 2 i = 1, 2, 3, ε = 10 −6 ,w˜iw i = .w˜1 + w˜2 + w˜3Shu’s graduate student Jiang derived these smoothness indicators:Homework:β i = ∆x 2 ∫I j[(P ′ (x) 2 + ∆x 2 (P ′′ (x) 2 ) 2 ]dx.• Code <strong>for</strong> Burgers’: ⎧⎨u t + ( u ) 22 x = 0⎩ u(x, 0)=1+ 1 sin(x) 2Give same output as be<strong>for</strong>e◦ 3rd order linear using u◦ 3rd order TVD◦ 3rd order TVB (M = 5)◦ 3rd order ENO◦ 5th order ENO◦ 5th order WENO−u j+1/2+u j+1/2: ū j −1 , ū j , ū j+1 ,: ū j , ū j+1 , ū j+2 .


Numerics 23Use 3rd order Runge-Kutta. (Might need to reduce ∆t to see the 5th order accuracy.)(Remember to initialize with and compare to cell averages of IC and exact solution!)2.5 Finite Difference <strong>Methods</strong>We are still consideringwhich we hope to approximate byusingOur requirements areu t + f(u) x =0,du jdt + 1 ()fˆj+1/2 − fˆj −1/2 = 0∆xfˆj+1/2 = fˆ(u j −p ,,u j+q ).2.5.1 AccuracyAccuracy means()fˆj+1/2 − fˆj −1/2 = f(u) x | x=xj +O(∆x r ).Lemma 19. (ENO paper by Shu, Osher) If there is a function h(x) (which depends on ∆x) s.t.f(u(x))= 1 ∫x+∆x/2h(ξ)dξ,∆x x−∆x/2thenf(u) x= 1 [ (h x + ∆x ) (−h x − ∆x )].∆x 2 2All that’s needed to obtain a higher-order scheme is now to approximate the function h to a certaindegree of accuracy.we want{u j } given ⇒ {f(u j )} given ⇒ {h¯j} given {h j+1/2 },reconstructionThenf(u j )= f(u(x j ))= 1 ∫x j+∆x/2h(ξ)dξ = h¯j.∆x x j −∆x/22.5.2 StabilityFor the moment, assume f ′ (u) 0.1. TVD Schemes:a. Use an upwind-biased stencil to compute fˆj+1/2, e.g.b. limit fˆj+1/2 − f(u j )=df j + .{f(u j −1 ), f(u j ), f(u j+1 )} → fˆj+1/2.Thendf j +(mod) = minmod(df j + , f(u j+1 ) − f(u j ), f(u j ) − f(u j −1 )).fˆj+1/2(mod) = f(u j )+df +(mod) j .Then use Harten’s Lemma to prove TVD’ness. We only have the term D j −1/2 since we have a uniquewind direction by assumption, inu n+1 j = u n nj −λ( − C j+1/2 (u j+1 − u n j )+D j −1/2 (u n nj −u j −1 )).


24 Section 3By brute <strong>for</strong>ce, we havewithD j −1/2 = f(u j)+df +(mod) +(mod)j − f(u j −1 ) − df j −1u j −u j −1+(mod)= f(u j) − f(u j −1 ) +df +(mod) j − df j −1u⎡ j −u j −1= f(u j) − f(u j −1 )⎢u j − u j −1 ⎣ 1+?f ′ (ξ)+(mod)df j−f(u j ) − f(u j −1 )?0∗10 D j −1/2 2max |f ′ (u)|.u+(mod)df j −1f(u j ) − f(u j −1 )?0∗1In order to lift the condition on the wind direction (f ′ (u) 0), we need to consider only a subclass ofmontone fluxes, namely those characterized by flux splitting:where• f(u) = f + (u) + f − (u)fˆ(u − , u + )= f + (u − )+ f − (u + ),df•+ (u) df 0,− (u)0.du duOne such example is Lax-Friedrichs: f ± (u)= 1 (f(u) ± αu), where α = max 2 u |f ′ (u)|.• Then use the previous (single-wind-direction) procedure w/ f + (u) instead of f(u).• The mirror-symetric (w.r.t. j + 1/2) procedure with f − (u) instead of f + (u).• Thus we obtain fˆj+1/2.Summary of FV versus FD:FVFDū j = 1 ∫ x j+1/2u(x, t) u∆x x j = u(x j , t)j −1/2reconstruction {ū j } → {u j ±1/2 } reconstruction {f ± ±(u j )} → {fˆj+1/2 }numerical flux fˆ(u − j+1 , u + +j+1 ) numerical flux fˆj+1/2 = fˆj+1/2 + fˆj+1/2any fˆ(↑, ↓) splittable monotone flux fˆ(u − , u + )= f + (u − )+ f − (u + )∆x arbitrary (meshing unrestricted) ∆x uni<strong>for</strong>m or smoothly mappable to uni<strong>for</strong>mnot much physics in the derivation⎤⎥⎦3 Two Space DimensionsNow considerThe good news are:u t + f(u) x + g(u) y =0.• Theoretical properties of weak solutions, entropy solutions etc. are the same as in 1D.• All properties of monotone schmes (TVD, entropy condition, L 1 -contraction, ...) are still valid in2D.Theorem 20. (Goodman & LeVeque) In 2D, TVD schemes are at most first order accurate.Proof. (Very rough idea) Many things can happen in 2D:


Two Space Dimensions 251 0 1 0Low Total VariationHigh TV“TVD” Schemes in the literature <strong>for</strong> nD means schemes which are TVD in 1D and are generalized to2D in a dimension by dimension fashion, like this:du jdt + 1 ()fˆj+1/2 − fˆj −1/2 = 0∆xwith fˆj+1/2 ← {f(u j −1 ), f(u j ), f(u j+1 )}becomesdu i,jdt+ 1 ()fˆi+1/2,j − fˆi−1/2,j + 1 ()fˆi,j+1/2 − fˆi,j −1/2∆x∆ywith fˆi+1/2,j ← {f(u i−1,j ), f(u i,j ), f(u i+1,j )}.They really are not TVD in more than one dimension.One good property we have in more than one dimension is a maximum principle: Given a scheme inHarten <strong>for</strong>m, i.e.withu n+1 ni,j =u i,jwe can proceed as follows:u i,j[n− λ x −Ci+1/2,j (u i+1,j= 0− u n i,j )+D i−1/2,j (u n i,j −u i−1,j )]n − u i,j −1 )][n− λ y −Ci,j+1/2 (u i,j+1 − u n i,j )+D i,j −1/2 (u i,jC i+1/2,j , D i−1/2,j , 1 − λ x [C i+1/2,j + D i+1/2,j ] 0,C i,j+1/2 , D i,j −1/2 , 1 − λ y [C i,j+1/2 +D i,j+1/2 ] 0,n+1 = [ 1 − λ x C i+1/2,j −λ x D i−1/2,j − λ y C i,j+1/2 − λ y D i,j −1/2 ]nu i,j□Thus?0nu i+1,j+λ x C i+1/2,j?0n+ λ x D i−1/2,j u i−1,j?0n+λ y C i,j+1/2 u i,j+1 + λ y D i,j −1/2?0?0nu i,j −1 .min (stencil)u n+1 i,j max (stencil)because it is a convex combination of the values in the stencil.3.1 FV methods in 2DNext, let’s consider FV methods in 2D. Letū˜i,j = 1 ∫∆x∆yy j+1/2∫y j −1/2x i+1/2u(x, y, t)dxdy,x i−1/2


26 Section 3where we note that·˜ is the cell-averaging operator in y,·¯ is the cell-averaging operator in x.Next,Thus[ddt ū˜i,j + 1∆x+ 1∆y=∫1∆x∆y∫1∆x∆yy j+1/2∫y j −1/2y j −1/2x i+1/2f(u)x dx dyx i−1/2y j+1/2f (u(xi+1/2 , y, t)) − f(u(x i−1/2 , y, t))dy.∫y1 j+1/2f (u(xi+1/2 , y, t))dy − 1 ∫]y j+1/2f (u(xi−1/2 , y, t))dy∆y y j −1/2∆y y j −1/2[ ∫x1 i+1/2f (u(x, yj+1/2 , t))dx − 1 ∫]x i+1/2f (u(x, yj∆x∆x−1/2 , t))dxx i−1/2x i−1/2= 0.The equality ( ∗ ) below is what breaks when we switch to a nonlinear equation.FV Scheme:ddt ū˜i,j + 1 []fˆi+1/2,j − fˆi−1/2,j + 1 [ ]ĝi,j+1/2 − ĝ∆x∆yi,j −1/2 = 0.3.1.1 The Linear CaseLet’s consider a simple case to start:u t + au x + bu y =0 ⇒ f(u)=au, g(u) =bu.In this case, we only have to per<strong>for</strong>m 2 reconstructions per point, so that⎡⎤ddt ū˜i,j + 1 ∫y1 j+1/2 f (u(xi+1/2 , y, t))dy − 1 ∫y j+1/2f (u(xi−1/2 , y, t))dy∆x⎢⎣∆y y j −1/2∆y y j −1/2⎥⎦?f˜i+1/2,j=aũ (∗) i+1/2,j = f(ũ i+1/2,j )⎡+ 1 ∫x1 i+1/2⎢ f (u(x, yj+1/2 , t))dx − 1 ∫⎤x i+1/2f (u(x, yj∆y⎣∆x x i−1/2∆x−1/2 , t))dx⎥}x i−1/2⎦ = 0.?ḡ i,j+1/23.1.2 The Nonlinear CaseIn general, if f(u) and g(u) are nonlinear, then we have to per<strong>for</strong>m one reconstructions <strong>for</strong> each point ofthe stencil, i.e. many times along one cut line through the stencil.1D rec num.int.{ũ i+1/2,j {ui+1/2,j+wk }{f(u i+1/2,j+wk )}}{fˆi+1/2,j }1D recր{ū˜i,j }1D recց1D rec num.int.{ū i,j+1/2 {ui+ωk ,j+1/2}{f(u i+ωk ,j+1/2)} {fˆi,j+1/2 }Remark 21. These considerations only matter if we are interested in order of accuracy three or greater.If we are concerned with only second order accuracy, thenis all we need.ū˜i,j = u(x i , y j )+O(∆x 2 , ∆y 2 )


Systems of <strong>Conservation</strong> <strong>Laws</strong> 273.2 Finite Difference <strong>Methods</strong>We are still consideringu t + f(u) x + g(u) y = 0,but we switch the focus of our approximation to actual point values:to get the discretized conservation lawdu i,j+ 1 [dt ∆xWe needu i,j = u(x i , y j , t)fˆi+1/2,j − fˆi−1/2,j]+ 1 [ ]ĝi,j+1/2 − ĝ∆yi,j −1/2 .1[]fˆi+1/2,j − fˆi−1/2,j = f(u) x | x=xj,y=y∆xj+ O(∆x r , ∆y r )<strong>for</strong> accuracy. This is identical to the 1D routine with fixed j.4 Systems of <strong>Conservation</strong> <strong>Laws</strong>u t + f(u) x =0u is a vector, and so is f. For the moment, x is still only 1-dimensional.Example 22. Compressible flow:⎛u= ⎝ ρ ρvE⎞⎛⎠, f(u) = ⎝⎞ρv2ρv + p ⎠,v(E + p)where ρ is density, v is velocity, E is total energy and p is pressure. For a γ-law gas, <strong>for</strong> example, wecould have the constitutive relationshipE =pγ −1 + 1 2 ρv2 .E.g. <strong>for</strong> air γ = 14.(Now, drop the bold-<strong>for</strong>-vector notation.)4.1 A First Attempt: Generalize <strong>Methods</strong> from AM255Example 23. (From 255) If f(u) =Au, then we have the equationu t + Au x =0 (6)If A has only real eigenvalues and a complete set of eigenvectors, then (6) is called hypberbolic. Considerso thatA r i =λ i r i ,AR=R diag(λ 1 ,,λ n ),?Λwhere R has the vectors r i in its columns. Then we obtainR −1 A R =Λ.The rows l i of R −1 are called the left eigenvectors of A, with l i A =λ i l i with l i r j = δ i,j .Now, per<strong>for</strong>m a change of variables, namely v = R −1 u, so thatv t + Λv x =0. (7)


28 Section 4The goal <strong>for</strong> the nonlinear case is to take the lessons from the linear case, but rewrite the scheme (7) sothat it only acts on u. If all the eigenvalues are positive, then we can rewrite the upwind scheme (nowreinstating bold-face-<strong>for</strong>-vector, with index <strong>for</strong> x location)dv jdt + 1∆x Λ[v j −v j −1 ] = 0⇔ du jdt + 1∆x RΛR−1 [Rv j − Rv j −1 ] = 0?u j⇔ du jdt + 1∆x A[u j − u j −1 ] = 0.If we do not have the above eigenvalue condition, then we need a good way to write the resulting systemconcisely. Why not start with some notation...a +4{ a a 0,0 otherwise,a −4{ 0 otherwisea a 0Thus |a| = a + − a − and a = a + + a − . This notation has natural generalizations to matrices and vectors.We obtain the following scheme in v:dv jdt + 1 { Λ + [v j −v j −1 ] + Λ − [v j+1 − v j ] } = 0∆x⇔ du jdt + 1 {}RΛ + R −1∆x +4[u j − u j −1 ] + RΛ − −4[u R −1 j+1 − u j ] = 0.?A?ANote the slightly ambiguous notation here–A + is not the positive part of A in the above sense, eventhough A=A + + A − still holds..4.2 How to Generalize Scalar Higher-Order Schemes to SystemsWe are still consideringu t + Au x = 0.1. Find the eigenvalues of A, hence ΛAlso find the eigenvectors of A, hence R and R −1 .2. At each point that we need to compute a flux or a reconstruction, say at x j+1/2 , do the followinga. v i = R −1 u i (i = j − p,j+q)b. Use the scalar subroutine to each component of v to obtain a reconstruction v j+1/2 .c. u j+1/2 = Rv j+1/2 .Now, why should we do this trans<strong>for</strong>mation instead of just applying the scalar subroutine to u? Considerthis example:(v 1 ) t + (v 1 ) x = 0,(v 2 ) t + (v 2 ) x = 0.Any combination of u is bound to develop two shocks, travelling at different speeds. If however we calculatev, then we retain the two nicely separated shocks. To drive home the point, ENO always counts onthe fact that it can find a stencil near a shock where the function is smooth. For a point “trapped”between two shocks, this assumption is violated, and we will lose something.Also note that this procedure only makes sense if you are doing something nonlinear in step 2b.Next, note that if our discussion is targetted at generalizing to nonlinear conservation laws. Consequently,it is really pointless to actually carry out steps 2a and 2c each time unless the matrix A is actuallychanging as it will be.Note 24. “Theorem”: All results about stability and convergence carry over to the case of linear systemsif the numerical schemes use the above the “characteristic” procedure.


Systems of <strong>Conservation</strong> <strong>Laws</strong> 294.3 The Nonlinear CaseIf we consider the equationthen• There is essentially no theory.u t + f(u) x =0,• The numerical procedure is essentially identical to that <strong>for</strong> the linear system case per<strong>for</strong>med in(local) characteristic fields.Additional Homework: (This+HW4 due Nov 29)1. Add third order finite difference version to HW4.[one class’s worth of material is missing here. It is available as a separate PDF file called 257-missedclass.pdfcourtesy of Ishani Roy.]


30 Section 55 The Discontinuous Galerkin Methodu t + f(u) x = 0.To begin a FV discretization, we rewrite this as∫x1 j+1/2(ut + f(u) x )dx=0,∆t x j −1/2which results in:dū jdt + 1 (f(uj+1/2 ) − f(u∆x j −1/2 ) ) = 0jFV in its full glory isdū jdt + 1 − +− +(fˆ(u∆x j+1/2 , u j+1/2 ) − fˆ(u j −1/2 , u j −1/2jwhere, to make this a scheme, we need a monotone flux fˆ(u − , u + ), which needs to satisfy the followingcriteria:• fˆ(↑, ↓),• fˆ(u, u)=u,• Lipschitz continuous.For DG, we do something different. We multiply the PDE by a “test function” v, then integrate the resultover the interval (x j −1/2 , x j+1/2 ) ∫x j+1/2(ut + f(u) x )v dx =0.)),x j −1/2Now consider u and v both from a finite-dimensional function space V h , where h = max (x j+1/2 , x j −1/2 ).The space is then given byV h = {w: w| Ij ∈ P k (I j )},where I j = (x j −1/2 , x j+1/2 ) and P k (I j ) is a collection of polynomials of degree k on cell I j . We observedim V h =N · (k +1). Then per<strong>for</strong>m integration by parts and write∫x j+1/2∫x j+1/2ut v − f(u)vx dx+ f(u j+1/2 )v j+1/2 − f(u j −1/2 )v j −1/2 = 0.x j −1/2x j −1/2To make this into a scheme: find u ∈V h such that∫ ∫u t v dx −I jf(u)v x dx+ f(u j+1/2 )v j+1/2 − f(u j −1/2 )v j −1/2I j ???{ 1 x ∈ Ij?,v =0 elsewhere,− f(u j −1/2 ) v j −1/2 = 0∫from leftfrom rightu t dx+ f(u j+1/2 ) − f(u j −1/2 ) = 0,I jis true <strong>for</strong> any test function v ∈ V h . But the term marked “?” is meaningless, since the functions aredouble-valued at the spots in question. To motivate a meaning <strong>for</strong> the term, consider the following: If wetake the test functionwe recover∫I ju t dx + f(u j+1/2 )v j+1/2which is exactly reminiscent of the FV scheme, motivating the equality−f(u j+1/2 ) − f(u j −1/2 )= fˆ(u j+1/2+= 0, u j+1/2 ) − fˆ(u j −1/2 , u j −1/2 )−+


The Discontinuous Galerkin Method 31and thus the scheme∫ ∫− +u t v dx − f(u)v x dx + fˆ(u j+1/2 , u j+1/2I j I jPick a basis <strong>for</strong> V h :For example, we could take−)v j+1/2V h = {ϕ (l) j : 1 j N,0lk}.ϕ (0) j(x) = 1 Ij (x),ϕ (1) j (x) = (x −x j )1 Ij (x),ϕ (2) j (x) = (x −x j ) 2 1 Ij (x),−− fˆ(u j −1/2+, u j −1/2+)v j −1/2=0.thenku(x, t) = ∑ l=1u j (l) (t)ϕ j (l) (x), x ∈I j .Now take v = ϕ (m) j (x), m = 0, 1,,l and put that into our scheme∫ ( )x j+1/2 ∑ku (l) j (t)ϕ (l) j (x) ϕ (m) j (x)dxx j −1/2 l=0t∫ ( )x j+1/2 ∑k− f u (l) j (t)ϕ (l) dj (x)x j −1/2dx ϕ (m) j (x)dx(l=0∑k+ fˆ u (l) j (t)ϕ (l) j (x j+1/2 ), ∑ )ku (l) j+1 (t)ϕ (l) j+1 (x j+1/2 ) ϕ (m) j (x j+1/2 )(l=0l=0∑k(l) (l)− fˆ u j −1 (t)ϕ j −1 (x j −1/2 ), ∑ )ku (l) j (t)ϕ (l) j (x j −1/2 ) ϕ (m) j (x j −1/2 ) = 0.l=0l=0Working with that yieldswhere∑kl=0∫ddt u (l) j (t)x j+1/2 (l) ϕj (x)ϕ (m) j (x)dxx j −1/2?(k+1)×(k+1) matrix+F(u j −1(t), u j (t), u j+1 (t)) = 0,⎛ ⎞u (0) j (t)u j (t)= ⎜ ⎟⎝ ⎠ .u (k) j (t)If the matrix above (also called the local mass matrix ) is, we can rewrite the scheme as∑kl=0ddt u j(t)+F˜(u j −1 (t), u j (t), u j+1 (t))=0,which, if F˜ is locally Lipschitz (which it is), gives a well-defined scheme. If we have a linear PDE f(u) =Au, where A =A(x, t), then the scheme becomesdu j (t)dt+[B j −1 u j −1 + C j u j (t)+D j+1 u j+1 (t)] = 0,where the three matrices B j −1 , C j , D j+1 (each of size (k + 1) ×(k +1)) do not depend on u.


32 Section 55.1 Some Theoretical Properties of the SchemeThis scheme satisfies the cell entropy inequality <strong>for</strong> the square entropy U(u) = u 2 /2. Recall the generalentropy inequality, where <strong>for</strong> an entropy U satisfying U ′′ (u)0 and a matching fluxwe havein some weak sense.F(u)=∫ uU ′ (u)f ′ (u)du,U(u) t + F(u) x 0Proof. Take v = u in the scheme:( ∫ )d u2dt 2 dx( ∫d u2dt∫ ∫u t u dx − f(u)u xI j I j−dx+ fˆj+1/2u j+1/2?g(u) x+− fˆj −1/2u j −1/2= 0)−2 dx − +−+g(u j+1/2 )+ g(u j −1/2 )+ fˆj+1/2u j+1/2 − fˆj −1/2u j −1/2 = 0[]−− +++ Fˆj+1/2 − Fˆj −1/2 + − g(u j −1/2 )+ fˆj −1/2u j −1/2 + g(u j −1/2 ) − fˆj −1/2u j −1/2 = 0?Θ j −1/2where we have takenandg(u)=∫ uf(u)du, g ′ (u) = f(u)−Fˆj+1/2 = − g(u j+1/2−)+ fˆj+1/2u j+1/2,where we observe that Fˆ is consistent, i.e.Fˆ(u, u) = − g(u) + f(u)u= ? ∫ uu f ′ (u)du←∫ u∫ uudf(u) =uf(u) − f(u)du.?g(u)Fˆ ′= − f(u) + f ′ (u)u + f(u) = f ′ (u)u.We would like to show Θ j −1/2 0 to prove the cell entropy inequality, i.e. the term above 0.Θ = − g(u − )+ fˆ(u − , u + )u − + g(u + ) − fˆ(u − , u + )u += g(u + ) − g(u − ) − fˆ(u − , u + )(u + − u − )= g ′ (ξ)(u + )(u + −u − ) − fˆ(u − , u + )(u + − u − )= (u + − u − )(f(ξ) − fˆ(u − , u + ))= (u + − u − )(fˆ(ξ, ξ) − fˆ(u − , u + )).After a simple case distinction on u − ≶ ξ ≶ u + and using fˆ(↑, ↓), we find Θ0.□

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!