High-order finite difference methods for hyperbolic IBVP

12
High-OrderFinite Difference Methods for Hyperbolic IBVP Bo Strand * Abstract We have derived stability results for explicit high-order finite difference approximations of systems of hyperbolic initial-boundary value problems (IBVP). The schemes are a generalization of a fourth order schemeby Gustafsson, Kreiss and Oliger[5]to general order of accuracy 2 r. The stability results are obtained using the theory of Gustafs- son.Kreiss and SundstrSm (G-K-S) for the semi-discrete IBVP. These results are then generalized to the fully dis- crete case using a theory of Kreiss and•Vu [7]. Key words: finite differences, wave equation, stability analysis. AMS subject classifications: 65M06, 65M12. I Introduction In this paper we develop explicit high-order difference methods for hyperbolic systems and use them in prac- tical computation of the two-dimensional wave equation. For a hyperbolic system to preserve the spatial accuracy, a pth-order inner schememust be closedwith at least a (p- 1)th-order boundary sche•ne, see Gustafsson [3] and [4]. When investigating stability of the numerical approxi- mation of the IBVP, we rely on the stability theory analy- sis based on normal mode analysis, developedfor the fully discrete case by Gustafsson, Kreissand SundstrSm (G-K- S) [6], and forthesemi-discrete case by Strikwerda [10] and Gustafsson, Kreiss andOliger[5]. The G-K-S theory gives conditionsthat the inner and boundary schemes must sat- isf•v to ensure stability. The following theoremstateswhen hyperbolic systems are G-K-S stable. •Department of Scientific Computing Uppsala University Upp- sala, Sweden Theorem 1.1 Necessary and sufficient conditions for sta- bility (fully discrete [6] or semi-discrete [5],[10]) of the finite-domain IBVP is that, the inner scheme must be Cauchy stableon (-c•, c•), and that the Kreiss condi- tion is fulfilled, i.e. there are no eigensolutions for the two quarter-plane problems. Furthermore, in [5]it is shown that if the conditions in theorem 1.1 are fulfilled, the normal mode analysis leads to strong stability. Here, we will use the method of lines approach,the hy- perbolic systems are discretized in space but the time is left continuous. The semi-discrete system is then analyzed and stability results derived. The stability of the fully discrete problem follows froma result of Kreiss and•Vu [7]. They have shownthat under weak conditions,if specific Runge- Kutta or multi-step schemes are usedfor ti•ne-integration, the stability of the fully discreteproblem followsfrom the stability of the se•ni-discrete problem. Explicit difference operators for PDEs have been con- sidered, for example in [1], [2], [5] and [9]. In [5] strong stability for hyperbolic systems in one dimensionis shown for the fourth order case. In this paper we generalize the result to general order of accuracy 2 r. The organization of the paper is as follows. Section2 presents the stability analysis on the scalar model problem ut = au•:. In sec- tion 3 the result is generalized to systems, and in section 4 nmnerical results on the two-dimensional wave equation are presented. 2 Scalar model equation for IBVP Consider the problem (1)a(x,t) a t) -- •, a•0, 0<x<c•, t>0, Ot a Ox - - ICOSAHOM'95: Proceedings ofthe Third International Con- (2) ferenceon Spectral and High Order Methods. ¸1996 Houston Journal ofMathematics, University ofHouston. (3) u(x,O) ---- f(x), u(0,t) = g(t), if a < 0. 4O9

Transcript of High-order finite difference methods for hyperbolic IBVP

High-Order Finite Difference Methods for Hyperbolic IBVP

Bo Strand *

Abstract

We have derived stability results for explicit high-order finite difference approximations of systems of hyperbolic initial-boundary value problems (IBVP). The schemes are a generalization of a fourth order scheme by Gustafsson, Kreiss and Oliger [5] to general order of accuracy 2 r. The stability results are obtained using the theory of Gustafs- son. Kreiss and SundstrSm (G-K-S) for the semi-discrete IBVP. These results are then generalized to the fully dis- crete case using a theory of Kreiss and •Vu [7].

Key words: finite differences, wave equation, stability analysis.

AMS subject classifications: 65M06, 65M12.

I Introduction

In this paper we develop explicit high-order difference methods for hyperbolic systems and use them in prac- tical computation of the two-dimensional wave equation. For a hyperbolic system to preserve the spatial accuracy, a pth-order inner scheme must be closed with at least a (p- 1)th-order boundary sche•ne, see Gustafsson [3] and [4].

When investigating stability of the numerical approxi- mation of the IBVP, we rely on the stability theory analy- sis based on normal mode analysis, developed for the fully discrete case by Gustafsson, Kreiss and SundstrSm (G-K- S) [6], and for the semi-discrete case by Strikwerda [10] and Gustafsson, Kreiss and Oliger [5]. The G-K-S theory gives conditions that the inner and boundary schemes must sat- isf•v to ensure stability. The following theorem states when hyperbolic systems are G-K-S stable.

•Department of Scientific Computing Uppsala University Upp- sala, Sweden

Theorem 1.1 Necessary and sufficient conditions for sta- bility (fully discrete [6] or semi-discrete [5],[10]) of the finite-domain IBVP is that, the inner scheme must be Cauchy stable on (-c•, c•), and that the Kreiss condi- tion is fulfilled, i.e. there are no eigensolutions for the two quarter-plane problems.

Furthermore, in [5] it is shown that if the conditions in theorem 1.1 are fulfilled, the normal mode analysis leads to strong stability.

Here, we will use the method of lines approach, the hy- perbolic systems are discretized in space but the time is left continuous. The semi-discrete system is then analyzed and stability results derived. The stability of the fully discrete problem follows from a result of Kreiss and •Vu [7]. They have shown that under weak conditions, if specific Runge- Kutta or multi-step schemes are used for ti•ne-integration, the stability of the fully discrete problem follows from the stability of the se•ni-discrete problem.

Explicit difference operators for PDEs have been con- sidered, for example in [1], [2], [5] and [9]. In [5] strong stability for hyperbolic systems in one dimension is shown for the fourth order case. In this paper we generalize the result to general order of accuracy 2 r. The organization of the paper is as follows. Section 2 presents the stability analysis on the scalar model problem ut = au•:. In sec- tion 3 the result is generalized to systems, and in section 4 nmnerical results on the two-dimensional wave equation are presented.

2 Scalar model equation for IBVP

Consider the problem

(1) a(x,t) a t) -- •, a•0, 0<x<c•, t>0, Ot a Ox - -

ICOSAHOM'95: Proceedings of the Third International Con- (2) ference on Spectral and High Order Methods. ¸1996 Houston

Journal of Mathematics, University of Houston. (3)

u(x,O) ---- f(x),

u(0, t) = g(t), if a < 0.

4O9

410 ICOSAHOM 95

We xvant to solve the above problem by difference ap- proximation. Therefore, we introduce the mesh width

and divide the x-axis into intervals of length h. For = -r + 1,-r + 2,...,0, 1,... we use the notation

vj(t) = v(xj,t), xj = j h.

We approximate (1) for j - 1,2,... by a centered finite difference scheme of order 2r

(4)

where

ova(t) = aQvj(t), ot

v:(O) = f(x:),

is difference operator and the coefficients are given by

(-1)t:-i (r!) 2 &• = v(r+v)!(r-v)!' /2 = 1,..., C•-u -- --Ctu. /2 -- 0,...,

Because the operator is 2r + 1 points wide we need extra boundary conditions at points x-v, /2 = 0, 1,..., r - 1. If a > 0. we have outflow at x -- 0, and use extrapolation of order q

(7) (hz•+)q•,_•(t) = o. /2 = o, 1,...,•- 1.

If • < 0. x = 0 is an inflow boundary, and by differenti- ating the boundary condition u(0, t) = #(t) and using the differential equation we obtain

(s) 02•u(O,t) ct 2• Or2• -- g(2V)(t), /2 = 0, 1 ..... We need

Lemma 2.1 We have the following expansion for smooth functions u(x)

(9) (D+D_)•u(O) = u(2•)(0) + • cyh2Ju(2•+25)(0),

where h D+ = E-I and h D_ = I-E -x. The coefficients are defined as

(2(•,+j))! = k (-1)k(/2- k)2(v+J) j = 0,1,..., /2 = 0,1,....

Proof

This shows that (D+D_) • has an expansion of the form (9). To compute the coefficients cy we note that

2/•

k:O

where the binomial theorem have been used. Thus,

(D+D_)%(O) = l • (2•)(--1)ku(xv_k). h2v k=O

Expanding u(x•_k) in Taylor series implies

= l! (-1)•(/2 - k)l' /=o k=0

The coefficient cy is then obtained for l = 2(/2 +j) and the proof if complete. []

As boundary conditions for the difference approximation in the inflow case we approximate (8) for/2 = 0,.... r - 1 by

r--u--1 (lO) •(•+•_)•vo(t) = j=0

For u = 0 the coefficients are c? = 6j.o, and (10) is valid also for the analytic boundary condition.

2.1 Necessary and sufficient conditions for stability

A necessary condition for stability of our semi-discrete ap- proximation, defined in (4), (7) and (10), is that the as- sociated eigenvalue problem has no eigenvalues or general- ized eigenvalues. That is, our semi-discrete problem with

High-Order Finite Difference Methods 411

g = 0, f = 0, has no solutions of the form

(11) = e "t

where s are the eigenvalues. Substitution into (4), (7) and (10) yields the eigenvalue problem

(12) •:j = a • a•j+/2, j = 1,2,..., g = s h,

(13) D•_4_/2 = 0, t, = 0,...,r-I, if a>0,

(14) (D+D_)/2•;o = 0, t, = 0,...,r- 1, ifa < 0,

(15)

The characteristic equation to the difference equation (12) is

(16) /2ml

Scalar product and norm are defined by

(17) (v, j=l

First we note that in [5] it is shown that for su•ciently large ',5•. Re • > 0, there are no eigenvalues. Furthermore, when Re • • •. the n with In[ < 1 converges to zero. •X• need

Lemma 2.2 1) The characteristic equation (16) has ex- actly r roots

[•j[ < 1 forReg>O, j = 1,...,r,

and there are no roots with ]/'•j] = 1 for Re g > O. 2.) For • = 0 the only roots to the characteristic equation (16) with absolute value one are n = 4-1. Furthermore they are simple. $) In a neighborhood of • = 0 the roots with [njl < 1 for Re • > O, and absolute value one for g = O, are of the form

• ---- -1+ s +O(g2), ira>O, 26 • ( r!)2

'• 0(,•2), /f a < O, <• : 1+•+

Proof

1) The statement follows from a result in [•]. 2) Also in !.5] it is shown that the operator can be factorized as

Q = Do /2=0

where the coefficients are defined recursively by

4u'-+2/•/2-1,

30 = 1.

Since (h2D+D_)/2n j nJ (•_•)2. = • , the characteristic equa- tion can be written as

r-1 (•;_ 1)2/2 /2=0

Let • = 0, n = e i•, -•r _• • _• •r, and note that

ei • = (--1)/222/2 (sin •'2/2 then the condition to have a root on the unit circle is

aisin•y•/222(sin•) 2 = O. /2-----0

The second factor is positive for all • except • = 0 for which it is zero. Therefore the condition can be fulfilled

only if• = 0 or • = 4-•r, i.e, if n = 4-1. To show that these roots are simple, let p(n) = Z;=I o•/2(/•/2 - N-/2). A necessary condition for n = 4-1 to be a multiple root is dp(4-1)/dn = 0, but

dp(n)

•p(-•) d•

= + /2=1

= 2 • c•/2• = 1. /2=1

= -2 • /2=1

- 2 • (r!)2 -- (•+/2)!(•_/2)! • 0,

shows that n - 4-1 are simple roots. 3) For g = 0, the solutions to the characteristic equation (16) with absolute value one are

n (•'2) = 4-1.

Since, (1 = 1 +

and

(-1 +e) • = (-1)•(1-ek) + O(62), the characteristic equation (16) gives for small • and nO) = 1+e

g = a•'•ak((l+e) k--(l+e) -k) = 2ae,•akk+O(e2). k=l k----1

412 ICOSAHOM 95

Consistency implies that •k=• ak k = 1/2, therefore

n (•) = 1+-+O(õ2).

With a(2) = -1 + e we have (19)

• = 2a• • •(-1)•+•k+o½ 2 ) k=l

= 2ae (•+k)!(r-k)! + ) with

r (r!)•- is positiveß Thus, where •-]•=•

•(2) = -1 + + O(•2). 2a (•+•)!(•_•)!

k=l

By selecting the roots satisfying Inl < 1 for Re J > 0, the third statement follows and the lemma is complete. []

By Lemma 1.2, there are r roots n•, •, = 1,...,r, with I•! < 1 for Re • > 0. The general solution of (12) with l[•ll• < •: can be written in the form

(20) g3 : c•f3[ni] 4-o2fj[n2.a•]-i-... +crfj[n•,...,n•], where

(lS) • •= •.. i • k, j = 1,2,....

where

fj[•t. •] = f•[• ...... •-•]-L[•,-• ..... •u] l > k. .... t• l --t• k ,

If for instance • = •2 = • is a double root, then fj [•2, •] becomesj•'-• If• =•2 =•3:•is a triple root then fj[•3.•2. s•] will become j(j- 1)• j-2. If • -- •2 ..... •z = a is a root with multiplicity 1, then fj[•z,...,•] becomes •! •-(z-•) and the solution (18) to the (J-U-•))• '

eigenvalue problem in this case can then be written as

• = (h +&j +...+hf-•)n • + • •f•[n•,...,n•+•]. u=l+l

Therefore by using the form (18) we can treat simple roots and multiple roots simultaneouslyß

To be able to express the boundary conditions in terms of • we need the following relations for the difference op- erators D+ and D_ and

(•D+)•,• : (•D+)•-•(• •+• - •)

= (•D+)•-2•(•- 1) 2

..... •(•- 1)q,

ß : h2uF) u F) u•-j : h2v/92v•cJ -v (h2D+D_)•

By (18) the outflow boundary conditions becomes

(hD+)q•-v • ck(hD+)qf_•[*•,...,*q]

• Ckgu[•k,...,•l] = O, k=l

v = 0,1,...,r-I,

g•[•] =

ß, t½l --t• k

The inflow boundary conditions becomes

, l>k.

(h2D+D_)•o

(n-l) 2•

• c•(h2D+D-)•fj[•k, .... nz] • Ckgu[•k, ... ,N'I] = O,

k----1

v = 0,1,...,r-I,

ß • tqI--t• k '

The systems of boundary conditions (19) and (20) we write as

c2

D . =0,

Cr

where D is the (r x r)-matrix

(•_•)• ,½• , a < 0,

•[•] = (•-•)•

•-• , a>0,

ß , tq l --tq k

_-- nJ-v(n -- 1) 2v. The be able to calculate the determinant of D we use

High-Order Finite Difference Methods 413

Lemma 2.3 D can be factorized as

D D - with

B•, = 0 t}• '

r>l,

1 -1

1

h-. 0 ) C• = o •, '

( go[•x] go[•2] ... go[•,-] ß o

g•-•[•] g•-z[•=] ... g•-z[•]

Here B•C• and 1• are of size (r x r), P• is of size ((v + 1) x (• + 1)), • is of size (• x •), and I•denotes the identity matrix of size (• x •).

Proof

D

go [•x] ß

go[•x] ... go[•-2, ß ß ß, •1 go[•,--x, ß ß ß, •2] ß

g•-•[•] ... g•-x[•-2,...,•x] g,--,[•,--z ..... •1

By repeating this procedure gives the factorization. [] The factorization of D makes it easy to calculate the de-

414 ICOSAHOM 95

terrainant. First we note that

detBj = 1,

I-Ik=l ( r-3+k -- n•)-l, detCj = J n ß Therefore,

j - 1,...,r-I,

j = 1,...,r-1.

r--1 r--1 j

II dctC• = H H (•r-•+•-•) -• 3----1 3----1 k----1

= (/{r --/{1)-- 1 (/{r_ 1 --/{1) --1

(Nr--N2)--I... (N3--N2)--I... (Nr--Nr_l) --1

: II (•_•)-1

= (_1)«(•-•> • H (•,_•j)-i r_>j>i>_l

= (-1) «{•-•)• H (•i-•]) -1 r_>j >i_> l

Now it only remains to calculate the determinant of/•. In the outflow case we have with •/j = (K s - 1) q

ß , ß

where the •) is a Vandermonde matrix. Let

XO :El ß ß ß Xn

then the determinant of V is •n•j>i•o(Xj -xi). With • = r - I and xi = 1/ni+•,i = 0,...,r - 1 we have

_ • •t• - H ( • •)= H (• r-l•j>i•0 nj.• n•+x r•j>i•l

and

Finally,

detD = H r_>j >i_> l /•i -- /•j kl-ll(/•k __ 1)q. /qi/qj

the outflow problemß In the inflow case we have

Since this also is a Vandermonde matrix we immediately (n•_r --1) 2 get with xi = •+1

: ( (• _•)2 (• _•)•. ) detD = H . • • r_>j>i_> l

= H (•-•)(•-•) r > 1.

Thus,

H (1- I ), c>1 detD = r_•j>i_• l • 1, r: 1,

which only can be zero if nit•j = 1, i • j, 1 _< i, j _< r, r > 1. By Lemma 1.2 this is not possible for Re • > 0, and there are no eigenvalue to the inflow problem.

We have proved

Lemma 2.4 There are no eigenvalues • with Re • > 0 to the eigenvalue problem (12) with outflow (13) or inflow (14) boundary conditions.

Finally, we have to show that there are no generalized eigenvalues when Re • goes to zero. We have

Lemma 2.5 There is constant 5 > 0 such that, on any compact set I•l <- c, Re •-> O, the roots nl, ..., n• of the characteristic equation (16) satisfy the inequalities

I•j - II >_ 5, j = 1,... ,r /fa > 0,

ll----• I >a i•j, I <i,j <rifa<O. M•t• 3 ....

High- Order Fini t e Difference ,Tie th o ds 415

Proof

The roots are continuous functions of •. Therefore, the inequalities can only be violated if for some •, Re • _> 0

nj = 1 whena>0or ninj =l, i•jwhena<0. The first statement of Lemma 1.2 tells us that this can-

not happen for Re • > O. Let a > 0 and nj = l, then from (16) • = 0. However,

the third statement of Lemma 1.2 tells us that nj = -1 and we have a contradiction.

Let a < 0 and •inj = 1, i • j, then (16) implies

,• _ •(• - • ) = •(• - • )

Thus. • = 0 and we have a contradiction since n•nj • 1 according to statement two and three of Lemma 1.2. This proves the lemma.

2.2 The main results

We now have the main result

Theorem 2.1 The approximation defined in (•), (7) and (10) is strongly stable and the error of the solution is of order h 2•' if q _> 2r.

Proof

From I5] it follows that the approximation is strongly sta- ble since it has no eigenvalues or generalized eigenvalues and the operator is semi-bounded for the Cauchy problem. Therefore it remains only to validate that the error of the solution is h 2r. Let u be a smooth function and denote by ej(t) = u(xj.t) - vj(t) the error, then we have

•%(t) = aQej(t) + h2rFj(t), j = 1,2, dt ' ß ' •

ej(O) = 0, j = 1,2,...

For the boundary conditions we have, if a < 0

h •-" (a •"(D+D_)"•(0, t)- o •"

0 0, and therefore the error of We note that for • -- 0, cr - the analytic boundary condition e0 = 0. For a > 0,

(•D+)•e_,(t) = (•D+)%(•_,,t) - (•D+)•_,(t)

= (•D+)•(•_,t)

- h qø•(•-•'•) o(h q+•) o(hq), -- Oxq + =

v = 0,1,...,r-1.

Therefore, from the strong stability and since the forcing is of order O(h 2• + hq), we have the following estimate for the error

II¾t)11• = co•st (11A2•F(•)IIZ+IO(h2•)12)d• = O(h4•),

if q • 2r. •

3 Systems

Consider the system

(21) ut = Au•. O<x<•c. t>O, -- _

with initial conditions

(22) u(•, 0) = f(x).

Approximate by a finite difference approximation of order 2r

dv,• (t) at = Qvj(t), j = 1,2,..., (23)

w(O) = fj, j = 1,2,..., where

Q=A• . Since A can be diagonalized, we can assume A having di- agonal form with

( Az ) A' A z' A = A• • , > 0, < 0.

The boundary conditions can be written as

(24) •"(0, t) = s•(0, t) + g(t).

Differentiation of the boundary conditions (24) and the differential equation (21) give us

o•"(o, t) o•(0,t) (A•

(2s)

416 ICOSAHOM 95

As boundary conditions for the in-going characteristic vari- able we approximate (25) for/2 = r - 1,..., 0 by

(26)

where

r--•,--1

Q• = (z•+z•_) • - • cy •v Q•+•. j=l

The reason to define Q• this way is that Q•u(O) will be an approximation of u(2•)(0) of order h 2r-2•. This is ex- actly what we need for the boundary conditions to be of order h 2r. For the outgoing characteristic variable we use extrapolation conditions

(27) D•_,,L•(t) = 0, /2 = 0,1,..., r - 1. We have the following result

Theorem 3.1 The approximation defined by (25), (26) and (27) is strongly stable and the error of the solution is qf order 2r if q _> 2r.

Proof

The t 'I approximation is decoupled from v TM and is already discussed and strongly stable. \Ve can now think of v •r as a given function and write the boundary conditions for v H as

/2 ---- 0,...,r--1.

Now we can think of the approximations of v H as consist- ing of scalar equations which we already have discussed. By theorem 1.1 they are strongly stable.

Let u be a smooth solution. Denote by, ej(t) = u(z b. t) - v• (t), the error, and we obtain the system

dcd (t) at = Qej(t) + h2*Fj, j = 1,2,...,

ej(0) = 0, j = 1,2,....

For the inflow part of the boundary conditions we have

= h2• (Q•un(O,t)-S•Q•uz(O,t)-(AZZ)-2•g(2•)(t))

and for the outflow part

(•D+)•eL•(t) = (•D+)•d(•_•,t)- (•D+)%,œ•(t)

= (•D+)•(•_•,t)

__ hq Oqu•(x_• ,t) -- Oxq q- O(hq+l)

: O(hq), /2 = O, 1,...,r - 1.

This shows that the forcing is of order O(h 2") + O(h q) and the desired estimate follows from the strong stability of the approximation. []

4 Numerical results

Consider the two-dimensional wave equations

Ut -- AlUz• +A2ux2, (28) where u = (p u v) T and

Ax = -1 0 0 0 0 0

O_<xx_<l, O<xo<l, t>_O.

0 0 -1) A2 - 0 0 0 . -1 0 0

The components of u are pressure and the velocity in the x• and x2 direction. With the boundary conditions

p(x•,O,t) = p(xt,l,t) = (29) p(O, x2,t) = p(1,x2,t) = 0, t _> 0,

and initial conditions

p(x•,x2,0) = sin(•x•)sin(•2x2),

(30) u(xx, x2,0) = 0,

v(x•,•:2,0) = 0,

where cv•: ran' and •2 - nn', ra, n - 1, 2,..., the exact solution is

p(x•,x2, t) = sin(•lX•)sin(•2x2) cos(v•t),

u(x•,x2,t) = -• cos(•x•) sin(•2x2) sin(v•t), v(x• x2 t) = -?-•- sin(•x•) c0s(•2x2) sin(v•t),

(31) where A = •2 + co• . Let h• and h2 be mesh widths in the x•- and x2-directions, and divide the axis into intervals of length h• and h2 respectively. For i = -r + 1,..., N• + r-landj = -r+l,...,N• 2+r-lweusethenotation

u/h,j(t) -- uh(xli,X2j,t), x•i -- ihl, x2j = j h2, = O(h2"), /2 = O,...,r-1, h•Nx• = h2,¾z2 = 1.

High-Order Finite Difference Methods 417

We approximate (28) by a centered difference approxima- tion of order 2 r

h

d u i.J dt = (A1Q•,i + A')Qz2) u'•' i - 1. Nx• - 1, - •../, ß . . ,

j = 1 .... ,.\•21, (32) where u. •. = (p/' u/' ,h r ,.• • )i.j and

Qx. = h17 • o, EY = =

3,= 1,2,

To get extra boundary conditions for the numerical scheme we differentiate the boundary conditions (29) with respect to tilne and use the differential equation (28) to obtain

{ 33) 02•p('j"r2't) /'J2"p(x 1 "i't) o.,.•,' o.d" = O. j = O. 1.

We approximate (33) for v = 0 ..... r- 1 with

)2,,pt.,. = 0. j : 0._•,. i = 1 ..... _\-• -1. I D_.,-, D_ •'2 '-.• - -

•34) where D_.,._ aud D_ ,._ are the usual forward and backward differences in the the -,-direction. At a'l = 0.1 we need boundary conditions for u. • and at x2 = 0.1 for v •. These couditions are obtained by extrapolation of the locally out- going characteristic variables. Thus. for •, = 0 ..... r- 1 we have

(h•D..,.•)2,.(ph _ uh)_.j =

(hlD_,.t)2,.(ph + uh).x_.q +v.d = 0. j = 1 .... ,-Vz2 - (35)

(h2D ..... )2,-(ph __ uh)i._. __ -

(h2D_.•. 2 )2r(ph + Vh)i.X,.2+•, = 0. i = 1 .... , A%• -- 1.

We now use the numerical boundary conditions (34) and (35) to modi•' the operator close to the boundary. The reason why we solve the differential equation only at in- terior points. i = 1 ..... .\• - 1, j = 1,...._'\•., - 1, is that it simplifies the implementation, and since p = 0 at the boundary. we will have u = 0 at x2 = 0, 1 and v = 0 at x• = 0.1. Furthermore. u•. ,.j at i = 0, '¾x• and u/h.j at j = 0. _\:•_.are given bv the extrapolation conditions (35) with v = 0.

Figure 1 shows the pressure component of the nmnerical solution obtained using the sixth-order scheme, (32), (34) and (35) with r= 3.

i

0.5 -.

o 41! • '½ ' *' , ½' "'-:.'1t' -1

1 '. '•..' ::;.:. ..

o o

Figure 1' Pressure component of numerical solution of the two-dimensional wave equation at t = 0.5. ,.'• =

4.1 Convergence rate of high-order meth- ods

To analyze the convergence rate of the numerical so- lution we make a grid refinement study on the two- dimensional wave equation. The Logm of the L2 error. Logm(llu - u•ll2), is computed at a fixed time t = T. and the convergence rate between two grid densities are plot- ted. For the second- and fourth-order scheme a fourth-

order Runge-Kutta scheme was used for time-integration. and for the sixth-order scheme a sixth-order Runge-Kutta. The time step was chosen such that the error of the time- discretization was smaller than the error of the space- discretization. The convergence rate was computed as

Ilu - u h' 112 hi q -- logm(llu_ u•=l12)/løgm(•) ß

The results are shown in table 4.1.

The results in table 4.1 agrees well with the theory of Gustafsson [3] and [4] which predicts that boundary con- ditions of order p - 1 must be imposed to retain pth-order global accuracy. Since all boundary conditions considered here are of order 2r- 1 we get global accuracy of order 2r.

4.2 Efficiency of high-order methods

The efficiency of high-order methods compared with sec- ond order methods has been studied in [8] and [11]. The

418 ICOSAHOM 95

Second-order Fourth-order Sixth-order

Grid Log(L2) q Log(L2) q Log(L2) q

21 -1.176 -2.708 -4.262

41 -1.753 1.92 -3.956 4.14 -6.622 7.83

81 -2.344 1.96 -5.177 4.06 -8.149 5.07

Table 1: Grid convergence of schemes on two-dimensional wave equation with ";• = ";2 = 2•r, T = 1.

conclusion is that the high-order methods are more efficient than low-order ones for hyperbolic problems with smooth solutions, except when very low accuracy in the solution is needed.

As a test of the efficiency of the fourth- and sixth-order methods compared xvith the second-order method, we com- pute the numerical solution and compare it with the ex- act solution of the two-dimensional wave equation. This is done at a fixed time, t = 0.5, on successively refined grids. with :V• = 3,•2 = N, and for different frequencies -;• = -;2 = -;. On each grid we compute the relative error, Ilu- uh!12/llul[2,and measure the consumed CPU time Tcp•,. For the second-order and the fourth-order schemes a fourth-order Runge-Kutta scheme with four stages was used to integrate in time. For the sixth-order scheme a sixth-order Runge-Kutta with seven stages was used. For all Runge-Kutta schemes the time step was chosen such that the error in the time-discretization was of the same

order as the error of the space-discretization and as close to the stability limit as possible. All computations was done on a SUN Spark-Station 10 equipped with a 40 MHz processor and without external cache. The results are pre- sented below.

Table 4.2-4.2 shows clearly the high efficiency of the fourth- and sixth-order methods compared with the second-order one, this is true in particular for high fre- quencies and high accuracy requirements in the solution. If we want to compute the solution of the problem with "; = 4•r, with a relative error of 0.001, the second-order method would need approximately 0.9 CPU hours while the fourth-order method would need less than 29 seconds

and the sixth-order one less than 15 seconds. For lower

frequencies and lower accuracy requirements in the solu- tion the gain is not that big. In table 4.2 a relative error of 0.01 xvould require approximately 0.5 second CPU time for the second-order method, 0.1 second for the fourth- order method and less than 0.3 seconds for the sixth-order

Second-order

[[u--uh 1[• Tcpu

Fourt h-order Sixt h-order

IlU-U•][2 Tcpu tlu--uh ][2 Tcpu [lUll2 IlUll2

9 5.88

17 1.63

33 4.10

65 1.02

129 2.56

257 6.40

513 1.60

10 -2 0.03 3.46

10 -2 0.14 2.43

10 -3 0.90 1.50

10 -3 6.7 8.95

10 -4 52 5.36

10 -s 415 3.26

10 -5 3305

10 -3 0.09 5.01. 10 -4 0.32

10 -4 0.57 2.47- 10 -6 2.0

10 -• 3.8 6.62. 10 -8 15

10 -7 29 9.59. 10 -•ø 115

10 -8 228 1.22. 10 -• 911

10 -• 1822 1.52.10 -•3 7268

Table 2: Relative error and consumed CPU time.

Second-order Fourth-order Sixth-order

[I u-uh [12 Tcpu I[ u-uh [[2 Tcpu [I u-ua 112 Zcpu 1111112 IlUl[2 1111112

9 5.03

17 1.15

33 2.72

65 6.74

129 1.70

257 4.29

513 1.08

10 -• 0.03 1.01

10 -• 0.14 7.75

10 -2 0.90 4.44

10 -3 6.7 2.52

10 -• 52 1.48

10 -4 415 8.96

10 -4 3312

10 -• 0.10 2.59. 10 -2 0.33

10 -3 0.57 4.50. 10 -4 2.0

10 -4 3.8 7.38. 10 -6 15

10 -s 29 8.66. 10 -s 115

10 -• 228 9.95. 10 -m 913

10 -8 1818 1.19.10 -• 7277

Table 3: Relative error and consumed CPU time, "; = 2 :r

High-Order Finite Difference Methods 419

Second-order Fourt h-order

Ilu--uhl12 Tcpu Ilu-uhl12 Tcpu

Sixth-order

u-u• 112 T•pu 9 1.29 10 ø

17 7.84 10 -1

33 2.67 10 -1

65 6.10 10 -2

129 1.45 10 -2

257 3.59 10 -3

513 8.95 10 -4

0.03

0.14

0.91

6.8

52

416

3314

9.50 10 -1

1.69 10 -1

1.09 10 -2

6.55 10 -4

4.03 10 -5

2.51 10 -6

0.10 1.66.10 ø 0.33

0.58 4.63- 10 -2 2.0

3.9 4.40.10 -4 15

29 2.73.10 -6 116

229 5.05- 10 -s 913

1817 8.86.10 -lø 7274

Table 4: Relative error and consumed CPU time, w = 4 •r

Second-order Fourth-order Sixth-order

]lU -uh I]2 Tcpu II u-uh 112 Tcpu II u-uh 112 Tcpu 9 1.00.10 ø 0.02 1.00- 10 ø 0.10 1.00.10 ø 0.32

17 1.14-10 ø 0.13 1.41.10 ø 0.57 9.87-10 -1 2.0

33 9.85. 10 -1 0.90 2.72- 10 -1 3.8 3.84- 10 -2 15

65 5.22. 10 -1 6.7 1.97. 10 -2 29 3.76. 10 -4 115

129 1.23. 10 -1 52 1.25 ß 10 -3 228 6.33. 10 -6 911

257 2.90. 10 -2 415 7.84 - 10 -5 1822 1.09- 10 -7 7268

513 7.15. 10 -3 3315

Table 5: Relative error and consumed CPU time, a; - 8 •r

one. Thus, it is only for a relative error of the order 0.1 and low frequencies that the second-order method can compete with the high-order ones. Tests with a three-stage second- order Runge-Kutta in combination with the second-order scheme in space was also made. However, the combination second-order in space and fourth-order in time turned out to be more efficient.

References

[1] Mark H. Carpenter, David Gottlieb, and Saul Abar- banel. The stability of numerical boundary treatments for compact high-order finite-difference schemes. Journal of Computational Physics, 108(2):272-295, October 1993.

[2] John Gary. On boundary conditions for hyper- bolic difference schemes. Journal of Computational Physics, 26:339-351, 1978.

[3] Bertil Gustafsson. The convergence rate for difference approximations to mixed initial boundary value prob- lems. Mathematics of Computation, 29(130):396-406, April 1975.

[4] Bertil Gustafsson. The convergence rate for differ- ence approximations to general mixed initial bound- ary value problems. Siam Journal of Numerical Anal- ysis, 18(2):179-190, April 1981.

[5] Bertil Gustafsson, Hans-Otto Kreiss, and Joseph Oliger. Time Dependent problems and Difference Methods. Wiley and Sons, 1994, To Appear.

[6] B. Gustafsson, H. O. Kreiss, A. Sundstr6m. Stability theory of difference approximations for mixed initial boundary value problems. ii. Mathematics of Compu- tation, 26(119):649-686, July 1972.

[7] Heinz-Otto Kreiss and Lixin •Vu. On the stability definition of difference approximations for the initial boundary value problems. Applied Numerical Mathe- matics, 12:213-227, 1993.

[8] Pelle Olsson. High-Order Difference Methods and Dat- aparallel Implementation. PhD thesis, Uppsala Uni- versity, Department of Scientific Computing, 1992.

[9] BjSrn Sj6green. High order centered difference meth- ods for the compressible Navier-Stokes equations. Journal of Computational Physics, 116, 1995. To Ap- pear.

420 ICOSAHOM 95

[10] John C. Strikwerda. Initial boundary value problems for the method of lines. Journal of Computational Physics, 34:94-110, 1980.

Blair Swartz and Burton Wendroff. The relative effi- ciency of finite difference methods. i: Hyperbolic prob- lems and splines. Siam Journal of Numerical Analysis, 11(5) :979-993, October 1974.