<<

A genuinely high order total variation diminishing scheme for one-dimensional scalar conservation laws1

Xiangxiong Zhang2 and Chi-Wang Shu3

Abstract

It is well known that finite difference or finite volume total variation diminishing (TVD) schemes solving one-dimensional scalar conservation laws degenerate to first order accuracy at smooth extrema [8], thus TVD schemes are at most second order accurate in the L1

for general smooth and non-monotone solutions. However, Sanders [12] introduced a third order accurate finite volume scheme which is TVD, where the total variation is defined by measuring the variation of the reconstructed polynomials rather than the traditional way of measuring the variation of the grid values. By adopting the definition of the total variation

for the numerical solutions as in [12], it is possible to design genuinely high order accurate TVD schemes. In this paper, we construct a finite volume scheme which is TVD in this sense with high order accuracy (up to sixth order) in the L1 norm. Numerical tests for a fifth order accurate TVD scheme will be reported, which include test cases from traffic flow

models.

AMS subject classification: 65M06 Keywords: hyperbolic conservation laws; finite volume scheme; total variation diminishing; total variation bounded; high order accuracy; conservative form

1Research supported by NSF grant DMS-0809086 and AFOSR grant FA9550-09-1-0126. 2Department of , Brown University, Providence, RI 02912. E-mail: Xiangx- iong [email protected] 3Division of Applied Mathematics, Brown University, Providence, RI 02912. E-mail: [email protected]

1 1 Introduction

We consider numerical solutions of one-dimensional hyperbolic scalar conservation law

ut + f(u)x = 0, u(x, 0) = u0(x), (1.1)

where u0(x) is assumed to be a . The main difficulty in solving (1.1) is that the solution may contain discontinuities even if the initial condition is smooth.

Successful numerical schemes for solving (1.1) are usually total variation stable, for exam- ple the total variation diminishing (TVD) schemes [1] or the total variation bounded (TVB) schemes [14], or essentially non-oscillatory, for example the essentially non-oscillatory (ENO) schemes [2, 15] or the weighted ENO (WENO) schemes [6, 4]. ENO and WENO schemes, al- though uniformly high order accurate and stable in applications, do not have mathematically provable TVB properties for general solutions and do not satisfy a maximum principle. It is certainly desirable to have a TVD or TVB scheme, which shares the TVD property of the exact entropy solution of (1.1), satisfies a maximum principle, and has at least a convergent subsequence to a weak solution of (1.1) due to its compactness. Typically, for a finite difference scheme with the numerical solution given by the grid values uj, or a finite volume scheme with the numerical solution given by the cell averages uj, the total variation of the numerical solution is measured by

T V (u) = |uj+1 − uj| (1.2) j X which is the standard bounded variation semi-norm when the numerical solution is considered to be a piecewise constant function with the data uj. A scheme is TVD if the numerical solution satisfies T V (un+1) ≤ T V (un) (1.3) where un refers to the numerical solution at the time level tn. A TVB scheme is one which satisfies T V (un) ≤ M (1.4)

2 for all n such that tn ≤ T , where the constant M does not depend on the mesh sizes but may depend on T . A sufficient condition for a scheme to be TVB is

T V (un+1) ≤ T V (un) + M∆t, or T V (un+1) ≤ (1 + M∆t)T V (un), where M is a constant and ∆t is the time step.

It is well known that finite difference or finite volume TVD schemes solving (1.1), where the total variation is measured by (1.2), necessarily degenerate to first order accuracy at smooth extrema [8], thus TVD schemes are at most second order accurate in the L1 norm for general smooth and non-monotone solutions. While the TVB schemes in [14] can overcome this accuracy degeneracy difficulty, the schemes are no longer scale-invariant (scale-invariance refers to the fact that the scheme does not change when x and t are scaled by the same factor) and involve a TVB parameter M which must be estimated and adjusted for individual problems.

In [12], Sanders introduced a third order accurate finite volume scheme which is TVD. The main idea in [12] is to define the total variation by measuring the variation of the reconstructed polynomials, rather than the traditional measurement as in (1.2). The scheme of Sanders in [12] can be summarized in the following steps.

0 0 • Start from the cell averages u¯j and the cell boundary values u 1 for all j from the j+ 2

initial condition u0(x).

• For n = 0, 1, · · · , perform the following

1. Reconstruct a piecewise quadratic polynomial solution un(x), based on the infor-

n n n mation u¯j and u 1 for all j, such that u (x) is third order accurate (degenerates j+ 2 to second order at isolated critical points, therefore still third order in the L1

3 norm), and TVD T V (un(x)) ≤ T V (un−1(x)) (1.5)

where the total variation is measured by the standard bounded variation semi-

norm of the piecewise quadratic polynomial solution un(x). For n = 0, T V (un−1(x))

is taken as the bounded variation semi-norm of the initial condition u0(x).

2. Evolve the PDE (1.1) exactly for one time step ∆t from the “initial condition”

n n n+1 u (x) at the time level t , and take the cell averages u¯j and the cell boundary

n+1 values u 1 for all j from this exactly evolved solution. Then return to Step 1 j+ 2 above.

The crucial step in Sanders’ scheme is the reconstruction, which should be high order accurate and TVD in the sense of (1.5). The second step above, namely the exact time evolution and cell averaging, does not increase the total variation. The resulting scheme is thus TVD as long as the reconstruction is TVD. The purpose of this paper is to generalize the scheme of Sanders, mainly the step of the high order TVD reconstruction, to higher order accuracy. In order to the total variation of a polynomial p(x) of degree k over the [a, b], we would need to obtain the zeros of its derivative p0(x) in this interval,

denoted by a1, a2, · · · , ak−1. If we also denote a0 = a and ak = b, then the variation of k b 0 p(x) over the interval [a, b] is a |p (x)|dx = |p(aj) − p(aj−1)|. If we insist on working j=1 with explicit formulas for the zerosR of polynomialsP to save cost, then we can only have the polynomial degree k of p(x) up to five, hence our approach can generate schemes up to sixth order in the L1 norm.

A major difficulty in generalizing Sanders’ TVD reconstruction to higher order is the design of the nonlinear limiter, which should maintain accuracy in smooth regions while enforcing the TVD property (1.5). The original limiter of Sanders in [12] works well for the third order scheme (k = 2), but it seems difficult to generalize it directly to higher order.

We will develop a different limiter to achieve this purpose. The finite volume schemes we

4 develop in this paper are (k +1)-th order accurate in the L1 norm, conservative, and TVD in the sense of (1.5). Numerical tests for a fifth order accurate TVD scheme will be reported, which include test cases from traffic flow models.

This paper is divided into six sections. In Section 2 we develop a Hermite type re- construction procedure using piecewise polynomials of degree k for functions of bounded variation. We use a quartic polynomial (k = 4) as an example to illustrate the procedure. The reconstruction does not increase the variation of the function being approximated, and

is (k + 1)-order accurate in regions where the approximated function is smooth. In Section 3 we show how to evolve the approximation in time in essentially the same way as in [12]. In Section 4, we derive the conservative form of the scheme and show that the local truncation error is formally (k + 1)-th order accurate. In Section 5 we present some numerical examples

of the fifth order scheme using quartic reconstruction polynomials. Numerical examples in- clude those from traffic flow models. Finally, in Section 6, we give concluding remarks and remarks for future work.

2 A fifth order TVD reconstruction

For a smooth function u(x) with bounded variation over an interval J ⊂ R, we would like to find a piecewise polynomial r(x) approximating u(x) with the property that the variation of r(x) does not exceed that of u(x). We will use a Hermite type quartic reconstruction

polynomial as an example to show how to find such an approximation. However we remark that this approximation procedure can also be applied to any reconstruction polynomials of degree up to five, including those obtained with the ENO or WENO procedure. We will use the following notation for our mesh 1 Ij = [x − 1 , x 1 ], xj = x − 1 + x 1 , ∆x = x 1 − x − 1 , j 2 j+ 2 2 j 2 j+ 2 j+ 2 j 2   which is assumed to be uniform for simplicity, and for the discretization of u over the mesh,

x 1 1 j+ 2 u¯j = u(x) dx, u − 1 = u(x − 1 ). ∆x j 2 j 2 x − 1 Z j 2

5 Given the cell averages and cell boundary point values of u(x), there are many ways to obtain a reconstruction polynomial pj(x) over the cell Jj. We choose to use the Hermite type reconstruction of degree four; i.e., the polynomial pj(x) should satisfy

1 pj(x) dx = u¯i, i = j − 1, j, j + 1; and pj(x  1 ) = u(x  1 ). ∆x j 2 j 2 ZIi If the reconstruction is written as

4 3 2 pj(x) = a4(x − xj) + a3(x − xj) + a2(x − xj) + a1(x − xj) + a0,

then the coefficients can be given explicitly as

u¯j−1 + 298u¯j + u¯j+1 − 54(uj− 1 + uj+ 1 ) a = 2 2 0 192 u¯j−1 − u¯j+1 − 10(u¯j− 1 − uj+ 1 ) a = 2 2 1 8∆x −(u¯j−1 + 58u¯j + u¯j+1) + 30(uj− 1 + uj+ 1 ) a = 2 2 2 8∆x2 u¯j+1 − u¯j−1 + 2(uj− 1 − uj+ 1 ) a = 2 2 3 ∆x3 5u¯j−1 + 50u¯j + 5u¯j+1 − 30(uj− 1 + uj+ 1 ) a = 2 2 . 4 12∆x4

It can be easily shown that the following properties hold for pj(x):

I Accuracy (recall that u(x) is a smooth function)

5 pj(x) = u(x) + O(∆x ), ∀x ∈ Ij (2.1)

II Agreement of the cell averages

1 p (x)dx = u¯ , ∀j (2.2) ∆x j j ZIj

Define the piecewise polynomial p(x) = j pj(x)χj(x), where χj is the characteristic function on Ij. Notice that for the specific HermiteP polynomial pj(x) defined above, we have p(x − 1 ) = pj(x − 1 ) = pj−1(x − 1 ) = u(x − 1 ), that is, p(x) is a . For any j 2 j 2 j 2 j 2

piecewise polynomial function r(x) = j rj(x)χj(x), where rj(x) is a polynomial which may P 6 not satisfy rj(x − 1 ) = u(x − 1 ) or rj(x 1 ) = u(x 1 ), we define the variation of r on each j 2 j 2 j+ 2 j+ 2 cell by x 1 j+ 2 0 V ar(rj) = |r (x)| dx + |rj(x − 1 ) − u − 1 | + |rj(x 1 ) − u 1 |. j j 2 j 2 j+ 2 j+ 2 x − 1 Z j 2 The standard total variation seminorm of r(x) is

x 1 j+ 2 0 T V (r) = |rj(x)| dx + |rj(x − 1 ) − rj−1(x − 1 )| ≤ V ar(rj).  j 2 j 2  j xj− 1 j X Z 2 X   The approximation r(x) is TVD if it satisfies

T V (r) = |r0(x)| dx ≤ |u0(x)| dx = T V (u), ZJ ZJ where the is in the generalized sense since r0(x) as well as u0(x) may contain δ- functions. Obviously, r is a TVD approximation if

0 V ar(rj) ≤ |u (x)| dx, ∀j ZIj

where we assume the cell boundary values u(x − 1 ) are well defined and shared by both cells j 2

Ij−1 and Ij. For convenience, we denote the total variation of the function u over the interval

Ij by 0 T V (u)j = |u (x)| dx. ZIj Now the question is, given a piecewise approximation polynomial p(x) and certain informa- tion of u(x) including its extrema, its cell boundary values u − 1 , its cell averages u¯j and j 2

its cell total variation T V (u)j for all j, whether we can find a TVD approximation r(x) by limiting p(x) such that the accuracy condition (2.1) and the conservation condition (2.2) still hold.

To obtain the TVD property, it suffices to enforce

V ar(rj) ≤ T V (u)j, ∀j. (2.3)

First, we assume u(x) has only finitely many nontrivial extrema so we can take the mesh fine enough such that there is at most one extremum of u(x) in each cell. We will deal with

7 the case of infinitely many extrema at the end of the section. We now discuss the limiting process case by case:

Case I. pj(x) is monotone in the cell Ij.

For this case, the TVD requirement (2.3) is already satisfied since pj(x) is a Hermite type polynomial which interpolates u at the cell boundaries.

Case II. pj(x) is not monotone in the cell Ij, but u(x) is monotone in this cell.

In this case, the TVD property (2.3) does not hold for pj(x) because

V ar(pj) > |u 1 − u − 1 | = T V (u)j. j+ 2 j 2

Without loss of generality, we only discuss the situation that u(x) is monotonically increasing

0 in Ij, i.e., u − 1 ≤ u 1 and u (x) ≥ 0, ∀x ∈ Ij. Since pj(x) is not monotone, we must j 2 j+ 2 0 have pj(x) < 0 for some x ∈ Ij. Consider pj(x) = pj(x) − αj(x − xj), where αj denotes the minimum of p0 (x) over I . We then have the following lemma. j j e

Lemma 2.1. The accuracy condition (2.1) and the cell average agreement condition (2.2)

still hold for pj(x).

Proof: The agreemene t of the cell average is obvious. To prove accuracy, it suffices to show 4 αj = O(∆x ).

0 0 4 We have pj(x) − u (x) = O(∆x ) since pj(x) is a fourth degree Hermite approximation

0 min 0 min of u(x). If pj(x) attains its minimum at the point x ∈ Ij, then we have u (x ) ≥ 0,

0 min 0 min 4 αj = pj(x ) < 0, therefore |αj| = −αj ≤ u (x ) − αj = O(∆x ).

We now enforce the TVD requirement (2.3). For this purpose, we apply the following

scaling to pj(x) around its cell average on the cell Ij:

e θj rj (x) = θj(pj(x) − u¯j) + u¯j,

e where θj ∈ [0, 1] is a parameter to be determined by the TVD requirement (2.3).

8 θj Lemma 2.2. If V ar(pj) > T V (u)j, then there exists θj ∈ [0, 1] such that V ar(rj ) = T V (u) . j e Proof: Take u − 1 − u¯j u 1 − u¯j j 2 j+ 2 θj = min , . ( pj(xj− 1 ) − u¯j pj(xj+ 1 ) − u¯j ) 2 2

First, we need to show θj ∈ [0 , 1]. If θj > 1, then e e

|u − 1 − u¯j| > |pj(x − 1 ) − u¯j|, |u 1 − u¯j| > |pj(x 1 ) − u¯j|. (2.4) j 2 j 2 j+ 2 j+ 2

e e Since u(x) and pj(x) are both monotonically increasing in Ij, we have

e u − 1 ≤ u¯j ≤ u 1 (2.5) j 2 j+ 2

and pj(x − 1 ) ≤ u¯j ≤ pj(x 1 ). Therefore, (2.4) implies u − 1 ≤ pj(x − 1 ) ≤ u¯j ≤ pj(x 1 ) ≤ j 2 j+ 2 j 2 j 2 j+ 2 u 1 . We then have j+ 2 e e e e

x 1 j+ 2 0 V ar(pj) = |p (x)| dx + |pj(x − 1 ) − u − 1 | + |pj(x 1 ) − u 1 | j j 2 j 2 j+ 2 j+ 2 x − 1 Z j 2 = (pj(x 1 ) − pj(x − 1 )) + (pj(x − 1 ) − u − 1 ) + (u 1 − pj(x 1 )) e j+ 2e j 2 e j 2 j e2 j+ 2 j+ 2

= u 1 − u − 1 ej+ 2 j 2 e e e

= T V (u)j.

This contradicts V ar(pj) > T V (u)j, therefore we have θj ∈ [0, 1]. Second, we should verify the TVD property (2.3). For convenience, we denote rθj (x) by e j rj(x) here. By the definition of the θj,

|rj(x − 1 ) − u¯j| = θj|pj(x − 1 ) − u¯j| ≤ |u − 1 − u¯j|, j 2 j 2 j 2

|rj(x 1 ) − u¯j| = θj|pj(x 1 ) − u¯j| ≤ |u 1 − u¯j|. (2.6) j+ 2 e j+ 2 j+ 2

e Since u(x) and rj(x) are both monotonically increasing in Ij, we have (2.5) and rj(x − 1 ) ≤ j 2 u¯j ≤ rj(x 1 ), therefore (2.6) implies u − 1 ≤ rj(x − 1 ) ≤ u¯j ≤ rj(x 1 ) ≤ u 1 . We thus j+ 2 j 2 j 2 j+ 2 j+ 2

9 have

x 1 j+ 2 0 V ar(rj) = |r (x)| dx + |rj(x − 1 ) − u − 1 | + |rj(x 1 ) − u 1 | j j 2 j 2 j+ 2 j+ 2 x − 1 Z j 2 = (rj(x 1 ) − rj(x − 1 )) + (rj(x − 1 ) − u − 1 ) + (u 1 − rj(x 1 )) j+ 2 j 2 j 2 j 2 j+ 2 j+ 2

= u 1 − u − 1 j+ 2 j 2

= T V (u)j.

Notice that this scaling does not change the cell average. Of course, we would need to show that, with the θj taken in Lemma 2.2, this scaling does not destroy accuracy. We would need the following result for polynomials:

Lemma 2.3. If a polynomial p(x) of degree k (k ≤ 4) is monotone over an interval I = [a, b], and its cell average over I is p¯, then

p(x) − p¯ p(x) − p¯ max ≤ C, max ≤ C, x∈I p(b) − p¯ x∈I p(a) − p¯

where C is a constant depending only on the degree of the polynomial k.

The proof is elementary but lengthy, and is therefore deferred to the Appendix. A similar (and more general) result for quadratic polynomials can be found in the appendix of [5].

Using Lemma 2.3 we can prove the accuracy property:

θj Lemma 2.4. For the θj chosen in Lemma 2.2, the accuracy property (2.1) holds for rj (x).

θj 5 Proof: It suffices to show that rj (x) − pj(x) = O(∆x ). Without loss of generality, we assume e u − 1 − u¯j j 2 θj = . pj(xj− 1 ) − u¯j 2

In this case, since both u(x) and pj(x) are monotonically increasing, we actually have θj = e e

10 u − 1 −u¯j j 2 e . Then, pj (x − 1 )−u¯j j 2

θj rj (x) − pj(x) = θj(pj(x) − uj) + u¯j − pj(x)

e = (θj e− 1)(pj(x) − uj) e u − 1 − u¯j j 2 = e − 1 (pj(x) − uj) pj(x − 1 ) − u¯j j 2 !

u − 1 − pj(x − 1 ) j 2 j 2 e = e (pj(x) − uj) pj(x − 1 ) − u¯j j 2 e pj(x) − uj = (u −e1 − pj(x − 1 )) j 2 j 2 pje(x − 1 ) − u¯j j 2 e 5 = O(∆x ) e e where in the last equality we have used Lemma 2.3.

Case III. pj(x) is not monotone in Ij and u(x) has one extremum inside the interval Ij.

max Without loss of generality, we assume u(x) attains its maximum at x ∈ Ij, and we denote umax = u(xmax).

l r To deal with this case, we propose to break the polynomial pj(x) into two parts, pj and pj .

l r l max r max Let u and u be the cell averages of u on I = [x − 1 , x ] and I = [x , x 1 ] respectively, j j j j 2 j j+ 2 l r l r similarly let pj and pj be the cell averages of pj(x) on Ij and Ij respectively. Define

l l r r pj(x) = pj(x), ∀x ∈ Ij, pj (x) = pj(x), ∀x ∈ Ij ,

l l r r u (x) = u(x), ∀x ∈ Ij, u (x) = u(x), ∀x ∈ Ij , then, after an adjustment of the cell averages over the two sub-cells, in each of the two

l r intervals Ij and Ij , the situation reduces to either Case I or Case II. Here, we will only

l r briefly discuss pj, since the procedure for pj is the same. Without loss of generality, we assume ul(x) is monotonically increasing.

l 1. If pj is monotone (Case I), then define

l l l l l θj l l l pj(x) = pj(x) − pj + uj, (rj) (x) = θj(pj(x) − uj) + uj,

e 11 e where u − 1 − u¯j max j 2 u − u¯j θj = min , max , 1 . ( pj(xj− 1 ) − u¯j pj(x ) − u¯j ) 2

l l l 2. If pj is not monotone (Case II), elet α be the minim e um of pj over Ij, then α < 0. Define

max xj− 1 + x pl (x) = pl (x) − pl + ul − α x − 2 , j j j j 2  

e l θj l l l (rj) (x) = θj(pj(x) − uj) + uj,

where e u − 1 − u¯j max j 2 u − u¯j θj = min , max , 1 . ( pj(xj− 1 ) − u¯j pj(x ) − u¯j ) 2

e e r r l l r r We define rj (x) on Ij in a similarly way, and use rj(x) = rj(x)χ(Ij) + rj (x)χ(Ij ) as our

TVD approximation of u(x) on Ij. By the same arguments as in Cases I and II, we can show the accuracy, TVD and agreement of cell averages for rj(x).

Finally, we consider the case that the smooth function u(x) has infinitely many extrema. This would involve clusters (limit points) of extrema. We have the following lemma to describe the behavior of u(x) at such limit points.

(m) Lemma 2.5. If x0 is a limit point of extrema (maxima or minima) of u(x), then u (x0) = 0 for all m.

Proof: Since x0 is a limit point of extrema, there exists a sequence of extrema, {yj}, such

0 0 that lim yj = x0. Each yj is an extremum, hence u (yj) = 0, which implies u (x0) = 0. j→∞ 1 1 By the Rolle’s Theorem, there exists another sequence {yj : yj ≤ yj ≤ yj+1}, such that

00 1 1 00 u (yj ) = 0 for all j. Obviously, lim yj = x0, hence u (x0) = 0. Repeating this argument j→∞ proves the conclusion of the Lemma.

m By Lemma 2.5 and using a Taylor expansion, we conclude that u(x) = u(x0) + O(∆x ) for all x ∈ [x0 − ∆x, x0 + ∆x] and for all m, if x0 is a limit point. Therefore, in any cell

containing such a limit point x0, we can simply use the constant u(x0) to achieve accuracy

12 and the TVD property. When all such cells are excluded, there are only finitely many isolated extrema of u(x) left, hence we are back to the previously discussed case.

3 A TVD finite volume scheme

Combining the high order accurate TVD reconstruction described in the previous section with the method of characteristics, we obtain a high order accurate TVD Godunov-type finite volume scheme solving the one dimensional scalar conservation law (1.1).

3.1 Time evolution

To implement the approximation of the previous section, several pieces of information must be available for each cell. Specifically, the cell averages and the left and right cell boundary point values of the function being approximated must be known. To obtain this information, we follow Sanders [12] and use a staggered spatial mesh with the method of characteristics.

We only need to discuss the evolution procedure for one time step.

Let T (u0)(x, t), t ≥ 0, denote the solution to the scalar conservation law (1.1) and

R(u0)(x) denote the piecewise polynomial TVD reconstruction to u0(x) in the previous sec- tion. As in the previous section, we partition the real line into nonoverlapping intervals

Ij = [x − 1 , x 1 ], and approximate u0 ∈ BV by the piecewise polynomial TVD reconstruc- j 2 j+ 2 tion

0 u (x) = R(u0)(x) = rj(x)χj(x), j X where rj(x) is either a polynomial or a (possibly discontinuous) two-piece polynomials

l l r r rj(x) = r (x)χ(I ) + r (x)χ(I ). Consider a staggered partition I − 1 = [xj−1, xj]. The j j j j j 2 0 ∆t objective of the evolution is to determine the necessary information of T (u )(x, 2 ) such ∆t that a TVD piecewise polynomial reconstruction at time t = 2 can be obtained. We assume that u0 is given by

0 u (x) = R¯(u0)(x),

13 t

x

j 1

tn+ 2

tn x − 1 yj x 1 j 2 j+ 2

x n ∆t Figure 3.1: The backward characteristic line from (xj, t + 2 ). where R¯ denotes a “preconditioned” version of reconstruction R. By this we mean specifically that R(u0) is modified (in a way we will discuss later) so that for all j,

d max u0(x) f 00(u0(x)) ∆t < 2. (3.1) Ij dx

Essentially, to enforce (3.1) is to push extremely large gradients of rj(x) out of the interval Ij and into the jump discontinuities at cell interfaces, see [12]. An additional condition that we

assume throughout is the Courant condition; that is, for all u in the range of u0 we assume the ratio λ = ∆t/∆x is taken so that

|f 0(u)|λ < 1. (3.2)

If we can find the backward characteristic line from each point xj at time t = ∆t/2 back

to the time level t = 0 with its foot located at yj ∈ Ij (see Figure 3.1) such that the exact

0 entropy solution is constant uj = u (yj) along the line, then we have already obtained the cell

0 ∆t endpoint values of T (u )(x, ) on the staggered cell I − 1 , and we can apply the 2 j 2

theorem to (1.1) over the trapezoid defined by the points (xj−1, ∆t/2), (xj, ∆t/2), (yj−1, 0)

14 0 ∆t and (yj, 0) to obtain the the cell average of T (u )(x, ) on I − 1 as 2 j 2

1 yj 2 1 0 ∆t ∆t u¯ − 1 = u (x)dx − f(uj) + (xj − yj)uj + f(uj−1) − (xj−1 − yj−1)uj−1 . j 2 ∆x 2 2 "Zyj−1 # (3.3) Therefore, we may now focus on how to obtain the backward characteristic line. With (3.1) and (3.2) we have:

0 Lemma 3.1. If the approximation function u is continuous on Ij, that is, rj(x) is a polynomial, then the backward characteristic equation

x − x f 0(u0(x)) = j , x ∈ I (3.4) ∆t/2 j has a unique solution yj ∈ Ij.

Proof: Consider finding the root of the function

0 0 H(s) = f (u (s))∆t + 2(s − xj). (3.5)

According to (3.2), we have that

+ 0 0 + H(x − 1 ) = f (u (x − 1 ))∆t − ∆x < 0, (3.6) j 2 j 2

− 0 0 − H(x 1 ) = f (u (x 1 ))∆t + ∆x > 0. (3.7) j+ 2 j+ 2

Moreover, (3.1) implies that for every s ∈ Ij,

d d H(s) = f 00(u0(s))∆t r (s) + 2 > 0. (3.8) ds ds j

Therefore, H(s) has a unique root yj ∈ Ij = (x − 1 , x 1 ). j 2 j+ 2

l l r r l r Lemma 3.2. If rj(x) = rj(x)χ(Ij) + rj (x)χ(Ij ) where rj(x) and rj (x) are two polyno-

l 0 r 0 mials defined on I = [x − 1 , x ] and I = [x , x 1 ] respectively, we can get either one or j j 2 j j j j+ 2 1 three possible candidates for the backward characteristic line from (xj, t 2 ) by solving the characteristic equation (3.4).

15 H(s)

xj− 1 0 xj+ 1

2 xj 2

s1 s2 s

Figure 3.2: A sketch of H(s) in Case 3.

Proof: Again, consider finding the root of the function (3.5). We still have (3.6) and

0 0 (3.7). Moreover, (3.8) holds for each piece of s ∈ (x − 1 , x ) and s ∈ (x , x 1 ), respectively. j 2 j j j+ 2 0 Therefore, H(s) is continuous on Ij except at xj and H(s) is monotonically increasing both

0 on the left side and on the right side of xj . Thus, there are three cases depending on the

0 − 0 + signs of H((xj ) ) and H((xj ) ).

0 − 0 + 1. If H((xj ) ) H((xj ) ) > 0, there is exactly one root of H(s).

0 − 0 + 0 2. If H((xj ) ) ≤ 0, H((xj ) ) ≥ 0, the backward characteristic line is from (xj , 0) to

0 (xj, ∆t/2) and the speed of this characteristic is 2(xj − xj )/∆t. Precisely speaking

0 − 0 + there is no root of H(s) if H((xj ) ) < 0 and H((xj ) ) > 0, but this means a rarefaction

0 wave emanating from (xj , 0).

0 − 0 + l 3. If H((xj ) ) ≥ 0, H((xj ) ) ≤ 0, then there are two roots of H(s), one is in Ij and

r 0 the other one is in Ij . Moreover, the line segment from (xj , 0) to (xj, ∆t/2) is also a possible characteristic. See Figure 3.2.

16 From the previous lemma, we know that there is a unique backward characteristic line unless Case 3 happens. For Case 3, we can use the Lax formula to choose the correct characteristic line among the candidates, if the flux f(u) is convex, see, e.g. the procedure

used in [10]. However, if f(u) is nonconvex, it is very difficult to single out the correct characteristic line among these candidates. We will show in next section that any choice among these candidates will maintain the desired accuracy, therefore our main concern is the TVD property of the scheme. We will choose the candidate so that the cell average

obtained from (3.3) satisfies the maximum principle, i.e.

1 0 2 0 min u (x) ≤ u¯j− 1 ≤ max u (x). (3.9) [yj−1,yj ] 2 [yj−1,yj ] Once this maximum principle is satisfied, the conditions for the analysis in Section 2 will be fulfilled and we may have a TVD reconstruction.

Notice that a choice of the correct characteristics for both cell end points yj−1 and yj would 1 2 0 produce u¯ − 1 from (3.3) as the exact cell average of the entropy solution T (u )(x, ∆t/2) on j 2

I − 1 , therefore it would automatically satisfy the maximum principle (3.9). Thus, in Case j 2 3 when there are more than one candidate for the characteristic line, there is at least one 1 2 choice which would return a u¯ − 1 satisfying (3.9). If more than one candidate satisfies this j 2 criterion, we will simply choose one of them arbitrarily. In our implementation, if there are N intervals in which Case 3 happens, then we have 3N candidates of possible combination. 1 N 2 We check all the 3 candidates sequentially until we find one choice such that each u¯ − 1 j 2 from (3.3) satisfies (3.9), then we will stop the search and use this choice.

After finding the backward characteristics, we can obtain the cell averages and cell boundary point values of T (u0)(x, ∆t/2). With this information, we can apply the pro- cedure in the previous section to obtain a piecewise Hermite type reconstruction polynomial

p(x) = p − 1 (x)χ − 1 (x) on the staggered mesh I − 1 = [xj−1, xj]. To find a TVD approx- j j 2 j 2 j 2 imationPto T (u0)(x, ∆t/2), we still need to know the extrema of T (u0)(x, ∆t/2). In actual

0 implementation, we use the maximum/minimum value of u (x) on the interval [yj−1, yj] to replace the maximum/minimum value of T (u0)(x, ∆t/2), and the position of the ex-

17 tremum of T (u0)(x, ∆t/2) is determined by forward characteristic lines starting from the

0 max maximum/minimum point of u (x). For example, if xj is the point of the maximum value

0 0 of u (x) in [yj−1, yj] and the maximum value is umax, then the forward characteristic is the line

max max 0 0 through (xj , 0) and (xj + f (umax)∆t/2, ∆t/2), i.e., we trace the maximum/minimum values by the characteristics. The two cell averages of the left and right parts can be com- puted in the same way as in (3.3).

Remark 3.1. Since the entropy solution to (1.1) satisfies the maximum principle, the

0 maximum/minimum value of T (u )(x, ∆t/2) on the interval I − 1 is less/greater than or equal j 2 0 to the maximum/minimum value of u (x) on the interval [yj−1, yj], which could be easily computed because u0 is a piecewise polynomial of degree k ≤ 5 and there are algebraic analytical formulas for the extrema.

Remark 3.2. When dealing with a nonsmooth solution (e.g., when a shock emerges), it is possible that there are two consecutive broken polynomials. In this case, there are two

0 extrema of u (x) in [yj−1, yj], we simply pick either one of them as the extremum used in the TVD limiter.

3.2 Precondition

We propose the following procedure as the preconditioning process to ensure (3.1).

1. rj(x) is a polynomial. If rj(x) fails to satisfy (3.1), i.e., either

0 00 max rj(x)f (rj(x)) > 2/∆t, x∈Ij

or

0 00 min rj(x)f (rj(x)) < −2/∆t, x∈Ij then we use

rˆj(x) = µ(rj(x) − u¯j) + u¯j

18 to replace rj(x), where u¯j is the cell average and 2 2 µ = min 00 0 , 00 0 . ∆t max ∈ f (r (x)) max ∈ r (x) ∆t min ∈ f (r (x)) min ∈ r (x)  x Ij j x Ij j x Ij j x Ij j 

l l r r l r 2. rj(x) = rj( x)χ(Ij) + rj (x)χ(Ij ). We only discuss rj(x), the process for rj (x) is similar.

l If rj(x) fails to satisfy (3.1), i.e., either l drj(x) 00 max f (rj(x)) > 2/∆t, ∈ l x Ij dx or l drj(x) 00 min f (rj(x)) < −2/∆t, ∈ l x Ij dx then we use

l l l l rˆj(x) = µ(rj(x) − u¯j) + u¯j

l l l to replace rj(x), where u¯j is the cell average on Ij and

2 2 µ = min l , l .  00 l drj (x) 00 l drj (x)  ∆t maxx∈Ij f (r (x)) maxx∈Il ∆t minx∈Il f (r (x)) minx∈Ij  j j dx j j dx 

3.3 Algorithm flowchart 

We can now formulate the algorithm flowchart for the TVD finite volume scheme. From now on we restrict ourself to the fifth order case for easy presentation, although the procedure

and results are valid for all orders up to six.

1. Start with the preconditioned version of piecewise polynomial of degree four un(x) =

j rj(x)χj(x) at time level n. P 2. For each xj, find the foot yj of the backward characteristic line by finding the root yj

of the characteristic equation (3.4) in Ij. If there are three candidates for yj, then pick 1 n+ 2 one which returns a maximum principle satisfying u − 1 in formula (3.3). j 2

n ∆t n n ∆t 3. Evaluate T (u )(xj, ) = u (yj) and the average of T (u )(x, ) on I − 1 by formula 2 2 j 2

(3.3). Construct the Hermite type reconstruction polynomials p − 1 (x) on the staggered j 2

interval I − 1 = [xj−1, xj]. j 2

19 xj 0 1 1 1 1 4. Evaluate V ar(pj− ) = − |p − (x)| dx + |pj− (xj−1) − uj−1| + |pj− (xj) − uj| and 2 xj 1 j 2 2 2 n n yj n 0 the standard variation ofR u (x) on [y − , y ], T V (u ) − = |(u ) (x)| dx. If j 1 j [yj 1,yj ] yj−1

1 n 1 1 V ar(p − ) > T V (u )[y −1,y ], apply the TVD limiter to p − (x) onR I − . j 2 j j j 2 j 2

n ∆t 5. Apply the preconditioning process. This finishes the evolution to t + 2 on the stag-

gered mesh I − 1 . j 2

n 6. Evolve to t + ∆t in an analogous way back to the mesh Ij.

4 Properties of the scheme

4.1 Conservative form

Since we use (3.3) to obtain the cell average, and noticing that the limiter and preconditioning process do not change the cell averages, we can rewrite our scheme in a conservative form

for the cell averages on I − 1 j 2

1 yj n+ 2 1 n ∆t ∆t u¯ − 1 = u (x)dx − f(uj) + (xj − yj)uj + f(uj−1) − (xj−1 − yj−1)uj−1 j 2 ∆x 2 2 "Zyj−1 # n 1 ∆t ˆ ˆ = u¯ − 1 − (fj − fj−1), j 2 2 ∆x where the numerical flux is 2 xj 2(x − y ) fˆ = un(x)dx + f(u ) − j j u j ∆t j ∆t j Zyj   n n and u¯ − 1 denotes the average of u (x) on Ij− 1 . See Figure 4.1. j 2 2 n First, fˆj only depends on u (x) over the interval Ij. Second, fˆj is consistent in the sense

n that fˆj = f(u¯) if u (x) is a constant u¯. Thus, our scheme is conservative.

4.2 Total-variation diminishing

As long as the cell averages satisfy the maximum principle (3.9), Lemma 2.2 in the TVD reconstruction section will hold, which ensures the TVD property, and the preconditioning process is total-variation diminishing. Therefore, our scheme is TVD, i.e.,

1 1 T V (un+ 2 (x)) ≤ V ar(un+ 2 (x)) ≤ T V (un(x)).

20 t

x − x

j 1 j 1 tn+ 2

x − 3 x − 1 x 1

j 2 j 2 j+ 2 n t yj−1 yj

x Figure 4.1: The trapezoid region in the x-t plane.

4.3 Fifth order accuracy

0 Assume the initial data u0(x) is a smooth function on a finite domain and u (x) is the TVD piecewise polynomial approximating u0(x). We will prove that the local truncation error is O(∆x5). It suffices to show that

1 0 5 u 2 (x) − T (u )(x, ∆t/2) = O(∆x ).

First of all, the preconditioning process does not change u0(x) at all if ∆t is small enough.

d d 0 Since u0(x) is smooth, dx u0(x) is bounded. Thus dx u (x) is also bounded because d d u0(x) − u (x) = O(∆x4). dx dx 0

If we assume f 00(u0(x)) is also bounded, then (3.1) will be automatically satisfied for u0(x) if the mesh is fine enough.

1 Second, u 2 (x) will be a fifth order accurate approximation to T (u0)(x, ∆t/2) if all the characteristic lines used in the scheme are fifth order accurate. The forward characteristic to

21 trace the maximum/minimum is obviously fifth order accurate. Except for Case 3 in Lemma 3.2, the backward characteristic lines are all exact. Therefore, we only need to check the accuracy of the backward characteristic line that we choose in Case 3.

00 0 Lemma 4.1. Assume f (x) and u0(x) are both bounded, then all the three candidates of the backward characteristic lines in Case 3 are fifth order accurate if the mesh is fine enough.

Proof: Assume the three possible locations of the foot of backward characteristics are s0,

0 s1 and s2 as shown in Figure 3.2 (in which s0 is denoted as xj ). It suffices to show that

5 s1 − s2 = O(∆x ) if ∆x and ∆t are sufficiently small.

0 0 0 Define G(x) = f (u0(x))∆t + 2(x − xj) and H(x) = f (u (x))∆t + 2(x − xj). We have

0 0 0 00 0 5 G(x) − H(x) = f (u0(x))∆t − f (u (x))∆t = f (ζ)(u0(x) − u (x))∆t = O(∆x ),

therefore

− + − + 5 |H(s0 ) − H(s0 )| ≤ |H(s0 ) − G(s0)| + |G(s0) − H(s0 )| = O(∆x ),

− + − 5 hence H(s0 ) H(s0 ) < 0 implies |H(s0 )| = O(∆x ). Notice that

0 00 0 G (x) = f (u0(x))u0(x)∆t + 2,

0 3 00 0 hence we have G (x) ≥ for all x ∈ [x − 1 , x 1 ] if ∆t is small enough, since f (x) and u (x) 2 j 2 j+ 2 0 are bounded. Now G0(x) − H0(x) = O(∆x4) implies that if ∆x is small, H0(x) ≥ 1 for all x ∈ [x − 1 , x 1 ]. Therefore j 2 j+ 2 − H(s0 ) − H(s1) 0 = H (ξ) ≥ 1, for some ξ ∈ [s1, s0], s0 − s1

− − 5 5 which implies s0 − s1 ≤ H(s0 ) − H(s1) = H(s0 ) = O(∆x ). Similarly s0 − s2 = O(∆x ). Therefore, the accuracy is not destroyed even if the entropic characteristic line is not neces-

sarily chosen in Case 3.

5 Numerical Test

In this section we provide numerical examples to test our schemes.

22 5.1 Standard test cases

Example 1. We solve the model equation

ut + ux = 0, −1 ≤ x ≤ 1,

u(x, 0) = u0(x), with periodic boundary conditions.

1 Three initial data u0(x) are used. The first one is u0(x) = sin(πx), and we list the L and

∞ 4 L errors for the cell averages at time t = 5 in Table 5.1. The second one is u0(x) = sin (πx), and we list the errors at time t = 5 in Table 5.2. Here and below, the mesh size ∆x = 2/N. We can clearly see that the designed fifth order accuracy is achieved in both cases, at least for the L1 error.

Table 5.1: u0(x) = sin(πx), t = 5, ∆t/∆x = 0.95. N L1 error order L∞ error order 20 1.08E-6 – 2.18E-6 – 40 3.34E-8 5.01 6.93E-8 4.97 80 1.02E-9 5.03 2.17E-9 5.00 160 3.14E-11 5.02 6.69E-11 5.02

4 Table 5.2: u0(x) = sin (πx), t = 5, ∆t/∆x = 0.95. N L1 error order L∞ error order 20 6.25E-4 – 1.22E-3 – 40 2.72E-5 4.52 7.58E-5 4.01 80 8.46E-7 5.00 3.15E-6 4.59 160 2.65E-8 4.99 1.20E-7 5.13 320 8.57E-10 4.95 4.08E-9 4.47

The third initial function is 1, −1 ≤ x ≤ 0 u (x) = . 0 −1, 0 ≤ x ≤ 1  The results at t = 100 are shown in Figure 5.1. We can see that numerical solution maintains a strict maximum principle and has relatively good resolution for the discontinuity for a coarse mesh after a very long time simulation (50 time periods).

23 1

0.5 ) x

( 0 u

-0.5

-1

-1 -0.5 0 0.5 1 x

Figure 5.1: N = 40, t = 100. Solid line: exact solution; Squares: numerical solution (cell averages).

Example 2. We solve the Burgers equation with periodic boundary conditions

u2 u + = 0, −1 ≤ x ≤ 1, t 2  x u(x, 0) = u0(x).

2 For the initial data u0(x) = 0.25 + 0.5 sin(πx), the exact solution is smooth up to t = π , then it develops a moving shock which interacts with a rarefaction wave. At t = 0.15 the solution is still smooth. We list the errors in Table 5.3. We can clearly see

1 2 the designed fifth order accuracy is achieved in the L norm. At t = π the shock just begins to form; at t = 2.0 the interaction between the shock and the rarefaction waves is over, and

the solution becomes monotone between the shocks. In Figure 5.2 we can see that the shock is captured very well. The errors 0.05 away from the shock (i.e., |x− shock location| ≥ 0.05) are listed in Table 5.4 at t = 2.0. We can again see that the designed order of accuracy is achieved or surpassed.

Example 3. Note that we have only proved TVD for our schemes, not entropy conditions. We use nonconvex fluxes to test the convergence to the physically correct entropy solutions.

24 Table 5.3: u0(x) = 0.25 + 0.5 sin(πx), t = 0.15, ∆t/∆x = 1.2. N L1 error order L∞ error order 20 1.32E-6 – 6.73E-6 – 40 3.26E-8 5.34 1.47E-7 5.51 80 6.41E-10 5.66 4.25E-9 5.12 160 2.30E-11 4.80 2.38E-10 4.16 320 7.63E-13 4.91 1.59E-11 3.90 640 2.46E-14 4.95 1.02E-12 3.95

0.7

0.6 0.6 0.5

0.4 0.4 ) ) 0.3 x x ( ( 0.2 0.2 u u

0.1

0 0

-0.1 -0.2 -0.2 -0.5 0 0.5 -0.5 0 0.5 x x

Figure 5.2: N = 80, ∆t/∆x = 1.2. Solid line: exact solution; Symbols: numerical solution (cell averages). Left: t = 0.6366; Right: t = 2.

Table 5.4: u0(x) = 0.25 + 0.5 sin(πx), t = 2, ∆t/∆x = 1.2. N L1 error order L∞ error order 20 2.19E-3 – 4.09E-2 – 40 3.30E-5 6.05 7.34E-4 5.80 80 2.68E-6 6.95 1.79E-5 5.36 160 8.23E-10 8.34 9.24E-8 9.24 320 2.70E-13 11.57 9.30E-12 13.27

25 The “exact” solutions are obtained from the first order Lax-Friedrichs scheme on a very fine mesh. The first flux is the Buckley-Leverett flux

4u2 f(u) = , 4u2 + (1 − u)2

1 with the initial data u = 1 in [− 2 , 0] and u = 0 elsewhere. The computational result is displayed in Figure 5.3, which is quite satisfactory.

1

0.8

0.6 ) x (

u 0.4

0.2

0 -1 -0.5 0 0.5 1 x

Figure 5.3: N = 160, t = 0.4, ∆t/∆x = 0.3. Solid line: exact solution; Symbols: numerical solution (cell averages).

The second flux is an example used in [11], defined by 1, if u < 1.6 cos(5π(u − 1.8)) + 2.0, if 1.6 ≤ u < 2.0 f(u) =  − cos(5π(u − 2.2)), if 2.0 ≤ u < 2.4   1, if u ≥ 2.4  with two initial conditions. The first initial condition is 1, for x < 0 u (x) = 0 3, for x ≥ 0  and it is shown in [11] that the numerical solutions of many high order schemes would stay stationary which is entropy-violating. Our result is shown in Figure 5.4 which approximates

26 the exact entropy solution very well. The other initial data that we test is

3, for − 1 ≤ x < 0 u (x) = 0 1, for 0 ≤ x ≤ 1  with a periodic boundary condition. It is shown in [11] that convergence towards the entropy solution for this test case is very slow for many schemes. Our results are shown in Figure 5.5. There is clearly convergence with refined meshes, and the rate of convergence is faster than that of the first order schemes shown in [11].

3

2.5 )

x 2 ( u

1.5

1 -10 -5 0 5 10 x

Figure 5.4: N = 400, t = 2, ∆t/∆x = 0.04. Solid line: exact solution; Symbols: numerical solution (cell averages).

5.2 Test cases from traffic flow models

In the subsection, we test our fifth order TVD scheme on two traffic flow problems. To describe the dynamic characteristics of traffic on a homogeneous and unidirectional highway, the Lighthill-Whitham-Richards (LWR) model is widely used. The governing equation for the LWR model is a scalar conservation law

ρt + q(ρ)x = 0

27 2.01

2.005 )

x 2 ( u

1.995

1.99

-0.5 0 0.5 1 x

Figure 5.5: t = 2, ∆t/∆x = 0.04. The curves, from right to left, are corresponding to N = 800, N = 1600, N = 3200 and the “exact” solution, respectively.

with suitable initial and boundary conditions. Here ρ ∈ (0, ρmax) is the density, ρmax is the maximum (jam) density, and q(ρ) is the traffic flow on a homogeneous highway, which is assumed to be a function of the density only in the LWR model. The flow q, the density ρ and the equilibrium speed u are related by

q(ρ) = u(ρ)ρ.

Example 4. The first traffic flow test example is taken from [7]. The flow-density function is given by a concave function

−0.4ρ2 + 100ρ, 0 ≤ ρ ≤ 50 q(ρ) = −0.1ρ2 + 15ρ + 3500, 50 ≤ ρ ≤ 100 .  2  −0.024ρ − 5.2ρ + 4760, 100 ≤ ρ ≤ 350 Consider a long homogeneous freeway of length 20 km. The entrance density is 50 veh/km. Due to an incident near the downstream end of the freeway, the piecewise linear traffic

density profile shown in Fig 5.6 is formed. To release the traffic jam condition downstream, the freeway entrance is blocked for 10 min, after which traffic is released again from the entrance at the capacity density 75 veh/km. After 20 min, the entrance flow returns back

28 to normal with a density 50 veh/h. At the exit boundary, a traffic signal is installed, with a repeated pattern of 2 min green light (zero density) followed by 1 min red light (jam density). The numerical solutions are shown in Figures 5.7, 5.8 and 5.9, in which the solid lines are

the exact solution and the symbols are the numerical solution obtained by our fifth order TVD scheme using N = 800 cells. We can observe that our TVD scheme produces very good approximations to the exact solution for this test case.

350

300

250 ) m k /

h 200 e v ( y t i 150 s n e D 100

50

5 10 15 Distance (km)

Figure 5.6: The initial density for first traffic flow Example 4.

Example 5. We consider a similar problem but with a much more complicated flow-density function in [3]. The flow function q(ρ) = ρVe(ρ) is given by

˜ 2 2 V 4V0 Ve(ρ) = −1 + 1 + 2V0  s V˜ 2    with 1 1 1 α(ρ ) V˜ (ρ) = − max T ρ ρ α(ρ) r  max  s

29 350

300

250

y 200 t i s n e

D 150

100

50

0 0 5 10 15 20 Distance

Figure 5.7: Traffic flow Example 4: t = 30 min, N = 800. Solid line: exact solution; Circles: numerical solution (cell averages).

30 350

300

250

y 200 t i s n e

D 150

100

50

0 0 5 10 15 20 Distance

Figure 5.8: Traffic flow Example 4: t = 60 min, N = 800. Solid line: exact solution; Circles: numerical solution (cell averages).

31 350

300

250

y 200 t i s n e

D 150

100

50

0 0 5 10 15 20 Distance

Figure 5.9: Traffic flow Example 4: t = 90 min, N = 800. Solid line: exact solution; Circles: numerical solution (cell averages).

32 and ρ − ρ α(ρ) = α + ∆α tanh ( c ) + 1 . 0 ∆ρ   Here V0, Tr, ρmax, α0, ∆α, ρc and ∆ρ are all constant parameters to be determined by fitting them to the empirical data. The physical meaning of these parameters can be found in [3].

We simply choose some typical values mentioned in [3]: V0 = 110 km/h, Tr = 1.8 seconds,

ρmax = 160 vehicles/km, α0 = 0.008, ∆α = 0.02, ρc = 0.27ρmax and ∆ρ = 0.1ρmax. With all these parameters, the flow-density function q(ρ) is well-defined, the graphs of this function and its second derivative are plotted in Figure 5.10. It is clearly neither a globally concave nor a globally convex function.

15 2000 10

5 1500 ) h /

h 0 e v (

1w 000 -5 o l F -10

500 -15

-20 0 0 50 100 150 0 50 100 150 Density (veh/km)

Figure 5.10: Left: the graph of q(ρ); Right: the graph of q00(ρ).

Consider a long homogeneous freeway of length 20 km. The entrance density is constant

135 π 145 30 veh/km. The initial condition is given as a sine function ρ0(x) = 2 sin ( 10 x) + 2 . At the exit boundary, a traffic signal is installed, with a repeated pattern of 1 min green light (ρ = 10 veh/km) followed by 2 min red light (ρ = 140 veh/km). The numerical solutions are shown in Figure 5.11, with a magnified graph for the boxed region shown in Figure 5.12,

where the solid line is the reference solution obtained by the first order Lax-Friedrichs scheme on a very fine grid (N = 4000000) and the circles are the numerical solution with N = 1600

33 cells at t = 18 min. We again observe very good resolution of our scheme for this nonconvex traffic flow model.

160

140

120

100 y t i s

n 80 e D 60

40

20

0 0 5 10 15 20 Distance

Figure 5.11: Traffic flow Example 5: t = 18 min, N = 1600. The region inside the rectangle on the right is magnified in Figure 5.12.

Remark 5.1. The advantage of our scheme is that it is high order accurate and satisfies strictly a maximum principle, therefore it has better resolution than the usual TVD schemes when the solution contains many waves, and it does not generate any unphysical solution such as negative density. From the two examples above, we can see that all the waves (shocks

34 160

140

120

100 y t i s

n 80 e D 60

40

20

0 17 18 19 20 Distance

Figure 5.12: Magnified graph of the region inside the rectangle in Figure 5.11.

35 and rarefactions) are well captured.

Remark 5.2. The boundary conditions in these two examples are all piecewise constants in time. Hence we simply use constant values on ghost cells as the numerical boundary condition for our scheme.

5.3 A simplified scheme

In this subsection we discussed a simplified version of our finite volume scheme. We use the same method for time evolution, and a similar but simpler limiter which only enforces strict maximum principle but not TVD, without breaking a polynomial into two pieces on any interval. The algorithm satisfies all the theoretical properties of the previous scheme

except for a rigorous proof of TVD. This maximum-principle-satisfying finite volume scheme is described below.

1. Start with the preconditioned version of piecewise polynomial of degree four un(x) =

j rj(x)χj(x) at time level n. P 2. For each xj, find the unique root yj of the characteristic equation (3.4) in Ij. The uniqueness of the root is ensured by Lemma 3.1.

1 n ∆t n n+ 2 n ∆t 3. Evaluate T (u )(xj, ) = u (yj) and the average u¯ − 1 of T (u )(x, ) on Ij− 1 by the 2 j 2 2 2

formula (3.3). Construct the Hermite type interpolation polynomials p − 1 (x) on the j 2

staggered interval I − 1 = [xj−1, xj]. j 2

4. For each interval I − 1 , evaluate the maximum Mj and the minimum mj of p − 1 (x) on j 2 j 2 n I − 1 , and the maximum M˜j and the minimum m˜ j of u (x) on [yj−1, yj]. Apply the j 2 following scaling 1 1 n+ 2 n+ 2 rj− 1 (x) = θ(pj− 1 (x) − u¯ − 1 ) + u¯ − 1 2 2 j 2 j 2

36 where θ is determined by

1 1 ˜ n+ 2 n+ 2 Mj − u¯ − 1 m˜ j − u¯ − 1 j 2 j 2 θ = min 1 , 1 , 1 .  n+ 2 n+ 2  Mj − u¯ − 1 mj − u¯ − 1   j 2 j 2      n ∆t 5. Apply the preconditioning process. This finishes the evolution to t + 2 on the stag-

gered mesh I − 1 . j 2

n 6. Evolve to t + ∆t in an analogous way back to the mesh Ij.

Remark 5.3. We can easily prove that this scheme is conservative and fifth order accurate. Obviously it satisfies the maximum principle. Therefore we will refer to it as the maximum- principle-satisfying scheme.

Remark 5.4. The maximum-principle-satisfying scheme is much easier to code than the

TVD scheme. Although we cannot rigorously prove TVD or TVB of the numerical solution, we have not observed any significant difference between this scheme and the TVD scheme tested before, for all the test cases reported in this paper. We will not show these results here to save space.

A Concluding remarks

In this paper we have extended the work in [12] and have constructed a class of genuinely high order accurate finite volume TVD schemes for solving one dimensional scalar conservation

laws. These schemes do not degenerate to lower order accuracy at smooth extrema, yet they satisfy a strict maximum principle and they can be proved to be TVD, when the total variation is measured by the bounded variation semi-norm of the reconstructed piecewise polynomials. The key ingredient of the algorithm is the TVD reconstruction, which can be

efficiently implemented for order of accuracy up to six.

37 We have tested the fifth order scheme on a variety of examples including those from traffic flow models and those with non-convex fluxes. The solutions are high order accurate and provide good resolution to shocks and rarefaction waves.

A simplified scheme is also described, which enforces a strict maximum principle but is not rigorously TVD, however it is much simpler to implement than the TVD scheme. Numerical experiments indicate that this simplified scheme perform as nicely in all the test cases as the TVD scheme.

The advantage of the schemes constructed in this paper, compared with traditional TVD schemes, is that they do not degenerate to first order at smooth extrema, hence they give very good resolutions to solutions with complicated smooth waves. On the other hand, the advantage of the schemes constructed in this paper, compared with ENO and WENO

schemes, is that they satisfy strictly the maximum principle, hence they will not generate non- physical solutions such as negative density for the traffic flows. This property is important in some applications. In order to generalize of this scheme to two dimensions, we should abandon the require-

ment of TVD and insist only on the strict maximum principle, that is, along the approach of the simplified scheme in Section 5.3. It is also possible to formally generalize the scheme to hyperbolic systems, see [13] for one possible approach. However, it would be probably more appropriate, for the system case, to enforce certain positivity preserving properties,

such as positivity preserving for density and pressure for Euler equations of compressible gas dynamics, see [9] for one possible approach. Both of these generalizations constitute ongoing research.

References

[1] A. Harten, High resolution schemes for hyperbolic conservation laws, Journal of Com- putational Physics, 49 (1983), pp.357-393.

38 [2] A. Harten, B. Engquist, S. Osher and S. Chakravarthy, Uniformly high order essentially non-oscillatory schemes, III, Journal of Computational Physics, 71 (1987), 231-303.

[3] D. Helbing, A. Hennecke, V. Shvetsov and M. Treiber, MASTER: macroscopic traffic

simulation based on a gas-kinetic, non-local traffic model, Transportation Research Part B, 35 (2001), pp.183-211.

[4] G.-S. Jiang and C.-W. Shu, Efficient implementation of weighted ENO schemes, Journal of Computational Physics, 126 (1996), pp.202-228.

[5] X.-D. Liu and S. Osher, Non-oscillatory high order accurate self similar maximum principle satisfying shock capturing schemes, SIAM Journal on , 33 (1996), pp.760-779.

[6] X.-D. Liu, S. Osher and T. Chan, Weighted essentially non-oscillatory schemes, Journal

of Computational Physics, 115 (1994), 200-212.

[7] Y. Lu, S.C. Wong, M. Zhang, C.-W. Shu and W. Chen, Explicit construction of en- tropy solutions for the Lighthill-Whitham-Richards traffic flow model with a piecewise quadratic flow-density relationship, Transportation Research Part B, 42 (2008), pp.355-

372.

[8] S. Osher and S. Chakravarthy, High resolution schemes and the entropy condition, SIAM Journal on Numerical Analysis, 21 (1984), pp.955-984.

[9] B. Perthame and C.-W. Shu, On positivity preserving finite volume schemes for Euler equations, Numerische Mathematik, 73 (1996), pp.119-130.

[10] J.-M. Qiu and C.-W. Shu, Convergence of Godunov-type schemes for scalar conservation laws under large time steps, SIAM Journal on Numerical Analysis, 46 (2008), pp.2211-

2237.

39 [11] J.-M. Qiu and C.-W. Shu, Convergence of high order finite volume weighted essentially non-oscillatory scheme and discontinuous Galerkin method for nonconvex conservation laws, SIAM Journal on Scientific Computing, 31 (2008), pp.584-607.

[12] R. Sanders, A third-order accurate variation nonexpansive difference scheme for single nonlinear conservation law, Mathematics of Computation, 51 (1988), pp.535-558.

[13] R. Sanders, High resolution staggered mesh approach for nonlinear hyperbolic systems of conservation laws, Journal of Computational Physics, 101 (1992), pp.314-329.

[14] C.-W. Shu, TVB uniformly high-order schemes for conservation laws, Mathematics of Computation, 49 (1987), pp.105-121.

[15] C.-W. Shu and S. Osher, Efficient implementation of essentially non-oscillatory shock- capturing schemes, Journal of Computational Physics, 77 (1988), pp.439-471.

A Appendix

In this appendix we provide a proof of Lemma 2.3.

Lemma 2.3. If a polynomial p(x) of degree k (k ≤ 4) is monotone over an interval I = [a, b], and its cell average over I is p¯, then

p(x) − p¯ p(x) − p¯ max ≤ C, max ≤ C, (A.1) x∈I p(b) − p¯ x∈I p(a) − p¯

where C is a constant depending only on the degree of the p olynomial k. In particular, C(2) = 2, C(3) = 4 and C(4) = 7.

Proof: We only prove the k = 4 case. The proof for lower k is very similar (and simpler)

and is thus omitted.

1 1 0 We can assume the interval is I = [− 2 , 2 ] by considering the rescaled variable x = x−(a+b)/2 0 b−a , which leaves the ratios in (A.1) unchanged. We will still denote x by x and,

40 2 3 4 without loss of generality, we assume p(x) = a0 + a1x + a2x + a3x + a4x is increasing on

1 1 1 1 I = [− 2 , 2 ]. Notice that p(x) is monotone on I = [− 2 , 2 ], we only need to show that

1 1 p 2 − p¯ p − 2 − p¯ 1 ≤ 7, 1 ≤ 7. (A.2) p − − p¯ p − p¯ 2 2 

  We will only prove the first inequalit y in (A.2), the deriv ation for the second inequality being the same. We have

1 1 1 1 1 p − = a − a + a − a + a 2 0 2 1 4 2 8 3 16 4   1 1 1 1 1 p = a + a + a + a + a 2 0 2 1 4 2 8 3 16 4   1 1 p¯ = a + a + a 0 12 2 80 4

Thus,

1 1 p 2 − p¯ p( 2 ) − p¯ 1 = 1 p − − p¯ −p(− ) + p¯ 2 2 1 1 1 1  2 a1 + 6 a2 + 8 a3 + 20 a4 = 1 1 1 1 2 a1 − 6 a2 + 8 a3 − 20 a4 1 1 1 a1 + 3 a2 + 4 a3 + 10 a4 = 1 1 1 a1 − 3 a2 + 4 a3 − 10 a4 2 1 3 a2 + 5 a4 = 1 + 1 1 1 a1 − 3 a2 + 4 a3 − 10 a4 3 2 a2 + 10 a4 = 1 + 1 1 1 . 3 a1 − 3 a2 + 4 a3 − 10 a4

We now discuss this in several cases.

1 − 3 p( 2 ) p¯ Case 1. If a2 + 10 a4 = 0, then − 1 − = 1 < 7. p( 2 ) p¯

3 Case 2. If a2 + a4 < 0, then 10 1 p 2 − p¯ 2 1 1 = 1 + 1 . p − − p¯ 3 a1+ 4 a3 1 2 3 − a2+ 10 a4 3



41 Since p(x) is increasing, 1 1 1 1 1 a + a + a + a = p − p¯ ≥ 0, 2 1 6 2 8 3 20 4 2   1 1 1 1 =⇒ a + a + a + a ≥ 0, 2 1 8 3 6 2 20 4 1 1 1 3 =⇒ (a + a ) + (a + a ) ≥ 0, 2 1 4 3 6 2 10 4 1 a1 + 4 a3 1 =⇒ 3 ≤ − , a2 + 10 a4 3 1 p 2 − p¯ =⇒ 1 < 1. p − − p¯ 2

Case 3. If a + 3 a > 0, then  2 10 4 1 p 2 − p¯ 2 1 = 1 + 1 . 1 a1+ a3 p − − p¯ 3 4 1 2 3 − a2+ 10 a4 3

1 1  For any u, v ∈ [− 2 , 2 ], we hav e

0 2 3 p (u) = a1 + 2ua2 + 3u a3 + 4u a4 ≥ 0,

0 2 3 p (v) = a1 + 2va2 + 3v a3 + 4v a4 ≥ 0,

0 0 2 2 3 3 =⇒ p (u) + p (v) = 2a1 + 2(u + v)a2 + 3(u + v )a3 + 4(u + v )a4 ≥ 0, 3 =⇒ 2(a + (u2 + v2)a ) + 2(u + v)(a + 2(u2 + v2 − uv)a ) ≥ 0, (A.3) 1 2 3 2 4 1 1 We would like to find u, v ∈ [− 2 , 2 ] satisfying 3 (u2 + v2) = 1 2 4 . 2(u2 + v2 − uv) = 3  10 1 1 2 1 1 2 Solving this linear system, we obtain u = − 2 5 + 15 and v = − 2 5 − 15 , which 1 1 q q  q q  are apparently within [− 2 , 2 ]. Plugging these values into (A.3), we obtain 3 2 a + (u2 + v2)a + 2(u + v)(a + 2(u2 + v2 − uv)a ) ≥ 0, 1 2 3 2 4   1 1 3 =⇒ 2 a + a − 2 a + a ≥ 0, 1 4 3 5 2 10 4   r   1 a1 + a3 1 =⇒ 4 ≥ , a + 3 a 5 2 10 4 r 1 p 2 − p¯ 2 1 =⇒ 1 ≤ 1 + ≈ 6.85 < 7. 3 1 1 p − 2 − p¯ −  5 3

 q 42 Remark A.1. The result of this lemma should also hold for polynomials of higher degree.

43