Fourth- and sixth-order conservative finite difference ... - (CNLS) @ LANL

51 downloads 0 Views 129KB Size Report
Applied Numerical Mathematics 37 (2001) 171–187 ... then differentiation and the Divergence Theorem give .... approximations to the derivative have the form.
Applied Numerical Mathematics 37 (2001) 171–187

Fourth- and sixth-order conservative finite difference approximations of the divergence and gradient ✩ J.E. Castillo a , J.M. Hyman b , M. Shashkov b , S. Steinberg c a Department of Mathematics, San Diego State University, San Diego, CA 92182-7720, USA b Theoretical Division, Mail Stop B284, Los Alamos National Laboratory, Los Alamos, NM 87545, USA c Department of Mathematics, University of New Mexico, Albuquerque, NM 87131, USA

Received 30 November 1999; accepted 7 August 2000

Abstract We derive conservative fourth- and sixth-order finite difference approximations for the divergence and gradient operators and a compatible inner product on staggered 1D uniform grids in a bounded domain. The methods combine standard centered difference formulas in the interior with new one-sided finite difference approximations near the boundaries. We derive compatible inner products for these difference methods that are high-order approximations of the continuum inner product. We also investigate defining compatible high-order divergence and gradient finite difference operators that satisfy a discrete integration by parts identity.  2001 IMACS. Published by Elsevier Science B.V. All rights reserved.

1. Introduction We are developing a discrete analog of vector and tensor calculus that can be used to accurately approximate continuum models for a wide range of physical processes on logically rectangular, nonorthogonal, nonsmooth grids. These finite difference methods (FDMs) preserve fundamental properties of the original continuum differential operators and allow the discrete approximations of partial differential equations (PDEs) to mimic critical properties, including conservation laws and symmetries, in the solution of the underlying physical problem. The discrete analogs of div, grad, and curl satisfy the identities and theorems of vector and tensor calculus and provide new reliable algorithms for a wide class of PDEs [6–9]. This approach has been used to construct high-quality mimetic finite-difference approximations for the divergence, gradient [16,17], and curl [11]. In [10] this new methodology has been applied to Maxwell’s first-order curl equations. We have created higher-order approximations (see [2,3, 5]) in 1D and 2D on smooth curvilinear grids that satisfy a summation by parts identity for the particular case of periodic boundary conditions. ✩ This research was supported by the Department of Energy under contracts W-7405-ENG-36, the Applied Mathematical Sciences Program KC-07-01-01, and the National Science Foundation Grant CCR-9531828.

0168-9274/01/$ – see front matter  2001 IMACS. Published by Elsevier Science B.V. All rights reserved. PII: S 0 1 6 8 - 9 2 7 4 ( 0 0 ) 0 0 0 3 3 - 7

172

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

One of the central parts of discrete vector analysis is the discrete analog of integration by parts formula. Compatible discrete divergence (∇·) and gradient (∇) operators satisfy a discrete analog of the Divergence Theorem: 

∇ · vf dV +





v∇f dV =





f v · n dS.

(1.1)

∂Ω

Here Ω is some smooth region in a Euclidean space, ∂Ω is the boundary of the region, n is an outward normal to the boundary, f is a smooth scalar function defined on the closure of the region, and v is a smooth vector field defined on the closure of the region (see [15]). The higher-order discrete operators derived in [2,3,5] do not satisfy the discrete analog of this identity for nonperiodic boundary conditions. Because of its importance, we illustrate how the divergence theorem is used to show stability of solutions of partial differential equations. So assume that f (x, t) is some smooth function for x ∈ Ω and satisfies the simple heat equation ∂f = ∇ · ∇f, (1.2) ∂t and that f is zero on the boundary ∂Ω. If we introduce the functional  1 f 2 (x, t) dV , (1.3) E(t) = 2 Ω

then differentiation and the Divergence Theorem give     2 ∂f ∂E (t) = (x, t)f (x, t) dV = ∇ · ∇f (x, t)f (x, t) dV = − ∇f (x, t) dV . ∂t ∂t Ω



(1.4)



Consequently, the derivative of E is negative or zero, and thus cannot grow. So in this sense the solutions of the differential equation must be stable. Similarly one can show that the solutions of the simple wave equation ∂ 2f = ∇ · ∇f ∂t 2 have constant energy E(t) =

1 2

  Ω

∂f ∂t

(1.5) 2



2

+ ∇f (x, t) dV ,

(1.6)

by showing that the time derivative of E is zero. In 1D both divergence and gradient are simple derivatives and the identity (1.1) reduces to integration by parts: 1 0

vx f dx +

1

vfx dx = f (1)v(1) − f (0)v(0),

(1.7)

0

and when either f ≡ 1 or v ≡ 1, this becomes a conservation law: 1 0

dv dx = v(1) − v(0), dx

1 0

df dx = f (1) − f (0). dx

(1.8)

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

173

Fig. 1. Staggered grid.

To satisfy a discrete analog of (1.8), we must define a discrete formula for the derivative and a discrete analog of the integral (in general a discrete analog of the inner products in (1.1)). Applications to hyperbolic conservation laws may only contain a divergence, so in this case we need only consider the analog of global conservation (1.8). In this paper we define high-order conservative (that is, satisfying identities (1.8)) finite difference methods (FDMs) for the divergence (D) and gradient (G) operators on 1D uniform staggered grids in bounded domains. On staggered grids there are two different discrete analogs of this derivative. One, which corresponds to the divergence, has domain consisting of values at the nodes and range consisting of values at the cell centers, and another one, which corresponds to the gradient, has complementary domain and range of values. The main results of this paper are explicit formulas for fourth- and sixth-order accurate discrete divergence and gradient and corresponding inner products that satisfy a discrete analog of formula (1.8) exactly. Many of the results in this paper require extensive algebraic computations which we have done with a computer algebra system. In discretization such as ours, it is important to distinguish if a nodal or staggered grid is being used, because this significantly impacts the construction of the difference schemes. Our FDMs for a staggered grid are quite different from those for a nodal grid [1,12,14,18]. For our discretizations we use a uniform staggered grid Fig. 1 with h = 1/N and nodes at xi = ih, 0  i  N , and cells [xi , xi+1 ] with centers xi+1/2 = 12 (xi + xi+1 ). Continuum functions are projected onto the grid using point values: fi+1/2 = f (xi+1/2 ),

0  i  N − 1,

vi = v(xi ),

0  i  N.

(1.9)

Two auxiliary values for f are introduced at the domain boundaries, f0 = f (0),

fN = f (1),

(1.10)

which is typical for support-operators formulations. The discrete divergence will act on the v-values, while the discrete gradient will act on the f -values, as illustrated in Fig. 1.

2. Second-order discrete operators The simplest discrete divergence is defined by (Dv)i+1/2 =

vi+1 − vi , h

0  i  N − 1,

(2.1)

174

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

and the discrete gradient is defined by f1/2 − f0 , h/2 fi+1/2 − fi−1/2 (Gf )i = , h fN − fN−1/2 , (Gf )N = h/2 (Gf )0 =

1  i  N − 1,

(2.2)

where again the definition of G at the boundary points is standard for the support operators approach. The divergence D is second-order accurate while the gradient G is second-order accurate in the interior and first-order at the boundary. Fig. 1 illustrates the positions of the values of Dv and Gf in the grid. Using both the midpoint and trapezoidal rules, we define two discrete integrals for cell-centered and nodal quantities by I cf = h

N−1 

fi+1/2 ,

(2.3)

i=0





 vN v0 N−1 + vi + . I nv = h 2 2 i=1

(2.4)

An easy computation shows that these are second-order approximations of the continuum integrals and I c (Dv) = vN − v0 , I n (Gf ) = fN − f0 ,

(2.5)

are analogs of the formulas in (1.8). 2.1. Generalizations Away from the boundaries, the above considerations generalize to higher-order discretizations. For staggered uniform grids, the half-integer points are obtained from the integer points by translating the points by 1/2 and vice versa. So the natural higher-order central approximations to the derivative on one grid can be translated by 1/2 to give an approximation of the derivative on the other grid. Such approximations to the derivative have the form K 

(Dv)i+1/2 =

dk vi+k ,

0  i  N − 1,

(2.6)

dk fi+k−1/2 ,

1  i  N − 1,

(2.7)

k=−K+1

(Gf )i =

K  k=−K+1

where K is a positive integer and the dk are anti-symmetric: dk = −d1−k , 1 − K  k  K. (Examples are given below.) We can set dk = 0 for k > K and k < 1 − K, while retaining the anti-symmetry of the dk , and then remove the limits from the sums in (2.6) and (2.7). If we assume that f and v are zero near the boundary,

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

175

then a natural discretization of the Divergence Theorem (1.1) is 

(Dv)i+1/2 fi+1/2 +

i



vi (Gf )i = 0.

(2.8)

i

If we manipulate the sums a bit we get 

(Dv)i+1/2 fi+1/2 =

i

 i

=−

dk vi+k fi+1/2 =

k

 i

 i

dk vi fi+k−1/2 = −

dk vi fi−k+1/2 =

k



k

 i

vi (Gf )i .

d1−k vi fi+k−1/2

k

(2.9)

i

So away from the boundary, the above simple analog of the Divergence Theorem holds exactly for all antisymmetric approximations of the derivative. One-sided approximations must be used near the boundary, so to have the Divergence Theorem hold exactly, we must modify the definitions of the divergence and gradient and take different approximations to the integrals in (1.1). Because the dk are antisymmetric, the higher order divergence D and gradient G both kill constant functions and thus also satisfy the analogs of (1.8) given by (2.5). Our problem is to fix things up so that we get exact discrete analogs of (1.8) up to the boundary.

3. Higher-order discretizations We define discrete inner products for functions defined on the staggered grid by generalizing the usual inner products using the matrices Q and P : Qf, g =

N−1 

Qi+1/2,j +1/2fi+1/2 gj +1/2 ,

u, P v =

i,j =0

N 

Pi,j ui vj .

(3.1)

i,j =0

For these expressions to be inner products, P and Q have to be symmetric positive-definite operators. The general divergence and gradient are defined by N 1 di+1/2,j vj , (Dv)i+1/2 = h j =0

0  i  N − 1,





N−1  1 gi,0 f0 + gi,j +1/2 fj +1/2 + gi,N fN , 0  i  N, (Gf )i = h j =0

(3.2)

and satisfy a discrete analog of the integration by parts theorem, (1.1) when QDv, f + v, P Gf = vN fN − v0 f0 ,

(3.3)

is satisfied. The operators have order of accuracy k when 

(Dv)i+1/2 − v i +

1 2



 





h = O hk ,

 k

(Gf )i − f (ih) = O h ,

0  i  N − 1, 0  i  N.

(3.4)

176

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

Our goal is to define Q, P , D and G satisfying (3.3) and (3.4) that are at least fourth order in the interior. Near the boundary D and G should be local operators but they could be lower order. For some PDEs, the reduced accuracy near the boundary has a small effect on the accuracy of the solution. The leading error term in approximations of the first derivative by finite differences has the form Chk

dk+1 f , dx k+1

(3.5)

where C is a constant. Therefore, an equivalent formulation of the accuracy requirement is that the derivatives be exact on the polynomials 1, x, . . . , x k : 

Dx j



Gx j

 



i+1/2

 j −1

− j i + 12 h

= 0,

0  i  N − 1,

j −1 = 0, i − j (ih)

0  i  N,

(3.6)

for 0  j  k. This condition provides a way of finding constraints on the inner product that are independent of the definitions of D and G:







m Qx m−1 , x n + n x m , P x n−1 = 1,

0  m  k, 0  n  k, m = 0 or n = 0,

(3.7)

or more explicitly m

N−1  i,j =0



Qi+1/2,j +1/2 i + 12

m−1 

j + 12

n

+n

N 

Pi,j i m j n−1 = N m+n .

(3.8)

i,j =0

That is, the constraints (3.8) on the matrices Q and P and the accuracy constraints on the D and G are independent. The constraints (3.8) imply that if the approximations D and G are fourth-order accurate then, it is impossible to satisfy (1.7) if Q and P are essentially identity matrices, that is, if Q and P are both diagonal with all but some fixed (with respect to the grid size) number of elements not equal to 1. We proved this fact by assuming Q and P had this form and then using computer algebra to show that not all the conditions could be simultaneously satisfied. This fact is also true for the sixth-order D and G operators. Because there are no fourth- or sixth-order compatible D and G that are both local operators and satisfy the integration by parts identity (1.7), we first derive local D and G operators satisfying (1.8) and relax the condition that they simultaneously satisfy (1.7). These D and G will satisfy the integration by part formula (1.7) to fourth- and sixth-order of accuracy, respectively. We now look independently at the constraints on the Q and P matrices, the higher-order divergence, and the high-order gradient. 3.1. The divergence Requiring that the discrete gradient is exact when f ≡ 1, that is, G1 = 0, reduces the summation by parts formula (3.3) to QDv, 1 = vn − v0 .

(3.9)

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

177

This implies that



Dv, QT 1 = vn − v0 .

(3.10)

If we define the column sums of Q, by Qi+1/2 =

N−1 

Qj +1/2,i+1/2,

(3.11)

j =0

then





Dv, Q = vn − v0 .

(3.12)

The second-order operator D (2.1) satisfies this condition as does the standard fourth-order approximation 1 (fi−1 − 27fi + 27fi+1 − fi+2 ), (3.13) 24h except for the terms near the boundary. To define a special local boundary formula to be used with this method, by symmetry we only need to consider the upper-left corner of the matrix for the divergence, (Df )i+1/2 =



a

 11   a21   a  31    a41   D =  a51    0    0     0 

a12

a13

a14

a15

a16

a17

a18

...

a22

a23

a24

a25

a26

a27

a28

...

a32

a33

a34

a35

a36

a37

a38

...

a42

a43

a44

a45

a46

a47

a48

...

a52

a53

a54

a55

a56

a57

a58

... .

0

0

0

1 24

− 27 24

1 − 24

...

0

0

0

0

1 24

0

0

0

0

0

0

0

0

0

0

27 24 − 27 24 1 24

...

0

27 24 − 27 24 1 24

0

(3.14)

... ...

When we display only the upper-left corner of a matrix, we leave off the trailing bracket to make this clear. We settled on modifying the FDM at the first five points after trying a number of examples and finding that with this setup we can find divergences with parameters that can be used to try to satisfy additional conditions. The following lemma will be helpful in the computations. Lemma. Let di+1/2,j , 0  i  N − 1, 0  j  N , be the matrix defining a divergence and Qi+1/2 , 0  i  N − 1, be the column sums of the weight matrix. Then Dv, 1 =

N  j =0

cj vj ,

(3.15)

178

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

where cj =

N−1 

0  j  N.

Qi+1/2 di+1/2,j ,

(3.16)

i=0

Therefore a fourth-order discrete divergence operator satisfies (3.3) with f ≡ 1 provided that c0 = −1, cN = 1 and cj = 0, 1  j  N − 1. We have shown by direct computation that there are no fourth-order accurate divergences given as above with Q ≡ 1. On the other hand, there are uniformly fourth-order accurate divergences with nontrivial Q: Q1/2 =

Q3/2 =

649 , 576

143 , 192

Q5/2 =

75 , 64

Q7/2 =

Q9/2 = 1,

551 , 576

... .

(3.17)

The inner product with these weights is exact for quadratic polynomials and is a fifth-order approximation of the continuous inner product. The formulas are similar to Gregory’s boundary corrected trapezoid formulas in [4]. That is, (3.17) is a fifth-order quadrature formula. Using a computer algebra system, we find a three-parameter family of uniformly fourth-order accurate discrete divergence operators,   a11  1   24 − α   −β    1  − 24 − γ D=   0    0    0  

a12

a13

a14

a15

a16

0

− 27 + 5α 24

27 − 10α 24 − 27 − 10β 24 − 38 − 10γ

1 − 24 + 10α

−5α

α

0

1 − 24 − 5β

β

0

γ

0 1 − 24

1 24 5 24

0

+ 5β

0

0

27 + 10β 24 − 17 + 10γ 24 1 24

0

0

0

1 24

0

0

0

0

27 24 − 27 24 1 24

0

0

0

0

0

+ 5γ

11 12

− 5γ

− 27 24

,

(3.18)

27 24 − 27 24 1 24

where + a11 = − 6851 7788

39 α 59

+ 675 β+ 649

− 195 α− 59

a12 =

8153 15576

a13 = a14 =

3867 + 390 α + 6750 β + 5510 γ, 5192 59 649 649 9005 − 15576 − 390 α − 6750 β − 5510 γ, 59 649 649

a15 =

3529 15576

+ 195 α+ 59

24 − a16 = − 649

39 α 59



3375 β 649

3375 β 649 675 β 649



551 γ, 649

+

2755 γ, 649

2755 γ, 649

− 551 γ. 649

(3.19)

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

179

The special case where the FDM only changes at the boundary is given by α = 0, β = 

            D=           

− 4751 5192

− 1165 5192

129 2596

25 − 15576

0

0

1 − 24

0

0

0

0

0

0

0

0

0

1 − 24

0 1 − 24

0

0

6091 15576 27 24 − 27 24 1 24

0

0

0

27 24 − 27 24 1 24

0

0

0

0

1 − 24 27 24 − 27 24 1 24

0

0

0

0

0

1 − 24 27 24 − 27 24 1 24

0

0

0

0

0

0

27 24 − 27 24 1 24

0

0

0

0

0

0

0

1 24

0

909 1298 − 27 24 1 24

1 , 24

.

1 γ = − 24 :

(3.20)

27 24 − 27 24 1 24

In Appendix A we put this divergence into two more symmetric forms. 3.2. Sixth-order divergence In Appendix B we give a 10 parameter family of sixth-order divergences. Here we only show the first two rows of the matrix of a divergence where the formula for this divergence is the usual sixth-order approximation of the derivative except for the boundary and first interior point: − 1077397 1273920

15668474643803 49955527 32472850116480 39491520 129 − 687 640 128

31 960

− 25369793 19745760 19 192

12220145 15796608 3 − 32

− 21334421 78983040 21 640

460217 9872880 3 − 640

101017 − 39491520

3369 26327680

0

0

(3.21)

The corresponding Q weights are 41137 , 34560

15667 , 34560

2933 , 1728

2131 , 4320

41411 , 34560

33437 , 34560

1,

... .

(3.22)

3.3. The gradient Using the exactness when v ≡ 1 of the discrete divergence, D1 = 0, the summation by parts formula (3.3) reduces to 1, P Gf = fn − f0 , or equivalently,



P T 1, Gf = fn − f0 .

(3.23) (3.24)

If we define the column sums of P as Pi =

N−1 

Pj,i ,

(3.25)

j =0

then





Gf, P = fn − f0 .

(3.26)

180

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

The operator G given in (2.2) satisfies this condition and is a second-order gradient in the interior with first-order truncation error at the boundary. As for the divergence, we first try for gradients that are a standard fourth-order approximation away from the boundary and local special formulas near the boundaries. The standard fourth-order approximation is 



1 1 27 27 1 fi−3/2 − fi−1/2 + fi+1/2 − fi+3/2 . (Gf )i = h 24 24 24 24

(3.27)

As for the divergence, the following will be helpful in doing the computations. Lemma. Let gi,0 , gi,j +1/2 , gi,N , 0  i  N , 0  j  N − 1, be the matrix defining a gradient and P i , 0  i  N , be the column sums of the weight matrix. Then P Gf, 1 = c0 f0 +

N−1 

cj +1/2 fj +1/2 + cN fN ,

(3.28)

j =0

where cj =

N−1 

P i gi,j +1/2 ,

0  j  N − 1.

(3.29)

i=0

The weights are again independent of the particulars of the gradient: P0 =

P1 =

407 , 1152

P2 =

473 , 384

343 , 384

P3 =

1177 , 1152

P 3 = 1,

...

(3.30)

and the resulting discrete inner product is a fifth-order approximation of the continuous inner product. A three-parameter family of uniformly fourth-order accurate gradients is: 

a

11   16 128   105 − α 35  G= −β 128  35   16 128  − 105 − γ 35 

0

a12

a13

a14

a15

0

0

− 31 + α9 24

3 − 40 + α 54 5

0

β

0

γ

0

0

0

1 − α 36 168 7 1 − 24 − β 36 7 51 36 −γ 7 56 − 27 24

α

1 + β9 24 3 +γ9 8

29 − α12 24 − 27 − β12 24 − 11 − γ 12 24

27 24

1 − 24

where + α 16512 + β 18816 + γ 13696 , a11 = − 124832 42735 1295 2035 1295 a12 = a13 = a14 = a15 = a16 =

10789 − α 1161 − β 9261 − γ 963 , 3256 37 407 37 421 1548 12348 1284 − 9768 + α 37 + β 407 + γ 37 , − 12189 − α 6966 − β 55566 − γ 5778 , 16280 185 2035 185 11789 + α 4644 + β 5292 + γ 3852 , 22792 259 407 259 48 129 1029 107 − 407 − α 37 − β 407 − γ 37 .

27 + β 54 24 5 27 − 40 + γ 54 5 1 24

,

(3.31)

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

The choice α = 

  G= 

1 , 24

− 1152 407 0 0

181

1 β = 0, γ = − 24 gives 10063 3256 − 11 12 1 24

− 3309 3256

2483 9768 17 24 − 27 24

3 8 27 24

2099 3256 5 − 24 1 − 24

697 − 4884 1 24

,

(3.32)

0

and results in a gradient that is only modified at the first interior point. 3.4. Sixth-order gradient In Appendix C we give a 10 parameter family of sixth-order gradients. Here we only show the first three rows of the matrix of a gradient where the formula for this gradient is the usual sixth-order approximation of the derivative except for the boundary and first two interior points: − 568557184 150834915 496 3465 8 − 385

455704609 83579520 − 811 640 179 1920

− 128942179 41789760 449 384 − 153 128

15911389 6964960 29 − 960 381 320

− 142924471 117011328 11 − 448 101 − 1344

20331719 50147712 13 1152 1 128

2688571 − 38307280

187529 41789760

6207 − 27859840

37 − 21120

0

0

3 − 7040

0

0

(3.33)

Again, we only present the rows that are not the same as the usual sixth-order approximation of the derivative. The corresponding P weights are 43531 , 138240

192937 , 138240

42647 , 69120

86473 , 69120

125303 , 138240

140309 , 138240

1,

... .

(3.34)

4. Conclusions and discussion We derive conservative fourth- and sixth-order finite difference approximations for the divergence and gradient operators and a compatible inner product on staggered 1D uniform grids in a bounded domain. The methods use standard centered difference formulas in the interior with a new one-sided finite difference approximation at the boundary. We derive a compatible inner product for these difference methods, that is, a fifth- and seventh-order approximations, respectively, of the continuum inner product. Our discrete operators satisfy the integration by parts identity (3.3) up to fourth- and sixth-order, respectively. Our ultimate goal is to define compatible high-order divergence and gradient finite difference operators that satisfy a discrete integration by parts identity (3.3) exactly. Let us note that we have made some substantial but unsuccessful attempts to solve this problem using the general divergence (3.18) and general gradient (3.31). The amount of algebra in this general setting simply overwhelms computer algebra systems. We now list some of the fourth-order cases that we tried that assume special forms for the matrices Q and P in (3.1). Case 1. No solution. The matrices Q and P have general six-by-six blocks in the upper left (and lower right) corners and are otherwise the identity. Also in the divergence α = 0,

β=

1 , 24

1 γ = − 24 ,

(4.1)

182

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

and in the gradient α=

1 , 24

β = 0,

1 γ = − 24 .

(4.2)

This choice sets all but the first entries of the first column of the divergence and gradient to zero. Case 2. No solution. The matrices Q and P are diagonal with diagonal given by the weights (3.22) and (3.34) discussed above, while the divergence is given by the ten-parameter family given in (B.1) and gradient is given by by the ten-parameter family given in (C.1). Let us note that discrete operators for nodal discretizations in 1D that satisfy summation by part formula have been constructed in [1,12,14,18]. It gives us hope that this also can be done on staggered grids.

Appendix A. Special forms for the divergence For the fourth-order accurate divergence, it is easy to see that the matrix for the operator QDv + v0 has a matrix with column sums zero and then that this implies that 1 QD + v0 = δAv, h

(A.1)

where δ is the simple difference operator, A is an N + 1 by N + 1 matrix with upper left corner given by: A1,1 = A1,3 = A1,5 = A2,1 = A2,3 = A2,5 = A3,1 = A3,4 =

61 + 143 α + 75 β + 551 γ, 6912 192 64 576 1289 715 375 2755 + 96 α + 32 β + 288 γ , 1536 3529 + 715 α + 375 β + 2755 γ, 13824 192 64 576 551 + 75 β + 551 γ, 13824 64 576 161 375 2755 + 32 β + 288 γ , 96 3529 + 375 β + 2755 γ, 13824 64 576 551 13824 8791 13824

+ 551 γ, 576 − 2755 γ, 288

A4,1 = A4,2 = A4,3 = 0,

A1,2 =

8153 − 715 α − 375 β − 2755 γ, 13824 192 64 576 9005 715 375 2755 A1,4 = − 13824 − 96 α − 32 β − 288 γ , 1 A1,6 = − 24 − 143 α − 75 β − 551 γ, 192 64 576

A1,7 = 0,

A2,2 = − 1715 − 375 β− 6912 64 A2,4 = − 4717 + 6912 1 − 24

A2,6 =



2755 γ, 576 375 2755 β + 288 γ , 32 75 β − 551 γ, 64 576

2755 A3,2 = − 13824 −

A3,5 =

1427 6912

+

2755 γ, 576 2755 γ, 576

1 A4,4 = − 24 ,

A5,1 = A5,2 = A5,3 = A5,4 = 0,

A2,7 = 0,

A3,3 = A3,6 =

A4,5 =

1 A5,5 = − 24 ,

(A.2)

551 + 2755 γ, 1536 288 1 − 24 − 551 γ, 576

13 , 12

A5,6 =

1 A4,6 = − 24 , 13 , 12

A3,7 = 0, A4,7 = 0,

1 A5,7 = − 24 .

Also, because the row sums of D are zero it is possible to write 1 D = Bδ, h

(A.3)

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

183

where again δ is the simple difference and 

a

11  − 1 +α  24  B = β   1   24 + γ

a12 13 − 4α 12 1 − 24 − 4β − 16 − 4γ

0

a13 1 − 24 + 6α 13 + 6β 12 5 + 6γ 24

0

0

a14

a15

0

−4α

α

0

1 − 24 − 4β 11 − 4γ 12 1 − 24

β

0

γ

0

13 12

1 − 24

,

(A.4)

where a11 = a12 = a13 = a14 = a15 =

6851 − 39 α − 675 β − 551 γ, 7788 59 649 649 5549 + 156 α + 2700 β + 2204 γ, 15576 59 649 649 1513 234 4050 3306 − 3894 − 59 α − 649 β − 649 γ , 2953 + 156 α + 2700 β + 2204 γ, 15576 59 649 649 24 39 675 551 − 649 − 59 α − 649 β − 649 γ .

(A.5)

Appendix B. Sixth-order divergence We have found a ten-parameter family of sixth-order divergences with the following structure: 

d11

  d21    d31    d41 D=   d51  d  61   0 

0

d12

d13

d14

d15

d16

d17

d18

d19

0

0

d22

d23

d24

d25

d26

d27

d28

d29

0

0

d32

d33

d34

d35

d36

d37

d38

d39

0

0

d42

d43

d44

d45

d46

d47

d48

d49

0

0

d52

d53

d54

d55

d56

d57

d58

d59

0

0

d62

d63

d64

d65

d66

d67

0

0

− 2250 1920 125 1920

d68 2250 1920 − 2250 1920

d69

125 1920 9 − 1920

125 − 1920 2250 1920

9 1920 125 − 1920

0

0

0

0

9 − 1920

0

0

0

0

,

(B.1)

9 1920

where + d11 = − 65098219 78983040 d12 = d13 =

34560 s + 241920 s + 34560 s + 241920 s + 241920 s + 34560 s + 34560 s 41137 1 41137 2 41137 3 41137 4 41137 6 41137 5 41137 7 241920 34560 241920 + 41137 s8 + 41137 s9 + 41137 s10 , 4302307 − 241920 s − 1658880 s − 241920 s − 1658880 s − 1658880 s − 241920 s − 241920 s 26327680 41137 1 41137 2 41137 3 41137 4 41137 6 41137 5 41137 7 − 1658880 s − 241920 s − 1658880 s , 41137 8 41137 9 41137 10 3443147 725760 4838400 + 41137 s1 + 41137 s2 + 725760 s + 4838400 s + 4838400 s + 725760 s + 725760 s 1974576 41137 3 41137 4 41137 6 41137 5 41137 7 4838400 725760 4838400 + 41137 s8 + 41137 s9 + 41137 s10 ,

− d14 = − 16731259 7898304 −

1209600 s − 7741440 s − 1209600 s 41137 1 41137 2 41137 3 7741440 1209600 7741440 s − 41137 s9 − 41137 s10 , 41137 8



7741440 s 41137 4

− 7741440 s − 1209600 s − 1209600 s 41137 6 41137 5 41137 7

184

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

d15 = d16 = d17 = d18 = d19 =

282037 + 1209600 s + 7257600 s + 1209600 s + 7257600 s + 7257600 s + 1209600 s + 1209600 s 169856 41137 1 41137 2 41137 3 41137 4 41137 6 41137 5 41137 7 7257600 1209600 7257600 + 41137 s8 + 41137 s9 + 41137 s10 , − 67575371 − 725760 s − 3870720 s − 725760 s − 3870720 s − 3870720 s − 725760 s − 725760 s 78983040 41137 1 41137 2 41137 3 41137 4 41137 6 41137 5 41137 7 3870720 725760 3870720 − 41137 s8 − 41137 s9 − 41137 s10 , 10952047 + 241920 s + 967680 s + 241920 s + 967680 s + 241920 s + 967680 s + 241920 s 39491520 41137 1 41137 2 41137 3 41137 4 41137 5 41137 6 41137 7 + 967680 s + 241920 s + 967680 s , 41137 8 41137 9 41137 10 34560 34560 34560 2088 − 41137 s1 − 41137 s3 − 41137 s5 − 34560 s − 34560 s − 41137 , 41137 7 41137 9 34560 34560 34560 34560 34560 162 − 41137 s2 − 41137 s4 − 41137 s6 − 41137 s8 − 41137 s10 + 41137 ,

d21 = − 34560 s − 241920 s + 15667 1 15667 2 d23 = d25 = d27 =

s − d31 = − 1728 2933 3 s − d33 = − 5184 419 3 s − d35 = − 8640 419 3 s − d37 = − 1728 419 3

1728 3 s − 640 , 419 4 34560 75 s − 64 , 419 4

d45 = d47 = d51 = d53 = d55 = d57 =

51840 25 s − 384 , 419 4 6912 s, d38 419 4

d34 = =

34560 s − 241920 s , 33437 9 33437 10 725760 4838400 s − 33437 s10 , 33437 9

− 1209600 s − d65 = − 59 48 33437 9 1627 1920



241920 s 33437 9



7257600 s , 33437 10 967680 s , 33437 10

The weights are given in Section 3.2.

25 + 82944 s + 384 , 2933 4

+ 55296 s + 75 , 419 4 64 27648 3 s + 640 , 419 4 1728 d39 = 2933 s4 ,

5184 s 419 3

1728 s, 2933 3

=

3 − 34560 s − 241920 s, 640 41411 7 41411 8 3 725760 4838400 − 41411 s7 − 41411 s8 , 32 7257600 − 41411 s8 − 1209600 s − 129 , 41411 7 128 241920 967680 31 − 41411 s7 − 41411 s8 − 960 ,

91 − d63 = − 128

1728 s 419 3 8640 s 419 3

d36 =

30240 s, d42 2131 6 90720 604800 25 − 2131 s5 − 2131 s6 + 384 , − 151200 s − 907200 s + 75 , 2131 5 2131 6 64 3 − 30240 s − 120960 s + 640 , 2131 5 2131 6

31 − d61 = − 960

d67 =

241920 s + 1658880 s − 687 , 15667 1 15667 2 640 1209600 7741440 19 d24 = 15667 s1 + 15667 s2 + 192 , 725760 3870720 21 d26 = 15667 s1 + 15667 s2 + 640 , d28 = 34560 s, d29 = 34560 s, 15667 1 15667 2

d32 =

s − d41 = − 4320 2131 5 d43 =

d22 =

31 , 960 725760 4838400 129 − 15667 s1 − 15667 s2 + 128 , 3 − 1209600 s − 7257600 s − 32 , 15667 1 15667 2 241920 967680 3 − 15667 s1 − 15667 s2 − 640 ,

30240 s 2131 5

+

+ 207360 s − 2131 6

3 , 640

d44 = − 75 + 151200 s + 64 2131 5 d46 = d48 =

90720 s 2131 5 4320 s, 2131 5

+

967680 s, 2131 6 483840 25 s − 384 , 2131 6 d49 = 4320 s, 2131 6

21 d52 = − 640 + 241920 s + 41411 7

1658880 s , 41411 8 19 1209600 7741440 d54 = − 192 + 41411 s7 + 41411 s8 , d56 = 3870720 s + 725760 s + 687 , 41411 8 41411 7 640 34560 34560 d58 = 41411 s7 , d59 = 41411 s8 ,

d62 =

443 + 241920 s + 1658880 s , 1920 33437 9 33437 10 235 1209600 7741440 d64 = 192 + 33437 s9 + 33437 s10 , d66 = − 211 + 725760 s + 3870720 s , 640 33437 9 33437 10 34560 34560 d68 = 33437 s9 , d69 = 33437 s10 .

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

185

Appendix C. Sixth-order gradient Here is a ten-parameter family of sixth-order gradients: 

g11

  g21    g31    g41 G=   g51  g  61   0 

0

g12

g13

g14

g15

g16

g17

g18

g19

0

0

g22

g23

g24

g25

g26

g27

g28

g29

0

0

g32

g33

g34

g35

g36

g37

g38

g39

0

0

g42

g43

g44

g45

g46

g47

g48

g49

0

0

g52

g53

g54

g55

g56

g57

g58

g59

0

0

g62

g63

g64

g65

g66

g67

0

0

− 2250 1920 125 1920

g68 2250 1920 − 2250 1920

g69

125 1920 9 − 1920

125 − 1920 2250 1920

9 1920 125 − 1920

0

0

0

0

9 − 1920

0

0

0

0

,

(C.1)

9 1920

where + 47185920 s + g11 = − 501295888 178259445 3351887 1 g12 = g13 =

47185920 s + 47185920 s + 47185920 s − 2359296 s + 82575360 s 478841 2 3351887 3 478841 4 6224933 5 6224933 6 47185920 47185920 47185920 47185920 + 3351887 s7 + 478841 s8 + 3351887 s9 + 478841 s10 , 7327275 − 1797120 s − 12441600 s − 1797120 s − 12441600 s + 48384 s − 1555200 s 2785984 43531 1 43531 2 43531 3 43531 4 43531 5 43531 6 − 1797120 s − 12441600 s − 1797120 s − 12441600 s , 43531 7 43531 8 43531 9 43531 10 14680151 3594240 24192000 3594240 + 43531 s1 + 43531 s2 + 43531 s3 + 24192000 s − 96768 s + 2419200 s 5571968 43531 4 43531 5 43531 6

+ 3594240 s + 24192000 s + 3594240 s + 24192000 s , 43531 7 43531 8 43531 9 43531 10 − 5391360 s − 34836480 s − g14 = − 179817489 27859840 43531 1 43531 2 g15 =

5391360 s − 34836480 s 43531 3 43531 4 5391360 34836480 5391360 34836480 − 43531 s7 − 43531 s8 − 43531 s9 − 43531 s10 , 142907685 + 35942400 s + 31104000 s + 35942400 s 19501888 304717 1 43531 2 304717 3 31104000 138240 35942400 31104000 + 43531 s4 − 43531 s5 + 304717 s7 + 43531 s8 + 35942400 s + 31104000 s , 304717 9 43531 10

+

145152 s 43531 5

− 2177280 s 43531 6

− 2995200 s − g16 = − 596065 124128 43531 1 g17 = g18 = g19 = g21 = g23 = g25 = g27 =

16128000 s − 2995200 s − 16128000 s + 80640 s + 2016000 s 43531 2 43531 3 43531 4 43531 5 43531 6 2995200 16128000 2995200 16128000 − 43531 s7 − 43531 s8 − 43531 s9 − 43531 s10 , 9908595 + 10782720 s + 43545600 s + 10782720 s + 43545600 s − 290304 s − 21772800 s 5571968 478841 1 478841 2 478841 3 478841 4 478841 5 478841 6 10782720 43545600 10782720 43545600 + 478841 s7 + 478841 s8 + 478841 s9 + 478841 s10 , 48384 − 22977393 − 138240 s − 138240 s + 565903 s5 + 10886400 s − 138240 s − 138240 s, 72435584 43531 1 43531 3 565903 6 43531 7 43531 9 648 − 138240 s − 138240 s − 138240 s − 138240 s − 138240 s , 43531 43531 2 43531 4 43531 6 43531 8 43531 10 496 − 47185920 s − 47185920 s, 3465 14856149 1 2122307 2 449 3594240 24192000 − 192937 s1 − 192937 s2 , 384 11 − 448 − 35942400 s − 31104000 s, 1350559 1 192937 2 37 10782720 43545600 − 21120 − 2122307 s1 − 2122307 s2 ,

g22 = − 811 + 640 29 g24 = − 960 +

g26 =

1797120 s + 12441600 s , 192937 1 192937 2 5391360 34836480 s + 192937 s2 , 192937 1

13 + 2995200 s + 16128000 s , 1152 192937 1 192937 2 138240 138240 g28 = 192937 s1 , g29 = 192937 s2 ,

(C.2)

186

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187 8 g31 = − 385 −

− g33 = − 153 128

23592960 s − 23592960 s, 3283819 3 469117 4 1797120 12096000 s − 42647 s4 , 42647 3

101 g35 = − 1344 − 17971200 s − 298529 3 3 − 5391360 s − g37 = − 7040 469117 3

15552000 s, 42647 4 21772800 s, 469117 4

20 g41 = − 143 +

g43 = g45 = g47 = g51 = g53 = g55 = g57 =

1179648 s − 41287680 s, 12365639 5 12365639 6 145 48384 1209600 − 192 + 86473 s5 − 86473 s6 , 69120 s, g46 = 475 − 40320 s 86473 5 768 86473 5 771 − 3520 + 145152 s + 10886400 s, 951203 5 951203 6 8 − 47185920 s − 47185920 s, 385 9648331 7 1378333 8 15 3594240 24192000 − 125303 s7 − 125303 s8 , 128 447 − 448 − 35942400 s − 31104000 s, 877121 7 125303 8 673 10782720 43545600 − 21120 − 1378333 s7 − 1378333 s8 ,

496 − 47185920 s − g61 = − 3465 10803793 9

− g63 = − 335 384 g65 = g67 =

47185920 s , 1543399 10 24192000 s , 140309 10

276480 s − 10793 9 1745 2764800 − 1344 − 75551 s9 − 31104000 s , 140309 10 1189 829440 43545600 − 118723 s9 − 1543399 s10 , 1408

g32 =

179 + 898560 s + 6220800 s, 1920 42647 3 42647 4 381 2695680 17418240 g34 = 320 + 42647 s3 + 42647 s4 , 1 g36 = 128 + 1497600 s + 8064000 s, 42647 3 42647 4 69120 69120 g38 = 42647 s3 , g39 = 42647 s4 ,

g42 =

519 − 24192 s + 777600 s, 1280 86473 5 86473 6 15 72576 1088640 g44 = 256 − 86473 s5 + 86473 s6 , − 1008000 s, 86473 6

g48 =

105 3328

24192 − 1124149 s5 −

5443200 s, 1124149 6

g49 =

69120 s, 86473 6

39 g52 = − 640 + 1797120 s + 125303 7

12441600 s, 125303 8 113 5391360 34836480 g54 = − 960 + 125303 s7 + 125303 s8 , g56 = 137 + 2995200 s + 16128000 s, 128 125303 7 125303 8 138240 138240 g58 = 125303 s7 , g59 = 125303 s8 ,

g62 =

163 + 138240 s + 12441600 s , 384 10793 9 140309 10 433 414720 34836480 g64 = 320 + 10793 s9 + 140309 s10 , 355 g66 = − 1152 + 230400 s + 16128000 s , 10793 9 140309 10 138240 138240 g68 = 140309 s9 , g69 = 140309 s10 .

The weights are given in Section 3.4. References [1] M.H. Carpenter, D. Gottlieb, S. Abarbanel, Time-stable boundary conditions for finite difference solving hyperbolic systems: Methodology and applications to high-order compact schemes, J. Comput. Phys. 111 (1994) 220–236. [2] J.E. Castillo, J.M. Hyman, M.J. Shashkov, S. Steinberg, The sensitivity and accuracy of fourth order finitedifference schemes on non-uniform grids in one dimension, Comput. Math. Appl. 30 (8) (1995) 41–55. [3] J.E. Castillo, J.M. Hyman, M.J. Shashkov, S. Steinberg, High-order mimetic finite-difference schemes on non-uniform grids, ICOSAHOM ’95; Houston J. Math. (1996). [4] R.W. Hamming, Numerical Methods for Scientists and Engineers, 2nd Edition, McGraw-Hill, New York, 1973. [5] J.M. Hyman, R.J. Knapp, J.C. Scovel, High order finite volume approximations of differential operators on nonuniform grids, Phys. D 60 (1992) 112–138. [6] J.M. Hyman, M. Shashkov, Natural discretizations for the divergence, gradient, and curl on logically rectangular grids, Internat. J. Comput. Math. Appl. 33 (1997) 81–104. [7] J.M. Hyman, M. Shashkov, The adjoint operators for the natural discretizations for the divergence, gradient, and curl on logically rectangular grids, IMACS J. Appl. Numer. Math. 25 (1997) 413–442. [8] J.M. Hyman, M. Shashkov, The approximation of boundary conditions for mimetic finite difference methods, Internat. J. Comput. Math. Appl. 36 (1998) 79–99.

J.E. Castillo et al. / Applied Numerical Mathematics 37 (2001) 171–187

187

[9] J.M. Hyman, M. Shashkov, The orthogonal decomposition theorems for mimetic finite difference methods, SIAM J. Numer. Anal. 36 (1999) 788–818. [10] J.M. Hyman, M. Shashkov, Mimetic discretizations for Maxwell’s equations, J. Comput. Phys., in press. [11] J.M. Hyman, M. Shashkov, S. Steinberg, The numerical solution of diffusion problems in strongly heterogeneous non-isotropic materials, J. Comput. Phys. 132 (1997) 130–148. [12] H.-O. Kreiss, G. Scherer, Finite element and finite difference methods for hyperbolic partial differential equations, in: C. De Boor (Ed.), Mathematical Aspects of Finite Elements in Partial Differential Equations, 1974, pp. 195–212. [13] S.K. Lele, Compact finite-difference schemes with spectral-like resolution, J. Comput. Phys. 103 (1) (1992) 16–42. [14] P. Olsson, Summation by parts, projections, and stability I, Math. Comp. 64 (211) (1995) 1035–1065. [15] M. Shashkov, Conservative Finite-Difference Methods on General Grids, CRC Press, Boca Raton, FL, 1995. [16] M. Shashkov, S. Steinberg, Support-operator finite-difference algorithms for general elliptic problems, J. Comput. Phys. 118 (1995) 131–151. [17] M. Shashkov, S. Steinberg, Solving diffusion equations with rough coefficients in rough grids, J. Comput. Phys. 129 (1996) 383–405. [18] B. Strand, Summation by parts for finite difference approximations for d/dx, J. Comput. Phys. 110 (1994) 47–67.