13
Compulerr & Strucrurrc Vol IX, No. 4. pp 719.731. 1984 Printed in Great Britain. rQ45-7949184 E3.Wt.W @ 1984 Pergamon Press Ltd. AN IMPROVED CURVILINEAR FINITE DIFFERENCE (CFD) METHOD FOR ARBITRARY MESH SYSTEMS S. K. KWOK Civil Engineering Department, University of Western Australia, Nedlands, W.A. 6009. Australia (Received 2 February 1983;received for publication 21 March 1983) Abstract-This paper describes the auto’maticcomputer generation of finite difference approximations for partial derivatives in arbitrary mesh systems using an “Improved CFD” method. In the first part of the paper, the algorithm of the proposed Improved CFD method, used to solve a general second-order linear partial differential equation defined in a two-dimensional domain, will be presented. The performance of this numerical method will then be compared with the “Original CFD” method developed by Lau[l], and a so-called least square surface fit method developed by Liszka and Orkisz[2]. In the proposed method, extensive use is made of matrix algebra. The method is therefore highly systematic and can be easily implemented into computer programmes. Numerical examples tested in this paper indicate that, for irregular meshes, better numerical accuracy can be attained by the proposed method as compared with the Original CFD method. At the same time, the straightforward extension of the present method to the generation of higher-order-than-two finite difference approximations and to the solution of three-dimensional field problems will also be demonstrated. In the second part of the paper, the computational procedures for the numerical solution of a first boundary- value problem which is governed by a single second-order nonlinear partial differential equation will be derived. INTRODUCTION The development of modern technology in high-speed computers no longer keeps the finite difference method to a regular mesh system in solving partial differential equations. The idea of a fully automatic computer generation of finite difference approximations for partial derivatives in arbitrary mesh systems is not new. Chu[3] used a so-called machine transformation to transform points in a global x-y plane onto an “equipotential” plane, on which finite difference approximations were generated with reference to a local triangular mesh. Jensen[4] employed a six-point star in his finite difference evaluation on an arbitrary grid using the two- dimensional Taylor series expansion. However, the 5 x 5 matrix that correlates the nodal function values and the partial derivatives, so obtained may be singular or ill- conditioned. Much effort was then devoted to a careful selection of local mesh to avoid singularity and to im- prove the accuracy of the so derived finite difference approximations. This problem of avoiding singularity was pursued further by Perrone and Kao[5]. They also claimed to have obtained better finite difference ap- proximations by averaging four sets of finite difference coefficients, obtained by applying Jensen’s method to four carefully chosen six-point stars selected from a local nine-point mesh. However, no theoretical inter- pretation was given to this averaging process. Incident- ally, the reason why this averaging process will give rise to better finite difference approximations was uncovered later by the development of the Curvilinear Finite Difference (or abbreviated as CFD) method. Although the name CFD method was firstly attached to Lau[l], a different account of the same method was published by Frey[6] around the same time under the name of flexible finite difference stencils. In the CFD method, the most important concept lies in a coordinate transformation between the global Cartesian and a local curvilinear coordinate system. Within every defined local coordinate system, a complete polynomial surface fit of the unknown function, expressed in terms of its nodal values, is sought to approximate its true value. Partial derivatives in the local curvilinear coor- dinate system can therefore be obtained by successive differentiation of the approximate complete polynomial surface fit with respect to the curvilinear coordinates. These local partial derivatives are then transformed back to the global Cartesian coordinate system according to the Chain Rule of Partial Differentiation to give the required finite difference approximations of the global partial derivatives. Thus, in the CFD method, the key transformation rule used to transform partial derivatives from one coordinate system to the other is the Chain Rule of Partial Differen- tiation. This implies that the transformation of the finite difference approximations of, say the nth-order partial derivatives, is independent of those finite difference ap- proximations of any partial derivatives with order higher than n. In this paper, it is found that the above implication has a significant effect on the numerical accuracy of the method, especially when the local curvilinear mesh is highly irregular. Although the performance of the CFD method when applied to irregular grids was shown to be satisfactory both by Lau[l] and Frey[6], none of the grids used in their numerical examples showed a marked irregularity in the grid spacings. In fact, it was pointed out by Frey that the order of accuracy of the method will drop if the global grid cannot be mapped conformally onto the local curvilinear coordinate system. Also, Liszka and Orkisz[2] reported that their least square surface fit method performs better than the CFD method on irregular grids. In the present paper, the author developed an “Im- proved CFD” method which aims at improving the numerical accuracy of the original CFD method when applied to irregular grids that cannot be mapped con- formally onto the local curvilinear coordinate system. In this Improved CFD method, the transformation matrix that correlates the local and global partial derivatives is derived from the Taylor Series Expansion. The algorithm 719

An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

  • Upload
    sk-kwok

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

Compulerr & Strucrurrc Vol IX, No. 4. pp 719.731. 1984 Printed in Great Britain.

rQ45-7949184 E3.Wt.W @ 1984 Pergamon Press Ltd.

AN IMPROVED CURVILINEAR FINITE DIFFERENCE (CFD) METHOD FOR ARBITRARY MESH SYSTEMS

S. K. KWOK Civil Engineering Department, University of Western Australia, Nedlands, W.A. 6009. Australia

(Received 2 February 1983; received for publication 21 March 1983)

Abstract-This paper describes the auto’matic computer generation of finite difference approximations for partial derivatives in arbitrary mesh systems using an “Improved CFD” method. In the first part of the paper, the algorithm of the proposed Improved CFD method, used to solve a general second-order linear partial differential equation defined in a two-dimensional domain, will be presented. The performance of this numerical method will then be compared with the “Original CFD” method developed by Lau[l], and a so-called least square surface fit method developed by Liszka and Orkisz[2]. In the proposed method, extensive use is made of matrix algebra. The method is therefore highly systematic and can be easily implemented into computer programmes. Numerical examples tested in this paper indicate that, for irregular meshes, better numerical accuracy can be attained by the proposed method as compared with the Original CFD method. At the same time, the straightforward extension of the present method to the generation of higher-order-than-two finite difference approximations and to the solution of three-dimensional field problems will also be demonstrated.

In the second part of the paper, the computational procedures for the numerical solution of a first boundary- value problem which is governed by a single second-order nonlinear partial differential equation will be derived.

INTRODUCTION The development of modern technology in high-speed computers no longer keeps the finite difference method to a regular mesh system in solving partial differential equations. The idea of a fully automatic computer generation of finite difference approximations for partial derivatives in arbitrary mesh systems is not new. Chu[3] used a so-called machine transformation to transform points in a global x-y plane onto an “equipotential” plane, on which finite difference approximations were generated with reference to a local triangular mesh. Jensen[4] employed a six-point star in his finite difference evaluation on an arbitrary grid using the two- dimensional Taylor series expansion. However, the 5 x 5 matrix that correlates the nodal function values and the partial derivatives, so obtained may be singular or ill- conditioned. Much effort was then devoted to a careful selection of local mesh to avoid singularity and to im- prove the accuracy of the so derived finite difference approximations. This problem of avoiding singularity was pursued further by Perrone and Kao[5]. They also claimed to have obtained better finite difference ap- proximations by averaging four sets of finite difference coefficients, obtained by applying Jensen’s method to four carefully chosen six-point stars selected from a local nine-point mesh. However, no theoretical inter- pretation was given to this averaging process. Incident- ally, the reason why this averaging process will give rise to better finite difference approximations was uncovered later by the development of the Curvilinear Finite Difference (or abbreviated as CFD) method. Although the name CFD method was firstly attached to Lau[l], a different account of the same method was published by Frey[6] around the same time under the name of flexible finite difference stencils.

In the CFD method, the most important concept lies in a coordinate transformation between the global Cartesian and a local curvilinear coordinate system. Within every defined local coordinate system, a complete polynomial surface fit of the unknown function, expressed in terms

of its nodal values, is sought to approximate its true value. Partial derivatives in the local curvilinear coor- dinate system can therefore be obtained by successive differentiation of the approximate complete polynomial surface fit with respect to the curvilinear coordinates. These local partial derivatives are then transformed back to the global Cartesian coordinate system according to the Chain Rule of Partial Differentiation to give the required finite difference approximations of the global partial derivatives.

Thus, in the CFD method, the key transformation rule used to transform partial derivatives from one coordinate system to the other is the Chain Rule of Partial Differen- tiation. This implies that the transformation of the finite difference approximations of, say the nth-order partial derivatives, is independent of those finite difference ap- proximations of any partial derivatives with order higher than n.

In this paper, it is found that the above implication has a significant effect on the numerical accuracy of the method, especially when the local curvilinear mesh is highly irregular. Although the performance of the CFD method when applied to irregular grids was shown to be satisfactory both by Lau[l] and Frey[6], none of the grids used in their numerical examples showed a marked irregularity in the grid spacings. In fact, it was pointed out by Frey that the order of accuracy of the method will drop if the global grid cannot be mapped conformally onto the local curvilinear coordinate system. Also, Liszka and Orkisz[2] reported that their least square surface fit method performs better than the CFD method on irregular grids.

In the present paper, the author developed an “Im- proved CFD” method which aims at improving the numerical accuracy of the original CFD method when applied to irregular grids that cannot be mapped con- formally onto the local curvilinear coordinate system. In this Improved CFD method, the transformation matrix that correlates the local and global partial derivatives is derived from the Taylor Series Expansion. The algorithm

719

Page 2: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

720 S. K. KWOK

of the proposed method will be described in Section 1 of this paper. Numerical examples involving 2nd-order linear partial differential equations will then be worked out separately by the Improved CFD method, the ori- ginal CFD method and the least square surface fit method developed by Liszka and Orkisz[2], and results obtained by the three methods will be compared. Since extensive use is made of matrix algebra, the current method is highly systematic and can be easily extended to derive higher-order finite difference approximations and to solve partial differential equations in three- dimensions. To demonstrate this, numerical examples solved earlier by 2nd-order finite difference ap- proximations will be solved again using 4thorder finite difference approximations. Furthermore, the proposed method will be applied to a three-dimensional Poisson’s equation involving the use of irregular grid.

In Section 2 of this paper, in conjunction with the use of a lst-order Newton-Raphson method, the Improved CFD method is further extended to solve a general Znd-order nonlinear partial differential equation. The computational procedures will be laid down and the results of a numerical example will be presented. It is hoped that, through all these illustrations, the Improved CFD method will be recognized as a powerful numerical tool in solving partial differential equations.

1. THE JMPR0VF.D CFD MEI’HOD

Let 4(x, y) be an unknown function defined in some region R of the global Cartesian x-y plane (see Fig. l), and suppose that its behaviour in R is governed by the following 2nd-order linear partial differential equation

Ai$,i + B&ii = f. (1)

Furthermore, eqn (1) is subject to the following boundary condition along the boundary S

C49itW = g (2)

where in eqn (1) and (2), f, g and all the coefficients are functions of x and y defined in R.

For convenience, the familiar indicial notation used in tensor calculus will be employed throughout this paper to represent partial derivatives, i.e. the comma appears in eqns (1) and (2) denotes partial differentiation and the subscripts i, j refer to the global x, y coordinates. The subscripts i, j will take the range of 1 and 2 in this case. Like

the Finite Element Method, the numerical computation starts with a discretization of the domain R to form a computational mesh. At each node of the arbitrary mesh formed, a local a-p curvilinear coordinate system is defined as it is shown in Fig. 1.

FINITE DIFFERENCE APPROXIMATIONS FOR LOCAL PARTIAL DERIVATIVES

Suppose the function value of $~(a, /3) at an arbitrary point located within the local curvilinear mesh is ap- proximated by the following 2nd-order complete poly- nomial.

do = a, t a2a t a,/3 + a4a2 t a$?‘+ asa/

t a7a2/3 t a,c#t asa2/32. (3)

Equation (3) is the lowest order complete polynomial that one can use if the function 4(a, /3) is to be ensured to be continuous up to its 2nd-order partial derivatives. In order to express the nine unknown coefficients, i.e. a,, . . , as, in terms of the nodal function values, a minimum number of nine nodes will be required to define a local curvilinear mesh. This is the case shown in Fig. 1. By applying eqn (3) to each node of the local mesh, the following matrix equation can be arrived.

where

and

b#Jr.J~= = {41,42,~ 3 991

{aJT = {aI, a2, . . , 4

‘1 al P1 . . . a1’P12

1 a2 P2 . . . aZ’P2

{A}=‘, ”

.

. .

-1 a9 P9 . a9’P9’

(4)

By multiplying {A}-’ to each side of eqn (4), {ai} can be

Local :-P Plane

at node i

Global Reference Franc

Fig. 1. The definition of the local curvilinear 9-point mesh.

Page 3: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

An improved curvilinear finite difference (Cm) method 721

expressed in terms of {&}, i.e.

{ai) = fA)%& (5)

Hence, within the local curvilinear mesh, 4 can be obtained by the following interpolation function

d, = IJIH~NI (6)

where

By successive partiai d~erentiating eqn (6) with respect to the curvilinear coordinates a and & the finite difference approximations of the partial derivatives in the local curvilinear coordinate system can be obtained. This is best summarized by the following matrix equation.

where

and {DC!} is a 5 x 9 matrix. Subsequently, by substituting the appropriate a, p values at a point within the local mesh into those expressions of the {DC) matrix, finite difference approximations of the local partial derivatives at that particular point can be easily obtained.

TRANSFORMATION OF THE LOCAL PARTIAL DERlVArrYH TO THE GLOBAL X-Y PLANE

Instead of using the Chain Rule of Partial Differentiation to transform those derived finite difference ap- proximations of the local partial derivatives from the local curvilinear coordinate system to the giobai x-y plane, the tw~dimensional Taylor series exp~sion theorem is used. For the purpose of illustration, the central diierencing case is considered. The function #J(x, y) at each node of the local curvilinear mesh will be approximated by the folloti- ing 2nd-order truncated Taylor series expansion.

where

By writing eqn (8) at each node of the local curvilinear mesh, the following matrix equation is obtained.

where

and

k,*l2

* . . . ,

k,zl2

Now, {&} in eqn (9) can be substituted into eqn (7) to obtain

{LD} = {DCHDHGD}.

By inverting eqn (lo), one gets

(IO)

{GD) = (~~HD~)-‘~~D}. (II)

Further substitution of eqn (7) into eqn (11) yields the final desirable equation,

i.e. IGD}= (WHW'WHcbiv~. (12)

Of course, eqn (12) means a 5 X 5 matrix inversion at each node, as opposed to a 2 x 2 matrix inversion used in the original CPD method. This wih involve more com- putational effort. However, the Improved CFD method presented above does guarantee a Znd-order accurate solution, even for those global irregular grids that cannot be mapped conformally onto the local curvilinear a+ coordinate system. Moreover, the method is highly sys- tematic. One needs to form the {D} and the {DC!} matrices at each node, and the finite difference approximations for the global partial derivatives will be generated automatic- ally by subsequent numerical inversion and multiplication of matrices.

No special geometric constraints have to be specified for the formation of the local g-point curvilinear mesh in order to obtain a 2nd-order accuracy for the solution in the Improved CPD method, except that the determinant of the Jacobian of the transformation matrix, i.e.

cannot be zero. This condition is, in fact, common to both the original and the Improved CPD methods. It merely states the fact that in the local curvilinear coordinate system, the angle between the a! and fi coordinate axes cannot be zero. In other words, those nine nodes which define a local mesh cannot lie on a curve or a straight line at the same time. If this condition is met, the transformation matrix defined in eqn (IO) will not be singular. Physic~fy, this means that in the local mesh, if the nine points can be dispersed to form a surface, one can always find a Znd-order complete surface polynomial to fit the unknown function values at these points. In the next section, numerical examples will be worked out to show how good the Improved CFD method performs as compared to the original CFD method.

Page 4: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

122 S. K. KWOK

NUMERICALEXAMPLES

Example 1 The first test example is designed to test the performance

of the Improved CFD method when it is applied to aregular square domain with variable grid spacings. The problem consists of the determination of the unknown 4(x, y) satisfying the following 2nd-order nonhomogenous mixed- type partial differential equation in the given square domain shown below in Fig. 2.

Y&X + &Y = - (1 t y) sin (x t y) (13)

and the prescribed boundary condition along the boundary.

f#~ = sin (x t y). (14)

This example was analysed before by Cheung[7] using the least square Finite Element Collation method. The exact solution for this problem is given by

4 = sin (x t y). (15)

Firstly, a 6 x 6 regular mesh (shown in Fig. 2) is used in the numerical analysis. Then, the computation will be repeated on an 8 x 8 irregular grid shown in Fig. 3. The numerical accuracy of the results obtained for both grids will be compared in terms of the discrepancy E,,, which is defined by the following ratio.

E,, = (Numerical result-Analytical result)/Analytical

c*,- .‘I

Fig. 2. Regular 6x6 computational grid for Test Example I.

Before comparing the results obtained by the Improved and the original CFD methods, it is instructive to see how good the original CFD method performs in the above two computational grids respectively. Results obtained are summarized in Table 1 below.

For the 6 x 6 regular grid, the numerical results obtained are very satisfactory. Even for such a coarse grid, at nowhere did the discrepancy, E,, for the function value 4 exceed 0.4%. However, for the 8 x 8 irregular grid, a maximum discrepancy of 7.48% occurred. This clearly showed that the order of accuracy of the original CFD method dropped in the 8 x 8 irregular grid. This is due to the fact that, in part of the 8 x 8 irregular grid, the global coordinates cannot be mapped conformally onto the defined local curvilinear coordinate system. In the follow- ing Table 2, it will be seen that the numerical accuracy is much improved by the Improved CFD method for the 8 X 8 irregular grid case. At the same time, the problem was also solved by the least square surface fit method developed by Liszka and Orkisz to serve as an extra comparison.

It is obvious from the Table 2 that the numerical accuracy of the results is much improved by the Improved CFD method. As a matter of fact, in the Improved CFD method, the maximum discrepancy E,, for the function values 4 is only 1.56% as compared to 7.48% obtained by

Y

I -0.5 64 37 26 26

T -0.4

-0.3

0.1

0.3

0.4

0.5

61 ..I6 .20 “2 I p3 ..24 $4

_______----. _x

16 17 ..LB p3 41_:*$, 10 L, ** 62

1 5 6 51

47 46 49 50

0 0.1 0.2 0.4 3.6 0.8 0.0 1.0

Fig. 3. Irregular 8 x 8 computational grid for Test Example 1.

Page 5: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

An improved curvilinear finite difference (CFD) method 723

Table 1. Summary of solution to eqn (13)obtained by the original CFD method

Analytical E*

X Y Numerical 0 rr

$ 6x6 grid 8x8 grid 6x6 grid 8x8 grid

0.2 -0.3 -0.09983 -0.09998 -0.10465 0.15 4.82

0.4 -0.3 0.09983 0.10022 0.10730 0.39 7.48

0.6 -0.3 0.29552 0.29529 0.28917 0.08 2.15

0.8 -0.3 0.47943 0.47987 0.48550 0.09 1.27

0.2 -0.1 0.09983 0.09974 0.09638 0.09 3.46

0.4 0.1 0.47943 0.47974 0.48435 0.06 1.03

._. .^ *Dtscrepancy detined m eqn (16) in percentages.

Table 2. Comparision of results for eqn (13) obtained by the original CFD method,the Improved CFD method,and the least square surface fit method fir the 8 x 8 irregular grid .

ORIGINAL CFD IMPROVED CFD LEAST SQUARE

x Y E* rr E* rr E* rr

0 $9, 0. Y

0 $3, 0. Y

0 $3, 0. Y

0.2 -0.3 4.82 3.73 0.21 0.21 0.94 0.41 1.62 0.67 0.96

0.4 -0.3 7.48 1.05 0.05 1.56 0.39 0.69 0.57 0.21 0.83

0.8 -0.3 1.27 6.23 2.15 0.45 0.59 0.86 0.30 0.78 0.76

0.2 -0.1 3.46 2.30 0.37 0.05 0.90 0.57 1.68 1.18 0.67

0.8 0.3 0.48 9.86 7.22 0.02 0.70 0.17 0.07 1.07 0.80

0.9 0.3 0.30 6.11 10.52 0.00 0.39 0.14 0.03 1.14 0.56

0.8 0.4 0.24 12.50 6.11 0.01 0.60 0.39 0.04 0.84 1.18

the original CFD method. Also, for the l&order partial derivatives, the maximum discrepancy E,, was found to be 1.33% in the Improved CFD method. For the regular 6 x 6 grid, both methods give rise to identical results. In fact, as far as regular mesh systems are concerned, the original and the Improved CFD methods are identical to the Standard Finite Difference Method. It is not surprising to see that both the Improved CFD method and the least square surface fit method will give rise to results with the same order of accuracy, as both methods are based on a Znd-order truncated Taylor series expansion of the un- known function 4. However, it must be pointed out that in the Improved CFD method, no laborious manual deriva- tion of the coefficient matrix correlating the unknown nodal function values and the unknown global derivatives is required. Therefore, it is relatively simple for the Improved CFD method to be extended to the generation of higher-order finite difference approximations or to the solution of boundary-value problems in three-dimensions.

Example 2 The second example to solve is the following non-

homogenous mixed-type partial differential equation,

y L + bYYY = (y + 1) eX+’ (171

defined in the inverted teardrop domain shown in Fig. 4. The domain is bounded by three curves, namely, a smooth curve S, in the elliptic subregion and two characteristic arcs Sr and SZ in the hyperbolic subregion.

Furthermore, eqn (17) is subject to the following boun- dary conditions. Firstly,

4 = e”+Y along SZ and S,

and secondly, no data will be prescribed on the free characteristic boundary S,. Again, this problem was solved before by Cheung[71 and the exact solution is

4 = ex+y (181

In this problem, the irregular boundary geometry of the domain highlights the power of the current CFD methods. Figure 4 shows a possible way of discretising the domain automatically by computer. The method used here for the automatic mesh generation was one des- cribed by Amsden and Hirt[8]. Because of the presence of the free characteristic boundary S,, backward differencing technique has to be used for those nodes lying along S1 to provide one algebraic finite difference equation at each of these nodes. In order to minimize the bandwidth of the problem, those nodes on S1 are num- bered first. Again, the problem was analysed separately by the original CFD method, the Improved CFD method and the least square surface fit method. Although a 143-point mesh is shown in Fig. 4, a 90-point mesh was actually used in the analysis, and the results obtained by the three different methods are compared in the follow- ing Table 3.

From the Table 3, it can be seen that the Improved CFD method again provides the best results amongst the three methods. The results shown in Table 3 are in fact the ones with the largest percentages of error. The rather low degree of accuracy attained for this test example is principally caused by the use of the backward differenc- ing technique along the free characteristic boundary S,. Since the order of accuracy in the present Improved CFD method is a second order one for the central difference approximations, the order of accuracy must be lower than 2nd-order if backward difference ap-

Page 6: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

724 S. K. IiWOK

Fig. 4. The inverted teardrop domain for Test Example 2 and a possible finite difference discretization.

Table 3. Comparison of results for eqn (17).

ORIGINAL CFO IMPROVED CFD LEAST SQtiRE

E* E* E’ x Y

t-r rr PP 0 o., +.

Y + o., $‘y 0 +,, by

-0.237 -1.095 7.83 10.63 13.45 4.01 14.93 8.40 0.96 8.56 18.62

-0.601 -0.710 6.25 32.48 2.35 2.58 8.41 10.49 14.10 20.63 7.48

0.195 -0.862 9.50 5.88 14.10 1.88 0.78 6.95 6.95 6.10 12.48

-0.636 -0.668 6.62 15.91 22.08 2.45 9.76 10.12 14.98 19.00 7.22

0.000 -0.640 6.91 11.06 2.59 2.32 2.73 2.88 3.56 18.44 2.08

0.190 -0.630 6.27 5.46 4.35 2.05 1.08 2.89 5.57 11.79 1.68

0.367 -0.613 6.34 3.48 0.95 1.65 0.11 1.77 6.17 3.60 1.02

-0.748 -0.523 12.20 18.18 4.40 2.41 14.87 9.35 17.35 14.84 5.34

-0.885 -0.310 11.37 11.06 12.92 2.73 16.36 11.69 13.57 11.24 23.18

-0.642 -0.234 6.34 18.48 2.78 0.65 1.07 0.81 9.24 7.42 8.09

*Discrepancy defined in eqn (16) in percentages.

Page 7: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

An improved curvilinear finite difference (CFD) method 72s

proximations are used. The use of a finer mesh in the analysis can, of course, improve the accuracy of the results. However, it was found that in this particular example, one must go to a very fine discretization in order to bring the maximum discrepancy for the 4 values to within 1%. In that case, computer storage becomes a problem. Therefore, it is quite necessary, in some parti- cular cases, to employ higher order finite difference approximations.

EXTENSION TO HICHER~ORDER FINITE DIFFERENCE APPROXIMATIONS

Although it was mentioned by many finite difference investigators that the extension of their methods to derive higher order finite difference approximations for arbitrary mesh is a straightforward matter, only a few of them actually carried out the computation to verify their statements.

The need to use higher order finite difference ap- proximations to provide accurate numerical models for functions with large gradients was recognized and poin- ted out, at least in the one-dimensional case, by Lau[9]. In one of his papers, Lau[lO] actually employed his CFD method to solve a biharmonic type 4th-order partial differential equation. However, the expressions for those finite difference coefficients he arrived are very com- plicated. It is the intention of the author to demonstrate how easy those finite difference coefficients can be automaticallv comouter generated bv the oresent Im- roved CFD’methdd. - P

I- IDI = 2s X 14

h, k,

h, k,

hi ki

h k,, 25

Y

I

L

h,k, !$ !$

.

. . .

Employing the same local curvilinear 25-point mesh as used by Lau (see Fig. 5), a function 4 is approximated by the following rlth-order complete polynomial within the local region.

+ P(a, t a7cf t aga2 t a9a3 t aloa4)

t p*(a,, t a,*(2 t a13cy2 t aIda t a,,a’)

t p3(aIa t a17a t a18a2 t aI92 t aMa’)

(19)

t p4(azl t a220 t a23(22 t a24a3 t az5a4)

where a,, a*, . . . , a25 are constant coefficients. Having gone through similar computations as it is

shown for the 2nd-order case, eqn (7) can be obtained, in ;hich~I~om~ RJ,~~$., &= +Y=.s $,se $J,,,. 9,m.ua

WW *B&3 lPPPP Yua.+ ,‘-W.W d tulle &w~B} and UW is now a 14x 25 matrix. Furthermore, {I&}= is the transpose of the node1 vector, i.e. {$1, &, . . . &J}.

NOW, with the help of eqn (12) and by means of a truncated 4th-order Taylor series expression, these finite difference approximations for the local partial deriva- tives can easily be transformed to the global x-y plane to give the desired finite difference approximations for the global partial derivatives. The vector {GD} in eqn (12) becomes I& & do,= &, &Y +,Xu +,uY, . . . , do,,,,,) and the matrix {D} is a 25 x 14 matrix defined as

h12k,h&g 2 2 6

. * .

. . .

h14 h13k, -- 24 6

. . .

. .

hr2k,* h,k13 kp - _ 4 6 24

. . .

L-7 i 3=T 21 20 19 I9 17

0;r 22 9 C&+ ‘i 3 7

1

I6

R (I

fi=p 234 I 2 15 +o

8=-l ?4 9 5 6 $4

s

,3-z 25 10 II 12 13 +X

a.-2 .*-I .=O a;1 a=2

.

. . .

Fig. 5. A 25-point local curvilinear coordinate system.

Page 8: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

726 S. K. KWOK

Table 4. Summary of solution of Test Example 1 obtained by the Improved CFD method using 4th-order finite difference approximations. (6 X 6 regular grid)

Y Analytical Numrical x E* rr

m 0 0 0.x 0. Y

0.2 -0.3 -0.09983 -0.09986 0.02 0.05 0.01

0.4 -0.3 0.09983 0.09986 0.02 0.01 0.02

0.6 -0.3 0.29552 0.29547 0.02 0.03 0.00

0.8 -0.3 0.47943 0.47939 0.01 0.04 0.00

0.2 -0.1 0.09983 0.09982 0.01 0.04 0.00

0.4 0.1 0.47943 0.47945 0.00 0.01 0.01

Table 5. Summary of solution to Test Example 2 obtained by the Improved CFD method using 4th-order finite difference approximations.

x Y Analytical Numerical E*

rr d 0 0 0.x ‘$3

Y

-0.234 -1.095 0.26370 0.26419

-0.601 -0.710 0.26994 0.26952

0.195 -0.862 0.51259 0.51366

-0.636 -0.668 0.27199 0.27144

0.000 -0.640 0.52635 0.52771

0.190 -0.630 0.64245 0.64397

0.367 -0.613 0.78067 0.78192

-0.748 -0.523 0.28137 0.28058

-1.885 -0.310 0.30303 0.30273

-0.642 -0.234 0.41762 0.41665

*Discrepancy defined in eqn (16) in percentages.

0.18 0.59 0.13

0.15 1.48 0.02

0.21 0.17 0.54

0.20 0.01 1.09

0.26 0.43 0.30

0.24 0.11 0.15

0.16 0.18 0.10

0.28 1.08 0.78

0.10 2.05 0.31

0.23 0.08 0.22

Therefore, once the {D} and {DC} matrices are for- the 4th-order finite difference approximations and the med, it becomes relatively simple to compute the finite results are presented in the following Tables 4 and 5. difference expressions for the global partial derivatives. It is true that the method involves considerable com- EXTENS~ONTOTHESOLUTIONOFBO~NDARY-VALUE

putational effort, as a 14 x 14 matrix inversion is required PROBLEMSINTRREEDIMJ3NSIONS

for each node. However, the method is guaranteed to be The derivation of those Znd-order correct finite

exact up to the 4th-order. difference approximations for the local partial deriva- The test examples 1 and 2 were resolved again using tives in a three-dimensional domain can easily be

Y

k x

Fig. 6. A 27-point three-dimensional local curvilinear coordinate system.

Page 9: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

An improved curvilinear finite difference (CFD) method 727

achieved if the following 2nd-order complete polynominal is used to approximate the unknown field function 4 within the three-dimensional curvilinear mesh of 27 nodes defined in Fig. 6.

4 = a, + a+ t a3a2 t a4P t @a t @a2 t a,p2

t a8a/3’ t a9/3’a2 t al0q + allqa + a12qa2

+ al43 + al4qPa + a15rtpa2+ a1&32

t a17qafi2+a18q/32a2+ a19q2t a20q2a

+ a2tq2a2f alzq2P f a23q2Pa

t amq2/3a2 + azsq2p2 t aZ6q2aP2 t a27q2/32a2

where al, a*, . . . , a*, are constant coefficients. From eqn (20), the {DC} matrix defined in eqn (7) can x-o.5

9.4.5

easily be derived. In this case, {DC} is a 9 X 27 matrix Td Te m,afrix4WP)T becomes MJ,~ 4~ 4, 4,-,, 4,aa

Fig. 7. A typical mesh discretization of the unit cube.

-VI ,cxf3 ,a? *I% . The subsequent transformation of these local partial CFD method, the Improved CFD method and the Stan-

derivatives to the global xyz region is again carried out dard finite difference method all give rise to identical by eqn (12) whereas the {D} matrix occurs in this equa- results. The main concern here is, therefore, not com- tion is now derived from a truncated Znd-order Taylor paring results obtained by various methods for regular series expansion in three-dimensions, i.e. spaced grids, but rather to point ouf the fact that the

hz kz lz . . . . . .

h 27 k2, 127 . . . . . .

where hi and ki are defined as before and li = Zi - 2,.

A numerical example: the steady state temperature dis- tribution of a unit cube

To examine the numerical performance of the current Improved CFD method in solving three-dimensional partial differential equations, the well-known problem of the steady state temperature distribution of a unit cube was chosen as a test case. The problem is governed by the following three-dimensional Poisson’s equation,

4, + & •t 4& = 0 (21)

within the unit cube domain. Furthermore, on the top surface, the cube is subject to a constant temperature of 1000°C and zero temperature on the other surfaces. Unit heat conductivities are assumed for all directions. The problem was well studied by finite element methodIll, 121 and by Lau[l3]. As pointed out before, as far as regular spaced grids are concerned, the original

CA.7 Vol. 18, No. &K

present Improved CFD method can provide true 2nd- order correct solutions for irregular grids. The three irregular spaced grids used before by Lau[l3] will be used again in the present Improved CFD method com- putations.

The above Fig. 7 shows a typical mesh discretization of the unit cube. Dimensions in the x and y directions will be spaced regularly while a graded spacings will be used in the z direction. As the problem is symmetrical about the xz and the yz planes, only one-quarter of the cube is used in the analysis. In the following Table 6, results for nodes lying on the z-axis will be presented for comparision.

2. SOLUTlONOFNONLlNEARPARTIALD-EQUATIONS In this section, the Improved CFD method is further

extended to solve boundary-value problems which are governed by a single Znd-order nonlinear partial differential equation. Such a governing equation is best

Page 10: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

128 S. K. KWOK

Table 6. Comparison of Temperature T and Xf’/az at nodes along the z-axis

T aT/aZ

MESH Discretization

L Original Improved Analytical

CFO CFD Soln. Original Improved Analytical in

CFO CFD S0ln. z-direction

3X3X5 0.85 606 612 650 2079 2185 2127

12 unknowns 0.G5 272 283 311 1099 O/0.375/0.65

1250 1240

0.375 84 R8 /0.85/1.0

35 419 508 444

3X3X5 0.8 512 515 548 1937 1914 1919

12 unknowns 0.6 225 234 O/0.3/0.6/0.8

254 896 1067 1047

0.3 Il.0

65 67 71 375 391 337

5X5X9 0.9 750 752 760 2330 2316 2290 O/0.125/0.25/

112 unknowns 0.8 534 538 548 1929 1914 1919 0.375/0.5375/ 0.125 29 23 22 182 209 194 0.7/0.8/0.9/1.0

put into the following generalized form,

where A, Ei, Fi, G/, Ifikr, Pii, Qij, Rt and S: are all constant coefficients, and f is a function of x and y only.

The indicial and summation conventions used in Ten- sor calculus are employed in eqn (22), and i, j, k and 1 will all have the range of 1 and 2 in the present context.

To solve eqn (22) numerically, a lst-order Newton- Raphson iteration scheme is used. By taking f to the left hand side of eqn (22), a new residual function 1 is formed. i.e.

Now, suppose the domain, on which eqn (22) is defined, is discretized into n mesh points. The global unknown nodal vector of I$ can be defined as

M+JY = {$r, $2,. . . ,dQ,. . . , 44 (24)

With the definition of {&}=, all those partial deriva- tives appear in eqn (23) can be approximated by some finite difference expressions in terms of {+N}T. In other words, the following matrix expressions can be laid down.

At each iteration, the substitution of eqn (25) into eqn (23) and its subsequent application to each node will yield the following nodal residual vector {I,}, whereas Ill,Y = ill,, ll2, . . . , I,,. . . ,llJ.

Now, the recurrence iterating equation for a Is&order Newton-Raphson scheme at the (it l)th-iteration is most conveniently expressed as

b#JNl(i+‘) = {&}(i) - {$ N

}(i) (261

{JIN}“) defined in the above equation is actually the nodal correction vector computed at the ith-iteration. A con- venient measure of {&.,} is the Euclidean norm N, defined as

N = (MJN~={~NV.

Convergence criterion is taken as

(28)

No+‘) - N”’ < II N”’ . (29)

where A is some prescribed order of accuracy. The main task is to solve for {JIN} at each iteration. To

do so, eqn (27) is rewritten as

By substituting eqn (25) into eqn (23) and carrying out the partial differentiation, eqn (30) yields the following equation at the node I.

Upon a closer examination, eqn (31) is in fact the finite difference counterpart of the following partial differential equation.

+ {Ei + E4 •t GiLAt + K’%,d&,i (32)

where + IQ& + R*,h + $%#‘>k@,, + d’d~k%$~ij

k k,

(27) + {f’tj f Q+$ + R iJ’#hk + S ii hk’hlbhij = II.

By collecting like terms, eqn (32) can be expressed as a

Page 11: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

An improved curvilinear finite difference (CFD) method 729

2nd-order partial differential equation in terms of I/J of the following form:

a4 •t hdhi + Cij&ij = ll (33)

in which

The coefficients a, bi and cij are computed from the results of 4 obtained from a previous iteration. There- fore, the solution of eqn (33) for $ is practically the same as solving a linear 2nd-order partial differential equation at each iteration, and all the procedures relating to the solution of linear partial differential equations described in Section I of this paper can be applied here.

COMPUTATIONAL. PROCEDURE (1) Equation (22) is first put into the following form

where

A4 + &d,i + C&u = f (35)

(36)

By comparing eqn (36) with eqn (34) it can be seen that

a = A + Fhi + Qijhij

(2) Computation starts with a guessing vector of I&}. This is usually chosen as the null vector {O}.

(3) From eqn (35), coefficients A, Bi and Cir can be computed from the {&} values of the previous iteration.

(4) The nodal residual vector {qN} can therefore be computed according to eqn (23).

(5) The coefficients a, bi and cij for the partial differential equation governing the correction function Jr are next computed according to eqn (37).

(6) Boundary conditions are then imposed on the resulting set of linear algebraic equations so obtained. Note that, in the case of a first boundary-value problem, the boundary condition of eqn (33)js diBerent from that of the original eqn (22). Here J, = tj = 0 along the boun- dary.

(7) The solution of the above set of aigebraic equations will give {$N}(i).

(8) The new {&.}(‘+‘) can therefore be found from eqn (26).

(9) Iteration continues until eqn (29) is satisfied.

NUMERlCALEXAhlPLE!3

The first example is a trivial test example. The govern- ing nonlinear partial differential equation is

= 2cos(x2t y){l t cos2(x2t y)}-(4x2 t 1) sin (x2 f y) (38)

defined in a square domain bounded by the x and y axes and the lines x = 1, y = 1.

Equation (38) is further subject to the following pres- cribed boundary condition.

$J = sin (x2 t y). (39)

Exact solution for this problem is also given by eqn (39). An 11 x 11 regular mesh was used to solve this problem. Numerical results were found to be in good agreement with the exact solution. The maximum percentages of error was only 0.16% occuring at the point (0.3, 0.2). A total of nine iterations were used for this problem to achieve a A = 0.05 convergence criterion defined by eqn (29).

The next example to solve is to work out the shape of some membrane structures. This problem is of some real practical significance since the solution of this problem is required both in the cutting of the membrane material to realize the ideal shape and in the stress analysis of the membrane structure. Standard finite difference method was applied successfully before by Ishu and Suzuki[l4] to solve this problem. Several cases including unloaded weighless membranes, membranes acted upon under in- ternal pressures and by its own weight were considered in their paper.

Fig. 8. Shape of an unloaded membrane.

Page 12: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

730 s. K. KWOK

Fig. 9. Values of z/A across sect. A-B.

However, in the present work, only the shape of an untoaded membrane will be worked out to demonstrate how the CFD method can be efficiently applied to solve nonlinear partial differential equations. As derived in Ref. 1141, the shape of an unloaded membrane structure is governed by the following nonlinear partial differential equation,

Lu -t G,, + (z,J22,,, - 2z,Xz,yz,Xg + (z,y)2z,XX = 0 (40)

in which the z coordinate is a function of x and y only. Boundary restriction to eqn (40) is best visualized with

the help of Fig. 8. The membrane is bounded by four straight lines which, when projected onto the xy plane, will give a square. The rise, R, at one corner of the projected square, in this particular example, is two times the dimension, A, of the square base. An 11 x 11 regular grid was used in the present CFD analysis, and the computed z/A values across the section A-B were plot- ted in Fig. 9. Results obtained by the present analysis agree excellently with those obtained by Ref. [I4]. A total number of six iterations was used in this example.

CONCLUSIONS An Improved CFD method is proposed to generate

finite difference approximations for partial derivatives in arbitrary mesh systems. The main difference between this proposed and the Original CFD method is the use of truncated Taylor series expansions to derive the global- local partial derivatives transformation matrix in the proposed method while the Chain Rule of Partial Differentiation is used in the original one. It is found that, for the grids in which the global Cartesian coor- dinates can be mapped conformally onto the defined local curvilinear coordinate systems, both methods are really identical to each other. However, if this condition is not realized, as it is usually the case for many irregular grids in general, the Improved CFD method is proved to be more accurate. It is true that more computations effort is required in the new method. However, this should not be a hindering factor in using the proposed method as a powerful tool in solving partial differential equations, since computers nowadays are getting larger and faster. And more importantly, the truncation error

terms of the present Improved CFD method can be observed readily.

Furthermore, the present method puts the finite difference technique in a highly systematic and flexible fashion, Finite difference approximations can now be easily generated for partial derivatives defined at any point within a local curvilinear mesh without any cum- bersome complication of the computer programming impIementation. This, undoubtedly, will enhance the use of the finite difference technique in combination with numerical integrations in the variational finite difference methods.

Various numerical examples worked out in this paper have proved that the method is not only successful in solving 2nd-order linear and nonlinear partial differential equations, but it can also be extended easily to generate higher order finite difference approximations and to par- tial differential equations in three-dimensions. In parti- cular, it must be mentioned that, as far as Znd-order partial differential equations are concerned, the averaging method described by Perrone and Kao[2] is really identical to the present Improved CFD method. However, four 5 x 5 matrix inversions for every node are required in their method while a single 5 x 5 inversion is needed in the present method. Liszka and Orkisz[2] also claimed that their least square surface fit method can give rise to more accurate results thati the CFD method for irregular grids. Results obtained in this work showed that this is quite true as far as the Original CFD method is concerned. However, with the present developed Im- proved CFD method, their claim becomes no longer valid. In fact, both their method and the Improved CFD method have the same order of accuracy and require a comparable amount of computational effort.

At the present stage, finite difference method has been put in a very competitive position as compared to finite element method. This is especially true for boundary- value problems which have no variational formulation. However, it must be admitted that in the finite difference method, technical difficulties may be encountered in im- posing the boundary conditions of a particular problem. The difhcult task is not on the generation of a finite difference equation for a boundary node, but rather on the complication which the boundary conditions will cause to any attempt in developing any automatic mesh generator. In the present work, a fully automatic mesh generator has been developed for the first boundary- value problems. However, if normal derivatives are prescribed along the boundaries, imaginary nodes are required for the generation of those finite difference equations for nodes on the boundaries. In this case, except for some regular domains, automatic mesh generating pro~~mes will be quite difhcult to be developed and one has to resort to the tedious manual input of nodal data.

P. C. M. Lau, Numerical solution of Poisson’s equation using curvilinear finite differences. Appt. Math. ModeIling 1, 349- 350 (1977). T. Liszka and J. Orkisz, The finite difference method at arbitrary irregular grids and its applications in applied mechanics. Comput. Structures 11,83-95 (1980). W. H. Chu, Development of a general finite difference ap- proximation for a general domain. J. Comp. Phys. 8, 392-408 (1971).

Page 13: An improved curvilinear finite difference (CFD) method for arbitrary mesh systems

An improved curvilinear finite difference (CFD) method 731

4. P. S. Jensen, Finite difference techniques for variable grids. Comput. Structures 2, 17-29 (1972).

5. N. Perrone and R. Kao, A general finite difference method for arbitrary meshes. Cornput. Sf~ct~res 5,45-58 (1975).

6. W. H. Frey, Flexible finite-~~erence stencils from iso- parametric finite elements. Jnt. J. Num. ~efh. Engng II, X53-1665 (1977).

7. G. F. Carey, Y. K. Cheung and S. L. Lau, Mixed operator problems using least square finite element collocation. Comput. Meth. Appl. Mech. Engng 22 121-130 (1980).

8. A. A. Amsden and C. W. Hirt, A simple scheme for generat- ing general curvilinear grids. J. Comp. Phys. 11, 348-359 (1973).

9. P. C. M. Lau, Finite difference approximation for ordinary derivatives. Jnt. J. Num. Meth. Engng 17,463-678 (1981).

10. P. C. M. Lau, Curvilinear finite difference method for

biharmonic equation. ht. J. Num. Methods Engng 14, 791- 812 (1979).

11. 0. C. Zienkiewixz, A. D. Bahrani and P. L. Arlett, Solution of three-Dimensions field problems by the finite element method. The Engineer 547-550 (Oct. 1%71.

12. D. M. ~Allen-~d S. C. R. ‘Dennis, The application of relaxation methods to the solution of differential equations in three-dimensions-I. Boundary value potential problems. Quart. J. Mech. Appl. Math. 4(2) (1951).

13. P. C. M. Lau, Curvilinear finite difference method for three- dimensional potential problems. J. Comp. Phys. 32, 325-344 (1979).

14. K. Ishu and T. Suzuki, Shapes of membrane structure. Proc. 1971 1AS.S Pacific Symp. Part II on Tension Structures and Space Frames, Tokyo and Kyoto, pp. W-136. ~chitectural Institute of Japan.