This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
\\ dt + * φ |Φιι dt + d
*Φ|| )ψ
0
d(
0 1
0
dt
0]
>ot+ k
ι 2
02
+ Α:φ | φ
0 1
02
+ Αφ
Ίφοι+ k<j> 'Φοι dt d
dt
+ k<j>Φθ2 02
dt + k
— +
^02
/ίφ,, | φ
0i
d
*Φιι)φι
12
Ι 2
—τ- + ^φ
| 2
fkT^dt
^φ,,
+ Α:φ | φ |2
dt fkT^ dt
0 2
φ
1 2
02
dt
CkT# dt n
Jt\
74
Basic Concepts in the Finite Difference and Finite Element Methods
T o solve (2.2.52) for the undetermined coefficients 7} and dTj/dt, it is necessary to perform the integrations indicated in the coefficient matrix. U p o n integration, the matrix equation becomes (2.2.53a) 0.242
0.205
0.757
-0.162
0.00476
0.0190
0.162
-0.0309
-0.243
- 0.0381
1.24
-0.00476
0.0381
0.00238
0.205
0.0190
0.500 0.0833
dt
0.500 dT,
0.0833
dt
Because 7", is known from the initial condition [i.e., 7ΚΌ)=1], the first row of (2.2.53a) can be eliminated and the final expression is (2.2.53b)
0.0190
0.162
-0.0309
-0.0381
1.24
-0.00476
0.00238
-0.205
0.0190
dT, '
0.0833
dt T dT
2
2
dt
=
0.500
0.00476 — -0.243
-0.0833
0.0381
The second term on the right-hand side of (2.2.53b) contains information derived from the initial condition. By inverting the coefficient matrix* the unknown parameters are obtained. (2.2.54) dT, dt T dT
2
56.3 —
2
1.68 11.1
dt
7.45 0.996 9.80
89.7 2.48 68.2
-0.937
0.0785 0.743 -0.121
=
0.570
.
-0.131
The parameter T = 0 . 5 7 0 is the temperature at t = 1 and compares very well 2
'Although solutions of matrix equations are often expressed formally in terms of matrix inverses, in computations other techniques such as Gaussian elimination are used whenever possible.
Introduction to Finite Element Approximation*
75
with the analytical value 0.568. The temperature at the midpoint (r = 0 . 5 ) is easily obtained from the original expansion (2.2.49). 2
dT
7=1
By evaluating d> and
f ( 0 . 5 ) = (1.00)(0.500) - (0.937)(0.125) + (0.570)(0.50O) + (0.131)(0.125)=0.684. T o three significant figures, this solution is identical to the analytical. It is readily apparent that the Galerkin method employing the Hermite cubic generates a solution to our example problem that is superior to other methods investigated. It should be kept in mind, however, that this approach generated three simultaneous equations, whereas the schemes considered earlier generated only two. It is apparent from the coefficient matrix of (2.2.52) that considerable effort is involved in performing the integrations required in the Galerkin method when more complex bases, such as Hermites, are employed. Consequently, it is worthwhile at this point to investigate the use of Hermites in conjunction with the collocation method. In the collocation approach, the M W R formulation is written
(2.2.55)
f*{^
+ k(f-T )}8{t-t,)a=0, e
1 = 1,2,3,4,
where /, are the locations of the collocation points. When the collocation points are chosen to be specifically the Gauss points, a more accurate numerical scheme results. As mentioned earlier, this is known as orthogonal collocation. We use two Gauss points within the element and two additional points at the nodes to account for the boundary condition. N o t e that if the number of elements in the problem were increased, all additional collocation points would be selected at Gauss points. In contrast to our earlier example (2.2.52), this time let us perform our calculations in the ξ coordinate system. T h u s we write (2.2.55) as
(2.2.56)
fJ^f {f-T )^-i,)f^=Q, t+k
e
,- = 1 , 2 , 3 , 4 .
76
Basic Concepts in the Finite Difference and Finite Element Methods
Equation (2.2.56) yields the following matrix equation: (2.2.57) d
^oi di di
+
,
di
+
+
l
<
+k
t>oi , di
d<
+
d
*m
di
k
+k
£=
-I
£ = 0.577
rfi
+
*<*di
£ = - 0.577
di
dt ^ d i
£ = 0 577
£=
+k
di
^
, . .
+"di
rf€ **»* £ = -
-I
, , .
+k
{ = - 0.577
^ d i £=1
^ d i
k
di
- i
0.577
dt
, ,
+
di
^
^ d i
k
^ οι
''fe
H
+
φ
di
dt " d i t=
,
+
+
£ = 0.577
* " d i £=1
k
k
+"dt
* » d i £= - 1
1
dT,
Λ
^12
dt
*o2 £ d
+"di
+k
. . .
di ^Φΐ2
£=1
di
dt *»di
dt
£ = -0.577
+
k
+
k
dt *»di
T
£ = 0 577
dT
..
+
2
2
dt
£=1
'di
kT^kT^ 'di kT^-
The coefficient matrix of (2.2.57) can now be evaluated using the basis function definitions given in (2.2.42) and (2.2.46): 0 + 0.500*
0.500Δί+0
- 0.500 + 0.442*
0.144Δ/ + 0.0657*
-0.500+0.0576*
-0.144Δ* +0.0176*
0+0
0+0
(2.2.58)
0+0
0+0
0.500 + 0.0576*
-0.144Δί-0.0176*
0.500 + 0.442*
0.144Δ.-0.0657*
0+0.500*
0.500Δί+0
kT dT, dt
e
2 kT
e
2 kT
t
τ
2
2 kT
dt
2
2
dT
t
Introduction to Finite Element Approximations
77
Substitution of the appropriate values of k and T yields e
(2.2.59) 0.500 ~
1.00
0.500
0
0
0.384
0.275
0.615
-0.179
-0.384
-0.109
1.384
0.0126
1.00
0.500
0
0
dT, dt T dT
2
2
d'
0.500 0.500 0.500
Because the value of T, is given via the boundary conditions, we can again eliminate row 1 and solve the resulting matrix equation: (2.2.60)
0.275
0.615
-0.179
-0.109
1.384
0.0126
dT, ' dt T dT
2
2
dt
=
dt T dT
2
dt
2.83
-2.03
0.227
0.573
-0.454
=
2
0.500
1.00
0
dT, '
1.15
0.500-0.384
0 116
0.500 + 0.384
0.884
0.500
0.500
1.06
0.116
-0.936
0.0669
0.884
0.566
1.86
0.500
-0.139
The calculated value of Γ , (0.566), compares favorably with the analytical value, (0.568). When the computed coefficients are substituted into the series approximation to Τ and the result evaluated at / = 0 . 5 , the calculated value of 7 " | is 0.683, compared to the analytical solution of 0.684. We have summarized in Table 2.5 the accuracy of the numerical schemes considered thus far in solving the O D E 2
0 5
(2.2.9)
4£ + k(T-T ) t
= 0,
0
r(o)=i. Although this comparison is interesting qualitatively, one must keep in mind that the sample problem consisted of only one element. A more quantitative analysis is considered in a later section.
78
Basic Concepts in the Finite Difference and Finite Element Methods TABLE 2.5. Comparison of Solutions Obtained with Several Weighted Residual Schemes"
Solution Method
/=0.0
f =0.5
< = 1.0
1.00 1.00 1.00 1.00 1.00 1.00 1.00
0.678 0.667 0.684 0.696 0.684 0.683 0.684
0.571 0.555 0.579 0.571 0.570 0.566 0.568
Galerkin linear bases Collocation linear bases Subdomain linear bases Galerkin quadratic bases Galerkin Hermite cubic bases Collocation Hermite cubic bases Analytical "Problem definition is given in (2.2.9).
Calculation of Derivatives. There are occasions when it is necessary to obtain not only the unknown function but also its derivative. T h e Hermite formulation provided this information directly, but it is also available using earlier formulations. It is only necessary to differentiate the approximating expression
Σ
f=
Wt)
7= >
to obtain -
(2.2.61)
ι
τ;-^-
-
7= 1
1 Τ,—ξ-
—.
7=1
Because the coefficients T are known and the basis function derivatives readily obtained, (2.2.61) is easily evaluated. When linear bases for the derivative at t = 0 (using the Galerkin solution for T ) are used, we have }
}
dt
di
l= 0
+ T ({)(4) 2
dt ,
T
A
2
,
W
= 0
= - 2 . 0 0 + 1.36= - 0 . 6 4 0 .
Similarly, we obtain using quadratic bases
Λ
#
,=o
dt
>
T (= 0
{
l
)
{
2
)
+ r (2)(2)+r,(-i)(2)=-0.787. 2
Introduction to Finite Element Approximations
79
The analytical value of the derivative at r = 0 is - 1.00. In summary, the linear, quadratic, and Hermite bases, when used with Galerkin's formulation, yield derivative values of —0.640, —0.787, and —0.937, respectively, compared to the correct value, — 1.00. Let us now consider calculation of the derivative at the location i = 0 . 5 . This is important because it represents an interelement boundary for linear basis functions. Because the linear bases are C ° continuous, the derivative dfy /dt\ is not formally defined. The most common approximation of the derivative at this point is the average of d$j/dt\ . and d$ /dt\ _ _ , where 0 < ε < Δ ί . Derivatives calculated using the three bases are summarized in Table 2.6. The Hermite bases provide a significantly more accurate solution for the derivative, whereas the quadratic scheme is only marginally better, overall, than the linear case. N o t e that the problem encountered in defining the derivative at the edges of the linear element also arise at the edges of quadratic and C ° continuous cubic elements. l=0
l=(jiJi t
2.2.4
t=0
s
5
t
Two-Dimensional Basis Functions
The extension of the weighted residual method to higher dimensions is relatively straightforward, provided that regular rectangular subspaces are employed. We now focus on this special case and examine the more conceptually difficult irregular subspace problem in Chapter 3. As in the earlier discussion of one-dimensional schemes, we illustrate the two-dimensional case using an elementary example. The discretized domain, which we return to shortly, is illustrated in Figure 2.10. Lagrangian Basis Functions. The simplest way to generate a twodimensional basis function is to form the product of two one-dimensional bases, one written for each coordinate direction. This approach can be applied whether linear, quadratic, cubic, or Hermite cubic bases are used. When C ° continuous Lagrange interpolating polynomials are used, we refer to these as Lagrangian bases and the associated finite elements as Lagrangian elements.
TABLE 2.6. Temperature and Temperature Derivatives Computed Using Linear, Quadratic, and Hermite Cubic-Basis Functions
Function: Location:
/=0.5
Analytic Linear Quadratic Hermite
0.684 0.678 0.696 0.684
f
/ = 1.0
f =0.0
0.569 0.571 0.571 0.570
-1.00 -0.640 -0.787 -0.937
df/dt
f =0.5 -0.368 -0.429 -0.429 -0.378
80
Basic Concepts in the Finite Difference and Finite Element Methods
y 2.0
\i
6
9
Γ5
—Η 0 ·
0.5
m
0,0
0.5
i.O
i.5
2.0
-hFigure 2.10. Discretized domain for two-dimensional heat flow. Finite element nodes are indicated by dots and the elements themselves by Roman numerals (from Pinder and Gray, 1977).
As an example, the two-dimensional Lagrangian basis functions arising out of the linear bases of Table 2.4 are (2.2.62a)
*,U.H) = [ K 1 - O ] [ i 0 - * ) ] .
(2.2.62b)
• (€.η)=[Κΐ + ί)][Κΐ-ιΐ)],
(2.2.62c)
• (€.ι») = [1(1 + €)][Ηΐ + ΐ|)].
(2.2.62d)
2
3
fctt.»)
= U ( l - 0 ] [ i O + i|)].
Figure 2.11a illustrates φ,. The other functions have the same shape. Lagrangian quadratic, cubic, and Hermitian cubic two-dimensional basis functions are presented in Table 2.7a and illustrated in Figures 2Mb, c and 2.13. N o t e that the Lagrangian element requires interior nodes when quadratic or cubic basis functions are generated. Serendipity Basis Functions. Although Lagrangian bases are the logical extension of their one-dimensional counterparts, there is another choice which preserves many of the important properties of the Lagrangian bases while decreasing the degrees of freedom by eliminating interior nodes. Examination of Figure 2.11 b and Table 2.7a reveals that the basis function at the central node spans only the rectangular domain illustrated. In light of this observation, let us now examine the possibility of defining a set of two-dimensional bases that are quadratic along each side of the rectangle of Figure 2.11, yet have no
Introduction to Finite Element Approximations
81
Figure 2.11. (a) Two-dimensional basis function that is linear along each side, (b) Two-dimensional Lagrangian basis function that is quadratic along each side. Note the occurrence of a central node where the basis function must be zero.
center node. In a manner analogous to that used to obtain the one-dimensional basis functions, we first write a polynomial expression quadratic in ξ and in η. (2.2.63)
φ = a + bi + CTJ + di
1
+ «?η + / ξ η + gξ η + Λξη + / ξ η . 2
1
2
2
2
There are nine coefficients to be evaluated in this expression, which requires the specification of nine constraints. The Lagrangian scheme involves nine nodes, and consequently the nine conditions are easily formulated. In fact, the bases we derived by taking the product of two one-dimensional bases will arise
82
Basic Concepts in the Finite Difference and Finite Element Methods
(c)
{Continued)
Figure 2.11.
Figure 2.11. (c) Two-dimensional Lagrangian basis function that is cubic along each side. Note the occurrence of four interior nodes where the basis function is defined to be zero.
out of (2.2.63) when each basis function is required to be unity at the node for which it is defined and zero at all other nodes. Because we wish to obtain a basis function with no interior node, there can be only eight constraints imposed. Thus the general polynomial of (2.2.63) requires simplification. Let us achieve this objective by dropping the last term, leaving the expression
(2.2.64)
+ d£ + eT) + / ξ η + g | r j + Λξη . 2
2
2
2
By requiring each basis function Φ,(ξ,τ)) to be unity at node i and zero at all other nodes, we arrive at the matrix equation for the particular case of φ,:
(2.2.65)
1 0 0 0 0 0 0 0
1 1 1 1 1 1 1
.ι
-1 0 1 1 1 0 -1
-ι
-1 -1 -1 0 1 1 1 0
1 0 1 1 1 0 1 1
1 1 1 0 1 1 1 0
1 0 -1 0 1 0 -1 0
-1 0 -1 0 1 0 1 0
-1 0 1 0 1 0 -1 0
a b c d e f g _h
I PΡ-
Ε 8
I
PP" ΆΛΙ·
+
PP-
+
--— ΡΡ-
PP-
w
X
ΡΡ-
+
+
>>
ΙΒ S Υ 5
Ρ-
PΡ"
•A
+ χ
X
—
Ν*
+
c
Ρ· Ρ-
ΡΡ-
+
+
+ Χ
+
(Ν «Α»
Ρ
+
I
i
+ +
Ρ-
I
&
ΡΡ-
f
+
PP-
Ί I
+
Ρ-
«*<·
+
+
I
Ρ&>
χ
Ρ·
***
i
ι
~
χ.
χ
+
+
ΡΡ-
W
V
W
Ρ Ρ· 7
**?
***
+
Ν/
+ + Ρ; Ρ"
Ν ,
«Α*
I
Χ
I
fN Ρ"
V *
I
_
fN *JU>
Ηί5 Η2
-I»
+ Χ Ν*
+
Ρ-
I
Ν*
I
sg
Mi>
2
"8
!3 Υ α
.a
Β
Ν,
sε G Υ
«*?
Ρ
U
U
7
•G
•G
ΙΛ
<75
C Υ Ό
C Υ Ό
+1 +1 II II
83
P-
PΥ
•9
Side no
α
II
Cubic Comer node
II
~- —|fi
Ο
Interioir node
Ο
—
~
AA?|<»
Ρ?|<»
ΡΡΡΡ·
Ρ-
+ χ
Ρ-
+
Ρ-
χ
-
Ρ(Ρ
Ρ-
+
Ρ£
Ρ· Ρ-
Ρ·
+
ΡΡ-
1
I
ι *Α? ΑΛ*
+
~
+ «Α»
*** I
+
+
I
Η£
α. =5
+1 II II P-m
C
+1 II
Interioi• node.
+1 +1 II II
a
+ >—·
Ρ· Ρ-
S ω
+ W
Ρ·
**#
•a
-1_
*A,
is
+
PP-
ON
C
84
Basic Concepts in the Finite Difference and Finite Element Methods TABLE 1.1b.
Basis Functions Formulated Using a Mixed Formulation
Corner node e, = i ( i + « , X i + i i , )
where β and /8 are defined as (
η
Side
fit
A,
1 2
Linear Quadratic Cubic
n
1 2
2
in,
-i
g) 7
Side node Quadratic Φ, = 1(!-ί )(ΐ + ηη,) ί,=ο,
i 8
η, = ±ι
2
Cubic Φ,=Α(1-ί Χ1+9ξί,)(1 + η»),) Φ, = π(1 + ίί,Χ1-η )(Ι+9τ,η,)
_
£, = =*, ", = ±1 {, = ±1, η = ± \
2
2
Equation (2.2.65) yields the vector of coefficients a
I 4
b c d
0 0 I 4
1
e
4
f
1
G
4
4
h
1 1
.
4
J
which, when substituted into (2.2.64) gives (2.2.66)
Φι = ί ( - 1 + ξ + η + ξ η - | η - η | ) · 2
2
2
2
By employing a scheme analogous to the one used for φ , , one can obtain bases for the remaining corner nodes. AH corner node bases are described by (2.2.67)
φ, = I ( 1 + « , ) ( 1 + τ,η,)(«,. + τ,η, - 1),
where £, — ± 1, η, = ± 1, depending on the location of the corner node. Φ, = { ( ΐ - έ ) ( 1 + ητ,,) 2
for
£,=0
Introduction to Finite Element Approximation
85
(-1,1)
(-«.-4) (C)
Figure 2.12. (a) Two-dimensional serendipity basis function that is quadratic along each side, (b) Two-dimensional serendipity basis function that is cubic along each side, ( c ) Two-dimensional mixed serendipity basis functions. Note that the function may be linear, quadratic, or cubic along any given side.
Basic Concepts in the Finite Difference and Finite Element Methods
86
and
Φ, = Η1 +«,)(!-V)
for
η,=0.
Corresponding cubic and Hermite bases are summarized in Table 2,7a. Bases of this class are generally referred to as serendipity basts functions. It is interesting at this point to examine the significance of dropping the ζ η term in formulating the interpolating polynomial (2.2.64). The quadratic and cubic serendipity bases are presented in Figure 2.12a and b and can readily be compared with the Lagrangian bases of Figure 2.11. Note that although an overall similarity exists, the Lagrangian bases are somewhat different in the interior because of the additional constraints imposed on their formulation. It can be shown, using a type of analysis to be presented later, that the addition of the | t j term in general has little influence on the overall accuracy of the approximation. To this point we have tacitly assumed that one type of element, be it linear, quadratic, or cubic, would be used to represent all regions in a particular domain. There are occasions, however, where higher-degree elements may be required in one region but not another. This situation generally arises when the solution is not a smooth surface, such as in the vicinity of singularities or abrupt changes in medium properties. To change from one element type to another requires a transition element. This element must be sufficiently flexible that a different degree of basis function can be used along each side (see Figure 2.12c). The formulation of these bases is presented in Table 2.7a (Pinder and Frind, 1972). 2
2
2
2
Hermitian Basis Functions. Although the two-dimensional Hermite bases are generated through a straightforward multiplication of the one-dimensional functions of Figure 2.9, they are somewhat more difficult to apply than the C ° continuous cubics mentioned above. The two-dimensional expansion of the trial function T(t) now contains, in general, six unknown parameters per node: T oTj/dx. dTJdy, d Tj/dxdy, d T /dx , and 3 7 ; / θ . ν . For any point within an element, we obtain* 2
p
2
2
2
2
}
(2.2.68)
dx dx . dyW
J
'The superscript I is introduced to denote the C' Lagrangian Hermites.
(c)
id)
Figure 2.13. Two-dimensional basis functions formulated using Hermite polynomials.
This expansion requires four bases per node: φ ^ , φ', , φ , and φ ' . Their algebraic form is given in Table 2.7a and they are illustrated in Figure 2.13. Examination of Figure 2.13 reveals that these bases manifest the following properties: 0
3φ'ιο at
3φρι
01
η
9 ΦΊι 2
{ = £,, η = η ,
the node where it is defined
and 9φ\η ^Φοι ^ φ\ι -τ— /= -τ— /- . y ' = 0 σξ ση σξση 2
at all other nodal locations,
While (2.2.68) provides the general formulation, it is possible to rewrite this expansion in a form more clearly related to the one-dimensional expression (2.2.49). This is accomplished by defining new bases in the following way: (2.2.69)
f=ly
97"*
4
0j
+
+
^ φ '
^ +
J
37*
+
Ώ, φ
^
J
8^7"*
+
^
x
v
J
88
Basic Concepts in the Finite Difference and Finite Element Methods
where
31'
ι _
ι
dy
\
dy
\
2
Φχ.ν>-Φ||>
dx
dx
Comparison of (2.2.69) and (2.2.49) reveals that both are written in fundamentally the same form but with a different number of unknown parameters and bases. In the case of zero-order continuous polynomials, we found that an incomplete polynomial could be used to formulate bases. These were designated serendipity basis functions. This approach may also be used to considerable advantage in developing two-dimensional Hermite bases. The resulting approximating expansion is
(2.2.70)
37. f-
3*
Σ
^Φοο, + ^ Φ ι ο , - ^ ' + di 7= 1
+
J
37:
dr
9Γ,
dx
ι^Φου 3;r™;av
dy d ^
where we have omitted the superscript 1 from the bases to emphasize that they are not first-order continuous. These bases are presented algebraically in Table 2.7a and graphically in Figure 2.14. Equation (2.2.70) may be rewritten in the form of (2.2.69) as
(2.2.71)
Introduction to Finite Element Approximations
89
(c)
Figure 2.14. Two-dimensional serendipity basis functions formulated using Hermite polynomials.
where Φο,
=
Φοο,.
_ dx Φ^-Φ>ο>9Ϊ^ _ dy Φ>·7-Φιο,3^
+
+
dx Φου^^' ^y Φοι,9^·
Examination of (2.2.71) and (2.2.69) reveals a considerable saving in computational effort when serendipity rather than standard Hermitian bases are used. The degrees of freedom per node are reduced from six to three with serendipity bases. Experiments conducted using both types of bases in conjunction with the Galerkin formulation suggest that the two schemes are of comparable accuracy. The advantage of the serendipity scheme is even more pronounced in three-dimensional formulations.
90
Basic Concepts in the Finite Difference and Finite Element Methods
2.2.5
Approximating Equations
Each of the weighted residual schemes introduced to solve the one-dimensiona problem can be extended to two space dimensions. As illustrative examples, we solve the following problem using Galerkin's method with linear basis functions, and a similar problem using collocation and Hermite cubics. Example 1 Consider the problem of two-dimensional, time-independent heat flow in a rectangular plate with a heat source located at the center of the plate. The governing equations for this problem are (2.2.72a)
£(T)
(2.2.72b)
T(x,2)=\,
= T
xx
+T
= Q,
yy
(2.2.72c) (2.2.72d)
T (x,0)=0,
(2.2.72e)
T (2,y)
= 0,
(2.2.72f)
Q(x,y)
=
y
x
QJ(x-\)8(y
where χ and y are Cartesian coordinates, Q is the heat source, and δ is the Dirac delta function. The discretized domain of interest in this problem is illustrated in Figure 2.10. w
Step 1 Define the trial functions 9
(2.2.73)
T(x,y)^f(x,y)=
Σ
T^(x,y).
7=1
For convenience, it is advantageous to define basis functions in local (£, η) coordinates whereupon (2.2.73) becomes, for each element, 4
(2.2.74)
T(x,y)~f(x,y)=
Σ
Τ^(ξ,η)
7=1
and φ (ξ, η) are bilinear chapeau functions such as those illustrated in Figure 2.11a.
Introduction to Finite Element Approximations
91
Step 2 Formulate the integral equations using Galerkin's procedure. This is the special case of the M W R scheme wherein the weighting function has been defined as the basis function. O n e can also interpret Galerkin's scheme as the requirement of orthogonality between the residual R and each basis function, f R(x,y)t,{x,y)dxdy=0,
(2.2.75)
i = l,...,9,
A
J
where R(x,y)=t(f)-Q
(2.2.76)
and £ is defined by (2.2.72a). Substitution of (2.2.72a) and (2.2.76) into (2.2.75) yields [(f
(2.2.77)
A
J
xx
+ T -Q)*,(x,y)dxdy=O yy
/ = 1,...,9.
t
It is advantageous, but not mandatory, to apply Green's theorem to (2.2.77) to incorporate second- and third-type boundary conditions directly into the set of integral equations. Equation (2.2.77) becomes (2.2.78)
/ ( 7 > „ + 7 > „ + Qt,)dxdy-/(f l
+ f ,/, )φ,ds = 0,
x x
J
A
(
J
1
= 1
S
9,
where l and l are direction cosines with respect to the normal to the curve S, the boundary of the domain A. In this particular problem, the second term of (2.2.78) will be used to conveniently define the zero-gradient N e u m a n n boundary conditions of (2.2.72d) and (2.2.72e). Substitution of the trial functions, as defined by (2.2.73), into (2.2.78) yields the following set of algebraic equations: x
(2.2.79)
y
Jf J Σ Γ , ( φ „ φ , + φ,,φ ,) + (2Φ, J dx dy χ
-f (f l s
x x
κ
+ f l )*,ds=0, y y
/ = 1,...,9.
Because φ, is defined such that it is nonzero only over elements adjacent to node ; (see Figure 2.10 and 2.1 l a ) the integrations of (2.2.79) may be performed piecewise over each element and subsequently summed. Thus
•2
Bask Concepts in the Finite Difference and Finite Element Methods
(2.2.79) may be written Σ
(2.2.80)
f ((Σ
-\
WA/
(f I
s
x
x
Φ>ΑΙ)
+
t I )4>, ds^j =
+
y y
+
0,
Q4>1\
dy
i =
9,
where A is the area of element e, S is the curve bounding A , direction cosines. e
e
c
and l
are
a
Step 3 Formulate the matrix equation. In general, it is advantageous to express (2.2.80) in terms of the local (ξ, η) coordinate system to facilitate integration (see Figure 2.IS). This is easily accomplished provided that the relationship between derivatives of φ· in each coordinate system is readily available. T o obtain this relationship, we once again employ the chain rule to obtain
Hj _ Hj dx
3Φ>
8£ ~ dx 9ξ
dy
9η
_ 3Φ, dx
3JC
9η
|
dy dt
HJ dy dy
9η'
This set of equations is conveniently written in matrix form as
3Φ; (2.2.81)
dy'
3Φ, 9η
dx
9η
' 9φ, " dx
Η
3φ/ or
9JC
dy
9η
or
9φ,
' 3φ, " 9* 9Φ =[J) 9η
' 9Φ " 7
dx
;
dy
dy
9Φ>
dx ΘΦ; dy
9φ, 9η
where [J] is the Jacobian matrix. In our example problem [ / ] evaluated as (2.2.82)
1.0 [J\ = 0.0
0.0 0.5
(2.2.83)
1.0 0.0
0.0 2.0
is easily
As we shall see in the section on elements of irregular shape, the Jacobian matrix is not always this easily obtained.
Introduction to Finite Element Approximtioni
(0,0)
(2,0)
Figure 2.15. Rectangular element in (x,y) formed into coordinates.
93
<-t,-t>
(-4,0 coordinates and the same element trans-
Equations (2.2.80)-(2.2.83) may now be combined to yield the following equation defined in the local (ξ, η) coordinate system: 4
±
(2.2.84)
9
/
(/_'/_' ( t
- [
( t j
x
TA44> j4> + 4φ^φ ) (
+
f y l y )
φ,
ds^J
+
νί
fl
=
0,
i
β φ ι
=
^
WJr,
9,
N o t e that in changing the limits of integration to span the local coordinate system we introduced the relationship dxdy=dct[J]didr). Because the elements in our example problem are all of the same size, the four integrals appearing in each element in (2.2.84) are identical for each element. The assembly process, that is, the transformation from element to global integrations, is easily seen with the assistance of Table 2.8. Here we have tabulated the global nodal numbers corresponding to each element nodal number (element nodes are numbered counterclockwise from 1 to 4). For example, to find the global node corresponding to the local node 2 in element I, we move right along the second row to the column marked I, which corresponds to element I. Here a global nodal number 4 is given. Similarly, if
TABLE 2.8. Relationship between Local Node Numbers and Global Node Numbers for Problem of Figure 2.10
Global Nodes (Global Node Numbers)
Element Nodes (Local Node Numbers)
I
II
III
IV
1 2 3 4
1 4 5 2
2 5 6 3
4 7 8 5
5 8 9 6
Basic Concepts in the Finite Difference and Finite Dement Methods
94
TABLE 2.9.
1
\
7
I 1 7
ί •χ J
4
Evaluated Integrals for One Element in Local Coordinates for Equation (2.2.84)
1
2
3
4
ι3
1 6
\
1
1 6
1 6
2 3
1
I 3
1 3
1 6
6
_ 3X
_ 1 6
_X
a
3
6
we wish to establish the integral values associated with global matrix coefficient 7 = 4, 7 = 5, the first step is to find the equivalent local numbers. Examination of Table 2.8 reveals that these two global nodal identifiers appear together in columns marked I and III. Thus these two elements (I and III) contribute information to the global integral. The assembly procedure now calls for extracting information concerning integration at the element level from Table 2.8. From column I we see that global nodes 4 and 5 correspond to element nodes 2 and 3 in element I. Table 2.9 tells us that the contribution to the global integral attributable to these nodes is found in row 2, column 3; it is — This value is now placed in matrix location (4,5) of the global matrix. We are not through, however, because there is also information to be retrieved from element III. Table 2.8 locates this information in position (1,4) of the element matrix of Table 2.9, it is also — £· This value summed with the previous integral value is now placed in the same
TABLE 2.10. Evaluated Integrals for the Four Elements of Figure 2.10 in Global Coordinates for Equation (2.2.84)"
X 1 2 3 4 5 6 7 8 9
1
2
3
13
_ 1 6
0
_ i
6
0
_ 1 6 _ 1 3
0 0 0 0
i1
3 6 _ 1 3 _ 1 3 1 3
0 0 0
_ 1 6
a 3 0
_ 31 1
(.
0 0 0
4
5
6
7
8
9
-1 i31
1 3 1 3
0 _ i
0 0 0
0 0 0
3 8 3 1 3 1
0 0 0 0
- 1 3 4 J
0
4 3
_ 11
—1 03
1 6 _ 1 3
0
_ ΐ1 3 _
_ 3 1 6
0
_ 1 6 1 3"
0
1 3X — i _ —1 0
3 6
06
1 3
" i _ 1 3 1 6 4 3 1 6
_ 1 3 _ 1 6
0
_ 6X I 3
"Note that these values are obtained using the information from Tables 2.8 and 2.9 only.
Introduction to Finite Element Approximations
95
global matrix location (4,5). Combination of the two integrals yields the final value of - \ , which appears in Table 2.10 in row 4, column 5. It is important to understand the two-step integration process outlined above, because this is the procedure used in nearly all finite element programs. In general, the element coefficient matrix (Table 2.9) is different for each element because of changes in either element geometry or parameter values. Moreover, it is often necessary to perform the integrations of (2.2.84) numerically. Because of the local coordinate system we have selected, this is easily accomplished using Gaussian quadrature (as will b e outlined later). Superficially, it appears that an unnecessarily complicated procedure has been introduced to evaluate rather simple integrals. Introduction of these basic ideas at this point, however, simplifies the extension to more challenging concepts in later chapters. Step 4 Solve the matrix equation. It is now possible, with the information of Table 2.10, to solve our example problem. The matrix equation arising out of (2.2.84) is _
_ 1 _ 1
2 3 1
—1
0
_
3 1 6
_
1
4
6 6
3
0 0 0 0
0
6
I
3
~~ 1 0 0 0
τ,
-X
o
x
x
Ά
j{f l
x x
τ< T
6
3
0
()
3
«
- 1
3
3
-i
+
T l )^ds
+
t l )^ds
+
f l )^ds
y y
y v
y y
0
T
7
f{f l
x x
9
+
t l )^ds y v
0 0
Ά f{f l
x x
+
I 6
3
3
5
T
τ
x
_
_ 13
-\
f {TJ
j{t l
6 Γ) υ
- i
- i
3
s
3
3 i 3
-I
_ 1 6
0 0 0
υ
_ i 3
—1
v
0 0 0
3
3
3 _ i 3
3 .1 6
3
3
i
.1
—1
- i
υ
0
3
6
- l
1 6
f l )
9
X
3 _ 1 6
0
0 0 0 -
j
—
i
-
-{ —
0 0 0 0
_ 1
3
J-
_
f
_
6
1 6
0
1 6 2 3
Basic Concepts in the Finite Difference and Finite Element Methods
96
The line integrals appearing o n the right-hand side of (2.2.85) represent flux boundary conditions along the perimeter of the problem area. Through summation of element integrals, these line integrals vanish along interelement boundaries. The point source becomes a value specified at node 5 through the evaluation of the Dirac delta function. In general, when Dirichlet boundaries are specified, it is necessary t o expand a n d evaluate the line integrals. However, when C ° bases are used, one can condense rows containing the known temperature values out of the matrix equation. Rows 1, 2, 3, 6, and 9 may thus b e eliminated. The corresponding columns may also be eliminated by placing information pertaining to these nodes on the right-hand side of equations 4, 5, 7, and 8. The reduced matrix equation is _
_ 1 3 _ 1 3 _ 1
Ι
3 £ 3 _ 1 3
(2.2.86)
_
1 2
Ά τ
6
Ί
-β„ + Ι 0
1 3
I
3
1 2
or [A]{b)
(2.2.87)
=
{f).
Equation (2.2.87) may be solved directly to yield 0.783'
Ά
0.525
Τι
0.655
Ά
0.783
The coefficients T , Γ , Γ , and Γ represent the values of the temperature at nodes 4, 5, 7, and 8 because the basis functions are defined such that φ, is unity at node ι and zero elsewhere. The analytical solution for this problem is (Tang, 1979) 4
5
7
8
T =
U+V+W,
where u
=
2
S sin[(/i + j-)ir(a - j>)/a]cosh[(ii + j >u-x)M π
y
=
2
„ίο
(n + ^)cosh(,t +
S cosh[(n + ±)vy/a]nn[(n + * nio (« + i)cosh(n + i)7r
])7r i)wx/a]
sin[(« -r4)wx/a]sin[(n + i)w£/a] VV
_2
S
~*Λ>
sin\i[{n + ^)ιτ(α-y)/a]cx)sh[(n
(« + i)cosh[(« + i)ir]
+
\)ιτη/α]
Introduction to Finite Element Approximations
97
E L E M E N T NUMBER
(0,0)
(4,0)
(2,0)
(a) COLLOCATION ^ POINT
(1,-4)
M.-O (b)
Figure 2.16. (a) Collocation net in ( x , y) coordinates, (b) One element of collocation net in (£, n) coordinates.
where a is the length of the side of the square (a = 2), and ζ and η are the χ and y locations of the heat source, respectively. The analytical solution for the nodal locations 4, 5, 7, and 8 is 0.756, 0.127, 0.719, and 0.756, respectively. It is evident that the numerical solution at the singular point (1,1) is not very accurate. This is not unusual inasmuch as we are attempting to represent a rapidly varying function with four bilinear elements. We will see in Chapter 4 that special trial functions can be used to circumvent this difficulty.
Example 2* In this example we consider the solution of Laplace's equation on a square region using the collocation method. T h e problem is illustrated in Figure 2.16 •The calculations for this example were made by Michael Celia, a research assistant in the Department of Civil Engineering, Princeton University.
98
Basic Concepts in the Finite Difference and Finite Element Methods
and the governing equations follow: (2.2.88a)
£o(«) = « « + «
v v
=0,
(2.2.88b)
u (0,y)=0.
0<>><2,
(2.2.88c)
«,(2,^)=0,
0
x
(2.2.88d)
« ( x , 0 ) = 3 - x,
0<x<2,
(2.2.88e)
I I ( J C , 2 ) = 3 - x,
0<x<2,
where u may have a number of physical interpretations such as electrical potential, temperature, or hydraulic head. Step 1 Define the trial functions. In this case we use cubic Hermite polynomials as basis functions. Thus the trial function for each element is written [see (2.2.69)]* 4
(2.2.89)
u(x,
y)<*u(x,
a t/ ^-ώ 3JC dy 2
1
+
.
Σ
y)=
d u.
d U,
dx
dy
,
+
317. , ^
y
j
2
2
+
W.
Ujtij + J^tij
2
φ'
,
where Φο/
Φοο, -
-
dx Φ>ο,3^
Φν7-Φ.ο,9|>
dx dx Φο.,9ην+Φ, £
.
2
+
υ θ
+
dy Φ ο υ ^ + Φ.υ
η 7.
3 y dx .
3x 3 ^ 3η 3 ?
9 £ 9
θ η
y
3η 3 £
J
3x 3 X
,
_
,
dy dy .
•Note that the .x and ν subscripts do not denote partial derivatives in this equation.
Introduction to Finite Element Approximations
99
Because we are using square elements in this example, dx/dr\ the following simplifications are possible: (2.2.90)
φ!,, = φ'
Φ ί „ = φ' „ = 0, ν
ι
_
ι
dy dx .
ι _
ι
— dy/di
= 0 , and
|07
dy .
Combination of (2.2.90) with (2.2.89) yields the appropriate trial function for a single element: dU
4
(2.2.91)
u(x,y)~u(x,y)=
2
dxdyV^dn
U^
+^ \
Wj
dU
Ά
χ
0
j
^ J
+
a
v
jftin^J
di J
It can be seen through a comparison of Figure 2.16a and b that dx/d£ dy/df\ = {- in this particular example.
=
Step 2 Formulate the approximating algorithm using the collocation procedure. In this case of the M W R , the weighting function is chosen to be the Dirac delta function specified at the 16 Gauss points ( x , , >>,). Thus we obtain (2.2.92)
f (R(x,y)8(x-x,,y-y,)dydx=0,
i = l,2
16,
where R(x, y) is the residual defined as R(x,y)=t (u)
(2.2.93)
0
and £ ( •) is defined in (2.2.88a). Substitution of (2.2.93) into (2.2.92) yields 0
(2.2.94)
jj£ (u)8(x-x„y-y,)dydx=0, 0
, = 1,2,..., 16.
We now transform (2.2.94) from ( x , y) to (ζ,η) space, not because it is particularly valuable in this example, but rather to provide a foundation for more complex formulations to follow in later sections. In (ξ, η) coordinates
100
Basic Concepts in the Finite Difference and Finite Element Methods
(2.2.94) becomes, for each
element,
f(Q (u)S(i-i , - )dei[J]d dt
(2.2.95)
o
k V Vk
= 0,
V
* = 1,2,...,4,
where [J] is the Jacobian matrix of (2.2.81). Let us now substitute for the operator £ ( « ) in (2.2.95): 0
(2.2.96)
(((u
+ u )Stt-i , - )det[J]d di
xx
vv
k v Vk
k=
= 0,
v
\,2,...,4.
From the definition of the Dirac delta function, we can rewrite (2.2.96) as (u
(2.2.97)
xx
+ u )det[J]\ =0, yy
* = 1,2,...,4,
(tiii
where (£*, T J ) is the coordinate of the &th Gauss point. Introduction of the definition of the trial function (2.2.91) into the collocation expression (2.2.97) yields, in a given element, a
(2.2.98)
Η I
+
l u'dx^
+ ^
2
3 x 3 ν 3r, H
J
3t/. dy
9 >
^
2 -·>) φ
+
dx
+
\
U
dv dy
2V0>J
dxdy
^ j j - ^
^ 2 V
VUj dy
, J
j
d
V
dx d£
J
+
9
2
"ioy
^
, dy *" 2
J
det[7]
= 0,
* = 1,2,...,4.
Step 3 Formulate the matrix equation. To evaluate (2.2.97) we must calculate the determinant of the Jacobian matrix and establish a transformation for the second-order derivatives from the ( x , y) to the (ξ, η) coordinate system. dy/dη, T h e Jacobian is obtained directly from the definitions of 9 x / 9 £ and which are observed to be \ from Figure 2.16, as mentioned earlier. Thus we
Introduction to Finite Element Approximations
101
obtain dx Κ det[/] = dx
(2.2.99)
dy 3? dy dη
4"
i
ο
T o transform the derivatives, we once again use the chain rule expansion (2.2.100) 3 Φ_ 2
3*2
d ΙΒφ\ dx { dx ) Α/^Μ dx \ 3£ dx
=
_/3£\ I dx)
2
3Φ 3£ 2
2
3 £3φ 2
+
3x
2
3£
+
+
^ 9 η \ dη dxj
/^^^_3_\/3φ3|3φ37ΐ\ \ dx 3£ dx dy j \ 3£ dx 3ij dx j
=
3{ 3η 3 φ dx dx 3£3τ,
/3η\ 3φ \ 3JC/ 3 ^
2
2
2
3^,.3φ 3JC 3 ^ ' 2
Because of the geometry, this particular problem (2.2.100) reduces to (2.2.101.)
'
and similarly (2.2.101b)
i^^(M) dx
1
3y
=
de\dx)
^ = 3 W M 2
2
( 4
de
2 =
3T,M W 9
^
3 J *
3η
(
), }
4
)
.
2
The final equation to be evaluated at each collocation point is obtained by substitution of (2.2.101) and (2.2.99) into (2.2.98): (2.2.102)
* = 1,2
4.
102
Basic Concepts in the Finite Difference and Finite Element Methods
It is important to recognize that (2.2.102) is written for one element only. It contains 16 unknowns while generating only four equations. When this equation is evaluated for all four elements, we will have 16 equations, but there will now be 36 unknowns. However, the number of unknowns will reduce to 16 when the appropriate boundary conditions are imposed. Step 4 Solve the algebraic equations. T o solve the algebraic equations associated with (2.2.102), we first evaluate this equation for each element. The resulting element equations are Η,,
Η,-,
//•·>
H
Η 22
Η 23
24
#3.
#32
Η-33
34
#4,
Η,42
#43
#4
2]
(2.2.103)
Η 14 =0
or [/7]{χ}=0, where the elements of [H] and {x} are row and column vectors, respectively, that is, 1 / Θ
ι 2
a \ 3 |
2
1
2
3
2
3
2
2
3η
W. 3(7, 3 t7, U ——3x ' dy 3 x 3 y 2
It should be noted that [H] is not a square matrix inasmuch as there are only four collocation points (k = 1,2,3,4) and 16 undetermined coefficients in {x}. Once the element coefficient matrix [H] is generated for each element, we must assemble this information into a global matrix. We recognize that many of the undetermined parameters in {x} are common to two or more finite elements. This assembly process generates a (16 X 36) global coefficient matrix. The associated global vector of unknowns is (2.2.104)
{G} = [ { g } „ { g M g } 3
{«ΙοΓ,
Introduction to Finite Element Approximations
103
where Γ
dU
W
m
dU \ 2
m
T
m
T o obtain a tractable set of equations, we impose the four boundary conditions specified in (2.2.88). This reduces the number of unknowns to 32. It is possible, however, to extract additional information from the boundary conditions. For example, because u = 0 along the side defined by x—0, the cross derivative d/dy (d/dx) must also vanish along this side. Thus we have generated an additional constraint on the global system of equations. Similar arguments lead to the following additional constraints: x
3(7 (2.2.105a)
= - 1 ,
y=4,6,
3 t7, 2
' < > ' . (2.2.105b) dx~dy~=°< y We now have a total of 20 constraints (see Figure 2.17), 16 degrees of freedom, and a tractable system of equations. The solution to this set of equations and a comparison with the analytical solution is given in Table 2.11. Because the corner nodes are singular in terms of 3M/3JC, an alternative set of constraints, in which Wj/dx — — l,j = 1,3,7,9, is also possible. In this case, however, it is more difficult to argue the disappearance of the cross derivative. Before leaving this introduction to the fundamental concepts underlying the finite element method, let us consider briefly the relationship between finite element and finite difference methods. =
1
2
3
7
8
U * 2 6
U = 3 3
U,»3«0
U» * 0 2
3
6
9
9
u9< t U , «0 U, -0 9
> 9
2
5
8
U„ «0
U< * 3 4 U„ » 0 φ Uxyl* 0
U«8*0 U,, «0
> 2
8
4 U4 • 2
7
u · t 7
U,
· 0
7
U,, »0 7
Figure 2.17. Dependent variable constraints for the collocation formulation using Hermite polynomial bases.
Basic Concepts in the Finite Difference and Finite Element Methods
104
TABLE 2.11. Collocation and Analytical Solutions for Problem Described by Equation (2.2.88) and Illustrated in Figure 2.17
Collocation Solution
Dependent Variable
—1.553 2.384 8.325 X H T ' 1.553 3.322X10" 5.427X10" 1.999 -5.715X10"' -8.240X10" -1.256XIO" 1.474X10" -5.427X10" 1.553 1.616 7.372 X 1 0 " -1.553
Uy, U
Analytical Solution
2
Uy2 Uyi
Percentage Error
2.325 6
16
0.0000
2.5 0.0
0.0000
0.0
2.000 0.0000
0.0 14 0.0
0.0000
0.0
1.675 0.0000
3.5 0.0
2
u U u
x
t
x
S
A
5
-0.5000
1 7
Uyi
1 5
u
x
v
S
16
Uyt
2
u
x
r
t
Uyi u,
1 7
Vyl Uy,
2.3
RELATIONSHIP BETWEEN FINITE ELEMENT A N D FINITE DIFFERENCE M E T H O D S
In Sections 2.2.1 a n d 2.2.2 we considered the relationships between the various weighted residual approximations. Let us n o w compare the finite element a n d finite difference methods to establish whether there are any features common to both. Consider once again the two-dimensional heat flow problem of the preceding section, but with the nodes renumbered as illustrated in Figure 2.18. Because node (0,0) is interior to the domain, the equation associated with that node can b e used t o demonstrate the general form of the finite element approximation. In other words, row 5 of the coefficient matrix of (2.2.85) does not reflect the influence of boundary conditions imposed on the system. When this row of the matrix equation is expanded, the resulting equation is (2.3.1)
i ( 7 - i . - i + 7 - . + 7'_ . + 7 . _ - 8 7 Ό . Ο - τ - ^ , + Γ , . . , ,
,
l
0
1
l
0
l
+ T
K0
+ T) lA
= Q. w
Although this expression cannot b e readily interpreted in terms of standard finite difference notation, it can b e rearranged to make the relationship more
Relationship Between Finite Element and Finite Difference Methods
105
y -1,1
2.0
n
1.5 -i.o
I
0.5
•
0.5
0.0
-hFigure 2.18. Discretized domain for two-dimensional heat flow. Finite element nodes are indicated by dots and elements by Roman numerals (numbering as used in the finite difference scheme) (from Pinder and Gray, 1977).
apparent. The rearranged form (which is obtained primarily through ingenuity and insight) is (2.3.2)
i
{(ϊ"ι.ι -2J"o.i +
4(r,.
)+
^-1.1
-2Γ
0
0 - 0
+
Γ_ ,. ) 0
+ ( Γ . _ - 2 Γ , _ + Γ _ . _ ) } + * { ( Γ . - 2 Γ , + 7', _ ) 1
1
0
ι
1
1
ι
+ 4 ( Γ . - 2 Γ , ο + Γ ._ ) + ( Γ _ , - 2 Γ _ 0
1
0
0
1
1
1
1
Ι
1 < 0
0
ι
1
+ Γ. ,_ )} 1
1
It can be shown (Gray and Pinder, 1976) that (2.3.2) is a special case (h = k — 1) of the more general expression (2
α χ\
h
k
(
T
\,\~
2 T
o,\
+
T
~\,\
,
7 4
*l,O~
Γ,,.,-ΣΓο,., + Γ , , , , , ] A I ^ ο,\ τ
2 7
ο.ο
7
ο.-ι
+
O,0
+
7
'-l.0
ftfcf 1
J
2
+
2 7
Τ'-ι,ι
Γ,,,-ΣΓ,,ο + Γ,,.,
6
27'-ι,ο + '
k
2
1,-1
106
Bask Concepts in the Finite Difference and Finite Element Methods
Finally, if we assume node (0,0) to be the more general point of reference ('«j\ obtain an expression that is clearly related to a finite difference approximation: w
(2
34)
e
Mcf^+i^+i 6 [
27]
J +
h
^T
! + 7]_, j ! +
l + i
h
2
2
+• hk j
27]+, + T y
6 1 ^Ί-i.j+t
7j -
[ + 1
t7
*2
27]_,
2r, + r, _ J
Λ
+ 7j_,
y
+l
y
1
2
^_
Equation (2.3.4) can be written more compactly using the symbolic notation of Table 2.1: (2.3.5)
^ { f t , +48X + i X } + l
r l
It is apparent from (2.3.5) that the finite element equations can be interpreted in terms of weighted-average finite difference approximations. But can the weighted averages themselves be interpreted in terms of standard finite difference theory? T o examine this relationship further, let us consider the well-known Simpson's rule of numerical integration. Simpson's rule for one-dimensional integration in a two-dimensional space is
k
dT
5
b
90dx dy 2
4
'"'
References
107
which provides a fourth-order-accurate integration using three discrete values. Replacement of the continuous derivatives of (2.3.6) by their difference counterparts yields the following: (2.3.7)
± Γ η
y
J
k
=
Vj+>
= y,-,
8X dy k
=
k
{«Χ,-,
+
in
k
aT
5
6
|
When (2.3.7) is substituted into (2.3.5), we obtain
U
~ }j - \
x
k
~
t~
x
I
Division by hk gives the alternative form
1 /• v* = v,+1 δΖ* L 2
1 r k - •*!+1 δ» 7Λ , x
π
It is now apparent that the finite element equations, defined over a rectangular subspace and formulated using chapeau basis functions, can be interpreted as integrated averaged finite difference approximations. Because this expression is 0(h ) in approximating the derivative and 0 ( Λ ) in performing the integration, the overall approximation is of 0(h ), the same as that achieved by the finite difference method on the same grid. However, the two approaches do not always generate schemes of the same order of accuracy, as demonstrated in later chapters. Moreover, the order of accuracy is only one indicator of computational performance and we see that, in fact, the solutions obtained using the finite element and finite difference methods on the same grid can be quite different. Although the analysis presented above involved only secondorder derivatives, an analogous development is possible for higher dimensions and for derivatives of other orders. 2
4
2
REFERENCES Biezcno, C. B. and J. J. Koch, "Over een Nieuwe Methode ter Berekening van Vlokke Platen met Toepassing op Enkele voor de Techniek Belangrijke Belastingsgevallen," Ing. Grav., 38, p. 25-36, 1923. Bubnov, I. G., "Report on the Works of Professor Timoshenko Which Were Awarded the Zhuranskii Prize," Symp, Inst. Commun. Eng., 81, All Union Special Planning Office (SPB), 1913. DeBoor, C. and B. Swartz, "Collocation at Gaussian Points," SIAM J. Numer. Anal., 10, 4, p. 582-606, 1973.
108
Basic Concepts in the Finite Difference and Finite Element Methods
Doherty, P. C , "Unsaturated Darcian Flow by the Galerkin Method," U.S. Geological Survey Computer Contribution, Program C938, 1972. Finlayson, B., The Method of Weighted Residuals and Variational Principles, Academic Press, New York, 1972. Galerkin, B. G., "Rods and Plates. Series in Some Problems of Elastic Equilibrium of Rods and Plates," Vestn. Inzh. Tekh. (USSR), 19, p. 897-908, 1915. Gartner, S., "Tragermethode—ein Neuartiger Defektabgleich zur Berechnung von Anfangswert— Problem mit der Methode der Finiten Elemente," Dissertation, Tech. Univ. Hannover, 1976. Gray, W. G., and G. F. Pinder, "On the Relationship between Finite Element and Finite Difference Methods," Int. J. Numer. Methods Eng., 10, p. 893-923. 1976. Mikhlin, S. G„ Variational Methods in Mathematical Physics. Macmillan, New York, 1964. Pinder, G. F. and E. O. Frind, "Application of Galerkin's Procedure to Aquifer Analysis," Water Resour. Res., 8. I. p. 108-120, 1972. Pinder, G. F. and W. G. Gray, Finite Element Simulation in Surface and Subsurface Hydrology, Academic Press, New York, 1977. Prenter, P. M., Splines and Variational Methods, J. Wiley, New York, 1975. Salvadori, M. G. and M. L. Baron, Numerical Methods in Engineering, Prentice-Hall, Englewood Cliffs, N.J., 1961. Slater, J. C , "Electronic Energy Bands in Metals." Phys. Rev., 45. p. 794-801, 1934. Tang, D. H., personal communication, 1979.
Finite Elements on Irregular Subspaces
3.0
INTRODUCTION
The basic concepts of finite element analysis were introduced in Chapter 2. In that discussion we tacitly assumed that the domain of interest was subdivided into elements of rectangular geometry similar to the standard finite difference approach. One of the advertised advantages of finite element schemes, however, is the ability to consider a wide range of element geometries. Although the most commonly encountered element is the triangle, there are many other shapes, including some higher-order forms with curved sides. This chapter is devoted to the description of commonly encountered finite element forms and their utilization. We borrow many of the transformation concepts introduced in Chapter 2 to facilitate integration over irregular elements. For the triangular element with straight sides, we develop relatively simple integration formulas. The more exotic elements, however, require the use of numerical integration. The triangular element is considered first, although in some ways its development is more conceptually difficult than the more general formulations presented later.
3.1 3.1.1
TRIANGULAR ELEMENTS The Linear Triangular Element
The triangular element with straight sides is universally associated with the finite element method. It is the simplest element that permits an accurate representation of an irregular domain. Because of the difficulty encountered in integrating over irregularly shaped triangles, it is necessary to introduce, at the outset, a convenient natural coordinate system. 109
1-3»*
Figure 3.1. Triangular finite element in Cartesian and natural coordinates.
(t>) 3.1.2
Area Coordinates
The natural coordinates we use are called area coordinates and are analogous to the (ξ, ij) system introduced in Chapter 2 to facilitate integration over rectangles of varying geometry. As the name implies, area coordinates are related to the area of a triangle, as indicated in Figure 3.1. Each coordinate L, is defined in terms of the triangular subarea whose base is the line L, = 0 , and vertex is the point £., = !, that is, (3.1.1)
A '
1* =
A '
-+,
where Λ = Σ ? , Λ , . Examination of the properties of L, reveals that they fulfill the requirements of bases defined on a triangular subspace. That is, L, is unity at node / and zero at any other node, and L, + L + L = 1. These functions can be readily expressed in terms of global ( x , v) Cartesian coordinates using the geometrical relationship of Figure 3.1. The area of a triangle is written in terms of the Cartesian coordinates of its vertices as =
2
1 (3.1.2)
A = ±det
Λ y-i
3
111
Triangular Elements
Consequently, the L , area coordinate and basis function is defined by
det (3.1.3) det
1
x
2
1
x
3
1
χ
y .
y
2
1
x.
y\
1
x
yi
1
*
2
3
or
(3.1.4)
x y3
1 2A
2
2
\yi
x
-xjy
_
2
*2>Ί
Λ "Λ
*3 *2
Λ
χ, — χ
>Ί " Λ
Χ
_
3
*|
— 2
Let us now examine how a typical integral arising in Galerkin's method can be evaluated using the L, basis functions. Consider the integral (3.1.5)
dx
dx
dxdy,
where A is the area of a triangle of arbitrary geometry such as illustrated in Figure 3.1a. Our first task is to rewrite the derivatives in this integral in terms of area coordinates. From the chain rule, we obtain (see also Section 2.2.5) dL,
(3.1.6)
dx
dL,
dL,
3L, ,
ν
'•I
dx ,
3L
+ ^
dL . 2
2
dx
In (3.1.6) it is important to note that the third coordinate is a function of the other two, L = L ( L , , L ) , because only when this is clearly understood are the partial derivatives with respect to L , and L meaningful. Notice that the derivative for 7_ is expressed only in terms of L , and L , 3
3
2
2
3
2
dL 3 _ dx
dL,
dL 2
dx
dx '
This is readily verified by substitution of L for L, in (3.1.6). Similar expressions are generated for the derivatives with respect to y . By differentiating L , , L and L as defined in (3.1.4) with respect to x, we can evaluate the right-hand side of (3.1.6) directly: 3
2
3
112
Finite Elements on Irregular Subspaces
Substitution of (3.1.7) into the integral (3.1.5) yields (3.1.8)
(yz-y\) 9L,
{y^-yM^xdy
9L,
Before attempting to evaluate this expression, it is worthwhile to introduce the following relationship for integrating polynomials in L,\ (LT>L^L^dxdy J
(3.1.9)
= 2A-
A
m[!m !m !
. , (m, + m + m + 2 ) ! 2
3
3
2
where m , , m , and w are positive integers. Because, in this example, the integrand of (3.1.8) is a constant, m, = m = m = 0 , and we obtain 2
3
2
.
(3.1.10a)
4A
3
9L,
(Λ >Ί) -
\ dL
2
t
9L,
3L,
(ν ->Ί)·Μ
3L,
3
or (3.1.!0b)
/· 9L 9L, ι l ^ j ^ s ^ d x d y ^ ^ y ^ - y ^ K y ^ - y ^ ) ,
where the i and 7 indices are cyclic 1 < i, j < 3. For example, when 1'· — 3, / + 1 refers to vertex 1. The formula for integration of the y derivative product is obtained in an analogous manner to that presented above and is
(
3
1
n
)
1 4l"(*<+2
C dL dL J ~dyJy dxdy=
A
V 2 V > ) -
-
-
Another commonly encountered integral is (3.1.12)
I =
JL,Ljdxdy.
When ϊφ j , wi, = m = 1, m = 0 , and (3.1.9) yields 2
(3...13,
/
3
/
Λ
Λ
φ
=
2
, ( β Ο
=
^ .
Triangular Elements
113
When the subscripts are the same (i.e., i = j), m , = 2 , m = m ~0, obtain 2
fL,L,dxdy
(3.1.14)
= 2A^
3
and we
= lA.
Whenever the integrand is a polynomial, (3.1.9) leads to an efficient integration formula. In the event that axisymmetric problems are encountered, however, the radius appears in the denominator of the integrand and it is n o longer a polynomial. Under these circumstances, either an approximate average radius over the triangle may be assumed with the resulting constant radius taken from under the integral, or numerical integration may be used. Several schemes have been developed for numerical integration over triangles. They have the general form / = ff(x,y)dxdy
(3.1.15)
Σ /(*>.^>Η
=
J =
Λ
1
in global coordinates, and in local coordinates /= C
(3.1.16)
( ~ g(L,,L )2AdL,dL l
L2
2
= 2A 2
g{L ,L )w u
2j
2
jy
7=1
where we have used the relationship (Connor and Will, 1969) dxdy =
(3.1.17)
2AdL,dL . 2
Integration such as indicated in (3.1.16) is performed over the element indicated in Figure 3.1b and (3.1.17) is the area transformation. Note that the integrand has also changed in going from (3.1.15) to (3.1.16) because the derivatives with respect to the global coordinates must now be expressed in the L, coordinate system [see (3.1.6)]. Appropriate values of n, L, and w are tabulated in Table 3.1 for polynomial forms of g up to fifth degree. Although the derivatives 3 L , / 9 x and dL,/dy are easily evaluated, this may not be true for more complicated basis functions. In general, it is necessary to formulate the Jacobian matrix and invert it to obtain the χ and y derivative expressions. Thus, applying the chain rule to the general basis function φ, = <j> {L , L , L (L , L )}, one obtains r
l
l
2
3
t
2
f
114
Finite Elements on Irregular Subspaces T A B L E 3.1.
η
Polynomial Degree
Quadrature Formulas for Triangular Finite Elements
1
^2 f
r
1 Linear
1 0.333 333 0.333 333
0.333 333
0.500 000
3 Quadratic
1 0.500 000 0.500 000 2 0.000 000 0.500 000 3 0.500 000 0.000 000
0.000 000 0.500 000 0.500 000
0.166 667 0.166 667 0.166 667
4
1 2 3 4
0.333 0.600 0.200 0.200
333 000 000 000
0.333 0.200 0.600 0.200
333 000 000 000
0.333 0.200 0.200 0.600
333 000 000 000
-0.281 0.260 0.260 0.260
250 417 417 417
1 2 3 4 5 6 7
0.333 0.797 0.101 0.101 0.059 0.470 0.470
333 427 287 287 716 142 142
0.333 0.101 0.797 0.101 0.470 0.059 0.470
333 287 427 287 142 716 142
0.333 0.101 0.101 0.797 0.470 0.470 0.059
333 287 287 427 142 142 716
0.112 0.062 0.062 0.062 0.066 0.066 0.066
500 970 970 970 197 197 197
Cubic
7 Quintic
From Brebbia and Connor. 1973.
Equation (3.1.18) can be written in matrix form as 3φ,
(3.1.19)
dL,
3L
2
2
L,
2
or " 3φ, " (3.1.20)
dL, 3φ,
3L
3φ,
Li dx d
dL, dx
3φ,
dL
dy
3*
= [J\
' d
dy
2
where \J] is the Jacobian matrix. The χ and y derivatives of the basis functions, defined in the local coordinate system, can now be obtained from ' 3φ, " (3.1.21)
dx
3φ,
dy
=uv
l
dL, 3φ,
3L
2
Triangular Elements
115
which is analogous to the expression obtained for rectangular elements [i.e., (2.2.81)]. Although the evaluation of the elements of the Jacobian matrix is relatively straightforward in the case of regularly shaped rectangles, it is somewhat more cumbersome for triangles. The transformation of the general triangular element to the equilateral of Figure 3.\b is achieved using the same functions as those adopted as bases for the unknown solution t5(x, y). The appropriate relationship is (3.1.22a) i= l
(3.1.22b) ;=l
where x, and y are Cartesian coordinates of the nodes of an irregular triangle. It is easily shown that when φ, is specified as L there is a one-to-one correspondence between the nodes in the local and global system, and the straight-line geometrical relationship between nodes in both systems is preserved. To evaluate the Jacobian matrix equations, (3.1.22) are differentiated to yield (
r
dx dL, dy_ dL,
'2
1
= 1
dx dL,
'dL,
= 1
i
=l
_4
dy_ dL,
3*1
= 2y, dL, ι
-ι
'dL, 9φ,
As an illustrative example, let us consider the case of linear triangles wherein φ, = L These expressions become r
dx dL, dy_ dL,
3x dL,
x, - x ; 3
dy_ dL,
'•y\-yi>
/-I
and the Jacobian matrix is (3.1.23a)
c
c
i - *
3
i~ 3 x
yi-yj y-L~y-i
116
Finite Elements on Irregular Subspaces
The determinant of the Jacobian matrix, det [J], is generally referred to as the Jacobian. (3.1.23b)
de\[J] = (x,-x,){y
- y,)-(x -x,)(
2
(3.1.23c)
2
Λ
[/]
Λ
_
Λ
-
-y,)\
y]
J'I
det[7)
Examination of (3.1.23b) and the determinant of (3.1.2) reveals that they are identical, which indicates that
aet[J] =
(3.1.24)
2A.
Thus the incremental area relationship of (3.1.17) can be rewritten dxdy=dei[J]dL dL ,
(3.1.25)
l
2
which is a well-known relationship and was employed earlier in (2.2.84). Equation (3.1.23c) may now be used in conjunction with (3.1.21) to obtain the global derivatives. For example, the case of φ, = L , yields ' 3L, ' (3.1.26)
dx 3L,
1
yi ~ r
3L,
Λ - y\
3
~ 2A
x,
2/1
3L,
31,
-x.
3L,
which is easily verified by comparison with (3.1.4). 3.1.3
The Quadratic Triangular Element
The preceding section introduced the basic principles behind triangular finite elements using the linear triangle as an example. As in the earlier case of rectangular elements (Section 2.2.4), we now extend our linear analysis to consider the case of quadratic basis functions. T h e quadratic element is illustrated in local coordinates in Figure 3.2a. In contrast to the linear triangle, three nodes must now appear on each side in order to allow a quadratic approximation. The quadratic basis functions are generated by first assuming a general second-order approximation of the unknown function tJ over the element. The polynomial is then constrained such that u ( x , , y )—V at the ith nodal location (/' = 1,2,... ,6). The starting point is a quadratic polynomial written in the local coordinates L, and L that is, i
l
2
(3.1.27)
φ,• = a + bL + cL + dL] + eL\ + }
2
fL L . 1
2
Triangular Elements
117
L M 3
Figure 3.2. Quadratic (a) and cubic (b, c) triangular elements.
We now impose six constraints for each basis function. Each function must be unity at the node for which it is defined and zero at all other nodes. For the basis function at node 1, we obtain 1 1 0
" 1' 0
1 0
I 2
ι
0 0
0 0
0
0 0
0 i
0
4
ι
2
2
0
0 0
0 i 4
i 4
0 0
Equation (3.1.28) may be solved for the vector of unknown coefficients to yield (3.1.29)
[a,
b,
c,
d,
e,
/ ] = [0, r
- 1 ,
0,
2,
0,
0) . T
When an equation analogous to (3.1.28) is generated and solved for each basis
118
Finite Elements on Irregular Subspaces
T A B L E 3.2.
Linear, Quadratic, and Cubic Basis Functions for Triangular Elements
Functions Quadratic
Linear
Basis
Cubic |Z. (3L -l)(3L,-2) 1L,L (3L,-1) |L,Z. (3L -I) K (3L -l)(3L -2) |L L,(3i. -l) K L (3L -I) iL (3L -l)(3L -2) iL L,(3L,-l)
2L]-L,
Φι Φι Φ
^3
Φα
—
4L L
Φ Φ* Φι
—
2L]-L,
—
—
4L L, — —
—
—
—
—
4L L t
3
5
φ Φιο 9
1
2
2L\-L
2
2
2
3
2
2
2
2
2
3
—
φ»
l
2
2
2
3
3
3
3
3
3
27L,i. Z. 2
3
function, the formulas recorded in Table 3.2 are obtained. Because these bases are polynomials in L,, the integrals generated in the Galerkin formulation can generally be evaluated using (3.1.9). When numerical integration is required, as in the case of elements with curved sides (discussed later), (3.1.16) can be used. 3.1.4
The Cubic Triangular Element
The extension of the concepts introduced for quadratic elements to consider cubic polynomial bases is relatively straightforward. The point of departure is the cubic polynomial expansion (3.1.30)
$=a
+ bL + cL + dL\+eL\ x
+ hL L\ l
1
+ iL, +
+ fL L ]
2
+
gL]L
2
jL\,
which involves 10 coefficients. Nine of the nodes required to define a cubic basis can be conveniently located along the edges of the triangle as indicated in Figure 3.2b. The tenth node is located, for convenience, at the centroid of the triangle. The vector of unknown coefficients can be readily evaluated using an expression analogous to (3.1.28). The resulting basis functions, once again defined in local L, coordinates, are tabulated in Table 3.2. In our discussion of cubic elements in Chapter 2 we suggested the possibility of using Hermite polynomials as basis functions. Recall that this approach replaced function values at interior and side nodes with function derivatives at corner nodes. In the two-dimensional case, rather than solve for the function ύ, at / = 1,2,..., 16, we sought
Triangular Elements
119
TABLE 3 3 . Cubic Basis Functions for Elements with Continuous 3«/dx and 9A/9y at Nodal Locations Basis Function
Functional Form
0ooi
/. (L,+3L +3L3)-7L,L L3
0ιοι
L ( a Z , - a L ) + (a -
0011
L (A L -A3L )+(/> -* )L L,L
0002
L^(L +3Z. +3L )-7L L L
0102
L|(a,L -
0012
L (b L,
0003
L](Lj + 3 L , + 3 L ) + 7 L , L L
0103
Z.|(a L -e /- ) + (e,-e )£, L Z-
2
2
2
a )L L L
2
3
1
2
i
2
3
t
2
3
2
2
2
3
2
3
3
3
I
1
Β ί.,)+(Β 3
3
- b.L^+i^
2
3
2
2
2
1
l
2
-
b )L L L, 3
2
2
3
- a,)L,L i-3
2
2
3
2
t
2
3
1
2
3
0013 27L,L L
0004
2
a,
= *A
~ *,
3
= >> ~ Λ
After Felippa, 1%6.
A similar approach can b e developed for triangular elements. In lieu of obtaining 10 values of the function we seek the function and its χ and y derivatives at the corner nodes of the triangle and the function alone at the centroid. N o t e that unlike the complete Hermite element, here d c/dxdy is not continuous at the nodes. This yields the 10 degrees of freedom we require to correctly define cubic interpolation. T h e element corresponding to this type of formulation is illustrated in Figure 3.2c and the corresponding bases, which are obtained in the same manner as the Hermites of Chapter 2, are given in Table 3.3. These bases represent the unknown function ύ within a given element as 2
(3.1.31)
ύ=
A «i 2 Uj**j + Σ
in a manner analogous to (2.2.71).
d
u
,
^
dx
a
i
da ; ^
dJt
^
120
Finite Elements on Irregular Subspaces
Because the basis function at the centroid interacts only with the nodes within the element for which it is defined, it can be eliminated from the global system of equations. In other words, one can express the coefficient at the centroid as a linear combination of the other nine coefficients. This is true for either type of cubic formulation. Thus one decreases the number of unknowns in the final matrix equation. The value at the centroid can, of course, be calculated later from the corner values. This procedure is commonly called "static condensation" in the structural engineering literature. 3.1.5
Higher-Order Triangular Elements
In the preceding section we examined the use of elements that exhibited continuity of the first derivative at nodal locations. It is also possible to require additional continuity constraints at the expense of calculating additional degrees of freedom at each node. Several elements of this kind have been formulated for structural engineering applications where an accurate representation of the strain is required along with displacement. This situation arises, for example, in the bending of plates. In general, a more accurate representation of the first derivative is achieved with elements of higher-order continuity. This may not always be the case, however, in the neighborhood of a discontinuity, where a large number of lower-order elements may be superior. It must also be kept in mind that, given a specified number of degrees of freedom, the larger bandwidth of the higher-order element results in increased computer storage and computational effort as compared to lower-order elements.
3.2
ISOPARAMETRIC FINITE ELEMENTS
In Chapter 2 regular rectangular elements were considered, and earlier in this chapter we considered triangular elements. It would appear, from the evidence presented to this point, that triangular elements would be preferred to rectangles because of the flexibility of the triangle in generating a net. In this section we show that irregular quadrilateral elements can be formulated that extend the utility of the regular rectangular element developed earlier. 3.2.1
Transformation Functions
In the isoparametric finite element approach, elements of irregular shape are transformed or mapped into elements of regular geometry to facilitate integration. Most of the concepts involved in this procedure have been introduced previously in a disguised form. They are repeated, in part, in this section for the sake of clarity and continuity. Consider an irregularly shaped quadrilateral element with straight sides and four nodes, one located at each corner of the element (see Figure 3.3a).
Μ,-Ο
(ο,-η
( b)
χ
(d)
Figure 3.3. Isoparametric elements: ( a ) linear quadrilateral; {b) quadratic quadrilateral with curved sides; (c) mixed quadrilateral; (d) quadratic triangle with curved sides.
122
Finite Elements on Irregular Subspaces
Further, let us assume that we wish to evaluate an integral arising out of the Galerkin formulation which has the form
7-/-ί < **> + · M A A 3φ
8ψ
9
Formally, the integration of (3.2.1) is to be performed over the entire x — y domain. In practice, however, the integral is evaluated elementwise where the elements may be of irregular shape such as those illustrated in Figure 3.3: (3.2.2)
/_
2 j ^ - -
+
J
- - j
d
x
d
y
,
where Ε is the number of elements. An obvious computational problem arises when we attempt to evaluate the elementwise integrations over this irregular geometry. The solution to this difficulty was introduced, in part, in Chapter 2. We transform (3.2.2) into an integral in the local coordinates (ξ, η) and integrate numerically. T o transform from (x, y) to (£, η) space requires the formulation of a transformation or mapping function. We develop such a function using a finite expansion analogous to that developed for the trial function ύ. The expansions for the χ and y coordinates are 4
(3.2.3a)
*=
(3.2.3b)
y=
Σ */*,(£.l)
( = 1
Σ ΛΨ,(Μ).
where, as earlier, x and y, are nodal coordinates in (x, v) space. These expressions are of the same form as (3.1.22) introduced earlier for triangular elements. Notice that the functions ψ, are formulated in the (ζ, η) system. T o establish the form of ψ,(£,η), we impose two constraints: t
1.
There must be a one-to-one mapping of the nodes between the two coordinate systems.
2.
There must be a linear variation in χ and y along the sides of the square element in (ξ, η) space.
The second constraint leads us to choose a transformation expression of the form (3.2.4a) (3.2.4b)
y = a + b i + c T\ + 2
1
2
d tri. 2
Isoparametric Finite Elements
123
It is readily apparent that χ and y vary linearly along ξ(η = ± 1) and along i»(* = ± D .
When (3.2.4) are evaluated at the nodal locations in each coordinate system, we obtain an equation of the form (using χ as an example)
"V (3.2.5)
1
1
-1
1
1
-1 1 1
-1 1 -1
*3
1
-1
"a."
ft,
Equation (3.2.5) is an expression of the first constraint (a). Solution of (3.2.5) yields
ft,
(3.2.6)
_ 1 ~ 4
1
1
1
-1 -1 1
1
1
-1
1
-1
1
1
Substitution of (3.2.6) into (3.2.4a) gives the required series expansion for x: (3.2.7)
* = 4 [( * l + * 2
+ (x
t
* 3 + *4 ) + (
+
~X
+ Χ
2
3
_
* I + *2 + * 3 ~ * 4 ) £ + ( ~ * 1 ~ * 2 + * 3 + * 4 ) η
~χ )ξη]. 4
T o establish the form of ψ,, we must rearrange (3.2.7) in a form more directly comparable to (3.2.3a). Thus we rewrite (3.2.7) as (3.2.8)
χ =
ί ( ι - ί - η + ίη)Λ, + Ηΐ + Ι - η - ί η ) * 2
or, equivalently, (3.2.9)
x
= [i(l- )][i(i- ,)] + [i(l + |)][i i- ,)] i
T
+ [i(l + i)][i(l +
X)
™)]^3
(
T
+ U(l-0][Hl
+
X2
")]*4.
124
Finite Elements on Irregular Subspaces
It is now apparent through an examination of (3.2.9), (3.2.3a), and (2.2.63) that the functions ψ, are, in fact, the basis functions φ, formulated for the rectangular element of Chapter 2. When the transformation or mapping functions and basis functions are the same, such as in this case, the formulation is called isoparametric. It should be evident that we would encounter no difficulty in using a higher-degree polynomial for the bases than for the transformation functions. In Figure 3.4 there is no advantage in using quadratic functions for the transformation because the element sides are straight with midside nodes at the midpoints and, therefore, exactly described by linear functions. On the other hand, the unknown function ύ may behave such that quadratic interpolation is warranted. When the transformation is accomplished using functions of lower degree than those used as bases, the formulation is called subparametric; when the transformation function is of higher degree than the basis function, the element is called superparametric. There are occasions when it is advantageous to use basis functions of different degrees in different locations within the domain of interest. This can be achieved through the use of a mixed element such as illustrated in Figure 3.3c. This element may employ different basis functions along each side and thus may act as a transition element. The two-dimensional bases for this element are given in Table 2.76. To evaluate the integral of (3.2.2), it is necessary to express the derivatives in terms of local coordinates. The integrands of (3.2.2) contain χ and y derivatives of the basis functions, while the bases are defined in terms of | and η. Using the chain rule, one can relate the required χ and y derivatives to the readily computed £ and η derivatives by (3.2.10a)
—ay"-—g^af+ —97-θξ
x
t
Figure 3.4. Subparametric element in global (x,y) and local (ξ,η) coordinates. Boxed nodes only are used for geometry transformation [i.e., only corner nodes have prescribed (x, y) coordinates]. Linear mapping gives straight sides with midside nodes at the midpoint of the side.
Isoparametric Finite Elements
9φ{ξ,η) 3η
(3.2.10b)
=
9φ{ξ,η) dx
dx 3η
125
3 φ ( £ , η ) dy 3ν 3η
t
Here χ and y derivatives are defined implicitly because (3.2.3) lends itself to computation of partial derivatives of χ or y with respect to ξ and η. On the other hand, χ or ν derivatives of ξ or η are not always readily calculated. Equation (3.2.10) can be rewritten in matrix form as
(3.2.11)
3JC
dy'
di
3?
Η
9φ(£,η) 3η
dx
dy 3η
3η
' 3φ({.ΐ) 3χ 3Φ(€,«) 1
^
J
or dφ (3.2.12)
di
dφ dx
3φ
dφ
where [ / ] is the Jacobian matrix. The derivative relationship we require is readily established as 3φ dx
(3.2.13)
3φ dy
3φ
= [·/]
3ξ 3φ 3η
The efficacy of this approach depends upon our ability to efficiently evaluate the Jacobian matrix. By differentiation of (3.2.3), it is apparent that [J] is easily obtained from the relationship " dx (3.2.14)
dx 3η
dy' dt
' 3φ,
3φ
dt
dy 3η
3φ,
3ί 3φ
3η
3η
2
3φ
3
di 2
dφ
'*\ Xl
y\ >2
3
3η
The two matrices on the right-hand side of (3.2.14) are known: the first a function of i and η is obtained through differentiation of φ, and the second contains the global coordinates of the nodes. Although the integrand of (3.2.2) is now expressed in local coordinates, the limits of integration and the differential area must also be changed. The
126
Finite Elements on Irregular Subspaces
appropriate relationship is [see, e.g., (3.1.25)] j^)dxdy
(3.2.15)
= f
J'
(-)det[J]did . V
Combining (3.2.2), (3.2.13), and (3.2.15) yields an integral expressed entirely in (ξ, η) coordinates: (3.2.16)
t\ r\ ' . +
1
/ dy 3Φ,
dy 3φ, \
^ - , J _ , d e t [ y J l 3η Η 1
/
/ dy 3φ,
dy 3φ, \
31 3η / d e t [ / ] \ 3η 3ξ
3£ 3η /
3x 8ψ, , dx 3φ, \
d l t T 7 l l ~ ^ ^
+
1
1
/
3χ3φ,
^ " 3 T / o ^ i ~ ^ W
3χ3φ,\
"3T^)
+
r
i
l
. , .
d e t [ y ] i /
^ '' i
where d e t [ / ] , the Jacobian, is given by ,3.2,7)
d
e
,
U
1
= | | | Z _ | £ | .
Whenever an integral involving a polynomial expression in φ(£, η) is encountered, it is readily evaluated because only (3.2.15) needs to be applied. As an example, consider the following commonly encountered integral: (3.2.18)
^ φ , ( £ , η ) φ , ( ξ , η)
= f
J*
φ,{ξ,ν)φ,(ζ,7,)ά«ν]α·ξάη.
There is n o need in this case to modify the original integrand. However, the right-hand integral has an extra factor which, in some cases, is dependent on ξ and η. 3.2.2
Numerical Integration
Integrals of the form (3.2.16) and (3.2.18) can be evaluated using several numerical procedures. The most commonly used approach is based on Gaussian quadrature. In this scheme the integral, which is defined over the range — 1 to 1, is approximated as the weighted sum of the integrand evaluated at specified points in the interval —1 to 1. Consider, for example, the function /= f(£). The appropriate Gaussian quadrature expression is
(3.2.19)
Σ *,/(?,)+Λ,„ /=ι
Isoparametric Finite Elements
TABLE 3.4.
where
127
Gaussian Quadrature Formulas: Weighting Functions H>, and Coordinates of Integration Points £,·
η
Polynomial Degree
I
Linear
0.000 000
2.000 000
2
Cubic
0.577 350
1.000 000
3
Quintic
0.774 600 0.000 000
0.555 556 0.888 889
4
Septimal
0.861 136 0.339 981
0.347 855 0.652 145
±£
H>,
(
w, = weighting factor £,=coordinate of the i t h integration point (Gauss point) η — total number of integration points Λ = 2 " '(«!) (2« + 1 ) ~ ' [ ( 2 « ) ! ] - ^ { 2
+
4
3
Λ
-1<0<1.
«ζ
A polynomial of degree In - 1 can be exactly integrated using η integration points. T h e weighting coefficients a n d integration points are computed using Legendre polynomials and the scheme is frequently called Gauss-Legendre quadrature. Tabulated values of w, and £, for up to four points are found in Table 3.4. The two-dimensional equivalent of (3.2.19) for a polynomial of degree up to 2n — 1 in ξ or η is obtained in a straightforward manner, (3.2.20)
f _ f _ f ^ )
d
^ =
Σ
Σ^,/α,ΐι,),
7 = 1,=i
where the locations TJ and corresponding weighting factors w are obtained from Table 3.4. T h e three-dimensional extension of (3.2.20) is 7
(3-2.21)
y
f_f_f_M^i) i ^s= d d
ΣΣ
i ^ . A € , . i » , . f a ) .
k=17=11=1
Although exact integration of terms of the form of (3.2.16) may be necessary in some instances, in selected cases fewer Gauss points than formally required may be used with satisfactory results.
Finite Elements on Irregular Subspaces
128
Examination of Table 3.4 reveals that the Gauss points are always located on the interior of the domain of integration ( — ! < £ , · < 1). When this domain consists of an element, the Gauss points then fall within the element. Because of the simple form of the bases at the nodes, it is sometimes desirable to use the nodal points themselves as integration points. Although this is not permitted using Gaussian quadrature, it can be accomplished using a highly accurate scheme based on Lobatto formulas. Lobatto formulas require one more integration point than Gauss formulas to achieve a particular order of accuracy. T h e appropriate Lobatto integration formula is
/ ' ftt)dt
(3.2.22)
'
= wj(-l)-r i
*,/(£,)+*„/(])+
n
R. n
1=2
For Lobatto
Λ
- = (^)( ) '" [("-0^2η-1)- [(2ι.-2)!]- ^ί 2
α
,
, >
3
ί=β
\<θ<\. Selected weighting functions and coordinates of integration for Lobatto formulas are given in Table 3.5. It is apparent from this table and the integration formula (3.2.22) that some integration points lie on the perimeter of the
TABLE 3.5. Lobatto Integration Formulas; Weighting Functions κ>, and Coordinates of Integration Points £,
η
Polynomial Degree
3
Cubic
1.000 000 0.000 000
0.333 333 1.333 333
4
Quintic
1.000 000 0.447 214
0.166 667 0.833 333
5
Septimal
1.000 000 0.654 654 0.000 000
0.100 000 0.544 444 0.711 111
Fron Abramowitz and Stegun. 1964.
= €,
w
,
Isoparametric Finite Elements
129
domain of integration. Moreover, when this domain is a standard element, some of these boundary points correspond to nodal locations. 3.23
finite
Isoparametric Serendipity Hermitian Elements
The formulation of finite elements employing Hermitian polynomial bases was introduced in Section 2.2.4. Recall that we developed two approaches in that section, one that preserved the C ' continuity of the bases and a second which guaranteed C continuity only at the nodal points and C ° continuity along the element edges. Because the first approach generates two additional unknowns when a coordinate transformation is required, (i.e., d Tj/dx and d Tj/dy ), let us consider the C ° continuous case. This approach results in three degrees of freedom at each node (i.e., 7", 9 7 J / 3 x , 8 7 J / 3 y ) . ]
2
2
2
2
Consider the isoparametric Hermitian finite element illustrated in Figure 3.5. The principal feature that distinguishes this element from those illustrated earlier is the lack of side nodes on a curved side. Information required to describe this curvature is now provided at the corners. As in earlier isoparametric formulations, we use the basis functions as coordinate transformation or mapping functions. Thus a point {x, y) in the global coordinate system is expressed in terms of the nodal locations (x,,y ) and the basis functions as (see van Genuchten et al., 1977) t
(3.2.23a)
χ(ξ,·η)=
Σ ΦοοΛ+Ψιο^ + Ψοι^
(3.2.23b)
,(ξ,η)=
2 ΦηΛ + ΦηΜ
-Μ)
(-4,-0
+
Φο^,
H.t)
«,-η
Figure 3.5. Isoparametric Hermitian finite element with side lengths £,. The angles defined by the element sides £, and £ and the χ axis are designated a and β, respectively. 4
y
Finite Elements on Irregular Subspace
130
where (3.2.24a)
Φοο>
(3.2.24b)
Φιο
(3.2.24c)
Φοι>
=
*(ΐ + ^ ) ( ΐ + η η , ) ( 2 + « , + η η , - £
- Κ , ( ΐ - £ ) 0 + «,)( 2
= 7
2
™,)'
1 +
=
and η = ± 1 depending upon the local coordinates of they th node. Because of the properties of these bases, the coefficients of the Jacobian matrix can be readily evaluated provided that the coefficients 3 x / 9 £ , 9.x . / 9 η , 3 y , / 3 i , and 3 > , / 3 η can be determined. These coefficients can be evaluated geometrically when the element side lengths are known; consider, for example, the approach 7
y
(3.2.25a)
ycosa,,
οξ _
(3.2.25b)
3? dx
(3.2.25c)
1
9η
J
y
=
sin a , , -fcosfi , J
dyj _ £
(3.2.25d)
3η
=
y s i n ^ .
where side k defines the angle β with the χ axis at the node j as illustrated in Figure 3.5. Unfortunately, the side lengths £ are not generally known when curved elements are employed. However, along an element boundary, (3.2.23) and (3.2.24) reduce to a one-dimensional form, for example, y
d
Xi
(3.2.25e )
x(0 =
(3.2.25f )
y{£Y-
(3.2.25g )
x(ij) =
Σ j=\
ν
Σ j=\
(φοο,Λ + Φ \
Φ ο ο Λ + Φ\0]~$£
for s i d e η = ± 1,
2
Σ
7=1
(3.2.25h )
y{i))-
Σ
0j j + Φ< X
9*, 3η
(φοο^+Φο,,-^)
\
for side
ξ=±\.
Isoparametric Finite Elements
131
tj can be calculated from
(3.2.26)
with the integration performed numerically along side j. The first estimate of £ is usually based on the straight-line distance between the two nodes. Examination of (3.2.23), (3.2.25), and (3.2.26) reveals that an iterative procedure is in fact necessary to evaluate the Jacobian. Given an estimate of £ , (3.2.25) is evaluated; this result is introduced into (3.2.23) to obtain 9 v / 9 £ , and so on, which are finally used in (3.2.26) to establish a new estimate of £ . The overall procedure is repeated until a suitable value of £ is obtained. A final estimate of the Jacobian matrix coefficients is then made. Because these Jacobian elements are only used for the side-length transformation, they are no longer needed after the £. are calculated. The Jacobian matrix coefficients for the interior Gauss points are different. Fortunately, this procedure need not be repeated unless the mesh geometry is modified. There are two main advantages to employing Hermitian isoparametrics. Whenever a first derivative is required, it is easily obtained, particularly at the nodes. In addition, there is a saving in computational effort over C ° cubic elements. Numerical experiments conducted using the two-dimensional transport equation reveal that 25 to 40% fewer degrees of freedom are required to obtain the same accuracy achieved by C ° cubic elements (van Genuchten et al., 1977). T h e principal disadvantage involves the introduction of N e u m a n n - t y p e (prescribed gradient) boundary conditions. We now overcome this difficulty by using a normal-tangential coordinate system more suited to the Hermitian isoparametric element. 3.2.4
Isoparametric Hermitian Elements in Normal and Tangential Coordinates
We have presented one approach to the solution of field problems using isoparametric Hermitian finite elements, and it is probably a worthwhile investment to present an interesting alternative approach developed by Frind (1977). The particular problem he considered to demonstrate his technique involves the calculation of the fluid potential in a wedge-shaped region of an axisymmetric radial flow field in a porous medium. Flow occurs from the perimeter toward the center of the wedge (see Figure 3.6). The governing equations are (3.2.27a)
v ( A : v w ) = 0,
(3.2.27b)
u=u
c
on
S , 2
132
Finite Elements on Irregular Subspace
Figure 3.6. Wedge-shaped grid for radial flow (after Frind, 1977). ^9"
(3.2.27c) du
(3.2.27d)
5 and5 ,
on
3
4
where Κ is the hydraulic conductivity of the porous medium. Let us employ Galerkin's method of weighted residuals to obtain a set of approximate integral equations (3.2.28)
f{V'{K
Vu))
i = 1,2,..., 14,
ai
A
J
α = 0,σ,τ,στ,
where the symbol φ represents four new types of Hermitian bases: αι
Φο,'
Φ.,'
Φτ/'
3
n
Φοτ,'
d
which will be described shortly and « is defined as
(3.2.29)
ϋ
ύ= 2
i , d U, + ^ Φ „ + ^ Φ ,+ ^ Φ W
7= '
"Α,
2
W
τ
τ
β
ν
.
Although one can readily solve (3.2.28) directly using Hermitian cubic bases, it is sometimes advantageous to apply Green's theorem so that the natural boundary conditions appear directly in the integral operator and only first-order derivatives require transformation:
(3.2.30)
f {Kvu)'V
i = 1,2,..., 14,
JKvu'ηφ„,ds α=0,σ,τ,στ.
=0,
Isoparametric Finite Elements
133
To establish the functional form of the bases
α Τ I U \ (3.2.3la)
" -d" U , du 3η -r- = t t - R - + - R - - R - , 9e of θσ 9η θσ
(1
9
(
1 3
2
9
11K\ 3
1
b
(3.2.31c)
"
-
9
"
9
*
97 - 9 ? 37
)
4 -
9
M
9
T
9 « _ 91 3£ d u 9σ9τ 9σ θτ g |
/ 9£ 9η \ 9σ 9τ
2
2
>
9^ 9 7 '
+
|
2
9£ 9η \ d u 9τ 9σ / 9£9η 2
|
^ 9η 9η 9 κ ^ 9 £ 9 Μ ^ 9 η 9« 9 σ θ τ 3£ 9σ9τ 9 η ' 9σ 9τ 3 η 2
2
2
2
Recall that along element boundaries either £ = ± 1 or η = ± 1 , so that by assuming elements with orthogonal corners 9 η / θ σ = 0 and 3 £ / 3 τ = 0 at all nodes. Imposition of these constraints on (3.2.31) yields -> i-i ^
ii (
3
2
3
2
a
du du d£ 9 7 = 9 ? 97
)
1Γ = IT Τ · στ ση στ
(3.2.32b)
1
The cross derivative of (3.2.29) can be expanded to give 9 M 2
3σ9τ
_
3 £ 9M 9 η 9M 3 σ 3 τ 3 | ' 3 σ 3 τ 3η 2
9$ 9η 9 u 3σ 9 τ 3£9η '
2
2
At this stage of the development, it is necessary to introduce approximations for the terms 9 ξ / 9 σ , θ η / 9 τ , and 9 £ / 9 σ 3 τ = 9 £ / θ τ 9 σ . From Figure 3.6 one can observe the following relationships: 2
(3.2.34.)
(3.2.34b)
2
d£,
2
3η,
2
- ± " > 4 - -
It should be noted that (3.2.34) provides only an approximation for the mapping derivatives at the nodes (i.e., 3 £ , / 3 σ and 3 η / 3 τ ) . This approxima7
134
Finite Elements on Irregular Subspace
tion results in a discontinuity of these quantities at the nodes.* O n e approach to approximating the cross derivative is t o use a difference representation,
(3.2.34c)
drdo J = Μ
/
β
- 2 ^ ( 1 θτ A
( τ )
-2Δ£,
-2Δ£ 2
I.
where Δ £ „ Ξ Ξ £ - £ and /„ and l are defined in Figure 3.6. Equations (3.2.32)-(3.2.34) can be written in matrix form as σ
T
0 ι
du . Yo du . Tr
2
0
J
(3.2.35)
J
2
0
—
3 u . 3σ3τ 2
7
e. -2Δ£
£ £
£ £
2
τ
3?
4
Τ
3 « . 3£3η 2
£ £
2
σ τ
7
3« .
0
-2Δ£„ α
3« .
0
7
F o r finite side lengths, the coefficient matrix of (3.2.35) is nonsingular and can be inverted to yield
du .
2
H
J
du . dt\
(3.2.36)
—
J
3 « 2
didi\
.
0 Δ£„
J
0
τ
.
d^ du . Tr du J
0
2 Δ£
3M
0
J
£ £
2
4
3CT3T
J
We now rewrite our trial function in the standard form, 14
(3.2.37)
*=
Σ. Ι ^
7=1
+ ^
+ ^3TJ υ
+
^
'
•It is possible to avoid this discontinuity by using average side lengths computed from adjacent elements.
Isoparametric Finite Elements
135
Substitution of the nodal values of (3.2.36) into (3.2.37) and comparison with (3.2.29) yields Φο,
Φ(Χ),
Φιο, +
2
(3.2.38)
£ , γΦου
—
Φι
4
τ
Δ£ , 4~Φι τ
+
e ε 4
_
, Φ",
T h e information given in (3.2.29), (3.2.30), and (3.2.38) must now be coupled in the standard way through the use of the Jacobian matrix dy
dx
dt
[J) =
dx 3l)
dy dη
The four coefficients of [J] are obtained, as in earlier examples, through the use of an expansion involving nodal values of geometric quantities and the bases: 14
dx dx . Σ *,Φοο, + ^ Φ ' . ο , + ^ Φ ο ι , +
(3.2.39a)
χ(ξ,η)=
(3.2.39b)
ν(£,η) = 2 ^
dx 2
υ
14
+ ||>Φ .ο> ,
7=1
+
^3 TΦJ ο υ + J
^ Φ
,
9£9TI
J
Μ > ·
T o evaluate the Jacobian matrix, it is necessary to establish values not only for the parameters dx 9£ ' 7
dx 9η '
dy
a? ' 7
7
dy . a n d
a^
but also for d x /dξdη and 9 ν / 9 £ 9 τ } . Various approximations can be employed to approximate the cross derivatives. Numerical experiments indicate, however, that omission of the cross-derivative term in the isoparametric mapping (3.2.29) actually improves the accuracy of the solution. Elimination of the cross derivative and substitution of (3.2.25) into (3.2.39) completely defines the coordinate transformation function. The Jacobian matrix is now easily 2
2
J
7
Finite Elements on Irregular Subspace
136
evaluated through differentiation of (3.2.39) as in the earlier isoparametric example. The final form of the matrix equation resulting from the approximation of (3.2.27) using isoparametric Hermitian elements is [C]{u)
(3.2.40)
=
{f),
where coefficients of [C], {u}, and {/} are given by Φο> θΦο, 3x dx
9
9
[c] =lf u
J_K
Φθ7 H„ dx dx T
9
Φθ7 3x
^Φη/ 3Φο/ 3χ 3χ
9
3x 3x
3x
9
-H„, · ^+ 3x
{«},=
3y
»Φϋ dy A
HOT,
3y
9
dy
Φ«ν Φο, 9χ 9χ
3y
3x
3x
3x
dy
9
Φ.τ, 8φ„ dx dx 9x *+-V
3x
9Φ , 9x Γ
9/
ο τ ;
[
0
3 φ , 9φ„, dy dy στ
Φ.τ> 3Φ
9 |
dy
detf/Ji/ii/T/
ΤΙ
dy
Φ.τ, , »^> Φ,
9
3y
9φ 9φ , dy dy
|
9
9
9y
3x
I/,
<7„Φο,
9ίΛ 3σ 3ί/, 3τ d U, 3σ3τ
4„Φτ,
2
^ / 9 ^ ,
+
dy
3x
9
» » T >
9y
3 ^ 9 ^ dy dy
+
9
dy
9Φο, 9y 9y
^ / 9φο, 9^> 9y
+
9ΦΓ/
T
οτ
Φ τ ,
+
^ 3 ^ 3x dx
Φ , , *b./ Φοτ,
Φ*> 3Φ.« ^ ^ / · + dy 9χ 9χ + r j
Φο/ 3φ„, dy dy οφρ; 9
|
9x
^
+
^ν^Φο, 9x 9x
a
9
d
9 t
Hoj 9
Φο> οΦο, dy dy
9
dy
° Φτ, η
β
To solve (3.2.40), it is necessary to impose constraints arising out of boundary conditions (3.2.27b)-(3.2.27d). In the case of Dirichlet-type conditions, one simply replaces the appropriate value of U with the known information and then eliminates the corresponding row from the matrix equation. We found in the Hermite example of Chapter 2 that specification of U, implies t
Boundary Conditions
137
TABLE 3.6. Relative Error in Gradient of « Using Isoparametric Hermitian Finite Elements
Node
b=2
b=3
b=4
l 2 3 4 5 6 7
-0.0214 -0.0114 -0.0097 -0.0089 -0.0076 -0.0018 +0.0288
-0.075 -0.053 -0.049 -0.050 -0.045 -0.029 + 0.080
-0.135 -0.105 -0.104 -0.106 -0.103 -0.071 -0.278
After Frind, 1977. specification of certain derivatives. In this case, because we are working in normal-tangential coordinates, we have automatically specified θ ί / , / θ τ and d U,/dadr, thereby eliminating two more equations. T h u s we have reduced the degrees of freedom associated with this problem by three through the specification of one boundary condition. In the case of Neumann-type conditions, we can impose the required constraints in two ways. The procedure described in earlier examples and expanded in the next section invokes replacement of the boundary integral of {/} by the specified flux integrated over the perimeter of the domain. In a Hermitian formulation, however, we also have the option of replacing an unknown coefficient of {«} directly with the known derivative information. T h e latter choice is preferable because it is a stronger condition and also results in a reduction in the number of algebraic equations. Let us now return to our example problem. The graduated nodal spacing of Figure 3.6 can be described using the relationship 2
r = b',
i=0,\,...,n,
where the parameters b and / can be specified a priori. Table 3.6 provides the relative error in the calculation of the gradient 3 ( / / 3 σ for selected values of b and /'. It has already been noted that the Jacobian employed in problems of arbitrary geometry is generally discontinuous across element boundaries.
3.3
BOUNDARY C O N D I T I O N S
One of the advertised advantages of the finite element method is the ability to incorporate second-type and third-type boundary conditions into the governing equation. This opportunity arises when Green's theorem is used to reduce the order of selected terms in the approximating integral equations. Consider,
138
Finite Elements on Irregular Subspace
for example, the species transport equation j - - V(D-Vc) + V(vc)=0,
(3.3.1) where
t
c=concentration D = molecular diffusion υ = m a s s average velocity of t h e fluid.
Application of Galerkin's method yields j f ( | j - v ( D . vc)+V(vc))«,dfl=0,
(3.3.2)
N,
ι = 1,2
where
7=1
and φ· are bases. Green's theorem may now be used to modify (3.3.2) in two ways. Consider first the reduction of the second-order term to yield
\
(3.3.3)
a
^
+ V ·
(ycijb + (D · V c) · V
·V
c) · η φ , ds,
i = l,2,...,/V. The right-hand side of (3.3.3) now contains the diffusive mass flux boundary condition as a contour integral around the domain. T h u s we have incorporated a second-type boundary condition directly into the governing equations. There also exists the possibility of applying Green's theorem to the first-order space term in (3.3.3). This gives rise to the expression (3.3.4)
J
φ + {Ό-ν c-vc)' ί
V φ,^α
=£(D-Vc-vc)-n<Mi,
* = 1.2
Ar-.
Now the right-hand side of (3.3.4) describes the total mass flux crossing the boundary S and we have thus embedded a third-type boundary condition in the approximating equation. Generally, the concentration-dependent terms in the contour integral are specified as a prescribed function, say g = g ( x , v, t). Thus we must evaluate an
Boundary Conditions
139
Figure 3.7. Quadratic element side, illustrating the dimensionless coordinate system.
expression of the form
/· = / ς ( ί ) · η φ
(3.3.5)
1
"
Ι
·Λ=2/ f
q(s)-m> ds i
c
2lf,
= e
which can be written in dimensionless coordinates as (3.3.6a)
/* =
/'φ)·ηφ .(0^^
I? =
!ffq(s)-
1
or (3.3.6b)
n
where / is the length of the element side as illustrated in Figure 3.7. Note that ds/di may not always be constant over an element, as shown in Figure 3.8. To evaluate (3.3.6b), a functional distribution for q must be established. When this function is known, (3.3.6) can be integrated either numerically or analytically and the resulting numerical value becomes a known parameter in e
X
Figure 3.8. Curved quadratic element side, illustrating the dimensionless coordinate system.
140
Finite Elements on Irregular Subspace
equation i. Although any functional form of q = q« η can be prescribed and, in principle, integrated, a simple form is usually selected for finite element analysis. The simplest case is to assume q constant along /. For a linear element side (i.e., two nodes), the two equations are n
(3.3.7a)
I i =
L J\( t qm
n=
(3.3.7b)
i)d
!4L
=
± f* u)dt='-f. qn
2
F o r a quadratic element such as illustrated in Figure 3.7, we obtain
h = iq.f_*te)dl = WA„), l
(3.3.8a)
* = W.\^)di = W q )>
7
(3.3.8b)
e
h = ^„f\(i)di
(3.3.8c)
n
= W/l )K
An alternative to assuming a constant q„ along each side is to establish q at each node point and then use the basis functions to interpolate between the nodes. Consider, for example, a quadratic interpolation of a „ ( | ) . The distribution of q would be given by ni
n
(3.3.9a)
ίβ
(0= Σ
?.,·Φ,(0.
The integral for each node would become (Connor and Will, 1969)
(3.3.9b)
/ f = 4 / ' Σί„ Φ Φ,(ί{ =
(3.3.9c)
/'=τ/'
;
2
A
(3.3.9d)
/ ' = -f/ 3
7
Σ 9.ΛΦ2^ =
»y = 1
Α/(2 „,+ „ -1 „3), ί
ς
Μ9«,+8ί»2
Σ ?»>Φ>Φ3^ = Μ - ^ .
9
2
+
?«3).
+9-2+2*7. ). 3
The formulation above becomes cumbersome when curved sides or unequally spaced nodal points are encountered. In the case of curved sides, the
141
Three-Dimensional Elements
side length / may not be readily available. Moreover, as mentioned earlier unequally spaced nodes along a side preclude the use of a simple transformation to assist in evaluation of the integral. Under these circumstances, it is advantageous to employ numerical integration such as introduced earlier for area integrals. Because the incremental distance along 5 can be expressed as
the appropriate integration formulas are
(33.0)
,;=/_',
A ( £
,((5|)
!
(|z) ) !
+
, / 2 J {
,
where the coefficients of the Jacobian matrix are obtained in the manner described earlier.
3.4
THREE-DIMENSIONAL ELEMENTS
The extension of two-dimensional analysis to three dimensions is rather straightforward for the majority of element types. As would be anticipated, the basis functions will be defined in terms of global coordinates (x,y,z) and local coordinates (ζ,η,ξ). For Lagrangian hexahedral elements the basis function formulation is a direct extension of the two-dimensional case for both the zero-order continuous and Hermitian elements. The development of the serendipity family of three-dimensional elements is less obvious and the appropriate bases are presented in Table 3.7a. The application of linear, quadratic, and cubic hexahedral elements is analogous to that presented for quadrilateral elements. Moreover, one can easily extend the isoparametric concept from quadrilaterals to deformed hexahedra (see Figure 3.9). The principal changes to be considered are in the formulation and use of the Jacobian matrix. Global and local derivatives are now related by 3ψ " dx (3.4.1)
3
' 3
= [ · / ] - ' dη
d<(> . f . 9
142
8)
Φ, = ^ ( 1 - ί 2 ) ( 1 + 9 ^ , χ ΐ + «,Χ1 + iP?,)(' = 13,8,15,16,17,18,19,20)
Φ, = ^ ( 1 -r, 2 )(l +9ηη,)(\ + Ιί,χΐ +ff,) (/ =2.3,8,9,22,23,28,29)
Φ, = ^ ( 1 - ί 2 Χ 1 + 9 « , ) ( 1 + τ ϊ ι,,)(1+ίί,)(/ = 11,12,5,6,31,32,26,25)
Φ, = ^ ( 1 + £i,Xl + i?n,Xl + ff,)[9(£2+7,2 + f 2 ) - 19] (i = 1,4.7.10,21,24,27,30)
Φ, = ^(1 - η2Χ1 + «,)(! +ff,) (' =2,6,18,14)
Φ, = {(1 - ί2)(1 + ηη,ΧΙ + ff,) (' =8,4,16,20)
*, = ^ ( l - f 2 ) ( l + «,)(l + 11,)('=9,10,ll,12)
Φ, = g (1 + «,XI + ΐΜΙ,ΧΙ + & Χ « , + ill, + ff, - 2 ) (i = 1,3,5,7,13,15,17,19)
Φ, = 8 (ΐ + ^ ) ( ΐ + ηη,)(ΐ+ ??/)('= 1.2
C° Elements
TABLE 3.7a. Basis Functions for Serendipity-Type C° Hexahedral Elements; £„ η„ and J, Are the Local Coordinates of the ith Point
143
16
Cubic
Linear Quadratic
Side
Φ, = ά(ΐ + « , χ ι + ηη,χι - f 2 χι +9ff.) (ι =9, ιθ)
!n 2 -ü
W.-f
«,-*
fl 2 -ü
1 3
1 3
ßi
Edge nodes Quadratic * , = i ( l - f 2 X l + ipi 1 Xl+ff 1 )('' = 12) Φ , ^ Ο + ί ί , Χ Ι - ν Χ Ι + ff,)(i = 18) Φ, = ί(ΐ + α χ ι + ηη,)(ΐ-? 2 )(<=2) Cubic Φ, = Ä 0 - ί 2 Χ1 +9ίί,)(1 + ι,τ,,χΐ + H,) (ι =6,7) Φ, = Α(1 + ί£,)(1-') 2 )(]+97 / 7 ? ,χΐ + #,)(,- = 12,13)
where
Mixed C° element Corner nodes φ, = α,β, «, = i(i + ii',)(i + ™,)(i + ff,)
Φοο„ = - jjrd - f 2 ) d + «oXl + if1oXl + ffo)
°Μ. Th. van Genuchten, unpublished manuscript. From Verge, 1975.
17
t
Φο,ο, = - - ί | ( 1 - ' ? 2 ) ( 1 + ίίοΧ1 + ')'>οΧ1 + «ο)
In
Φ.οο, = - | | ( 1 - ί 2 ) ( 1 + ίίο)(1 + '?υο)(1+«ο)
3
8Ϊ
24
St2 _ i S
tt,-i
I
Φθ(ΐο, = -^(1 + «ο)(1 + ηηο)(1+?ίοΧ2 + Ιίο + η')ο + ί ί ο - ί 2 - η 2 - ^ )
C° Hermite"
144
Finite Elements on Irregular Subspace θ (-4.4.0
7(4,1,4)
(-4-4.4)
(4,-4,1)
£(_-Ur4). 'H.-4.-4)
Figure 3.9. Isoparametric hexahedral elements in global (x,y,z) coordinates.
3 (4,4,-4) r
(4,-4,-4)
and local
where the Jacobian matrix ( / ] is given as dx
dy
dz
9x
dy
dz_
9η
9η
9η
dx
dy
92
a*
9f
η
9ί
The differential volume element is transformed into local coordinates by (3.4.3) As in required Gaussian Table 3.4
dv =dcl[
J]dtdvd$.
the case of isoparametric quadrilaterals, numerical integration is for isoparametric hexahedra. The appropriate three-dimensional quadrature uses the integration points and weighting factors listed in in conjunction with (3.2.21), which we rewrite here for a polynomial
Figure 3.10. Deformed prismatic element with triangular cross section in global (JC, y,z) and local (Ζ,,ί) coordinates.
Three-Dimensional Elements
145
integrand of degree not exceeding In — 1 in £, η, or f.
(3.4.4)
f f f f(i,v,ttdtd dS=
j, 2
V
'
'
I
k λ = = I1 7ι = = 1 I ii = = 1I
Surface integrations arising out of the application of Green's theorem are performed numerically using (3.2.20), the two-dimensional analog of (3.4.4). In the case of triangular elements, there are two popular approaches to generating their three-dimensional counterparts. One scheme combines triangular bases, in χ and y say, and linear bases in the remaining coordinate direction, in this case z. This generates a prismatic element with triangular cross section. This element can be deformed to yield a pentahedron as illustrated in Figure 3.10. Bases for this family of elements are given in local coordinates in Table 3.7b. Numerical integration is readily accomplished using a combination of the formulas employed for triangular elements and one-dimensional Gaussian quadrature:
(3.4.5)
- Σ Σ g( \j. L
L,
L,
v:
£, )w w .
3j
]
i
T h e integration points and weighting coefficients are obtained from Tables 3.1 and 3.4. Triangular elements can also be combined to form tetrahedral elements as illustrated in Figure 3.11. The natural coordinate system for this family is based on the volume of the tetrahedron. It is apparent from Figure 3.12 that the point Ρ can be uniquely located using L where, for example, Jy
Li
=
volume 2 3 4 Ρ volume 1234 '
Bases for tetrahedral elements formulated using volume coordinates are presented in Table 3Jb. Integration can be performed using a formula analogous to the one introduced for triangles and area coordinates:
ν
L^L^L^L^dO=()V
\m \m
I7I|
2
3
\m ! 4
( m , + m + m + m + 3)! ' 2
3
4
TABLE 3.7b.
Basis Functions for Serendipity-Type
Pentahedral Elements and Tetrahedral Elements
Pentahedral elements
10
12
φ, = \L,(2L, - 1X1 + «,•) - H , ( l - € ) (/ = 1.3,5,10,12,14) 2
Φ, =2Z. L (l + « , ) (/ =2,4,6, II, 13,15) y
4
•, = L (l-i )(i'=7,8,9) 2
t
where _/ and λ are nodes located along the same edge as /. Tetrahedral elements
*, = L,
1 ) 1 , 0 = 1,3, 5, 10)
φ, = 4 / ^ ( 1 =2,4,6,7,8,9)
where y and k are nodes located along the same edge as i. From Zienkiewicz, 1971.
146
Three-Dimensional Elements
147
ζ 4
Χ
Figure 3.11. dinates.
Isoparametric tetrahedral elements in global (x, y , z) and local L coor-
where χ
61/ = det
ζ
2 y
3 Λ
x
X
2
Z
7
2
X
4
y* Z
3
4
and ( x , , y , , z , ) are the global coordinates of the node /'. Where numerical integration is required, as in the case of isoparametric tetrahedra, the following formula can be employed: rifi-Ltrx-L,-^'#(/.,, L , L j ,
(3.4.6)
L )dL\dL dL'3
2
n \j^
Σ
L
2 r
L ,L h
4 j
)w
A
2
r
where the integration point coordinates and weighting functions are reported in Table 3.8. In summary, the extension from two-dimensional to three-dimensional finite elements is not conceptually difficult. The challenging aspect of threedimensional simulation is the development of a computer code which can efficiently solve the large number of resulting algebraic equations.
L
4
M
2 L
2'
1
Figure 3.12. Tetrahedral element, volume coordinates.
illustrating
Finite Elements on Irregular Subspace
148 TABLE 3.8.
Integration Point Coordinates and Weighting Functions for Tetrahedral Elements
η
Polynomial Degree
l
Linear
l
0.250 000
0.250 000
0.250 000
0.250 000
1.000 000
4
Quadratic
l 2 3 4
0.585 0.138 0.138 0.138
410 197 197 197
0.138 0.585 0.138 0.138
197 410 197 197
0.138 0.138 0.585 0.138
197 197 410 197
0.138 0.138 0.138 0.585
197 197 197 410
0.250 0.250 0.250 0.250
000 000 000 000
5
Cubic
l 2 3 4 5
0.250 0.333 0.166 0.166 0.166
000 333 667 667 667
0.250 0.166 0.333 0.166 0.166
000 667 333 667 667
0.250 0.166 0.166 0.333 0.166
000 667 667 333 667
0.250 0.166 0.166 0.166 0.333
000 667 667 667 333
-0.800 0.450 0.450 0.450 0.450
000 000 000 000 000
Κ
L
2
After Zienkiewicz, 1971.
REFERENCES Abramowitz, M. and I. A. Stegun, Handbook of Mathematical Functions, National Bureau of Standards, Appl. Math. Ser. 55. 1964. Brebbia. C. A. and J. J. Connor, Fundamentals of Finite Element Techniques for Structural Engineers. Butterworths, London, 1973. Connor, J. and G. Will, "Computer-Aided Teaching of the Finite Element Displacement Method," MIT. Dept. of Civil Engineering, Res. Rep. 69-23. 1969. Felippa, C. Α., "Refined Finite Element Analysis of Linear and Nonlinear Two-Dimensional Structures," Dept. of Civil Engineering, Univ. of California. Berkeley, Rep. 66-22, 1966. Frind, E. O.. "An Isoparametric Hermitian Finite Element for the Solution of Field Problems," Int. J Numer. Methods Eng., 11, p. 945-962. 1977. Van Genuchten, M. Th.. G. F. Pinder. and E. O. Frind, "Simulation of Two-Dimensional Contaminant Transport with Isoparametric Hermitian Finite Elements," Water Resour. Res.. 13, 2, p. 451-458, 1977. Verge, M. J., "A Three-Dimensional Saturated-Unsaturated Groundwater Flow Model for Practical Application," Ph.D. thesis. University of Waterloo, Waterloo, Canada, 1975. Zienkiewicz, P. C , The Finite Element Method in Engineering Science, McGraw-Hill, New York, 1971.
mm Parabolic Partial Differential Equations
4.0
INTRODUCTION
In Chapter 1 we described the properties and behavior of parabolic partial differential equations. It is apparent from that discussion that this class of equations plays a very important role in many branches of science and engineering. As a result, a considerable amount of effort has been expended in formulating and analyzing accurate and efficient numerical approximations to parabolic operators. In this chapter we examine many of these approximating schemes and formulate the methodology required to evaluate them.
4.1
PARTIAL DIFFERENTIAL EQUATIONS
As a first step in our discussion of parabolic PDEs we repeat a certain amount of the material introduced in Chapter 1. This allows us to set up some model parabolic PDEs that can serve as test vehicles for the numerical algorithms to be presented. As before, we use the notation u = u(x, y) when only two independent variables are involved with χ serving as a representation for a time variable in many physical systems and y representing a spatial variable. When more than two independent variables are involved, we use u = u(x, y, z) o r u = w(x, y ,y ,y ,...). Our typical model second-order parabolic P D E takes the form l
2
J
(4.1.1) where £( · ) is a linear (usually) or nonlinear operator involving spatial derivatives and possibly other side conditions. Thus we might write as a linear example in only one space variable (4.1.2)
fi(x,y)u
)-y(x,y)u 149
1 SO
Parabolic Partial Differential Equations
or β(χ,
(4.1.3)
y)u
= V
x
'aVu-yu,
where α, / ? > 0 , γ > 0 . A simplified version of (4.1.2) would be u =
(4.1.4)
au ,
x
yy
which we have encountered many times before. T o (4.1.2) we must append suitable initial and boundary conditions. These depend on the range of the y variable; thus we might specify (4.1.5)
(i) -oo
(4.1.6a)
(ii) y>0;
(4.1.6b)
+ oo;
a (x,0)u
+ a,(x,0)u
Q
u = f(y)
atx=0
" = /(v)
atx=0
= a (x,0)
y
a t y = 0,
2
x>0,
where a >0, a, < 0 , and a — a, > 0 . 0
(4.1.7a)
0
u = f{y)
(iii) 0 < y < l ;
atx=0
(4.1.7b)
a (x,0)u
(4.1.7c)
J8 (JC,1)M + /8 U1)«I , = /8 (X,1)
+ (x,0)u
o
ai
0
= a (x,0)
y
2
i
J
2
aty = 0,
x>0
a t y = l,
x>0
with the same requirements on α , a,, a , β , β , and β as above. We might also represent (4.1.2) as a set of two first-order P D E s ; this has the virtue of removing the derivatives from the boundary conditions in (4.1.6) and (4.1.7). We may also write the right-hand side of (4.1.2) as 0
(4.1.8)
0
2
χ
2
£(«)=£(·) |τ(·) +
or
(4.1.9)
e(„)=^(.) 4() +
+
^ ( ) .
where ( · ) has the obvious notation in connection with the use of two or more dependent variables. Alternatively, we might use the similar forms (4.1.10)
\Z(u) = a[u
yy
+
u„\
or (4.1.11)
£
( « ) = «[«™,
+
«™ «™]· +
Model Difference Approximations
151
Finally, we might write a nonlinear model parabolic P D E in the form Z(u)=F(x,y,u,u ,u ).
(4.1.12)
v
yy
In addition, there are equations that may change their form depending upon the physical response of the system. Consider, for example, Burger's equation written in its fluid dynamical form as (4.1.13)
« + «!<„ = R e " ' u ^ . , x
where Re here is the flow Reynolds number. As the Re value changes in different flow regimes (i.e., near boundary layers and in regions of full turbulence), the mathematical character of the equation may change completely. Thus (4.1.13) may change from a parabolic equation into a hyperbolic one, with all the different solution characteristics thus inferred. A method developed to solve (4.1.13) in one regime of flow may well be completely unsuccessful in another regime. 4.1.1
Well-Posed Partial Differential Equations
It is necessary that all model P D E systems be well posed as well as possess unique solutions. This implies that the P D E possess neighboring solutions such that when the initial data are slightly perturbed, the P D E still provides a solution that deviates only slightly from the unperturbed solution. This is equivalent to stating that the P D E truly represents the prototype physical system. In general, the model parabolic equations that we consider here have this feature since we integrate in the positive χ (or time) direction into an open boundary region.
4.2
MODEL DIFFERENCE APPROXIMATIONS
Just as we have a set of model parabolic PDEs, we also have a set of model difference approximations to the PDEs. It is these finite difference equations ( F D E s ) that we need to solve. The F D E s must be well posed themselves as well as being consistent, convergent, and stable (see Sections 4.4 and 4.5). To obtain these finite difference representations, we use the notation of Chapter 1, namely that for a two-dimensional problem u ( x , y), the increments in χ will be of length h and those in y will be of length k. If there is more than one spatial variable, we use / , , / The subscripts r and s (i.e., w, ) will denote values of u at incremental values of x(r) and y(s), with further subscripts used for more spatial directions. When h and it are constant values, we refer to the two-dimensional mesh that results (see Figure 4.1) as a uniform mesh. This is obviously the simplest procedure we can analyze. N o w we usually seek to calculate u at the mesh points u , where the mesh intersections occur. 2
s
r
s
152
Parabolic Partial Differential Equations Χ
X . nod* / · < « . » )
•(3,1)
1
•(3,2)
• IS.})
»[2,2)
ο,ο
"—~—' k
y
•
u(5/2,3/2) •
•
U(3/2,V2) «(3/2,5/2) • •
•
»i»/2,S/2) •
o.o
Mesh - Intersection Points
•
•
"—-—' k Block - Centered
y Points
Figure 4.1. Uniform, two-dimensional finite difference nets. Depending on the boundary conditions, however, it may be advantageous to use a block-centered grid in which u is calculated in the center of a block, u +\/2.s+\/2The latter case is especially useful when flux-type boundary conditions are specified. Later, we also investigate the features of nonuniform meshes in which h and k will be functions of r and s, respectively. This will be particularly useful when gradients are quite different in various regions of the (x, y ) domain. In general, a nonuniform mesh in the χ direction alone may conserve computing time, especially if the P D E solution is basically damped as an exponential function of x. In this case, an exponential increase in h as one proceeds into χ space allows a retention of accuracy while minimizing the computing time required. r
The general linear form of a finite difference approximation may be written in matrix form as (4.2.1)
[^] {«} = [^]i{«.}, + M] {«},-,+ · •• +MW«},- , 0
r+ 1
2
m+ 1
where [A] , [A],,..., [A] ate square matrices and { « } , { κ } , , . . . , {"},-„,+ , may be suitable vectors. T h e subscript s has been dropped with the values incorporated into the vectors {«} . Equation (4.2.1) says that we can calculate {u} [at the ( r + l)th level] by incorporating the m x-levels below. Of course, [A\ cannot be singular. In most cases, m = 1 or m = 2 since higher values of m require extensive computing time. If [A] is a diagonal matrix, (4.2.1) is termed an explicit difference form. In all other cases (4.2.1) is termed an implicit difference form. Later sections of this chapter make this distinction clear as well as showing the computational differences. Alternatively, o n e may adopt the convention that the general linear or nonlinear finite difference form be given as 0
m
r + 1
r
f + 1
Q
0
(4.2.2)
{ « } ,
+
Ι
=
{«}, + Λ(Λ{Μ},
+
Ι +
Ό{«},).
Derivation of Finite Difference Approximations
153
where P and P are operators composed of polynomial combinations of difference operators defined over the spatial region and acting on their arguments in a linear or nonlinear fashion. This obviously corresponds in a loose sense to the case m = l in (4.2.1) and is implicit. Many examples of (4.2.2) are given later. It is important to realize that when our model P D E is linear, the resulting model finite difference approximation is also linear. However, Gerber and Miranker (1973) have proposed that a nonlinear difference scheme may have advantages. At each χ step the calculation proceeds by determining the best possible difference scheme to use at that step subject to an optimization criterion. This approach has high accuracy as well as being stable and convergent; it may well be that this nonclassical procedure will be of major importance as further developments occur. {
0
4.2.1
Well-Posed Difference Forms
We have emphasized that our model P D E must be well posed for various initial data, but it also follows that the finite difference approximation should be well posed. In general, a well-posed difference approximation must be continuous for a wider class of initial data perturbations than the P D E ; this is directly related to the stability of the finite difference approximation wherein all perturbations in a computed solution must be bounded. When the perturbations in the initial data are made small (in some sense, such as h, k ->0), the resulting perturbations in the computed solution must become small, thus resulting in convergence of the finite difference approximation. We investigate some of these features later.
43
DERIVATION O F F I N I T E D I F F E R E N C E APPROXIMATIONS
We have shown in Section 2.1.2 that one can use truncated Taylor series expansions to replace a P D E with a finite difference approximation. The truncated terms lead to the local truncation error, which is used, at least in a local sense, to provide a measure of the accuracy of the finite difference approximation. For any single P D E there are many such possible finite difference representations and we may suspect that schemes with smaller local truncation errors (i.e., higher order in powers of A, A:,...) are to be preferred. This is frequently, but not always, the case since other features in addition to the truncation error make a particular finite difference approximation a feasible candidate for a computation or a simulation. In this section we take the model parabolic P D E of (4.1.1) in the form (4.3.1)
u = Uy x
[model parabolic P D E ]
154
Parabolic Partial Differential Equations
and derive a number of different finite difference approximations. We use either the Taylor series directly or the approach of Mitchell and Pearce (1962), which has the model P D E embedded directly into the series equations. In particular, we are interested in the local truncation error for each different approximation but not, at this point, in how to use the approximations or how to solve them efficiently. The latter points are considered in later sections of the chapter. We shall encounter two types of approximations, explicit and implicit. Because of the form of the resulting algebraic equations, different computational schemes must be used for each type. For (4.3.1), assuming that u(x, y) is continuous and has sufficient derivatives, it is simple to show by repeated differentiation (assuming that the order of differentiation can be interchanged) that (4.3.2)
U
χ
Uy ,
χ
Μχχχ
Vyv
Uyyyyyyt
· · · *
^fflJC
^2iMV"
N o w if we develop a Taylor series around u , there results r
U
r+\.s
r.s
=
+
U
h
+
u
But by using (4.3.2) and h — pk
u
r + i i S
=u
+
r<s
Η
β
+
Μ
"χχχ
we may write
1
(4.3.3)
Λ 2
s
+ —«,,,,. , P
pk u , 2
t
2
k *
+
or
where B = ku
vv
D = k*u.. tyyy
and
2
yy r.s
vvv
r,s
.
In exactly the same manner we may derive all of the following (we drop the subscripts r, s on the right-hand sides): u
(4-3.4) (4-3.5)
u_ , r
s+
= u± B
r ± K s
+u_ rs
[
=2u -I Τ
(4-3.6)
U r s + 2
+ u _ =2u+4B rs
2
+ \p D±\p F 2
P
3
+ ±p*H ±^ p J 5
0
+
+ B + ->- D + ^ F + ^ H 2
J
/ +
1.814,40Ο·
7
. . . Τ
+ iD + ^F+^H
+ ^ J + - .
Derivation of Finite Difference Approximations
(4.3.7)
M
r ±
i
i i +
, + u
_ , = 2u + (\±2p)B
r ± l - i
+(
+ (±±p
+
155
p )D 2
I
I60 — 360
+ ··· , Incidentally, if (4.3.1) had been written as where F,... are k u ,— u — α « , α > 0 , the same results would have occurred with the one change that ah = pk . By the direct use of Taylor series or by combining the expansions above, we can develop finite difference approximations for the model parabolic P D E (4.3.1). Further, the local truncation error is immediately available. Next we calculate some of the possible combinations. 6
YyyYrr
x
ν ν
2
4.3.1
The Classic Explicit Approximation
Let us multiply (4.3.5) by ρ and subtract the result from (4.3.4) (with the plus subscript). This yields (4.3.8)
«,+ ι . = ( ί - 2 ρ ) « , . + ρ ( κ , . , + « , , , _ , ) ί
ί
ί +
+ p{p-i)l>
+ lp(p -i- )F+
i
2
2
0
••• •
Thus, if we use this finite difference form, referred to as the classic explicit form, (4.3.9)
«
f + l
J
=(l-2p)« , f
s
+ p{u , i r J+
+ K ,,_,) r
[classicexplicit]
the local truncation error will have as its major or principal part \p(p — l)D. But since p = h/k , it follows that 2
(4.3.10) This is essentially the result obtained in (2.1.24) and we say that (4.3.9) is 0(h + hk ) or 0(h + k ) or in a simpler notation 0 ( 1 , 2 ) . The reader can see that the classic explicit method connects mesh points on the (r, s) grid which have the form 2
2
2
o
—
o
—
ο
156
Parabolic Partial Differential Equations
This computational molecule clearly shows that «,+ .,,, the shaded sphere, can be calculated from the lower three points κ , , , - ι , u , and u . We follow the convention of attaching such a symbolic diagram next to each new finite difference approximation developed. Note that if we choose the special case ρ = I in (4.3.8), then (4.3.9) still holds but the local truncation error has a principal part which is r
ip(o -±)F
=
2
s
r
h F=ih>u - iohk u
s + ]
6
1
i
6v )
(>r
Thus, if ρ = | , the classic explicit approximation to the model parabolic P D E is 0(h? + hk ) or 0(h + k ) or 0 ( 2 , 4 ) . All these results could have been derived directly from Taylor series expansions around u . We illustrate the procedure for the case o (4.3.9) as 4
2
4
r
r
s
«r+l. -(l- p)"r. 2
-
J
J
p["r, +l
h + hu + γ υ
r s
x
J
A + -^u 3
2
u
"r. -|]
+
i
χ
χ
+ •
xxx
k
k
2
u,,
+ ku
s
+ -j-u
y
yy
u , - ku + y « „ s
3
+ ~£U
+
vry
y« ,.+
y
n
Collecting terms on the right-hand side, we find that U
r+l, -( - P) r.sl 2
P( r.s+\
U
= h{u
+
U
S
- u
x
) + {-h u
U
- -h_hk u
2
r.s-\)
+
2
xx
4v
Because u — u = 0 , we see that for u = u we have a local truncation error identical to that achieved for (4.3.9). W e could have approached this in the manner x
(4.3.H)
yy
xx
u -u=0>
4
r+
x
l,j
4y
u
κ r,j
_ L ,
r.s+
—
2u
u
+
, r,5—I
r,s
I
with the first difference approximation on the right being O(h) and the second 0(k ). A simple manipulation of the right-hand side yields (4.3.9) directly. For future reference, we could use the notation 2
(4.3.l2a) (4.3.12b)
(e w)r 2
+l, =«r+l, +l i
i
_
2
M
r+l,
i
+
«r+l, -l J
Derivation of Finite Difference Approximations
157
and write (4.3.11) as
h 4.3.2
K
2
The DuFort-Frankel Explicit Approximation
If we multiply (4.3.3) by (1 + 2p), (4.3.5) by ( - 2 p ) , and (4.3.4) with the minus subscript sign by — (1 - 2 p ) and add all three, there results (4.3.13)
(l+2p)
M r + )
, =2p(u . J
r
J + 1
+ «,,,_,)
+ (l-2p)w _, . r
s
[DuFort-Frankel]
- o
Ο r,s- 1
r,i + 1
ό
r-
1,i
This is termed the explicit D u F o r t - F r a n k e l approximation and has a local truncation error
(^-iMf-ife)* Replacing ρ, Z), and F as before, we find that the D u F o r t - F r a n k e l finite difference approximation has a local error of 0 ( Λ + hk + h /k ) or 0(h + k + h /k ) or 0 ( 2 , 2 , 2 / 2 ) . Note that this involves the ratio of h/k as well as the usual independent terms for h and k. If we had used the Taylor series expansion directly, we would have found the equivalent form of the local truncation error as 2
3
2
2
3
2
2h
2
^xx
This is identical to the first equation for the error with u 3x
U
=
2
2
% ·
xx
= u„ t
and
158
Parabolic Partial Differential Equations
Equation (4.3.13) may also be developed through the approximation r,s-\
2h
which is not directly obvious. What has been done is to replace u in (S u/k ) (an approximation for u ) by the arithmetic average of (u , + M , - ! . , ) . Alternatively, one may derive the D u F o r t - F r a n k e l approximation by replacing u by a second order accurate approximation centered in χ and in y. Thus r
2
s
2
r
s
yy
r+
s
vv
(4.3.14)
"Γ.»+|-2« ,, + « ,,-|
„,-,,„= "'•"·' " ' - · ' 2Λ
γ
γ
k
2
In this form one can more easily see why the truncation error has a term h /k . Also, one should note that the D u F o r t - F r a n k e l approximation has a smaller error ( f t ) than the classic explicit approximation with ρ Φ \. 2
2
2
4.3.3
The Richardson Explicit Approximation
Another explicit finite difference approximation which is more accurate than the classic explicit is due to Richardson and is called the leapfrog approximation. It may be written as (4.3.15) u
r-\.s
+ " , . i - i ] + 4pMr s = 0
~~2p[" , i r J+
Ο r,
s
-
1
[Richardson explicit]
•γτ·—Q, r, s +
I
ό
r -
l.s
1
Derivation of Finite Difference Approximations
159
and follows from a substitution of the form (4.3.16)
U
x
- u
y
y
- 0 -
^
—
•
2
Equation (4.3.15) is 0(h + k ) or 0 ( 2 , 2 ) . We do not develop the explicit local truncation error because, as we shall show later, (4.3.15) is unconditionally unstable and should not be used in any calculation. It is, however, important to note that the D u F o r t - F r a n k e l and the Richardson approximations differ only in the manner in which u is treated in the finite difference representation for u . This difference turns out to be enough to make the first scheme stable and the second unstable; it also demonstrates that considerable care must be used to obtain a valid (computable) finite difference approximation. 2
2
r
s
yv
4.3.4
The Backwards Implicit Approximation
The three finite difference approximations to the model parabolic P D E that have already been presented are explicit in form. The term "explicit" refers to the fact that only one value of u on the line r +1 occurs in the approximation (i.e., K | j of the computational molecule). In contrast, there are a number of implicit formulations in which two or more values of u appear on the line r + 1 (i.e., u , u, 1 , u 1 - ). As we shall see later, the difference between an explicit and an implicit approximation is quite important computationally. For the moment, we merely derive a few such implicit approximations together with their local truncation errors and save any discussion on computation until a later section. r +
r + l
s
r+
i +
r+
s x
The backwards implicit approximation is given by the equation (4.3.17) (1 + 2 p ) u , , - p( u , r +
r+
ο
, , + u +
r +
—
,_,) = u . r
ο
—
r + 1, j - 1
[r+1,s
[backwards implicit]
s
m r+1,s+1
0
r. s
Following either procedure outlined previously, it is easily shown that the local truncation error for (4.3.17) is
-H' i) =-il> rK +
B
,+1
160
Parabolic Partial Differential Equations
In addition, we could have written the truncation error as
with all the various forms being completely equivalent for u = u . Obviously, the backwards implicit approximation is 0 ( A + hk ) or 0 ( A + k ) or 0 ( 1 , 2 ) . Equation (4.3.17) can b e developed from x
— n—
U
">
x
_
—
«
r
r+l,s
~
U
h
r,s
yv
2
2
"r-H.j+l ~ ^
U
2
r+l.s +
"r+l.j-l
2
k
+ l . , - » r . M
( ^
~T
h
2
« ) , , ;—r +
\,S.
r
k
c
2
It can be seen that (4.3.17) is obtained by centering the approximation for u at ( r + 1, s) rather than at (r, s). 4.3.5
yy
The Crank-Nicolson Implicit Approximation
The well-known C r a n k - N i c o l s o n implicit approximation is written as (4.3.18)
2(p + l ) «
f
+
l
= 2(1 — p)u
-
I
r
-p(K
s
R+
V
+ p(u
+
I
riJ+!
o
J
+
+ K, , . ^ )
1
+
1
+ u _,). r
[Crank-Nicolson implicit]
s
#
1 , 1 - 1
—
R, Ι -
i
Θ
ο
1
—
ο
R, Ι
R, Ί + 1
The local truncation error can be developed for (4.3.18) as before. The first term is — ( M / 1 2 ) w , while a term abstracted from « y is - ( A / 6 ) u . . Thus the approximation is 0 ( A + hk ) or 0 ( A + fc ) or 0 ( 2 , 2 ) . This, of course, holds only for the model parabolic P D E . Equation (4.3.18) can b e obtained through the approximation 2
3
4 y
6
3
(4.3.19)
2
2
2
« , - 1 1 ^ = 0 = - ^
2A:
2
6 l
Derivation of Finite Difference Approximations
161
In (4.3.19) u is replaced by the average of (S u) Jk and (S u) /k ; that is, the approximation is centered midway between the r and r +1 lines. This accounts for the increased accuracy over the classic explicit and the backwards implicit approximations, which are centered at r and r + 1, respectively. There is one further interesting feature of the Crank-Nicolson approximation. If we combine the classic explicit approximation (4.3.9) a n d the backwards implicit approximation (4.3.17) in tandem, we obtain the C r a n k Nicolson approximation (4.3.18). Thus one would combine the following three steps: 2
vy
2
2
r
2
r+Us
1.
Write classic explicit over the interval r to r +1.
2.
Write backwards implicit over interval r + 1 to r + 2.
3.
Generate Crank-Nicolson for interval r to r + 2 by substitution of (1) into (2). 4.3.6
The Variable-Weighted Implicit Approximation
We have already shown that finite difference approximations for the derivative u in the model parabolic P D E can be centered at (.-, s), [(8 u) /k ] in (4.3.9), at ( r + 1 , j ) , \(8 u) Jk ] in (4.3.17), and at the arithmetic average of (r + 1, s) and (r, s), [((δ u j u ) ) / 2 k ] in (4.3.18). A generalization of this concept would weight ( δ u) and ( δ u) by a factor of θ and (1 - 0), respectively, with 0 θ =£ 1. In other words, we could write 2
yy
2
r
2
s
2
r+x
2
2
r
+
r
s
2
2
r + U s
(4.3.20)
u - =0=
r
s
h
x Uyy
— [9(8 u) + +(\-e)(S u) J, 2
0<θ<\
2
r
Ks
r
or expanding the right-hand side, (4.3.21)
(l+2pi)u
=p (] ,, = p(l-e)[u,,,
r + 1 < 1
+
l
+
u ^.] r
+ [l-2p(l-*)K , tf
O<0<1. [variable-weight implicit]
θ
r+
r+ 1 , j +
1 . 1 - 1
Ο
Ο
Ο
1
162
Parabolic Partial Differential Equations
In effect, we have introduced another parameter θ which can be adjusted along with ρ to yield various finite difference approximations with different local truncation errors. The special cases 0 = 0 , θ-{, and 0 = 1 yield (4.3.9), (4.3.18), and (4.3.17), respectively; thus (4.3.21) contains the classic explicit, Crank-Nicolson, and backwards implicit approximations as special cases. The local truncation error can be developed for this case. In rough form, it can be written as (4.3.22)
12
D
Ρ 360
12
With ρ and θ both free, this yields an approximation of 0(h + hk ) or 0(h + k ) or 0 ( 1 , 2 ) . Of course, for θ = j , (4.3.22) yields the same results as the Crank-Nicolson approximation. However, if we select 2
2
2
1 12p
Θ-
(4.3.23)
the first term in (4.3.22) disappears and the result is 0 ( 2 , 4 ) . The finite difference approximation becomes (4.3.24)
(5+6p)u
r +
L s
+(J - 3 χ « Ρ
Γ +
= (5-6p)«,. +(i + 3pXH 5
u ,,,_,)
,+
r i J + 1
r+
+
M r
._ ) 1
1 12p
Finally, if we let ρ = 1 /γ/20 , further cancellation in the truncation error form 0(k ). occurs; the result is We could continue this procedure of specifying approximations for the model parabolic P D E and then determining the corresponding truncation error employing additional levels of r and more than six node points. Later we tabulate many of the known model approximations together with certain properties of each that we have not yet specified. In addition, we consider the model parabolic P D E in cylindrical and spherical coordinates and the case of two or more spatial derivatives. Finally, we point out that all the material in this section has been developed without use or specification of initial or boundary conditions. T h u s the results and formulas hold in any domain where the model parabolic P D E is valid. 6
4.4
C O N S I S T E N C Y AND C O N V E R G E N C E
In this section we analyze the concepts of consistency and convergence of the finite difference approximations and in the next section that of stability. We assume in this development that the model parabolic P D E is well posed.
Consistency and Convergence
163
In broad terms we may say that stability (computational) calls for the boundedness of all perturbations in a computed solution. In other words, when the magnitudes of perturbations in initial data are made arbitrarily small as h, k,... - * 0 , the resulting perturbations in the computed solution must vanish rather than grow. In such a case computed solutions based upon a consistent difference approximation converge to the solution of the model parabolic P D E . That is, stability and consistency imply convergence as defined by Lax. Stated in another fashion, the success of obtaining a convergent numerical solution based upon a particular finite difference approximation lies in the consistency of the finite difference form with the well-posed model P D E and the stability of the finite difference form. As a result, these concepts are of major importance in assessing the viability of any finite difference approximation. Consistency has to d o with the assurance that, as the finite difference mesh is refined (i.e., as h, k,..., ->0), the truncation errors go to zero. Alternatively, one can say that the finite difference model approximates the P D E desired and not some other P D E . As an example, consider the classic explicit finite difference form. Using (4.3.8), we can develop the approximate relationship (4.4.D
κ - «ο-"--"-Γ+ "- " :r — +i
2
+M
where once again we have used ρ-h/k . But since D = k*u , side, which is the local truncation error, can be written 1
4r
Λ Truncation error = — u
iy
the right-hand
1 , , — —k w , 4l
or equivalently 2^
x x
12
'
It is apparent that this truncation error goes to zero as A, k -»0 no matter how this limit is taken. Thus the classic explicit finite difference approximation is consistent with the model parabolic P D E . Of course, to be complete we need to say the same about the boundary conditions. The analysis is exactly the same when the boundary conditions are replaced (if necessary) with finite difference approximations. We would now say that the finite difference problem is consistent with the model parabolic P D E problem. Note, incidentally, that if a term k<j> is added to the finite difference approximation where φ is bounded as A,/c->0, then the resulting difference
164
Parabolic Partial Differential Equations
approximation remains consistent; thus there are an infinite number of consistent approximations to the P D E . Hence this property alone cannot suffice to discriminate among various finite difference approximations. Almost all finite difference approximations presented in this chapter are consistent with the model parabolic P D E . However, we must differentiate between those approximations that are unconditionally consistent and those which are conditionally consistent. T h e classic explicit approximation is unconditionally consistent since no special relationship between A a n d k need be maintained to eliminate the error term as A,fc-»0. Although this is the situation in most cases, there are some exceptions. Consider, for example, the D u F o r t - F r a n k e l approximation, (4.3.13). The local truncation error has the form (4.4.2)
2
xx'
The consistency of this form is dependent on how h,k-*0. If A goes to zero faster than k, the last term in (4.4.2) goes to zero as well as the other two terms. In this case, the D u F o r t - F r a n k e l approximation is consistent with the model parabolic P D E . If, however, h/k — c—constant, and A and k go t o zero at the same rate, then the approximation is consistent with the model hyperbolic PDE, (4.4.3) This result could be inferred directly from (4.3.14). Thus the D u F o r t - F r a n k e l finite difference approximation is conditionally consistent. The same phenomenon, a conditionally consistent approximation, holds for the Saul'yev scheme shown later (Birtwistle, 1968). However, we emphasize that the vast majority of approximations are unconditionally consistent. A finite difference approximation is said to be convergent if ΙΙ«Γ.,-Κ,.,ΙΙ-ό
as h,k,... -»0. Here II · II is some suitable norm between the exact value of Q(x, y ) and the computed value u at the fixed point r, 5. In principle, this assures us that the difference approximation can be made an arbitrarily accurate approximation t o the exact solution by refining the mesh. It is possible in many cases to derive estimates of the form r
(4.4.4)
ΙΙδ
Γ ι 1
s
-«,,,ΙΙ<κ(ΙΙΤ.Ε.||),
where T.E. is the truncation error for the particular finite difference approximation. If κ is independent of A, k,..., then (4.4.4) specifies an unconditionally
Consistency and Convergence
16S
convergent finite difference approximation; if κ is a function of A, k,..., then (4.4.4) specifies a conditionally convergent approximation with a requirement needed on the values of A, k, Of course, we should also include the boundary condition approximations in our analysis. We would then speak of unconditionally and conditionally convergent finite difference problems. In such a case, the right-hand side of (4.4.4) becomes κ(||Τ.Ε.|| + ||φ||), where
where t represents the difference (or errors) between the exact solution of the P D E , U , and the solution of the finite difference approximation, u , at the mesh point ( r , s). As an example, for the model parabolic P D E and the classic explicit approximation, it follows from (4.3.8) that r
s
r s
r
e =(l-2 )e _
(4.4.5)
r+is
P
r
+ p(e
s
+ e _)
rs+x
rs
+ 0(h
x
2
+
s
hk ). 2
N o w let us impose a constraint on the values of A and k:
Equation (4.4.5) is a linear difference equation for e which we could solve to generate ε, ; fortunately, we d o not need to explicitly carry out this solution. Instead, we turn to a maximum principle type of analysis. In (4.4.5) we note that the three coefficients, (1 - 2 p ) , p, and ρ sum to 1 for any choice of p; further, they are all nonnegative if 0 < p « s \ . Thus ε _ is a weighted average with positive coefficients of the other error terms and it cannot fall below the minimum or above the maximum of the other error terms. Further, we adopt the notation that if r
s
s
Γ + ι
F(x) =
t
0(G(x)),
then \F(x)\
|
£ r + 1
, |<(l-2p)|e J
f i i
| + p|e
| + p | 6 , _ | + /<(A + AA: ). 2
r j + 1
f
J
2
1
Here A is the upper bound of the derivatives in the explicit form of the local
Parabolic Partial Differential Equations
166
truncation error term. Finally, we define E as the modulus of the maximum error along the r t h row in the x-coordinate direction. N o w we can write (4.4.6) as r
E ^E
(4.4.7)
r+
+ A(h
r
+
2
hk ) 2
since the subscript s has been eliminated. But if we assume that the initial line (r = 0 ) has zero error between the true and approximate solutions,
we may solve (4.4.7) in a recursive fashion. Thus £ , < £ 0 + A(h £ <£,+
+
2
A(h
2
<2A(h
+
2
£,< rA(h
2
2
hk ) 2
+
hk ) 2
hk ) 2
+ hk ) 2
= x A{h r
+
k) 2
where x — rh. But when k-Ό, h —0 also since k p = h and thus E -*0 as h -*0. Thus the classic explicit approximation is convergent if 0 < ρ < {. When ρ > ΐ , this approach cannot be used, and instead we must actually solve (4.4.5). The result (details not given here) is that e becomes unbounded as k -»0. Thus the classic explicit approximation is conditionally convergent. We could continue to analyze the other finite difference approximations in Section 4.3, but this is a long and tedious procedure. We would find that the implicit approximations such as the backwards implicit and the C r a n k Nicolson are unconditionally convergent (i.e., they are convergent for any values of p). Because the results obtained through such an analysis correspond to those obtained for stability, which is discussed in the next section, we do not pursue the discussion of convergence further at this time. 2
r
r
r
4.5
s
STABILITY
In Section 4.4 we investigated some of the features of consistent and convergent finite difference approximations as they related to the model parabolic
Stability
167
P D E . Now we consider the stability of these approximations. This feature of numerical analysis has basically nothing to d o with the P D E but rather concerns the unstable growth or stable decay of errors in the arithmetic operations needed to solve the finite difference equations themselves. Although there is a theoretically exact solution to any one of the finite difference approximations, because of round-off error in the computer, errors are committed as the explicit calculation is carried out. Whether these errors amplify or decay characterizes the stability property of the scheme. If an approximation is stable, then we are assured that computational errors can, in principle, be made arbitrarily small. Once again, we encounter the terms "conditional" and "unconditional," but now they refer to the stability of a particular finite difference approximation. As before, a conditionally stable scheme implies that there are restrictive bounds on the mesh widths, A, above which the numerical solution is unstable and below which the solution is stable. An unconditionally stable algorithm has no such bounds. Of course, an unconditionally unstable algorithm has bounds of zero, and no meaningful computation can be carried out with this algorithm. We find, for example, that most explicit finite difference approximations are conditionally stable, whereas most implicit approximations are unconditionally stable. However, this is not always true and many workers have developed unconditionally stable explicit algorithms. The D u F o r t - F r a n k e l approximation, (4.3.13), is a classic example in which the bound on A , k , . . . , is p < o o . Thus any value of A and k can theoretically be used and errors will not propagate as the calculation proceeds. As a result one may use a large A to advance the calculation and thereby save computing time. By contrast, the classic explicit scheme has a bound of ρ < { and the restriction on A can be particularly severe where an accurate representation in y (small k) is required. Yet, at the same time, stable explicit methods such as D u F o r t - F r a n k e l may have inherent limitations due to conditional consistency. If h/k^\.0, the computed solution may involve waves associated with the hyperbolic character of the P D E (4.4.3), with which it is consistent. Further, the imposition of N e u m a n n or second-type boundary conditions will automatically cause the D u F o r t - F r a n k e l scheme to become unstable. Thus the question of stability or instability is only one of the factors that must be carefully analyzed in ascertaining the viability of a finite difference approximation. Nevertheless, stability is probably the most pressing problem in any algorithm since it is a necessary rather than sufficient condition for accuracy. It is generally the first one to be encountered in any attempt to obtain a solution. Accuracy and computational efficiency follow after one is assured that a meaningful computation can be carried out successfully. Moreover, experience indicates that an unstable scheme is not convergent (the classic explicit approximation is a prime example for the case ρ > j ) . The formal statement of the relationship between stability and convergence is known as the Lax
168
Parabolic Partial Differential Equations
equivalence theorem, which reads:*
Given a properly posed initial or boundary value parabolic P D E and a finite difference approximation to it that satisfies the consistency condition, then stability is the necessary and sufficient condition for convergence.
O n e should keep in mind that the analysis above assumes a model P D E that is linear and has only constant coefficients. This type of analysis is extendable to more complex equations. 4.5.1
Heuristic Stability
Because we have qualitatively defined stability with reference to whether an error (say round-off) made anywhere in the calculation is damped (stability) or grows (instability), a n obvious investigative procedure is " t o try it out." By this we refer to the solution of the finite difference approximation for a single isolated error in one number and the observation of the behavior of this error. This approach we refer to as heuristic stability analysis since it yields n o information, unless an exhaustive search is made, on possible bounds on the stability. T o illustrate the procedure we first choose the classic explicit approximation (4.3.9)
u
r+[
s
=(\-2p)u,
+ p(u,, +
s
«,,,-•)
J+1
and investigate the cases p = \ and p = 1.0. For these values of ρ (4.3.9) (4.5.1)
u
(4-5.2)
«,+ I.J = « , . , + ! +
r
+
U
s
= %u , ri
+
l
(P = i)
+ « , _i) r
«
4
,
.
,
-
•
(
P
= 10).
We then set up a grid exactly like that in Figure 4 . 1 , specify initial and boundary conditions and introduce a single error ε at one of the mesh points. Using (4.5.1) or (4.5.2), we compute u to see what happens t o t h e error ε. As an example in Figure 4.2, we show the case where u = 0 , u = 0 (the initial and boundary conditions are all zero) a n d introduce the error ε at one of the initial conditions. It is important t o understand that once ρ is fixed, the choice of k dictates a corresponding value of h. As can be seen from Figure 4.2 when ρ = \ , the error ε damps itself out; when ρ = 1.0, the error oscillates in sign and grows in magnitude. Thus we would say that the classic explicit approximation t o the model parabolic P D E is stable when ρ = { but unstable r
s
r 0
0
s
'Note that Leutert and O'Brien (1952) have shown, using a particular example, that an unstable approximation may converge mathematically for certain initial conditions.
169
Stability
0.375€
0.25€
'ι
"}h
<>
k
<>
0.256
> i•
<•
1»
<
0.375€
—1
•
i
<•
i
0.5€
<>
0.375 € 0.25€
O.S€ 0.5€
<
,1
,
0.25€
i.0€
1
ι
y (P--W2)
H6.0€
9.oe F
1
J
'
i
i
•
-3.0€
Jk
1
1 \
>
4
<»
<
| .
f
^
Λ 19
-7.06
-2.0€
Ί.06 ιΡ
( •
6.0€ 1
3.0€
9.0€
-16.0€
o . o e • I9
Ρ
k
,
\
6.0€
-2.0€
|
-3.0€
I
- r o e )
t
t.06
»
1
»
t.0€
i>
I
t.0€
k >*
1
'
1
< P
1
|
k
4»
(b>
k
'
^ k
1
• r o e
f
C
>—»-
ip-.\)
Figure 4.2. Heuristic stability for ( a ) p = j , and (b) ρ = 1.0 in classic explicit approximation. when ρ = 1.0. T h e approximation is, in fact, conditionally stable, but to establish where the actual bound on ρ occurs between stability a n d instability would require additional results for { < ρ < 1.0. Later we see that the bound is 0 < p * £ j . Incidentally, if ε were introduced on the boundary instead of as an initial condition, the same qualitative result would be determined. Finally, we should mention that depending on the number of decimals carried in a calculation and the size of the error, there may be a delay in an unstable process before one can see the oscillation a n d error buildup. But sooner or later, the unstable nature of the calculation will reveal itself. Now let us turn to the Richardson explicit approximation, (4.3.15), «,+ ι., = « , - ! . , + 2 f > ( « , . , + 1 + « , . , - i ) - 4 p i * , .
(4.3.15)
r
J
For the case ρ = 2 » this becomes (4.5.3)
u +i., r
=
u
r-i.,
+
u
r . i + \
+
u
r . s - i - 2
u
, . s
(P = i)-
170
Parabolic Partial Differential Equations -6.0€
17.0€
_4 )
1.06
) (
-24.0€
I
-6.oe i
-4.06
>
i
ι
^
1
1>
(
47.0 € *
^ i.oe -2.0€ • ^_ ^ 4.0€"
1
Figure 43.
-4.0€
—I
j
ί
4.0€
4.0€ *
1
•
<
11
1
4
1
y
Heuristic stability for Richardson explicit approximation with ρ = \.
In order to use (4.5.3) at the r + 1 line, it is necessary to have data on both the r and r — 1 lines; thus we assume that the initial line is all zero, u = 0 , and that all u, = 0 except for one value of ε. Now we see how this error ε propagates up into the full (r, s) space. Figure 4.3 shows such a calculation and it is obvious that the algorithm is unstable for p = j . In fact, further calculations of this type show that the Richardson explicit approximation is unstable for any value of p. Thus, even though the Richardson explicit, 0 ( 2 , 2 ) , is more accurate than the classic explicit, 0(1,2), the unstable character of the first negates its usefulness completely. We could exhaustively treat all the other finite difference approximations of Section 4.3, but this would gain us little. Rather, we turn to two other methods that can be used to develop stability bounds. 0
s
s
4.5.2
Von Neumann Stability
Perhaps the most widely used procedure for determining the stability (or instability) of a finite difference approximation is called von N e u m a n n stability. In essence, it introduces an initial line of errors as represented by a finite Fourier series and considers the growth (or decay) of these errors as χ increases. The method applies, in a theoretical sense, only to pure initial value problems with periodic initial data; as such it neglects completely the influence of boundary conditions (see Section 4.5.3). Further, it applies only to linear, constant coefficient, finite difference approximations (to this point we have only considered such approximations). If the linearization condition is not met, some form of local linearization is necessary. Because of the linearity, each Fourier component can be treated separately and superposition used to add all other components. It is of practical interest that the von N e u m a n n approach always yields a necessary condition for stability and in many cases this is also a sufficient condition. For ease in discussion, we first consider any finite difference approximation in which κ, is a scalar quantity. N o w we introduce a harmonic decomposition s
Stability
171
of the error at the grid points on a given χ level
£(ν) = Σ Δ
(4.5.4)
/
*Λ
j
where J is equal to the number of mesh points on the χ line, |/?,·| is the frequency of the error, and / is the complex number Because of linearity, we need only consider one of these / terms and thus only need e' (where β is real). That is, each harmonic grows or decays separately of others. Now we write the solution of the finite difference approximation in a separable form as Py
E(x,y)~e e't> ,
(4.5.5)
yx
v
where γ = -γ(β) is, in general, complex. N o t e that the solution at χ = 0 equals the error introduced at x=0. But we see from (4.5.5) that in order for the original error not to grow as χ increases, |e
Y J t
|^l
for all y . Alternatively, we may write this condition for stability as | e * | < l.
(4.5.6a)
[von Neumann condition]
Y
In general, one defines { Ξ ^ Ξ constraint (4.5.6a) becomes
the amplification factor and thus the stability
(4.5.6b)
|£|<1.
To illustrate the use of (4.5.6b) we shall now consider those finite difference approximations for the model parabolic P D E developed in Section 4.3. We start with the classic explicit, (4.3.9), which we write in error form (the error is assumed to satisfy the difference approximation) (4.5.7a)
E
r+Us
= (l - 2 p ) £ . , + p ( £ . r
r
J + l
+ £,.,_,).
Substitution of (4.5.5) in the form (4.5.7b) into (4.5.7a) yields
E
r% s
= ey e ^ rh
i
sk
= f V ** 3
172
Parabolic Partial Differential Equations
Cancellation of common terms yields i = ( l - 2 p ) + p[e** + e-**]. Now, using the trigonometric identity
and the definition e'
pk
+e
lfik
= 2 c o s fik, there results
€= 1
2p(l-cos/3fc)
or (4.5.8)
€= 1
Thus we have developed an expression for the amplification factor ζ for the classic explicit approximation. We now merely need to see what requirements are involved such that \ζ\<\ holds for all βk. Thus we need to consider the conditions whereby
We see immediately that 1.
The upper bound -I-1 is satisfied automatically since ρ > 0 .
2.
For 0 < ξ, the solution (4.5.7b) decays steadily.
3.
For — Κ ξ < 0 , the solution (4.5.7b) decays but oscillates.
4.
For £ < — 1, the solution (4.5.7b) oscillates with increasing amplitude. This is an unstable condition.
Thus, for stability, -Kl-4psin ^ 2
or
Noting the behavior of sin (/Mr/2) for any choice of 0k, we see that in the 2
Stability
worst instance [i.e., ύη\βΙί/2)=
173
1]
Thus the classic explicit finite difference approximation is conditionally stable with a stability bound of (4.5.9)
0
[classic explicit]
If we further desired no oscillation in the stable behavior,
£= l-4psin 4^0 2
or (4.5.10)
0
2(l-cos/3*)
For the D u F o r t - F r a n k e l approximation, (4.3.13), the same procedure can be used. T h e development is slightly more complex since three r levels, r +1, r, and r - 1 , are involved rather than merely two levels, as in the previous case. The amplification factor is ^_
2pcosfik±\l(2pcosfikf
-4p + l 2
l+2p or
(4.5.11)
2 p c o s fik±]lΊ-4p £= — — ^
sin fik — .
2
2
[DuFort-Frankel]
Consideration of the magnitude of the term under the square-root sign shows that |£|*£l, and therefore D u F o r t - F r a n k e l approximation is unconditionally stable. For the Richardson approximation, u
(4.3.15)
r + U s
-«,_,,, =2ρ[«
Λ
i + l
+ u, _ , ] - 4 ρ κ ί
Γ
we may substitute (4.5.5) to yield £ r + \eiflsk
_
γ - \ tf,k e
_
2p[£'
eil>(,+
" * + £ >K'-')*] re
_4ρξ' <β'ΐ< β
Canceling out the e'** term and using the same identities mentioned above k
174
Parabolic Partial Differential Equations
there results Γ
+ . _
Γ
- 1
r -r~ + ,
=
, =
2
p
£
/
-r8psin
{
-
2
}
2
2 "
But this is a difference equation, for which we can write | +8p|sin ^-l=0 2
2
and the roots are (4.5.12)
ξ,
= -4psin ^±^16p sin ^ + l . 2
2
2
[Richardson]
4
Calling R = 4p sin ( fik / 2 ) , we may now write 2
£,, = - Λ ± / ΐ + Λ
2
2
and note that ξ, = — 1 / ξ and £, + ξ — —2R. It is now easily verified that for that satisfy the constraint any choice of β and ρ there are n o values of |£, | < 1 . Thus the Richardson approximation is unconditionally unstable. In spite of its attractive truncation error, it cannot be used for a meaningful computation. 2
2
2
2
Next, we turn to the backwards implicit approximation, (4.3.17), (4.3.17)
0+2Ρ)Η
Γ +
,,,-Ρ(
M, ,,+ • + «,+ !.,-•)=«,.,· +1
Substituting as before and canceling common terms, we obtain (l+2p)|-p|(e'^ + e~'^)=l. This expression may be rewritten £[l+2p(l-cos/3A:)] = l or l+4psin
2
)8* ^
= 1.
Thus the amplification factor is (4.5.13)
ί =
l+4psin
JJT-. j
[backwards implicit]
Stability
175
It is apparent from (4.5.13) that | | | < 1 for all values of p, a n d therefore the backwards implicit approximation is unconditionally stable. The C r a n k - N i c o l s o n approximation, (4.3.18), (4.3.18)
2(P +
1 K + I . , - P ( « , I.,+ I+ «,+ !.,-•) +
= 2 ( l - p ) « _ + p(u ,,+ r
s
,+
r
«,.,_,)
can be analyzed for stability in the same manner. In fact, one obtains
-2 (r+r')sin ^=r -r 2
+l
P
or
r (l+2psin ^)=r(l-2psin ^). 2
+ ,
2
Thus it follows that the amplification factor is l-2psin ^ 2
(4.5.14)
£=
[Crank-Nicolson]
l+2psin ^ 2
For any value of ρ and we have | | | < 1 and thus the approximation is unconditionally stable. Finally in this section we turn to the generalized weighted implicit approximation, (4.3.21), (4.3.21)
(l+2pe)u
r + l i J
= p(l-*)[ii ., r
+
P*[«r .., +
+
+ 1
+ «„_,]
i+
«r ..,-il + +
[l-2p(l-*)]« .,. r
Substituting (4.5.7b) and canceling terms as before, we obtain the following expression for the amplification factor: l-4p(l-0)sin ^ ξ= — l+4p0sin ^ 2
(4.5.15)
.
[weighted implicit]
2
This amplification factor will be bounded, \ξ\< 1, for all /3/t if (4.5.16)
p(l-20)^.
Parabolic Partial Differential Equations
176
From this, we may note the following constraints: (i)
0=0,
(")
0 < i2
as in classic explicit >
2(1-20)
(iii)
ρ < oo; always stable as in backwards implicit a n d Crank-Nicolson
(iv)
-^(4.3.23),
p =
6(1-20) '
Condition (iv) indicates that (4.3.24) is unconditionally stable. Our discussion of stability and consistency can now be summarized. Each of the explicit approximations has a deficiency in terms of conditional stability or conditional consistency. In contrast, each implicit approximation is unconditionally stable and consistent. This seems to be true in all cases. All of the discussion on von N e u m a n n stability above assumed that u , was a scalar quantity. Yet in many problems there will be more than one dependent variable and the analysis must be generalized. N o t e that this has nothing to do with the number of independent variables but only the dependent variables. Further, we intimated some problems with the analysis of the D u F o r t - F r a n k e l and Richardson approximations; these problems can be circumvented using the analysis to follow. We now consider the vector function {u) , in which there are as many elements as dependent variables. Following the previous concepts, we now introduce the von N e u m a n n series in the form r
r
s
sk
into the system of difference approximations. Canceling the common factors, there results
[Q]l{») lM) r+
=
[Q\o{u)rM)-
Here [Q] and [Q\ are matrix operators depending on the constant coefficients of the finite difference approximations and the increments h and k. On the assumption that [(?], can be inverted (nonsingular), we may write x
(4.5.17)
0
{«)r
+
Ufii) =
[G]{u} Mh r
where [(/] = [<2]Γ'[£?1ο is termed the amplification matrix. [G] is a square matrix of size equal to the number of dependent variables and describes the transition or evolution of the Fourier components. In order for the Fourier
Stability
177
components to be bounded, it follows from n«}rj<\\[G]\\ \\{u) j, r
0
where { « }
0 s
= { « } ( # / ) , that
ii[G]ir be bounded. But since \\[G]\\'>R ([G]), r
where R([G]) is the spectral radius or largest eigenvalue λ of [G], the end result is that all the eigenvalues λ, of the amplification matrix [G] must be bounded by (4.5.18)
|λ,|<1.
Equation (4.5.18) is the von Neumann stability (necessary) condition for more than one dependent variable. T o illustrate the use of (4.5.18), let us return to Richardson's approximation,
«
i , = 2 p ( 5 « ) . + w2
r +
J
r
We define a new variable v (45.19)
r+x
s
«ι
Γ + ι
r
s
= u
r
I.J-
such that
s
.,=2ρ(« „),, + «,, 2
In vector form (4.5.19) becomes 2p(S u) ,
1
1
0
2
{«}r + i.,
:
r s
where {u} = {u , v } . Introducing the von N e u m a n n series and carrying out the cancellations yields T
r
or
s
r
s
r
S
Parabolic Partial Differential Equations
178
with -opsin γ
1
2
[G} =
The eigenvalues of [G] are λ, = — 4psin"
fik
16p sin ^ + l . 2
4
This merely confirms (4.5.12) and | λ | > 1. The D u F o r t - F r a n k e l approximation can be written in two-variable form exactly as above and an equivalent analysis yields (
l+2p
[G]
l~2p l+2p 0
cos fik
with eigenvalues 2p cosfiA: ± \J 1 - 4 p sin fik 2
2
l + 2p which conforms to (4.5.11). It is possible to further state that if [G] is normal (i.e., it commutes with its adjoint), then the von Neumann condition is sufficient as well as necessary. In addition, if the exact solution is thought to be an increasing exponential, a relaxed von N e u m a n n condition is given by l + ATi,
(4.5.20)
where Κ is a uniform bound for all Fourier modes. Thus if one considers the parabolic P D E u = u x
+ au,
a >0
and the approximation (classic explicit) 4
r + l.i
u
u r,s
^• r.j-M
—
2u
+M
r.s
r,s-
+ au
r
a simple analysis of the type carried out in this section yields the amplification
Stability
179
factor £ = l - 4 p s i n ^ + A, 2
where b — ha. Thus (4.5.20) is satisfied if ρ *£ 4.5.3
as before.
Matrix Stability
We wish now to examine some of the finite difference approximations of Section 4.3 via what is termed the matrix method. As distinct from the von N e u m a n n approach, the present method includes directly the boundary conditions. Thus we restate our model parabolic P D E as u =
(4.5.21)
u
x
yy
u = f(y),
x=Q,
O^y^l
a u + α,Μ,, = α , 0
v=0,
x>0
y = \,
x>0.
2
β ι* + β η 0
χ
= β,
ν
2
Further, the finite difference approximations take the form [A) {u)
(4.2.1)
0
r
+
X
=[A} {u) x
+
r
[A] {u} . + 2
r x
where [ Λ ] , [ / 4 ] , , [ / 1 ] , . . . are square matrices of order equal to the number of internal (not counting boundary values) mesh points on any line x. If [A] is diagonal, (4.2.1) represents an explicit approximation and if [A] is not diagonal, (4.2.1) represents an implicit approximation. It is assumed that [A] is nonsingular and thus [A]Q ' exists. Actually, for the approximations under consideration, [ Λ ] , [ / 1 ] , . . . =[0] and [Λ] =^[0] only for the Richardson and D u F o r t - F r a n k e l approximations (the lines r + 1, r, and r - 1 are involved). Thus we frequently need only [A] and [A] . Because stability is under investigation, (4.2.1) only involves the subscript r(x = rh), the direction in which we wish to examine error propagation. Most of our results are identical to those obtained from the von N e u m a n n approach, but in at least one case, we indicate how the boundary conditions change a stable approximation into an unstable one. The basic approach is straightforward to detail. Consider a matrix equation arising out of a finite difference discretization 0
2
0
0
0
3
4
2
Q
(4.5.22)
{u}
r
X
+
i
=
[B]{u} , r
180
Parabolic Partial Differential Equations
where [ # ] = [ Λ ] 'ΜΙι', then in terms of the error { £ } , 0
r
{E}
(4-5.23)
r
+
=
i
[B]{E} . r
In turn, it follows that
and for errors to die out, or be damped, it is necessary that (4.5.24)
ΙΙ[β]ΙΙ<1.
We merely need to put our approximations in the form of (4.5.22) or (4.5.23) and examine (4.5.24). We start our analysis with the classic explicit approximation, (4.3.9), (4.3.9)
«,+ •., = 0 - 2 Ρ ) Μ . , + Γ
Ρ(Μ,,
1
+
,
+
Ι Ι
Γ
. , _ Ι )
and specify the boundary conditions in (4.5.21) as κ=0,
>>=0
u=0,
y = l.
Actually, if these conditions are not equal to zero, but rather a constant or a variable, the analysis does not change. It merely adds a constant vector to the right-hand side of (4.5.22), and this is not used in the manipulations. If, however, α , , β , =^0, then flux conditions are imposed and this does influence the results, as we shall see shortly. Converting (4.3.9) into the form (4.5.22) or (4.5.23), we see that (4.5.25)
[A]
0
= [I];
!>],=[*]
=
1 — 2p
ρ
0
ρ
1 —2p
ρ
0
0
ρ
1 — 2p
ρ
or
[*] = M + p[U where [T] is the tridiagonal matrix {1, —2,1}. In essence, (4.5.24) is equivalent to considering the spectral radius of [B],R([B]), and requiring, for stability, that Λ ( [ Β ] ) < 1 . But since [T] (or [B]) is tridiagonal, it follows that the eigenvalues can be obtained easily. The eigenvalues of the tridiagonal matrix
Stability
181
{A, ο , c ) are \ = a + 2{Jbcco$(s-n/n)}, where s = 1,2,...,η - 1 is the number of internal mesh points along a line in the χ direction. Thus the eigenvalues of [B] are given by s
\
s
= 1 -2p{\
—
c
o
s
~ )·
Using, as before, the trigonometric identity 1—cosa = 2sin —, 2
we find that (4.5.26)
X = 1 —4psin
SIT
2n~
s
It is now evident that for stability ,2 St!
-Kl-4psin ^
j = l,2,...,n-l,
and this leads to the condition 0 <
P
< 1
Next we turn to the D u F o r t - F r a n k e l approximation, (4.3.13)
( l + 2 p K
+
l
i
I
= 2 p ( « , ,
1
+
+ «, _ ) +
I
> 1
1
+
[ ^ ]
( l - 2 p K _ , .
In terms of (4.2.1) we find that
[>*lo{«},-,,=Mli{«},
{ « } , - i .
2
where [A] =(\-2p)[I]
[Λ] = (1+2ρ)[/],
2
0
0 MI=2P
1 0 · · ·
1 0 0
1 0 · · · 1 0
1
0
Thus {«}, . = M ] a 7 [ A ] { u } i
+
l
r
+
[A\ - [A] {u} . . X
0
2
r l
J
Parabolic Partial Differential Equations
182
We may, as before, remove by defining a new variable v , implies that an equivalent form is r+
, = u ; this r
s
{u} =[B){u) , r+]
r
where {u} is the new vector and r
[B} =
[AK [A]
WM.
l
[I]
2
0
The eigenvalues of this matrix [B] are given by the roots of (l+2p)X -4p\cos^ + (2p-l)=0,
5= 1,2,...,,?-1.
2
It can be shown that | λ | < 1 for all ρ and unconditional stability is thereby established. Finally, we turn to the Crank-Nicolson approximation, 2(p + l ) M
(4.3.18)
r + l i I
-p[ii,
= 2(1 - p)u
+
) i l + l
+ p(u,
rs
+ «,+ , . , _ , ]
1 + l
+
u _,). rs
We may write this in the form (2[I]-p[T)){u)
r
+
=(2[I]
i
+
p[T]){u} , r
where [T] is tridiagonal {1, —2,1}. Alternatively, we write {"},
= ( 2 [ / ] - p [ T ] ) " ( 2 [ / ] + p[7']){ } ,
+
l
U
=
r
[B]{u) . r
Since the eigenvalues of [T] are — 4 s i n ( j i r / 2 n ) , the eigenvalues of [B] are 2
, sir 2—4psin 2n λ =• sv 2 + 4psin" 2n~
5 = 1,2,...,n-l.
These \ are all less than one for ρ > 0, thus reconfirming the unconditionally stable behavior of the C r a n k - N i c o l s o n approximation. Let us now illustrate the influence of flux boundary conditions on the analysis. The point i = 0 corresponds to y=0 and s = n to y = \\ a typical s
Stability
183
version of the conditions in (4.5.21) might be y~0,
u = h,(u-a*), r
a = l,
α, = - 1 / Λ , ,
0
a = a* 2
«,. = - Α ( « - / 8 · ) ,
>> = 1
2
P\> = - 1 ,
/9, = - l / A , 2
&= where all the items are constant. This would correspond to heat fluxes with A,, A as heat transfer coefficients. The question that immediately arises is what Because the P D E approximations are formula to use to approximate u 0(k ), we use central differences to achieve an approximation of the same order. Thus 2
r
2
(4.5.27a)
=
2k
Α,(« .ο-α*) Γ
- u.
(4.5.27b)
2k
is coupled with the classic explicit approximation. N o t e that in (4.5.27) fictitious mesh points, u and u , occur. These are points on any r row that are one mesh point outside of j > = 0 and y = l, respectively. But these points can be eliminated by solving for them in terms of u , u , and u, „ _ , , u „. Thus the matrix equations become r
r
n +
r l
r
(4.5.28)
{«},-, = [*l{«}r +
{<0.
where {u} is a vector of η + 1 terms u , w , . . . , u , „ _ , , « r
r
0
r l
r
n
, and
2pA,a*/c 0 0 2ph fi*k 2
[ l - 2 p ( l + A,*)]
2p
Ρ
l-2p
[BY-
l-'2p 2p
"
ρ
( l - 2 p ( l + A A)] 2
r 0
184
Parabolic Partial Differential Equations
For stability purposes, we can discard {d} since it is a constant. What we need to do is look at the eigenvalues ol\B] and see if they are all bounded by 1. We d o not show the details but merely summarize. One finds the bounds to be -1<1-2ρ(2+Α,*.)<1 -\<\-2p(2+h k)<\ 2
or
1
P
P <
Thus we select
.
p^min-s
ί
2 + A,Jt
<
2TV' ι
— — : — r
.
i l
;—;——
[ 2 + Α,& 2+h k for stability. Obviously, if A, = A = 0 , we return to the nonflux stability bounds. * Similar results can be obtained for other finite difference approximations. However, some care must be taken; as shown by Taylor (1970), the D u F o r t Frankel approximation with flux boundary conditions is unstable if u is represented by a central difference approximation (as above), 0(k ), but stable if a forward or backward difference approximation, O(k), is used. We have attempted to show that one must be very careful in selecting a finite difference approximation. Stability considerations may be such that an apparently simple approximation is unstable. It is interesting to note that whereas the Richardson or leapfrog approximation is unstable for the model parabolic P D E , it is stable for the model hyperbolic PDE. This implies that it is probably incorrect to refer to an algorithm as stable or unstable. The same algorithm when applied to different differential equations will lead to different difference approximations which exhibit entirely different stability characteristics. Thus the centered difference in χ and y when applied to u = u leads to an unstable approximation, whereas the same centered difference in χ and y applied to u + u = 0 yields an unconditionally stable approximation. To make this point more evident, we state the following (the interested reader may wish to check out the details): y
2
2
y
2
x
yy
x
1.
y
For the model parabolic P D E "* = «",·»•
*Hindmarsh and Gresho, 1983, have shown that, in contrast to the sufficient conditions given here, the necessary conditions are p«min { j ^ , j j j if h,k and hjk > 2. Hindmarsh, Α., and P. Gresho, "The stability of explicit euler time integrations for certain Ref. finite difference approximations of the multi-dimensional advection-diffusion equation." Int. 1. Num. Meth. Fluids (in press).
Stability
185
the Richardson centered difference approximation for u and w is unstable. At the same time, the classic explicit, forward difference on u and central difference on u , is conditionally stable, 0 < ρ = ah/k |. For the model parabolic P D E x
vl
x
2
vr
2.
where /' = / — Τ and ω is real, the classic explicit approach yields a completely unstable approximation. 3.
For the same model parabolic P D E as in (2), a Richardson approach yields a conditionally stable approximation, 0 < ρ < 1 / 4 ω .
Next, we consider a model parabolic P D E of the form yy "r+Ι,ι-Ι
4
"r,i~l
h
U
r+\.s+\
U
r,s+\
k
2
or (4.5.29)
«,+ , , , - ι + M
r +
,.
1 +
,=(l+2p)(«
r
t
_, + «
r
J + l
)-4p
U r J
.
We may rewrite (4.5.29) in two parts: (4.5.30a)
«,+ , , , + , = - Μ
(4.5.30b)
«,+ , , , _ , = - u ,
γ + Ι ι ϊ
_ , + (l+2p)(«,_,_, + "
+ l i J +
, +(1 + 2p)(K
f i J
r
i + 1
_, + " , .
)-4pu
ί + 1
f
)-4ρκ
5
Γ ί
.
The equations of (4.5.30) can be used in the following way (together with the given boundary conditions): 1.
Use the first equation from left to right along any r + 1 line to calculate U
r + 1 . 2 > r + 1 , 4 ' r+ 1.6' • · • < r + 1, n + IU
U
U
2.
Use the second equation from right to left along the same r + 1 line to _ ,.... calculate u , „ _ , u , „ , u
3.
After both passes, all the u
r +
2
r +
n
4
r + n
r + i s
6
will be known on the r + 1 line.
T h e question that immediately arises is: Why go through these manipulations? The reason is that (4.5.29) is implicit (note that u _ and u occur), whereas (4.5.30), because of its method of calculation, behaves like an explicit approximation and explicit methods are usually simpler to calculate. However, all of this numerical sophistication is to no avail because analysis of the stability of (4.5.29) or (4.5.30) shows they are completely unstable. T h u s what seems to be an ingenious algorithm computationally is absolutely of no practical use. r+]
s
t
r + l s + ]
Parabolic Partial Differential Equations
186
4.6
SOME EXTENSIONS
There are a number of extensions of the basic concepts developed in previous sections which are of interest. Note, however, that we continue to retain the model parabolic PDE, u = u , and have not, as yet, considered more than two independent variables; this extension to higher dimensions is discussed later. x
4.6.1
vv
Influence of Lower-Order Terms
To this point our analysis has been concerned only with the model parabolic P D E M = u ,. Now we wish to show that the addition of lower-order terms, such as u, and u in the PDE, does not affect the stability bounds already derived. Thus we consider vl
V
u - UYY + au + bu.
(4.6.1)
x
v
There are, of course, many ways to finite-difference this equation; consider the straightforward explicit approximation (
4
6
2
)
* " ' '
U
r + l . , - " r . ,
_
«r.,+
l ~
2
" r . , + "r. s - I
h
k +
Ο \ «,. , + 1~
+
«r. s - I ]
2k
1
bu . rs
Because the approximation for u approximation remains 0(h + hk ) 2
is of the same order as for «,.,,, the or 0(h + k ) or 0 ( 1 , 2 ) . If we had used
r
2
2
the result would be 0(h + hk) or 0(h + k) or 0 ( 1 , 1 ) . Let us now analyze the stability of (4.6.2). The case where a = 0 has already been examined at the end of Section 4.5.2. By a von Neumann stability analysis, the amplification factor was reported to be 2
(4.6.3a)
$=
l-4psin 4£ 2
+ M,
leading to the same bound on ρ, 0<ρ*ζ{-, as when b=0. It is interesting to observe that ξ in (4.6.3a) can be obtained by considering the amplification factor for the case b—0, 1 — 4psin (/3A/2), and then merely adding to it the result for bu. Now let us consider the case of α Φ 0. We perform a von N e u m a n n stability analysis as usual. The only new feature is the term 2
2k
Some Extensions
187
If one examines this term along with the left-hand side of (4.6.2), the von N e u m a n n analysis yields an amplification factor of iajsinfik.
(4.6.3b)
Thus the total equation (4.6.2) yields a combination of (4.6.3a) and (4.6.3b): { = 1 - 4 p s i n ^ + ia £ sin fik + bh.
(4.6.4)
2
Since this is a complex number, it follows that - 4 p s i n ^ + bh)j + a pAsin fik .
Υ(1
2
2
2
2
As usual, we desired \ξ\ =s 1 for stability; after tedious calculation, it can be shown that 0 < ρ \ as before. If instead of representing u by (S u) /k we had used the weighted implicit form [i.e., 0 ( o * « ) , , + ( 1 — θ)(8 ιι), J, then we would have used (4.5.15). In (4.5.15) the amplification factor for « is 2
vy
2
r
2
s
2
f+
l-4p(l-0)sin ^ {= — - i - . l+4 0sin ^ 2
(4.6.5)
2
P
By following exactly the same approach as was used above, except that (4.6.5) must be carried throughout, one obtains 1 - 4 p ( l - θ )sin ~
+ ia jsinfik — i l+4 0sin ^ 2
(4.6.6)
1=
2
+ bh
.
2
P
Expansion of (4.6.6) to form \ξ\ and an analysis of the results for conditions such that | £ | < 1 reveals that the weighted implicit bounds on ρ found in Section 4.5 hold exactly. Thus it appears that the presence of lower-order linear terms in the model parabolic P D E does not influence the stability bounds. 4.6.2
Higher-Order Forms
Although we have already presented a number of different finite difference approximations for our model parabolic PDE, we have not concentrated on
188
Parabolic Partial Differential Equations
improving the order of the approximation. Such improvements can be made by 1.
Use of a computational molecule with more than three s points on each r level. However, we desire to use a maximum of three χ points on any r level to circumvent computational difficulties. With this restriction we can use only a total of six mesh points, three per r level. We have already presented an optimum approximation for this case, 0 ( 2 , 4 ) in (4.3.24). This scheme is frequently called the Douglas approximation (Douglas, 1956). Boundary conditions are discussed by Zafarullah (1971). We shall not pursue this approach further.
2.
Use of three r levels, with three s points per level. In this case the maximum number of points would be nine. Actually, the Richardson and D u F o r t - F r a n k e l approximations fall into three /--level schemes. We now wish to present three additional implicit approximations of this type.
The first approximation, which is 0 ( 2 , 2 ) , follows from
In effect this formula weights (with \ and — \ ) in the χ direction. Expanding and collecting terms, we obtain (4.6.7)
[3+4p]«
r + l i I
-2p(« . #
+
I i J +
, + «,+ , , , _ , ) = 4 «
Γ ι Ι
-«,_,_,.
This implicit formulation (4.6.7) is 0 ( 2 , 2 ) and unconditionally stable. Alternatively, we may extend the concept of the C r a n k - N i c o l s o n scheme formulated in two r levels to three r levels. T h e resulting implicit, 0 ( 2 , 2 ) form is
(4.6.8)
" -'^=-[ [(g ii) f
2
I
,,s+(* ")r.s+(* «)r-.,s]t
r +
2
Some Extensions
189
When expanded this stable 0 ( 2 , 2 ) formula becomes (4.6.9)
[1 + ! Ρ Κ
+
1
Ι
Ι
-$Ρ[«γ Ι., +
+
Ι + « , + • . , - • ]
2P, = - 3- [ «*r.,+ l —2« . , + « , . , - | ] P
[ -!p]"r-l. +3P[",-1, +l + «r-|. -|]-
+
1
I
R+ 1
R
I - 1
J
Ο
R+Ι,Ί
R+1,I+1
Ο Q—ο Ο—ο—ο
r, s-
R -
i
r.s
1
1
Ι , Ί -
r
R -
Ι , Ί
τ-
,s+
1
1
1 . S +
Here we have used a central difference for u and, as can be seen, an average for u over all three levels. Finally, through analysis of the truncation error in (4.6.8), one can find an even better approximation, which is 0 ( 2 , 4 ) . This 0 ( 2 , 4 ) formula is also stable and uses the same approximation for u as employed above. Thus we write x
x
=
2h
-^[(* «)Γ .. +(β «),. +(β «),-,. ] 3k 2
2
+
[(S u)
2
ί
ί
2
24Λ
ί
,,-(8 u) . ,]. 2
r
+
l
r u
Expansion of this approximation yields (4.6.10)
(5 + 8 p ) H =
4
r + 1
P["r,
. -(4p-i)[H 1
i
+
l ~
2
u
r , s
+ (5-8pK_
+ M, , _ ] 1
+ (4p + i ) [ « , _ , , ,
+ I
U
1 + 1
r, s -
r+
1,
s
r+
1,
+ «,_,.,_,].
s+ 1
R,s + 1
1
Ι,Ί -
l
r.s-l]
o—o—ο Ο ο—ο Ο—ο—ο
R + 1,s - 1
r-
l i J
.
+ 1
+
r + 1
1
I . J
R - 1,Ι+
1
Parabolic Partial Differential Equations
190
Although many additional, higher-order accurate approximations can be developed, our experience indicates that such schemes are seldom used for practical problems. Illustrative examples of the use of three-level approximations can be found in the papers of Lees (1966) and Bonacina et al. (1973). 4.6.3
Predictor-Corrector Methods
We have already mentioned that the combination of certain finite difference algorithms can lead to additional approximations. In this and the next section we illustrate certain of these; some of the results are surprising to say the least. We are primarily concerned here with the classic explicit and the backwards implicit approximations. Thus we first rewrite these equations in simple form together with their truncation error and amplification factors. (4.6.11)
r+],s
4
u
u
~¥ u
.• — 2u
[classic explicit]
ο — ό
r.J -
Ό r,
s+ 1
1
ί; = 1 — 4pshr T r u n c a t i o n e r r o r = \h u 2
xx
— -\ihk u^ 2
y
+ ··· ;
0(1,2)
(4.6.12) [backwards implicit]
r+
Π Ι 1 , s - 1
•+
1,s
Ο
r+
1,5 + 1
191
Some Extensions
l l+4psin ^ 2
Truncation e r r o r = — \h u 2
— jihk u^
+ ··• ;
2
xx
v
0(1,2).
Recall also that the explicit form has a conditional stability bound, whereas the implicit method is unconditionally stable. First, let us use the classic explicit approximation to calculate the values on the line r + j (we use j here to simplify the final result) and then follow it up with a backwards implicit calculation of the values on the line r + l. We may write U
r+\/2.s
U
• 2M
r.s
+
U
,
A/2 u r+\.s
U
r+i/2.s _
U
r + i . s + i ~
2
u
r + \ . s
+
U
A/2
r+ l . j - l
for the combined two-step procedure. We refer to the overall process as a predictor-corrector scheme because the second formula uses the numerical values from the first formula. Adding these two equations together (note we d o not eliminate variables from one equation and substitute into the other), we obtain (4.6.13)
" r + \ . s -
A
U
r . s
_
1
U
,.,+ l -
2
+
2
u
r . s
"r.s-\
+
k
2
r+\.s+l
U
2
u
r + I,s
U
r+
1 ,s-
Equation (4.6.13) has exactly the form of the Crank-Nicolson approximation. Inasmuch as we have the amplification factor for each step, we can write the overall amplification factor for (4.6.13) as (4.6.14)
l-4psin ^]fl+4psin ^ 2
2
which, with the use of p / 2 because of the half step, is identical to the C r a n k - N i c o l s o n amplification factor. Thus this combined process is unconditionally stable as long as A is held constant in each step. Further, if one looks at the truncation errors, it can be seen that the 0 ( A ) term has opposite sign and when added cancels out. Consequently, the combined process is 0 ( 2 , 2 ) . We may also interchange the order of the calculations. If we use the backwards implicit first (for a step A) and then the classic explicit second (for
192
Parabolic Partial Differential Equations
another step A), the result is, in exactly the same manner as before,
-κ.
/•+
(4.6.15)
•r+2,l
V+
+ I
V+I.i-H
1,1
Γ,5
1,1
_
-2M r +
1,1
-2M r+1,1
+ «r + l , i - l
+
«r+ 1,1-1
"/•+!
2A
But this has exactly the form of the Richardson explicit approximation [(4.3.15) with the index τ decreased by one], which is completely unstable. Yet the combined two-step process has the same amplification factor, (4.6.14), as before and is unconditionally stable. Further, the truncation error is 0 ( 2 , 2 ) . Thus we see that if we form a two-step predictor-corrector process from an unconditionally stable and a conditionally stable approximation, the result is an unconditionally stable approximation. Moreover, we even achieve a better accuracy, from 0 ( 1 , 2 ) to 0 ( 2 , 2 ) . This in the face of the fact that one of the schemes, the second, appears to be unconditionally unstable.
4.6.4
Asymmetric Approximations
N o w we turn to some interesting methods that are termed asymmetric because of either the nonsymmetric method of application or the explicit form of the approximations. These algorithms will be most useful for higher-dimensional problems; for the present they all behave as explicit algorithms in that only one new mesh point is calculated at a time. Gordon (1965) first introduced the idea of using explicit and implicit finite difference schemes at alternate mesh points (on a single r line) to solve the model parabolic P D E in one dimension (u = u ); this was followed by papers by Scala and Gordon (1966, 1968). Then Gourlay (1970) placed the procedure in a more general setting referred to as the hopscotch method. The name derives from the children's game, hopscotch, and the manner in which the mesh points are employed. Gordon proposed the following procedure: x
ry
1.
On any given r + 1 line, calculate every other point on the line with the classic explicit approximation.
2.
On the same r + 1 line, calculate the missing points on the line using the backwards implicit approximation.
Some Extensions
3.
193
On the following r + 2 step, reverse the roles of the odd and even formulas, and so on, as follows: + 0 x
0 + x
+ 0
x
0 +
x
+ 0
x
0 +
x
r+2 line r + l line r line, all values known
+ 0 0 + x
x
0: calculate with classic explicit + : calculate with backwards implicit The overall result is a series of explicit calculations since there is never more than one unknown u at any point. The result was shown by Gordon to be stable and to be consistent with the model parabolic P D E in exactly the same manner as the D u F o r t - F r a n k e l method. In fact, it turns out that the combined sequence behaves like the D u F o r t - F r a n k e l approximation applied to half the points. Gourlay showed that this sequence could be written r + U s
(4.6.16)
»r l,s
=
(4-6.17)
«
= « ., + ρ ( « ΐ ί )
+
»r,s+P(* »)r.s 2
2
Γ + 1 ι ί
Γ
Γ +
Ι ι ί
,
where each equation is used on alternate mesh points along the r + 1 line (in t h e ^ direction). If (4.6.16) is used for s even and (4.6.17) is used for s odd, and if we further define if r is even otherwise,
(4.6.18)
then for a specified value of s, the hopscotch method follows. (4.6.19)
-/r Wo «) +
M r + 1
=
2
r
+
1
+ /}'p(6 «) . 2
W r
r
N o w write r + l instead of r in (4.6.19) and eliminate « Ξ β') equations to yield (with β
from the two
r + l
Γ+2
(4.6.20)
u
r+2
= u +
fi p[(S u) 2
r
2
+(S u) ]+2fi' *p(8 u) 2
r
+
+ 2
2
r
r
+
t
.
generated for r even as being intermediate If we regard the solutions u calculations, then for r even calculations (4.6.20) yields r + l
(4.6.21)
u
r+2
= u + p[(8 u) 2
r
r
+
2
+
(S u) ] 2
r
Parabolic Partial Differential Equations
194
and for r odd u
(4.6.22)
=u +
r + 2
2p(8 u) . 2
r
r+]
But (4.6.21) is the Crank-Nicolson approximation for 2 A and (4.6.22) is the Richardson approximation. Thus this simple-appearing method of Gordon is made u p of a series of different calculations. We return to these concepts in a later section. Saul'yev (1964) introduced a series of asymmetric approximations for the model parabolic P D E ; this was followed by interesting variations d u e to Larkin (1964), Barakat a n d Clark (1966), a n d Liu (1969). In each case the result is an approximation or a pair of approximations that are unconditionally stable and are explicit in nature. T h e basic concept here is rather straightforward. We introduce two approximating equations Ur+ 1 . 5
" ~ _
U
r%s
h
x
v\r,s
U
+ \/l
~
U
v\r,s-\/2
In other words, we use the usual forward difference for u a n d a central N o w Saul'yev replaces u \ _ with difference for u - d(u )/dy. " v l r + i . j - i / 2 o" obvious central difference approximations x
yv
an
u s e s
v
m
r
r s
] / 2
e
„
I >''<•.!+ 1 / 2
I
_
U
r . s
r+
U
+
\ ~ ^
I.J
">·!/• + I . j - 1 / 2
U
r . ,
r+ \,s£ U
I
When these relations are substituted into u — «,.,. = 0 , the end result is (we call this Saul'yev I) x
(4.6.23)
«,+ , , , ^ , . , +
Ρ Κ + Ι . , - ι - Μ
Ο r + 1 . i - 1
Γ
+
1
. , - Μ
γ
. ,
+ «,.
© Τ'+Ι.ί
Ο — ο
1 + ι
].
[Saul'yev I]
Some Extensions
195
In the same manner, Saul'yev also develops an analogous form (called Saul'yev Π) PK+ ι, 1
« , + 1 , , = « ,, +
(4.6.24)
\.s ~
-
Ι +
R
+
1,1
"r.s
Ο
'+
1,s +
+ "r.s-1]·
[Saul'yev II]
1
Οππ—<> For use later, we can also write Saul'yev II in the form (let r-*r
+ \)
(4.6.25) =
"r+2.,
"r+\.s
+
P[«r+2.,+
l~
"r+2.s
~
U
r+l.s
+
[Saul'yev II]
It is important to note that Saul'yev I will be explicit if one evaluates from the left boundary ( ^ = 0) and moves to the right. In this case, only the single value u will be unknown. The same explicit nature holds for Saul'yev II if the calculation proceeds from the right boundary (y = 1) to the left. T h u s r+i
s
Saul'yev I
Saul'yev II
L-R
R-L
If one selects the case ρ = 1, (4.6.23) and (4.6.24) simplify to (4.6.26)
«,+ !., = 2 [ « r + l . , - l + « , . , + • ]
o
r+ 1,i -
1
m
r+ 1,i
1
Ο
r, s + 1
(4.6.27)
«r+l.i =
i[«r+l.i+l
Ο
| r + 1,J
Ο
r, s -
1
Ο
r+ Ι , ί + 1
Parabolic Partial Differential Equations
196
Larkin (1964) outlined the options that were open to using these Saul'yev approximations. Among these options are: 1.
Use (4.6.23) only and proceed line by line (in the χ direction) but always from left to right on a line.
2.
Use (4.6.24) only but reverse the direction in (1).
3.
Use (4.6.23) for one line (left to right) and follow with (4.6.25) for the next line (right to left). Here one alternates from line to line using first Saul'yev I and then Saul'yev II.
4.
Use both (4.6.23) (left to right) and (4.6.24) (right to left) on the same line and then average the results for the final answer. This is equivalent to defining the dummy variables P and q such that r
(4.6.28a)
P
(4.6.28b)
q
(4.6.29)
u .,=
= u
r+Us
r+]
s
= u
r s
r s
+p [ P + p[q
' -'
+
P +i
r+l
r+
q
l
'
s
r
s
+ u
+
r
P
+
r
s
u , + H
-
+
, - q,
r
- u
r+
s
r s
f J +
, ]
+ u _, ] r
s
'
This averaging approach has merit because of truncation error cancellations. Barakat and Clark (1966) suggested retaining P step to yield (4.6.30a)
Λ
(4.6.30b)
i
+ 1
r +
.
,,
Ρ [
Γ
s
and q
r
s
from the previous
Ι
= Λ«
i
= t7r. + P [ 9 r + i . + i - ^ + i , . - 9 , . . + ^ , 1 - 1 ]
+
/
,
+
ι . , - | - ^
r
J
+
ι . - Λ . , + ^., ί
+
ι1
J
[Barakat-Clark] with r+\.s
U
_ ^f+l.i
Qr+l,s
2
Liu (1969) suggested using a higher-order approximation for u \ ^ resulting finite difference approximations become
y r
v\r,s-\/i-
u
(4.6.31)
s
+
l
/
2
or
e
(3p + 2 K
+ l i J
= (2-4p)M -
M f + 1 > J
R > J
+ pK. _ +3M
_ +4« 2
I
r + 1
1
,_,]
R - J +
, [Liu I]
Some Extensions
Γ+1.Ϊ-2
f r+ Ι , ι
r+1.J-1
Ο
ο
Γ, ι - 1
(4.6.32)
(3p+2)
U r + l
197
, =(2-4p) J
M f J
ο
r,J+ 1
+ p[« , r
J + l
+3
U r
, _ i
l
[Liu II]
Ο — ο
Ο Tr+1,i
r+1,j+1
Ο — ο
r+1,s +2
r, ί + 1
Equations (4.6.31) and (4.6.32) are completely analogous to the Saul'yev forms except that one must obtain the first point on any line (either from the left or the right) by some other means. Obviously, the two schemes can be used in any combination, as was indicated for the Saul'yev approximations. We have already stated that each of the individual approximations and combinations of them were unconditionally stable. We now wish to demonstrate this stability using Saul'yev I, (4.6.23), as an example. Either the matrix or the von N e u m a n n approach can be used. Let us write the approximating equations in the form [Λ1Ο{«},
+
,=[Λ]|{«}Γ
{«},+.=Μ1ο"'μ]ι{«}, and cast (4.6.23) into the proper form; the result is l+p -p [A)c =
0
1-p
0 l+ p -p
(1 + P )
ρ 1-p
0 ρ 1-p
0
ρ
Parabolic Partial Differential Equations
198
Both [A\ and [Λ], are bidiagonal. We would now need to invert [A] and then find the spectral radius of [ Λ ] ο ' Μ ] ; this can be done but it is considerable work. Instead, we use the von N e u m a n n separation-of-variables approach (i.e., u = t e' ). When this relationship is substituted into (4.6.23) and common factors canceled, there results 0
Q
(
r
r
fisk
s
or
+1
- i
= Γ + ρ[Γ
(4.6.33)
+
ξ =
i ;£
r +r 1
r +
Ve* ]
' - Γ +
k
_ ll+- pp -+p pe-'"* e " ,fik
The numerator of (4.6.33), call it N, and the denominator, D, are both complex with identical imaginary parts. Thus the amplification factor ξ will be bounded b y | i | < l if [Re(Z>)] -[Re(JV)] >0. 2
2
Expanding Ν and D reveals that [Re(£>)] - [ R e ( / V ) ] = 4 p ( l - c o s 0 f c ) , 2
2
which is always >0 independent of ρ, ρ > 0 . Thus the Saul'yev I approximation is unconditionally stable. For the Liu I, as another illustration, (p/2-4) + e~'^+3e'^ (p/2 + 3) + e -
2 , p k
-4e
l p k
and the same reasoning proves stability once again. Next we turn to a brief analysis of the truncation errors of these various approximations. Using Taylor series expansions on the model parabolic P D E and the specific approximations, Wyman (1971) [see also Birtwistle (1968)] has shown that h
k TJ" ^
h
2
(4.6.34a)
Saul'yev I :
Truncation e r r o r = ^ « 3
(4.6.34b)
Saul'yev II:
Truncation e r r o r = — — u
— V
h
4
72
k h — ^«4,, -—M ,. 2
3v
2
-
2
6 I
Thus either formula used alone is 0(k + Λ + h/k) or 0 ( 2 , 2 , 1 / 1 ) . Because h/kpk, if the formula is to be used such that ρ is constant and the formula 2
2
Some Extensions
199
is consistent with the model parabolic P D E , the truncation error is like 0(k + A ) or 0 ( 1 , 2 ) . When, however, the methods are averaged or used in an alternate direction scheme, the difference in the signs in the leading terms in (4.6.34) tend to cancel. In this case, it turns out that the truncation error is 0(k + A + ( A / k ) ) or 0 ( 2 , 2 , ( 1 / 1 ) ) . Much the same behavior seems to apply to the variants on Saul'yev's approximations and to the Liu approach. 2
2
2
2
2
4.6.5
Variable Coefficients
Many physical problems are described by parabolic PDEs with variable (functions of x, y,...) coefficients. In particular, the P D E
represents (on the right side) a cylindrical coordinate problem while
u
x
, 2 = vy
+
u
-
y
u
represents a spherical coordinate problem. Thus we shall now analyze a general model parabolic P D E of the form u =u
(4.6.35)
x
yy
+ ^u . y
N o t e that when α = 0 (4.6.35) reduces to the rectangular model P D E and when a — 1,2 we have the cylindrical and spherical cases, respectively. Generally, the physical problem is such that symmetry occurs at y=0 a n d o n e of the boundary conditions is M . = 0 at y —0. This implies that we need t o consider 0«>-
(4
6
3 6
"r+l.,-«r,M
)
U =
r,s+\-2"r.s
+
"r,s-l
k
A
2
+ 1 Λ
2k
Note that the only complexity here is that u has been represented at r, s and thus a/y-a/y ; we must keep track of y as the calculation proceeds (i.e., we might use = ks). Because an explicit representation has been used for u , it would seem probable that (4.6.36) is conditionally stable. In fact, it turns out that the stability constraint is 0
s
s
vv
200
Parabolic Partial Differential Equations
not changed from the simpler case. It is also possible to estimate the truncation error associated with (4.6.36), namely (via the usual Taylor series) for a =2. h Truncation e r r o r = — u 2
- hk y 2
xx
I 1 1 — w , + j^u
\ J·
iy
4>
Thus the method is 0(A + k ) or «9(1,2). Obviously, we could also replace u with any of the implicit approximations presented (e.g., the Crank-Nicolson scheme). We shall not write this form down since it is rather obvious. Of interest, however, is the fact that the result is unconditionally stable and that the truncation error is 0 ( 2 , 2 ) . There is one problem, however, associated with (4.6.35) and thus with (4.6.36). If the point ν = 0 is involved, then, because of symmetry, the term (a/y)u is indeterminate. However, we can circumvent this problem if we use 2
vy
y
(4.6.37)
lim u
v-0
= lim [u
Η—u
y
yy
y —0
y
+
vv
= (1 + β)ιι_
au ] vv
at
νν
>>=0.
Writing (4.6.36) at ( r , 0 ) (s = 0 corresponds to y = 0 ) , we obtain " Γ + 1 . 0 - " Γ . Ο _ / .
A
.
u
v»,.i-2«,,o + «,.-i a
} k
2
But the fact that 1 ^ = 0 a t ^ = 0 implies that u , -u u ,-\)/2k = 0 ] , and consequently there results r
_ , [from u \ =(u
r
v r0
rA
-
r
( « Λ )
ϊ ^ ί -
2Ί1±£)
=
(
Ι
,,,-„,
Ο
)
.
T h e finite difference approximations are now (4.6.38) for s = 0 and (4.6.36) for s = 1,2,... . However, a von N e u m a n n stability analysis of (4.6.38) reveals that the equation is stable only for 0
1
2 ( l + fl)
It is apparent that this does not affect the case a = 0 since we are back to the usual classic explicit bound of ρ < ^ . For a = 1 and a =2, however, there is a definite deterioration of the stability bound; ρ < { for a = 1 and ρ < I for a = 2. Thus the overall stability is limited by the approximation at y=0. This restriction can be removed by making (4.6.38) implicit: (4.6.39)
! U ±
i
^
=
2 ^
[
U
r
+
l
l
-
U
r
+
u
o
l
Some Extensions
201
N o w the overall process is limited by the bound on (4.6.36). It is also important to note that if v = 0 is not involved (the physical problem represents a hollow cylinder or sphere), then we do not need to worry about the approximations at y = 0. In addition, if one makes the following changes in variables (these hold only when y = 0 is not involved), a — 1 (cylinder);
y — e
a -2 (sphere);
v = uy
v
there results, for the model PDE, a = \;
eu
a = 2;
v =
2v
x
x
=
u
vv
v. vy
Thus we entirely remove the a /y term from the equation. When variable coefficients occur, one follows much the same procedure as with a constant coefficient system. T o illustrate this point, let us take a number of different cases. u = au ,
(i)
x
a=constant.
vv
All the previous approximations still hold true; the only change is that p = ap replaces the earlier p. (ii)
u = a{ y)u , x
a = function of y and its derivatives exist.
vv
We rewrite this equation as (4.6.40)
^7)
=
and treat this as in the classic explicit approach. Thus
k
h
2
or (4.6.41)
«,+ ι., = ( 1 - 2 α , ρ ) Η
Γ ι Ι
+ α,ρ[« , Γ ι
+
ι
+ «,,,_,].
Equation (4.6.41) is equivalent to (4.3.9) with only the specification needed on where to evaluate a(y).
Parabolic Partial Differential Equations
202
This concept can be extended t o higher-order approximations. Consider, for example, U
r
+
l
s
~
U
r
h
-
U
i
- J ^
2
[ ( o
, + (S u) ,
+
2
u )
2
+ l s
r
1 (8 u)
r s
2
, -(8 u) . 2h
(S u) ^ ] 2
r
s
2
r
+
l
12
s
r
U s
which led to (4.6.10), which is 6>(2,4). The first term on the left can be seen to come from a central difference approximation for u \ and the last term on the right can be equivalently written as x
r
s
1 e [ " , 4 - t . , - " , - i , J _, " I , r
I
2
2h
12
Thus, if we now use [1 /a(y)\u r+\,s
U
x
1
r-\,s
2a.h
]
ι"**'·>ι·
in place of u , we obtain
x
U
2
12
•[(8 u) 2
3k
+ (8 u) ,
+
2
r
+ L
s
r s
(8 u) . ] 2
r Us
1 24Λ (iii) This is equivalent t o u = a{y)u K
Vf
+
ua y
v
or U
r , s + \ -
2
U
r . s +
U
Tk
r,s-i
·
This can b e written "r+l.i
=
0 -2e +
P ) « , . , + <>A r.,+ U
f
Λ
K,,+
1
| - « r . , - l J
+
«r.i-|]
203
Some Extensions
and is 0 ( 1 , 2 ) . u =a(x,y)u .
(iv)
x
rv
T o treat this case, we note that du
d
4
=
2
I
dy*
u
x
dy \a{x,y) 2
or
v + 1/2.
d »r+\/2,s 4
J
+ ·•
AA
2
3 /
and & r+\/l.s U
dy
k
_ 1 β [«,+ Ι . , + «Γ.,1
2
2
8
V+l/2. dy
12
2
4
+
Both of these equations can be verified using Taylor series expansions. Combination of the forms above yields 1 P°r
+
1/2,
•[«r+l.i
-
M
r.*]=T*
2
1
16
P«r+l/2.
S
1
1 + 6
P
f l
r+l/2,j
and is 0 ( 2 , 4 ) . This is the counterpart to (4.3.24). 4.6.6
Nonlinear Parabolic P D E
Finally, we wish to consider some features associated with the approximation of nonlinear or quasilinear parabolic P D E . All that one can d o here is present a few indicative results of previous workers and then suggest that one must learn by experience. It is difficult, if not impossible, to generate results on stability, convergence, and consistency for nonlinear P D E approximations; the best that one can usually do is obtain results on a local basis in which certain terms are averaged or even held constant. If a stability bound for such a local system is developed, it is necessary to use a safety factor when actually carrying out a calculation.
204
Parabolic Partial Differential Equations
In slightly more specific terms, one can visualize the following steps in the analysis of a nonlinear finite difference approximation: 1.
Linearize the nonlinear equation by considering the solution as the sum of a small perturbation and the local solution. When this is substituted into the difference approximation and only first-order terms retained, the result is an approximation with coefficients as functions of χ and y.
2.
Although the coefficients will actually be varying at the various mesh points, one can assume that they are locally constant. N o w the finite difference approximations are linear but vary from region to region or mesh point to mesh point.
3.
At least in the vicinity of any mesh point a stability (or any other) analysis can be carried out.
4.
The most restrictive of all the local stability bounds is taken as holding for the entire problem. This bound should be treated with a certain degree of caution.
As an example of how such approaches may be used, consider the model parabolic P D E as
«, = ( « " ) ^ = (»«""'^) .· ί
A suitable finite difference approximation might be r+ I , J
(4.6.42)
"r,s+
V.j _
1
•2u1
+ u"
r,s-
But if we think of nu" = a constant in a local sense, then we might estimate stability for (4.6.42) from 1
«« ρ<ί· π_1
(4.6.43)
This follows directly from the stability constraints developed for u — au , where a — constant. Obviously, (4.6.43) is not a constant but is a function of the solution itself (the value of «). Such a stability estimate can b e used to monitor a calculation as it proceeds. Next, let us consider x
u = (u )
(4.6.44)
=
5
x
yy
{5u*u )
y y
as another illustrative case. An implicit approximation might be (4.6.45)
U
^<°
h
"'>'
=A
e
2
( M
3
) r
+i i f +
i!_^l
eV)rif
.
yy
Some Extensions
205
As a linearization, we might use (« )
(4.6.46)
s
i.,-(« ),,, = 5(ii ) . [« 5
r +
-«,.,]
4
r
f
r + 1 > f
or
S^Uu.-SHu'l^Siu^BHuU^-SHu^J.
(4.6.47)
In the case of (4.6.45), the result would be (expanding all the δ (4.6.48)
(u -u )-5e [(u*) _ r+ls
rs
P
r
s
(u
+
i
2
terms)
-u )
r+Us+i
rs+i
- 2 ( « ) ( M ι . , - ι Ο + ίι» ),,, -ι(«,+ ι .,-I-M, .,-•)] 4
4
R-J
R+
= (l-e)p[(« ) . s
which is linear in ( « (4.6.49)
(w
r + l i f
-u _
-2(« ),, + (« ), _ ], s
r
J +
1
s
1
- u, J. Using (4.6.47), the result is
r + L i
)-5t?p(« )r.,[(«, 4
r i J
1
+
2 ( « , + ι., - « , , , ) + («,+
= 5ρ(Η ),.,Κ 4
ί + 1
I
.
i +
|-«,.,
+
i)
! . , - 1 1 ) ]
- 2 ι / . , + u,,,_,]. Γ
This equation is identical to that which would result if 5 u in (4.6.47) is treated as O(M)= a - constant. Now a stability analysis on (4.6.48) reveals that 4
l-(l-fl)S
\ + es
<1,
where S = 5( u* ) [2 rsP
-(c
+ d )οο$βΙ( -i(c-d
whereas on (4.6.49), 2(1-20)' which is identical to the constant a bound.
)sin βΐι]
206
Parabolic Partial Differential Equations
In this way estimates can be obtained for the stability of the finite difference approximations. These must, of course, be treated with considerable caution since they were obtained by local linearization. However, experience tends t o indicate that the results are quite satisfactory. Let us now expand o u r model nonlinear P D E a n d consider a number of possible finite difference approximations. Obviously, the P D E can be written in many forms, one of which is
f{: : ° )
(4.6.50)
) 0
The question we raise is how t o handle this P D E so that n o stability questions arise. We could use an implicit form such as the Crank-Nicolson, b u t this leads t o an onerous algebraic problem to solve after the finite differencing. Instead, we turn to a three (r)-level scheme. Thus we form /5(«r.J[«r+l. -«r-l.J=2p[a(« , I
r
J +
,
/ 2
)(w , r
i + |
-M , ) r
1
~ (»r.,-\/l)(»r.s~ r.,-\)\a
U
The left-hand side is a central difference approximation with β(υ) evaluated at the center, and the right-hand side is a central difference for d/dy with a(u)u evaluated at the two points of interest. If we now replace u , , u and u _, by
y
r s +
M
l [ r + l , s + I + r.s+
r.i+ 1
=
« , . s = H"r+l.* + " , . . «,..-l iI =
, <
1+
U
M
+
, <
U
r-
r s
r
s
|]
r-l.s]
r+l.*-|+W,.5-l «r-|. -|] +
i
and let «(«,.,+1/2)-«[——2
(»r,s-\/2)- [
a
J
2
a
then the final finite difference approximation is achieved: (4.6.51)
/3(M , )[M r
J
r + 1
, -M _|, ] = |p[o {(M J
r
J
l
+
(»r.
r + l
+
+
1
l «,.i) _
i
i
- u
+
r
+
1
)
(«r-l,,+ | - « r - l . . ) }
-<*l{(Ur+\,s- r+\,s~\) U
+
s
(*r-l.,-«r-|.,-l)}.
+
( r. -U , -l) U
s
r
S
Some Extensions
207
which is stable and convergent (see Lees, 1966). Further, the unknowns at r + 1 are now linear. Now, let us consider a more general form of the nonlinear P D E , namely u =
(4.6.52)
<j>(x,y,u,u ,u ).
x
v
rv
We can approximate (4.6.52) by r+\.s
r,s
U
(4.6.53)
. I
U
h
^ ~ * \
r
.
.
<
h
s
k
U
r,s+\
U
> » , s , •
2
2k r,s +
u
r.s-\
"r,s-\
Equation (4.6.53) is the exact finite difference expression of (4.6.52). Now, if we replace u by u + e and e is the error that comes from roundoff error or linearization, then (4.6.53) can be written rs
(4.6.54)
r s
( r+\,s U
+
£
r
r s
r
\ . s ) - ( " r . s
+
s
+
£
r.s)
( r.s+l
+
U
£
r,s+i)-(»r.s-\
*r.s-\)
+
2k
k
2
Rewriting (4.6.54), we have (4.6.55)
U
r+\.s- r.s+( r U
e
= Φ x,y,u r.,
+
l
. -e _ ) s
r
s
r,s+\
+ e ,
rs
U
+
U
r s
l-2«r., +
u
r.,-l
U
2k
r,s~\
g
e
r.s-i
2k r,,+
,
_|_ r,s+\
e
1~
2
*r,,
+
Because 2k
£
and
r,l-H
2e
r,s~^~
E
r.s-\
are very small in comparison to 2k
and
U
r , s + l ~
2
u r
. s
+
U
r, s
I
208
Parabolic Partial Differential Equations
respectively, Taylor series expansion of
right-hand
+ Η
Η
= Φ
2k 3φ du _3φ
c
f.i+l
g
r,j-l
θψ 3u
,
2*
3«„ where — r,s+l U
U
r,s-\
and
2k
a = 3
A
2
Subtraction of (4.6.53) from (4.6.56) yields 1
-
f l
0 r . , + fl| C
+ a
2k
r,s+l
~
£
2
e
r , s +
£
r , j -I
where _3φ du
_ 3φ
. and
~3«..
_ 3φ a =-— du yy 21
This equation may now be rearranged to yield k
+ l - 2 p (laα - γ « ) 2
+ ρ(α -|α,)ε 2
Γ
0
,
If a «£0 and a > 0 , then the bounded solution (stability) of (4.6.53) is guaranteed. This implies that 0
2
(4.6.57a)
k<
(4.6.57b)
P<
2α
Ί
2a — 2
ka 2
0
Some Extensions
209
As an indication of the use of these bounds, consider » χ = ^
[«(«)«>•]
with a(u) = 1 - bu; then u =(\-bu)u -b(u ) . 2
x
vy
v
Replacing terms with the same finite differences as above, we find that " r + l . , = "r.s
+ p[0
-
*«,.,)( «r.i+ I ~
2
» r . s +
"r.s-\)
-i*(«,.,+ i-«,.,-i) ]2
Thus from (4.6.57) we have directly l-bu
(4.6.58a)
p<
(4.6.58b)
2(l-/J )+6/c u 2
M
v v
which serve as bounds on A: and h and can be used to generate a locally stable computation. We have previously commented on the use of predictor-corrector methods for solving the model parabolic P D E . Douglas and Jones (1963) applied this approach to nonlinear P D E . Thus, for the general quasilinear parabolic P D E "yy
=
>
V
U
y'
U
x)
with 3 ψ | θ « > 0 , a Crank-Nicolson approximation might be χ
^ [(δ «),, 2
Ι
1
+(δ
2 Μ
)
Γ +
1
,,] = ψ{(Γ + 1 / 2 ) Λ , ^ , Κ « , r,i+l
M
2k »r+\.s-
U
r,i-|
ί
+ ^ ,. )< +
ί
_j_ r + l . j + l M
M
r+I,j-I
2k
r,s
Stability and convergence can be proven for this approximation, but it involves a nasty set of nonlinear equations at the r + 1 level. However, linear equations
210
Parabolic Partial Differential Equations
can be obtained by the following predictor-corrector set: (4.6.59)
P-
(4.6.60)
c:
= ψ ( ( Γ + l/2)h,sk,
j- (S u) . 2
2
r+l/2 s
«,.„ ^ μ ( 5 « ) . Γ
' " r + l/2,l>
r +
I, j
where i>-(u ) = {[u + + u _ ]. Equation (4.6.60) is a backwards equation using the values at r + { which are predicted from (4.6.59). This scheme is convergent and is 0(2,2). Finally, we wish to consider Burger's equation rs
r
s
{/2
r
(4.6.61)
s
l/2
u + uu =au
,
x
which serves as a description of turbulence in a one-dimensional system. It is readily seen that this is quasilinear because of the uu term. But suppose that locally we assume that u — c = constant in this term; then we have v
u + cu x
v
=
ClU i t
'
which combines a hyperbolic component (the left side) and a parabolic component (the right side). If we replace u with a forward difference, u . with a backward difference, and the usual explicit central difference for u , a von Neumann analysis leads to the stability bound x
v
rv
N o t e that if each term in brackets were about equal, this indicates a stable h about one-half that for the model parabolic P D E . This infers that for (4.6.61) a safety factor of j should be used over that predicted by the simple model PDE. For the full equation (4.6.61), Cheng (1969) has presented two stable difference equations. With β — h/k and ρ = ha/k , the first approximation is a combination D u F o r t - F r a n k e l (parabolic part) and leapfrog (hyperbolic part): 2
Ur + Ι,ί
"r-Ι,ί ~ 5 . ψ "r.i+I ) +
2
2
- ( "r.i-I
p["r.i+l + "r.i-|-("r+l.i
+
A «,
Some Extensions
211
The second approximation is a two-step or predictor-corrector set. First the intermediate values u are calculated from r
s
"r.j = " r . j 4 , 9 [ ( « .
,) -(«,.,-,) ] 2
-
r
+ p["r. and then final values at u
"r
r + l
I. j =
+
s
"r.J
J +
J +
|-2tv.
2
+ «,.,-,]
J
are calculated from
-
\β[(ΰ ,,
+|)
Γ
+ p[",..,
+
|-2«
r
+
i,
2
I
-
( " r . J -
I ) ] 2
+ « .,_,]. r
Both schemes are second-order accurate and have a local stability bound /2 < l independent of a. As such they compare very favorably with any other method. 4.6.7
The Box Method
Keller (1971) outlined an interesting method, termed the box method because of the way in which the finite differencing is carried out. It has many attractive features, including simplicity and ease of programming, unconditional stability, second-order accuracy, and the ability to use extrapolation as Λ—0 to improve the solution with minimal effort. Moreover, it applies in a simple fashion to nonlinear as well as linear parabolic PDE. The model parabolic system can be written as
u = ~- [a{y)u ]
(4.6.62)
x
y
y
+ c(y)u
+ S(x,
y)
with initial and boundary conditions x=0,
(4.6.63a)
«(0,v)=/(v),
(4.6.63b)
a u(x,0)+a u ,{x O)=a (x).
(4.6.63c)
i8 ii(jc,l) + j 8 M , ( x , I ) = i8 (jc),
0
)
0
t
t
2
l
2
0<>>
χ >0
y = \,
x>0.
However, to use the box method, we must convert (4.6.62) to a set of
212
Parabolic Partial Differential Equations
x r+4
« x
ι
— •I—-
r-2" f — f -
4 R
R4 *S-t
*SH/Z
2
*S
Figure 4.4. method.
y
Mesh rectangle
for
box
first-order PDE. Thus the model equations become a{y)u
(4.6.64a)
—v
v
v = u -c(y)u-S(x,
(4.6.64b)
y
y)
x
u(0,y)
= f(y),
x=0,
0
α Μ(χ,0) + α,υ(χ,0) = ο ( χ ) ,
y=0,
x>0
ft«(x,l)
y = l,
x>0.
2
0
+ /8,»(x,l) = i8 U), 2
Now consider the mesh rectangle shown in Figure 4.4. Assume that (4.6.65a)
x =0,
Λ , = x,_, + A ,
r=
\,2,...,N
(4.6.65b)
y =0,
y = y-
s=
\,2,...,M,
0
0
r
s
+ k,
s t
s
where h and are completely arbitrary and can change over the full grid. W e define the mesh coordinates and the values u and v at the mesh points by r
r
(4.6.66a) (4.6.66b)
X
r - ) / 2 ~
2 [ r~l~ l
x
Λ-1/2 = 2[Λ +
X
s
r - \ ]
Λ-|]
(4.6.67a) (4.6.67b)
Φγ= 1/2.1
where φ represents either u or v.
= 2
[Φ,-.ι + Φ , - ~ . . ι ] '
r
s
Solution of Finite Difference Approximations
213
The difference equations that are to approximate (4.6.64) can be obtained by using central differences. Thus for terms such as v.. — u
κ„ = v.
or
we would use (4.6.68a)
.
(4.6.68b)
" - ' = « „ , - ,
,
, j f c i
/
2 .
- "'=«V,,-,/2f
N o t e that we average about the midpoint (x , y _ ) of the segment P\P - On this basis we replace (4.6.64) with the finite difference approximation r
_
(4.6.69a)
(4.6.69b)
flf
C
-t>,,_
l/2
r.«~ r. -l P
f
_
r.i-l/2~
M
C
(4.6.69c) (4.6.69d)
(4-6.69e)
M
l / 2
s
.
r-l.»-l/2
j-l/2 /~l/2.j-l/2 M
«,.o =
2
l / 2
^r-l/2.. -|/2 t
/U)
«0 r.O + » l r . O ( « 2 ) r . O U
u
=
rVr.A, + M . « =
On the basis of the finite difference approximations, Keller shows that a set of linear or nonlinear algebraic equations result. In the nonlinear case, Newton's method proves very effective; in the linear case, a block tridiagonal system is generated which can be solved efficiently via the method detailed in the next section. Further, using what seems to be very crude mesh widths in a Richardson extrapolation, a solution can be obtained (as h and k become small) with sufficient accuracy for most practical purposes.
4.7
SOLUTION OF FINITE DIFFERENCE APPROXIMATIONS
To this point we have concentrated on the development of various explicit and implicit finite difference approximations for the model parabolic PDE. In general terms, this has indicated that: 1.
Implicit methods generally have better stability properties than d o explicit methods. Using the classic explicit approximation, (4.3.9), as an
214
Parabolic Partial Differential Equations
illustration, there is a bound of ρ \; by contrast the stability bound for the Crank-Nicolson approximation, (4.3.18), and other implicit methods is p < o o . 2.
Implicit methods generally have higher accuracy. For the same two approximations in (1) the local truncation errors are 0 ( 1 , 2 ) and 0 ( 2 , 2 ) respectively. If one chooses the implicit weighting factor θ correctly, even higher accuracy can be achieved.
3.
Explicit methods seem to be easier to solve than implicit methods in terms of time and effort spent on a computer. This follows because, in the classic explicit method, only one unknown is involved in the use of the finite difference approximation; that is, given all the d a t a on the r line new values at the r +1 line can be calculated point by point. By contrast, in the Crank-Nicolson method, three unknown values are contained at r + 1 ; thus it is necessary to treat the system of difference approximations at all the interior mesh points on the r + 1 line simultaneously. This would seem to impose a significant lower bound on the computing time necessary to solve the implicit approximation as compared to the explicit approximation. This, of course, assumes that 0 < y < l ; if either boundary is ( ± o o ) , the number of simultaneous equations is infinite and special approaches (but not implicit) may be necessary.
Thus we have positive and negative features associated with solving either type of approximation. However, there is an efficient way to solve the implicit approximations which may tip the balance in their favor. 4.7.1
Solution of Implicit Approximations
If we select any implicit finite difference approximation and move all terms at the r + 1 level to the left side of the equality and all other terms to the right side, there results [ - a , u _ + b u, -c,u
(4.7.1)
s
l
s
1+
t
]
r
+
{
=
[,],,,_,,
where a b , and c are coefficients which depend on the particular finite difference approximation, and d contains all the terms not at the r + 1 level. For ease in handling, we drop the subscripts r + 1 , r, and r — 1 because we shall not need them further. As an illustration, if we pick the backward implicit approximation, (4.3.17), then )t
s
s
s
a = P= c
(4.7.2a) (4.7.2b) (4.7.2c)
s
ft
s
s
= l+2p d =u
.
Solution of Finite Difference Approximations
215
For the Crank-Nicolson and weighted implicit approximations, (4.3.18) and (4.3.20), we find, respectively, a
P ~
s ~
C
s
b = 2(p + \) s
and e , = P* = c,
b = \+2pe s
d ^p(\-e)[u , s
+ u ^]
r5+
[\-2p(\-e)]u .
+
rs
rs
Because s = 1,2,...,« — 1 for all interior points on the r + l line and if u(y=0)— «(0) and H ( y = 1 ) = w(l) (other boundary values modify what we are doing but d o not change the basic details), we may write (4.7.1) in matrix form, = {d},
[T){u}
(4.7.3) where
"«Μ
b
2
a.
-
(4.7.4)
[T] =
- α — ι
= tridiagonal { - a , b - c }; s
s
s
+ a (0)
«1 M
{«} =
2
| M
;
{«0 = _4,-I+*.,-i«0)
Thus to solve for all the unknowns {«} on the r + 1 line, we need to solve a set of simultaneous linear algebraic equations whose coefficient matrix is tridiagonal. If we can d o this in an efficient manner, we can start with the initial
216
Parabolic Partial Differential Equations
conditions and move up line by line; if a three-level formula is involved, we need a different procedure for r — 1, but r > 1 follows in the same manner. Fortunately, a very efficient and simple algorithm exists which can solve the tridiagonal system (4.7.3). It is basically a variation on Gaussian elimination and is frequently referred to as the Thomas algorithm. In contrast to the usual elimination method, it has excellent round-off characteristics. Moreover, the scheme requires the evaluation of two recursion relationships and not a matrix inverse. The basic idea is to factor [T] into two new matrices [T ] and [Τ ], which are both bidiagonal, {T}=[T ][T ], One then finds a solution for vector {/} ^ L
l
(4.7.5)
ν
u
lT ]{f}
= {d)
L
and uses this {/} to give a final solution [T ){u)
(4.7.6)
u
=
{f).
Obviously, { / } = | T J - ' < < / } , [T ]{u)=[T ]- {d), = {d). To illustrate the algorithm we write [T] as
and
l
v
L
thus
fjTJMO}
0
[7·] = *n-2
"n-2
0 where we have dropped the minus signs in (4.7.4) (this does not change the procedure but merely makes the algorithm more general). N o w we factor IT) as 0 α-,
α,
0
1
βι
i
β
2
[Τ) = [η][Τ„] = 0
α.
1
β„-2
1 where α, and β, are to be determined. By equating the left- and right-hand sides of this equation, we find directly the recursive relations (4.7.7a) (4.7.7b)
a, = b,
Solution of Finite Difference Approximations
(4.7.7c)
a, = i > , - a , p V , ,
(4.7.7d)
A= ~.
i=
f=2
217
«—1 α,ΦΟ.
2
From (4.7.7) we obtain the a, and β, from the known α , 6,, and c,. Now we may solve (
[T ]{f)
= {d},
L
where the elements of {/} are given by (4.7.8a)
/, = £• «ι
(4.7.8b)
/ =
a
' ~ ^ ' -
1
,
,=2
«-l
and in turn use [ ^ { κ } = {/) in the form (4.7.9a) (4.7.9b)
«„-, = /„-, u, = / , - f t « ,
+ I
,
ί = η-2,ιι-3
1.
Thus once (4.7.7) is used to develop [ F J and [T ], the two recurrence relations (4.7.8) and (4.7.9) can be used to find the unknowns u , ί = 1,2,..., η - 1. Of interest a n d importance is the requirement that det [T] not equal zero. This will be the case when conditions such as v
s
(4.7.10a)
|M>|c,|>0
(4.7.10b)
| A , H a , | + |c,|,
(4.7.10c)
|Α _,|>|α_,|>0
i=2,3
n~2;
a,c,*Q
η
hold; moreover, round-off errors are minimized when (4.7.11)
\β,\<\.
The restrictions on α , ^ Ο and a,c, Φ0 are not harmful in any way but may require a renumbering of the variables. Of major importance in the use of this algorithm is that only 5 5 — 9 [where [T] is ( S — 1 ) X ( 5 — 1)] multiplications and divisions are required to solve the sets of (4.7.7)-(4.7.9). This compares with 5 multiplications and divisions to solve an explicit approximation; such a comparison is crude at best b u t seems to be roughly verified by numerical experiments. Thus to solve for one line of
218
Parabolic Partial Differential Equations
the unknowns u via an implicit procedure is approximately five times as time consuming as an explicit procedure. If a standard Gaussian elimination procedure were used, the number of multiplications and divisions would be roughly ( 5 — l ) , and even an iteration procedure requires roughly (S— l ) operations. Thus the present algorithm is extraordinarily efficient. If we pick one of the various implicit methods under discussion, say the backwards implicit, then from (4.7.2) one finds that J + 1
3
2
|l+2p|>|p|>0 | l + 2 p | > | p | + |p| since p > 0 . Further, a simple analysis shows that | / 5 , | < 1 always. Thus the conditions (4.7.10) and (4.7.11) are satisfied and an accurate solution is assured for all positive values of p. 4.7.2
Explicit versus Implicit Approximations
From the above we see that there does exist an excellent algorithm for solving the implicit finite difference approximation in approximately five times the computing effort per r + 1 line required by the explicit approximation. However, the explicit approximation has a stability constraint on the choice of ρ (or given equal-sized Ar's, on the value of h that can be used). If p > 3 in the implicit form, the computational effort between the two methods becomes equal. If we further assume that h varies as k, as k tends toward zero to achieve convergence, the computational work involved increases roughly with l/k using the C r a n k - N i c o l s o n method and l/k with the classic explicit method. On this basis, one would prefer to use the implicit method rather than the explicit. It is worth pointing out that the restriction on ρ associated with the classic explicit method is a most serious one, especially in higher space dimension problems. If three space dimensions are involved, it turns out that the stability bound becomes 2
3
'* 2*3=1
0<
and if we select k = -m, the maximum h that can be used is approximately h =0.00001. If we wish to calculate to χ = 1, it will take 10 steps to reach this point. By contrast, the implicit approximation can take much larger steps, sufficiently large so as to make the implicit more favorable in terms of computing time. However, one must be careful. When large steps in Λ are used, the accuracy of the solution may suffer. Thus when comparing the classic explicit and the backwards implicit methods, a large step in the latter would mean 0(h)» 0(k ); the computing time is shorter but the accuracy is much less. In fact, 5
2
219
Composite Solutions
one can run some simple calculations to show that if an accuracy of say 1 0 ~ or 1 0 must be achieved, then the computing times by the two approaches are comparable. T h e Crank-Nicolson behaves much better than the backwards implicit because its local truncation error is second order in h. The conflict between accuracy and efficiency is the reason many people favor the D u F o r t - F r a n k e l type approximation. It is stable for all ρ and is second order in h. However, even here there are defects; it converges under a more limited set of mesh refinements than d o the other approximations and it is a three-level (in r ) formula. The latter point is not serious but the former can cause serious computational difficulties. Nevertheless, this approximation usually works well in practice. 2
- 3
Although this discussion does not really demonstrate that one approach is better than the other (we have also neglected such items as programming difficulty), most workers seem to prefer implicit methods. When considered for higher-dimensional problems with special alternative approaches available, this feeling is further strengthened. However, we point out that methods which combine an explicit and implicit type of calculation may be the most attractive in terms of computational effort.
4.8
COMPOSITE SOLUTIONS
Consideration is given here to the feasibility of composite methods for solving linear and nonlinear PDE. Composite techniques are defined as methods wherein numerical solutions are obtained through the combination of preexisting numerical solutions. Thus the general form of a composite might be u (P)=F[ (P),u (P),...,u„(P)],
(4.8.1)
(
U]
2
where u {P) is the composite solution at a particular mesh point Ρ (Ρ is used here to denote r,s for simplicity), «,(/°), u (P),...,u (P) are different approximations at the mesh P, and F( ·) is a functional relation. The combination can be applied in a global or local manner depending on the use of the composite. A global composite is one in which the composite solution is not utilized in any continued calculations; thus global composites evolve from solutions obtained over the entire space of independent variables. For local composites, the composite is used in the continued calculations of the different solutions. Therefore, the local procedure is a line-by-line (at some r) algorithm where the different solutions are combined on a particular line and the composite becomes the initial value for the continued calculations of the different solutions. Embedded in the terminology of composite solutions are a variety of methods, such as extrapolation (deferred approach to a limit), alternating direction, and acceleration techniques. Here we present only a limited analysis based on the work of Burgess and Lapidus (1973), but the reader will recognize c
2
n
220
Parabolic Partial Differential Equations
the other areas as they arise. O u r concentration will be on parabolic P D E (see also Keller, 1971), but such authors as Hofmann (1967), Gourlay and Morris (1968), and Werner (1968) have applied some of the techniques to elliptic and hyperbolic PDE. In a global sense, we deal with extrapolation in which the solution over the space of independent variables is calculated and combined with solutions for successively smaller mesh spacings, characterized by k . In a local sense, we deal with linear combinations of different solutions (i.e., a predictor-corrector scheme) to extend the region of stability. Many of the ideas presented here go back to Richardson and Romberg (see Lapidus and Seinfeld, 1971, Chap. 2) and have been used extensively in numerical quadrature and the numerical solution of O D E . The interested reader may wish to consult such papers as Pereyra (1967), Lindberg (1972), and Strom (1973), and the review by Joyce (1971) for further details in these other areas. We should also point out that the cost of computing a numerical solution grows exponentially as ft, k -»0. Thus it is the objective of extrapolation either to reduce the error for a given computational effort or t o reduce the cost of computation at a preset error level. This is achieved not by obtaining solutions for very small h and k but rather by using large h and k and calculating the result as if small mesh increments were used. m
4.8.1
Global Extrapolation
Based on previous sections of this chapter it seems feasible to assume that the truncation error of the finite difference approximation can be represented as a polynomial series, (4.8.2)
u {P k )=c 0
t
m
+ c k* + c k% +
Q
l
...,
2
where the left-hand side represents the finite difference approximation at the mesh point Ρ as a function of the spacing k \ the c,'s are unknown (perhaps) functions of the independent variables at point P, the γ, are integer powers, and the subscript 0 on u is to indicate the finite difference approximation. Obviously, c is the exact solution since, for k -»0, u -* c . Thus an objective to any calculation is to remove the terms c , / c £ , e s o that u is as close an approximation to c as possible. The methods for achieving this depend on whether the γ , , γ , . . . are known or unknown. When the γ , , γ , . . . in (4.8.2) are known, an extrapolation formula can be derived for general spacing sequences, k . In particular, two such sequences are rather obvious. The first, abbreviated SSI, is m
Q
m
0
0
Q
2
0
0
2
2
m
{k ,k /2,k /3,k /4,k /5,...}, Q
0
0
0
0
[SSI]
Composite Solutions
221
where k is the largest spacing and m 2*0. The second, SS2, is 0
* „ = φ ;
{Λ ,Α: /2,Α /4,Λ /8,Α /16,...}, 0
0
0
0
[SS2]
0
which corresponds to halving the characteristic spacing with each new solution; SS2 is obviously a subset of SSI. The objective of extrapolation (say the ith extrapolation) is to eliminate the Cj term of the series (4.8.2.) The zeroth extrapolated result is the original finite difference approximation. Thus for two grid spacings k and k , we may write (4.8.2) at the same mesh point Ρ as (for convenience we drop the P) m
u (k )
(4.8.3a)
0
(4.8.3b)
= c + c ^ + ...
m
« (fc 0
m + l
m + l
0
) = c + c,iVJ' ,+ .... 0
+
Combining the two equations to eliminate c,, we obtain the first extrapolated value M , ( / c ) , where m
(4.8.4)
« , ( k ) = C + C * 2 + C kl> m
0
+...
3
2
and
The C, in (4.8.4) are functions of c,, γ,, k , and k that m
\C,\<\c,\,
(4.8.6)
and are bounded such
m+x
«>2.
Thus we have eliminated the first term in the truncation error and also reduced the remaining terms in absolute magnitude. Consequently, u (k ) is a better approximation to the exact solution than u (k ). It is of interest to show some of these features. Thus if we substitute (4.8.3) into (4.8.5), the first extrapolated value u (k ) will have the form of (4.8.2). But the coefficients are x
Q
x
(k /k 1 m
c
°-
(k /k ) m
c
m+i
'-
„ .
m
m
) C Q ~ Cp Y I
m+
c
' \kl,+ \— Cyk^l c
φ
(k /k ) m
m+i
_
φ
_
'c k^ 2
+l
— c k% 2
U
°
m
222
Parabolic Partial Differential Equations
where
~
θ
Φ
·
For SSI and γ, = 2 , γ = 4 , it follows that 2
m=0,
r? = - ι
m = \,
6 = ~t
m
θ>-\,
while for SS2, 0 = - { for all m. Since | 0 | < 1 , (4.8.6) follows directly. From this analysis we can see that combining «<,(&,) and u (k ) yields u (k y, but also u (k ) and M (& ) yields u,(A: ), and so on. In the same sense, we can combine «,(&,) and u , ( f c ) y> 'd "2(^1)* second extrapolated value, and eliminate the c term. In diagram form this entire procedure is shown in Figure 4.5; the arrows indicate the values needed to calculate the next approximation. At any one level of extrapolation only the information on a horizontal line in Figure 4.5 need be kept in computer storage. It is important to remember that u (k ) represents a complete numerical solution of the P D E problem. Q
t
t
0
2
0
3
2
2
1 0
e
a
2
2
t
m
The following steps illustrate the computational algorithm: 1.
Calculate
2.
Perform one extrapolation, combining u {k )
3.
Replace « ( * - i )
u (k ). 0
m
0
0
m
u t Μ 0
w
'
t n
u
o( ) k
m
since u (k _ ) 0
m
and « ( / c _ | ) to yield
m
t
0
m
is n o longer required.
\ ^
\ u (k ) — 0
4
•
•
u, ( k ) — 3
·
·
u (k ) — 2
2
·
·
U (K, ) 3
·
·
a
Figure 4.5. Schematic of global extrapolation based on a known polynomial truncation error.
Composite Solutions
m — 1:
For / = 2,3 4.
Perform /th extrapolation combining u _ (k _ ) calculate u,(k _ ). l
m
5.
223
]
m
and w,_,(fc _,) to
i+l
m
l
Replace M,_ ,(*„,_,) with
,(*„_,+,).
In this way we enlarge the last horizontal line in Figure 4.5, replacing the line from left to right. If {γ,} = { 2 , 4 , 6 , . . . } and SS2 is used, the / th extrapolation formula is given by (4.8.7)
.
|
(
J
t
J
" • - - ( * » • ) - ' - ( * . ) , 4' - 1
=
That is, the weighting factors for the linear combination of « , _ , ( A : ) and i-i(*m) 4 ' / ( 4 ' —1) and — 1 / ( 4 ' - 1 ) , respectively. If the same {γ,} are used but with SSI, m+1
M
a r e
u (k
(4 8 8)
)= ^
m
~
l
+
l
^^ '-i(^m+i)~ (/c _, ,A ) -i m
+
l
/
M
i-\(k )
u
m
2
m
But note that since k
m
= k /(m
m + ]
+ l),
0
k
+
m-i±l
k
m+2
_
m + ]
m-i
+ 2'
When the γ, are unknown, there are three unknowns, c , c,, and γ,, in the first extrapolation. Thus a single extrapolation requires three spacings in k \ further, the SS2 sequence is required to be able to eliminate the c, term. This type of extrapolation, usually called Aitken extrapolation, uses u (k ), o(k +\), and «0(^^1+2) i the formula 0
m
0
u
w
m
t n
m
(4.8.9)
«,(*„)=
«,-.(*,, 2)
[ " - ( ^ » ) - » * - ( ^ . ) ]
+
2
[«i-l(*«+2)-2«/-l(*«+l)+«(-l(*«)]
where k - k / 2 . Figure 4.6 illustrates schematically this extrapolation. Obviously, this process is less efficient than the previous extrapolation method because three approximations per extrapolation are required. If one introduces the terms m
m
0
R = truncation error of Aitken extrapolation/truncation error for (4.8.2) using
k /4, m
224
Parabolic Partial Differential Equations
U0< t'
\ ^
k
X X
u
oU > — 4
U
< (K )
/
3
Figure 4.6. u
o
( l ,
Schematic of Aitken extrapola-
tion.
5'
which are the ratio of the third to the second terms in (4.8.2) and the ratio of the extrapolated truncation error to the error of the normal solution with the smallest spacing, a plot of R vs. ζ shows a maximum. For small ζ (the third truncation error term < second truncation error term), the value of R is small and extrapolation will reduce the error. This is also true for large z. However, near the maximum the extrapolation will fail to reduce the error significantly. Unfortunately, this maximum is a function of γ, and γ and thus one cannot, a priori, predict where the maximum will occur. The stability of extrapolation techniques is also of interest. It is not difficult to show that the same stability constraints that hold for the primary finite difference approximation also hold for the global extrapolation composite. Thus if we extrapolate once with the classic explicit which has an amplification factor (4.5.8), 2
i = l-4psin ^, 2
then (4.8.7) for i = 1 yields
,„.„,
{„(*)- '«*^-«*'. 4
Here £ (k) represents the amplification factor for one extrapolation, combining the finite difference solutions at k and k/2. Since A = p/c , the halving of k requires that A be divided by 4 to maintain a constant p. This procedure could be continued with the classic explicit as more extrapolations are performed or a different finite difference algorithm is employed. E]
2
4.8.2
Some Numerical Results
Here we wish to present some numerical results obtained with global extrapolation using the model parabolic P D E (4.8.11a)
«.x = «,·.·'
0
x>0
Composite Solutions
225
and augmenting conditions (4.8.11b)
M = sin2iry,
0
(4.8.11c)
H=0,
y=0,
x=0
y = \,
x>0.
Many other linear and nonlinear P D E systems have been used by Burgess and Lapidus (1973), but the present one serves to show the power of the method. T h e classic explicit finite difference approximation was first used with ρ = \ and k = 0 . 2 ; then the further solutions were obtained with ρ held constant but k decreased according to the SS2 spacing sequence. In Figure 4.7 the log|error| is plotted vs. log|/c~'| for y = 0 . 4 and χ = 0 . 1 ; at this location the exact solution of (4.8.11) is u = 1.1342X 1 0 ~ . This single point is quite representative of the results at other x, y points. For extrapolated results, the log|error| is plotted against the k corresponding to the smallest spacing used in the composite solution. As an example, four approximate solutions are required for those extrapolations; thus the three extrapolation errors are plotted vs. k / 8 , the smallest spacing. 0
2
m
0
In Figure 4.7 the number of extrapolations is a parameter. The solution of the finite difference approximation converges with kj, corresponding to the slope of the zero extrapolation curve. The one-, two-, and three-extrapolation curves have increasing slopes corresponding to a truncation error of k k%, and k , respectively. Also shown on Figure 4.7 is the use of Aitken extrapolation and, as expected, the results are similar but displaced to the right one unit since three approximations per extrapolation are required rather than two approximations. A
m>
%
m
As an example of the efficiency of this global extrapolation, the error at the k /c\ spacing with zero and three extrapolations differs by about three orders 0
226
Parabolic Partial Differential Equations
of magnitude, whereas the three-extrapolation calculation requires only 50% more computing time than the k /% finite difference solution alone. If the zero extrapolation curve is extended to this error level of 1 0 ~ , a spacing of & / 2 5 6 would be required; this would involve roughly 2 X 10 % more computing time than the k /i solution. A number of other interesting points can be quoted as well. As an illustration, the curves in Figure 4.7 d o not necessarily continue to extend straight down as k is continually decreased. Round-off error may intrude to turn the curves up. Results using the Saul'yev alternating direction method vs. the Crank-Nicolson approximation reveal that the alternating direction methods do not work as well. Thus with no extrapolation, the ratio of the error between the two methods is between 5 and 40 (the Crank-Nicolson being more accurate), while after two extrapolations the ratio is 50 to 4000. Finally, the SSI space sequencing seems superior to the SS2 sequencing. As an example, for a computing time of 10 units (a normalized factor for the particular computer used), the following errors are observed with the C r a n k Nicolson approximation and a slightly different model parabolic P D E : 0
7
0
6
0
0
3
N o extrapolation:
|error| of 1 0 ~
Aitken extrapolation:
|error| of 3 X 1 0 "
SS2 extrapolation:
|error| of 1 0 ~
SSI extrapolation:
|error| of 3 Χ Ί 0 "
4
5
7
1 1
In the same way but at an error level of 10 , the following normalized computing times are required: 8
N o extrapolation:
>10
Aitken extrapolation:
10
computing units
5
SS2 extrapolation:
3X10
SSI extrapolation:
4X10
4.8.3
computing units
8
3
2
computing units computing units
Local Combination
A local combination or composite is one in which the composite solution is used in the continued integration of the approximations. If the composite u (P) replaces the approximations « , ( / * ) , u ( P ) , . . . as the initial value for the continued calculations, then the process is a local one. It would seem apparent that these local processes drastically influence the overall stability of the solution as it evolves. Of interest is that the range of stability for conditionally c
2
Composite Solutions
227
stable approximations can be increased by local combinations. Local procedures are always mesh point-by-mesh point or line-by-line combinations depending o n the finite difference approximation used. All space by space (the entire grid of mesh points) are global, since there is n o continued calculation of a particular approximation after the solution is obtained over the whole domain. The local combination algorithm can b e stated as: 1.
Initialize u (x = 0 ) with initial data from the PDE.
2.
Calculate « ( 0 + A ; p ) for m = l , 2 , . . . , where P — h /k . This is equivalent to first using the finite difference approximation to go from χ = 0 to χ = A with p (use A ) ; then go from χ = 0 to χ = A / 2 to χ = A
c
1
m
m
m
0
0
with p , (use A / 2 ) ; then go from χ = 0 to χ = A / 3 to χ = 2 A / 3 to χ = A 0
with p (use A / 3 ) ; and so on. 0
2
3.
Combine these solutions via the formula t o be given shortly t o yield M (A). This, of course, is the set of all mesh values on the τ — 1 or A line.
4.
Use « ( A ) as an initial set for the next calculation to reach χ = 2 A ; this is continued as far in the x-direction as desired.
(
C
For one combination, the formula for the composite is (4.8.12)
« (p ) = e «(p,) + ( l - e ) u ( p o ) . f
0
1
1
where p , = p / 2 , p = h /k , a n d a, and (1 — a , ) are weight factors for the combination. In other words, we put the two solutions w ( p ) a n d « ( p , ) together via a linear combination. In the more general case, we would relate η solutions 2
0
0
0
0
(4-8.13)
M
C
(
P
O
)=
Σ m =0
a u( ), m
Pm
where the requirement on the a is m
Σ *•, = ·•
m =0
Let us now examine the stability of the classic explicit method when used in one or two combinations. W e again use the amplification factor £= l-4psm ^2
or, in a simpler form for our use, £= l-2p(l-cosp\t).
228
Parabolic Partial Differential Equations
But because the range of cospV: is - 1 to + 1, we can also write ί = 1-2ρΔ,
(4.8.14)
where 0 < Δ < 2 . Obviously, (4.8.14), which we write as ξ(ρ )=1-2 0
Ρ ο
Δ,
is the decay factor for a one-step (the normal case) approximation. For a two-step approximation over h the factor is £ ( p , ) . That is, « ( ρ , ) has an amplification factor of £ ( p , ) or ξ ( ρ / 2 ) for each A / 2 step and ξ ( ρ / 2 ) for the two-step integration. For the composite, using (4.8.12), 2
0
2
0
(4.8.15)
0
0
ξ,(Ρο) = ο . ( 1 - Ρ ο Δ ) + ( 1 - Α ) ( 1 - 2 ρ Δ ) ,
0<Δ<2.
2
1
0
But for stability, | £ ( p ) | < l , which yields two inequalities c
0
€,(Po)< + l i,(Pb)>-l or, using (4.8.15), (4.8.16a)
1-2ρ Δ + α,ρ Δ «1
(4.8.16b)
1-2ρ Δ + α,ρ
2
2
0
0
2
Δ >-1. 2
3
The solution of (4.8.16) yields a two-dimensional region representing the p and a , which form stable composites. T h e maximum stable value of p occurs at α, = I (see Burgess and Lapidus, 1973); at this point p = 2.0. Thus with one local composite the stability region is extended from the usual value of ρ = {- to ρ = 2.0. For 1 < p < 2 this procedure combines unstable solutions of the classic explicit approximation at p and p / 2 to yield a stable composite. For two combinations, the form of the local composite is (using the SSI spacing sequence) 0
(
0
0
0
0
(4.8.17)
0
« (ρ ) = β 2 « ( j ) + ί
fli«(y)
0
+ 0-ei-e )«(Po) 2
and the stability inequalities are - 1< 1-2
Δ + ( j a + α, ) ρ Δ - ^ ρ 2
Ρ ο
2
2
3 0
Δ
3
< + 1.
N o w one has a three-dimensional plot for p , a,, and a - With ο = Ιτ d a, = ^ , the maximum stable p is p = 4 . 5 . Thus the region of stability has been increased from | to 2.0 to 4.5 by the local composites. a n
0
0
0
2
2
Composite Solutions
229
One can continue this procedure and it is not too difficult to show that with these combinations (SSI sequence), the maximum stable p is 8.0 with o = 2 2 7 / 5 1 2 , α = 188/512, and a, = 8 1 / 5 1 2 . In fact, for η combinations 0
3
2
(4-8.18)
Ρ ο Ι ™ ^
1
^ ^ .
It is also possible to use the SS2 sequence, but the results are never as good as with the SSI sequence. We may also use these results to derive new finite difference approximations. Thus if the weighting factor (4.8.19)
=
fll
l
Po
is selected in the one-combination case, a new four-point finite difference approximation results from the composite. This is shown in Figure 4.8/J, and Figure 4.8a is the one-combination composite. The stability range for Figure 4.8Z> has the same maximum, ρ < 2 . 0 , as the composite. This idea can be extended to the two-combination case with 0
Po
8 3p
_ Po 2
0
p-k-
i-2
i-4
i
a ) Arbitrary α,
h
Η
i-2
U - - ,
i-4
i+2
i+1
ι*
-Ηί
i+2
i+(
b) Special c a s e , a = l / y = k / h
0
z
0
Figure 4.8. Schematic representation of equivalent difference equation for one combination composite, (a) General case with arbitrary a. (b) Special case a, = l / p . (From Burgess, 1971.)
0
230
Parabolic Partial Differential Equations
to yield a new four-point finite difference approximation with p < 4 . 5 and the three-combination case with 0
a, =
=
fl
3
\6 Po
27
27
2po
Po
Π
18
" Pi
Po
- T
7 +
3
—
Po
·
In fact, for η combinations the following finite difference results: (4.8.20)
approximation
(Λ + 1)
with Po'
( n + 1)
2
O n e may use a Taylor series expansion in (4.8.20) to show that the local truncation error is (4.8.21)
Truncation errorl „
=
h 2
k' > 12 v +l
2
UY
as compared to the classic explicit form, (4.3.10)
Truncation error|
()g
^=
h__k*_ 2 12
«4,·
The ratio of these two truncation errors (neglecting stability for the classic explicit) indicates that the composite is more accurate at the same p . However, the ratio of the truncation error of the composite at its maximum stable p to that for the classic explicit at its maximum stable p ( | ) shows that the composite truncation error is always greater. 0
0
0
4.8.4
Some Numerical Results
Here we report some results for the model parabolic P D E system: (4.8.22a)
u =u, x
yy
Q
x>0
Composite Solutions
TABLE 4.1.
Local Composites: Error Reported as |error| X 1 0 η
Method"
Po
V -0.2
1[*=' 0.1, Ay =-0.05,Ax
Classic explicit Composite of CE Composite of CE (1) Composite of CE Exact solution
231
0 1 2 3 —
0.5 2.0 4.0 8.0 —
y=0.6 =
m
s
y=0.S
pAy ,SS\] 2
113.5 462.3 940.7 1843. 0.08093
305.2 1209. 2956. 356.0 0.3714
226.3 886.8 2522. 3272. 0.6547
[* = 5.0, Ay-=0.05, Ax = ρ Ay ,SS1] 2
Classic explicit Composite of CE Composite of CE (2) Composite of CE Exact solution
0 1 2 3 —
0.5 2.0 4.5 8.0
~0 0.0306 925. 0.1142 0.9999
~0 0.0189 1498. 0.0706 1.000
~0 0.0099 1274. 0.0301 1.000
"From Burgess. 1971. (1) Results reported at ρ =4.0 rather than 4.5 so that error at Λ =0.1 can be given (i.e., χ =0.1 is not a multiple of 4.5X Δ y ) . (2) Inordinately large errors have not been explained although the method is stable. Errors are reported at χ =4.950 since 5.0 is not a multiple of 4.5χ Δ y . 1
2
(4.8.22b)
u=0,
0
(4.8.22c)
u = l,
y = \,
u =0,
(4.8.22d)
y
y=0,
x=0 x>Q x>0.
The numerical results are reported in Table 4.1 for χ = 0 . 1 and χ = 5.0. The error is shown for zero, one, two, and three combinations at three values of y. The zero combination is the classical explicit solution and the SSI spacing sequence is used. It is clear from Table 4.1 that the composite is stable over the extended ranges of p; also, the larger truncation error associated with the large steps is apparent. There seems to be a discrepancy in the case of two combinations, but the reason for this has not been found. 4.8.5
Composites of Different Approximations
In previous sections we have considered the effect of forming composites with a fixed approximation while varying A and k. Now we look at different approximations combined in a composite at fixed A and k. T h e Saul'yev alternating direction approximations (4.6.24 and 4.6.25), which are averaged together, fit directly the definition of a local composite. The computational
Parabolic Partial Differential Equations
232
advantage here is the increase in stability and also in truncation error. Only local composites are considered here since global composites do not change the stability bounds. Let us consider in detail the following two cases: 1.
The classic explicit and the Crank-Nicolson composite.
2.
The Saul'yev and classic explicit composite.
If we call the solution to a parabolic P D E via the classic explicit approximation « ( r + l) at the r + 1 line (suppressing the index s) and that for the Crank-Nicolson u (r+ 1), then a local composite may be written as C E
CN
(4.8.23)
« (r + l) = e u r
C N
( r + l) + ( l - f l ) i i
C E
( r + l).
where a and (1 — a ) are the weighting factors. Using the appropriate finite difference approximations for u ( r + 1 ) and w ( r + 1 ) and a von N e u m a n n stability analysis (using the appropriate amplification factors), two inequalities result: C N
C E
1-ρΔ + 2ρ Δ (α-ΐ) < + l. 1 + ρΔ 2
2
With the two parameters ρ and a, we may now determine the region of stability for the composite (4.8.23). This is shown in Figure 4.9 with, of course, the case a = 1 showing ρ < oo. The truncation error for the composite can be shown (in the usual way) to be k . 12
k (a~\) u 2
2
Truncation e r r o r =
2
P
4y
+
0(k ) 4
and if s is chosen as 6p the error becomes 0(k*). This optimum a, also shown on Figure 4.9, is stable only if p < 1.5. However, when compared to the Douglas optimum finite difference approximation, (4.3.24), which has the same truncation error but is unconditionally stable, this particular composite, (4.8.23), seems to be of only academic interest. If we call w ( r + l) the numerical solution of the model parabolic P D E using the Saul'yev alternating direction and averaging technique, then we may SA
Composite Solutions
233
write a composite as (4.8.24)
u (r c
+ \) = au (r SA
+ \) + (\-a)u (r CE
+ \).
This has the advantage that all finite difference approximations are explicit and thus require minimal computing effort. Burgess and Lapidus (1973) have analyzed this composite a n d presented numerical results. There it is shown that for larger mesh spacings, the composite is much more accurate than the Saul'yev alone and is more accurate than the Crank-Nicolson. However, as the mesh spacings become small, these differences become small. W e should also point out the work of Joubert (1971) in which h e applies the unstable finite difference approximation of Richardson, (4.3.15), to the model parabolic P D E . However, by imposing an additional smoothing solution, which is really a local composite, he is able to generate a conditionally stable algorithm. Extensive numerical details are presented and the interested reader should consult this paper for an interesting illustration of how composites can change the normal behavior of a finite difference approximation.
234
Parabolic Partial Differential Equations
4.9
F I N I T E D I F F E R E N C E A P P R O X I M A T I O N S IN T W O S P A C E DIMENSIONS
In the present section we wish to consider various techniques for solving the model parabolic P D E
defined in the rectangle 0 < V | < l , 0 < y < l . Obviously, there are initial and boundary conditions that must be added to (4.9.1), but these d o not seriously affect the finite difference approximations and their solution beyond that already mentioned. The terminology to be used here is to specify u{x, y , y ) and u , with the increments in the mesh values corresponding to x, y , and\y being h, k , and k . For simplicity in the manipulations, we shall usually write A, = k = k and therefore >>, and y increments are assumed equal. Extensions of these definitions will be apparent as we proceed, and we shall introduce other features when it seems appropriate. 2
}
r
s
x
{
2
2
2
2
2
Note that on this basis, we are going to consider the evolution in the χ direction of a plane in y and y . Figure 4.10 is a schematic diagram of a portion of the two-dimensional plane evolving in the χ direction. x
2
4.9.1
Explicit Methods
It would seem apparent that we now have many options in terms of explicit and K , . , . A substantial number and implicit representations for the terms u of these approximations can be obtained by starting with a weighted implicit VtV]
V 2
"r-M , ι , ι .
h
Figure 4.10. Two-dimensional plane and corresponding finite difference mesh increments.
Finite Difference Approximations in Two Space Dimensions
235
form of (4.9.1). Thus we write, with 0 < 0, < 1 and 0 < 0 < 1, 2
(4.9.2)
- -'~"'' -'=^(u +i.s u,-l»r us.,
Ur+] s
+
r
Ur us->.,)
+
s
+
\ —θ + —T (»r. +\,,- r.s, k 1
2u
S
+
+
U
l
r.s-\.,)
β +
7 Τ (
Μ
Γ +
I.J./+
+ r+\.s.t~
I ~ r+l.s.l 2u
U
l)
k \ —β k As before, if we select 0, = θ = 0 , we shall obtain an explicit finite difference approximation (termed the classic explicit) 2
(4.9.3)
",+ ! . , . , =
+
P("r.
l . r + "r.s-
i +
+ « , , , _ i — 4t/ > J t
« Γ . , . Η -
1.1 +
r
,).
5
I
[classic explicit]
Note that (4.9.3) uses the five points labeled 0, 1,2, 3, and 4 in Figure 4.10 to calculate u . Obviously, the method of calculation involves a point-bypoint evaluation on the r + 1 plane using the points on the r plane. Given the initial conditions for r = 0, the plane by plane evaluation follows. As a special case, the choice p — \ yields r + ] s l
(4.9.4)
« +|,,., =
+ «*r.,-
Γ
1,1
+
"r.,.1+1
+
«r.,.l-|)
and we thereby eliminate the u , term. Stability of the classic explicit approximation (4.9.3) can be ascertained using von N e u m a n n ' s method. The extension of (4.5.5) for the one-dimensional case now becomes J (
£ ( x , >>,, y ) x e e ' P ' ' e ' y x
y
2
P l V 2
=
y 'Pi 'fii' rh
e
e
sk
k
e
When substituted into (4.9.3) and common terms canceled, there results (4.9.5)
ξ — amplification factor = e * = 1 —4p s i n ^ - + s i n ^ T
2
Since | £ \ < 1 is required for stability, it follows that - l < l l--44 p ([ss i n ^ + s i n ^ | < l . 2 2 2
2
2
236
Parabolic Partial Differential Equations
But /?, and β are arbitrary and it follows that 2
1
p<-
(4.9.6)
2ΐ8ΐη γ-+5ΐη -|-| 2ί
2ί
1 4 ·
<
We see that (4.9.4) is taken at the upper limit of the stability bound for (4.9.3). the stability Finally, if we h a d not used k = k = k b u t retained k =£k , bound would b e t
2
x
2
1
(4.9.7)
This becomes (4.9.6) when k = k . It is also possible t o derive (4.9.3) in other ways. In particular, we point out that x
(4.9.8)
2
«r i.,,, = +
where (8fu) ,
[l + p(*, + e; )]«,.,.,. 2
i
1
=u -2ιι + u ^ , a n d {8 u) = u , , -2u r.,.t-\ yield the identical equation. F r o m the way we have derived the finite difference approximation, it seems obvious that the local truncation error is 0 ( 1 , 2 ) . The stability bound of ρ < \ for (4.9.3) is restrictive to say the least. This can be relaxed slightly t o ρ *s {· by including additional points in the r plane; however, the truncation error remains at 0 ( 1 , 2 ) . This new nine-point a p proximation comes by adding a term ρ δ δ t o the right-hand side of (4.9.8). In a sense, this c a n be thought of as adding another term t o the right-hand expansion. If the explicit expansions are carried out, the result adds the term 2
rj
+
r s + U l
Λ ί ι ί
r
s
y
rst
r
+
l
r
s
l
u
2
2
2
2
(4.9.9) P [( « r . + i . / + i 2
i
+
( « r ,
J
+
_
2
u
,. ./+i+ i
l . , - r 2 «
M
.
(
1.,+i)-2(M
r j +
,,-2u
r
,,., +
Ιν.,-1.,)
- l + " M - U - | ) ]
to the right-hand side of (4.9.3). The accuracy of this new approximation c a n be increased to 0 ( 2 , 4 ) by selecting the special, but stable, case of ρ = \ . This is possible because, in the local truncation error term, there occurs a factor of ( p — £); when ρ = \ is selected, this entire term disappears and t h e truncation error is improved. Note, however, that (4.9.3) plus (4.9.9) uses all nine points o n the r plane of Figure 4.10.
Finite Difference Approximations in Two Space Dimensions
237
Although these formulas are interesting, the finite stability bounds usually mean that, even though these schemes are explicit and thus simple to program and compute, they find little actual use. Although we present some algorithms shortly which are used widely, we wish to indicate here the extension of the Saul'yev and D u F o r t - F r a n k e l approximations. As in the one-dimensional case, these approximations are explicit and completely stable; however, the local truncation error is 0(1,'2) and consistency questions exist. Nevertheless, these approaches have much to recommend them. The Saul'yev approximations in two dimensions have been presented by Larkin (1964) and in a more general context by Birtwistle (1968). The basic idea resides in the replacement of K (and also M ) , exactly as in the development of (4.6.23). Thus we write, in analogy to (4.9.2) and (4.6.23), VjV)
( .9. ) 4
1 0
- -'~ - -'
Ur+l s
= ^- (u
Ur s
2
r + U s
+
.
V2V2
U l
-u
, -u ^ l
r
• «r.i.l
1,1
r,s+
+•
r + U s
2
+ u , r
s + U l
)
«r.,-l,i)
+
r,3,t
.1
; ( « r + 1.5.1-1
l
U
M
r.j.l+l)
+ Obviously, for 0, = θ = 0 , this is merely (4.9.3). However, for 0, and θ Φ0, we may rearrange (4.9.10) to 2
(4.9.11)
u
r+
l.j.r '
2
l + 0,p + 0 p 0 | r + l , j - l . / + 0 2 r + l . , , , - | M
M
2
+ (l-»iK,-i, + (l-«iK,„.-i (
+ « , . , + !., + « r . , , , + 1 -
(
4
~
θ
\ ~ 2 θ
-
^
) «,.,.,
-
[Saul'yev 1 ] 2
Although this approximation does not appear explicit because «,+ ι , , - ι , , and « , a r e on the right-hand side, a careful use of the equation makes it explicit. This is, of course, the same idea as with (4.6.23), the Saul'yev I; in fact, we call (4.9.11) the Saul'yev I for the two-dimensional version. If one begins the calculation at the upper left corner of the mesh space and proceeds to the right along a line, the only unknown is u . The values of u , _, , r +
s
2
r+
U
r
r +
s
238
Parabolic Partial Differential Equations
and u _ are initially boundary values and then become previously calculated values. In other words, only the single unknown u , is calculated point by point and then line by line, an explicit calculation. In much the same manner, we may also obtain the approximation r + l s !
x
r+]
(4.9.12)
«,+ , . , . , -
ι
+
β
Ρ
+
Λ
0\ r+\.s+\,t
s
+ ^2 r+l,s,l+l
U
U
+0-βι)«,., ι.,+(ι-·Μ«,.,.Μ-. +
+ «r.i-l.l
«r.*.»-l
+
[Saul'yev I I ] 2
which we call Saul'yev I I . This calculation is explicit from right to left. Equation (4.9.12) may be combined with (4.9.11) and averaged in exactly the same manner as in the one-dimensional case to increase the accuracy; the local truncation error of (4.9.11) and (4.9.12) is 0{6 k + e k + h + k ). The stability bound of a combined set of (4.9.11) and (4.9.12) is 2
2
x
2
1
(4.9.13)
2(2-r7,-t? ) * 2
which yields (4.9.6) when 0, = θ = 0 . But as 0, and θ -»1.0, the stability bound increases until at 0, = θ = 1.0, the bound ρ < oo is achieved. We return to these equations in a later section. We may also generalize the one-dimensional D u F o r t - F r a n k e l approach (4.3.13) to two dimensions (see Birtwistle, 1968). Thus we start with what would be a Richardson explicit approximation: 2
2
2
(4.9.14)
u r+\,s,l
U
r-\,s,l
_
r,s+I,t
U
2u
2h
ic
+
r,s,t^~ r,s-\,l U
2
k
2
However, this form is unconditionally unstable. Instead, let us replace u the right side of (4.9.14) by
r
M
r,j,f
^H'v+l.i.i
+
M
r-l,i,/)>
s
, on
Finite Difference Approximations in Two Space Dimensions
239
to yield (4.9.15)
u
r + U s
,= j ^ ( u
,+ «,,,_,,,+
r s + i
ΚΓ.,.,+
Ι + «,.,.,-i)
+ {^«,-.,j.r
iDuFort-FrankelJ
This approximation is explicit (only one point on the r + 1 plane is involved) and unconditionally stable. Further, it has a local truncation error 0 ( 2 , 2 , 2 / 2 ) . However, it does need to bootstrap itself through one r plane. T h e plane r = 0 is given by the initial conditions, but the plane r = 1 must be calculated before (4.9.15) can be implemented for r = 2 , 3 , 4 This can be d o n e with any alternative formula or by using (4.9.15) with ρ = Obviously, (4.9.15) has the advantage of being stable and explicit. The problem of a starting sequence is also relatively easy to overcome. However, as with the one-dimensional case, the consistency of the solution as the mesh spacings are refined is unusual. Thus, if h/k-*0 as 0 ( 1 ) , then the model parabolic P D E with which (4.9.15) is consistent is
u 4Η*
2
Λ
2
£2
U -— U x
+Τ u
y>yi > 2 . v :
x
rather than u —u *
y\y\
+ u "
w
i
Nevertheless, used with care, this seems like a powerful finite difference approximation. The interested reader is referred to the paper by Birtwistle (1968) for a superb analysis of both the Saul'yev and D u f o r t - F r a n k e l approximations in two and three dimensions. In particular, the link between the two methods is analyzed rather carefully. Finally in this section we wish to point out the generalization of (4.6.30) by Barakat a n d Clark (1966) to two space dimension. The model parabolic P D E is replaced with the set (4.9.16a)
Pr+\,s,l
h
Pr.s.l
_ Pr,s+\,l
Pr,s,l
Pr+ \,s,l + Pr+ I . J - 1 , / k
_|_ Pr,s,l+\
~ Pr.t,i~
2
Pr+ l,j,<
k (4.9.16b)
°r+\,s,l
~ Qr,s,t
_ 4 l + l . » + l , t ~ Qr+\,s.t
' Qr,s,t
k
Pr+ l . j . t - 1
2
2
+
Qr,s-\,t
Parabolic Parabolic Partial PartialDifferential Differential Equations Equations
240 240
with «ur+l| s, calculated calculated from from the the average average of of ppr+, s, and and qqr+i l . ssl. f, r +
r+l
s
(4-9.17) (4.9.17)
*r+\,s,t
_ Pr+\,s,t
+
22
s
r+
Qr+\,s,t
The , and ,, _, can The values valuespp r+Us%l and qqr+iiS can be be calculated calculated explicitly explicitly by by first first solving solving for Pr+\.s.t right-to-left Pr+\.s.t m t n e left-to-right left-to-right direction direction and and then then qqr+is_,, inin the the right-to-left direction. + | , for direction. Further, Further, the the ppr+\, +\,SJ and and gqr+Us for one one complete complete step step are are retained and become become pr s, and and qqr 5, in in the the next next step. step. ItIt isis interesting interesting that that this this approximation approximation is not only unconditionally stable stable with with aa local local truncation truncation error 0(2,2) PDE. 0(2,2) but but also also is consistent with with the the model model parabolic parabolic PDE. we discuss briefly what are referred to as alternatingIn a later section we direction D E . However, we direction explicit explicit methods, methods, A ADE. we have, have, in in the the present present section, aleady aleady outlined certain certain methods methods which which are are members members of of this this general general category. Both the Saul'yev Saul'yev and and Barakat Barakat and Clark algorithms are explicit and involve computation computation in in two two directions. r+i s%l
m
r+i<s
t n e
r+]
r
r
SJ
s
r
r
s
i J < (
5
4.9.2
Boundaries Irregular Boundaries
In all the material above and in what is to follow, it has been assumed that k == kk2 == kk and A:, and that that the the boundaries boundaries of of the the domain domain of of interest interest are are parallel parallel to to t h e y , and y2 coordinates. the^, coordinates. The The first first assumption can be removed in in aa straightforward ward manner manner and and we we do do not not pursue pursue this this point point further. further. However, the second assumption assumption of of parallel parallel boundaries boundaries is is not not as as easily easily overcome. overcome. The The main main problem is is that that mesh mesh points points may may not not lie lie oonn the the boundary boundary (if curved), as shown in Figure 4.11. 4.11. Note that the the points points 0,4,5 0,4,5 are are within within the the region region of of interest, interest, whereas whereas the we must, in some way, revise the points 2,3 are outside outside the the boundary. boundary. Thus we approximations to handle the points 22 and and 3. x
2
2
t,
,
S
tk ' f 1
,4 k 2 J —
k—*
7 \ 6
0 \
' 2
ΪΓ V" 5
\
\
y2 y<
Figure 4.11. Rectangular spacing with irregular boundary.
Finite Difference Approximations in Two Space Dimensions
241
There are at least two ways of revising the procedure. The first is relatively simple and consists of transferring the boundary values for u to the mesh points closest to the boundary. In effect, the boundary is reshaped so that it conforms to the rectangular grid; obviously, this introduces an error in the approximation being used, but the method itself is simple to implement. The second approach is more precise in that the finite difference approximations near to the boundary are revised. From Figure 4.11 we see that the distance between point 0 and 4, and 0 and 5, is k, whereas the distances between 0 and 6, and 0 and 7, are A, and k , respectively. However, if we recall (2.1.27), where we wrote (in the present notation) 2
4
V + V r S w
(4.9.18)
/ =o
where
- L + -L
a = -2 0
kk,
k (k 2
kk.
+
2
2
M*i + * ) ' αΛ
a, =
k)'
=
k(k
2
+ k)
then, we may revise our finite difference approximation without too much difficulty. In fact, using u — {u , )/h and (4.9.18), we may write the classic explicit approximation (4.9.3) as (see Figure 4.11) x
r+
'
1 (4-9.19)
u1 r+
j ,
:
l-2p
+ 2p
+
*•/* +
2
1 k /k
l+
k /k(l 2
k /k
}
+ k /k) 2
+ k /k{l
*r,s-\,t
t
- -' >
r s
+k
/k
+ k /k) t
+1+
k /k 2
'· *'/*·' ί+
"'·'•'-·
Of course, when = k = k, this reduces to (4.9.3). Equation (4.9.19) is 0 ( 1 , 1 ) and thus is less accurate than the standard form. The computational algorithm now consists of the standard approximation (4.9.3) for all ( J , t) points that d o not involve the boundary plus (4.9.19) for all ( J , / ) points that impinge on the boundary. 2
4.9.3
Implicit Methods
Using the weighted implicit approximation (4.9.2) we may generate a number of different implicit forms such as the backwards implicit and the C r a n k -
Parabolic Partial Differential Equations
242
Nicolson approximations. Before we d o so, however, we should point out the following. In the one-dimensional model parabolic P D E case, the implicit methods with their unconditional stability were quite competitive with the standard explicit methods. This was due to the tridiagonal nature of the coefficient matrix in the implicit case a n d the very efficient Thomas algorithm available for solving the algebraic equations. N o w , however, we find that a penta-diagonal matrix occurs and the Thomas algorithm cannot b e used. Thus the implicit methods, as presented in this section, are really not competitive with the explicit methods; as a result we present only a limited number of approximations. If we take 0, = 0 = 1 and 0 , = θ = {- in (4.9.2) we immediately obtain the backwards implicit and C r a n k - N i c o l s o n approximations, respectively: 2
2
(4.9.20) (l+4p)H
r + 1
, , . , = « , , , , , + P( «,+ ! . , + I . , + « r + l . s-\.,
+
r+\,,,t+\
+ «,+ ι . , , , - ι )
u
[backwards implicit] (4.9.21) (l+2p)«
r + 1
s
,-(l-2p)«
r
., = | ( « , 1 , +
+
M
J + I
., + «,+ , , ,
r + I , j . f + I + r+l.s,l-
l)
u
ρ + 2 ( " r . , + 1 . / + r.s-\.t
+ r.s.,+
U
U
\+
"r.s.,-\)-
[Crank-Nicolson] Both of these approximations are unconditionally stable with local truncation errors as in the one-dimensional case; for example, the Crank-Nicolson form is 0 ( 2 , 2 ) unless an irregular boundary is involved, in which case it is 0 ( 2 , 1 ) . N o t e that there are five unknowns at the ( r 4-1) plane in each equation and thus, if we were to write them in matrix form, the coefficient matrix would b e penta-diagonal. T h e solution, in this case, requires either a normal elimination procedure or an iteration process; neither is generally as efficient as the solution of the explicit approximations developed previously. We may also write (4.9.20) and (4.9.21) in a more condensed notation suitable for manipulation in a later section. Thus (4.9.20) can be written as (4.9.22)
(1 - ρ
- ρ 8^) u, , +
s
,= u
r
s
,
[backwards implicit]
Finite Difference Approximations in Two Space Dimensions
243
while (4.9.21) is equivalent to (l-fe*-f«r\)«,
(4.9.23)
. . , . r = (» + f*K + f ^ ) « r . , . r 2
+
I
[Crank-Nicolson] A perturbation of (4.9.23) can be found by adding the term
J v l( 's.>- r+\.s.>) S
2S
U
U
l
to the right-hand side to yield (4.9.24)
( l - f e ? . ) ( l - f ^ ) ^ . . , . , = (l + f « ? ) ( l - H f a ? J j
1
This equation will be of use shortly. It is also possible to obtain higher-order, more accurate, approximations. Fairweather (1969) has indicated that
[l-i(p-i)e ,][l-*(p-i)e,y«,
(4.9.25)
2
v
+
l
.,.
f
= [i + Hp + l)s, J[i + Hp + i ) s J « , , 2
2
l
i
is 0(2.4). The reader will recognize the analogy to the Douglas approximation in one dimension. Finally, we wish to show that a mixed derivative can be included in the model parabolic P D E without any serious difficulties. Thus we write +2bu ,.
u=au ,.
(4.9.26)
v
+ cu ,. ,
r
v
where a > 0 , b > 0 and ac - b = 0 to ensure the parabolic nature of (4.9.26). If we use a central difference for u and « , we may write 2
u
(4.9.27)
r+
U
s
- u
= e L, P
r i i i l
+
,
+ (1 - 6 ) L P
r
s
where L
r.s.i =[
f l
+
("r.5+l.l ~
2
b
2
u
r . s . , +
( " r , s + l . + \ ~ l
U
U .s-\.,) r
r . s ~ \ . , +
\ ~
U
r . s + \ . , - \
n
Parabolic Partial Differential Equations
244
L , , is evaluated at r + 1, and θ is an implicit weighting factor O < 0 * s l ; when θ -0, we have a classic explicit form, θ = {, a C r a n k - N i c o l s o n form, and β = 1 a backwards implicit form. The stability bound on (4.9.27) is r+I
(4.9.28)
\<θ^\
p
(a + c)p
O<0<J-,
which is a direct extension of the one-dimensional case (i.e., a = 1 and c = A=0). 4.9.4
Alternating Direction Explicit (ADE) Methods
Here we turn to the first phase of the analysis of methods that combine stability with computational simplicity for problems in two (and three) space dimensions. These methods are referred to as alternating direction since a single cycle of the computation requires the solution of two different finite difference approximations written in different physical directions. The end result of the two cycles is taken as the answers on the r + 1 plane. In this section we consider explicit methods, thus A D E , and in Section 4.9.5 implicit methods, thus ADI. Actually, we have already developed most of the explicit approximations, namely those due to Saul'yev and Larkin, (4.9.11) and (4.9.12), and Barakat and Clark. (4.9.16) and (4.9.17). We concentrate here on the first set, with the extension to the second being rather straightforward. If we let θ, = θ = 1 in (4.9.11) and (4.9.12) [note that (4.9.13) indicates that each approximation is unconditionally stable] but write (4.9.11) over 2 r -»2r + 1 and (4.9.12) over 2 r + l - * 2 r + 2 , there results 2
(4.9.29a)
U
j
r
+
U
i
i
=
T
JL-
U
2r+I.j-I,f
+
M
2r+I.s.r-I
+ « 2 r . , + l.r + « 2 r . » . » + l
2 -1 P
~
" 2r, j , f
(for odd χ steps) (4.9.29b)
u
2 r + 2
^,
=
Ρ l+2p
U
2 r + 2.i+l./"!" 2 r + 2.i./+l U
, +
, 2r+
U
l.j-l.r
'
2p-l W
2r+1. j.r-1
2r+\.s.t
U n
(for even χ steps).
Finite Difference Approximations in Two Space Dimensions
245
Sweeping a two-dimensional grid from southwest to northeast using (4.9.29a) and from northeast to southwest using (4.9.29b) (alternating directions) allows a direct or explicit calculation of i / , at the end of the two layer cycle. Note that in alternating direction procedures such as this one, the values w , , , are intermediate solutions and are not utilized as final answers. Also, we could have used (4.9.29a) to go from r — r + {· and (4.9.29b) to go from r + 5 — r + 1 in the same manner. One finds both sets of subscripts in the literature. These approximations may also be written in the following forms: 2 r +
2
Λ
2 r +
M
2r+l,,.,-"2r...i
A =
.-,»2r.i.f
~ ,·, 2γ+Ι.»-Ι.ι
h
U
2r+2.S.,~
U
Δ
μ
k
2
2r+\..,.L
_
A
r,"2r+2.v./
h
• , 2r + 1 . - 1.1
Δ
k
U
2
k
2
where ^v"r,S.J
"r,\+].I
kyJ*r,S.,- r. ., U
s
+
"r.S,L \-"r.S.,>
as shown by Coats and Terhune (1966). This A D E approximation is explicit, unconditionally stable, but only of moderate accuracy. In addition, as with other Saul'yev approximations, consistency must be handled carefully since a term h/k is in the local truncation error. Coats and Terhune (1966) compared the results of this A D E algorithm with an ADI algorithm (given in the next section) on a number of complex PDE. T h e end result was that ADI yielded significantly greater accuracy (the local truncation error of ADI is smaller than ADE) but required about 60% more computing time. For the same level of truncation error, a smaller h step must be used with A D E than with ADI, but ADI requires a more complex algorithm for the solution of the finite difference equations. In general, their results seem to indicate ADI methods superior to A D E methods. 4.9.5
Alternating Direction Implicit (ADI) Methods
Although the previous methods for solving the two-dimensional model parabolic problem are interesting, almost all have some defect. This may be the
246
Parabolic Partial Differential Equations
accuracy, the stability, the consistency, or the number of unknowns required in a solution for any one pass. Thus the C r a n k - N i c o l s o n implicit approximation, (4.9.23), is unconditionally stable, is accurate (<9(2,2)) and is consistent; yet the method requires the solution of a (n — l ) X ( n - l ) pentadiagonal matrix [assuming ( « - l ) mesh points in both t h e y , and the y directions]. Thus it probably is not a feasible approach unless η is relatively small. However, there is a variation on the Crank-Nicolson approximation which is very efficient, especially for rectangular regions of ( y , , y ) . This approach was first developed by Peaceman, Rachford, and Douglas and is called the alternating direction implicit (ADI) method. 2
2
In the A D I approach, the finite difference equations are written in terms of quantities at two χ levels. However, two different finite difference approximations are used alternately, one to advance the calculations from the plane χ = rh to a plane χ = (r + l)h and the second to advance the calculations from the x=(r + \)h plane to the x = ( r + 2 ) A plane; the second approximation needs no information about the values at χ = rh.* The first approximation is obtained by replacing u with an implicit form (backwards implicit) and Μ with an explicit form (classic explicit); the solution of the resulting (η — 1) unknowns per line in the (η — 1) equations can be solved at χ = ( r + \)h via the tridiagonal algorithm described previously. The second approximation is obtained by reversing the implicit-explicit terms and solving tridiagonal systems once again. As we shall see, the solution is thus obtained by alternating between rows and columns in ( y , , y ) space and solving tridiagonal equations. Ergo, we adopt the terminology ADI for the overall approach. 2
It will become apparent that the overall two-step approach requires minimal computer storage and is quite accurate. Further, the two-step scheme is unconditionally stable and consistent with the model parabolic P D E . There are some subtle features that one should be aware of and we shall detail them shortly. Let us start the development with the Peaceman-Rachford (1955) [PR] approach. The model parabolic P D E is written in two steps as (4.9.30a)
« ? + . . , . , - « , . , , , = ρ(«ν,«? ι.,.» + β Χ . , ) Ι
+
[PR][implicit i n y , direction] (4.9.30b)
=
+« « 2
2
Γ + 2
.,.,).
[PR][implicit i n y direction] 2
Note that (4.9.30a) is used for a step h to generate u * , +
s
, and then (4.9.30b) is
*As in the case of ADE an alternative notation is sometimes employed wherein one writes the sequence of steps χ = rh — χ ~(r + \)h — χ =(r + 2)h as χ = rh — χ =(r + \/2)h — χ = ( r + 1)Λ with the same implied meaning.
Finite Difference Approximations in Two Space Dimensions
247
used for the same fixed step h to generate u ,. One should interpret u* +, , as an intermediate solution in the two-step calculation. Within a single cycle of the two equations, the value of ρ is fixed, but it can change for subsequent cycles. Each approximation is itself consistent with the model parabolic P D E . In the first step of the two-step procedure, the solution is obtained through a line-by-line calculation using the tridiagonal algorithm in the y, direction (calculate «*+, , on all lines in t h e y , direction). The second step involves a second line-by-line calculation using the tridiagonal algorithm in the y direction. r+2
s
r
s
s
2
Depending on the notation one wishes to use, we could also write (4.9.30) as (4.9.31a) (4.9.31b)
«!, u
. . - « 2 Γ . , , = ρ ( δ ν « ^ . . , + δ "2,. .,)
[PR]
2
+ 1
5
ί
ί
-u*
2 r + l s l
+ 1
ί
ι
= p(8lul ,
2 r + l s l
2
Ι
+
r+ls
d u ^) 2
2r+2
l
or, for h / 2 per equation. u*
(4.9.32a)
- M _ , = ^{8 u* 2
+
l
/
2
s
l
+8 u
,)
2
+
r J
l
/
2
s
l
r s
[PR] (4.9.32b)
u
r+
,,~u*
Us
+
, = |(δ Μ* 2
l / 2 i J i
+
ι / 2 ι ί ι
, +
8fu +> ). r
sl
We may also rewrite these approximations in a more concise form, such as
(4.9.33a)
(4.9.33b)
(l-^J^.j.H^f^K*' (1 - f δ
2 2
) « ,
+
= (1 + § 8 } , ) « ?
+ 1 / 2
[PR] .,,,.
The stability of the PR algorithm can be obtained (using the von N e u m a n approach) by substituting yrh ifl,sk i$ lk
e
e
e
2
into the appropriate equation. As an illustration, with (4.9.32a) we find an amplification factor of
248
Parabolic Partial Differential Equations
while for (4.9.32b) there results
l-2ps,n (M) 2
(4.9.34b)
1 + 2psin2 | r V \ "
Note that each of these factors has a finite stability bound (i.e., each equation used alone is conditionally stable). However, the combined two-cycle calculation has an amplification factor
(4.9.35)
{ « = {.{,= 1 +2psin'
l+2psin
2
[PR]
βΗ 2
which is unconditionally stable for p < o o . Thus, although each individual equation is conditionally stable by itself, the combined two-step algorithm (with ρ the same in each step) is completely stable. This behavior is much like that in Section 4.3.5. where the classic explicit and backwards implicit approximations were shown to be equal, when applied in a tandem calculation, to the unconditionally stable Crank-Nicolson approximation. Finally, we can also predict that in a three-dimensional case, u = + " , · e procedure above will not be unconditionally stable since we are not able to obtain a symmetric amplification factor such as (4.9.35). t n
x
We may also eliminate approximation (4.9.36)
KJ"+I/2,S,/
( ' - Ι ^ Η ' - !
M
8
ΐ 2
2
(4.9.33) to yield the single composite
; ) " - . . . .
[PR] in which
are consistent nine-point operators in the r + l and r planes. In this form, however, all the computational advantages of the tridiagonal algorithms are lost. Note that for the Peaceman-Rachford method, there is a composite form, (4.9.36), and a split form, (4.9.33). We shall show shortly that there are alternative ways to split (4.9.36) into two-cycle approximations. For the moment, we merely wish to point out that we could obtain the unconditional stability bound on the composite forms (4.9.36), as well as on the split forms.
Finite Difference Approximations in Two Space Dimensions
249
(4.9.33), as we have done. However, in actually using the split form we need to pay special attention to the boundary values for u* ,\ without this special attention (to be detailed shortly) the two approaches do not yield the same numerical results except for a special case. The truncation error of the Peaceman-Rachford algorithm can be obtained in the usual fashion via Taylor series expansions. Although we d o not detail this point here, it is convenient to use the identities +x/l
"vx = « 4 , ,
+ 2
"2v,2v +
4,
i <
2
s
r
The result of such a calculation is to show that the Peaceman-Rachford method is (9(2,2) assuming a rectangular region. This also follows if one looks at (4.9.36) and (4.9.24), which we showed were equivalent to the C r a n k Nicolson method with a perturbation term (p /4)8 S (u , - u+ ) added on. There are also a number of other A D I approximations to the twodimensional model parabolic PDE. Douglas and Rachford (1956) [DR] proposed the two-cycle or split form 2
2
2
r
2
(4.9.37a)
(I-P«'>,V,, = (
1
+
s
r
lsl
P . X*.< 5 2
[DR]
(4.9.37b) Each equation is consistent and when combined to eliminate u* , composite approximation +
(4.9.38)
(1 - ρ δ ) ( 1 - ρδΐ)u ,,,
= (1 +
2
r+
2 Ρ
s
, yields the
δ δ )«,,,. 2
2
In this case the local truncation error is 0 ( 1 , 2 ) and the operators (1 - ρ δ )(1 ρ δ , ) and (\ + ρ δ δ ^) are nine-point consistent operators. Stability of the Douglas-Rachford approach follows the same line as used above on either (4.9.37) or (4.9.38); the amplification factor turns out to be 2
2
2
2
2
l + 16p sin 2
(4.9.39)
£DR
2
sin [DR]
—
(l+4psin [^])(l+4psin [^]) 2
2
This amplification factor is bounded, | £ | < 1, so that the Douglas-Rachford approximation is unconditionally stable. Mitchell and Fairweather (1964) have also derived a high-accuracy A D I approximation to the two-dimensional parabolic PDE. The reader would do D R
250
Parabolic Partial Differential Equations
well to consult this paper for a lucid development of the formulas, the truncation error, a n d the stability bounds. Here we give only a summary of the results. The two-step split formulas are given by
[l-Hp-t)^Ui.,M*
(4.9.40a)
ttP
+
+
l K h . s . ,
[i-i(p-i)*vJ«, ..,., = [> + i(p + i)e, ]«r ,. .,2
(4.9.40b)
[MF]
2
+
+
1
i
In this form the intermediate values , could have been written more By eliminating the intermediate values u* t h e properly as u * corresponding composite form is given as s
+ l / 2 s
r
+l
s
[l-Kp-iWjIl-Hp-i)^]"^....,
(4.9.41)
= [l + i(p + W ] [ l + i(p + W j « , . , . 1
[MF].
(
However while (4.9.41) is consistent with the model P D E , the split forms are not consistent individually. T h e local truncation error is (9(2,4) a n d thus is much better than the PR or D R methods. Note, however, that if the case ρ = £ is chosen, the left-hand side of (4.9.41) becomes merely u , and the algorithm becomes explicit. It is also of interest to list here the principal parts of the local truncation error for the three algorithms; these are r + l
rhk\u, +
u )
y
[PR]
Av2
HP + )k\u
+ u )+pk u
L
~ ) P
P
2
[DR]
4
4Vi
6
s
4v2
2yi2v2
~ : > K , +<W
[MF]
10(P + | ) and we see that the choice p~\/{2^5) yields a further improvement in the truncation error of the Mitchell- Fairweather method. The stability features of the Mitchell-Fairweather method can be ascertained in exactly the same manner as before. N o w the amplification factor is 2(ρ
(4.9.42)
£
M F
+ ί)ύ*(ψ)-\][2(ρ
+
1)ώ*(*£)-
[MF]
=
2(p-i)sin (M) 2
which is bounded, I ^ M F I ^ ^ f ° unconditionally stable.
r a u
"
+
v a , u
1
][
2 ( p
_i
) s i n 2
(M)+
1
e s of p. Thus this A D I algorithm is
Finite Difference Approximations in Two Space Dimensions
251
Douglas (1962) has also presented a higher-order accurate method. T h e reasoning in this method is to obtain a perturbation of the C r a n k - N i c o l s o n form; since we detail this feature in the three-dimensional case, we merely give the split and composite forms here. Thus we have (4.9.43a)
(ΐ-{ρδ \)ν .,,=[[\
+ \ρ%) +
(4.9.43b)
(l - i p e > ,
u
ν
+ι
2
+
, . „ = u%
Ρ
6ϊ]*,^, [D]
-\p8 \u , _,
,
v
r
s
and (4.9.44)
(l - i p « i ) ( l - i p « i j ( « = ρ(β
r +
,.,. - « . , . ) f
r
r
+ «, Χ.„.
[D]
2
ζ 1 ι
The algorithm is «9(2,2) and is unconditionally stable. Now let us turn to the evaluation of the intermediate values « * , , , in any of the ADI algorithms. W e explore this question for the Peaceman-Rachford algorithm and then quote the equivalent results for the others. For further details, see Fairweather and Mitchell (1967). The split forms for the Peaceman -Rachford algorithm are given as (4.9.33a) and (4.9.33b); in solving each form via the tridiagonal algorithm, it will be necessary to specify boundary values at the ends of the line being solved. In the case of (4.9.33b), this is no problem and « , , where t = 0 and / = Μ assuming that values are given for u , represent the boundary points. However, in (4.9.33a), it is necessary to have M* i and M * in order to solve the implicit equations. If the boundary conditions are functions of x, u , = g , on the boundary, then these values must be calculated correctly or the algorithm will lose accuracy (i.e., errors will be introduced). If the boundary conditions are independent of x, u , = g , on the boundary, no problems will occur. T o obtain the proper boundary conditions in the x-dependent case, we proceed by adding (4.9.33a) and form and (4.9.33b) to eliminate {p8 u* +
r+
/ 2 ! 0
+
+
l
/
2
t
Λ 0
r +
s
s
r
t
s
t
(4.9.45)
M
M
r
r
s
u% , ., l/2 s
+l/2sl
= i ( l + 4p«, ) , ,, + i ( l - i p 5 ) 2
2
!
M r
i
M r + l
. ,. J
[PR]
It is interesting to note that the Peaceman-Rachford algorithm could use (4.9.33a) and (4.9.45) in tandem; this is more efficient than (4.9.33a) and (4.9.33b) because in (4.9.45) the calculation for [l + {pS ]u , has already been carried out. If we eliminate w * , between (4.9.33a) and (4.9.45), we y
+ ! / 2
s
r
s
252
Parabolic Partial Differential Equations
get an alternative Peaceman-Rachford composite form, (4.9.46)
(1 - - i P ^v , ) ( » - i P * v 1 . , . r 2
= (l + ip6 )(l + {po J« . ,, + ^ , „ 2
2
(
l
|
r
[PR],
J
where ρ { * Γ . / 2 . ο . , - K + hP^)gr.o.,
~if -
1
lP8 )g .o.,}
1
+
2
r+l
2
(on one boundary) by
(4.9.47)
s
Ρ { * , \ , / 2 . Μ., - I ( + 5 P « 1
2 M
. ,
- 1 ( 1 - 1P«
2 2
) * , .. Μ.,) +
(on the other boundary) (in interior region).
0
The Peaceman-Rachford algorithm will be 0 ( 2 , 2 ) provided that the b , = 0 ; otherwise, the method will lose accuracy. In order for the b , = 0 , it follows that s
s
^,^,.^Ηΐ + ^Κ.,, + Μΐ-Μ, ,)^!.,.,
[PR]
2
(4.9.48)
on the boundaries. But (4.9.48) is the same form as (4.9.45) and thus the latter formula can be used to calculate the intermediate boundary values prior to the start of the main calculation. If the boundary conditions are independent of x, it follows that &r,s
and the b , in (4.9.47) are b , = 0 always. Thus if we use g * , , = g , no loss of accuracy occurs at any time. In exactly the same manner, we can develop the equivalent equations for the Douglas-Rachford and Mitchell-Fairweather algorithms. These are, in turn, s
(4.9.49) (4.9.50)
s
+ 1 / 2 - J
«*?+ 1. J . / =
P v r. s . , + ( 1 - Ρ*, , ) "r +
**+!.,./=
Ρ
U
8
2
2
Β
, ,*Γ. ., 2
Ι
5
I.,.,
[DR]
+ ( ΐ - ρ β ν ) * , + ι.,., 2
1
and (4.9.51)
^..,, = ^ [ i + i(p + iR K,, 2
2
+
£
5
i n
[ -Hp-i)«^]«r ,
+ 1
.,.,
[MF]
Finite Difference Approximations in Two Space Dimensions P+ i
(4.9.52)
253
2p •[i + i ( p + i ) « ] 2
In the Douglas-Rachford method, the equivalent b =0 if the boundary conditions are χ independent; however, in the Mitchell-Fairweather method, (4.9.52) reduces to it
(4.9.53)
[MF]
even when g * , , = g , = g ,. Thus (4.9.53) must be used even when the boundary conditions are χ independent. Obviously, some of these results can be extended in a number of directions. Thus Keast and Mitchell (1967) developed a Peaceman-Rachford A D I algorithm when the boundary conditions are given in x-independent flux form +
a
r s
t
>>,=(Γ
(4.9.54a)
ν, = 1
(4.9.54b)
Ι
Λ = 1
0
χ>0
0«Ξν,<1,
χ>0
and McK.ee and Mitchell (1970) include a mixed cross derivative in the two-dimensional model parabolic PDE. In particular, they show that for (4.9.55)
u . = au . v
+ 2bu ,. v
+ cu. ,.
the composite form
(4.9.56)
*r+ Ι,ί./
= {[ι + ( )
+
+
Ιρ„) ;
- ρ Κ , % > Λ .
δ
ί
. ,
1 + ΐ 7 + ^Ρ^)δ,
2 2
254
Parabolic Partial Differential Equations
can be obtained, where / i s an adjustable parameter y, r,s.l
W
W
~
U
U
r,s+
\.i
U
r.s-\.i
R.J.R+L
M
y r,s.l~ U
2
r.s,t-\-
U
This can be split in Douglas-Rachford form to yield (4.9.57)
1+
(rH«
4
r + \.s,l
δ.
1 +
'
+ pcfi/ + 1 p Z , 2
1 +
(7~\
p c
" '·*·' * '·*·' r +
) y> 8
= M
+
+
2
+ ^ (α + c ) 5 δ 2
% i % j
2
(7~I )y2r.s.r pc 8
u
Equation (4.9.56) is shown by McK.ee and Mitchell (1970) to be 0 ( 1 , 2 ) and to be unconditionally stable for / < 0 and f>4. The intermediate boundary conditions are given by (4.9.58)
g; ,,,,,= +
One may also add a source or sink term to the model parabolic PDE. Thus we may write (4.9.59)
" x = «»,». + u
T h e Peaceman-Rachford (4.9.59) become (4.9.60)
(l-ipe;>?
+S(u,
x,y ,y )t
2
and Douglas-Rachford split schemes applied to
+ 1 / 2 > i
. = (l + i p * ; ) u . . + <
i
r
J
l
ipS
, .
r + 1 / 2
1
(
[PR]
(l-ipeA) 'r I.S.I = ( l + i P ' , > R V I / 2 . . . + i p SV+L/2,J,i ,
+
i
l
and (4.9.61)
(l-piftuU^.^l
+ pdtiu^
+ pS,^,,, [DR]
(
1
~ P*A
) " r + I, ι . / = « ? + I. ι.» -
Ρ * Α « Γ . f. ι ·
Finite Difference Approximations in Two Space Dimensions
255
Of course, if S is nonlinear, the result is a set of nonlinear algebraic equations. Thus the simple tridiagonal solution feature is lost; as a result either linearization plus iteration is used to return to the linear form or S is evaluated at the last pass (say at r rather than r + \) value. We may also extend the ADI methods to parabolic P D E with variable coefficients. Thus if the model P D E is written as (4.9.62) the Peaceman-Rachford split formulas would be (4.9.63)
[1 - ^(β,β,,)]
«Γ .,. = [ 1 + +I / 2
ip« ( « )]«,.,.,
f
y i
β 2
Λ
[ι-ίΡ^ (βΛ )]«Γ ..,.,=[ι+^ ("Λ )]«? ./2. . ι
Ι
+
ι
ι
+
ί
[PR] ί
with the intermediate boundary conditions given by (4.9.64)
g;
+ 1 / 2
. . = |[l-ip«JA 5 )]g J
(
2
> ;
r + 1
. , , + i [ l + ^p«5 ,(AA )]g , ,, I
>
2
r
i
as an extension of (4.9.48). Finally, we mention that all of the above holds strictly for rectangular regions in y, and y . If the regions are not rectangular, then the split and composite forms are not necessarily equivalent. It may be necessary in nonrectangular regions to use equations such as (4.9.19) at the boundary or to ignore the curved sections entirely. Obviously, either approach leads to a loss in accuracy. However, computational experience, not theory, indicates that A D I methods work well even in the case of nonrectangular regions. The methods still seem to be among the best that one can use. 2
4.9.6
L O D and Fractional Splitting Methods
We have already pointed out the connection between the split and composite formulas in an A D I context. It is, however, also possible to split the composite (or the P D E ) in alternative ways. These methods are termed local onedimensional (LOD) approximations or fractional splitting approximations. Such schemes have been discussed in detail by Yanenko (1970), H u b b a r d (1966), Gourlay and Mitchell (1969, 1972), Mitchell (1971) and Morris and Gourlay (1973). Morris (1970) has also presented a very interesting comparison between the L O D and ADI methods as applied to a heat flow problem with a discontinuous heat source. As might be expected, in certain cases or under certain restrictions, all types of splitting will be identical. As one might anticipate, many split forms are possible. W e have shown (4.9.33a) and (4.9.33b) as the Peaceman-Rachford split formulas which lead to
256
Parabolic Partial Differential Equations
composite (4.9.36). Instead, we could have used the split forms (4.9.65a)
(ΐ-|.5 ) ?
(4.9.65b)
(\-^)u ,,,,
2
Μ
, = (ΐ + | β ) ( ΐ + | β 2
+ 1 / 2 ι 1
=
r+l
2
)«,.,,,
ur ,,,„ +l/2
which also yield the composite (4.9.36). Computationally, the different split forms involve different points but the end result, at least for our model parabolic PDE, is the same. With this feature in mind, we rewrite the model parabolic P D E as (4.9.66a)
« = M, . + i i , , x
il
i
r j
i
which we now express as (4.9.66b)
K
= «„v,
Κ
= «,·„·,
and (4.9.66c)
N o t e that each of the two equations (4.9.66b) and (4.9.66c) has only one space variable (_y, or y ) involved. Thus we may treat each equation via onedimensional methods and combine the two results to solve the original problem. Since we have the { in front of u a n d we wish to solve the combined set over one step, A, we can write in explicit form 2
x
2\
A/2
1 / r+i,s.,- r+\/2.s,,\ U
U
2\
k
/
2
+ I / 2 . S . I \ __ y\
81 U
r+\/2.s.,
A/2
or (4.9.67a)
(4.9.67b)
«,
+
i/2.,., = 0 + P * v , k . , . ,
« , . , . = (l + P*v ) +l
l
1
The composite form of (4.9.67a) and (4.9.67b) is (4.9.68)
^ Ι + ρ ό ^ Ι + ρδ^Χ,.,,
Finite Difference Approximations in Two Space Dimensions
257
which is equivalent to (4.9.8) with the perturbation ρ δ δ added to the right-hand side. Although we d o not propose the serious use of this split or composite form, it is obvious that (4.9.67a) has the virtue of operating in one space direction followed by (4.9.67b) operating in the other space direction. Thus one would use two explicit schemes in succession, one in each space direction. On this basis, the term local one-dimensional (LOD) has developed for methods that employ this type of splitting. However, rather than use the explicit represention, it would seem preferable to use the Crank-Nicolson approximation with its increased accuracy and unconditional stability. Thus if we represent (for h / 2 ) \u = w by 2
2
2
x
2{
) ~ ^lK«,
hj2
+
1
V V |
+ V—)
/2. ., 3
or (4.9.69a)
(1 - | δ ) u , ,,.,
= (1 + | δ , , )
2
In the same sense, we may also write for \u
x
(4.9.69b)
( l - ^
2
)
M
r
,.,.
2
r+ /2
+ 1
.. , = (l + ^ s
= 2
)
M
r
+
1
/
2
s
, .
thus forming an L O D split formula group. Note that if δ and δ, , commute (i.e., the y, - y region is rectangular with sides parallel to the y, and y axis), we d o come back directly to the Peaceman-Rachford A D I forms (4.9.33a) and (4.9.33b). In fact, one might start with the Peaceman-Rachford split forms and interchange ( 1 + ( ρ / 2 ) δ ) and ( 1 + ( ρ / 2 ) δ , ) on the right-hand side to yield the L O D forms above. The L O D split forms use a tridiagonal solution as before, are unconditionally stable, and are second-order accurate (since they use the Crank-Nicolson algorithms) [i.e., 0(2,2)]. The same concept can be applied to the Mitchell-Fairweather A D I split forms, (4.9.40a) and (4.9.40b), to yield 2
2
2
2
2
(4.9.70a) (4.9.70b)
[\-Hp-m]u
2
r
+
l
/
[l-i(p-i)*, J«
2
. ,,
2
s
= [\ + HP +
i)S ]u , , 2
r s n
. . , = [l + i ( p + i ) « J « r , / 2 . . . , 2
r + l
i
l
+
Commutation of the A D I and L O D forms follow, as before, only when δ and δ, commute. Intermediate boundary values for either of these L O D schemes follow from 2
2
2
(4.9.71)
r+l/2,i./
8r+\/2.s,f
Parabolic Partial Differential Equations
258
Although some accuracy may be lost in this formulation, in contrast to A D I methods, there does not seem to be any better way to calculate the intermediate boundary condition. When δ and δ, d o not commute, there is n o obvious connection between the ADI (PR) and L O D schemes. However, Gourlay a n d Mitchell (1969) did point out the conditions linking the two. Thus we write the Peaceman-Rachford scheme as 2
2
(4.9.72a)
(1 - | «
) u%
2
1
(l-fe )«,
/
2
(4.9.72b)
J
+
2
s
fa)
, = (1 +
,
fei)«r i 2. .,
i. ., = ( l +
+ /
i
i
and the L O D scheme, (4.9.69a) and (4.9.69b), as ( 1 - ^ ) ^ 1 / 2 . , . , = (« +
(4.9.73a)
§*Α)ΟΓ.,.,
(1 - 1δ ) υ, , , , = (1 + § δ ) v
(4.9.73b)
2
2
+
r + 1 / 2
.,.
Note that we have used ν instead of u in the L O D form and changed the indices in a straightforward fashion. N o w if we eliminate t J , in (4.9.73) (i.e., form the L O D composite), there results r + 1 / 2 - J >
(4.9.74a)
(l-f
β^)<ν+..,., = (ΐ + §e»)(l-t-f
« )"V„2
Now if we choose v , ,,
(4.9.74b)
r s
(4.9.74c)
=
(l-fa ) 2
° , ι.,., = ( ΐ - § «
2
+
2
U
r
)«,
+
s
l
,.,.,.
then (4.9.74a) becomes (4.9.75)
( ^ f a ^ - f a ^ u ^ ^ ^
+
fa^
+
fa^,,
which is (4.9.36), the composite P R form. Thus the L O D a n d PeacemanRachford schemes are equivalent through the transformation (4.9.74b) a n d (4.9.74c); in one case the values v are generated in the calculation, while in the other the values u , are generated. But either can be obtained from the other via (4.9.74). r + l s l
r + l s
Finite Difference Approximations in Two Space Dimensions
259
Gourlay and Mitchell actually consider the case where the model parabolic P D E includes the source or sink term S(y^ y ). This requires a careful analysis of the intermediate boundary conditions, but the transformation of (4.9.74) follows in the same way. The interested reader should also consult Morris (1970) for further details. We should also point out that from the splitting of (4.9.66a), the L O D algorithm can be applied in an obvious fashion to variable coefficient and nonrectangular regions exactly as in the one-dimensional case. The fractional splitting methods are based upon a simple idea which starts with the model parabolic P D E in the form 2
u
x
= £u,
where £ is a linear spatial differential operator explicitly independent of x. Thus £ = £ , + £ + · · · + £ where g is the number of space dimensions (in our present notation £ = £ , + £ or £ = £,, + £ ) . Now a difference scheme is developed which replaces £ successively by g £ , , g £ , . e a c h operating for an interval h /g. As a result one replaces the original problem with a series of simpler problems. When £ , , £ , . . . , each involve only derivatives with respect to a single variable (i.e.. £ , = 9 / d , £ = 9 / 9 , , . . . ) , the fractional splitting methods become L O D methods. Thus if we start with the one-dimensional case, 2
2
V2
2
2
2
2
2
2
2
u
x
7
= £«,
where £ = 9 / 9 y , then the Crank-Nicolson approach yields 2
2
h where L/k
[
2k
2
is the finite difference equivalent of £ and
2
κ , ., = (ΐ + § * · ) ( ΐ - § ί . ) ~ ' « , . , · + 1
In this case, we obtain a tridiagonal matrix with unconditional stability and a simple solution algorithm. For two dimensions, the same approach yields L = L + L with the resulting matrix n o longer tridiagonal. T o circumvent this problem, we integ