Higher Order Approximation of Advection Diffusion Equation by Semi-Discretization Method ()
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
, 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:
(1)
with initial condition
;
and boundary condition
where,
is the velocity of the medium in the
direction,
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
.
(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
into
equal sub-interval such that
with
,
and
. Approximations
are found by replacing thespatial derivatives by difference quotients. This gives a finite difference discretization in space. Setting
.
Therefore, we get a system of ordinary difference equations (ODEs) of (1)
(3)
with a given initial value
. To approximate (1.1) with we also divide the time interval
into
equal sub-interval such that
with
,
, and
. For purpose of the notation
. So, the following approximations are constructed
.
Where
is an intended approximation of
. Now, with time step
for the numerical solution of advection diffusion equation with the Euler method is-
(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
where,
is the spatial step,
is the time step,
and
is spatial and temporal node respectively. Substituting these above equations in (1) and solvingfor unknown
. We obtain,
Where,
and
. Stability condition
&
.
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
, then we use the Runge-Kutta 2nd order method and obtain
(5)
This is called the Runge-Kutta 2nd order for ADE.
The formula of fourth-order Runge-Kutta method is given by where
(6)
Which are two simplest methods for the semi-discretization of
.
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,
,
,
,
,
total time
to
. The advection diffusion equation for this problem
is to be solved with initial and boundary conditions
.
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.
|
|
|
|
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
,
,
known as advection equation number and
known as diffusion term.
Numerical implementation of semi-discretization method our solving Equation (1):
Initial condition:
.
Boundary condition:
;
We can write out the matrix system of equation we will solve numerically for the concentration
. Suppose we use 4 grid points
i.e.
in this example.
, solution for concentration vector
at time
. The boundary condition gives
and
.
We can rewrite general nth term grid point in equation as
where,
and
;
In the matrix form
(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:
where,
and
Now we get,
(8)
Equation (8) is the semi-discretized Runge-Kutta 2nd order method of advection diffusion equation. Similarly, we calculate
and
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.
|
|
Error for ECDS |
Error for Euler |
Error for Runge Kutta |
RK 2nd order |
RK 4th order |
0.0020 |
0.0400 |
|
|
|
|
0.0027 |
0.0667 |
|
|
|
|
0.0040 |
0.0667 |
|
|
|
|
0.0050 |
0.0800 |
|
|
|
|
0.0080 |
0.0800 |
|
|
|
|
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.