comparison of finite difference and control volume methods ... of... · comparisons are made...
TRANSCRIPT
Computers and Chemical Engineering 24 (2000) 2633–2654
Comparison of finite difference and control volume methods forsolving differential equations
Gerardine G. Botte, James A. Ritter, Ralph E. White *Department of Chemical Engineering, Center for Electrochemical Engineering, Uni6ersity of South Carolina, Columbia, SC 29208, USA
Received 5 May 1998; received in revised form 10 August 2000; accepted 11 August 2000
Abstract
Comparisons are made between the finite difference method (FDM) and the control volume formulation (CVF). An analysisof truncation errors for the two methods is presented. Some rules-of-thumb related to the accuracy of the methods are included.It is shown that the truncation error is the same for both methods when the boundary conditions are of the Dirichlet type, thesystem equations are linear and represented in Cartesian coordinates. A technique to analyze the accuracy of the methods ispresented. Two examples representing different physical situations are solved using the methods. The FDM failed to conservemass for a small number of nodes when both boundary conditions include a derivative term (i.e. either a Robin or Neumann typeboundary condition) whereas the CVF method did conserve mass for these cases. The FDM is more accurate than the CVF forproblems with interfaces between adjacent regions. The CVF is (DX) order of accuracy for a Neumann type boundary conditionwhereas the FDM is (DX)2 order. © 2000 Elsevier Science Ltd. All rights reserved.
Keywords: Finite difference method; Control volume formulation; Truncation errors; Stepwise profile; Piecewise-linear profile; Taylor’s series
www.elsevier.com/locate/compchemeng
1. Introduction
The finite difference method (FDM) is a popularnumerical technique for solving systems of differentialequations that describe mass, momentum, and energybalances. Its development began at the end of the 1940s(Ciarlet & Lions, 1990), and is very well established bynow. In the FDM, the differential equation is approxi-mated by a set of algebraic equations using a Taylor-Series expansion where the accuracy is improved withthe use of more terms in the series and with the use ofsmall grid spacing sizes (i.e. a large number of nodes).The simplicity of this method has made it a very usefultechnique in many different fields. However, it has beenpointed out (Patankar, 1980; West & Fuller, 1996;West, Yang & Debecker, 1995) that the FDM some-times yields unrealistic behavior and that mass is onlyrigorously conserved in the limit when the grid spacinggoes to zero (Patankar, 1980; West & Fuller, 1996). Tocircumvent these situations, some investigators have
used the control volume formulation (CVF, Patankar,1980; West & Fuller, 1996; West et al., 1995). Theorigin of the CVF, or finite volume method (FVM) asit is also known, can be traced to Varga (1965) whorefers to the CVF method as the Integration Method.Varga states that the Integration Method seems to havearisen as a result of numerical investigations of hetero-geneous reactor problems (Stark, 1956; Tikhonov &Samarskii, 1956; Varga, 1957; Marchuk, 1959; Wachs-press, 1960). Davis (1984) recommends the use of theIntegration Method, for interfaces between adjacentregions. Most of the recent applications of the CVF arein computational fluid dynamics (Vijayan &Kallinderis, 1994; Versteeg & Malalasekera, 1995;Moder, Chai, Parthasarathy, Lee & Patankar, 1996;Cordero, De Biase & Pennati, 1997; Baek, Kim & Kim,1998; Noh & Song, 1998; Shahcheragui & Dwyer, 1998;Thynell, 1998; Chan & Anastasiou, 1999; Munz,Schneider, Sonnendrucker, Stein, Voss & Westermann,1999; Sohankar, Norberg & Davison, 1999; Su, Tang &Fu, 1999).
In the CVF method, the differential equation is inte-grated over a control volume and the resultant equationis discretised using some special approximations, which
* Corresponding author. Tel.: +1-803-7773270; fax: +1-803-7778265.
E-mail address: [email protected] (R.E. White).
0098-1354/00/$ - see front matter © 2000 Elsevier Science Ltd. All rights reserved.PII: S0098-1354(00)00619-0
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542634
are discussed further below (see also Patankar, 1980).Since the CVF utilizes integration over small controlvolumes and since the flux of material at the commonface between two adjacent control volumes is repre-sented by the same expression, material is rigorouslyconserved (West & Fuller, 1996).
The objective of this paper is to compare the FDMto the CVF in terms of their accuracy, conservation ofmass, and execution time. A general analysis of errors isused to study the accuracy of the methods. It is shownthat the truncation errors are the same for the approxi-mations of the second and first derivatives for bothmethods in the central nodes (FDM) or internal controlvolumes (CVF). It was reported incorrectly before byothers (Leonard, 1994, 1995; Leonard & Mokhtari,1990) that the truncation errors for the first and secondderivatives obtained for the CVF method are smallerthan that for the FDM. The effect of the boundaryconditions on the accuracy of the solution is also shownin the analysis of errors. Two examples representingdifferent physical situations are treated using the twomethods.
2. Description of the methods
2.1. FDM
The FDM method consists of replacement of contin-uous variables by discrete variables; that is, instead of
obtaining a solution, which is continuous over thewhole domain of interest, the FDM yields values atdiscrete points. In the FDM a differential equation isapproximated by a set of linear algebraic equationsusing a Taylor Series expansion. For nonlinearsystems, after discretisation of the equations, a set ofnonlinear algebraic equations is obtained, which can besolved using Newton’s method (Davis, 1984; White,1987).
Once the equations have been discretised, theresulting set of algebraic equations are solved simulta-neously by using different packages such as Maple,Math-Cad, etc. (Abell & Braselton, 1994; Mathcad7,1997). For this paper, we used the subroutineBAND (J) (Newman, 1967, 1968, 1973a,b) and Maple(Abell & Braselton, 1994) to solve the algebraic equa-tions.
The accuracy of the FDM depends on the fixed gridspacing (the smaller the grid spacing the better theaccuracy), and the number of the terms usedin the Taylor series (the more terms the better theaccuracy). Different discretisations can be used depend-ing on the situation and the accuracy required by theprocess, i.e. high order discretisations have been usedsuccessfully in electrochemical systems (Van Zee,Kleine & White, 1984; Fan & White, 1991). As shownin Fig. 1a, we use the three-point forward, three-pointbackward and three-point central difference approxi-mations for the derivatives (these approximationsyield an accuracy of order (DX)2). More details arereadily available about the FDM (Ciarlet & Lions,1990; Pozrikidis, 1997, 1998). The discretised equationsfor the approximations using FDM are given in Table1.
2.2. CVF
In the CVF the differential equation is integratedover a control volume, and the resultant equation isdiscretised using assumed approximations or profiles(Patankar, 1980; Versteeg & Malalasekera, 1995). Fig.1b shows a typical one dimensional control volume forthe CVF. Integration of the first and second orderderivatives using the control volume shown in Fig. 1byields:& e
w
dfdX
dX=fe−fw (1)
& e
w
d2fdX2 dX=
dfdX
�e−dfdX
�w (2)
The CVF method also yields values at node points.In this case the node points are labeled W, P, and E(see Fig. 1b). Values for f at these node points can beobtained by assuming a profile for f between the node
Fig. 1. Comparison of the FDM and CVF discretisation methods (a)typical discretisation with FDM, (b) typical one-dimensional controlvolume with CVF.
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2635
Table 1Discretised equation of the different models for the derivatives and/or variable using FDM and CVF
Approximation EquationsModel of Method
T1.1−3f1+4f2−f3
2DXFDM
dfdX
(Left boundary)
dfdX
(Right boundary)3fnj−4fnj−1+fnj−2
2DXT1.2FDM
dfdX
(Governing equation) T1.3FDMfj+1−fj−1
2DX
T1.4fj+1−2fj+fj−1
DX2FDM
d2fdX2
(Governing equation)
1
DX
dfdX
�efj+1−fj
DX2T1.5CVF-PLP
1
DX
dfdX
�w T1.6CVF-PLPfj−fj−1
DX2
T1.7fj+1−2fj+fj−1
DX2CVF-PLP
1
DX
dfdX
�e−1
DX
dfdX
�w
CVF-PLPfj+1+fj
2DXT1.8
fe
DX
T1.9fj−1+fj
2DXCVF-PLP
fw
DXfe
DX−
fw
DX
fj+1−fj−1
2DXT1.10CVF-PLP
T1.11fj
DXCVF-SP
fe
DX
CVF-SPfj−1
DXT1.12
fw
DXfe
DX−
fw
DXT1.13CVF-SP
fj−fj−1
DX
points. Fig. 2a shows the results of assuming a stepwiseprofile (SP) and Fig. 2b shows the results for a piece-wise linear profile (PLP). It is important to note thatthe assumed profile for fe and fw can be different fromthat assumed for df/dX�e and df/dX�w. The SP (orupwind) profile is usually used to represent the variable,and the PLP is used to represent the derivative of thevariable. More accurate, higher order discretisationschemes have been used successfully for the CVFmethod (Leonard, 1994, 1995; Leonard & Mokhtari,1990; Johnson & Mackinnon, 1992; Castillo, Hyman,Shashkow & Steinberg, 1995).
In this study, the points ‘W’, ‘P’ and ‘E’ are consid-ered equidistant and the points ‘w’ and ‘e’ are fixed halfway between the points ‘W–P’ and ‘P–E’, respectively(see Fig. 2a); therefore, (DX)e= (DX)w=DX. This as-sumption makes the equations of the CVF comparablewith the discretisations used in the FDM presentedabove. The values used for fe and fw depend on theassumed profile.
fe=fp=fj for SP (3)
fw=fW=fj−1 for SP (4)
fe=fP+fE
2=
fj+fj+1
2for PLP (5)
fw=fP+fW
2=
fj+fj-1
2for PLP (6)
The approximations for the derivatives are obtainedfrom the assumed PLP.
dfdX
�e=fE−fP
DX=
fj+1−fj
DXfor PLP only (7)
dfdX
�w=fP−fW
DX=
fj−fj-1
DXfor PLP only (8)
The discretised equations for the CVF approxima-tions are summarized in Table 1.
When the equation of interest involves time depen-dence (unsteady state), the implicit stepping methodsatisfies the physical behavior of the function, and theresulting equations are very simple (Patankar, 1980).
Fig. 2. Typical profiles use in the control volume formulation.
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542636
The implicit stepping scheme is thus used here and isgiven by& t+Dt
t
f dt=f�t+Dt−f�t (9)
More details about the CVF are available elsewhere(Patankar, 1980; Versteeg & Malalasekera, 1995).
3. Results and discussion
We have divided the results in two sections (1) Trun-cation errors, and (2) examples. In the first section ageneral analysis of the truncation error of the approxi-mations is made in order to analyze the accuracy of thetechniques, and in the second section two examplesrepresenting different physical situations are presentedto compare the FDM and CVF. The examples includean unsteady-state convective diffusion equation (exam-ple 1), and a steady-state heat conduction with a forc-ing function (example 2). Example 1 is used to verifythe mass conservativeness of the methods, and example2 is used to verify the accuracy of the methods whendealing with systems that include multiple regions withinternal boundary conditions.
3.1. Truncation errors
Leonard (1995) claimed that the CVF is more accu-rate than the FDM. He made his claim based onexpressions he derived for the truncation errors for thetwo methods. We will derive truncation error expres-sions for the second and first derivatives for bothmethods and show that the truncation error expressionsare the same for boundary value problems. Conse-quently, the accuracy of the two methods for this caseis the same. We will show that Leonard’s expressionsfor the truncations errors for the CVF are not correct.
The approximation for the first derivative using theFDM is obtained by using Taylor’s series expansion forthe points fj+1 and fj−1 about the point fj.
fj+1=fj+DXf%j +DX2
2!f¦j +
DX3
3!f§j +
DX4
4!fj
IV
+DX5
5!fj
V+… (10)
fj-1=fj−DXfj+DX2
2!f¦j −
DX3
3!f§j +
DX4
4!fj
IV
−DX5
5!fj
V+… (11)
Subtracting Eqs. (10) and (11).
f%j =fj+1−fj-1
2DX−
DX2
6f§j −
DX4
120fj
V−… (12)
Since the first term of the r.h.s. of Eq. (12) is used forthe approximation of the first derivative, the truncationerror for the first derivative is given by
(T.E.)1−FDM= −DX2
6f§j −
DX4
120fj
V−… (13)
The truncation error for the second derivative usingFDM ((T.E.)2−FDM) can be obtained using the sameprocedure as that for the first derivative. The truncationerrors for the first and second derivatives using FDMare summarized in Table 2. When the boundary condi-tions of the problem involve the first derivative of thevariable, a three-point forward or a three-point back-ward approximation can be used for the left and rightboundary, respectively. The approximation for the firstderivative at the left boundary is obtained by usingTaylor’s series expansion for the points f2 and f3
about the point f1. After mathematical manipulation ofthe series expansions is easy to show that.
dfdX
)X=0=f%X=0=
4f2−f3−3f1
2DX+
2DX2
3!f§1
+6DX3
4!f1
IV+… (14)
Taking the first term of the r.h.s. of Eq. (14) for theapproximation of the derivative, the truncation errorfor the first derivative in the left boundary becomes.
(T.E.)3PF−FDM=DX2
3f§1 +
DX3
4f1
IV+… (15)
A similar procedure can be used to obtained thetruncation error for the right boundary ((T.E.)3PB−
FDM), using a Taylor’s series expansion for the pointsfnj−1 and fnj−2 about the point fnj. The truncationerrors for the left and right boundaries are presented inTable 2.
When using the CVF for a system where the firstderivative is involved we get
1DX
& w
e
dfdX
dX=1
DXfe−
1DX
fw (16)
where the DX dividing Eq. (16) is obtained from theother terms in the balance that do not involve a deriva-tive of the variable, as we will show later. Values for(1/DX)fe and (1/DX)fw can be obtained by using thePLP or SP profiles (see Eqs. (3)–(6)).
The truncation error for the approximation of thevariable at the east face (fe) using CVF-PLP can beobtained by using Leonard’s approach (Leonard, 1994,1995). His approach consists of using a Taylor’s seriesexpansion for the points fj+1 and fj about the pointfe, fj−1 about the point fw, and fe and fw about thepoint fj.
fj+1=fe+DX2
f%e+(DX/2)2
2!f¦e +
(DX/2)3
3!f§e
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2637
Table 2Truncation errors of the different models for the derivatives and/or variables using FDM and CVF ((T.E.)V(j)−D(j)). (T.E.)V(j)−D(j) represents thetruncation error due to the discretisation of the variables and/or derivatives at the volume faces as a function of the node points0
ErrorModel of EquationsMethod
dfdX
(Left boundary) (T.E.)3PF−FDM=DX2
3f§j +
DX3
4fj
IV+… T2.1FDM
T2.2(T.E.)3PB−FDM=DX2
3f§j −
DX3
4fj
IV+…FDMdfdX
(Right boundary)
dfdX
(Governing equation) T2.3FDM (T.E.)1−FDM=−DX2
6f§j −
DX4
120fj
V−…
d2fdX2
(Governing equation) (T.E.)2−FDM=−DX2
12fj
IV−DX4
360fj
VI−… T2.4FDM
CVF-PLP T2.5a1
DX
dfdX
�e (T.E)e−PLP,1=−DX
24f§j −
DX2
48fj
IV−11DX3
1920fj
V−13DX4
11520fj
VI−…
CVF-PLP T2.6a1
DX
dfdX
�w (T.E.)w−PLP,1=−DX
24f§j +
DX2
48fj
IV−11DX3
1920fj
V+13DX4
11520fj
VI−…
CVF-PLP T2.7a1
DX
dfdX
�e−1
DX
dfdX
�w (T.E.)e−w,PLP−1=−DX2
24fj
IV−13DX4
5760fj
VI−...
CVF-PLP T2.8afe
DX(T.E)e−PLP,V=−
DX
8f§j −
DX2
16f§j −7
DX3
384fj
IV−DX4
256fj
V−…
fw
DX(T.E.)w−PLP,V=−
DX
8f¦j +
DX2
16f§j −7
DX3
384fj
IV+DX4
256fj
V−… T2.9aCVF-PLP
fe
DX−
fw
DX(T.E.)e−w,PLP-V=−
DX2
8f§j −
DX4
128fj
V−… T2.10aCVF-PLP
T2.11a(T.E.)e−SP=f%j2
+DX
8f¦j +
DX2
48f§j +
DX3
384fj
IV+…CVF-SPfe
DX
fw
DXT2.12aCVF-SP (T.E.)w−SP=
f%j2
−3DX
8f¦j +7
DX2
48f§j −5
DX3
128fj
IV+…
fe
DX−
fw
DX(T.E.)e−w,SP=
DX
2f¦j −
DX2
8f§j +
DX3
24fj
IV+… T2.13aCVF-SP
a Represents (T.E.)7V(j)−D(j).
+(DX/2)4
4!fe
IV+(DX/2)5
5!fe
V+… (17)
fj=fe−DX2
f%e+(DX/2)2
2!f¦e −
(DX/2)3
3!f§e
+(DX/2)4
4!fe
IV−(DX/2)5
5!fe
V+… (18)
fj=fw+DX2
f%w+(DX/2)2
2!f¦w+
(DX/2)3
3!f§w
+(DX/2)4
4!fw
IV+(DX/2)5
5!fw
V+… (19)
fj-1=fw−DX2
f%w+(DX/2)2
2!f¦w−
(DX/2)3
3!f§w
+(DX/2)4
4!fw
IV−(DX/2)5
5!fw
V+… (20)
fe=fj+DX2
f%j +(DX/2)2
2!f¦j +
(DX/2)3
3!f§j
+(DX/2)4
4!fj
IV+(DX/2)5
5!fj
V+… (21)
fw=fj−DX2
f%j +(DX/2)2
2!f¦j −
(DX/2)3
3!f§j
+(DX/2)4
4!fj
IV−(DX/2)5
5!fj
V+… (22)
Adding Eqs. (17)–(20) yields
fe=(fj+1+fj)
2−
DX2
8f¦e −
DX4
384fe
IV−… (23)
fw=(fj+fj-1)
2−
DX2
8f¦w−
DX4
384fw
IV−… (24)
Taking the derivatives of Eq. (21) respect to X (sec-ond and fourth derivatives), substituting into Eq. (23)and dividing the expression by DX yields.
fe
DX=
(fj+1+fj)2DX
−DX8
f¦j −DX2
16f§j −… (25)
Taking the first term of the r.h.s of Eq. (25) as theapproximation for the variable at the east face, theerror for this approximation using CVF-PLP ((T.E.)e−
PLP,V) becomes
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542638
(T.E.)e−PLP,V= −DX8
f¦j −DX2
16f§j −7
DX3
384fj
IV
−DX4
256fj
V−… (26)
The truncation error for the approximation of thevariable at the west face using CVF-PLP ((T.E.)w−
PLP,V) can be obtained by taking the derivatives of Eq.(22) respect to X (second and fourth derivatives), sub-stituting into Eq. (24) and dividing the expression byDX. The equations for the truncation errors of thevariables using CVF-PLP are given in Table 2.
A similar procedure can be used to obtain the trunca-tion error for the approximations of the variable at theeast and west faces using CVF-SP ((T.E.)e−SP and((T.E.)w−SP, respectively). Also, Leonard’s approachcan be extended to obtain the truncation errors for theapproximation of the first derivative at the east andwest faces using CVF (T.E.)e−PLP,1 and (T.E.)w−PLP,1).All these equations are summarized in Table 2.
According to the approximations obtained for thevariables evaluated at the east and west faces (Eqs. (23)and (24)) Eq. (16) becomes:
1DX
& w
e
dfdX
dX=1
DXfe−
1DX
fw=fj+1−fj-1
2 DX
+ (T.E.)e−w,PLP-V (27)
where the truncation error for the approximation of thevariable at the east face minus the approximation of thevariable at the west face using CVF-PLP ((T.E.)e−
w,PLP−V) is obtained by subtracting Eq. T2.9 fromEq. T2.8:
(T.E.)e−w,PLP-V= −DX2
8f§j −
DX4
128fj
V−… (28)
Since Leonard stated that Eq. (16) is exact (Leonard,1995), the truncation error for the approximation of thevariable at the east face minus the approximation of thevariable at the west face represents the truncation errorof the CVF-PLP method:
(T.E.)CVF-PLP= (T.E.)e−w,PLP-V (29)
The first term of the r.h.s. of Eq. (12) represents thediscretised equation for the first derivative used in theFDM (Eq. T1.3), while the first term of the r.h.s. of Eq.(27) is the expression used for the first derivative in theCVF-PLP (Eq. T1.10). As one can see both terms arethe same (Eqs. T1.3 and T1.10 in Table 1); therefore,for fixed boundary node values the FDM and theCVF-PLP will yield to the same solution. Since bothmethods yield to the same expression for the firstderivative, their accuracy and their truncation errorsmust be the same. However, according to the trunca-tion errors, the CVF-PLP (see Eqs. (28) and (29)) willbe more accurate than the FDM (see Eq. (13)). It isimportant to know that this conclusion is not correct
and both truncation errors should be the same. Theinconsistency in the truncation errors is due to the factthat Eq. (16) represents the exact solution at the volumefaces but not at the node points needed.
This same problem exists for Leonard’s truncationerror expression for the second derivative. This can beseen by subtracting Eq. T2.6 from Eq. T2.5 whichyields (compare to Eq. A-60 in Leonard, 1995).
(T.E.)CVF-PLP= −DX2
24fj
IV−13
5760DX4 fj
VI (30)
According to Eq. (30) the truncation error for thesolution of a second order differential equation usingCVF-PLP is smaller than the truncation error usingFDM (see Eq. T2.4), which is not true as we explainnext. The equations for the approximation associatedwith Eq. (30) are.
1DX
& e
w
d2fdX2 dX=
1DX
�dfdX
�e−dfdX
�w�=fj+1−2fj+fj-1
DX2
(31)
Eq. (31) yields the same approximation that theFDM yields for the second derivative evaluated at thenode ‘j ’ (see Eq. T1.4). Note that the approximationsfor the solution of a second order differential equationusing both methods are the same (compare Eqs. T1.4and T1.7). Since the equations for the approximationsare the same, the truncation errors must be the same.The truncation error represented by Eq. (30) includesthe truncation errors associated with expressing the firstderivatives at the east and west faces as a function ofthe nodes j, j+1, and j−1. That is, Eq. (30) containsonly the truncation errors for the derivatives evaluatedat the faces of the control volume. However, the solu-tion of the problem is required at the node points andnot at the faces of the control volume; therefore thetruncation error of interest is that associated with thenode points. To determine this truncation error, theapproximation that the CVF method uses for the inte-gral of the variable over the control volume formula-tion will be used (generally used for representing sourceterms in the balances). According to the CVF theintegration of the variable over the control volume isapproximated by (Patankar, 1980; Leonard, 1995):& e
w
f dX:fjDX (32)
where it is assumed that the value of the dependentvariable evaluated at node point ‘j’ times DX is equal tothe integral of the variable from ‘w’ to ‘e’. This assump-tion is true because the mean-value theorem for integralcalculus states that if a function is continuous on theclosed interval [w, e], there is a number j, with w5j5e, such that.
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2639& e
w
f dX=f(j)DX (33)
Choosing j=Xj is an approximation. By analogywith Eq. (32) the integral of the second derivative overthe control volume followed by applying the mean-value theorem of integral calculus yields.& e
w
d2fdX2 dX=f¦j DX (34)
Again, the evaluation of f¦ at Xj and not at j is anapproximation. An approximation for f¦j can be ob-tained by taking the derivatives of Eqs. (21) and (22)respect to X, subtracting the results and rearranging.
f¦j =1
DX(f%e−f%w)−
DX2
24fj
IV−DX4
1920fj
VI−… (35)
Eq. (35) shows the differences between the secondderivative evaluated at the node point and thegradient of the first derivative between the east andwest faces of the control volume. This equation indi-cates that evaluating the difference of the first deriva-tives at the east and west faces should over-predict theresults obtain by evaluating the second derivative at thenode point.
Substituting Eq. (35) into Eq. (34) followed by rear-rangement yields:
1DX
& e
w
d2fdX2 dX=
1DX
�dfdX
�e−dfdX
�w�+ (T.E.)D−e,w� j
(36)
where (T.E.)D−e,w� j represents the truncationerror associated with the derivatives evaluated at thefaces of the control volume (east and west), and it isgiven by.
(T.E.)D−e,w� j= −DX2
24fj
IV−DX4
1920fj
VI−… (37)
Finally, the truncation error for the approximationof the second derivative using CVF-PLP can be ob-tained by adding Eqs. (37) and (30) which yields:
(T.E.)CVF-PLP= −DX2
12fj
IV−DX4
360fj
VI−… (38)
which is the same as the truncation error for the secondderivative using FDM (see Table 2, Eq. T2.4).
To demonstrate the validity of Eq. (38) and that Eq.(30) is wrong, consider the following simple system. Arectangular bar enclosed in a vacuum environmentwith a heat consumption source. The governing equa-tion is
d2TdX2=b1T (39)
where b1 is a dimensionless parameter. To eliminate theeffect of the truncation errors of the boundary condi-
tions, we assume that the boundary temperatures areknown:
T=Tleft at X=0 (40)
T=Tright at X=1 (41)
The analytical solution is given by:
T=[Tright−Tleft cosh b1]
sinhb1
sinh(b1X)
+Tleft cosh(b1X) (42)
The discretised equations for Eq. (39) using the FDMand CVF in this case are the same; therefore thenumerical solution obtained by the two methods will bethe same. The equations were solved for 6 nodes (nj=6). We developed a technique that allows calculatingthe values of the truncation errors from the numericalsolution when the analytical solution is known. Detailsfor the derivation of this technique are given in theAppendix A. The advantage of the technique is that itallows: 1. Calculating the total truncation error, 2.Calculating and evaluating the effect of the round-offerrors, and 3. Verifying the values obtained for thetheoretical truncation errors, i.e. using Taylor’s seriesexpansion. The discretised equations were solved usingMaple V and the truncation errors were calculatedusing the technique proposed in the Appendix A. Someimportant results are summarized below for b1=1,Tleft=350°C, and Tright=200°C:
T=
ÁÃÃÃÃÃÃÃÄ
350.000
298.761
259.512
230.679
211.103
200.000
ÂÃÃÃÃÃÃÃÅ
TFDM-CVF=
ÁÃÃÃÃÃÃÃÄ
350.000
298.826
259.604
230.767
211.160
200.000
ÂÃÃÃÃÃÃÃÅ
TE=
ÁÃÃÃÃÃÃÃÄ
0.000
−0.997
−0.866
−0.769
−0.707
0.000
ÂÃÃÃÃÃÃÃÅ
(T.E.)FDM=
ÁÃÃÃÃÃÃÃÄ
0.000
−0.997
−0.866
−0.769
−0.705
0.000
ÂÃÃÃÃÃÃÃÅ
(T.E.)CVF-PLP (Eq.30)=
ÁÃÃÃÃÃÃÃÄ
0.000
−0.499
−0.433
−0.385
−0.352
0.000
ÂÃÃÃÃÃÃÃÅ
where T, TFDM-CVF, TE, (T.E.)FDM, and (T.E.)CVF-
PLP(Eq. (30)), represent the analytical solution vector,
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542640
the numerical solution vector, the truncation error vec-tor calculated from the numerical solution, the trunca-tion error vector for the FDM calculated from Eq.T2.4, and the truncation error vector predicted by usingLeonard’s approach (i.e. calculated from Eq. (30)),respectively. The truncation errors predicted by Eq.T2.4 which is the same as Eq. (38) match well thetruncation errors obtained from the numerical solution(compare TE to (T.E.)FDM). As expected, the truncationerrors predicted by Leonard’s approach (Eq. (30)) donot agree with the calculated truncation errors (com-pare TE to (T.E.)CVF-PLP(Eq. (30)). Again, the calculatedtruncation errors (TE) agree well with the predictedtruncation errors obtained from Eq. (38), which is thesame equation as T2.4), and disagree significantly withthose predicted by Leonard’s Eq. (30). This showsclearly that the truncation errors are the same for thetwo methods (FDM and CVF). The truncation errorfor the CVF method is not smaller than that for the
FDM as claimed by Leonard. Note that Eq. (38) can beobtained by adding Eq. T3.2 to Eq. (30).
Truncation errors for other equations using the CVFcan be calculated by
(T.E.)CVF= (T.E.)V(j)−D(j)+ (T.E.)V,D� j (43)
where the first term in the r.h.s. of Eq. (43) representsthe truncation error associated with expressing the vari-ables and/or the derivatives as a function of the nodepoints (discretisation), and the second term representsthe truncation error caused by solving the algebraicequations at the node points and not at the volumefaces. Expressions for (T.E.)V(j)−D(j) are given in Table2 and typical expressions for (T.E.)V,D� j are presentedin Table 3. For instance, to calculate the truncationerror of 1/DX e
w df/dX×dX=1/DX(f�e−f�w) usingPLP, Eqs. T2.10 ((T.E.)V(j)−D(j)) and T3.1 ((T.E.)V,D� j)should be added; therefore the total truncation errorfor this case would be.
Table 3Truncation error in the CVF caused by solving the algebraic equations at the node points and not at the volume faces ((T.E.)V,D� j)
Used for Equations(T.E.)V,D� j
1
DXe
w
dfdX
dX=1
DX(fe−fw) T3.1
(T.E.)V−e,w� j=−DX2
24f§j −
DX4
1920fj
V−…
1
DXe
w
d2fdX2
dX=1
DX
�dfdX
�e−dfdX
�w�
T3.2(T.E.)D−e,w� j=−
DX2
24fj
IV−DX4
1920fj
VI−…
2
DXiil
Bl
dfdX
dX=2
DX(fiil
−fBl) T3.3*
(T.E.)V−l� j=−DX2
96f§j −
DX3
384fj
IV−DX4
3072fj
V−…
T3.4**2
DXBr
iir
dfdX
dX=2
DX(fBr
−fiir)
(T.E.)V−r� j=−DX2
96f§j +
DX3
384fj
IV−DX4
3072fj
V+…
T3.5*2
DXiil
Bl
d2fdX2
dX=2
DX
�dfdX
�iil−dfdX
�Bl
�(T.E.)D−l� j=−
DX2
96fj
IV−DX3
384fj
V−DX4
3072fj
VI−…
T3.6**2
DXBr
iir
d2fdX2
dX=2
DX
�dfdX
�Br−
dfdX
�iir�
(T.E.)D−r� j=−DX2
96fj
IV+DX3
384fj
V−DX4
3072fj
VI+…
fe+fw
2T3.7
(T.E.)V,e+w� j=−DX2
8f¦j −
DX4
384fj
IV−…
T3.81
2
�dfdX
�e+dfdX
�w�
(T.E.)D,e+w� j=−DX2
8f§j −
DX4
384fj
V−…
fBr+fiir
2T3.9*
(T.E.)V,Br+iir� j=−DX2
32f¦j +
DX3
128f§j −…
fBl+fiil
2T3.10**
(T.E.)V,Bl+iil� j=−DX2
32f¦j −
DX3
128f§j −…
1
2
�dfdX
�Br+
dfdX
�iir�
T3.11*(T.E.)D,Br+iir� j=−
DX2
32f§j +
DX3
128fj
IV−…
1
2
�dfdX
�Bl+
dfdX
�iil�
T3.12**(T.E.)D,Bl+iil� j=−
DX2
32f§j −
DX3
128fj
IV−…
T3.13*2
DXiil
Blf dX=fl (T.E.)V−l�1=
DX
4f%1+
DX2
32f¦1+
DX3
384f§1 +…
T3.14**2
DXBr
iir f dX=fr (T.E.)V−r�nj=−DX
4f%nj+
DX2
32f¦nj−
DX3
384f§nj+…
* Approximate value, the value is assumed to be located at 1+1/4 (j=X1+DX/4)).** Approximate value, the value is assumed to be located at nj−1/4 (j=Xnj−DX/4)).
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2641
Fig. 3. Treatment of the boundary conditions in example 1 using thecontrol volume formulation.
3.1.1. Boundary conditionsThe solution of the problem will depend on the
boundary conditions; therefore, in order to complete theanalysis of truncation errors of a problem, the trunca-tion errors of the approximations used for the boundaryconditions should be included. We can have three differ-ent kinds of boundary conditions: Dirichlet, in which thevalue of the variable is given; Neumann, in which thevalue of the first derivative is known; and Robin that isa combination of Dirichlet and Neumann boundaryconditions. Knowing this, we can have different combi-nations at the two boundaries (1) Dirichlet at bothboundaries, (2) Dirichlet at one boundary and Neumannat the other, (3) Robin at one boundary and Dirichlet atthe other, and (4) Robin at both boundaries, and (5)Neumann at both boundaries. It is worth noting thatNeumann conditions at both boundaries cannot besolved for a steady state problem because infinite manysolutions exist for such a case.
When both boundary conditions are of the Dirichletkind, the error of the approximation of the system isdefined by the error of the approximations used in thegoverning equation as we have shown above. The trun-cation errors for other kinds of boundary conditionsusing FDM can be obtained from Table 2.
The truncation errors at the boundaries using CVFmethod need to be derived. The methodology explainedabove can be used to determine the truncation errorsassociated with the boundary conditions for the CVFmethod by applying the mean-value theorem of integralcalculus at the middle point of half of a control volume.This assumption is based on the methodology used bythe CVF to treat source terms as shown in Eq. (32).According to Eq. (32) the variable is evaluated at the ‘j’node that corresponds with the center of the controlvolume for the central control volumes (see Fig. 1b). Inthe same way, when applying the mean-value theorem ofintegral calculus at the boundaries, the variable shouldbe evaluated at the center of the control volume, that isat X=DX/4 for the left boundary (see Fig. 3a) andX=1− (DX/4) for the right boundary (see Fig. 3b). Forexample, consider applying the mean value theorem forthe second derivative of the variable over the halfcontrol volume shown in Fig. 3b (at X=1):& Br
iir
d2fdX2 dX=f¦nj−1/4
DX2
(49)
where f¦ is evaluated at the center of the half controlvolume. Eq. (49) is an approximation where j=Xj−(DX/4) (i.e. nj−1/4) was assumed. Expanding fBr
andfiir
about fnj−1/4 using Taylor’s series expansions yields.
fBr=fnj−1/4+
DX4
f%nj−1/4+(DX/4)2
2!f¦nj−1/4
+(DX/4)3
3!f§nj−1/4+
(DX/4)4
4!fnj−1/4
IV +… (50)
(T.E.)CVF-PLP= −DX2
6f§j −
DX4
120fj
V−… (44)
Eq. (44) is the same as the truncation error for thefirst derivative using FDM (see Eq. T2.3). The valuesfor (T.E.)V,D� j will depend on the case study; theequations shown in Table 3 can be used as a basis fromwhich to derive other cases. For example, the procedureto calculate the truncation error for CVF in cylindricalcoordinates is given next. The equation for the centralnodes in cylindrical coordinates is given by:
1DX
& e
w
ddX
�X
dfdX
�dX=
1DX
�Xe
dfdX
�e−Xw
dfdX
�w� (45)
where Xe=Xj+ (DX/2) and Xw=Xj+ (DX/2). Eq. (45)is not directly represented in Table 3; however, it can berearranged to use the expressions given in Table 3.Substituting Xe and Xw into Eq. (45) and rearranging.
1DX
�Xe
dfdX
�e−Xw
dfdX
�w�=Xj
DX�df
dX�e−
dfdX
�w�+
12�df
dX�e+
dfdX
�w� (46)
The error associated with the first term on the r.h.s.of Eq. (46) is given by Eq. T3.2 (Table 3) while theerror for the second term is given by Eq. T3.8,therefore:
1DX
& e
w
ddX
�X
dfdX
�dX=
1DX
�Xe
dfdX
�e−Xw
dfdX
�w�+ (T.E.)Cyl−e,w� j (47)
where the truncation error associated with the approxi-mation of the derivative evaluated at the node j by thederivatives evaluated at the faces of the control volumefor cylindrical coordinates is given by.
(T.E.)Cyl−e,w� j= −DX2
8�f§j +
Xj
3fj
IV�−
DX4
384�fj
V+Xj
5fj
VI�−… (48)
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542642
fiir=fnj−1/4−
DX4
f%nj−1/4+(DX/4)2
2!f¦nj−1/4
−(DX/4)3
3!f§nj−1/4+
(DX/4)4
4!fnj−1/4
IV −… (51)
Subtracting Eq. (51) from Eq. (50) and rearrangingyields.
f¦nj−1/4=2(f%Br
−f%iir)DX
−DX2
96fnj−1/4
IV −… (52)
Expanding fnj−1/4 about fnj and taking the requiredderivatives of the expansion with respect to X, gives
fnj−1/4IV =fnj
IV−DX4
fnjV +
DX2
32fnj
VI−DX3
384fnj
VII+…
(53)
Substituting Eqs. (53) and (52) into Eq. (49) andrearranging yields:
2dX
& Br
iir
d2fdX2 dX=2
(f%Br−f%iir)DX
+ (T.E.)D−r�nj (54)
where the error associated with evaluating the variableat the middle point of the half control volume is givenby.
(T.E.)D−r�nj= −DX2
96fnj
IV+DX3
384fnj
V −DX4
3072fnj
VI+…
(55)
Using the same procedure, truncation errors relatedto the variables in the boundary conditions can becalculated, these errors are summarized in Table 3 (Eqs.T3.13 and T3.14 for the left and right boundary,respectively).
In order to illustrate how to analyze the accuracy ofthe methods including the boundary conditions a sim-ple problem is solved. Consider a rectangular fin asdescribed by Davis (1984). The equations that describethis system are given by:
d2TdX2=H2(T−Ta) (56)
T=Tleft at X=0 (57)
dTdX
=0 at X=1 (58)
where H is a parameter, and Ta is the ambient temper-ature. The discretised equations for this system are:
� for 2B jBnj:fj+1−2fj+fj-1
DX2
=H2(fj−Ta) for the FDM and CVF (59)
� j=nj:3fnj−4fnj−1+fnj−2
2DX=0 for the FDM
(60)
To obtain the discretised equation for the right
boundary using the CVF-PLP method, Eq. (56) needsto be integrated over the half of control volume shownin Fig. 3b:& Br
iir
d2TdX2 dX=
& Br
ii r
H2(T−Ta)dX (61)
then
dTdX
�Br−
dTdX
�iir=H2(T−Ta)DX2
(62)
where T( is the control volume average temperature.The derivative of the temperature at the right boundaryis known (dT/dX�Br
=0 from boundary condition Eq.(58)). The first derivative at the internal interface (iir)and the control volume average temperature need to bediscretised. The PLP profile is used to discretise thederivative evaluated at the internal interface (see Eq.T1.6) and the control volume average temperature isapproximated with the variable evaluated at the nodepoint ‘nj’. The discretised equation for the rightboundary using CVF-PLP represented with the discre-tised variable f is given by.
−2(fnj−fnj−1)
DX2 =H2(fnj−Ta) (63)
The truncation errors for the central nodes for bothmethods (CVF and FDM) are the same for this case,and they are given by.
(T.E.)FDM= (T.E.)CVF-PLP= −DX2
12fj
IV
−DX4
360fj
VI−… for central nodes (64)
Therefore, the differences in the solutions betweenthe two methods depend on the approximations usedand the truncation errors for the right boundary. Thetruncation errors for the right boundary are given by.
(T.E.)3PB-FDM=DX2
3f§j −
DX3
4fj
IV+…
for the FDM (65)
The total truncation error for Eq. (63) (using CVF-PLP) can be obtained by subtracting two times Eq.T2.6 from Eq. (55). As it was mentioned before thecontrol volume average temperature was approximatedwith the temperature evaluated at the node point nj,therefore, the error associated with this approximationshould also be incorporated in the total truncationerror. The truncation error for the average of thevariable ((T.E.)V−r� j) is given by Eq. T3.14. Thereforethe total truncation error associated with Eq. (63)(using CVF-PLP) is given by.
(T.E.)CVF-PLP= −2(T.E.)w−PLP,1+ (T.E.)D−r� j
−H2(T.E.)V−r� j (66)
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2643
Thus,
(T.E.)CVF-PLP=DX12
f§j −DX2
24fj
IV+11DX3
960fj
V
−DX2
96fj
IV+DX3
384fj
V−H2
�−
DX4
f%j +DX2
32f¦j −
DX3
384f§j
�(67)
The truncation error for the right boundary conditionusing FDM is order (DX)2 (see Eq. (65)), while thetruncation error for the CVF-PLP is order (DX) (see Eq.(67)). In addition, the truncation error for the CVF-PLPright boundary is a direct function of the dimensionlessparameter H, while for the FDM is only an indirectfunction through the derivatives of the variable.
The analytical solution for Eqs. (56)–(58) is given by:
T=Ta+(Tleft−Ta)cosh[H(1−X)]
cosh(H)(68)
The discretised equations were solved using Maple.The solution was obtained for Ta=25°C, Tleft=200°C,and H=1. The temperature profile is affected by thevalue of the dimensionless parameter H as shown by Eq.(68). The larger H the larger the heat transfer to theambient and the steeper the profile of the temperature atthe beginning of the fin. The truncation errors for bothmethods are also affected by the value of H. In the caseof the FDM, the truncation errors at the central nodesand at the right boundary are affected indirectly by Hthrough the derivatives of the variable (see Eqs. (64) and(65)). In the case of the CVF method, the truncationerrors are affected indirectly by H through the deriva-tives of the variable at the central nodes and rightboundary node (see Eqs. (64) and (67)), and they are alsodirectly affected by H at the right boundary node (seeEq. (67)). Numerical solutions were calculated for nj=6.Important results are given next (ten significant figureswere used for the calculations; however, the results aresummarized here with two significant figures):
T=
ÁÃÃÃÃÃÃÃÄ
200.00
176.68
159.44
147.60
140.69
138.41
ÂÃÃÃÃÃÃÃÅ
TFDM=
ÁÃÃÃÃÃÃÃÄ
200.00
176.71
159.48
147.63
140.69
138.38
ÂÃÃÃÃÃÃÃÅ
TCVF=
ÁÃÃÃÃÃÃÃÄ
200.00
176.74
159.54
147.73
140.82
138.55
ÂÃÃÃÃÃÃÃÅ
TEFDM=
ÁÃÃÃÃÃÃÃÄ
0.0000
−0.5063
−0.4487
−0.4092
−0.3861
−0.2283
ÂÃÃÃÃÃÃÃÅ
TECVF=
ÁÃÃÃÃÃÃÃÄ
0.0000
−0.5063
−0.4487
−0.4092
−0.3861
−0.3785
ÂÃÃÃÃÃÃÃÅ
(T.E.)FDM=
ÁÃÃÃÃÃÃÃÄ
0.0000
−0.5063
−0.4487
−0.4092
−0.3861
−0.2283
ÂÃÃÃÃÃÃÃÅ
(T.E.)CVF=
ÁÃÃÃÃÃÃÃÄ
0.0000
−0.5063
−0.4487
−0.4092
−0.3861
−0.3780
ÂÃÃÃÃÃÃÃÅ
where T represents the analytical solution vector, TFDM,and TCVF represent the numerical solution vectors usingthe FDM and the CVF, respectively. TEFDM and TECVF
represent the total truncation error vectors for the twodifferent methods calculated using Eq. A15, (T.E.)FDM isthe truncation error vector for the FDM predicted usingEqs. (64) and (65), and (T.E.)CVF is the truncation errorvector for the CVF predicted using Eqs. (64) and (67).
The results shown above indicate that the truncationerrors predicted for the CVF and FDM agree very wellwith the exact one calculated using Eq. A15. Thedeviation between the truncation error predicted for theCVF at the last node and the exact one is due to theapproximations made during the derivation of Eq. (67).Using a larger number of nodes would reduce thisdeviation. The results shown above demonstrate theutility of the methodology used here to estimate thetruncation errors for both methods including the effectof the boundary conditions. Additionally, the resultsdemonstrate that the truncation error at the rightboundary using FDM is order (DX)2 whereas for theCVF method is order (DX). The analysis of theboundary conditions has shown that the order of accu-racy for the CVF-PLP method is reduced by one at theboundary respect to the central nodes. That is thetruncation error at the right boundary for the CVF-PLPis order (DX) whereas is order (DX)2 for the centralnodes. The same can be concluded for the CVF-SPmethod, therefore when using this method the trunca-tion error at the boundary for a Robin type boundarycondition will be order (DX)0.
4. Examples
4.1. Example 1: unsteady-state con6ecti6e diffusionequation
The purpose of this example is to evaluate the conser-vation of mass in the system using the FDM, and CVF.
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542644
Consider a closed isothermal system (tank) containingtwo components, A and B. Component B is a gas andis insoluble in liquid A. Liquid A is allowed to evapo-rate slowly into gas B so the liquid level remainsconstant; after some time the system reaches equi-librium with the concentration of A in the gas phase at45 gmol/m3. Suddenly the top of the tank is removedgiving rise to a uniform exit flow of ‘A’ that is equal tothe evaporating flux of ‘A’. Accordingly, the averageconcentrations of components ‘A and ‘B’ over thevolume remain constant with time. The equations thatdescribe this situation, assuming flow only in the ‘X’direction are:
(Ca
(t=
Dab
L2
(2Ca
(X2 −nL(Ca
(X(69)
Ca=Ca0 at t=0 Ö X (70)
Na=−Dab
L(Ca
(X+nCa at X=0 Ö t\0 (71)
Na=−Dab
L(Ca
(X+nCa at X=1 Ö t\0 (72)
where X=x/L. There is no closed-form analytical solu-tion for this problem; nevertheless, because of the con-servation of mass, the overall concentration of ‘A’should be constant, and this constraint can be used tocompare the two methods. The average concentration isgiven by the equation:
Ca,avg=& 1
0
Ca(X)dX (73)
where Ca,avg=Ca0 due to conservation of mass.In the FDM, Eqs. (69)–(72) were discretised accord-
ing to Fig. 1. In the CVF, the equations were discre-tised according to the profiles shown in Fig. 2, with SPused for the variable and PLP used for the variable orthe derivative. Fig. 3 shows the application of the CVFat the boundaries. According to the discretisation pro-cedure, the left boundary is located at position Bl(j=1in the discretisation) and the right boundary at positionBr(j=nj in the discretisation, see Fig. 3). Since theboundaries are the limits (spatial in this case), the massbalance has to be performed in half of the controlvolume, yielding with an internal interface between theboundary Bl and the internal left node Il called iil (seeFig. 3); in the same way the internal interface of theboundary of the right (Br) is called iir (see Fig. 3).According to the CVF, the integral mass balance in theleft boundary over half of the control volume yields.& iil
Bl
& t+Dt
t
(Ca
(tdt d X= −
1L& iil
Bl
& t+Dt
t
(Na
(Xdt dX (74)
Solving the internal integral of the l.h.s. of Eq. (74),
and assuming that the value of Ca at Bl prevailsthroughout the half control volume:& iil
Bl
& t+Dt
t
(Ca
(tdt dX= (Ca�t+Dt,Bl
−Ca�t,Bl)DX2
(75)
For the r.h.s of Eq. (74), assuming that the value of(Na/(X at t+Dt prevails throughout the time interval,and solving.
−1L& iil
Bl
& t+Dt
t
(Na
(Xdt dX= −
DtL
(Na�t+Dt,iil−Na�t+Dt,Bl
)
(76)
Substituting Eqs. (75) and (76) into Eq. (74) andrearranging.
(Ca�t+Dt,Bl−Ca�t,Bl
)Dt
= −2
LDX(Na�t+Dt,iil
−Na�t+Dt,Bl)
(77)
The flux of species ‘A’ at any position can be evalu-ated using the equation.
Na=−Dab
L(Ca
(X+nCa (78)
Evaluating Eq. (78) at the internal interface andsubstituting it into Eq. (77).
(Ca�t+Dt,Bl−Ca�t,Bl
)Dt
=
−2
LDX�
−Dab
L(Ca
(X�t+Dt,iil
+nCa�t+Dt,iil−Na�t+Dt,Bl
�(79)
Using the same procedure the equation for the rightboundary can be obtained. The derivative terms in Eq.(79) can be approximated using PLP and the concentra-tion terms can be approximated using not only PLP butalso with SP. The discretised equations for both meth-ods are compared in Table 4. The equations weresolved using Newman’s BAND(J) subroutine. Theparameters used are given in Table 5.
Note that in Table 4 equation E.1.2a is the same thatequation E.1.2b (both accurate to order DX2+Dt);thus, the discretised governing equation is the same forthe FDM and the CVF-PLP method. However, theequations given for the boundary conditions are differ-ent, this is because the boundary conditions in the CVFare obtained with a mass balance whereas those for theFDM are obtained by discretising Eqs. (71) and (72).An analysis of the accuracy of the methods can beperformed as explained in the previous section. Therewas not significant difference in the computational timerequired by the two methods.
Fig. 4 presents the numerical solution for example 1.Fig. 4a shows the variation of the concentrationthrough the tank at t=20 s (with nj=6 and Dt=2 s)using the two methods. The profiles given by all ofthem have the same behavior, i.e. the concentration
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2645
Table 4Comparison of the discretised equations, presented in functional form for programming (White, 1987), used for the FDM and CVF in example1a
Discretised equation EquationsMethod Region
j=1FDMF(1)=Na�X=0−nf1,j+
Dab
L
�−3f1,j+4f1,j+1−f1,j+2
2DX
�E1.1a
1BjBnjE1.2aF(1)=
Dab
L2
�f1,j+1−2f1,j+f1,j−1
DX2
�−
nL
�f1,j+1−f1,j−1
2DX
�−
f1,j
Dt+
fN1,j
Dt
j=njF(1)=Na�X=1−nf1,j+
Dab
L
�3f1,j−4f1,j−1+f1,j−2
2DX
�E1.3a
j=1CVF-PLPF(1)=
2
LDX
!Na�X=0+
Dab
L
�f1,j+1−f1,j
DX
�−n
�f1,j+1+f1,j
2
�"−
f1,j
Dt+
fN1,j
DtE1.1b
1BjBnjE1.2bF(1)=
Dab
L2
�f1,j+1−2f1,j+f1,j−1
DX2
�−
nL
�f1,j+1−f1,j−1
2DX
�−
f1,j
Dt+
fN1,j
Dt
j=njF(1)=−
2
LDX
!Na�X=1+
Dab
L
�f1,j−f1,j−1
DX
�−n
�f1,j+f1,j−1
2
�"−
f1,j
Dt+
fN1,j
DtE1.3b
j=1CVF-SPF(1) =
2
LDX
!Na�X=0+
Dab
L
�f1,j+1−f1,j
DX
�−nf1,j
"−
f1,j
Dt+
fN1,j
DtE1.1c
1BjBnjE1.2cF(1)=
Dab
L2
�f1,j+1−2f1,j+f1,j−1
DX2
�+
nL
�f1,j−1−f1,j
DX
�−
f1,j
Dt+
fN1,j
Dt
j=njE1.3cF(1)=
2
LDX
!−Na�X=1−
Dab
L
�f1,j−f1,j−1
DX
�+nf1,j−1
"−61,j
Dt+
fN1,j
Dta The equations used for the CVF were adapted to use the BAND(J) subroutine (Newman, 1973a). Where F(1)=0 and fN1,j represents the
value of the variable at the previous time (t−Dt).
decreases with the distance. The change of the concentra-tion with the distance is due to the gradient of concen-tration caused by the fluxes at the entrance and exit ofthe tank. Fig. 4b shows the overall mass balance in thetank using the two methods at different times with Dt=2s. The average concentration was obtained by solvingnumerically Eq. (73) using the trapezoid rule for integra-tion; and due to conservation of mass it should stayconstant at 45.0 gmol/m3. However, for the FDM theaverage concentration decreases with time for nj=6 and21; and it becomes mass conservative only when nj=41or larger. The FDM also exhibited this behavior forsmaller values of Dt (the mass balance was not signifi-cantly affected by Dt). In contrast, the CVF (for both SPand PLP) is mass conservative independently of thenumber of spatial nodes (nj) or the time step (Dt). Thisfact is due to the difference in how the methods deal withthe boundary conditions. In the CVF the boundaryconditions are incorporated into the governing equationwhile in the FDM they are not. This example demon-strates that mass conservation can be achieved with fewernode points when using the CVF than when using theFDM, when both boundary conditions are given as a flux(Robin type at both boundaries). The same conclusionfollows for Neumann type boundary conditions.
4.2. Example 2: steady-state heat conduction with aforcing function
The purpose of this example is to evaluate the accuracy
of the FDM and CVF when an additional flux boundarycondition is used in the system due to its heterogeneity.Heat conduction in a nuclear fuel rod assembly isrepresented in dimensionless variables by the followingequation and boundary conditions (Bird, Stewart &Lightfoot, 1960):
(
(R
�RKf
(T(R
�+SoRRc
2�1+b�RcR
Rf
�2n=0
at 0BRB0.75 (80)
(
(R
�RKc
(T(R
�=0 at 0.75BRB1.0 (81)
Table 5Parameters used in examples 1 and 2
Example Parameter UnitsValue
1 Gmol/m345.0Ca0
Dab 1×10−5 m2/sL 1×10−1 Mn 1×10−6 m/sNa (at X=0 & 9×10−3 Gmol/m2 sX=1)Kc 0.640 Cal/s °C cm2Kf 0.066 Cal/s °C cm
Cm0.9525Rf
Rc 1.27 CmTl 500 °Cb 0.1 Dimensionless
Cal/s cm350So
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542646
Fig. 4. Numerical solutions for example 1 from the FDM and CVF(a) variation of the concentration through the tank at t=20 s(nj=6); (b) overall mass balance in the tank (Dt=2 s).
& e
w
(
(R
�RKf
(T(R
�dR+
& e
w
SoRRc2�1+b
�RcR
Rf
�2ndR=0
(87)
Kf
DR
�Re
dTdR
)e−Rw
dTdR
�w�+SoRjRc2�1+b
�RcRj
Rf
�2n=0
(88)
where Re=Rj+DR/2 and Rw=Rj−DR/2. The dis-cretised equations when 0.75BRB1.0 are obtained inthe same way but integrating Eq. (81). At the interfaceEq. (80) is integrated from ‘e’ to ‘j’ (half of the controlvolume) and Eq. (81) is integrated from ‘j’ to ‘w’, thediscretised equation at this node is obtained by addingboth results. The discretised equations for this exampleare given in Table 6. In all the cases, the discretisedequations were solved using Maple V. There was notsignificant difference in the computational time re-quired by the two methods.
Using the methodology explained before the trunca-tion errors for the approximation at the central nodescan be obtained and they are summarized by.
(T.E.)FDM= (T.E.)CVF= −DR(j−1)DR2
12fj
IV
−DR2
6f§j −… (89)
Eq. (89) has been simplified. The more significantterms for the calculation of the truncation errors havebeen included. The truncation errors for both methodsat the central nodes are the same. The truncation errorsat the left boundary and at the interface will be differ-ent for both methods. Using the methodology ex-plained in Section 1 the truncation errors for the CVFat the boundaries can be obtained. For instance, thetruncation errors at the left boundaries are given by.
(T.E)FDM=DR2
3f§1 +
DR3
4f1
IV (90)
(T.E)CVF= −DR
2f¦1 −
DR2
6f§1 −
DR3
24f1
IV (91)
The truncation error at the left boundary for theCVF method is (DR)order of accuracy whereas for theFDM is order (DR)2. It can be shown that at theinterface, the truncation error for the CVF method isonly (DR) order of accuracy whereas for the FDM isorder (DR)2. From this analysis we can conclude thatthe truncation errors for the left and interfaceboundaries using the CVF are larger than when usingthe FDM. Therefore, the FDM will be more accuratethan the CVF.
Fig. 5 presents the comparison of the errors (analyti-cal — numerical solution) for both methods. The FDMis more accurate than the CVF for a small and largenumber of nodes (nj=21 and 101). The CVF is lessaccurate than the FDM, because of the effect of the
(T(R
=0 at R=0 (82)
Kf
(T(R
=Kc
(T(R
at R=0.75 (83)
T=T1 at R=1 (84)
where R=r/Rc. Eq. (84) assumes an infinite heat trans-fer coefficient.
For this problem, the analytical solution is given by(Bird et al., 1960):
T=Tl−SoR
2Rc2
4Kf
�1+
b4�RRc
Rf
�2n+
SoRf2
2Kc
�1+
b2n
ln�Rc
Rf
�+
SoRf2
4Kf
�1+
b4n
at 05R5Rf
Rc
(85)
T=Tl+SoRf
2
2Kc
�1+
b2n
ln� 1R
�at
Rf
Rc
5R51 (86)
The parameters used for solving the problem areshown in Table 5. The discretised equations for theFDM were obtained in the same way as before, exceptfor the interface. At the interface (R=0.75), the discre-tised equation was obtained by applying three-pointforward and three-point backward to the l.h.s. andr.h.s. of Eq. (83). In the CVF the discretised equationsfor the region 0BRB0.75 are obtained by integratingEq. (80) from east to west as shown
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2647
Table 6Comparison of the discretised equations, presented in functional form for programming (White, 1987), used for the FDM and CVF in example2a
Method Discretised equationRegion Equations
j=1FDMF(1)=
�−3f1,j+4f1,j+1−f1,j+2
2DR
�E2.1a
1BjBnj(2)E2.2aF (1)= (j−1)DR
�f1,j+1−2f1,j+f1,j−1
DR2
�+�f1,j+1−f1,j−1
2DR
�+
SoRc2(j−1)DR
Kf
�1+b�RcDR
Rf
�2
(j−1)2nj=nj(2)
F(1)=Kf
�3f1,j−4f1,j−1+f1,j−2
2DR
�−Kc
�−3f1,j+4f1,j+1−f1,j+2
2DR
�E2.3a
nj(2)BjBnjE2.4aF(1)= (j−1)DR
�f1,j+1−2f1,j+f1,j−1
DR2
�+�f1,j+1−f1,j−1
2DR
�j=nj F(1)=f1,j−Tl E2.5a
j=1CVF-PLPF (1) =
�f1, j+1−f1, j
DR
�E2.1b
F(1)= (j−1)DR1BjBnj(2)E2.2b�f1,j+1−2f1,j+f1,j−1
DR2
�+�f1,j+1−f1,j−1
2DR
�+
SoRc2(j−1)DR
Kf
�1+b
�RcDR
Rf
�2
(j−1)2nj=nj(2)
E2.3bF(1)=Kf
�j−
3
2
��f1,j−f1,j−1
DR
�−Kc
�j−
1
2
��f1,j+1−f1,j
DR
�−
SoRc2(j−1)DR
2
�1+b
�RcDR
Rf
�2
(j−1)2nnj(2)BjBnj
F(1)= (j−1)DR�f1,j+1−2f1,j+f1,j−1
DR2
�+�f1,j+1−f1,j−1
2DR
�E2.4b
F(1)=f1,j−Tl E2.5bj=nj
a The equations were solved using Maple V. Where F(1)=0.
approximations used for the left boundary and theinterface.
5. Conclusions
A comparison between the FDM, and the CVF wasmade including the use of two different profiles (SP andPLP). The conservativeness, accuracy, advantages anddisadvantages of the methods were evaluated.
The FDM is not mass conservative when a smallnumber of nodes is used in a system represented by asecond order differential equation when both boundaryconditions are Robin type or Neumann type. The lackof conservation is caused because the boundary condi-tions are not included into the governing equation.Using the FDM with a large number of nodes can solvethis problem. In contrast, the CVF is mass conservativefor any number of nodes. Therefore, when dealing withRobin or Neumann type of boundary conditions ateach boundary, the CVF is superior to the FDM whena small number of nodes is used.
There are no major differences in the computationaltime required by the two methods to solve the equa-
tions. Both methods are easy to implement. However,the CVF requires the formulation and integration ofthe energy and/or mass balances at any boundary orregion in the system, while for the FDM the balancesare formulated first and after a direct substitution ofthe derivatives by discretised variables is performed.
Fig. 5. Comparison of the errors (�analytical minus numerical solu-tion�) at different node points given by the FDM and CVF forexample 2.
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542648
The technique proposed by Leonard (1994, 1995) todetermine the truncation errors for the CVF was evalu-ated. The truncation errors calculated with his techniquemislead the interpretation of the results. The techniqueis only valid for the approximation of the variables andderivatives at the faces of the control volume as afunction of the node points. However, the truncationerrors associated with the average of the variables overthe control volume are not considered by his method.The truncation error for the CVF should be determinedusing the mean-value theorem for integral calculus thatincorporates the truncation error associated with theaverage of the variables over the control volume. Thetotal truncation error for the approximation will be theone obtained by adding the truncation error associatedwith expressing the variables and/or the derivatives as afunction of the node points, and the truncation errorcause by solving the algebraic equations at the nodepoints and not at the volume faces. The use of thismethod allows obtaining truncation errors for the CVFthat agree with the numerical results obtained.
We have shown that the boundary conditions shouldbe incorporated in the truncation error analysis of aproblem to evaluate the accuracy of the method. Aprocedure to evaluate the accuracy of the methods basedon the truncation error of the approximations has beendeveloped. Its applicability has been tested for somesystems. The accuracy of the methods for the samenumber of nodes depends on the behavior of the vari-able, type of boundary conditions, and profiles used forthe discretisation of the equations. The analysis oftruncation errors proposed here can be used for predict-ing the accuracy of the method before solving a partic-ular problem. The following rules-of-thumb foraccuracy of the methods were derived from the trunca-tion error analysis. (1) The truncation error for Neu-mann and/or Robin type boundary conditions is order(DX)2 for the FDM whereas is order (DX) for theCVF-PLP method. (2) The FDM is more accurate thanthe CVF-PLP for problems with interfaces betweenadjacent regions. (3) The FDM is more accurate thanthe CVF for systems where a combination of Dirichletand Neumann, or Dirichlet and Robin type boundaryconditions are used unless the response of the dependentvariable is very steep. (4) CVF usually requires morenumber of nodes than the FDM to obtain the sameaccuracy. (5) The methods are essentially the same whenin a one-dimensional system, the boundary conditionsare given directly as a value of the variable, the systemconsists of linear differential equations, and the coordi-nate system is Cartesian.
6. Nomenclature
A jacobians coefficient matrixjacobian defined by Eq. A16A( j
constants vectorBjacobian defined by Eq. A16B( j
b constant used in example 2, 0.1dimensionless
b1 parameter used in Eq. (39), 1dimensionless
Bl left boundary in CVFBr right boundary in CVF
backward approximationBWconcentration, gmol/m3C
Ca concentration of component A,gmol/m3
initial concentration of A, 45 gmol/Ca0
m3 (see Table 5)average concentration, gmol/m3Ca,avg
control volume formulationCVFjacobian defined by Eq. A.16D( j
diffusivity of specie A on B, 1×10−5Dab
m2/s (see Table 5)e east face of the control volumeE discretised point in the east direction
of the CVFerror vector (contains the values forErrorAnalytical-Numerical Solution)
F equations vectorfinite difference methodFDM
H parameter used in Eq. (56), 1dimensionlessinterface for the left boundary iniilCVFinterface for the right boundary iniirCVF
Il internal left node in CVFIr internal right node in CVF
spatial direction nodaljthermal conductivity of the cladding,Kc
0.64 cal/°C cm s (see Table 5)Kf thermal conductivity of the nuclear
fuel rod, 0.066 cal/°C cm s (seeTable 5)length, mLnumber of spatial nodesnj
Na flux of species A, 9×10−3 gmol/m2 s(see Table 5)discretised point under study in thePCVF
3PB three-point backward approximation3PF three-point forward approximation
piece-wise linear profilePLPradial coordinate, cmrradial coordinate (R=r/Rc),R
dimensionlessradius of the cladding, 1.27 cm (seeRc
Table 5)radius of the nuclear fuel rod, 0.9525Rf
cm (see Table 5)
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2649
So constant fission heat, 50 cal/cm3 s(see Table 5)
SP step wise profiletime, sttemperature, °CTanalytical solution vector for the tem-Tperature, °Ccontrol volume average temperature,T(°C
Ta ambient temperature used in Eq. (56),°Cnumerical solution vector for theTFDM-CVF
temperature, °Coutside temperature, 500°CT1
Tleft temperature at left boundary, °Ctemperature at right boundary, °CTright
initial temperature, 100°CTo
TE truncation error vector calculatedfrom the numerical solution accord-ing to the Appendix A
(T.E.)CVF-PLP truncation error vector for the CVF-PLPtruncation error of the equation using(T.E.)CVF-PLP
CVF-PLPtruncation error of the equation using(T.E.)CVF-SP
CVF-SP(T.E.)Cyl–e,w� j truncation error associated with the
derivatives evaluated at the faces ofthe control volume in cylindricalcoordinates.
(T.E.)D,Bl+iil� j truncation error associated with thederivative evaluated at the leftboundary interfaces.truncation error associated with the(T.E.)D,Br+iir� j
derivative evaluated at the rightboundary interfaces.truncation error associated with the(T.E.)D−e,w� j
derivatives evaluated at the faces ofthe control volume.
(T.E.)D,e+w� j truncation error associated with thederivatives at the east plus west facesof the control volumetruncation error associated with solv-(T.E.)D−1� j
ing the derivatives at the left boudarytruncation error associated with solv-(T.E.)D−r� j
ing the derivatives at the rightboudarytruncation error for the derivative(T.E.)e−PLP,1� j
evaluated at the east face using PLP(T.E.)e−PLP,V truncation error for the variable eval-
uated at the east face using PLPtruncation error of the variable evalu-(T.E.)e−SP
ated at the east face using SPtruncation error for the derivative(T.E.)e−w,PLP−1
evaluated at the east minus west facesusing PLP
truncation error for the variable eval-(T.E.)e−w,PLP−V
uated at the east minus west faces us-ing PLP
(T.E.)e−w,SP truncation error for the variable eval-uated at the east minus west faces us-ing SPtruncation error vector for the FDM(T.E.)FDM
truncation error of the equation using(T.E.)FDM
FDMtruncation error of the first derivative(T.E.)1−FDM
using FDMtruncation error of the first derivative(T.E.)1BW−FDM
using FDM with backward approxi-mationtruncation error of the second deriva-(T.E.)2−FDM
tive using FDM(T.E.)3PB−FDM truncation error using 3PB
approximationtruncation error using 3PF(T.E.)3PF−FDM
approximation(T.E.)V,B1+ii1� j truncation error associated with the
variable evaluated at the leftboundary interfaces.truncation error associated with the(T.E.)V,Br+iir� j
variable evaluated at the rightboundary interfaces.
(T.E.)V(j)−D(j) truncation error associated with ex-pressing the variables and/or deriva-tives as a function of the node pointstruncation error caused by solving(T.E.)V,D� j
the algebraic equations at the nodepoints
(T.E.)V−e,w� j truncation error associated with thevariables evaluated at the faces of thecontrol volume.
(T.E.)V,e+w� j truncation error associated with thevariables at the east plus west facesof the control volumetruncation error associated with the(T.E.)V−1� j
variables evaluated at left boundaryof the control volumetruncation error associated with the(T.E.)V( −1� j
average of the variables evaluated atleft boundary of the control volume.truncation error associated with the(T.E.)V−r� j
variables evaluated at right boundaryof the control volume
(T.E.)V( −r� j truncation error associated with theaverage of the variables evaluated atright boundary of the control vol-ume.truncation error for the derivative(T.E.)w−PLP,1
evaluated at the west face using PLPtruncation error for the variable(T.E.)w−PLP,V
evaluated at the west face usingPLP
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542650
(T.E.)w−SP truncation error for the variableevaluated at the west face using SP
v velocity, 1×10−6 m/s (see Table 5)west face of the control volumewdiscretised point in the west directionWof CVF
x distance in x spatial direction, mdimensionless distanceX
X( j jacobian defined by Eq. A.16jacobian defined by Eq. A.16Y( j
Greek lettersj value for the dependent variable that
satisfies the mean-value theorem forintegral calculus, see Eq. (33)
DR radial step size, dimensionlessstep size in time, sDtstep size in the X-direction,DXdimensionlessstep size in the east direction,(DX)e
dimensionlessstep size in the west direction,(DX)w
dimensionlessf dependent variable, dimensionless
representation of the discretised de-fNpendent variable on time evaluatedat time t−Dtvariable evaluated at the point EfE
fp variable evaluated at the point Pvariable evaluated at the point WfW
Appendix A. Calculation of the truncation error usingthe numerical solution
In the following analysis, it is assumed that theproblem is linear, one-dimensional, and steady state.Let us start by showing the methodology to solve Eqs.(39)–(41) using FDM and CVF. The first step in theFDM is to discretise the equations. In the same way thefirst step for the CVF is to integrate the equations andafter substitute the derivatives at the face volumes bydiscrete values using a specific approach. A uniformgrid of mesh size DX is used. As stated in the paper, forthis case the algebraic equations to solve simultaneouslyusing the two different methods (FDM and CVF) arethe same. Using 6 nodes for the solution (nj=6) thealgebraic equations to solve are given by.
F1=f1−Tleft=0
F2=25f1−51f2+25f3=0
F3=25f2−51f3+25f4=0
F4=25f3−51f4+25f5=0
F5=25f4−51f5+25f6=0
F6=f6−Tright=0
(A.1)
The set of equations given before can be representedin matrix–vector form by:
F=ATFDM-CVF−B=0 (A.2)
where F represents the vector of the equations, TFDM−
CVF is the vector form with the dependent variables(fj), A is the coefficient matrix, and B is the constantsvector (boundary conditions in this case). The vectorTFDM-CVF, the matrix A, and the vector B are given by
TFDM−CVF=
ÁÃÃÃÃÃÃÃÄ
f1
f2
f3
f4
f5
f6
ÂÃÃÃÃÃÃÃÅ
A=
ÁÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÄ
(F1
(f1
(F1
(f2
(F1
(f3
0 0 0
(F2
(f1
(F2
(f2
(F2
(f3
0 0 0
0(F3
(f2
(F3
(f3
(F3
(f4
0 0
0 0(F4
(f3
(F4
(f4
(F4
(f5
0
0 0 0(F5
(f4
(F5
(f5
(F5
(f6
0 0 0(F6
(f4
(F6
(f5
(F6
(66
ÂÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÅ
B=
ÁÃÃÃÃÃÃÃÄ
Tleft
0
0
0
0
Tright
ÂÃÃÃÃÃÃÃÅ
The matrix A includes maximum three points differ-ent than zero because the approximations and theapproaches used in this paper use maximum threepoints for the calculations. In this case, the matrix isgiven by.
A=
ÁÃÃÃÃÃÃÃÄ
1 0 0 0 0 0
25 −51 25 0 0 0
0 25 −51 25 0 0
0 0 25 −51 25 0
0 0 0 25 −51 25
0 0 0 0 0 1
ÂÃÃÃÃÃÃÃÅ
(A.3)
The solution of Eq. (A.2) is given by.
TFDM-CVF=A−1B (A.4)
Calling the elements of the inverse matrix l, theinverse matrix for this case looks like.
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2651
A-1=
ÁÃÃÃÃÃÃÃÄ
l1,1 l1,2 l1,3 l1,4 l1,5 l1,6
l2,1 l2,2 l2,3 l2,4 l2,5 l2,6
l3,1 l3,2 l3,3 l3,4 l3,5 l3,6
l4,1 l4,2 l4,3 l4,4 l4,5 l4,6
l5,1 l5,2 l5,3 l5,4 l5,5 l5,6
l6,1 l6,2 l6,3 l6,4 l6,5 l6,6
ÂÃÃÃÃÃÃÃÅ
(A.5)
For this case the values of the coefficients of the firstand sixth rows are zero except for l1,1=l6,6=1.
Substituting Eq. (A.5) into Eq. (A.4) and evaluating.
TFDM-CVF=
ÁÃÃÃÃÃÃÃÄ
f1
f2
f3
f4
f5
f6
ÂÃÃÃÃÃÃÃÅ
=
ÁÃÃÃÃÃÃÃÄ
l1,1Tleft+l1,6Tright
l2,1Tleft+l2,6Tright
l3,1Tleft+l3,6Tright
l4,1Tleft+l4,6Tright
l5,1Tleft+l5,6Tright
l6,1Tleft+l6,6Tright
ÂÃÃÃÃÃÃÃÅ
(A.6)
Eq. (A.6) represents the numerical solution of theproblem. Since the values of l are known the solutioncan be calculated. The solution given by Eq. (A.6) doesnot represent exactly the analytical solution because ofthe terms that were neglected in the discretisation thatrepresent the truncation error. Suppose that the vectorT contains the values of the analytical solution evalu-ated at the specific node points, the error vector (Error)will be given by
Error=T−TFDM−CVF or
ÁÃÃÃÃÃÃÃÄ
Error1
Error2
Error3
Error4
Error5
Error6
ÂÃÃÃÃÃÃÃÅ
=
ÁÃÃÃÃÃÃÃÄ
T1
T2
T3
T4
T5
T6
ÂÃÃÃÃÃÃÃÅ
−
ÁÃÃÃÃÃÃÃÄ
f1
f2
f3
f4
f5
f6
ÂÃÃÃÃÃÃÃÅ
(A.7)
where the elements of the vectors Error and T havebeen called Errorj and Tj, respectively. If all the termswere included in the discretised equations the errorwould be zero.
Let us call TE the vector containing the termsnot included in the discretised equations at each nodepoint, that is, the vector containing the truncationerrors at each node point that has the following ele-ments
TE=
ÁÃÃÃÃÃÃÃÄ
TE1
TE2
TE3
TE4
TE5
TE6
ÂÃÃÃÃÃÃÃÅ
(A.8)
that is TE1 represents the truncation error at node 1and so on. To make the solution of Eq. (A.2) exact thetruncation errors should be added, therefore.
F=ATFDM−CVF−B+TE=0 (A.9)
The vectors B and TE can be combined together toredefine a new vector B given by.
B=
ÁÃÃÃÃÃÃÃÄ
Tleft−TE1
−TE2
−TE3
−TE4
−TE5
Tright−TE6
ÂÃÃÃÃÃÃÃÅ
(A.10)
The coefficient matrix A is not affected by introduc-ing the truncation errors, therefore the solution of theproblem is given by.
TFDM−CVF=
ÁÃÃÃÃÃÃÃÄ
l1,1 l1,2 l1,3 l1,4 l1,5 l1,6
l2,1 l2,2 l2,3 l2,4 l2,5 l2,6
l3,1 l3,2 l3,3 l3,4 l3,5 l3,6
l4,1 l4,2 l4,3 l4,4 l4,5 l4,6
l5,1 l5,2 l5,3 l5,4 l5,5 l5,6
l6,1 l6,2 l6,3 l6,4 l6,5 l6,6
ÂÃÃÃÃÃÃÃÅ
ÁÃÃÃÃÃÃÃÄ
Tleft−TE1
−TE2
−TE3
−TE4
−TE5
Tright−TE6
ÂÃÃÃÃÃÃÃÅ
(A.11)
Evaluating Eq. (A.11) yields.
TFDM−CVF=
ÁÃÃÃÃÃÃÃÄ
f1
f2
f3
f4
f5
f6
ÂÃÃÃÃÃÃÃÅ
=
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542652
ÁÃÃÃÃÃÃÃÄ
l1,1Tleft+l1,6Tright− [l1,1TE1+l1,2TE2+l1,3TE3+l1,4TE4+l1,5TE5+l1,6TE6]
l2,1Tleft+l2,6Tright− [l2,1TE1+l2,2TE2+l2,3TE3+l2,4TE4+l2,5TE5+l2,6TE6]
l3,1Tleft+l3,6Tright− [l3,1TE1+l3,2TE2+l3,3TE3+l3,4TE4+l3,5TE5+l3,6TE6]
l4,1Tleft+l4,6Tright− [l4,1TE1+l4,2TE2+l4,3TE3+l4,4TE4+l4,5TE5+l4,6TE6]
l5,1Tleft+l5,6Tright− [l5,1TE1+l5,2TE2+l5,3TE3+l5,4TE4+l5,5TE5+l5,6TE6]
l6,1Tleft+l6,6Tright− [l6,1TE1+l6,2TE2+l6,3TE3+l6,4TE4+l6,5TE5+l6,6TE6]
ÂÃÃÃÃÃÃÃÅ
(A.12)
The terms out of the bracket in Eq. (A.12) representthe numerical solution given in Eq. (A.6) which valuesare known, while the terms inside the bracket representthe error caused in the solution due to the truncationerrors which values are unknown. Substituting Eq.(A.12) into Eq. (A.7) yields.ÁÃÃÃÃÃÃÃÄ
0
0
0
0
0
0
ÂÃÃÃÃÃÃÃÅ
=
ÁÃÃÃÃÃÃÃÄ
T1
T2
T3
T4
T5
T6
ÂÃÃÃÃÃÃÃÅ
Eq. (A.13) is equated to zero based on the fact thatwhen the truncation errors are included in the solutionthe numerical solution should match the analyticalsolution. Rearranging Eq. (A.13) and expressing it invector and matrices form.
−A−1TE=T−TFDM−CVF=Error (A.14)
Therefore, the value of the truncation errors can beobtained by.
TE=A(TFDM−CVF−T)=A(−Error) (A.15)
Eq. (A.15) indicates that to calculate the truncationerror vector for a one-dimensional, steady state, andlinear differential equation with uniform mesh size, thenegative of the error vector of the numerical solution(difference between the numerical solution and the ana-lytical solution) should multiply the coefficient matrix(obtained for the discretised equation).
Truncation error for FDM:The coefficient matrix A can be obtained by defining
some jacobians:
B( j=(Fj
(fj
A( j=(Fj
(fj-1
D( j=(Fj
(fj+1
X( j=(Fj
(fj+2
Y( j=(Fj
(fj-2
(A.16)
therefore,
A=
ÁÃÃÃÃÃÃÃÄ
B( 1 D( 1 X( 1 0 L 0
A( 2 B( 2 D6 2 0 L 0
0 A( j B( j D( j … 0
� � � � � �0 0 0 A( nj−1 B( nj−1 D( nj−1
0 0 0 Y( nj A( nj B( nj
ÂÃÃÃÃÃÃÃÅnj×nj
(A.17)Substituting Eq. (A.17) into Eq. (A.15) and
evaluating.
TE1=B( 1E1+D( 1E2+X( 1E3
�TEj=A( jEj−1+B( jEj+D( jEj+1
�TEnj=Y( njEnj−2+A( njEnj−1+B( njEnj
(A.18)
Eq. (A.18) allows calculating the total truncationerror at each node point for a one-dimensional, steadystate, linear differential equation using FDM with uni-form mesh size for any possible combination of theboundary conditions. The truncation error at a givennode point is given by a linear combination of the errorat that node and the errors at the nodes next to it(backward and forward to the node for central nodes,two nodes forward for the first node, and two nodesbackward for the last node).
Truncation error for CVF:For the CVF the jacobians calculated from X( 1 and
Y( nj−2 are equal to zero, therefore the total truncationerrors at each node point are given by
−
ÁÃÃÃÃÃÃÃÄ
l1,1Tleft+l1,6Tright− [l1,1TE1+l1,2TE2+l1,3TE3+l1,4TE4+l1,5TE5+l1,6TE6]
l2,1Tleft+l2,6Tright− [l2,1TE1+l2,2TE2+l2,3TE3+l2,4TE4+l2,5TE5+l2,6TE6]
l3,1Tleft+l3,6Tright− [l3,1TE1+l3,2TE2+l3,3TE3+l3,4TE4+l3,5TE5+l3,6TE6]
l4,1Tleft+l4,6Tright− [l4,1TE1+l4,2TE2+l4,3TE3+l4,4TE4+l4,5TE5+l4,6TE6]
l5,1Tleft+l5,6Tright− [l5,1TE1+l5,2TE2+l5,3TE3+l5,4TE4+l5,5TE5+l5,6TE6]
l6,1Tleft+l6,6Tright− [l6,1TE1+l6,2TE2+l6,3TE3+l6,4TE4+l6,5TE5+l6,6TE6]
ÂÃÃÃÃÃÃÃÅ
(A.13)
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–2654 2653
TE1=B( 1E1+D( 1E2
�TEj=A( jEj−1+B( jEj+D( jEj+1
�TEnj=A( njEnj−1+B( njEnj
(A.19)
The truncation errors calculated from Eq. (A.19)represent the total truncation error at each node point.The equation can be used for any kind of boundaryconditions using the CVF for a one-dimensional, steadystate, linear differential equation with uniform meshsize discretisation.
References
Abell, M. L., & Braselton, J. P. (1994). The maple V handbook. NewYork: AP Professional.
Baek, S. W., Kim, M. Y., & Kim, J. S. (1998). Nonorthogonalfinite volume solutions of radiative heat transfer in a three dimen-sional enclosure. Numerical Heat Transfer B-Fundamentals, 34,419.
Bird, R., Stewart, W., & Lightfoot, E. (1960). Transport phenomena.New York: Wiley.
Castillo, J. E., Hyman, J. M., Shashkow, M. J., & Steinberg, S.(1995). The sensitivity and accuracy of fourth order finite-differ-ence schemes on nonuniform grids in one dimension. Computersand Mathematics with Applications, 30, 41.
Chan, C. T., & Anastasiou, K. (1999). Solution of incompressibleflows with or without a free surface using the finite volumemethod on unstructured triangular meshes. International Journalof Numerical Methods Florida, 29, 35.
Ciarlet, P. G., & Lions, J. L. (1990). Handbook of numerical analysis,vol. 1. New York: Elsevier.
Cordero, E., De Biase, L., & Pennati, V. (1997). A new finite volumemethod for the solution of convection–diffusion equations: analy-sis of stability and convergence. Communication Numerical Meth-ods Engineering, 13, 923.
Davis, M. E. (1984). Numerical methods and modeling for chemicalengineers. New York: Wiley.
Fan, D., & White, R. E. (1991). Optimization and extension ofpentadioagonal BAND(J) solver to multiregion systems contain-ing interior boundaries. Computers and Chemical Engineering, 15,797.
Johnson, R. W., & Mackinnon, R. J. (1992). Equivalent versions ofthe QUICK scheme for finite-difference and finite-volume numer-ical methods. Communications in Applied Numerical Methods, 8,841.
Leonard, B. P. (1994). Comparison of truncation error of finitedifference and finite volume formulations of convection terms.Applied Mathematical Modelling, 18, 46.
Leonard, B. P. (1995). Order of accuracy of QUICK and relatedconvection–diffusion schemes. Applied Mathematical Modelling,19, 640.
Leonard, B. P., & Mokhtari, S. (1990). Beyond first-order upwinding:the ultra-sharp alternative for non-oscillatory steady-state simula-tion of convection. International Journal for Numerical Methods inEngineering, 30, 729.
Marchuk, G. I. (1959). Numerical methods for nuclear reactor calcula-tions. New York: Consultants Bureau.
Mathcad7, (1997). User’s guide. Cambridge: MathSoft Inc.Moder, J. P., Chai, J. C., Parthasarathy, G., Lee, H. S.,
Patankar, S. V. (1996). Nonaxisymmetric radiative transfer in
cylindrical enclosures. Numerical Heat Transfer B-Fundamentals,30, 437.
Munz, C. D., Schneider, R., Sonnendrucker, E., Stein, E., Voss, U.,& Westermann, T. (1999). A finite volume particle in cell methodfor the numerical treatment of Maxwell–Lorentz equations onboundary-fitted meshes. International Journal for NumericalMethods in Engineering, 44, 461.
Newman, J. S. (1967). Numerical solution of coupled ordinary differ-ential equations. University of California, Berkeley, UCRL-177369.
Newman, J. S. (1968). Numerical solution of coupled ordinary differ-ential equations. Industrial Engineering and Chemical Fundamen-tals, 7, 514.
Newman, J. S. (1973a). Electrochemical systems. New Jersey: Pren-tice-Hall.
Newman, J. S. (1973b). The fundamental principles of current distri-bution and mass transfer in electrochemical cells. Electro-analyti-cal Chemistry, 6, 187.
Noh, H. K., & Song, K. S. (1998). Temperature distribution of a lowtemperature heat pipe with multiple heaters for electronic cooling.ETRI Journal, 20, 380.
Patankar, S. (1980). Numerical heat transfer and fluid flow. New York:Hemisphere Publishing.
Pozrikidis, C. (1997). Introduction to theoretical and computationalfluid dynamics. New York: Oxford University Press.
Pozrikidis, C. (1998). Numerical computation in science and engineer-ing. New York: Oxford University Press.
Shahcheragui, N., & Dwyer, H. A. (1998). Fluid flow and heattransfer over a three-dimensional spherical object in a pipe.Journal of Heat Transfer-T. American Society of MechanicalEngineers, 120, 985.
Sohankar, A., Norberg, C., & Davison, L. (1999). Simulation of threedimensional flow around a square cylinder at moderate Reynoldsnumbers. Physical fluids, 11, 288.
Stark, R. H. (1956). Rates of convergence in numerical solution ofthe diffusion equation. Journal of Association of Computer Ma-chines, 3, 29.
Su, M. D., Tang, G. F., & Fu, S. (1999). Numerical simulation offluid flow and thermal performance of a dry cooling tower undercross wind condition. Journal Wind Engneering and IndustrialAerodynamics, 79, 289.
Thynell, S. T. (1998). Discrete-ordinates method in radiativeheat transfer. International Journal of Engineering Sciences, 36,1651.
Tikhonov, A. N., & Samarskii, A. A. (1956). On finite differencemethods for equation with discontinuous coefficients. DokladyAkad. Nauk SSSR (N.S.), 108, 393.
Van Zee, J., Kleine, G., & White, R. E. (1984). Extension ofNewman’s numerical technique to pentadiagonal systems of equa-tions. In R. E. White, Electrochemical cell design. New York:Plenum Press.
Varga, R. S. (1957). Numerical solution of the two-group diffusionequation in x–y geometry. IRE Transactions of the ProfessionalGroup on Nuclear Science, NS-4, 52.
Varga, R. S. (1965). Matrix iterati6e analysis. New Jersey: Prentice-Hall.
Versteeg, H. K., & Malalasekera, W. (1995). An introduction tocomputational fluid dynamics. The finite 6olume method. Malaysia:Longman Group.
Vijayan, P., & Kallinderis, Y. (1994). A 3-D finite volume scheme forthe euler equations on adaptive tetrahedral grids. Journal ofComputer Physics, 113, 249.
Wachspress, E. L. (1960). The numerical solution of boundary valueproblems. In A. Ralston, & H. S. Wilf, Mathematical methods fordigital computers. New York: Wiley..
G.G. Botte et al. / Computers and Chemical Engineering 24 (2000) 2633–26542654
West, A., & Fuller, T. (1996). Influence of rib spacing in proton-ex-change membrane electrode assemblies. Journal of Applied Elec-trochemistry, 26, 557.
West, A., Yang, D., & Debecker, B. (1995). The simulation ofmass-transfer effects for electrochemical-cell design. In Electro-
chemical society proceedings, vol. 95-11 (p. 172). Pennington: TheElectrochemical Society.
White, R. E. (1987). Application and explanation of Newman’sBAND(J) subroutine. Texas A&M University, Unpublished(available upon request).
.