we describe the method for the advection equation ... proximate (reconstruct) the solution by a parabola .... that the reconstruction parabolas are always mono-.
A PIECEWISE-PARABOLIC DUAL-MESH METHOD FOR THE EULER EQUATIONS
Downloaded by HT Huynh on March 1, 2013 | http://arc.aiaa.org | DOI: 10.2514/6.1995-1739
H. T. Huynh* NASA Lewis Research Center, MS 5-11 Cleveland, Ohio 44135
Abstract. A piecewise-parabolic dual-mesh method for the one-dimensional Euler equations is presented. The method carries the cell averages as well as the interface values of the conserved variables and, for this reason, has very small dissipation and dispersion errors. Oscillations in the solutions are avoided by devising monotonicity constraints that preserve accuracy near extrema. A steepening technique that can capture contact discontinuities in two cells is introduced. A dual- (staggered) mesh system, which facilitates the updating of both variables (averages and point values), is employed. The resulting method is a centered scheme and can be considered a third-order accurate extension of the Lax-Friedrichs met hod. 1. Advection equation. For simplicity, first we describe the method for the advection equation with constant speed a ,
(1. l a )
where uo(x) is the initial condition. By assuming that uo is of compact support or periodic, boundary conditions are straightforward, and are omitted. The presentation below facilitates the extensions t o systems of equations. At time t n , for j = 1 , 2 , . . ., 9 , let x, be the cell / ~ the interface between the j-th and center, x j + ~ be j 1-th cells, the mesh be uniform, and the cell width be denoted by h. Assume that we know u,
+
*''Copyright 01995 by the American Institute of Aeronautics and Astronautics, Inc. No copyright is asserted in the United States under Title 17, U.S. Code. The U.S. Government has a royalty-free Licence to exercise all rights under the copyright claimed herein for government purposes. All other rights are reserved by the copyright owner."
and ~ j + 1 / 2which respectively approximate the average value in the j-th cell and the interface point value at x j + ~ of / ~ the solution u, for all j. (Note that the superscript n is omitted when it does not cause confusion.) We wish t o calculate and
;:;t
u ~ + "which ~ respectively approximate the cell average and the interface point value of the solution at time tn+'I2 = tn +(1/2)At, where A t is assumed t o satisfy the CFL condition
Remark that we take only half the regular time step, and at time the mesh is staggered (Fig. 1). The algorithm proceeds as follows. Set
(In the next section where monotonicity constraints are introduced, u ~ , and j UR,, will be defined differently.) At time level n and in each cell j, we approximate (reconstruct) the solution by a parabola denoted by Pj using these three pieces of information: the cell average iij and the two point values u ~ , and j u ~ , j The . second and first derivatives and the point value at x j of u can be approximated by those of the parabola Pj,
Dzuj = U R , ~- UL,j uj
= iij - ~ ; u j / 2 4 ;
(1.4b) (1.4~)
here h is assumed to be 1. Using ( l . l a ) , we can calculate the time partial derivatives:
Since the half time step corresponds t o a CFL number less than 1/2, the discontinuities (in slope) a t ( ~ j - ~tn) / ~and , (xj+1/2, t n ) have not arrived at x, when t = tnf 'I2. As a result, we can calculate the point value by a Taylor series expansion in the j-th cell: with r = At/h, n + l P = uj
+ (Dtuj ) ( ~ / 2 )+ ( 1 / 2 ) ( ~ t u)j( ~ / 2 ) '-
(1.6) Note that due to (1.la) and (1.5), the above is identical t o the value obtained by characteristic tracing. Loosely put, upwind effect is built in. The quantity can be calculated by a similar expression. Denote the average flux between time tn and tnf 'I2 by f;:
Downloaded by HT Huynh on March 1, 2013 | http://arc.aiaa.org | DOI: 10.2514/6.1995-1739
~7"'~
Next, denote the average of u in the left half of the cell by GLH,~, and in the right, U R H , ~Then .
U ~ a =j iij
+ DZuj/4.
(1.8b)
The cell average iy;:," is updated b i balancing the fluxes for the control volume whose four corners are (xj, t n ) , (xj+1, tn), ( x j , tn+'I2), and (xj+1, tn+1/2) shown in Fig. 1, -n+1/2 j+1/2 = ~1 ( u R x+ULH,j+l),~ $(~t/h)(fi+l-5)-
21
(1.9) The next half time step is identical to the above except for obvious changes in indices due to the staggering of the mesh system. One then obtains {ii;+ l} and {u;,}, and this completes the basic algorithm. The following remarks are in order. Van Leer introduced the single-mesh version of the above scheme in (1977). For a single-mesh system, the scheme must be formulated as an upwind scheme, whereas the dual-mesh formulation results in a centered scheme. In the same paper, Van Leer presented a total of five upwind schemes for numerical convection. The single-mesh version of the above scheme was singled out as the best one by virtue of its simplicity and accuracy. For high frequency waves, the scheme has a much smaller dispersion error compared t o standard high-order schemes that only carry along the cell average quantities. The dissipative error is also small. To prevent oscillations near a discontinuity, he devised a monotonicity constraint which requires the reconstruction t o take values in the range spanned by the neighboring
quantities. (See also Colella and Woodward 1984.) The constraint, however, causes accuracy t o degenerate t o first order near extrema. Moreover, it is very difficult t o extend this upwind scheme t o the system of Euler Equations. (Updating the interface values is no easy task.) The above dual-mesh formulation is due to Sanders (1988), except for the following key difference. Instead of evolving in time via the partial differential equations and a Taylor series expansion as in (1-5-6), Sanders employed characteristic tracing. For advection of constant speed, the two techniques are equivalent. However, for systems of equatzns, it is considerably more complex t o preserve accuracy via a method of characteristics; in addition, extensions t o multi-dimensional cases must rely on dimensional splitting, which makes preserving third-order accuracy an impossible task. As noted above, due to the copstraint, a monotonicity-preserving (or total variation diminishing) scheme is of no higher than first-order accuracy near extrema. By modifying the definition of the total variation, Sanders presented a constraint that preserves a t least second-order accuracy and does not increase the total variation, but the constraint is somewhat complex and costly since extrema must be tracked. We introduce below simple constraints that preserve uniform third-order accuracy. Sanders and Weiser (1989,1992) also mentioned the piecewise linear reconstruction via the minmod limiter, which can be considered the dualmesh version of Van Leer's scheme 2. For linear advection, one can always reproduce a dual-mesh result by using the corresponding singlemesh scheme. More precisely, assume that a is positive, and we start with the same solution a t time level n. For the dual-mesh scheme, suppose we take two half time steps, each of which corresponds t o a CFL number c < 112 (say c = 0.4, and thus, the solution has advected a distance of 0.8h). For the single-mesh scheme, suppose we take two time steps, each of which corresponds to a CFL number 1/2 c (CFL = 0.9, and thus, the solution has advected a distance of 1.8h); next, we shift the solution back one mesh point (back t o .8h). Then the two results are identical. This observation holds true for any polynomial reconstruct ion. Loosely put, staggering the mesh is equivalent to advecting a distance of a half mesh width. As a consequence, a dual-mesh (centered) scheme has errors twice as large as the corresponding singlemesh (upwind) scheme since, t o get t o the same final time, the number of half time steps for the
+
Downloaded by HT Huynh on March 1, 2013 | http://arc.aiaa.org | DOI: 10.2514/6.1995-1739
former is twice the number of full time steps for the latter. We briefly discuss second-order accurate schemes (linear reconstructions) below. If we discard the interface values and calculate the slopes by interpolating the cell average quantities, the resulting staggered-mesh scheme is that of Nessyahu and Tadmor (1990). They also employed the time e v e lution (1.5a) above. Due to the linear reconstruction, t heir algorithm is simple; since interface values are not kept, the storage is minimal. However, it takes very little work to carry these point values and, as shown by Van Leer (1977) (scheme 1 and 2), the resulting scheme is considerably more accurate (dissipation error is one third). If we keep the interface values, calculate the slopes in each cell by a weighted average or a limiter function (Sanders and Weiser 1989, l992), and employ the time evolution (1.5a) (Nessyahu and Tadmor 1990), we obtain essentially the scheme presented by Chang and To (1992), which was derived in a different framework. This framework, which carries the cell averages and both slopes in x and in t , led to a family of methods called the a - c schemes (Chang 1993 and these proceedings). 2. Monotonicity constraints. The key ingredient that simplifies our constraint is the median function. In the following definitions, all arguments are real. Let the median of three numbers be the number that lies between the other two. Denote by I [x, y, z] the interval [min(x, y, z), max(x, y, z)]. Let minmod (x, y) be the median of 2 , y, and 0. Equivalently,
where sgn (x) = 1 if x is positive; sgn (3) = -1 if z is negative. Notice that if x = 0, (2.1) returns 0, and it does not matter whether sgn (x) is defined as 1 or -1. Conversely, the median function can be expressed in terms of minmod:
Let p* be the parabola determined by u,-112, iij, and p ~ ( ~ j - = ~ /0.~ )Denote by u* the value P*(xj+l/2) Then
Consider the constraint that u ~ , lies j between iij and u*, u ~ , Ej I [ ~ u*]. j P4) Starting with ~ j + ~ we / ~can , define an interface value which satisfies the above constraint by using the median function,
Loosely put, the lower limit (bound) iij, which corresponds to the constant reconstruction, provides a 'pivot'. The upper limit u*, which prevents a strict extremum from taking place inside the cdl, provides 'room'. At most smooth regions, the interface value ~ j + 1 / 2lies between iij and u* a priori and the constraint has no effect (it provides plenty of room). Near a discontinuity, the constraint takes effect; for the situation of Fig. 2(b), it yields UR,, = u* , and the reconstruction parabola remains monotone. A major drawback of the constraint is that near an extremum, it also takes effect and yields U R , j = ii, as shown in Fig. 2(a); consequently, accuracy degenerates to first order. 2.2. Constraint with second-order accuracy near extrema. Constraint (2.5) involves only the three values in cell j. To improve accuracy near extrema, the stencil is enlarged to include iij - 1 and iij+l. The five pieces of data help distinguish an extremum from a discontinuity. Consider the parabola p determined by uj - li2, iij, and the second derivative p". A little algebra yields its equation (again assume h = I),
+ iP1I[(~- xjl2 - h ] .
median(x, y, z) = x+minmod(y - x, z - x). (2.2)
(2.6) Therefore,
2.1. Constraint with firsborder accuracy near extrema. Due to symmetry (reflection), we carry out the constraints only for UR,, . To prevent oscillations near a discontinuity, Colella and Woodward (1984) presented a constraint which assures that the reconstruction parabolas are always monotone. Our presentation of this constraint below is geometric and simple. It also facilitates accuracypreserving extensions.
Let pj-,/z be the parabola determined by the three quantities Gj, Uj-1/2, and 'iij-1. Then
(Notice the difference between the above and (1.4a).) Denote pj-1/2(~j+l/2)by UXFL where the
subscript XFL stands for 'extrapolating from the left'. Expressions (2.7) and (2.8) imply
To reduce the loss of accuracy near extrema, we replace the lower limit uj in (2.4) by
Downloaded by HT Huynh on March 1, 2013 | http://arc.aiaa.org | DOI: 10.2514/6.1995-1739
(See Figs. 2). The constraint takes the form
Since uj+l/2 and u x are~ accurate ~ t o 0(h3), so is the limit u,. Consequently, the resulting scheme is of second- or higher-order accuracy. Finally,
Similar constraints for slopes instead of interface values were presented by the author in (Huynh 1993a, 1993b, and these proceedings). 2.3. Uniformly third-order accurate constraint. With py-lL2 given by (2.8), consider the parabola p defined y uj-112, iij, ahd the second derivative p" = 2~;'-~,,. The value p(xjCl12) shown in Figs. 2 is denoted by ULAC where LAC stands for 'largest allowable curvature'. By (2.7),
To preserve accuracy, the monotonicity interval I [u,, u*] in (2.4) is enlarged by adjoining ULAC. The constraint takes the form
As a motivation for the definition of ULAC, consider the extreme case of Gj-1 = uj-l/2 = 0 and ii, = 1 shown in Fig. 2(b). Expression (2.3) yields u* = 3, and (2.12), U L A ~= 3. Thus, a pfl larger than 2p;1-112 leads t o u ~ a > c 3, and monotonicity is no longer preserved. The above constraint preserves accuracy. The proof is sketched below. Consider a fixed x in the smooth regions of the data. Assume that the mesh is fine enough. If uf(x) # 0, the interval I [u,, u*] already provides plenty of room, and the interface value u j + l p is not altered by constraint (2.13). If ul(x) = 0 and uU(x) # 0, (2.13) also provides plenty of room due to the following argument. The value G j (u, - uj-l12), which corresponds t o a linear extrapolation, lies in I [u, , u*] and thus also lies in I [uj, u*,uLAc]. The value
+
ULAC,which corresponds t o an extrapolation with a second derivative of approximately 2uU(x), lies in I [u, ,u*, uLAc]. Thus, the interval in (2.13) contains the interface value u,+l/2, and this case is completed. If ul(x) = u"(x) = 0 and u"I(x) # 0, e.g., the situation near x = 0 of u(x) = x3, the interval I [uj, u*] again provides room. Finally, if ul(x) = u"(x) = ufff(x)= 0, then u itself is a small quantity of order 0(h4). To enforce (2.13), set
The interface value is given by
The above algorithm (consisting of (2.3), (2.12), (2.14a1b), and (2.15)) is slightly costlier than that of the previous subsection ((2.3), (2.9), (2.10), and (2.11)). In practice, (2.11) is nearly as accurate as (2.15). Also note that instead of enlarging I [G,, u*] via (2. U ) , one can enlarge I [u., u*] in a similar manner. 2.4. A steepening technique. The m o n e tonicity constraints prevent oscillations, but discontinuities are still slightly smeared, although t o a much lesser extent than typical upwind schemes. We present below a steepening technique which can resolve a contact discontinuity in about two cells. For the steepening t o have no effect a t smooth regions, the stencil is enlarged further t o include data between uj-2 and uj+2. Set
then the data is considered t o be near a discontinuity. Loosely put, the reconstruction is made steeper by allowing the data to the right to pull the interbefore limiting it. More precisely, face value uj let VLIN be the value at x j +1/2 o f t he linear e x t r a p olation through uj+l and uj+3/2,
Let V L A ~be the value at x,+1/2 of the parabola determined by u, + l , u,+3/2 and p" = 2pL3/,. Using (2.12), a reflection, and a shift of indices,
Downloaded by HT Huynh on March 1, 2013 | http://arc.aiaa.org | DOI: 10.2514/6.1995-1739
(Clearly, one can employ (2.15) instead of (2.1 I).) Observe that combining with (2.18), expression (2.22) essentially has no effect at smooth regions. 2.5. Smooth regions. For the Euler equations, we apply the constraints t o the characteristic variables, which are somewhat expensive to calculate. Since the constraints have no effect at smooth regions, it would save considerable computing time if we can derive a simple criterion t o detect when they have no effect and, in that case, U L , ~and U R , j are given by uj-112 and ujcl12 respectively as in (1.3). Such a criterion is presented below. Let p j be the parabola determined by uj - 112, uj , and uj+l/2. Similar t o (1.4a),
+ ~ j + 1 / 2- 2uj).
py =
derivative satisfies the test. For the Euler equations, to save computing time, the test is performed only on the density field and E is set equal t o We compensate for omitting the test on the momentum and energy fields by reducing k: k = 3/2. The interface estimate with steepening is summarized below. For each index j, calculate p r via (2.24), py-,,, and p;+l12 via (2.8), and a j and bj via (2.26). (a) If (2.27) is satisfied, define U L j and uR,j by (1.3) and move on t o the next index. (b) Otherwise, define uR,j as follows. Obtain rj-1 by (2.16-17). If (2.18) holds, calculate vj+l/2 via the steepening (2.19-22); if (2.18) does not hold, set v,+l/2 = uj+l/2. Finally, define U R j via (2.3), (2.9-lo), and (2.23). The value U L j is estimated by similar calculations except all indices are reflected about j, e-g., ~ j + 3 / 2is replaced by u j -312. a 3. Euler equations. The one-dimensional flow of an inviscid and compressible gas can be written
I, =
(2.24)
For the j-th cell, if (2.25~)
(5)
,
F=
(fi-)
(3-%3)
where t is time, x distance, p density, m momentum (m = pu), e total energy per unit volume, u velocity, and p pressure. Let y be the ratio of specific heats. Then for a perfect gas,
and 1
1 / 2 / ~ ; 2, then the data are considered to be smooth since constraint (2.15) does not alter uj +1/2 In practice, we allow some noises which are quickly damped out by the scheme; with k = 2, and 2
I
At smooth regions of the conserved variable U , (3.1) is equivalent t o the non-conservation form
~ ~ = ( P ~ - ~ / ~ - ~ P ~ ) ( P ~ - (2.26') ~ / ~ - ~ P where : ) ) ~A = a F / d U . After some algebra,
expression (2.25) can be coded as max(aj, bj)