On the numerical treatment of an ordinary differential equation
arising in one-dimensional non-Fickian diffusion problems
J.I. Ramos
∗Room I-320-D, E.T.S. Ingenieros Industriales, Universidad de Málaga, Plaza El Ejido, s/n, 29013-Málaga, Spain
Received 2 August 2004; accepted 13 April 2005 Available online 25 May 2005
Abstract
In a recent study, Chen and Liu [Comput. Phys. Comm. 150 (2003) 31] considered a one-dimensional, linear non-Fickian diffusion problem with a potential field, which, upon application of the Laplace transform, resulted in a second-order linear ordinary differential equation which was solved by means of a control-volume finite difference method that employs exponential shape functions. It is first shown that this formulation does not properly account for the spatial dependence of the drift forces and results in oscillatory solutions near the left boundary when these forces are large. A piecewise linearized method that provides piecewise analytical solutions, is exact in exact arithmetic for constant coefficients, homogeneous, second-order linear ordinary differential equations and results in three-point finite difference equations is then proposed. Numerical simulations indicate that the piecewise linearized method is free from unphysical oscillations and more accurate than that of Chen and Liu, especially for large drift forces. The method is then applied to non-Fickian diffusion problems with non-constant drift forces in order to determine the effects of the potential field on the concentration distribution.
2005 Elsevier B.V. All rights reserved.
PACS: 02.70.-c; 02.70.Rw; 02.60.Cb; 02.30.Mv
Keywords: Piecewise linearization methods; Non-Fickian diffusion; Boundary-value problems; Exponential methods; Ordinary differential equations
1. Introduction
In a recent paper, Chen and Liu[1] considered a linear, one-dimensional non-Fickian diffusion problem in composite media with a potential field in Cartesian coordinates. Such a problem is governed by a telegraph equation (their Eq. (7)) for the mass concentration which, upon applying the Laplace transform in time, yields the following
* Tel.: +34-95-2131402; fax: +34-95-2132816.
E-mail address:[email protected](J.I. Ramos).
0010-4655/$ – see front matter 2005 Elsevier B.V. All rights reserved. doi:10.1016/j.cpc.2005.04.004
non-dimensional, linear, second-order ordinary differential equation
(1)
d2c dx2+
d
dx(pc)−β
2c=0,
wherex (0< x <1)is the Cartesian coordinate,cis the concentration,β is related to the exponent of the kernel of the Laplace transform, andp(x)is the drift force.
Eq.(1) coincides with Eq. (13) of Chen and Liu [1] except that a different notation has been used. For the numerical integration of Eq. (1), Chen and Liu [1] used a finite volume technique in an equally-spaced mesh consisting ofN grid points such that the grid spacing isx=xi+1−xi =1/(N−1),i=1,2, . . . , N, integrated
this equation fromxi−1/2toxi+1/2using as an approximation the solution of
(2)
d2c dx2−β
2c=0,
in the intervalxi< x < xi+1, subject to the conditions
(3)
c(xi)=ci, c(xi+1)=ci+1,
and obtained the following three-point finite difference equation
(4)
1−p
β sinh
βx
2
ci−1−2 cosh(βx)ci+
1+p
βsinh
βx
2
ci+1=0.
In this paper, we shall consider Eq.(1)subject to the following boundary conditions
(5)
c(0)=1, c(1)=0.
The objective of this paper is several-fold. First, it is shown that Eq.(4)is not consistent with the derivation presented by Chen and Liu[1]whenpdepends onx. Second, it is shown that Eq.(4)yields oscillatory solutions whenpis large. Third, an exponential numerical method based on a simple manipulation of Eq.(1)and piecewise linearization of the resulting equation is developed. This numerical method is shown to be more accurate than that of Chen and Liu[1]and yields, in the absence of round-off errors, the exact solution of Eq.(1)for constant p. Fourth, the exponential method proposed here is used to determine the numerical solution of Eq.(1)for quadratic drift forces, i.e.
(6)
p(x)=ap(x−xp)2+bp(x−xp)+cp,
as a function of the constantsap,bp,cpand 0xp1.
2. The method of Chen and Liu[1]
Eq.(2)can be integrated analytically in the intervalxi< x < xi+1subject to Eq.(3)to yield
c(x)=ci+1
β
sinhβxsinh
β(x−xi)
+ci
β
sinhβxsinh
β(xi+1−x)
,
(7)
xixxi+1,
which can be differentiated inxi< x < xi+1to obtain dcdx in this interval. An analogous expression to Eq.(7)can
be obtained in the intervalxi−1xxi. Eq.(7)and its analog in the intervalxi−1xxi can be used in the
1−pi−1/2
β sinh
βx
2
ci−1−
2 cosh(βx)+pi−1/2−pi+1/2 β sinh βx 2 ci (8) +
1+pi+1/2
β sinh
βx
2
ci+1=0,
wherepi+1/2=p(xi+1/2).
Eq.(8)coincides with Eq.(4)and Eq. (29) of Chen and Liu[1]for constantpand is valid forp(x). Moreover, the appearance of hyperbolic functions in Eq.(8)indicates that the method of Chen and Liu[1]is of exponential type.
For constantp, Eq.(8)can be written as
(9)
1− R 2θsinhθ
ci−1−2 cosh(2θ )ci+
1+ R
2θsinhθ
ci+1=0,
whereR≡pxis the cell or mesh Péclet number andθ=βx2 .
The linear finite difference equation(9)can be solved analytically, for their solutions are of the formci=Cri,
whereCis a constant andris governed by the following quadratic equation
(10)
1− R 2θsinhθ
−2 cosh(2θ )r+
1+ R
2θsinhθ
r2=0.
If this equation has a negative root, then Eq. (9)has oscillatory solutions which are not consistent with the analytical solution of Eq.(1). In fact, it is an easy matter to verify that, for fixedθand Re1, Eq.(9)is asymp-totically equivalent toci+1=ci−1the roots of which arer= ±1 and, therefore, under these assumptions, Eq.(8)
has oscillatory solutions whereas the analytical solution of Eq.(1)with constantpis monotonic.
3. Piecewise linearization method
Based on the conclusions reached in the previous section, we consider Eq.(1)written as
(11)
d2c dx2+p(x)
dc dx +
d(x)−β2c=0,
whered(x)=dpdx(x). Eq.(11)is linear but has variable coefficients; therefore, it is in general impossible to obtain analytical solutions for this equation. However, if in the intervalxi−1< x < xi+1, Eq.(11)is approximated by
(12)
d2c dx2+pi
dc dx +
di−β2
c=0,
which can be obtained from Eq.(11)by freezing the coefficients at the mid-point of the intervalxi−1< x < xi+1
or by expanding bothp(x)andd(x)in Taylor’s series expansions aboutxi and retaining only the first term of these
expansions, one can easily obtain the solution of Eq.(12)as
(13)
c(x)=Aiexp
λ+i (x−xi)
+Biexp
λ−i (x−xi)
,
ifRi=(pi/2)2−(di−β2) >0, whereλ±i = −pi/2± √
Ri, andAi andBi can be determined from the conditions
(14)
c(xi−1)=ci−1, c(xi)=ci, c(xi+1)=ci+1,
as
(15)
Ai =
ci−1−ciexp(−λ−i x)
exp(−λ+i x)−exp(−λ−i x)=
ci+1−ciexp(λ−i x)
exp(λ+i x)−exp(λ−i x),
(16)
Eq.(15)yields the following three-point finite difference equation
(17) exp(λ+i +λ−i )xci−1−
exp(λ+i x)+exp(λ−i x)ci+ci+1=0.
Analytical solutions to Eq.(12)can be obtained from other conditions than the one considered here, e.g.,Ri0,
but are not reported here. It suffices to say that the method presented in this section is of exponential type (cf. Eq. (13)), is based on the linearization of Eq. (1) about the mid-point of the interval xi−1xxi+1, yields
three-point finite difference equations, and is exact (in the absence of round-off errors) for Eq.(1)with constant
pand linear second-order ordinary differential equations with constant coefficients and constant right-hand sides. Moreover, for constantpand(p/2)2β2, it is an easy matter to show thatλ+i ≈0 andλ−i ≈ −p; therefore, for
p1, Eq.(17)is asymptotically equivalent toci−1=ci, i.e. it does not produce oscillatory solutions.
It must be pointed out that, for constantpandβ=0, Eq.(17)coincides with the (locally exact) exponentially-fitted methods of Allen and Southwell[2], Scharfetter and Gummel[3]and Il’in[4]for one-dimensional, linear advection-diffusion equations, although these authors employed finite difference equations with artificial diffusion, the value of which was determined from the condition that the characteristic roots of the finite difference equation coincide with those of the linear ordinary differential equation. Il’in’s uniformly convergent scheme can also be derived by freezing the coefficients of the differential equation, compact exponentially-fitted methods, exact differ-ence techniques, collocation, finite volumes, polynomial-conforming Petrov–Galerkin finite elements, exponential
Fig. 1. Concentration (left) and difference between the exactce(x)and numericalc(x)solutions (right) as functions ofxforp=1 andN=101. (Top: numerical solution obtained with the piecewise linearization method presented in this paper. Bottom: numerical solution obtained with the method of Chen and Liu[1]. Solid, dashed, dashed-dotted and dotted lines correspond toβ=0.1, 1, 10 and 100, respectively.)
Petrov–Galerkin finite elements, explicit Galerkin techniques and mixed finite elements[5]. It can also be derived by considering three-point intervals(xi−1, xi+1), freezing the coefficients of the differential equation at the
mid-point, solving the resulting steady convection–diffusion equation analytically and imposing that this solution yields the nodal values at the two end points and at the midpoint of each interval[6].
4. Results
Comparisons between the numerical results obtained with the method of Chen and Liu[1]and the one presented in the previous section are illustrated inFigs. 1–3for different values of (constant)p,βandN.Fig. 1(left) indicates that the concentration profiles obtained with the two methods forp=1 are similar for different values ofβ when
N=101. However, the numerical method of Chen and Liu[1]produces much larger errors than the one presented in this paper. In fact, the errors of the method presented here are due to round-off, for the method is exact in exact arithmetic for constantp.Fig. 1(right) also indicates that the errors of the method of Chen and Liu[1]increase whereas those of the exponential technique presented here decrease asβis increased.
The results presented inFig. 2correspond toN =101, p=1000 and different values ofβ, and show that the method presented in this paper yields monotonic (positive) exponentially decaying solutions, whereas that of Chen and Liu[1]predicts unphysical oscillatory solutions near the left boundary. It must be noted that, at largep,
Fig. 2. Concentration (left) and difference between the exactce(x)and numericalc(x)solutions (right) as functions ofxforp=1000 and N=101. (Top: numerical solution obtained with the piecewise linearization method presented in this paper. Bottom: numerical solution obtained with the method of Chen and Liu[1]. Solid, dashed, dashed-dotted and dotted lines correspond toβ=0.1, 1, 10 and 100, respectively.)
Fig. 3. Concentration (left) and difference between the exactce(x)and numericalc(x)solutions (right) as functions ofxforp=1000 and β=100. (Top: numerical solution obtained with the piecewise linearization method presented in this paper. Bottom: numerical solution obtained with the method of Chen and Liu[1]. Solid, dashed and dashed-dotted and dotted lines correspond toN=101, 51 and 26, respectively.)
Eq.(1)exhibits a boundary layer atx=0, the thickness of which is of the order of p1. Moreover, forp=1000 and
N=101, the mesh Péclet or Reynolds number is Re=10 and, as indicated in Section2, for this value of the mesh Reynolds number, the method of Chen and Liu[1]yields oscillatory solutions because one of the roots of Eq.(9) is negative.
Fig. 2also shows that the numerical errors of the method presented here are nearly independent ofβ whereas those of the method of Chen and Liu[1]decrease slightly asβis increased. The results presented inFig. 2(top) are again consistent with the fact that the method presented in this paper provides in exact arithmetic the exact solution of Eq.(1)whenpis constant.
Fig. 3corresponds top=1000 andβ=100 and different grid sizes. This figure indicates that the amplitude and penetration of the oscillations predicted by the method of Chen and Liu[1]nearx=0 increase as the mesh spacing is increased, for the mesh Reynolds number increases asx is increased; the numerical errors of their method also increase asx is increased. However, the numerical results obtained with the method presented in this paper are nearly independent of the mesh spacing and are much smaller than those of the technique of Chen and Liu[1].
Fig. 3also shows the numerical “thickening” of the boundary layer atx=0 asxis increased for the method presented in this paper. This thickening is caused by the fact that the mesh spacing is larger than the boundary layer thickness and this is consistent with the remarks made in the previous section regarding Eq.(17)for large values ofp.
Fig. 4. Concentration as a function ofxforβ=1,N=101 andp=ap(x−xp)2+bp(x−xp)+cp. (Top left:bp=cp=0,xp=0.5; solid, dashed and dashed-dotted lines correspond toap=10, 100 and 1000, respectively. Top right:ap=10,cp=0,xp=0.5; solid, dashed and dashed-dotted lines correspond tobp=0, 10 and 0.1, respectively. Bottom left:ap=10,bp=0,xp=0.5; solid, dashed and dashed-dotted lines correspond tocp=0, 10 and 100, respectively. Bottom right:ap=10,bp=cp=0; solid, dashed and dashed-dotted lines correspond to xp=0.5, 0 and 1, respectively.)
The results presented inFigs. 1 (top) and 2 (top)clearly indicate that, forp=1, the steepness of the solution nearx=0 increases asβis increased, whereas a comparison between the results presented inFigs. 1 (top) and 2 (top)indicates that the concentration profiles are nearly independent ofβand exhibit a boundary layer atx=0 for
p=1000. Note that Eq.(1)becomes convection-dominated for large values ofp.
In order to show the effects of the drift forcep(x)on the concentration profiles, we have applied the method proposed here to Eq.(1)with the quadraticp(x)of Eq.(6)and some sample results are exhibited inFig. 4. This figure indicates that, as the magnitude ofap is increased, the steepness of the concentration profiles nearx=0 is
increased as indicated in the upper left frame ofFig. 4, whereas the concentration profile is a monotonic decreasing function ofx for bp=0.1 and 1 and exhibits a relative maximum forbp=10; the amplitude of this relative
maximum increases asbpis increased.
The results presented in the lower left frame ofFig. 4are similar to those presented in the upper left frame of the same figure and indicate that the steepness of the concentration profiles nearx=0 increases as the magnitude of cp is increased. Finally, the results presented in the lower right frame ofFig. 4 show that the steepness of
the concentration profiles nearx=0 decreases as xp (0xp1)is decreased; this is consistent with the fact
respectively, whereap=10, and, therefore, the magnitude of the convection terms near this boundary decreases as
xpis decreased from 1 to 0.
5. Conclusions
A piecewise linearization method for linear, second-order differential equations arising from the Laplace trans-formation of one-dimensional non-Fickian diffusion problems with potential fields has been developed. The method is based on the piecewise linearization of the nonhomogeneous coefficients, provides piecewise analytical solutions and a three-point difference equation, is exact for constant coefficients, second-order, linear ordinary differential equations with constant right-hand sides, and provides monotonic solutions even at high mesh Reynolds numbers. For grid spacings larger than the boundary layer thickness, the method preserves the positivity of the solution, is free from unphysical oscillations and predicts a boundary layer thickness on the order of the mesh size.
The results of the method have been compared with those of an available finite-volume formulation based on the use of exponential shape functions which has been improved by accounting for the spatial dependence of the drift forces, and it has been found that finite-volume discretizations are much less accurate than exponentially-fitted techniques for large constant drift forces and exhibit unphysical oscillations when these forces are large.
It has also been found that space-dependent drift forces affect strongly the concentration profiles which may ex-hibit either an exponentially decreasing trend from the boundary layer at the left end or relative maxima depending on the coefficients of the parabolic function that specifies these forces.
Acknowledgements
This research was partially financed by Project BFM2001-1902 from the Ministerio de Ciencia y Tecnología of Spain and fondos FEDER.
References
[1] H.-T. Chen, K.-C. Liu, Analysis of non-Fickian diffusion problems in a composite medium, Comput. Phys. Comm. 150 (2003) 31–42. [2] D.N. de G. Allen, R.V. Southwell, Relaxation methods applied to motion, in two dimensions, of a viscous fluid past a fixed cylinder, Quart.
J. Mech. Appl. Math. 8 (1955) 129–145.
[3] D.I. Scharfetter, H.K. Gummel, Large-signal analysis of a silicon Read diode oscillator, IEEE Trans. Electron. Devices ED-16 (1969) 64–77.
[4] A.M. Il’in, A difference scheme for a differential equation with a small parameter affecting the highest derivative, Mat. Zametki 6 (1969) 237–248.
[5] H.-G. Roos, Ten ways to generate Il’in and related schemes, J. Comput. Appl. Math. 53 (1994) 43–59. [6] J.I. Ramos, On diffusive and exponentially fitted techniques, Appl. Math. Comput. 103 (1999) 69–96.