1,112
Views
1
CrossRef citations to date
0
Altmetric
Research Article

A numerical algorithm for solving one-dimensional parabolic convection-diffusion equation

, &
Article: 2204808 | Received 22 Dec 2022, Accepted 16 Apr 2023, Published online: 26 Apr 2023

Abstract

A numerical method for solving one-dimensional (1D) parabolic convection–diffusion equation is provided. We consider the finite difference formulas with five points to obtain a numerical method. The proposed method converts the given equation, domain, and time interval into a discrete form. The numerical values of the solution are approximated by solving algebraic equations containing finite differences and values at these discrete points. The consistency, stability and convergence are investigated. On the other hand, some numerical examples illustrate the validity and applicability of the method. Finally, the numerical results are compared with the finite difference scheme’s three points.

Mathematics Subject Classifications:

1. Introduction

The convection–diffusion-reaction has three phases [Citation1]. In the first phase, convection and materials move from one region to another. In the second phase, diffusion and materials flow from a high-concentration region to a low-concentration region. The last phase is a reaction and in this phase occurs the decay, absorption, and reaction of substances with other components.

One-dimensional parabolic convection–diffusion equation is a partial differential equation that is challenging to model in many scientific areas problems such as biology, physics and engineering [Citation2–8]. Therefore, some researchers have embarked on obtaining the numerical solutions to those problems using different numerical methods:

In [Citation4], Gürbüz proposed a Laguerre collocation method to solve the 1D parabolic convection equation. In this scheme, the given equation and conditions transform a matrix-vector equation. Then, using collocation points, the solution of this matrix-vector equation produces the Laguerre coefficients.

In [Citation9], a finite difference method was presented for linear and nonlinear convection–diffusion-reaction models to obtain numerical results by Lima et al. The authors focus on analyzing the convergence, utilizing errors and the accuracy of the method.

In [Citation10], the authors introduced an optimal q-homotopy analysis method to arise the approximate solution of the convection–diffusion equation. This study uses the homotopy perturbation method and optimal q-homotopy analysis.

Also, several methods have been proposed to solve the convection–diffusion-reaction, such as the homotopy perturbation method [Citation11], finite element method [Citation12], Runga Kutta method [Citation13], Bessel collocation method [Citation14], the weighted finite difference [Citation15], a hybrid approximation scheme [Citation16], the uniform convergent numerical method [Citation17].

We consider the 1D parabolic convection–diffusion equation as follows: (1) ut=2ux2+A(x)ux+B(x)u+f(x,t)(1) with the initial conditions (2) u(x,0)=g(x)(2) and the boundary conditions (3) u(0,t)=g0(t)(3) (4) u(l,t)=g1(t)(4) where 0xl,0tT and 0tlT. In this paper, we seek the numerical solutions of Equation (1) with the initial or boundary conditions Eqs.(2)-(4) by finite difference method. The finite difference method approximates the derivative of a known function. The forward and central difference approximation is basic difference equation with two points. Moreover, we have a finite difference equation with four points [Citation18]. Those equations are obtained by using the Taylor series. By using the Taylor series, we have [Citation18] (5) f(x)=8f(x+h)8f(xh)f(x+2h)+f(x2h)12h+O(h4)(5) for a known function f with four points. The finite difference method (FDM) is a suitable solver for ordinary and partial differential equations. It has been applied to many more problems in applied sciences, such as the Poisson equation [Citation19], sixth-order boundary value problems [Citation20], bi-harmonic interface problems [Citation21], blending denoising models [Citation22], fractional boundary value problems [Citation23], quasilinear parabolic partial differential equation [Citation24], some special problems [Citation25].

This article is systematized: the basic finite-difference formulation of Equation (1) and the numerical scheme are presented in a discrete form with the uniform mesh points in Section 2. The consistency, stability, and convergence are investigated in Section 3. In Section 4, the presented method is performed in several examples to show the practicality and proficiency of the process. Finally, a conclusion is added in Section 5.

2. Solution method

This section introduces the basic ideas for the numerical solution of the time-fractional diffusion equation Equation (1) by implicit finite differences and methods. The domain [0,l]×[0,T] is divided into on N×M mesh with h=lM and Δt=TM, respectively xi=ih for i=1,2,,N is the ith node. The uniform step size Δt is used; thus, tj=jΔt is the time level for the jth step. The quantity u(xi,tj) represents the exact solution at (xi,tj) while uij represents the numerical solution at (xi,tj).

The finite difference approximation for the derivative can be stated as follows respectively (6) ut=uij+1uijΔt+O(Δt)(6) (7) ux=ui2j8ui1j+8ui+1jui+2j12h+O(h4)(7) (8) 2ux2=ui2j+16ui1j30uij+16ui+1jui+2j12h2+O(h4)(8)

Substituting (6), (7), and (8) into (1) for (j+1)th step, we obtain (9) uij+1uij=Δt12hA(x)(ui2j+18ui1j+1+8ui+1j+1ui+2j+1)+kB(x)uij+1+Δt12h2(ui2j+1+16ui1j+130uij+1+16ui+1j+1ui+2j+1)(9) Equation (9) requires, at each time step, solving a triangular system of linear equations where the right-hand side utilizes the computed solution’s history up to that time.

3. Convergence analysis for numerical scheme

In this section, we shall give the convergence of the given numerical scheme. For this purpose, the Neumann stability analysis and consistency analysis are investigated. Finally, at the end of this section, the convergence is hold by Lax Equivalence Theorem.

3.1. Neumann stability analysis

Let’s assume that uij=upq. Then, we apply the von Neumann stability analysis to find the stability region. Also, we take that the solution is of the form upq:=Gqeiβph. Substitution of the above expression into Equation (9) yields (10) Gq+1eiβphGqeiβph=Δt12hA(x)(Gq+1e(p2)h8Gq+1e(p1)h+8Gq+1e(p+1)hGq+1e(p+2)h)+ΔtB(x)Gq+1eiβph+Δt12h2(Gq+1e(p2)h+16Gq+1e(p1)h30Gq+1eiβph+16Gq+1e(p+1)hGq+1e(p+2)h)(10)

After simplifying equation Equation (10), we have G1=Δt12hA(x)G(e2iβh8eiβh+8eiβhe2iβh)+Δt12h2G(e2iβh+16eiβh30+16eiβhe2iβh)

and G1=Δt12hA(x)G(16isin(βh)2isin(2βh))+GΔtB(x)+Δt12h2G(2+4sin2(βh)+3264sin2(βh/2)30)

Thus G[1+Δt12hA(x)G(16isin(βh)2isin(2βh))+GΔtB(x)Δt12h2(2+4sin2(βh)+3264sin2(βh/2)30]=1

From the above equation, we have G=1/([1+Δt12hA(x)G(16isin(βh)2isin(2βh))+GΔtB(x)Δt12h2(2+4sin2(βh)+3264sin2(βh/2)30])

So for all Δt12h2>0, we have |G|1. Then the given numerical method for Equation (1) is unconditionally stable for all Δt12h2>0.

3.2. Consistency analysis

Consistency requires that the original equation can recover from the algebraic equations [Citation20]. We expand every term of Equation (9) using Taylors series expansion: (11) Uij+1=Uij+Δtut+(Δt)22!2ut2+(11) (12) Ui+1j+1=Uij+(Δxux+Δtut)+12!((Δx)22ux22ΔxΔt2ux∂t+(Δt)22ut2)+(12) (13) Ui1j+1=Uij+(Δxux+Δtut)+12!((Δx)22ux22ΔxΔt2ux∂t+(Δt)22ut2)+(13) (14) Ui+2j+1=Uij+(2Δxux+Δtut)+12!((2Δx)22ux2+4ΔxΔt2ux∂t+(Δt)22ut2)+(14) (15) Ui2j+1=Uij+(2Δxux+Δtut)+12!((2Δx)22ux24ΔxΔt2ux∂t+(Δt)22ut2)+(15)

Substituting Eqs.(11)-(15) into implicit scheme Equation (9), simplifying and collecting like terms together (16) Δtut+(Δt)22!2ut2=Δt[A(x)3ux+B(x)u+432ux2]+(Δt)2[A(x)32ux∂t712Δxut+B(x)ut+ΔtB(x)22ut2+16(Δx)2ut+Δt12(Δx)22ut2](16)

Dividing Equation (16) by Δt and reordering, we get (17) ut+A(x)3uxB(x)u432ux2=Δt[A(x)32ux∂t712Δxut+B(x)ut+ΔtB(x)22ut2+16(Δx)2ut+Δt12(Δx)22ut2+122ut2](17) It is noticed that the first four terms in Equation (17) are for the recovered partial differential equation, that is parabolic convection diffusion equation, and the other terms are the truncation error since the parabolic convection–diffusion equation has been recovered from the algebraic equation of the implicit scheme developed and so, we conclude that the method is “consistent”.

3.3. Convergence analysis

We obtain the stability and consistency analysis of the proposed method in this section. In Sections 3.1 and 3.2, we proved the consistency and stability of the proposed method. Moreover, the following theorem assures the convergence of the method.

Theorem:

(Lax Equivalence Theorem) The finite difference scheme, which is consistent and stable, is equivalent to convergence.

Proof:

[Citation19].

4. Algorithm

  1. Input the time step Δt and space step (h).

  2. Compute grid points xi for i=0,1,,N and ti for j=0,1,,T.

  3. Compute ui0 for all mesh points by Equation (9).

  4. Compute the right-hand side of Equation (9) for all mesh points.

    1. For each fixed i=0,,N and j=0,,T compute uij and uij1by using Equation (9).

    2. For each fixed i=0,,N and j=0,,T compute fij.

  5. Compute the boundary conditions uij for i=0,,N and j=0,,T.

  6. Calculate uij+1by using the given scheme Equations (6)-(9).

  7. Evaluate absolute errors.

5. Examples

In this section, we give some examples to confirm the method. All numerical values are obtained by using codes by Maple. To confirm the versatility and accuracy of the proposed method, we perform the error sources L2 and L, where L2=||ueu||2=hi=0N|(ue)ijuij|2andL=||ueu||=maxi|(ue)ijuij|.

Example 5.1:

Let us consider the following 1-D parabolic convection–diffusion equation (18) u(x,t)t2u(x,t)x2(2x+1)u(x,t)xx2u(x,t)=ex+tε(18) where (x,t)[0,1]×[0,T]. The exact solution to this problem is u(x,t)=ex+tε. The initial and boundary conditions are calculated using the exact solution. We takeε=0.2. Our numerical results are tabulated in Tables and for different values h at different time steps. A comparison of the error values between the 3 and 5 points difference scheme of Equation (18) is presented in . Those results are compared in Figures . Moreover, errors are shown in the counter form in . Our numerical results are observed to be better than the classical FDM. Our results are the same surface with the exact solution.

Figure 1. 3D Graph of absolute errors in Example1 for h=1/10, Δt=1/10000, 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.0005.

Figure 1. 3D Graph of absolute errors in Example1 for h=1/10, Δt=1/10000, 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.0005.

Figure 2. 3D Graph of numerical values in Example1 for h=1/10, Δt=1/10000 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.0005.

Figure 2. 3D Graph of numerical values in Example1 for h=1/10, Δt=1/10000 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.0005.

Figure 3. Contour Graph of numerical values in Example1 for h=1/10, Δt=1/10000 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.0005.

Figure 3. Contour Graph of numerical values in Example1 for h=1/10, Δt=1/10000 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.0005.

Table 1. Absolute errors for Equation (18) with h=1/10, Δt=1/10000 at different time step.

Table 2. Numerical, exact solutions and absolute errors for Equation (18) with h=1/20, Δt=1/10000 at different spatial step.

Example 5.2:

Let us consider the following diffusion equation (19) u(x,t)t2u(x,t)x2+u(x,t)x=u(x,t)(19) where (x,t)[0,1]×[0,T]. The exact solution to this problem is u(x,t)=ex+t. Absolute errors are reported in Tables for different spatial steps. Numerical results are plotted in Figures . These results confirm that the proposed technique is correct in solving this problem.

Figure 4. 3D Graph of absolute errors in Example 2 for h=1/10, Δt=1/100 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.05.

Figure 4. 3D Graph of absolute errors in Example 2 for h=1/10, Δt=1/100 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.05.

Figure 5. 3D Graph of numerical solutions in Example 2 for h=1/10, Δt=1/100 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.05.

Figure 5. 3D Graph of numerical solutions in Example 2 for h=1/10, Δt=1/100 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.05.

Figure 6. Contour Graph of absolute errors in Example 2 for h=1/10, Δt=1/100 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.05.

Figure 6. Contour Graph of absolute errors in Example 2 for h=1/10, Δt=1/100 0 ≤ x ≤ 1, 0 ≤ t ≤ 0.05.

Table 3. Absolute errors for Equation (19) with two methods with h=1/10, Δt=1/10000 at different spatial step.

Table 4. Numerical, exact solutions and absolute errors for Equation (19) with i=N1,h=1/30, Δt=1/10000 at different time step.

Table 5. L and L2errors for Equation (19) with j=3, Δt=1/10000 at different N values.

6. Conclusion

The FDM scheme is the prime, essential, and most applied numerical method to solve ODEs and PDEs. The central difference and forward difference schemes with three points in literature are usually developed. This paper presented an efficient numerical scheme using the finite difference method with five points for solving the 1D parabolic convection–diffusion equation. First, the proposed method reduced the main problem into a discrete equation form. Then, the equation was converted to a triangular system of linear equations to find desired numerical values. Neumann stability analysis for the regular domain and convergence of the method was investigated. We examined several examples to compare the absolute errors and existing method results. Our results and comparisons are tabulated and plotted. Our numerical results are better than three points scheme from Tables and . Moreover, our errors are O(h4), while the three-point scheme has O(h2). In the proposed method, to warrant the required accuracy, the calculations are mainly run by a sufficiently high precision calculation, but the size of the digit number is naturally limited. All computations are performed in Maple software.

Acknowledgments

All authors contributed equally and significantly in writing this article. All authors read and approved the final manuscript.

Disclosure statement

No potential conflict of interest was reported by the author(s).

References

  • Ndivhuwo M. Numerical solution of 1-D convection-diffusion-reaction equation, AIMS.Thesis; 2013.
  • Songsheng D, Jianing P. Application of convection-diffusion equation to the analyses of contamination between batches inmulti-products pipeline transport. Appl Math Mech Amsterdam. 1998;19:757–764.
  • Efendiev MA, Hermann JE. On positivity of solutions of semi-linear convection-diffusion-reaction systems, with applications in ecology and environmental engineering. Math Models Phenomen. 2007;4:92–101.
  • Gürbüz G, Sezer M. Modified laguerre collocation method for solving 1-dimensional parabolic convection-diffusion problems. Math Methods Appl Sci. 2017;41(18):1–7.
  • Murray JD. Mathematical biology I: an introduction. Berlin: Springer; 2002.
  • Goodwin AD, Meares CF, DeRiemer LH, et al. Clinical studies with In-111 BLEDTA, a tumor-imaging conjugate of bleomycin with a bifunctional chelating agent. J Nuclear Medicine. 1981;22:787–792.
  • Ahmad HF, Hasmed WA. A novel spectral technique for 2D fractional telegraph equation models with spatial variable coefficients. J Taibah Univ Sci. 2022;16(1):885–894.
  • Kumbinarasaiah S, Mulimani M. A novel scheme for the hyperbolic partial differential equaton through fibonacci wavelets. J Taibah Univ Sci. 2022;16(1):1112–1132.
  • Lima SA, Kamrujjaman M, Islam MS. Numerical solution of convection-diffusion-reaction equations by a finite element method with error correction. AIP Adv. 2021;11:085225.
  • Mohamed MS, Hamed YS. Solving the convection-diffusion equation by means of the optimal q-homotopy analysis method. Results Phys. 2016;6:20–25.
  • Porshokouhi MG, Ghanbari B, Gholami M, et al. Approximate solution of convection-diffusion equation by the homotopy perturbation method. Gen. 2010;1:108–114.
  • Dehghan M. On the numerical solution of the one-dimensional convection-diffusion equation. Math Probl Eng. 2005;1:61–74.
  • Chen Z, Gumel AB, Mickens RE. Nonstandard discretizations of the generalized nagumo reaction-diffusion equation. Numer Methods Partial Differ Equ. 2003;19(3):363–379.
  • Yüzbaşı Ş, Şahin N. Numerical solutions of singularly perturbed one-dimensional parabolic convection–diffusion problems by the bessel collocation method. Appl Math Comput. 2013;220:305–315.
  • Dehghan M. Weighted finite difference techniques for the one-dimensional advection–diffusion equation. Appl Math Comput. 2004;142(2):307–319.
  • Izadi M, Yüzbaşı Ş. A hybrid approximation scheme for 1-D singularly perturbed parabolic convection-diffusion problems. Math Commun. 2022;27:47–62.
  • Turuna DA, Woldaregay MM, Duressa FD. Uniform convergent numerical method for singularly perturbed convection-diffusion equation. Kyungpook Math J. 2020;60:631–647.
  • Epperson JF. An introduction to numerical methods and analysis. New York City (NJ): Wiley; 2013.
  • Siyyam HI. An accurate solution of the poisson equation by the finite difference-Chebyshev-Tau method. Appl Math Mech. 2001;22(8):935–939.
  • Pandey PK. Fourth order finite difference method for sixth order boundary value problems. Comput Math Math Phys. 2013;53(1):57–62.
  • Xing Y, Song L, Li P. A generalized finite difference method for solving biharmonic interface problems. Eng Anal Bound Elem. 2022;135:132–144.
  • Eslahchi MR, Esmaili S, Namaki N, et al. Application of finite difference method in solving a second- and fourth-order PDE blending denoising model. Math Sci. 2021;17:93–106.
  • Hao Z, Cao W. An improved algorithm based on finite difference schemes for fractional boundary value problems with non-smooth solution. J Sci Comput. 2017;73(1):395–415.
  • Jain MK, Jain RK, Mohanty RK. A fourth order difference method for the one dimensional general quasilinear parabolic partial differential equation. Numer Methods Partial Differ Equ. 1990;6(4):311–319.
  • Smith GD. Numerical solution of partial differential equations: finite difference methods. New York: Oxford University Press; 1985.