Abstract

Numerical solutions of one-dimensional heat and advection-diffusion equations are obtained by collocation method based on cubic B-spline. Usual finite difference scheme is used for time and space integrations. Cubic B-spline is applied as interpolation function. The stability analysis of the scheme is examined by the Von Neumann approach. The efficiency of the method is illustrated by some test problems. The numerical results are found to be in good agreement with the exact solution.

1. Introduction

The combination of advection and diffusion is important for mass transport in fluids. It is well known that the volumetric concentration of a pollutant, 𝑢(𝑥,𝑡), at a point 𝑥(𝑎𝑥𝑏) in a one-dimensional moving fluid with a constant speed 𝛽 and diffusion coefficient 𝛼 in 𝑥 direction at time 𝑡(𝑡0) is given by the one-dimensional advection-diffusion equation, which is in the form𝑢𝑡+𝛽𝑢𝑥=𝛼𝑢𝑥𝑥,𝑎𝑥𝑏,𝑡0,(1.1) subject to the initial condition[]𝑢(𝑥,0)=𝜙(𝑥),𝑥𝑎,𝑏,(1.2) and the boundary conditions𝑢(𝑎,𝑡)=𝑔0(𝑡),(1.3a)𝑢(𝑏,𝑡)=𝑔1[],(𝑡),𝑡0,T(1.3b)where 𝑔0 and 𝑔1 are assumed to be smooth functions. It should be noted that, when 𝛽=0, the advection-diffusion equation will be reduced to the one-dimensional heat equation in the case of thermal diffusion.

Advection-diffusion equation arises very frequently in transferring mass, heat, energy, and vorticity in chemistry and engineering. Thus, it has been of interest to many authors. A third-degree 𝐵-spline function has been used by Caglar et al. for solving one-dimensional heat equation with a nonlocal initial condition [1]. Mohebbi and Dehghan [2] have presented a fourth-order compact finite difference approximation and cubic 𝐶1-spline collocation method for the solution with fourth-order accuracy in both space and time variables, 𝑂(4,𝑘4). In [3], Dag and Saka concluded that collocation scheme is easy to implement compared to other numerical methods with giving a better result.

In this paper, a combination of finite difference approach and cubic 𝐵-spline method would be considered to solve the one-dimensional heat and advection-diffusion equation. Forward finite difference approach would be used for discretizing the derivative of time, while cubic 𝐵-spline would be applied to interpolate the solutions at time 𝑡. Von Neumann approach would be used to prove the unconditionally stable property of the method. Finally, the approximated solutions and the numerical errors would be presented to demonstrate the efficiency of the method.

2. Collocation Method

In this paper, cubic 𝐵-splines are used to construct the numerical solutions to solve the problems. Consider a partition of [𝑎,𝑏] that is equally divided by knots 𝑥𝑖 into 𝑛 subinterval [𝑥𝑖,𝑥𝑖+1], where 𝑖=0,1,,𝑛1 such that 𝑎=𝑥0<𝑥1<<𝑥𝑛=𝑏. Hence, an approximation 𝑈(𝑥,𝑡) to the exact solution 𝑢(𝑥,𝑡) based on collocation approach can be expressed as [4]𝑈(𝑥,𝑡)=𝑛1𝑖=3𝐶𝑖(𝑡)𝐵3,𝑖(𝑥),(2.1) where 𝐶𝑖(𝑡) are time-dependent quantities to be determined and 𝐵3,𝑖(𝑥) are third-degree 𝐵-spline functions which are defined by the relationship [5]𝐵3,𝑖1(𝑥)=63𝑥𝑥𝑖3𝑥,𝑥𝑖,𝑥𝑖+1,3+32𝑥𝑥𝑖+1+3𝑥𝑥𝑖+123𝑥𝑥𝑖+13𝑥,𝑥𝑖+1,𝑥𝑖+2,3+32𝑥𝑖+3𝑥𝑥+3𝑖+3𝑥2𝑥3𝑖+3𝑥3𝑥,𝑥𝑖+2,𝑥𝑖+3,𝑥𝑖+4𝑥3𝑥,𝑥𝑖+3,𝑥𝑖+4,(2.2) where =(𝑏𝑎)/𝑛. The approximation 𝑈𝑘𝑖 at the point (𝑥𝑖,𝑡𝑘) over the subinterval [𝑥𝑖,𝑥𝑖+1] can be simplified into𝑈𝑘𝑖=𝑖1𝑗=𝑖3𝐶𝑘𝑗𝐵3,𝑗(𝑥),(2.3) where 𝑖=0,1,,𝑛. To obtain the approximations of the solutions, the values of 𝐵3,𝑖(𝑥) and its derivatives at the knots are needed. Since the values vanish at all other knots, they are omitted from Table 1.

The approximations of the solutions of (1.1) at 𝑡𝑗+1th time level can be considered by [6]:𝑈𝑡𝑘𝑖+(1𝜃)𝑓𝑘𝑖+𝜃𝑓𝑖𝑘+1=0,(2.4)

where 𝑓𝑘𝑖=𝛽(𝑈𝑥)𝑘𝑖𝛼(𝑈𝑥𝑥)𝑘𝑖 and the superscripts 𝑘 and 𝑘+1 are successive time levels, 𝑘=0,1,2,. Now, discretizing the time derivative by a first-order accurate forward difference scheme and rearranging the equation, we obtain𝑈𝑖𝑘+1+𝜃Δ𝑡𝑓𝑖𝑘+1=𝑈𝑘𝑖(1𝜃)Δ𝑡𝑓𝑘𝑖,(2.5) where Δ𝑡 is the time step. Note that the system becomes an explicit scheme when 𝜃=0, a fully implicit scheme when 𝜃=1, and a mixed scheme of Crank-Nicolson when 𝜃=0.5 [6]. Here, Crank-Nicolson approach is used. Hence, (2.5) takes the form𝑈𝑖𝑘+1+0.5Δ𝑡𝑓𝑖𝑘+1=𝑈𝑘𝑖0.5Δ𝑡𝑓𝑘𝑖(2.6) for 𝑖=0,1,,𝑛 at each level of time. Therefore, a linear system of order (𝑛+1) is obtained with (𝑛+3) unknowns 𝐂𝑘+1=(𝐶𝑘+13,𝐶𝑘+12,,𝐶𝑘+1𝑛1) at the level time 𝑡=𝑡𝑘+1. To solve the system, two additional linear equations are needed. Thus, (2.3) is applied to the boundary conditions (1.3a)-(1.3b) to obtain𝑈0𝑘+1=𝑔0𝑡𝑘+1,𝑈(2.7a)𝑛𝑘+1=𝑔1𝑡𝑘+1.(2.7b)Equations (2.6), (2.7a)-(2.7b) lead to a (𝑛+3)×(𝑛+3) tridiagonal matrix system, which can be solved by the Thomas algorithm. Once the initial vector 𝐂0 has been calculated from the initial conditions [7], the approximation solution 𝑈𝑖𝑘+1 at each level of time 𝑡𝑘+1 can be determined by the vector 𝐂𝑘+1 which is found by solving the recurrence relation repeatedly.

The initial vector 𝐂0 can be obtained from the initial condition and boundary values of the derivatives of the initial condition as the following expressions [6]:(1)(𝑈0𝑖)𝑥=𝜙(𝑥𝑖), 𝑖=0,(2)𝑈0𝑖=𝜙(𝑥𝑖), 𝑖=0,1,,𝑛,(3)(𝑈0𝑖)𝑥=𝜙(𝑥𝑖), 𝑖=𝑛.

This yields a (𝑛+3)×(𝑛+3) matrix system where the solution can be found by Thomas algorithms.

3. Stability Analysis

Von Neumann stability method is applied for analyzing the stability of the proposed scheme. This type of stability analysis had been used by many researchers [3, 810]. Consider the trial solution (one Fourier mode out of the full solution) at a given point 𝑥𝑚𝐶𝑘𝑚=𝛿𝑘exp(𝑖𝜂𝑚),(3.1) where 𝑖=1and 𝜂 is the mode number. By substituting (2.3) into (2.5) and rearranging the equation, it leads to𝑝1𝐶𝑘+1𝑚3+𝑝2𝐶𝑘+1𝑚2+𝑝3𝐶𝑘+1𝑚1=𝑝4𝐶𝑘𝑚3+𝑝5𝐶𝑘𝑚2+𝑝6𝐶𝑘𝑚1,(3.2) where 𝑝1=16+𝜃Δ𝑡𝛽2𝜃Δ𝑡𝛼2,𝑝2=46+2𝜃Δ𝑡𝛼2,𝑝3=16𝜃Δ𝑡𝛽2𝜃Δ𝑡𝛼2,𝑝4=16(1𝜃)Δ𝑡𝛽+2(1𝜃)Δ𝑡𝛼2,𝑝5=462(1𝜃)Δ𝑡𝛼2,𝑝6=16+(1𝜃)Δ𝑡𝛽+(21𝜃)Δ𝑡𝛼2.(3.3) Inserting the trial solution (3.1) into (3.2) and simplifying the equation give𝛿=𝐴+𝑖𝐵𝐶+𝑖𝐷,(3.4) where1𝐴=3(2+cos𝜂)2(1𝜃)Δ𝑡𝛼2(1cos𝜂),𝐵=(1𝜃)Δ𝑡𝛽1sin𝜂,𝐶=3(2+cos𝜂)+2𝜃Δ𝑡𝛼2(1cos𝜂),𝐷=𝜃Δ𝑡𝛽sin𝜂.(3.5) If the amplification factor |𝛿|1, then the proposed scheme is stable, or else the approximations grow in amplitude and become unstable. As 𝜃=0.5 is used in the proposed scheme, thus substitute the 𝜃 value into (3.4) and after some algebraic manipulation, it can be noticed that𝑎2+𝑏2𝑐2+𝑑2||𝛿||or2=𝑎2+𝑏2𝑐2+𝑑21.(3.6) Thus, this had been proved that the presented numerical scheme for the advection-diffusion equation is unconditionally stable.

4. Numerical Results

4.1. Problem 1

Suppose the heat equation is as follows [11]:𝑢𝑡=𝑢𝑥𝑥,0<𝑥<1,𝑡>0,(4.1)

with initial and boundary conditions𝑢(𝑥,0)=sin(𝜋𝑥),𝑢(0,𝑡)=𝑢(1,𝑡)=0.(4.2) The exact solution is known to be 𝑢(𝑥,𝑡)=exp(𝜋2𝑡)sin(𝜋𝑥). This problem is tested by different values of and Δ𝑡 to show the capability of the presented method for solving one-dimensional heat equation. The final time is chosen as 𝑇=1. The maximum absolute errors of the method are compared with those obtained by Crank-Nicolson (CN) scheme and compact boundary value method (CBVM) in [11]. The numerical errors are presented in Table 2. Although the fourth-order compact boundary value method gives a much more better solution, the present method is still well compared with the Crank-Nicolson scheme.

4.2. Problem 2

Consider the advection-diffusion equation in (1.1) with 𝛽=1, 𝛼=0.1, as follows [2]:𝑢𝑡+𝑢𝑥=0.1𝑢𝑥𝑥,0<𝑥<1,𝑡>0,(4.3)

where the initial condition is given by𝜋𝑢(𝑥,0)=exp(5𝑥)cos2𝑥𝜋+0.25sin2𝑥(4.4)

and the exact solution5𝑡𝑢(𝑥,𝑡)=exp𝑥2𝜋exp2𝑡𝜋40cos2𝑥𝜋+0.25sin2𝑥.(4.5) The boundary conditions at 𝑥=0 and 𝑥=1 can be obtained from the exact solution. Table 3 shows the absolute errors of the approximations at the grid points when 𝑇=2. It can be noticed that the present method is comparable with cubic 𝐶1-spline collocation method. The approximations of the solutions over a time period 𝑡[0,2] along 𝑥 is depicted in Figure 1.

5. Conclusions

A numerical method based on collocation of cubic 𝐵-spline had been described in the previous section for solving one-dimensional heat and advection-diffusion equations. A finite difference scheme had been used for discretizing time derivatives and cubic 𝐵-spline for interpolating the solutions at each time level. From the test problems, the obtained results show that the presented method is capable for solving one-dimensional heat and advection-diffusion equations accurately with a promised stability.

Acknowledgment

The authors would like to acknowledge with thanks the financial support from Malaysian Government in the form of Fundamental Research Grant Scheme (FRGS) of number 203/PMATHS/6711150.