^{1}

^{*}

^{2}

^{1}

Numerical diffusion and oscillatory behavior characteristics are averted applying numerical solutions of advection-diffusion equation are themselves immensely sophisticated. In this paper, two numerical methods have been used to solve the advection diffusion equation. We use an explicit finite difference scheme for the advection diffusion equation and semi-discretization on the spatial variable for advection-diffusion equation yields a system of ordinary differential equations solved by Euler’s method. Numerical assessment has been executed with specified initial and boundary conditions, for which the exact solution is known. We compare the solutions of the advection diffusion equation as well as error analysis for both schemes.

The advection diffusion equation (ADE) is the model that can be used for simulation natural processes. Two categories of the advection-diffusion equation: advection is first due to the movement of materials from one region to another; the second category is called diffusion which is due to the movement of materials from higher concentration to low concentration. This mathematical model has a wide range of applications in natural science and engineering. These applications include where simulation techniques are useful for transport of air, river water, adsorption of pollutants in soil, food processing, modeling of the biological system, finance, electromagnetism, fluid mechanics structural dynamics, quantum physical process, etc. The analytical and numerical solutions along with an initial and two boundary conditions help to comprehend pollutant concentration distribution behavior through an open medium like rivers, air, lakes, and porous medium. Various works have been appeared to solve and use this equation in their simulation using finite difference methods [

We consider the following partial differential equation, which has both an adventive and diffusive terms together.

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

with initial condition:

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

And boundary conditions:

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

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

where u a , u b are concentration values and u ( x , t ) is the unknown solution being investigated which indicates concentration, c ( x , t ) is the velocity of the medium in the x direction, D ( x , t ) is the diffusion coefficient. To introduce numerical scheme for Equation (1), an advection diffusion problem whose general solution [

u ( x , t ) = 1 4 π D t e − ( x − c t ) 2 4 D t (2)

In mathematics, our goal is to approximate the solution of the differential equations.

This gives a large algebraic system of equations to be solved in replace of the differential equation, which can be easily solved [

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 = ( m − 1 ) Δ x , m = 1 , 2 , 3 , ⋯ , M + 1 and Δ x = L M .

Approximations u ( t ) ≈ u ( x m , t ) 0 are found by replacing the spatial derivatives by difference quotients. we also divide the time interval [ 0 , T ] into N + 1 equal subinterval such that t 1 < t 2 < t 3 < ⋯ < T with t n = ( n − 1 ) Δ x , n = 1 , 2 , 3 , ⋯ , N + 1 ,

and Δ t = T N . For purpose of the notation Δ x = h and Δ t = k .

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.1)

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

with a given initial value u ( 0 ) .

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 (a)

u x ( x m , t n ) ≅ u m + 1 n − u m − 1 n 2 Δ x (b)

u x x ( x m , t n ) ≅ u m + 1 n + 1 − 2 u m n + u m − 1 n ( Δ x ) 2 (c)

where Δ x is the spatial step, Δ t is the time step, m and n is spatial and temporal node respectively. Substituting Equation (a), (b), (c) in Equation (1) and solving

for unknown u m n + 1 . We obtain u m n + 1 = ( α 2 + γ ) u m − 1 n + ( 1 − 2 γ ) 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 .

We consider the following figure for ADE (Advection Diffusion Equation).

We draw vertical grid line as shown in the picture. These lines are parallel to the t-axis and cross the x-axis in x = x m , m = 1 , ⋯ , M + 1 . x m = m × Δ x ,

Δ x = 1 M + 1 .

In semi-discretization method (SDM), we assume that the PDE system with its boundary conditions has spatially discretized, and thus we focus on ODE system u ′ ( t ) = F ( t , u ( t ) ) , representing semi-discrete advection-diffusion problems.

This equation is same as Equation (2). Now Consider ADE (1) with c > 0 and D > 0 .

We introduce the function of one variable: u m ( t ) ≈ u ( t , x m ) , m = 1 , ⋯ , M + 1 .

Now approximate the first derivative and second derivative ∂ x and ∂ x x respectively as:

u x ( x m , t ) ≅ u m + 1 ( t ) − u m − 1 ( t ) 2 Δ x (d)

u x x ( x m , t ) ≅ u m + 1 ( t ) − 2 u m ( t ) + u m − 1 ( t ) ( Δ x ) 2 (e)

This gives the semi-discrete form of (1)

d u m ( t ) d t = − α ( u m + 1 − u m − 1 ) 2 Δ x + γ ( u m − 1 + 2 u m + u m + 1 ) ( Δ x ) 2 u 1 ( t ) = f 0 ( t ) u M + 1 ( t ) = f 1 ( t ) m = 2 , ⋯ , M ; α = c 2 Δ x & γ = D ( Δ x ) 2 (4)

Setting u m ( 0 ) = f ( x m ) , m = 2 , ⋯ , M

We get, u ˙ ( t ) : = [ u 2 ( t ) , ⋯ , u m ( t ) ] T

d d t ( u 2 ⋮ u M ) = − α ( 0 1 0 − 1 0 0 0 1 0 − 1 0 1 ) ( u 2 ⋮ u M ) + γ ( − 2 1 0 1 − 2 0 − 2 1 0 1 − 2 1 ) ( u 2 ⋮ u M ) + ( − α u 1 ⋮ − α u M + 1 ) + ( γ u 1 ⋮ γ u M + 1 )

So, we obtain a linear system of ordinary differential equations (ODE’s) of the type.

u ˙ ( t ) = d u d t = A u + b ( t ) ︸ f ( t ) , u ( 0 ) = u 0 = [ f ( x 1 ) , ⋯ , f ( x M ) ] T ∴ u ˙ ( t ) = F ( t , u ) , u ( 0 ) = u 0 , where u and F ( t , u ) are vector

Now, we get with time step Δ t for the numerical solution

u n + 1 − u n Δ t = F ( t n , u n ) u n + 1 = u n + Δ t F ( t n , u n )

which is the semi discretization using Euler method of F ( t , u ) = A u ˙ + b ( t ) .

To approximate the solution to the partial differential equation

∂ u ∂ t ( x , t ) + c ∂ u ∂ x ( x , t ) − D ∂ 2 u ∂ x 2 ( x , t ) = 0 , a < x < b and t 0 < t < T Subject to the boundary condition u ( a , t ) = u a ( t ) , t 0 < t < T u ( b , t ) = u b ( t ) , t 0 < t < T And Initial condition, u ( x , t 0 ) = f ( x ) ; a < x < b

Input: dt, dx, constant co-efficient C , D , t 0 , the left and right end point t f of ( 0 , T ) ; x d , the right end point of ( 0 , b ) .

Output: approximation u m m to u ( x m , t n ) for each m m = 2 , ⋯ , m , n = 1 , ⋯ , N .

Step 1: set n x = x d − x 0 d x ; n t = t f − f 0 d t ; α = − c 2 d x , λ = D d x 2

Step 2: for m = 2 , ⋯ , n x Set u m , 1 = f ( x ) ( Initial value ) u n = u m , 1 ;

Step 3: Set , u 1 , n = u a ( left boundary condition ) u n x + 1 , n = u b ; ( right boundary condition )

Step 4-Step 6: (solve a tri-diagonal linear system)

Step 4: Construct matrix A and B

Set, T 1 = ( α ∗ A ) + ( β ∗ B )

b ( 1 ) = u ( 1 , 1 ) b ( n x − 1 ) = u ( n , 1 ) } Boundary

u n e w = u n + d t ( T 1 ∗ u n ) + b (Unknown solution for first time step)

Step 5: For n = 1 , ⋯ , n t + 1

Set u m m , n = u n e w ; u n = u n e w ;

u n e w = u n + d t ( T 1 ∗ u n ) + b ;

Output ( x , u m , n ) ,

Step 6: Stop (the procedure complete)

Numerical implementation of Euler method [

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 will solve numerically for the concentration u using matrix system of equation.

Suppose we use 4 grid points x 1 , x 2 , x 3 , x 4 = x m + 1 i.e. m = 3 in this example.

We let, 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 in Equation (4) to required Euler method of advection diffusion equation.

u → n + 1 = ( u 2 n u 3 n ) − α ( 0 1 − 1 0 ) ︸ A ( u 2 n u 3 n ) + λ ( − 2 1 1 − 2 ) ︸ B ( 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 ) ︸ P } u → n + 1 = ( u 2 n u 3 n ) + Δ t P → ; α = c 2 Δ x ; & λ = D ( Δ x ) 2

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

α = 0.2 × 0.008 0.1 = 0.0160 ≤ 1 ,

γ = 0.02 × 0.008 0.1 2 = 0.0160 ≤ 0.5

Summary of elapsed time for different temporal grid point present below:

The comparison of relative error for two finite difference schemes as a function of time is shown in

the ADE. A good agreement between the numerical solutions and the analytical solutions is obtained and the error becomes clear when using large size step for the time.

represents the concentration is high for 10 seconds and the green curve shows that concentration is decreased for 20 seconds. The curve marked by “blue” represents concentration is high for 30 seconds and. The plot marked by “yellow” represents concentration is high for 50 seconds we can see that when time is increased concentration profile is decreasing. As can be seen in

Similarly, we observe the above figure with the concentration distribution profile for different distances is decreased in a position with respect to time in

both velocity and diffusion coefficient at t = 20 secs, the solutions appeared which can be seen in

Similarly, concentration profile by solving numerically at a different diffusion rate can be seen in

We present numerical solutions with exact solutions for the advection-diffusion equation with an initial condition and two boundary conditions by using ECDS and semi discretize method. A numerical study of the ADE has been presented graphically for two different schemes. The numerical solution of ADE by semi-discretization scheme shows a good agreement with the exact solution as well as for ECDS. Though, ECDS seems a more efficient scheme in terms of elapse timing; we compute the relative errors for two different schemes, both schemes show a very good rate of convergence. In comparison to Euler’s method, ECDS shows less error, which is obvious. Semi discretize methods have to deal with a large number of systems of ordinary differential equations in comparison with ECDS. In our next work, we would like to upgrade this work with higher-order accuracy.

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

Ara, K.N.I., Rahaman, Md.M. and Alam, Md.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