Abstract
A fourth-order numerical method based on cubic B-spline functions has been proposed to solve a class of advection–diffusion equations. The proposed method has several advantageous features such as high accuracy and fast results with very small CPU time. We have applied the Crank–Nicolson method to solve the advection–diffusion equation. The stability analysis is performed, and the method is shown to be unconditionally stable. Error analysis is carried out to show that the proposed method has fourth-order convergence. The efficiency of the proposed B-spline method has been checked by applying on ten important advection–diffusion problems of three types, having Dirichlet, Neumann and periodic boundary conditions. Considered examples prove the mentioned advantages of the method. The computed results are also compared with those available in the literature, and it is found that our method is giving better results.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
Introduction
Consider the one-dimensional convection–diffusion equation
where \(\epsilon\) and \(\gamma\) are convection and diffusion coefficients, respectively. The initial condition is defined by
The boundary conditions are as follows:
-
(a)
The Dirichlet boundary conditions are given by
$$\begin{aligned} u(a,t)=f_1(t), \,\ u(b,t)=f_2(t), \end{aligned}$$(1.3) -
(b)
The Neumann boundary conditions are defined by
$$\begin{aligned} \frac{\partial u}{\partial x}(a,t)=g_1(t) , \,\ \frac{\partial u}{\partial x}(b,t)=g_2(t), \end{aligned}$$(1.4)and
-
(c)
The periodic boundary conditions can be written as
$$\begin{aligned} u(a,t)=u(b,t). \end{aligned}$$(1.5)If the boundary conditions are periodic, then the total heat(mass) is conserved, i.e.,
$$\begin{aligned} m(t)&= \int ^{b}_{a}u(x,t)\mathrm{d}t\nonumber \\ &= \hbox {k}\,(\hbox {constant}). \end{aligned}$$(1.6)
The advection–diffusion equation represents many problems of physics, chemistry and biology. It describes physical phenomena in which energy is transformed during two processes, namely advection and diffusion. It presents advection and diffusion of quantities such as mass, energy, heat, etc. The advection–diffusion equation can be used to depict water transfer in soils [1], transportation of pollutants in the atmosphere [2], diffusion of pollutants in rivers and stream [3], transfer of energy [4] and fluid [5] through the medium. Different numerical methods have been given to solve advection–diffusion equations due to wide applicability of this equation in different areas. Rizwan and Uddin presented second-order space and time nodal method [6]. Different numerical methods have been given by Dehghan for finding numerical solutions for this equation. Most of his methods are based on finite difference implicit or explicit schemes and are used to solve one- and three-dimensional advection–diffusion equations. Dehghan presented the weighted finite difference scheme [5] and high-order compact scheme [7] for the numerical study of the advection–diffusion equation. Other methods given by Dehghan can be seen in [8,9,10,11]. The advection–diffusion equation was studied numerically by Salkuyeh [12]. Karahan [13, 14] developed finite difference methods to solve this equation numerically. Zhang and Ding [15] developed a new difference scheme to get numerical solutions. Several spline-based methods have been given to solve (1.1) such as spline functions [16], exponential cubic spline [17], cubic B-splines [18, 19], cubic B-spline differential quadrature method [20], redefined splines [4], B-spline finite element [21, 22], the Taylor–Galerkin method [22] and the Taylor–Galerkin finite element method [23]. In the classical method of B-spline collocation, we just replace the unknown function and its derivatives by spline approximations for the function and its derivatives, respectively, and apply the Crank–Nicolson scheme or Runge–Kutta methods to get solutions at the grid points. The B-spline approximations of the unknown function u and its first derivative are of the fourth order, and those for the double derivative are of the second order.
In this work, we have introduced two different end conditions for the double derivatives to develop a fourth-order method having a higher order of convergence. In short, we have improved approximation for the double derivative by using different end conditions which resulted in very good numerical solutions. The fourth-order approximation for \(u^{''}(x)\) can be obtained by taking one more term in the Taylor series expansion. A collocation method is applied to find the solution. One of the advantages of the method is that the solution can be obtained at any point of the domain.
The rest of the paper is organized as follows. In “Cubic B-spline functions” section, we have discussed the properties of spline functions. In “Implementation of the method” section, the implementation of the method to (1.1) has been explained. In “Error analysis” section, the convergence has been checked. “ Stability analysis” section contains the stability analysis followed by “Numerical experiments” section which contains test problems taken from the literature. A conclusion has been added in “Conclusion” section to briefly summarize the outcomes of the research work.
Cubic B-spline functions
A spline is a function that is piecewise defined by polynomial functions and possesses a high degree of smoothness at the places where polynomial pieces connect. A B-spline is a spline function that has minimal support with respect to given degree smoothness and domain partition. The cubic B-spline functions are defined as follows
where \(\big \{B_{-1}(x),B_0(x),B_1(x),B_2(x),\ldots ,B_N(x),B_{N+1}(x)\big \}\) forms a basis over the considered interval.
Consider a uniform partition of the problem domain \(a\le x \le b\) by the knots \(x_i\), \(i=0,1,2 \ldots N\) such that \(x_{i}-x_{i-1}=h\) is the length of each interval.
In the cubic B-spline collocation method, we approximate exact solution u(x, t) by S(x, t) in the form [24]
where \(c_j(t)\)’s are time-dependent quantities which we determine from the boundary conditions and collocation from the differential equation. We assume that the approximate solution S(x, t) satisfies the following interpolatory and boundary conditions
If u(x, t) is sufficiently smooth and S(x, t) is the unique cubic spline interpolant satisfying the above end conditions, then we have from [25]
The approximate values S(x, t) and their first-order derivatives at the knots are defined by using finite difference and Taylor expansions as follows
Using (2.7)–(2.9) in (2.5)–(2.6), we get
(2.11) to (2.13) can be written as
Using (2.1)–(2.2), (2.14)–(2.16) can be further simplified to get
We will use these formulae in the next section.
Implementation of the method
Applying the Crank–Nicolson scheme to Eq. (1.1), it can be written as
Separating the terms of advanced and initial level, we get
For \(j=0\),
For \(1 \le j \le N-1\),
for \(j=N\), we have
Rearranging the terms for \(j=0\), we may write
where
and
and for \(j=1,2 \ldots N-1,\) we get
where \(x_1=\frac{\gamma \Delta t}{4h^2},\)
for \(j=N\),
where
and
Thus, we get the following system
where \(c=[c_{-1},c_0,c_1,c_2 \ldots c_{N},c_{N+1}]^T\)
We have \(N+1\) equations in \(N+3\) unknowns. It may be observed that \(c_{-1}\) and \(c_{N+1}\) can be eliminated with the help of the Dirichlet or Neumann boundary conditions to get \(N+1\) equations in \(N+1\) unknowns. In the case of the periodic boundary condition, we solve for \(c_{0}\)...\(c_{N-1}\) only. The system obtained on eliminating \(c_{-1}\) and \(c_{N+1}\) can be solved at any desired time level starting with the initial vector \([c^{(0)}_{0},c^{(0)}_{1},c^{(0)}_{2} \ldots c^{(0)}_{N-1},c^{(0)}_{N}]^T\). The initial vector can be determined by using the B-spline approximation of the initial condition of the problem.
Error analysis
In this section, we have found an error bound for the presented method. From (2.1), we get the following expressions
Then, as given in [26], we can use the operator notation \(E(S(x_i))=S(x_{i+1})\) and \(E=e^{hD}\) where \(D\equiv d/dx\). We obtain the following expressions
Using the above relations in (4.4) and (4.5), we obtain
Now, using (4.6)–(4.7) in (4.8), we obtain
which can be simplified to get
We further simplify the above to get
From (4.9) and (4.13), we obtain
Expanding \(e^{hD}\) and rearranging the terms of the above equation, we obtain
Error analysis of convection–diffusion equation
As discussed above, we have applied the following approximations
Truncation error associated with the time discretization of convection–diffusion equation can be found by the typical finite difference formulation. Consider
We discretize the time derivative by finite difference to get
We apply the Taylor series expansion
The truncation error of convection–diffusion equation is
Substituting the values of errors introduced by space and time approximations, the truncation error of convection–diffusion equation may be given by
Hence, the final truncation error is
Hence, the spline approximation used in the proposed method with uniformly distributed interior points is \(O(\Delta t^2+h^4)\)accurate.
Stability analysis
To check the stability of the scheme derived by the Crank–Nicolson and the fourth-order B-spline method, we have applied the Fourier-series (von Neumann) method. As discussed in “Cubic B-spline functions” section, applying the Crank–Nicolson on (1.1), we obtain the following difference scheme
where \(x_i\)’s have values as given in the previous section. Substituting \(c^n_j=A\xi ^n exp(ij\phi h)\), where \(i=\sqrt{-1}\), A is amplitude, h is step length and \(\phi\) is mode number, we get
We further simplify (5.2) by substituting values of \(x_i\)’s. We thus get the following expression
which may be written as
where \(X_1=4h^2(\mathrm{cos}(\phi h)+2)-\gamma \Delta t(9-8\mathrm{cos}(\phi h)-\mathrm{cos}(2 \phi h))\)
and \(Y=6\epsilon h \Delta t \mathrm{sin}(\phi h)\)
which gives \(|\xi |^2=\frac{X_1^2+Y^2}{X_2^2+Y^2}\)
For stability, we must have \(|\xi | \le 1\).
That is,\(\frac{X_1^2+Y^2}{X_2^2+Y^2}\le 1\)
Hence, for stability, we need to show that \(X_1^2\le X_2^2\)
We note that \(X_1^2-X_2^2=(X_1+X_2)(X_1-X_2)=(8h^2(\mathrm{cos}(\phi h)+2))\big [-2\gamma \Delta t(9-8\mathrm{cos}(\phi h)-\mathrm{cos}(2 \phi h))\big ]\le 0\)
Hence, the difference scheme is stable for any value of \(\Delta t\) and any value of \(\Delta x\). That is, the difference scheme is unconditionally stable.
Numerical experiments
We apply the cubic B-spline based method to 11 problems taken from the literature which have been categorized into problems having Dirichlet, Neumann and periodic boundary conditions. The accuracy of the method has been calculated by using maximum absolute error norms given by
where \(U^{N}\) stands for numerical solution. \(u_{i}^{exact}\) and \(U^{N}_{i}\) represent exact solution and numerical solution at the knot \(x_{i}\), respectively. The rate of convergence for the method has been calculated using the following formula
where \(E(N_1)\) and \(E(N_2)\) represent maximum absolute error with number of grid points \(N_1\) and \(N_2\), respectively. The Peclet number is defined by
\(P_e=\)heat transport by convection/heat transport by diffusion=\(\frac{\epsilon }{\gamma }\). The obtained results are presented in tabular form and illustrated in graphs also.
Problems having Dirichlet boundary conditions
Example 1
We consider the advection–diffusion problem [9] in (0, 2) with exact solution
Boundary conditions are taken from the exact solution, and initial condition is
This problem is solved with \(\Delta t=0.001\) for different values of N. Computed results for \(N=120\) at \(t=1.0\) for different values of \(P_e\) are reported in Table 1 and compared with those obtained with \(\Delta t=0.00078125\) by the fourth-order method given by Dehghan [9]. It may be noticed that our method is giving good results even at high Peclet number. Table 2 shows the results for different values of \(\gamma\) and \(\epsilon =1.0\). Absolute errors for different values of N at \(t=1.0\), \(\epsilon =1.0\) and \(\gamma =0.001\) are reported in Table 3. It can be observed that solutions are very accurate and the CPU time is very small. Numerical solutions are depicted in Figs. 1 and 2 with \(\gamma =1.0\), \(t \le 2\) and \(\gamma =0.001\), \(t \le 1\), respectively.
Example 2
We consider the advection–diffusion Eq. (1.1) in (0, 1) with \(\epsilon =1.0\), \(\gamma =0.1\) and following initial condition
The exact solution [9] of this advection–diffusion equation is given by
Absolute errors with \(\Delta t=0.01\) for different values of h at \(t=2\) are reported in Table 4. It is observed that our results are better than those given by Dehghan [9]. In Table 6, absolute errors at \(t=5.0\) are given and also compared with the errors obtained by Mittal and Jain [4]. We can conclude from the table that the results obtained by the present method are better than those obtained by redefined B-splines. Numerical results obtained for \(t\leqslant 2\) are depicted in Fig. 3 for \(N=20\) and \(\Delta t=0.01\) (Figs. 4, 5).
Example 3
We consider (1.1) with the steady-state solution [27] given by
Initial and boundary conditions are taken from the exact solution(4.6). Numerical solutions at \(t=1.0,t=5.0\) and \(t=10.0\) are reported in Table 5 with \(\Delta t=0.1\) and \(N=300\). Numerical solutions have been plotted in Fig. 4 against the values of x and t. CPU time has been estimated to be 1 second. Maximum absolute errors, rate of convergence and CPU time at different values of N are represented in Table 6. We observe that CPU time is very small even at large values of N.
Example 4
We consider (1.1) in (0, 1) with the following boundary conditions
and with the initial condition given by
The exact solution [4] of the problem is
where \(s=1+200\gamma t\). Absolute errors at different grid points are given in Table 7 at time levels of \(t=0.5\), \(t=1.0\) and \(t=5.0\) with \(N=10\). Results obtained by the present method are compared with those obtained by Nazir et al [28] in Table 8. Our solutions are found to be better than the solutions given in [4, 29] and [28]. Numerical and exact solutions have been plotted in Fig. 5. We can see that numerical results coincide with the exact results.
Example 5
We consider problem [30] with an analytical solution of a Gaussian pulse of unit height with its center at \(x=1\) in a domain [0, 9]. Its analytical solution is given by
The initial condition is obtained from the exact solution by taking \(t=0\). The boundary conditions are given by \(u(0,t)=u(9,t)=0\). We performed numerical simulations up to time \(t=5\) with \(\epsilon =.008\) and \(\gamma =.5\), and results are reported in Table 9 and compared with those given in [30]. We found that the fourth-order method is giving better results than QRTDQ and QNTDQ with very small CPU time.
Problems having Neumann boundary conditions
Example 6
We consider the advection–diffusion equation with the boundary conditions
and with the initial condition defined by
The problem has the exact solution [28] of the form
We consider this problem in (0, 2). Absolute errors at grid points for different Peclet numbers are illustrated in Table 10. It may be seen that excellent results have been obtained. Table 11 contains absolute errors and CPU time for different values of N at \(t=1.0\). Space and time graphs of numerical and exact solutions are given in Figs. 6 and 7 for \(\gamma =0.01\) and \(\gamma =0.001\), respectively. In Fig. 8, numerical and exact solutions are depicted up to time \(t=5.0\) with \(\epsilon =\gamma =1.0\). It may be seen that approximate solutions are very close to the exact solutions.
Example 7
Let us consider the advection–diffusion Eq. (1.1) with the following exact solution [22]
Boundary conditions are defined as follows
Initial condition is given by
This problem has been solved by taking \(\alpha =0.02854797991928\), \(\beta =-0.0999\), \(\Delta t=0.001\) , \(N=40\), \(\epsilon =3.5\) and \(\gamma =0.022\). Excellent results have been obtained which are presented in tabular form (Table 12) and compared with the solutions obtained by Mittal and Jain [22]. It is noticed that our method is better than the methods given in [22].
Example 8
Consider (1.1) with the exact solution [22]
where \(\alpha =1.17712434446770\), \(\beta =-0.09\), \(\Delta t=0.001\), \(N=80\), \(\epsilon =0.1\) and \(\gamma =0.2\). Initial and Neumann boundary conditions are taken from the exact solution. We computed results for different values of parameters which are reported in Table 13. Our results are better than the results obtained by [22].
Example 9
We consider the following Neumann boundary conditions for (1.1) in (0, 1)
Initial condition is \(u(x,0)=a \,\ exp(-cx)\), and the exact solution is [31]
where \(c=\frac{-\epsilon +\sqrt{\epsilon ^2+4\gamma b}}{2\gamma }\), \(a=1.0\) and \(b=0.1\). We carried out numerical experiments by taking different values of \(\epsilon\) and \(\gamma\). Results obtained for \(\Delta t=0.001\) and \(h=0.1\) are reported in Table 14. It may be observed that results are very good. Computed results up to time \(t=1\) are depicted in Fig. 9. It may be found that the space and time graph is the same as illustrated by [22, 31].
Periodic problems
Example 10
We consider the advection–diffusion Eq. (1.1) with the exact solution given by
This equation represents a decaying traveling wave. The initial condition is taken from the exact solution of the problem. The boundary conditions are periodic in the considered interval and may be given as
Computed results are illustrated in Fig. 10 and presented in Table 15. Figure 10 depicts exact and numerical solutions at \(t=0.1\), 0.2, 0.3, 0.4 and \(t=0.5\). It may be observed that numerical solutions are very close to the exact values. We calculated the value of m(t) and found that it is a constant for different time levels.
Example 11
We consider the periodic problem [32] with the boundary condition
and with the initial condition \(u(x,0)=cos(2\pi x)\),\(0<x<1\). The problem has exact solution given by
The computed absolute errors at \(t=0.1,0.2\) and \(t=0.3\) are given in Table 16. Figure 11 depicts the numerical and the exact results with \(\epsilon =1.0\) and \(\gamma =0.001\) at \(t=0.1\) and \(t=0.2\). It may be seen that the results obtained by the proposed method are very good.
We evaluated m(t) for t\(=0.1\), 0.2 and 0.3.
Conclusion
-
(a)
The proposed method produces very accurate results with very small CPU time.
-
(b)
The stability analysis is performed by using the von Neumann’s method, and proposed spline-based fourth-order method has been shown to be unconditionally stable.
-
(c)
The convergence analysis has been carried out, and it is shown that the proposed method is \(O(\Delta t^2+h^4)\) accurate.
-
(d)
The method is stable, so the time step can be taken large compared with some other known methods. This allows one to find solution at a high level of time.
-
(e)
Ten important convection–diffusion problems have been studied and shown to have very accurate solutions.
-
(f)
The obtained results are presented in tables and depicted in figures also. We can observe that the method is applicable for convection-dominated problems as well as for diffusion-dominated problems.
-
(g)
The method can solve very efficiently a large class of partial differential equations having the Dirichlet, Neumann or periodic boundary conditions.
-
(h)
We would like to extend our research work in this direction by taking hyperbolic and two-dimensional problems.
References
Parlarge, J.Y.: Water transport in soils. Ann. Rev. Fluid Mech. 2, 77–102 (1980)
Zlatev, Z., Berkowicz, R., Prahm, L.P.: Implementation of a variable step-size variable formula in the time-integration part of a code for treatment of longrange transport of air pollutants. J. Comput. Phys. 55 (1984)
Chatwin, P.C., Allen, C.M.: Mathematical models of dispersion in rivers and estuaries. Ann. Rev. Fluid Mech. 17, 119–149 (1985)
Mittal, R.C., Jain, R.K.: Redefined cubic B-spline collocation method for solving convection diffusion equations. Appl. Math. Model. 36, 5555–5573 (2012)
Dehghan, M.: Weighted finite difference techniques for the one-dimensional advection–diffusion equation. Appl. Math. Comput. 147, 307–319 (2004)
Rizwan-Uddin: A second-order space and time nodal method for the one-dimensional convection–diffusion equation. Comput. Fluids 26, 233–247 (1997)
Mohebbi, A., Dehghan, M.: High-order compact solution of the one-dimensional heat and advection–diffusion equations. Appl. Math. Model. 34, 3071–3084 (2010)
Dehghan, M.: Numerical solution of the three-dimensional advection–diffusion equation. Appl. Math. Comput. 150, 5–19 (2004)
Dehghan, M., Mohebbi, A.: High-order compact boundary value method for the solution of unsteady convection–diffusion problems. Math. Comput. Simul. 79, 683–699 (2010)
Dehghan, M.: Quasi-implicit and two-level explicit finite-difference procedures for solving the one-dimensional advection equation. Appl. Math.Comput. Simul. 167, 46–67 (2005)
Singh, I., Kumar, S.: Approximate solution of convection diffusion equation using Haar wavelet. Italian J. Pure Appl. Math. 35, 143–154 (2015)
Salkuyeh, D.K.: On the finite difference approximation to the convection-diffusion equation. Appl. Math. Comput. 179 (2006)
Karahan, H.: Unconditional stable explicit finite difference technique for the advection–diffusion equation using spreadsheets. Adv. Eng. Softw. 38, 80–86 (2007)
Karahan, H.: Implicit finite difference techniques for the advection–diffusion equation using spreadsheets. Adv. Eng. Softw. 37, 601–608 (2006)
Ding, H.F., Zhang, Y.X.: A new difference scheme with high accuracy and absolute stability for solving convection–diffusion equations. J. Comput. Appl. Math. 230, 600–606 (2009)
Szymkiewicz, R.: Solution of the advection–diffusion equation using the spline function and finite elements. Commun. Numer. Methods Eng. 9, 197–206 (1993)
Mohammadi, R.: Exponential B-spline solution of convection–diffusion equations. Appl. Math. 4, 933–944 (2013)
Mittal, R.C., Jain, R.K.: Numerical solution of convection–diffusion equation using cubic B-splines collocation methods with Neumann’s boundary conditions. Int. J. Appl. Math. Comput. 4, 115–127 (2012)
Goh, J., Majid, A.A., Ismail, A.I.B. Md.: Cubic B-spline collocation method for one-dimensional heat and advection–diffusion equations. J. Appl. Math. Article ID 458701 (2012)
Korkmaz, A., Dag, I.: Cubic B-spline differential quadrature methods for the advection–diffusion equation. Int. J. Numer. Methods Heat Fluid Flow 22, 1021–1036 (2012)
Gardner, L.R.T., Dag, I.: A numerical solution of the advection-diffusion equation using B-spline finite element. In: Proceedings of the International AMSE Conference on Systems Analysis, Control and Design, Lyon, France, pp. 109–116 (1994)
Dag, I., Canivar, A., Sahin, A.: Taylor–Galerkin method for advection–diffusion equation. Kybernetes 40, 762–777 (2011)
Kadalbajoo, M.K., Arora, P.: Taylor–Galerkin B-spline finite element method for the one dimensional advection–diffusion equation. Numer. Methods Par. Diff. Eqs. 26, 1206–1223 (2009)
Prenter, P.M.: Splines and Variational Methods. Wiley, Hoboken (1989)
Lucas, T.R.: Error bounds for interpolating cubic splines under various end conditions. Siam J. Numer. Anal. 11, 569–584 (1975)
Sastry, S.S.: Introductory Methods of Numerical Analysis, fourth ed., PHI Learning (2009)
Salama, A.A., Zidan, H.Z.: Fourth order schemes of exponential type for singularly perturbed parabolic partial differential equations. J. Math. 36 (2006)
Nazir, T., Abbas, M., Ahmad Izani, M., Ismail, A.A., Majid, A.R.: The numerical solution of advection–diffusion problems using new cubic trigonometric B-splines approach. Appl. Math. Model. 40, 4586–4611 (2016)
Chawla, M.M., Al-Zanaidi, M.A., Al-Aslab, M.G.: Extended one step time-integration schemes for convection–diffusion equations. Comput. Math. Appl. 39, 71–84 (2000)
Korkmaz, A., Dag, I.: Quartic and quintic B-spline methods for advection–diffusion equation. Appl. Math. Comput. 274, 208–219 (2016)
Cao, H.-H., Liu, L.-B., Zhang, Y., Fu, S.: A fourth-order method of the convection–diffusion equations with Neumann boundary conditions. Appl. Math. Comput. 217, 9133–9141 (2011)
Chen, N., Haiming, G.: Alternating group explicit iterative methods for one-dimensional advection–diffusion equation. Am. J. Comput. Math. 5, 274–282 (2015)
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Mittal, R.C., Rohila, R. The numerical study of advection–diffusion equations by the fourth-order cubic B-spline collocation method. Math Sci 14, 409–423 (2020). https://doi.org/10.1007/s40096-020-00352-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s40096-020-00352-7