Higher Order Approximation of Advection Diffusion Equation by Semi-Discretization Method

Abstract

A system of ordinary differential equations (ODEs) is produced by the semi-discretize method of discretizing the advection diffusion equation (ADE). Runge-Kutta methods of the second and fourth orders are used to solve the system of ODEs. We compute the ADE numerically for initial and boundary conditions, for which the exact solution is known. In the semi-discretization approach, we estimate the error for both the second and fourth-order Runge-Kutta schemes. The semi-discretization method’s outcome is contrasted with the ADE’s numerical solution derived from the complete discretization explicit centered difference scheme.

Share and Cite:

Ara, K. , Alam, M. and Andallah, L. (2025) Higher Order Approximation of Advection Diffusion Equation by Semi-Discretization Method. American Journal of Computational Mathematics, 15, 246-258. doi: 10.4236/ajcm.2025.153013.

1. Introduction

The semi-discretization method (SDM) is used to derive numerical solutions for time-dependent partial differential equations (PDEs). The numerical solution procedure is known as space semi-discretization, in which the time variable is left continuous while the space variable is discretised and time integration is applied to transform the PDEs into a system of ordinary differential equations (ODEs). We look at the mathematical model of advection diffusion, which may be used to simulate natural processes in a variety of natural science and engineering applications. Many scholars have tried to solve this equation and apply it in their simulations [1]-[8]. A finite difference approach is used to solve the advection diffusion problem. It is well known that the optimal approach to solving the advection diffusion problem is usually to use an FDS (finite difference scheme) [7]-[10]. The researcher explored the operator splitting approach for the numerical solution of the Advection Diffusion Equation [2]. The Crank-Nicolson (CN) finite difference scheme and the characteristic method with cubic spline interpolation (MOC-CS) were used to implement these techniques [2]. The results were compared to the analytical solution. It is evident that even with large time steps; the applied method yields correct results and has a smaller error than other methods. Explicit finite difference techniques are used in this study to solve the advection diffusion problem [8]-[10]. We look into an alternative method that produces a system of ODEs with a time independent variable: the semi-discretization method on spatial variables [1]. We use Runge-Kutta’s second and fourth order methods as well as Euler’s method to solve this system of ODEs. In order to calculate the unknown concentration u( x,t ) , we create an algorithm that combines the Euler and Runge Kutta methods for the system of ODEs.

2. The Semi-Discretization Techniques

2.1. Advection Diffusion Equations (ADE)

Advection Diffusion equations have both advective and diffusive terms together, represented as a partial differential equation below:

u( x,t ) t +c u( x,t ) x =D 2 u( x,t ) x 2 (1)

with initial condition

u( x, t 0 )=f( x );a<x<b ;

and boundary condition

u( a,t )= u a ( t ); t 0 <t<T

u( b,t )= u b ( t ); t 0 <t<T

where, c is the velocity of the medium in the x direction, D is the diffusion coefficient. An advection diffusion problem whose general solution [1] is given in Figure 1.

Figure 1. Analytical solution of advection diffusion equation.

2.2. Finite Difference Discretization

Among the discretization methods for partial differential equations, the finite difference method (FDM) is the most traditional. Numerous contemporary numerical methods for transport phenomena have their roots in finite difference approximations that were created between the late 1950s and the early 1980s. FDM is especially easy to derive and apply to structured meshes, which are topologically equal to a uniform Cartesian grid. The nodal value of the approximate solution at node m .

u m ( t )u( x m ,t ) (2)

is a pointwise approximation to the true solution of the partial differential equation.

3. Numerical Method

3.1. Semi-Discretization Euler Methods

Our aim is to introduce several numerical methods of solving ODEs to obtain approximate solutions [1]. We consider some simple space discretization on a uniform grid. We divide the spatial interval [ 0,L ] into M+1 equal sub-interval such that x 1 < x 2 < x 3 <,<L with x m =( m1 )Δx , m=1,2,3,,M+1 and Δx= L M . Approximations u( t )u ( x m ,t ) 0 are found by replacing thespatial derivatives by difference quotients. This gives a finite difference discretization in space. Setting

u( t )= ( u 1 ( t ),, u m ( t ) ) T .

Therefore, we get a system of ordinary difference equations (ODEs) of (1)

u ( t )=F( t,u( t ) ),t>0,u( 0 )= u 0 (3)

with a given initial value u( 0 ) . To approximate (1.1) with we also divide the time interval [ 0,T ] into N+1 equal sub-interval such that t 1 < t 2 < t 3 <<T with t n =( n1 )Δt , n=1,2,3,,N+1 , and Δt= T N . For purpose of the notation Δt=k . So, the following approximations are constructed u 0 , u 1 ,, u n , u n+1 .

Where u n is an intended approximation of u( t n ) . Now, with time step Δt for the numerical solution of advection diffusion equation with the Euler method is-

u n+1 = u n +ΔtF( t n , u n ) (4)

3.2. Full Discretization of Explicit Centered Difference Scheme (ECDS)

To approximate the solution to Equation (1) using the Explicit Centered Difference Scheme, we use the following approximations

u t ( x m , t n ) u m n+1 u m n Δt

u x ( x m , t n ) u m+1 n u m1 n 2Δx

u xx ( x m , t n ) u m+1 n+1 2 u m n + u m1 n ( Δx ) 2

where, Δx is the spatial step, Δt is the time step, m and n is spatial and temporal node respectively. Substituting these above equations in (1) and solvingfor unknown u m n+1 . We obtain, u m n+1 =( α 2 +γ ) u m1 n +( 12γ ) u m n +( γ α 2 ) u m+1 n

Where, cΔt Δx =α and DΔt Δ x 2 =γ . Stability condition cΔt Δx 1 & DΔt Δ x 2 1 2 .

3.3. Semi-Discretization Runge-Kutta Methods

Euler method and ECDS both are first order methods. In order to develop efficient, highly accurate approximation algorithm, higher-order difference methods are designed. Assume t n+1 = t n +Δt , then we use the Runge-Kutta 2nd order method and obtain

u n+1 = u n + Δt 2 ( F( t n , u n )+F( t n+1 , u n+1 ) ) (5)

This is called the Runge-Kutta 2nd order for ADE.

The formula of fourth-order Runge-Kutta method is given by where t n+1 = t n + Δt 2

K 1 =F( t n , u n )

K 2 =F( t n+1 , u n+1 +h K 1 )

K 3 =F( t n+1 , u n+1 +h K 2 )

K 4 =F( t n+1 , u n + K 3 )

u n+1 = u n + h 6 ( K 1 +2 K 2 +2 K 3 + K 4 ) (6)

Which are two simplest methods for the semi-discretization of F( t,u )=A u ˙ +b( t ) .

4. Numerical Results and Discussion

4.1. Discussion Semi-Discretization Methods

The general solution for the advection diffusion Equation (1) this study, we assume that spatial length, l=50m ,  c=0.6m/s , D=0.09 m 2 /s , Δx=0.1 , Δt=0.08 total time t=10sec to t=50sec . The advection diffusion equation for this problem u t +c u x =D u xx is to be solved with initial and boundary conditions

u( x,0 )=f( x ) .

u( x=0,t )= f 0 ( x )

u( x=l,t )= f l ( x );0tT

A computer programing code and various values of time steps are to be used to investigate the numerical schemes [9]-[12] (Table 1).

Table 1. Elapsed time with different temporal grid point.

Δt

Δx

nt

nx

ECDS

(E.T.sec)

Euler

(E.T. sec)

Runge Kutta

2nd order (E.T)

4th order (E.T)

0.0020

0.0667

20000

600

1.742224

20.768796

43.015423

341.596993

0.0027

0.0667

15000

600

1.454636

28.784721

77.852146

256.830589

0.0040

0.0667

10000

600

1.397545

18.871882

53.445049

152.704436

0.0050

0.0800

8000

600

1.475086

14.689404

28.975703

118.589866

0.0080

0.0800

5000

600

1.010213

9.434639

25.819919

61.982884

4.1.1. Case 1: Euler Method

For this case the time step is increased to Δt=0.008 , Δx= , cΔt Δx =α known as advection equation number and DΔt ( Δx ) 2 =γ  known as diffusion term.

Numerical implementation of semi-discretization method our solving Equation (1):

u t +c u x =D u xx

Initial condition: u m 0 =f( x m )=u( x,t=0 ) .

Boundary condition: u( x=0,t )= u 0 n = f 1 ( t n ) ; u( x=b,t )= u b n = f b ( t n )

We can write out the matrix system of equation we will solve numerically for the concentration u . Suppose we use 4 grid points x 1 , x 2 , x 3 , x 4 = x m+1 i.e. m=3 in this example. u n =( u 2 n u 3 n ) , solution for concentration vector u n at time t n . The boundary condition gives u 1 n =u( x=0, t n ) and u m+1 n = u 4 n =u( x=b, t b ) .

We can rewrite general nth term grid point in equation as

u n+1 =( u 2 n u 3 n )+α( 0 1 1 0 )( u 2 n u 3 n )+λ( 2 1 1 2 )( u 2 n u 3 n )α( u 1 n u 4 n )+λ( u 1 n u 4 n )

u n+1 =( u 2 n u 3 n )+Δt{ αA( u 2 n u 3 n )+λB( u 2 n u 3 n )α( u 1 n u 4 n )+λ( u 1 n u 4 n ) }

where, A=( 0 1 1 0 ) and B=( 2 1 1 2 )

u n+1 =( u 2 n u 3 n )+ΔtF;α= c 2Δx &γ= D ( Δx ) 2

u m n+1 = u m n +Δt{ α( u m+1 n u m1 n )+γ( u m+1 n 2 u m n + u m1 n ) } ;

In the matrix form

u m n+1 = u m n +Δt F m,n ( t n , u n ) (7)

4.1.2. Case II: Runge-Kutta Method

We consider the semi-discretize form in Equation (4), so we can write from the case 1:

K 1 =F( t n , u n )=( Aα+Bγ )u+[ ( α+γ ) u 1 0 ( α+γ ) u M+1 ]

K 2 =F( t n+1 , u n+1 )=( Aα+Bγ )( u+h K 1 )+[ ( α+γ )( u+h K 1 ) 0 ( α+γ )( u M+1 +h K 1 ) ]

K 1 ={ α( 0 1 1 0 )+λ( 2 1 1 2 ) }( u 2 n u 3 n )+[ ( α+λ ) u 1 n 0 ( α+λ ) u 4 n ]

K 2 ={ α( 0 1 1 0 )+λ( 2 1 1 2 ) }( u 2 n +h K 1 u 3 n +h K 1 )+[ ( α+λ )( u 1 n +h K 1 ) 0 ( α+λ )( u 4 n +h K 1 ) ]

where, A=( 0 1 1 0 ) and B=( 2 1 1 2 )

Now we get,

u n+1 = u n + Δt 2 ( K 1 + K 2 ) (8)

Equation (8) is the semi-discretized Runge-Kutta 2nd order method of advection diffusion equation. Similarly, we calculate K 3 and K 4 Runge Kutta 4th order method of advection diffusion equation.

5. Error Analysis and Convergence

5.1. Error Analysis

Figure 2 shows that the comparison of relative error for two finite difference schemes. The relative error for ECDS which remains below 0.0010 and for Runge-Kutta 4th order the relative error is 0.0004.

Figure 3 shows that the comparison of relative error for two finite difference schemes. The relative error for RK2 and Rk4 which remains below 0.00041 and for Runge-Kutta 4th order the relative error is 0.0004.

Figure 2. Relative error of 1D ADE for ECDS and RK4 scheme.

Figure 3. Relative error of 1D ADE for Runge-Kutta 2nd and 4th order scheme.

The following Figure 4 shows that the comparison of relative error with full discretization and semi-discretization in finite difference schemes. The relative error for ECDS which remains below 0.00001. The relative error for Euler and 4th order the relative error is 0.00009 and 0.000003 respectively.

5.2. Convergence

5.2.1. Convergence of Relative Error for ECDS Method

The following Figure 5 shows the convergence of relative error by the ECDS. This figure shows a very good rate of convergence of full discretizing method.

5.2.2. Convergence of Relative Error for Euler Method

The following Figure 6 shows the convergence of relative errors by the Euler method. This figure shows a very good rate of convergence of semi-discretizing method.

Figure 4. Relative error of 1D ADE for ECDS, Euler, Runge-Kutta 4th order scheme.

Figure 5. Convergence of relative error ECDS.

5.2.3. Convergence of Relative Error for Runge-Kutta 2nd Order Method

The following Figure 7 shows the convergence of relative error by the 2nd order Runge-Kutta method. This figure shows a very good rate of convergence of semi-discretizing method.

5.2.4. Convergence of Relative Error for Runge-Kutta 4th Order Method

The following Figure 8, Table 2 show the convergence of relative error by the 4th order Runge-Kutta method. This figure shows a very good rate of convergence of semi-discretizing method.

Figure 6. Convergence of relative error Euler.

Figure 7. Convergence of relative error Runge-Kutta 2nd order method.

Figure 8. Convergence of relative error Runge-Kutta 4th order method.

Table 2. Error analysis of the three different schemes at different spaces and time steps size.

Δt

Δx

Error for ECDS

Error for Euler

Error for Runge Kutta

RK 2nd order

RK 4th order

0.0020

0.0400

1.15× 10 3

1.16× 10 3

0.058× 10 3

0.056× 10 3

0.0027

0.0667

2.4× 10 3

2.4× 10 3

2.5× 10 3

1.2× 10 3

0.0040

0.0667

3.2× 10 3

3.4× 10 3

1.6× 10 3

1.2× 10 3

0.0050

0.0800

4× 10 3

4.4× 10 3

1.5× 10 3

1.4× 10 3

0.0080

0.0800

6.4× 10 3

6.5× 10 3

1.7× 10 3

1.6× 10 3

5.3. Problem Discussion

Here we can see in Figure 9 that the semi-discretization method Runge-Kutta 4th order method is the better one. The following Figure 10 shows concentration distribution by semi-discretization method for different velocities and for different diffusion coefficients. Figure 11 shows concentration distribution for varying diffusion rate a time t = 30 sec.

Figure 9. Concentration distribution of full discretization ECDS and semi-discretization Runge-Kutta 4th order method.

Figure 10. The figure demonstrated varying advection & diffusion rate a time t = 20 secs.

Figure 11. The plot demonstrated varying diffusion rate a time t = 30 sec.

The “red curved” in Figure 12 below indicates a high concentration for 20 seconds, whereas the green curve indicates a concentration for 30 seconds. The “blue” curve indicates that concentration is high for 40 seconds. The figure indicated by “black” shows that concentration is high for 50 seconds, and as time increases, we can observe that the concentration profile decreases.

Figure 12. The figure demonstrated different time.

In Figure 13, the “black curved” indicates that the concentration is high for 8 meters, while the green curve indicates that the concentration is lower for 16 meters. The red curve indicates 40 m, the blue curve indicates 24 m, and the plot indicated by “deep red” indicates 32 m of high concentration. With regard to time, we may observe that when focus is raised while in a motionless position.

Figure 14, Concentration distributions for varying diffusion rates and velocities over time It is evident that the concentration distribution varies with velocity and diffusion rate. The “Green” curve, for instance, indicates that concentration begins at 0.85 and drops to zero at 2 meters. Comparably, the “Black” curve begins at about 0.82 and drops to zero and 4 m, while the “Red curve” begins at concentration 1 and drops directly to less than 0.8 concentration at 0 m before beginning to decrease to zero at 6 m.

Figure 13. Concentration distribution for different time for RK4.

Figure 14. The figure demonstrated a different position.

6. Conclusion

In this work, we investigate higher-order approximations of ADE by a semi-discretization method with initial and boundary conditions. Numerical results of ADE are briefly discussed, along with the relative error for both semi-discretization and full discretization methods. Both schemes show a good rate of convergence. We observe that the higher-order semi-discretization method gives better results than ECDS. The 4th order R-K method gives less error than the 2nd order R-K method.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Ara, K.N.I., Rahaman, M.M. and Alam, M.S. (2021) Numerical Solution of Advection Diffusion Equation Using Semi-Discretization Scheme. Applied Mathematics, 12, 1236-1247.
https://doi.org/10.4236/am.2021.1212079
[2] Bahar, E. and Gürarslan, G. (2017) Numerical Solution of Advection-Diffusion Equation Using Operator Splitting Method. International Journal of Engineering & Applied Sciences, 9, 76-88.
https://doi.org/10.24107/ijeas.357237
[3] Dehghan, M. (2005) On the Numerical Solution of the One-Dimensional Convection-Diffusion Equation. Mathematical Problems in Engineering, 2005, 61-74.
https://doi.org/10.1155/mpe.2005.61
[4] Ahmed, G.S. (2012) A Numerical Algorithm for Solving Advection-Diffusion Equation with Constant and Variable Coefficients. The Open Numerical Methods Journal, 4, 1-7.
https://doi.org/10.2174/1876389801204010001
[5] Mojtabi, A. and Deville, M.O. (2015) One-Dimensional Linear Advection-Diffusion Equation: Analytical and Finite Element Solutions. Computers & Fluids, 107, 189-195.
https://doi.org/10.1016/j.compfluid.2014.11.006
[6] Tinega, A.K. and Ndede, C.O. (2016) Stability and Consistency Analysis of Central Difference Scheme for Advection Diffusion Partial Differential Equation. International Journal of Science and Research, 7, 1046-1049.
[7] Azad, T. and Andallah, L. (2017) Stability Analysis of Finite Difference Schemes for an Advection Diffusion Equation. Bangladesh Journal of Scientific Research, 29, 143-151.
https://doi.org/10.3329/bjsr.v29i2.32331
[8] Appadu, A.R. (2013) Numerical Solution of the 1D Advection-Diffusion Equation Using Standard and Nonstandard Finite Difference Schemes. Journal of Applied Mathematics, 2013, Article ID 734374.
https://doi.org/10.1155/2013/734374
[9] Djordjevich, A., Savović, S. and Janićijević, A. (2017) Explicit Finite-Difference Solution of Two-Dimensional Solute Transport with Periodic Flow in Homogenous Porous Media. Journal of Hydrology and Hydromechanics, 65, 426-432.
https://doi.org/10.1515/johh-2017-0040
[10] Iliev, O.P., et al. (2013) Numerical Solution of Partial Differential Equations: Theory, Algorithms, and Their Applications. Springer Science & Business Media.
[11] Rahaman, M.M. and Andallah, L.S. (2014) Simulation of Water Pollution by Finite Difference Method. International Journal of Research in Information Technology, 2, 17-24.
[12] Mathews, J.H. and Fink, K.K. (2004) Numerical Methods Using Matlab. 4th Edition, Prentice Hall.

Copyright © 2025 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.