High-order finite difference methods for the Helmholtz ... - ScienceDirect

18 downloads 0 Views 1MB Size Report
High-order finite difference methods for solving the Helmhohz equation are .... A,, A,Y, Ac, are the coefficients for the stencil, which will be represented later in the ...
Computer methods in applied mechanics and engineering

EISZVLER

Comput.

Methods

Appl. Mech. Engrg.

163 (1998) 343-358

High-order finite difference methods for the Helmholtz equation I. Singer, E. Turkel* School of Mathematical Sciences, Sackler Faculty of Exact Sciences, Tel-Aviv University, Tel-Aviv, Israel Received

15 May 1997

Abstract High-order finite difference methods for solving the Helmhohz equation are developed and analyzed, in one and two dimensions on uniform grids. The standard pointwise representation has a second-order accurate local truncation error. We also study two schemes which have a fourth-order accurate local truncation error. One of the high-order schemes is based on generalizations of the Pade approximation. The second scheme is based on high-order approximation to the derivative calculated from the Helmholtz equation itself. A symmetric high-order representation is developed for a Neumann boundary condition. Numerical results are presented on model problems approximated with the developed schemes. 0 1998 Elsevier Science S.A. All rights reserved.

1. Discrete formulations Let S CR”

be a closed bounded

set. Consider

the Helmholtz

equation.

Au + k2u = F inside S. At the boundary u =f(x)

or a Neumann U, = g(x)

(1) of S, which we denote by 6’S, we have either a Dirichlet

boundary

(2)

for X E as boundary

condition

condition

for n E aS,

IZ the normal to XS

(3)

or a combination of both. We develop here approximations dimensions, using finite difference methods. We develop boundary dS (for any of the above boundary conditions).

for the solution approximations

of this equation in one and in two both for the interior and for the

2. Approximations in the interior In this study we analyze approximations using the same methods [7].

* Corresponding

for uniform

grids. Extensions

author.

0045-7825/98/$19.00 0 1998 Elsevier Science S.A. All rights reserved, PII: SOO45-7825(98)00023-l

to nonuniform

grid is straightforward

344

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

2.1.One dimension Pointwise representation In one dimension (1) becomes u” + k2u = F(x) where S = [a, b] E

the O.D.E.

for x E S

(4)

R. The standard finite difference stencil for the second derivative is

u(Xj+r) -

2u(xj)

Dxxu(xj):=

+

'('j-1)

(5)

h2

and for every sufficiently u”(xj) = Q&j)

smooth u

+ O(h*) .

(6)

Let 4j be the discrete approximation D&

to u(x,) satisfying

the discrete formulation

of (4)

+ k’& = F,

(7)

where Fj = F(x,), and “(3) = +j + 0(h2). We call this formulation, (7), the Pointwise-Representation (PT). There are many more O(h ) formulations like the Weighted-Average or the Exact-Phase representations [7]. Our main interest here is to analyze higher order representations, O(h4) formulations. We use the standard O(h*) method as a starting point. 2.1.1. Higher-order representations A more accurate estimate of (6) is DXXu(xj)= u”(xj) + ; applying

uc4)(xj) + 0(h4)

(8)

OX, to u” we get from (6)

uC4)(xj) = DXxu”(xj)+ O(h*)

(9)

Using (9) in (8) we get DX,u(xj) = u”(x,) + $

(DXXuN(xj) + O(h*)) + 0(h4)

=(l+$DX,)u”(x,)+O(h4). Rearranging

and solving

for cJ’(x,) we get

u”(X,)=(l+$D,,)-‘DXXu(xj)+O(h4).

(10)

So we have an implicit approximation to u” with fourth-order accuracy. We consider the discrete solution of (4) that satisfies the approximation (1 +$DXX)-’

DX,4j + k2qSj= F,

or equivalently

(11) This approximation is called the PadC approximation Applying the definition of D,, in (11) we get F,+,+lOFj+F,_,

*+,+lO&:+$-, Dx,$ + k*

12

Because F is a known function

151.

=

12

(12)

.

we can use another formulation

of (5), applied on the function

F.

I. Singer, E. Turkel I Contput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

D,,F =

5,’

-2Fj+q_,

4Fj+,,,

h2

+ k2

(13)

h’

(1 + h2/ 12 D,,) F, we get instead of (12)

q!x+, + 106 + 4,-l

D&

- 8Fj + 4F,_,,,

=

Using (13) in calculating

345

12

?+I,, =

+ Fj + ?-r/z (14)

3

We call this formulation the High-Order Representation (HO). Another approach to get a fourth-order stencil could be taken by using the fact that u satisfies the Helmholtz equation. Differentiating (4) twice we get (assuming k is constant) U’“‘(X) = F”(x) - k2u”(x) . Inserting

this estimate

(15)

for U(~)(X) into (8)

Using (6) to approximate

F”

The difference between this approximation and (10) is that (10) holds for all u with enough derivatives while (16) is true only for u that satisfies the Helmholtz equation, The discrete solution for (4) now satisfies the approximation

(17) or

Applying

the definition

of D,, and using (13) we get

(18) This stencil is also of high-order These stencils are all symmetric, A,(4,+,

0(h4), and we call it Equation-Based having the same form

+ 4j-1) +Ao&=B.y(F,+r,2

+FJ-112)

(EB).

+B&

where the constants A,, AS, B,, B,? depend on the scheme. We can write these approximations multiplying by h2, for the PT approximation (7) where A, = -2 + k2h2 B,=h2

A, = 1

By = 0

for the HO approximation

(14) 1 A,=1+12k2h2

A,=-2+;k2h2 B, =;

B,v =;

and for the EB approximation

( 18)

(19) in this form, after

346

I. Singer, E. Turkel I Comput.MethodsAppl. Mech. Engrg. 163 (1998) 343-358

A,=-2+k’h”(l-g)

2.2.

A,,=1

Two dimensions

In two dimensions

Helmholtz

equation

is

u,, + u,, + k2u = F(x, y)

(20)

All our stencils use at most nine points. Let +i,j be the numerical approximation be a known function. We wish to have a symmetric stencils in both directions properties has the form: A,h,j

+ A,,?, + A,g

to u(xj, y,), and Fi.j = F(x;, y,) x and y. A scheme with these

= BOF;,,j + B,YJ + B,S

(21)

where ?V =

+i.j+l

+

+i+t.j

+

4,,-1

+

4t-1.j

is the sum of the values of the mid-side ff~ = 4i+l,j+l

+ 4;+1,,-l

+

+i-1.1-l

points and +

4t-l.j+l

is the sum of the values at the comer points.

Similarly

for F we have

~=F;,j+~,2+F,+~/2,j+Fi,,-~,2+Fi-~,2., and C=F;+1/2,j+1/2

+Fi+1,2,j-1/2

A,, A,Y, Ac, are the coefficients

representation

+ FI-1/2,,-,/2

for the stencil,

+F~-~/z.~+LIZ

which will be represented

later in the matrix A, of the matrix

of the stencil.

Aqb=b B,, B,7, B, appear in the vector b. Pointwise representation

Using (6) for the variables

x and y we get the Pointwise

Representation

(PT) in two dimensions

for (20) (22)

Dxx4i.l + Dyu4il.j + k2h., = F.‘,I or 4i+l,j

+

4;i-1.j

This is a five-point A, = -4 B,=h’

+

(hi,,+1

+

&,

representation,

+ k2h2

-

4+i,j + k2h2+;,j = h2F,,j .

with the coefficients

A,‘ = 1

A,=B,=B,=O

This scheme is of order 0(h2). Higher-order

representations

The two-dimensional

analog to (11) is

(23)

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

This may be generalized

to

2 =

+

347

4

k

(Dxx

Dyy) +

+

6

&

DxxDyy

(24)

Fi,j

>

where y, 6 are free parameters selected to further improve the properties in directions other than along grid lines [7]. These parameters do not affect the accuracy of the scheme because they multiply a 0(h4) factor. Dx,Dyy in (24) can be replaced by

(25)

164 - 324 + 64Fi,, D.J’~?F~,j = D~,AFi,, Expressing

=

h4

.

the scheme in the form (21) we get k2h2

2

FQ=~+~( -;)

A,=-~+k”h2(~+~)

Bo=h2(-$+;)

Bs=h2(f_$)

A&++$

B,=h’$.

This HO stencil, similar to the one-dimensional case (14), is of order 0(h4). y and 6 are free parameters but we shall always choose S = 0. The second approach to achieve a fourth-order algorithm is the Equation Based approach. In order to develop the two-dimensional analogue to (17) we have to replace the estimate of ( 15) by u XXIX = FX, - r&X - k2% U yyyy =

Inserting

Ky

-

UKWY

-

k2U,,

this into (8) and adding we get

CD,, + D_Ju = u,, + uyv+ $ =(I

_g>

(F,, + Fyy - 24xyy - k2+,, + uy,N + 0(h4)

(u,, + ~,,a) + ;

ND,, + DJF

- 2DxxDyv4 + 0(h4)

and the O(h4) approximation 2

( Uxx

+

U,y

0,x+

D,,

+

$

2 D,,D,,

=

l-The discrete solution

>

U -

;

Co,,

+

D,,)F

k2h2 12

to (20) now satisfies

(26) In the format of (21) we have

(27)

I. Singer, E. Turkel / Comput.MethodsAppl. Mech. Engrg. 163 (1998) 343-358

348

As in the HO (24) approximation, we can add free parameters affect the accuracy of the scheme. We omit these parameters 2.3. Approximations

which multiply factors of order 0(h4) and do not here for simplicity.

of the boundary

We wish to approximate the boundary conditions, with the same accuracy as the interior. For the PT stencil we can use O(h*) approximations, and for the HO and the EB stencils we need O(h4) approximations. We wish the boundary approximations to be symmetric and use only the nearby points, since these kind of stencils have useful properties. For the Dirichlet boundary condition (2), we can simply use the function f(x) which is known along the boundary for the approximation, and have for every point on the boundary 4t.j

(28)

=.AxiYYj)

This is the exact value of the point and it is suitable One dimension We assume that a Neumann becomes u’(x,) = g( g a constant)

boundary

condition

for all the interior

schemes.

is specified at the left boundary

.

of the interval (at x,), so (3)

(29)

As an intermediate step we introduce the point x_,, which we will eventually eliminate. We do not have equations at this artificial point but we have two sets of equations at the point x,,. We have the Neumann boundary,condition and we also treat this point also as an interior point. We then use these two equations to eliminate the point x_ , . We approximate (29) by 2 'Cxj+,)

-

u(xj-l)

= u’(x,) + $

2h Differentiating

(4) we have

u”‘(X,) = -kL’(X,)

'('j+l)

-

+ F’(x,) .

u(xj-l)

2h Rearranging,

cP(xj) + 0(h4) .

= u’(x,) +;

(-k2ur(x,)

+ F’(x,)) + 0(h4) .

we have for u’(x,)

and at j = 0, we have an O(h4) approximation

for the boundary

We write this as A,(c#&Q=A,(Zhg(l-q)+;F;).

(31)

Using (19) with j = 0 we have A,(~,+~_,)+A,~~==B,(F,+F-,)+B,F,. Adding (31) to (32) and applying for the boundary point

the standard O(h*) approximation

(32) for FL, we get the desired approximation

349

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

+a,~“=2A.~hg( -qg+(Bs+A,$)F, +(B.-A,$)F_, fB,F,.

2A,4,

from F in the interior using suitably accurate extrapolation.

F_, is either known or else can be calculated approximation is of order O(h4). Two dimensions For simplicity x=0

-au dX

we shall consider a rectangular

domain, and assume a Neumann

boundary

condition

(34)

U(X;+,rYj) - u(xi-I? Yj) 2h Differentiating

This

on the line

x=o = l?(Y).

We introduce the line i = - 1, which we will eventually (30) for the point (xi, yj)

eliminate. We begin with the two-dimensional

analog of

2

= u, + x

u,,, + 0(h4) .

(20) with respect to x we have xyy - k2u, + F, .

u XXX =-u Hence,

4x,+,*

Yj)

‘Cxi-LTYj)

-

2h Solving

(33)

=u,+h2

-

%Y - k2u, + F, 6

+ 0(h4)

for U,

u, =

a+,

Y,> -

‘(xi-I> Yj)

h2 + 6 (uxyv + k2u, - F,) + O(h4) .

2h

(35)

and U, in order to conserve the overall accuracy. For uIVYwe can aPPlY to uXYY

We need an 0(h2) approximation (30) on 0,” (5) and get uWY=

u(x,+,, Yj+~)-2u(xi+,,Yj)+u(xi+l’Yj-l’ 2h3 -

U(Xi_l>

Yj+l>

-

2u(xi-,3

Yj) + ‘(‘i-I?

Y]-1) + 0(h2)

2h3 and for u, we can use u, = zz ZZ

U(xi+]7 Yj> - u(xi-L’Yj) + 0(h2)

2h u(xi+l? Yj) - dxi- ITYj) 2h

+ ph*u,,,

(1 - 2/-L)(u(xi+*Y Yj> - ‘b-l* 2h

for arbitrary p. Inserting 2&, = 4,,

-2Pu)(+,,j-

where fix is the exact value of aF/ && we can write

Yj>)

‘Cxi+l? Yj+l) + ‘(‘i+IT

Yj_l)

+P

into (359, multiplying

-4-l,j++(4l.j+1

+$k2h2((l

+ O(h2> -

u(xj-I?

Yj+l> - u(xi-l~ Yj-1)

2h by 2h, and setting i = 0

- 2+,,j + +l,j-1 - (6l,j+l 4-l,j)+Pu(+1,,+1

++I,~-I

- 2+-l,j -~-I,,+I

or a suitable 0(h2) approximation.

+ +-l,J-l)) -4_,,,,,-Sri This stencil is of order W4)

which

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

350

3

(36) Noting again that p is arbitrary

we have

,. 2 1 As = 3 + 6 k2h2( 1 - 2~) The standard interior

(37) (21) on the line i = 0 can be written

approximation

A.rC4l.j + 61.j + A,j+l + &,,-I)+A~(~I,,+I =

+

4l,j-1

+

4-*,j+l

+

hl,j~l)

+A040,j

BoF,, + B,y< + Bee.

(38)

we would like to merge these last two equations

and eliminate

all elements

with i = - 1. In order to do so we

need a constant (Y such that if we multiply (36) with (Y and add to (38) then &r,j,

&r,j+l

and +-l.j-I

will not

appear. This (Y should satisfy

or A a=+=+. As

A. AC

We solve this equation

and find that (Y exists if

or + ,uk2h2(A,7 + 2AJ

= + k2h2Ac + 5 A, - + A,

(4 + k2h2)A, - A,y ,uk2h2 =

A,y+2Ac



We choose p to satisfy the last equation. 2 1 A,y=~+~k2h2-~ n

Then, we get in (37)

1 (4 + k2h2)A, - A, A, + 2A,

=(l+F)A,+A;A,

(39)

Adding

(36) and (38), using (39), dividing

As4l.j +A,(4,,j+,

+ 4,j-,)+~A,~(&,j+~

by 2 we get our desired O(h4) approximation at i = 0 + k,j-,)+~A,,h,j

=~B,Fo+~Bs~+~BcI;:+cr(hgif~~x). A

and B are given from the interior

scheme (38).

(40)

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

351

3. Properties of the matrix The continuous

problem

has eigenvalues,

for the Dirichlet

problem,

s, t = 1,2, 3 . . .

A,?,,= k* - (s2 + t2)

(41)

The largest eigenvalue is A,., = k2 - 2. So for k > K, = & = 1.414 the problem is indefinite. For the Neumann boundary condition we consider u, = 0 at x = 0, and a Dirichlet boundary condition, at the other three borders of the rectangle x = 7r, y = 0, rr. The eigenvalues are given by /\ ,s,,=k2-((s+;)2+t2)

s=O,1,2,3...

r-1,2,3...

u = 0,

(42)

Now the largest eigenvalue is h,,, = k2 - 5 /4. The problem is indefinite for every k > K, = &/2 = 1.118. We shall now calculate the eigenvalues of the approximation for the Dirichlet problem. Using any of the approximations to the term A + k2 in the (21) form, we get A,&;;

+A,&qb’;:,,, + +f&

+ &;;+, + &,‘-,)

+ +.;;,,j-,

+Ac(4:il,j+l

+ g.l,,j+l

+ 4.;‘r,,j_,)

= h2A,,,&y

(43)

where A,,, are the desired eigenvalues and 4:;; are the eigenfunctions of the scheme at the gridpoint (ih, jh). A ,,, As, A, are defined in (23) for the PT scheme, (26) for the HO scheme and (27) for the EB scheme. The factor h2 multiplies h,r,, because A,, A,, A, were obtained from approximations to A + k2 after multiplying by h2. Using the eigenfunctions c$:,: = sin(&)

sin(@)

which satisfy the homogenous

Dirichlet

CJfC,., + +.Y,,j + &,f+,

+ qq_*

boundary

conditions,

we get on the edge of the stencil

= sin(s(i + 1)h) sin(@) + sin(s(i - 1)h) sin(tjh) + sin(sih) sin(t(j + 1)h) + sin(sih) sin(t(j - 1)h) = 2(cos(sh) + cos(th))+f;f

(44)

and in the corner of the stencil l#$L,,,+, + +::,,j-,

+ &.f,,j+,

= sin(s(i + 1)h) sin(t(j

+ 4:&i

+ 1)h) + sin(s(i + 1)h) sin(t( j - 1)h)

+ sin(s(i - 1)h) sin(t( j + 1)h) + sin(s(i - 1)h) sin(t( j - 1)h) .

= 4 cos(sh) cost;;; Inserting

(45)

(44) and (45) into (43) we get for A,,, A, + 2A,(cos(sh)

+ cos(rh)) + 4AC cos(sh) cos(fh)

A,,, =

(46)

h2

Using a Taylor expansion

we get for sufficiently

small values of h

A, + 4A,s + 4A, L

=

h2 + $

- (s2 + t’)(A, + 2AJ

((s4 + r4)(A,y + 2AJ + 12A,s2t2) + O(h4).

For the PT scheme we have A,, + 4A,V+ 4AC = h2k2, for the HO scheme:

AS+2A,=1,

A, =0

(47)

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

352

1 Y A, = yj + h2k2 144

h2k2

A, + 4A, + 4A, = h2k2,

A,y+2A,=1+y,

and for the EB scheme: h4k4

A,+4A,+4A,+h2k2-7, Using these formulations

A, + 2A, = 1,

AC=;.

in (47) we get for the PT scheme:

A;,; = k2- (s2+ t2) +

$ (s4+ t”) + O(h4)

for the HO scheme: h 2;

= (k2- (s2+ t’)) 1 - $

(s2 + t2) + O(h4)

>

and for the EB scheme: A E;=(k’-(s2+t2))

1-~(s2+t2+k2)+O(h4)

>

.

The eigenvalues we found are approximations of order O(h’) to the differential schemes even though HO and EB are fourth-order accurate to the scheme. We now have to solve the classical problem of linear algebra A4=b.

problem

(41) for all the three

(48)

The matrix A is of a very large order, and we need to use a computer algorithm in order to get the solution 4i,j. There are many matrix solvers algorithms. For the results obtained here we have used by Gauss elimination and various conjugate residual iteration methods. One possibility is to use a preconditioned conjugate gradient method on the normal equations (see [2,3]). In this study a biconjugate gradient method was used (see for example [ 11).

4. Numerical

results

We examine the behavior of the three schemes we developed on two model problems in two dimensions. One is a pure Dirichlet problem in a square and the second one is the same problem but with a Neumann boundary condition on one side of the square. Even though the numerical examples use model problems, they illustrate the benefits to be expected for more realistic problems. We keep in mind that the relationship between k and h is more complicated than just the number of points per wavelength [4]. We now introduce the two model problems. The first one we call the ‘D-Problem’, and the second one the ‘N-Problem’. In both problems the Helmholtz equation is OSXSIT,

Au + k2u = (k2 - 5) sin x sin 2y In the ‘D-Problem’

we solve (49) with the boundary

OSySn

(49)

condition

u(0, y) = u(n, y) = U(X,0) = u(x, n) = 0

(50)

and in the ‘N-Problem’ u(rr, y) = (x, 0) = u(x, n) = 0 In both these problems

u,(O, y) = sin(2y) .

the exact solution

(51)

is

u(x, y) = sin x sin 2y .

(52)

We solved these problems

using the schemes PT (22), and HO (24) with y equal to: 0, 0.4, 1, 2, 2.8 with

353

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

6 = y, and EB (26). We used the symmetric high-order (40). We used a uniform grid of size h with h = n/N. Are the schemes

We compared e;,j = @i,

In the following

approximation

for the Neumann

boundary

condition

really high-order?

the numerical

solution

&

to u(xi, yj) where u is the exact solution

(52). The error vector e is

Yj> - 4z,j

tables we present the 1, and l,-norms

of the error for the ‘D-problem’

with k = 6.4.

I,-norm:

and /,-norm:

Thus, llellr is comparable Results for D-Problem,

with Ilel12.The HO scheme was run with y = 2.

k = 6.4

N

lid

PT

k% PT

k% HO

lIelIt HO

kllr EB

lellz EB

4 8 16 32 64 128

2.20E-2 5.92E-3 1.51E-3 3.79E-4 9.49E-5 2.37E-5

l.lOE-2 2.96E-3 7.54E-4

3.808-2 2.398-3 1.49E-4 9.29E-6 5.80E-7 3.63E-8

1.90E-2 1.20E-3 7.45E-5 4.65E-6 2.9OE-7 l.SlE-8

1.32E-2 2.43E-3 7.35E-5 4.07E-6 2.48E-7 1.54E-8

5.66E-3 1,.22E-3 :~.66E-5 :!.04E-6

1.89E-4 4.74E-5 l.l9E-5

1.24E-7 :‘.67E-9

In all the schemes the norm of the error decreases, as the number of gridpoints increases. We clearly see that the norm of the error behaves like the order of the scheme. As we multiply N by 2 (divide h by 2) the norm of the error decreases by 4 for the PT scheme and by 16 in the HO and EB schemes. This is also true for the ‘N-Problem’ as we can see in these results for k = 6.4$: Results for N-Problem,

k = 6.4

N

l141x fl

II4 m

llell= HO

lIelIz HO

/kllm EB

i/d EB

4 8 16 32 64 128

2.20E-2 I .07E-2 6.26E-2 1.51E-3 3.51E-4 8.73E-5

l.lOE-2 4.01E-3 3.17E-2 5.98E-4

8.62E-2 1.99E- 1 1.25E-3 7.88E-5 4.92E-6 3.09E-7

3.72E-2 l.l2E-1 5.98E-4 3.53E-5 2.20E-6 1.37E-7

l.l9E-2 2.44E-2 l.l4E-3 7.04E-5 4.47E-6 2.80E-7

7.10E-3 1.13E-3 5.448-4 3,37E-5 2.10E-6 1.31E-7

1.38E-4 3.40E-5

We can see that for the ‘N-Problem’ the schemes do not yield reasonable solutions accuracy only when h is small enough (in these examples for N 2 16). In all the D-Problem results we find that

II4 II4

-2.2.

for large h, and we see their

(53)

This is also true for other values of k and other values of y in the HO scheme. So it is necessary to check only one of these norms, for instance Ilellm. We wish to computationally verify the order of the scheme. So we assume that for small h,

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

354

C(k)N’ = C(k)dh’

//e/la =

(54)

where r is the order of the scheme, i.e. 2 r =(4

if scheme = PT if scheme = HO or EB

Let N = 2’, then -log,(llell,)

= 1. ord(scheme)-log,

C(k) .

(55)

Hence, we calculate the order of accuracy, r, by measuring the slope of the curve. Alternatively, if R, = I(& for a mesh with N points then r = log(2)R,/R,,,. We verify (55) using Figs. l-3 for the D-Problem, which presents -log2jle/, f or various k. In these figures the parameter of the HO scheme y = 6 is denoted by p. We see that for small values of k our assumption (55) is correct, but as k grows, the schemes begin to act differently. While we can see a difference between the different values of y in Fig. 1, as k grows the schemes HO behaves the same way for all 7, as seen in Figs. 2 and 3. For all values of k for PT and HO schemes we get the estimate (55). For small values of k the HO scheme is always more accurate than the PT scheme, but as k grows, C(k), which is defined in (54), grows more for the HO schemes, and the PT becomes more accurate

::

HOp=0.4

.++.HO p=l +

Hop=2

+

HOp=2.8

+EB 2

3

4

5

6

7

h#J) Fig.

I. D-Problem, k = 1.6,I, norm.

30 25 20 g

15

v

10 5 0 2

3

4

5

6

log(N) Fig. 2. D-Problem,

k = 6.4, 1, norm.

7

I. Singer, E. Turkel

I Comput. Methods Appl. Mech. Engrg.

163 (1998) 343-358

30

355

25

-tPT ...@ ....HOp=O

20

...+.;... HO pzO.4

z

15

.....+. HO p=l

F

10

+.-Hop=2 +...HOp=2.8

5

+EB

0 2

3

4

5

6

7

k$N Fig. 3. D-Problem,

k = 25.6, 1, norm.

compared with HO for large values of h. When h decreases HO becomes more accurate. For the EB scheme we discover an interesting phenomenon as can be seen in Figs. 2 and 3. When k increases, for large values of h, it behaves like the PT schemes with O(h2) slope. Nevertheless, it is still more accurate than the HO and the PT schemes. For values of h when the HO scheme is more accurate than the PT scheme, the EB scheme starts to be of O(h4) accuracy as expected, and is more accurate than the HO schemes. We can explain this phenomenon by the fact that the approximation of the interior in the EB scheme (26) includes the factor 1 - (k”h2)/ 12 which we assumed to be of order 0( 1). When k is large, for example k = 25.6 which is shown in Fig. 3, we get

N

4

8

16

32

64

128

1 - (k2h2)/12

-32.69

-7.42

-1.10

0.47

0.87

0.97

We see that we really have O(h X 4) order of convergence for N 2 32 (or for log,(N) > 5). For the N-Problem we do not find the simple ratio of (53). So it is necessary to calculate both the 1, and the 1, norms of the error. In Figs. 4-7 we plot -log,llell, against log,(N), similar to what we presented for the D-Problem in Figs. l-3.

30

-+-PT

25

-.+..a

20

HOp-0

.;::.. HOp=O.4 g

15

$

10

..._% __..._ HOp-1 s+.... HOp=2

+ 5

-4-EB

0 2

3

4

5

6

log(N) Fig. 4. N-Problem

k = 1.6 1, norm

7

HOp-2.8

356

I. Singer, E. Turket J Comput. Methods A&.

2

3

4

5

Mech. Engrg. 163 (1998) 343-358

6

Fig. 5. N-Problem

k = 6.4 1, norm.

Fig. 6. N-Problem

k = 12.8 I, norm.

Fig. 7. N-Problem

k = 25.6 I, norm.

7

1. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg.

351

163 (1998) 343-358

From Fig. 4 we see that for small values of k that the schemes behaves as expected from (55) as with the D-Problem. The first deviation occurs in Fig. 5 when k = 3.2, when all the schemes are inaccurate. The reason for this phenomena is that k = 3.2 is very close to an eigenvalue of the differential Poisson problem (k =:0) with the same boundary conditions (51). Taking s = t = 2 in (42) we get Ih2,21= 13.2*-(2* + 2.5*)1 = 0.01 When the problem has an eigenvalue close to zero, the matrix is almost singular and the problem is not stable. For accuracy we need to take finer meshes. As k increases the schemes appear to lose their high-order behavior, as we can clearly see in Fig. 7. For such large values of k in order to maintain the accuracy we need to take much smaller values of h. The behavior of the EB scheme is similar to what we discovered for the D-Problem. For this problem also we find that for large values of k the EB scheme behaves like the PT scheme for small values of h, but in most of the cases it does not effect the accuracy of the scheme. The I, norm behaves in the same manner as the I, norm and so is not presented here.

4.2.

Which scheme is better?

In Figs. l-7 we examined the error using the schemes for a fixed k with various h. We now examine the term C(k) in (54), to determine which scheme we should use for different values of k. We see in Fig. 8 that for

0.00006

0.00007

0.00006

0.00005 z t

0.00004 -S--HO

0.00003

p=2.8

0.00002

0.00001

0

2

6

4

10

8

14

12

k

Fig. 8. C(k) for the D problem,

N = 32.

0.009 O.OOB 0.007 0.006 ___BBs_ HO p-O.4 0.096 3

0.004 0.003 0.002 0.001 0 6

8

10

12

k

Fig. 9. C(k) for the N problem,

N = 32.

14

I. Singer, E. Turkel I Comput. Methods Appl. Mech. Engrg. 163 (1998) 343-358

358

3.99

4.00

4.01

4.02

4.03

4.04

4.05

4.06

4.07

k

Fig. 10. C(k) for N problem,

N = 32 near k = 4.031129.

k < K, = & the schemes are more accurate than we get for larger values of k, where our problem becomes indefinite. We can also see that as k increases (k > 6.4) all the HO schemes behave similarly and the EB scheme is slightly more accurate. In Fig. 9 we plot C(k) for the N-Problem. The results for the N-Problem show that it is much more sensitive to the value of k than the D-Problem. This occurs because the N-Problem is more sensitive to its eigenvalues. Figs. 8 and 9 are made based on results where 0 C k S 12.8, k varies in units of 0.8. We zoom into Fig.9 near k = 4.031129 with the scheme EB. Taking s = 3 and t = 2 in (42) we get Ih3,21= 14.031129’ - (3.5’ + 2’)) = 0.0001 . We see in Fig. 10 that near k = 4.031129 where I& -0, the problem is unstable and the scheme gives poor accuracy. For the D-Problem this phenomenon is less significant and occurs only near small eigenvalues. 5. Conclusions Two high-order nine points finite difference schemes for the Helmholtz equation were developed. One is based on generalizations of the Padt approximation. The second uses the Helmholtz equation to calculate high-order correction terms. These fourth-order schemes were analyzed and compared to the standard second-order finite difference scheme. A high-order symmetric representation, independent of the interior scheme, was developed for the Neumann boundary condition. Numerical results have been presented for the Helmholtz problem with two types of boundary conditions: pure Dirichlet boundary condition and a mixed Dirichlet-Neumann boundary condition. The results show that the high-order schemes give the expected accuracy. We discussed how the schemes behave for various values of k and h. References [l] R. Barrett et al., Templates for the Solution of Iterative Systems (SIAM, Philadelphia, 1994). [2] A. Bayliss, C.I. Goldstein and E. Turkel, An iterative method for the Helmholtz equation, J. Comput. Phys. 49 (1983) 443-457. [3] A. Bayliss, C.I. Goldstein and E. Turkel, Preconditioned conjugate gradient methods for the Helmholtz equation, Elliptic Problem Solvers II (1984) 233-243. [4] A. Bayliss, C.I. Goldstein and E. Turkel, On accuracy

conditions

for the numerical

computation

of waves, J. Comput. Phys. 59 (1985)

396-404. [5] L. Collatz, The Numerical Treatment of Differential Equations, 3rd edition (Springer-Verlag, Berlin, 1960). [6] I. Harari, Accurate finite difference representation of Neumann boundary data for time-harmonic wave propagation, J. Comput. Acoust. 4 (1996) 425-432. [7] I. Harari and E. Turkel, Accurate finite difference methods for time-harmonic wave propagation, J. Comput. Phys. 119 (1995) 252-270.