Solution of the Poisson equation by differential ... - Wiley Online Library

5 downloads 0 Views 542KB Size Report
May 6, 2019 - and Patankar' compared solutions of the two-dimensional Poisson equation ... This set has a unique solution for the weighting coefficients, uij, ...
INTERNATIONAL JOURNAL FOR NUMERICAL METHODS IN ENGINEERING, VOL. 19, 71 1-724 (1983)

SOLUTION OF THE POISSON EQUATION BY DIFFERENTIAL QUADRATURE FARUK CIVAN AND C. M. SLIEPCEVICH

University of Oklahoma, Norman, OK, U.S.A.

SUMMARY The method of differential quadrature is demonstrated by solving the two-dimensional Poisson equation. The results for three test problems are compared with the exact analytical solutions and the numerical solutions obtained by others for the Galerkin, the control-volume and the five-point finite difference methods. The method of differential quadrature leads to more accurate results for comparable levels of computational effort.

INTRODUCTION Many applications of the Poisson equation to transport processes require numerical solutions which usually are based on some version of finite elements or finite differences. Ramadhyani and Patankar' compared solutions of the two-dimensional Poisson equation by the Galerkin, control-volume and five-point finite difference methods and concluded that the control-volume method produced the most accurate results. The purpose of this paper is to demonstrate the application of the method of differential quadrature to the identical test problems used by Ramadhyani and Patankar so that direct comparisons could be made with both their analytical and numerical (conventional methods) results. Bellman' introduced the method of diff erential quadrature and applied it to one-dimensional, initial value problems. Subsequently, Mingle6 applied the method to one-dimensional, initialboundary value problems. In this paper, the method is extended to the two-dimensional, boundary value problem. APPROXIMATION OF DERIVATIVES BY DIFFERENTIAL QUADRATURE Consider xi: i = 1 , 2 , . . . ,N are the sample points obtained by subdividing the x-variable into N discrete values and f(xi) are the function values at these points. If aij are the weights to attach to these function values at the sample points, the values of the function derivatives at these points are approximated by a weighted sum of the function values at these points as expressed by the following quadrature formula:'

To calculate the weighting coefficients the function f(x) is represented by an appropriate analytical function, such as a polynomial, f(x)=xk-*;

0029-5981/83/050711-14$01.40 @ 1983 by John Wiley & Sons, Ltd.

k = 1 , 2 , . .., N

(2)

Received 6 July 1981 Revised 23 March 1982

712

F. CIVAN AND C. M. SLIEPCEVICH

and its derivative,

af(x)/ax

= (k - l)xk-’

(3)

Substituting equations (2) and (3)into equation (l),N linear algebraic equations are obtained: N

c ui,.xjk-l = ( k - - l ) x f - ’ ;

j=l

k =1, 2 , . . . , N

and i = 1 , 2 , . . . , N

(4)

This set has a unique solution for the weighting coefficients, uij,because the matrix of elements is a Vandermonde matrix whose inverse can be obtained analytically as shown by Hamming.’ According to Bellman et d.,’the approximation formulae for the partial derivatives of second (and higher) order are obtained by iterating the quadrature approximation formula for the first-order partial derivative, given by equation (1).Hence, for example, the secondorder partial derivative approximation formula is derived from equation (1)by replacing f ( x ) by af(x)/ax,

In order to reduce the complexity of the derivative approximation formulae and thereby conserve on computational effort, it is advantageous to use quadrature approximation formulae for also the second6 and higher order derivative^.^ Of course, the weighting coefficients for each formula will be different from those for the first-order derivative. (This approach does not appear to be feasible for mixed partial derivatives, however.) Thus, for example, the second-order partial derivatives can be approximated by a linear weighted sum of function values at the sample points as

in which bij are the weights attached to the function values at the sample points. As before, the weighting coefficients can be obtained by a procedure similar to that for equation (1). Again, the function given by equation (2) is used so that the second-order derivative is d z f ( x ) / d x 2 = (k - I)(& -2

) ~ ~ - ~

(7)

Substituting equation (2) and (7)into equation (6) results in a set of N linear algebraic equations for the weighting coefficients, bij, N

C bijx;-’ =(k - l ) ( k - 2 ) ~ : ~ ~ k; = 1,2,. ..,N and i = 1,2,. .. ,N

(8)

j=l

This equation can be solved in the same manner as indicated for equation (4) above. The derivative approximation formulae derived for a function of one variable can be extended as follows for a function of two variables:

SOLUTION OF POISSON EQUATION

713

where Nr and N Y are the number of sample points in the x- and y-directions, respectively. The second-order derivative approximation formulae are

NY

c bykf(Xi,yk)

(12b)

k=l

Similar formulae can be developed for all of the partial derivatives of any order for multidimensional systems,' but they will not be presented here since they are not needed for the examples which follow. APPLICATION O F APPROXIMATION FORMULAE TO POISSON EQUATION The following summary of the application of differential quadrature is general and, therefore, is not problem dependent. Although the technique illustrated below is specifically for the two-dimensional Poisson equation, it can be readily extended to the three-dimensional case. Consider the two-dimensional Poisson equation in normalized form:

where p = L / H represents the aspect ratio and 0 s x , y s 1. Here the dimensionless quantities are given by x =X/L

q5=$

ifS=O

t 14)

(16b)

where 4, the dependent variable, is a function of the space co-ordinates, X and Y, and S represents a given source strength. L and H are the characteristic lengths of the physical domain in the X and Y directions. For numerical solution the two-dimensional rectangular grid system of Figure 1 is formed by subdividing the x and y variables into N" and N Y discrete values, respectively. The spacings need not necessarily be equal; however, in this study they are assigned equally. The resulting discrete points in the x and y directions are indicated by subscripts i and j , respectively. Then the partial derivatives of the function, q5 (x, y), are replaced by the approximation formulae throughout the Poisson equation and the derivative boundary conditions to obtain a set of linear algebraic equations which can be solved using any appropriate methods. To utilize differential quadrature, two options are available. The first approach' is to replace the second-order partial derivatives with respect to x and y variables in equation (13)by the

714

F. CIVAN AND C. M. SLIEPCEVICH

7

h

2

I i - 4

i

----L

i = f , Z , . . . ,N Figure 1. The unit square region and the grid for the normalized Poisson equation

approximation formulae ( I l a ) and (12a) to obtain NY

NY

in which the following shorthand notation is used for convenience: dii=-4(xi, y j ) and Sij=S(xi, y i ) . The second approach6 is to replace the derivatives by the approximation formulae ( l l b ) and (12b), respectively:

Of the two approaches, the latter saves appreciably on computational effort but requires ) additional storage for the bii's. Both the equations (17a) and (17b) contain ( N x ) ( N Yfunction values, some of which are the prescribed boundary values given by Dirichlet conditions and others by the boundary conditions involving the function derivatives, such as Neumann or mixed boundary conditions. The first step for the numerical model is to separate terms that are associated with the known boundary values and move these terms, as well as the source term, to the right of equation (17a) or (17b). The terms associated with the interior points, as well as the boundary points upon which boundary conditions involving function derivatives are imposed, must be collected on the left-hand side of equations (17a) or (17b). As a result, these equations can be represented by

g . . = h.. 11

(18)

11

which can be written as

ag-

P

C 3 d r n= h,; 4 a4rn

i = 2 , 3 , . . . , (N"-1)

and j = 2 , 3 , .

. . ,(Ivy-1)

(19)

Here, p and q are indices for those mesh points where the function values are to be calculated. In equation (19), agij/aq5, are the elements of the Jacobian matrix obtained from gii. For the first approach, they are given by

SOLUTION OF POISSON EQUATION

715

and for the second approach,

agij/a4,

= ajqb;

+si&'b;q

(20b) Here, S,, are the Kroneker deltas whose values are equal to 1when rn = n but 0 when rn # n. The Jacobian matrix elements are constant numbers and have to be calculated only once for the Poisson equation. However, equation (20b) is preferred for relatively large mesh systems to conserve on computational effort. Since the elements of the Jacobian matrix are constant values, equation (19) represents (N"- 2 ) ( N y- 2) linear algebraic equations. If these equations also contain the boundary values defined by conditions involving function derivatives, such as the Neumann or mixed type, in addition to the interior region function values, the function derivatives in these boundary conditions also need to be replaced by the quadrature approximation formulae to obtain an algebraic relation for the boundary values. For example, consider a boundary condition expressed by

ad(X, Y ) / a Y = f ( x > at Y = 1

(21)

where f ( x ) is a given function. Replacing the function derivative in equation (21) with the differential quadrature approximation given by equation (10) one obtains

After collecting the term associated with the known boundary value (if there is any at all) on the right, equation (22) can also be expressed in a form similar to equation (19),

where the Jacobian matrix elements are given by

agiNy/a4, = &,a 'N,Y

(24)

Other types of boundary conditions involving the function derivatives can be treated similarly. The resulting set of algebraic equations are solved simultaneously using, for example, a Gaussian elimination technique for the unknown function values at points (p, 4). However, in the application problems presented next a slightly different approach will be used to reduce the size of the matrix equation that needs to be solved for the unknown function values. For this purpose, equation (22) is solved first for the unknown boundary values as

Using equation (25) the unknown boundary values will be eliminated throughout the discretized Poisson equation (17a) or (17b). In this manner the number of equations to be solved is reduced because equation (23) is not required any longer. The resulting equation can be expressed in the form of equation (19) according to

ag.. 1 -1L4pq=hij; q = 2 a4m

( N x - 1 ) (Ny-1) p=2

i = 2 , 3 , . . . , ( N x -1) and j = 2 , 3 , . . . , ( N y-1)

7 16

F. CIVAN AND C. M. SLIEPCEVICH

which contains only the function values for the interior region. Upon simultaneous solution of equation (26) the unknown boundary values are obtained from their corresponding expressions, such as equation (25). Because the expressions for the Jacobian matrix elements contain the Kroneker deltas, the resulting Jacobian matrix contains many zero elements and therefore is not a 'full' matrix. One may, of course, take advantage of this situation to develop special matrix solvers to reduce the computing effort and to increase the accuracy of numerical solutions. However, for the sizes of the matrices encountered in the test problems which follow, a Gaussian elimination type of solver for a set of linear equations with a full coefficient matrix is acceptable. TEST PROBLEMS Three test problems involving the Poisson equation, which are identical to Ramadhyani and Patankar,' will be used to demonstrate the quality of the numerical solutions by the method of differential quadrature. Both of the aforementioned approaches were used for each test problem; as would be expected the results were identical. Therefore, in the interest of brevity, only the procedure for the first approach will be presented for the first problem and only the procedure for the second approach will be presented for the second and third problems.

First problem Consider the following problem in normalized form:

-+p a24 ax

2a24 y=o;

Osx,ysl

aY

The exact solution in normalized form is given by

4 = sinh [wy/(2@)]. sin (m/2)/sinh [7r/(2/3)]

(32)

Replacing the partial derivatives with the approximation formulae given by equations (9), ( l l a ) and (12a), the model equations (27)-(31) reduce to

4il=O; i = 2 , 3 , . . . ,N" 4N i Y = sin (7rxi/2); i = 2,3, . . . ,N" 4lj=O; j = 1 , 2 , . . . , N Y

(34)

SOLUTION OF POISSON EQUATION

717

By virtue of equation (36), equation (37) leads to the following expression for the value of the function on the symmetry boundary,

Using equations (34)-(38) and rearranging, equation (33) reduces to the following set of algebraic equations:

for i = 2 , 3 , . . . , (N"- 1), and j = 2 , 3 , . . . , ( N y- l),in which the elements of the Jacobian matrix are given by

and NY

hij = -p2 sin (rxi/2)

1 a&& 1=1

Solution of equation (39) has been accomplished with subroutines DECOMP, SOLVE and SING given by Forsythe and Moler? which utilizes the method of Gaussian elimination, on the IBM 370/158 computer facility at the University of Oklahoma. Numerical calculations have been carried out using uniform grid systems, 5 x 5 and 7 x 7. A local error, defined by =- Idexact -4computedl

E

(42)

was calculated at every point of the uniform grid. , the maximum To facilitate comparisons, only the errors at the centre of the domain, E ~ and are shown in Figure 2 for various values of the aspect ratio L / H . error in the domain, E-, These results are compared directly with those reported by Ramadhyani and Patankar.7 It is evident that the method of differential quadrature using a 7 X 7 grid results in much lower errors than are obtained by the conventional finite element and finite difference techniques using a 7 x 7 grid.

Second problem The governing equations for the second problem in normalized form are

C#l(x,O)=O;

Ocxsl

l ) / a y = 0;

Oax s 1

4(0,y)=O;

Oayal

a4 (I,y)/ax = 0;

o =S y a 1

a&(X,

718

F. CIVAN AND C. M. SLIEPCEVICH 10.0

?$--.,

1.0

. . ... 0.

'0

0.1

\

-

\

l o 3 E,

0.01

x-.-

X Galer

in(7X7) Ref.7

+-+Control 0

volume(7X7)

Ref.7

5-Point f i n i t e d i f f . ( 7 X 7 ) Ref.7

0---ODiff.

quad.(5X5)

O--aDiff.

q u a d . ( 7 ~ 7 ) p r e s e n t work

I

I

0.001

0.25

p r e s e n t work

I

0.75

0.50

I 1.0

L/H

Figure 2(a). The centre-point error for the first problem

The exact solution in normalized form is given by

4

1 =-(2P2 1-y2-4

a0

C (-1)" cosh (A,@x)cos(A,y)/[A:

cosh ( A d ) ] }

n=O

where A, = (2n + 1)7~/2. For numericalsolutions, the partial derivativesare replaced with the approximationformulae given by the equations (9), (lo), (Ilb) and (12b). By rearrangingthe model, equations (43)-(47) are reduced to the following set of algebraic equations:

for i = 2 , 3 , . . . , (N' - 1) andj = 2 , 3 , . . . , (IVY- l),in which

agij/a4,

= 6jq(b;,,- b~N=U&x,/U&XNX)+6i,@2(biq- b & y U L Y q / U h y )

(50)

SOLUTION OF POISSON EQUATION

719

The right of equation (49) is simply hij = -1. The function values along the symmetry boundaries are calculated by

( z2 (Nx-1)

4NY= -

akxk#kj)/akxNx

(51)

and

The solution of equation (49) has been carried out using the same subroutines and grid systems as in the first problem. For various values of the aspect ratio L / H , the results in terms of the centre-point error c 0 and maximum error E,, obtained via the differential quadrature method are presented in Figure 3. Again the errors for differential quadrature with a 7 x 7

720

F. CIVAN AND C. M. SLIEPCEVICH

grid are lower than those obtained by the conventional finite element and finite difference technique using a 7 x 7 grid. In Figure 3(a) it should be noted that the centre-point errors for the finite element and the finite difference techniques increase with increasing aspect ratio; although this behaviour is anomalous, Ramadhyani and Patankar do not offer any comment. On the other hand, the maximum errors for the conventional techniques, shown in Figure 3(b), demonstrate normal behaviour. By contrast, both the centre-point and maximum errors produced via differential quadrature solutions exhibit the expected decreases with increasing aspect ratio. However, it is somewhat surprising to find that the 5 x 5 grid for differential quadrature gives smaller centre-point errors than the 7 x 7, as can be seen in Figure 3(a), whereas for the maximum error the 7 X 7 differential quadrature is more accurate than the 5 x 5 according to Figure 3(b).

c 0 . -. 11

.-N .

x--

\\

+ \ \

\ \

\

\

'\

\

0

\

\

0.01

t-

X-.-x

G a l e r k i n ( 7 X 7 ) Ref.'

+ -+ C o n t r o l

volume( 7x7) R e f . 7

5-Point f i n i t e diff.(7X7)

0.001

i

Ref.7

O---ODiff.

quad.(5X5)

present work

o--aOiff.

quad.(7X7)

p r e s e n t work

I

I

I

I

1

I

I

I

Figure 3(a). The centre-point error for the second problem

SOLUTION OF POISSON EQUATION

100.0

0.1

n t

x-.--ry

Galerkin(7X7) Ref. 7

+-+Control

volume(7X7)

Ref. 7

5-Point f i n i t e diff.(7X:)

o---oOiff. o--nOiff. 0.01

72 1

I

I

Ref.7

quad.(5X5)

p r e s e n t work

quad.(7X7)

p r e s e n t work

I

I

I

I

I

I

Third problem This problem has been formed by considering a square region between two concentric circles of radii, rl and r2, and treating the one-dimensional problem in polar co-ordinates like a two-dimensional problem in Cartesian co-ordinates for a source strength, S,equal to zero. Moving the Cartesian co-ordinates to X1= Y1= r l / J 2 point and using equations (14) and (15) with L = H = ( r 2 - r l ) / J Z and equation (16b), the following normalized form of the Poisson equation was obtained:

a2d a24

2+- 0. ax ay2- ’

0S x , y S 1

(53)

for which the Dirichlet boundary conditions along the boundaries and the exact solution are given by

4 = In (r/rd/ln 2 1/2

where r = (X2+Y )

.

(r2/r1)

(54)

722

F. CIVAN AND C. M. SLIEPCEVICH

As before, the partial derivatives are replaced by the approximation formulae, equations (1lb) and (12b). Then, the terms involving the boundary values are separated and are collected on the right-hand side to obtain the following set of linear algebraic equations:

10.0

1 .o

/ / /

-

0.1

/ / /

0

l o 4 E,

-

0.01

x-.-x

Galerkin(llX11)

+- + C o n t r o l 5-Point

0

o---oOiff. 0.001 2

volume(llX11) Ref.7 finite diff.(llXll)Ref.7

quad.(5x5) p r e s e n t work

o----oDiff. I

Ref. i

q u a d . ( 7 X 7 ) p r e s e n t work 1

4

I

I

6

1

I

a

1

I 10

r2'rl

Figure 4(a). The centre-point error for the third problem

723

SOLUTION OF POISSON EQUATION 100.0

I p’

10.0

- +/

1.0

/ /

/

/

l o 4 Emax

/ / / - 0

0.1

x-.-x

G a l e r k i n ( 11x11) Ref. I

+-+Control 0

o---ODiff. . f f iDl [ - - - -n

0.01

2

volume(llXl1)

5-Point

Ref.7

finite diff.(IlXll)Ref.?

quad.(5X5)

p r e s e n t work

quad.(7X7)

p r e s e n t work

1 a 4

6

10

rz’rl

Figure 4(b). The maximum error for the third problem

Using the same subroutines to solve equation (55) the resulting values of .I and .nax are compared with published values’ in Figure 4, It is clearly evident that the differential quadrature solution with a 7 X 7 grid is more accurate than the conventional finite element and finite difference methods with a 11x 11grid. DISCUSSION AND CONCLUSIONS Based on the foregoing comparison of results for these three test problems, it is evident that for comparable levels of computational effort, the method of differential quadrature generally produces smaller errors, although it is conceded that the conventional finite element and finite difference techniques probably give sufficiently accurate results for many applications of the Poisson equation. Thus, the principal advantage of differential quadrature is that it is basically easier to apply than conventional numerical techniques.

724

F. CIVAN A N D C. M. SLIEPCEVICH

Although not evident from the test problems used herein, it has been demonstrated2 that the method of differential quadrature can be advantageously employed in solving accurately a variety of practical, multi-dimensional problems with a considerable savings in computational effort. The reason is that this technique is somewhat unique in that it appears to give optimum performance with grids as small as 5 x 5 or 7 x 7, and rarely beyond 15 x 15. In these cases, if solutions at intermediate points are required, they can be easily obtained by an appropriate interpolation, such as the Lagrange method. From the standpoint of the two approaches presented herein for applying the method of differential quadrature, the second approach, equation (17b), requires 25-75 per cent less computational effort than the first approach, equation (17a). ACKNOWLEDGEMENTS

The authors acknowledge the financial support of University Technologists, Inc. of Norman, Oklahoma, U.S.A. and the Merrick Computing Center of the University of Oklahoma.

REFERENCES

1. R.Bellman, B. G. Kashef and J. Casti, ‘Differential quadrature: a technique for the rapid solution of nonlinear partial differential equations’, J. Comp. Phys. 10,40-52 (1972). 2. F. Civan, ‘Solution of transport phenomena type models by the method of differential quadratures’, Ph.D. dissert., Univ. of Oklahoma (1978). 3. F. Civan and C. M. Sliepcevich, ‘Application of differential quadrature to transport processes’, J. Math. Anal. Appl., to be published. 4. G . E. Forsythe and C. B. Moler, Computer Solution of Linear Algebraic Systems, sect. 17, Prentice-Hall, Inc., Englewood Cliffs, N.J., 1967. 5. R. W. Hamming, Numerical Methods for Scientists and Engineers, 2nd edn, McGraw-Hill, New York, 1973,p. 124. 6. J. 0. Mingle, ‘Computational considerations in nonlinear diffusion’, Znt. J. num.Meth. Engng, 7 , 103-116 (1973). 7. S. Ramadhyani and S. V. Patankar, ‘Solution of the Poisson equation: comparison of the Galerkin and controlvolume methods’, Znt. J. num. Meth. Engng, 15,1395-1402 (1980).