Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views23 pages

Stability Analysis 2023

This research article presents stability analysis and numerical results for three finite difference methods—Lax-Wendroff, Du-Fort-Frankel, and a nonstandard scheme—applied to 2D nonconstant coefficient advection-diffusion equations. The study includes two numerical experiments, with one having an exact solution, and evaluates the stability and convergence rates of the methods. The findings highlight the challenges of solving nonconstant coefficient advection-diffusion equations and aim to identify the most efficient numerical scheme among the three methods.

Uploaded by

aiswarya.iyer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views23 pages

Stability Analysis 2023

This research article presents stability analysis and numerical results for three finite difference methods—Lax-Wendroff, Du-Fort-Frankel, and a nonstandard scheme—applied to 2D nonconstant coefficient advection-diffusion equations. The study includes two numerical experiments, with one having an exact solution, and evaluates the stability and convergence rates of the methods. The findings highlight the challenges of solving nonconstant coefficient advection-diffusion equations and aim to identify the most efficient numerical scheme among the three methods.

Uploaded by

aiswarya.iyer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Open Physics 2024; 22: 20230195

Research Article

Appanah Rao Appadu* and Hagos Hailu Gidey

Stability analysis and numerical results for some


schemes discretising 2D nonconstant coefficient
advection–diffusion equations
https://doi.org/10.1515/phys-2023-0195
received November 22, 2023; accepted January 17, 2024
Nomenclature
Abstract: We solve two numerical experiments described k temporal step size
by 2D nonconstant coefficient advection–diffusion equations Δx spatial step size in the direction of x
with specified initial and boundary conditions. Three finite Δy spatial step size in the direction of y
difference methods, namely Lax–Wendroff, Du-Fort–Frankel ξ amplification factor
and a nonstandard finite difference scheme, are derived and D1, D2 coefficients of dissipation
used to solve the two problems, whereby only the first pro- t time
blem has an exact solution. Stability analysis is performed to Cin, j numerical solution at the grid point (tn , xi , yj )
obtain a range of values of the time step size at a fixed spatial
step size. We obtain the rate of convergence in space when
the three methods are used to solve Problem 1. Computational
times of the three algorithms are computed for Problem 1. 1 Introduction
Results are displayed for the two problems using the three
methods at times T = 1.0 and T = 5.0. The main novelty is the The advection–diffusion equation describes the transport
stability analysis, which is not straightforward as we are of a quantity due to two processes: advection and diffusion.
working with numerical methods discretising 2D nonconstant This equation is widely used in various fields of science
coefficient advection–diffusion equation where many para- and engineering such as fluid dynamics, heat transfer, che-
meters are involved. The second highlight is to determine the mical engineering, and atmospheric sciences [1–3]. The
most efficient scheme from the three methods. Third, there numerical solution of advection–diffusion equation is gen-
are very few published studies on analysis and use of numer- erally a challenging problem due to its nature as it consists
ical methods to solve nonconstant coefficient advection–dif- of advection and diffusion terms [4].
fusion equations, and this is one of the very few rare articles Finite difference method is one of the most popular
treating such topics. classes of numerical methods used to solve advection–dif-
fusion equations. Finite difference methods for advection–
Keywords: nonconstant coefficient, advection–diffusion, diffusion equations with uniform flow and constant coeffi-
Lax–Wendroff, Du-Fort–Frankel, nonstandard finite differ- cients have been extensively studied and developed [5–9].
ence, stability, rate of convergence One of the most common ways of measuring the rela-
tive merit of a numerical scheme for advection is to con-
sider the scheme’s dispersion and dissipation [10]. The
pioneering work of the theoretical study of finite difference
methods was made by Courant et al. [11]. Von Neumann and
Richtmyer [12] developed Fourier analysis method of finite

* Corresponding author: Appanah Rao Appadu, Department of difference schemes. Kreiss [13] initiated work on the disper-
Mathematics, Nelson Mandela University, University Way, sion and dissipation of finite difference schemes discretising
Summerstrand, Gqeberha, 6031, South Africa, partial differential equations using Fourier method. The dis-
e-mail: [email protected]
sipative and dispersive features of the Lax–Wendroff (LW)
Hagos Hailu Gidey: Department of Mathematics and Statistical Sciences,
Botswana International University of Science and Technology, Palapye,
and the MacCormack schemes discretising the linear and
Botswana; Department of Mathematics, Aksum University, Axum, non-linear advection equation are discussed in the study
Ethiopia of Winnicki et al. [14]. Hirt [15] and Ru-xun and Zhao-hui

Open Access. © 2024 the author(s), published by De Gruyter. This work is licensed under the Creative Commons Attribution 4.0 International License.
2  Appanah Rao Appadu and Hagos Hailu Gidey

[16] worked on the remainder analysis approach of finite of k and check if ∣ξ ∣ ≤ 1 for stability. We then increase k
difference methods. The relative phase error is a measure of gradually until ∣ξ ∣ ≤ 1 no longer holds. In the second
the dispersive character of a numerical method [17]. The approach, we use the technique of Hindmarsh et al.
relative phase error is a ratio that measures the velocity [25]. We fix Δx , Δy ,D 1 , D 2 to obtain the amplification factor
of the computed waves to that of the physical waves [17]. ξ in terms of k , xi , yj . Then, we obtain 3D plots of ∣ξ ∣ vs
Appadu [18] used the LW, Crank–Nicolson, and x ∈ [0, 1] vs y ∈ [0, 1] and obtain range of values of k for
a nonstandard finite difference scheme to solve a one- which ∣ξ ∣ ≤ 1 .
dimensional advection–diffusion equation with constant This article is organised as follows. We describe the two
coefficients. Two optimisation techniques based on mini- numerical experiments in Section 2. In Section 3, we derive
misation of dispersion error were implemented to find the the three methods, namely Lax–Wendroff, Du-Fort–Frankel
optimal value of the time step size when the spatial step and nonstandard finite difference method (NSFD) methods
size is chosen as h = 0.02 , and this is validated using some to solve Problem 1. Section 4 is devoted to derivation and
numerical experiments. Appadu et al. [8] used three numer- study of stability of the methods to solve Problem 2. Sections
ical methods to solve two problems described by advec- 5 and 6 provide the numerical results from Problems 1 and 2,
tion–diffusion equations with specified initial and boundary respectively. Section 7 highlights the salient features of this
conditions. Two test problems were considered. The first test article.
problem considered has steep boundary layers near x = 1 ,
and this is a challenging problem as many schemes are
plagued by non-physical oscillation near steep boundaries.
The regions of stability of forward-time central space 2 Numerical experiments
(FTCS) and LW schemes discretising the 1D advection–dif-
fusion equation given by [19]: We solve the 2D nonconstant coefficient advection–diffu-
∂C ∂C ∂2 C sion equation given by:
+a = α 2, (1)
∂t ∂x ∂x ∂C ∂ ∂ ⎛ ∂2 C ⎞ ⎛⎜ ∂2C ⎞⎟
c2 1 1 − c2 α Δt + (uC ) + (vC ) = D 1 + D

2

, (2)
are 2 ≤ s ≤ 2 and 0 < s ≤ 2 , respectively, where s = Δx 2 ∂t ∂x ∂y ⎝ ∂x 2 ⎠ ⎝ ∂y 2 ⎠
a Δt
and c = Δx . We note that a is the coefficient of advection
where D 1 and D 2 are the constants and u and v are the
and α is the coefficient of diffusion.
nonconstants.
Hutomo et al. [20] used Du-Fort–Frankel scheme in
order to solve some nonconstant coefficient advection–
diffusion equations on regular and irregular grids. They
considered five numerical experiments, out of which 2.1 Problem 1 [20]
only one of them has exact solution. However, no detailed
proof of the stability of the Du-Fort–Frankel is given. We solve Eq. (2), where
In this work, we derive three methods to solve two
problems described by nonconstant coefficient advection– ⎛ α⎞
u (x ) = D 1 β −
⎜ + pe −βx ,
⎟ (3)
diffusion equation. Exact solution is known for only one ⎝ 2β ⎠
of the problems considered. Obtaining the stability of
⎛ α⎞
numerical methods for advection–diffusion equation is v ( y ) = D 2γ −
⎜ + qe −γy ,
⎟ (4)
⎝ 2γ ⎠
not straightforward and there were several attempts in
the past by various authors and some of the previously with the following parameters:
published studies [15,21–25]. Complication arises for non-
α = − 0.029, β = 0.5, γ = 0.5, p = 0.05, q = 0.05,
constant coefficient advection–diffusion equations. In this
current work, the amplification factor is a function of xi , D 1 = 0.004, and D 2 = 0.004.
yj , ωx , ω y , Δx , Δy , k , ui , j , and vi , j and the constants D 1 and The exact solution is given by [20]:
D 2 . Two approaches are used in order to obtain the range
of values of for stability. In the first approach, we fix C (x , y , t ) = e αt + βx + γy , (5)
D 1 , D 2 , Δx , Δy and select some values of xi ∈ [0, 1] and and the boundary conditions are deduced from exact solu-
yj ∈ [0, 1]. We then obtain 3D plots of the modulus of tion. Dirichlet boundary conditions are used at the bound-
amplification factor ξ vs ωx ∈ [− π , π ] vs ω y ∈ [− π , π ] at aries. The domains are x , y ∈ [0, 1] and t ∈ (0, T ]. We
some selected value of k , starting with a very small value choose the spatial step sizes in the x and y directions as
Nonconstant coefficient advection–diffusion equations  3

Δx = Δy = 0.05. For the domain selected, the range of both where ϕ and are the temporal and spatial weighting factors.
1−u
u and v is 0.06 to 0.08, and this can be easily obtained using To obtain the LW scheme, we use ϕ = 0 and χ = 2 . Thus,
any suitable numerical software such as Maple. We have the LW scheme when used to discretise Eq. (6) is [6,26]
decided to obtain profiles at short and longer time propa-
Cin + 1 − Cin n n
⎡ Ci − Ci − 1 Cin+ 1 − Cin− 1 ⎤
gation, and this is why we chose T as 1.0 and 5.0. + u⎢c + (1 − c )
k ⎣ Δx 2Δx ⎥⎦
Cin+ 1 − 2Cin + Cin− 1
2.2 Problem 2 [20] −D = 0,
(Δx )2
uk
In this numerical experiment, we solve Eq. (2) where the where c = Δx .
nonconstant coefficient advection terms are given by: Suppose we have a 1D nonconstant coefficient advec-
u(x , y ) = 0.01 + 0.005x − 0.005y , tion–diffusion equation of the form:
v(x , y ) = − 0.01 − 0.005x + 0.005y , ∂C ∂ ∂2 C
+ (uC ) − D 2 = 0,
with domain x , y ∈ [0, 1] and the constants ∂t ∂x ∂x
D 1 = D 2 = 0.0004 . The initial condition is given by: where u = u(x ) and D is a constant. This equation can be
⎧ 10, if x = 0.5, y = 0.5 written as:
C (x , y , t = 0) = ⎨
⎩ 1, otherwise . ∂C ∂C ∂u ∂2 C
+u + C − D 2 = 0. (7)
The boundary conditions are as follows: ∂t ∂x ∂x ∂x
C (x = 0, y , t ) = C (x = 1, y , t ) = 1, When Eq. (7) is discretised using the LW scheme, the fol-
C (x , y = 0, t ) = C (x , y = 1, t ) = 1. lowing discretisations are used:
There is no exact solution for this problem. We display the ∂C Cin + 1 − Cin
results at times T = 1 and T = 5 using Δx = Δy = 0.05. ≈ ,
∂t k
n n
∂C Ci − Ci − 1 Cin+ 1 − Cin− 1
≈ ci + (1 − ci ) ,
∂x Δx 2Δx
3 Derivation and stability analysis ∂2C Cin+ 1 − 2Cin + Cin− 1
≈ ,
of the three methods for ∂x 2 (Δx )2
Problem 1 where ci =
u ik
Δx
. This gives the following scheme:

Cin + 1 − Cin ⎡ ⎛ Cin − Cin− 1 ⎞ n n


⎛ Ci + 1 − Ci − 1 ⎞⎤
3.1 LW method + ui ci ⎜
+ (1 − ci )
⎟ ⎜ ⎟

k ⎢⎣ ⎝ Δx ⎠ ⎝ 2Δx ⎠⎦⎥
(8)
n n n
We first obtain the family of explicit and implicit schemes
∂u ⎛ Ci + 1 − 2Ci + Ci − 1 ⎞
+ Cin −D ⎜ ⎟
= 0.
in order to discretise the constant coefficient advection– ∂x i ⎝ (Δx )2 ⎠
diffusion equation [18]: Eq. (2) can be rewritten as follows:
∂C ∂C ∂2 C
+u − D 2 = 0. (6) ∂C ∂u ∂C ∂v ∂C
∂t ∂x ∂x + C+u + C+v
∂t ∂x ∂x ∂y ∂y
The family of methods is given by: (9)
⎛ ∂2 C ⎞ ⎛ ∂2 C ⎞
Cin + 1 − Cin = D1 ⎜
2
+ D 2⎜ 2 ⎟ .

⎝ ∂x ⎠ ⎝ ∂y ⎠
k
⎧1 − ϕ⎡ Cin − Cin− 1 Cin+ 1 − Cin− 1 ⎤ The following approximations are used when Eq. (9) is
+ u⎨ ( 1 − χ ) + χ discretised using LW scheme:
⎩ Δx ⎢⎣ Δx 2Δx ⎥⎦
ϕ⎡ Cin + 1 − Cin−+1 1 Cin++1 1 − Cin−+1 1 ⎤⎫
+ (1 − χ ) +χ
Δx ⎢⎣ Δx 2Δx ⎥⎦⎬⎭

⎡1 − ϕ n
− D⎢ (C − 2Cin + Cin− 1)
⎣ (Δx )2 i + 1
ϕ ⎤
+ (C n + 1 − 2Cin + 1 + Cin−+1 1)⎥ = 0,
(Δx )2 i + 1 ⎦
4  Appanah Rao Appadu and Hagos Hailu Gidey

n+1 n
∂C Ci , j − Ci , j The LW scheme when used to solve Problem 1 is given by:
≈ ,
∂t k Cin, j+ 1 − Cin, j
∂C
n n
k Ci , j − Ci − 1, j + p( − β )e −βxiCin, j + q( − γ)e −γyjCin, j
≈ ui , j k
∂x Δx Δx n n
⎡ k Ci , j − Ci − 1, j ⎛
n n
n n
k ⎞ Ci + 1, j − Ci − 1, j ⎤
⎛ k ⎞ Ci + 1, j − Ci − 1, j + ui⎢ui + 1 − ui ⎥⎦
+ 1 − ui , j , ⎣ Δx Δx ⎝ Δx ⎠ 2Δx
⎝ Δx ⎠ 2Δx (10)
n n n n
n n n ⎡ k Ci , j − Ci , j − 1 ⎛ k ⎞ Ci , j + 1 − Ci , j − 1 ⎤
∂2C Ci + 1, j − 2Ci , j + Ci − 1, j + vj ⎢vj + 1 − vj ⎜ ⎟
≈ , ⎣ Δx Δy ⎝ Δy ⎠ 2Δy ⎥⎦
∂x 2 (Δx )2
n n Cin+ 1, j − 2Cin, j + Cin− 1, j Cin, j + 1 − 2Cin, j + Cin, j − 1
∂C k Ci , j − Ci , j − 1 = D1 + D2 ,
≈ vi , j (Δx )2 (Δy )2
∂y Δy Δy
n n
⎛ k ⎞ Ci , j + 1 − Ci , j − 1 where
+ ⎜1 − vi , j ⎟ ,
⎝ Δy ⎠ 2Δy ⎛ α⎞
n n n ui = D 1 β −
⎜ + pe −βxi ,
⎟ (11)
∂2C Ci , j + 1 − 2Ci , j + Ci , j − 1 ⎝ 2β ⎠
≈ .
∂y 2 (Δy )2
⎛ α⎞
vj = D 2γ −
⎜ + qe −γyj .
⎟ (12)
⎝ 2γ ⎠

Plots of u(x ) vs x ∈ [0, 1] vs y ∈ [0, 1] and v(x ) vs


x ∈ [0, 1] vs y ∈ [0, 1] when D 1 = D 2 = 0.004, α = − 0.029,
β = 0.5, γ = 0.5, p = 0.05, and q = 0.05 are displayed in
Figure 1, and we observe that both quantities are non-
negative.
Using Eq. (10), we obtain
Cin, j+ 1 = Cin, j + pβke −βxiCin, j + qγke −γyjCin, j
n n
⎡ k Ci , j − Ci − 1, j
− uik ⎢ui
⎣ Δx Δx
n n
⎛ k ⎞ Ci + 1, j − Ci − 1, j ⎤
+ 1 − ui ⎥⎦
⎝ Δx ⎠ 2Δx
n n
⎡ k Ci , j − Ci , j − 1
− vjk ⎢vj (13)
⎣ Δx Δy
n n
⎛ k ⎞ Ci , j + 1 − Ci , j − 1 ⎤
+ ⎜1 − vj ⎟ ⎥⎦
⎝ Δy ⎠ 2Δy
D 1k
+ (C n − 2Cin, j + Cin− 1, j )
(Δx )2 i + 1, j
D 2k n
+ (C − 2Cin, j + Cin, j − 1) .
(Δy )2 i , j + 1
To study the stability, we use the ansatz Cin, j = ξ ne Iθxi Δx e Iθ y j Δy
[27], where θx and θy are the wave numbers along x - and y -
directions, respectively, and I = − 1 . Let ωx = θx Δx and
ω y = θy Δy . The amplification factor is given by:

Figure 1: Plots of u(x ) vs x ∈ [0, 1] vs y ∈ [0, 1] and v(x ) vs x ∈ [0, 1] vs


y ∈ [0, 1]: (a) u and (b) v .
Nonconstant coefficient advection–diffusion equations  5

ξ = 1 + pβke −βxi + qγke −γyj


⎡ k ⎛ k ⎞ 2I sin(ωx ) ⎤
− uik ⎢ui (1 − e −Iωx ) + 1 − ui
⎣ (Δx )2 ⎝ Δx ⎠ 2Δx ⎥⎦
⎡ k ⎛ k ⎞ 2I sin(ω y ) ⎤
− vjk ⎢vj (1 − e −Iω y ) + 1 − vj
⎜ ⎟ (14)
⎣ (Δy ) 2
⎝ Δy ⎠ 2Δy ⎥⎦
D 1k Iωx D 2k Iω y
+ (e − 2 + e −Iωx ) + (e − 2
(Δx )2 (Δy )2
+ e −Iω y ) .

We note that for Problem 1, the parameters are [20] as


follows:
α = − 0.029, β = 0.5, γ = 0.5, p = 0.05, q = 0.05,
D 1 = 0.004, and D 2 = 0.004.

However, different parameters can be used in future stu-


dies. We choose Δx = Δy = 0.05 and use the parameters
which Hutomo et al. [20] used for Problem 1. This gives
the amplification factor as follows:

ξ = 1 + 0.0025ke −0.5xi + 0.025ke −0.5yj + 0.124k 2e −0.5xi


+ I sin(ωx )e −0.5xi[k − 0.124k 2 − 0.01k 2e −0.5xi]
+ I sin(ω y )e −0.5yj[k − 1.24k 2 − k 2e −0.5yj ]
+ I sin(ωx )[3.82k − 0.3844k 2] − 0.3844k 2e −Iωx
+ I sin(ω y )[3.82k − 0.3844k 2] + 0.01k 2(e −0.5xi )2
+ 1.24k 2e −0.5yj[1 − e −Iω y] + k 2(e −0.5yj )2[1 − e −Iω y]
+ 0.7688k 2 − 0.124k 2e −0.5xie −Iωx
− 0.01k 2(e −0.5xi )2e −Iωx − 0.3844k 2e −Iω y − 6.4k ,

which can be written as follows:

ξ = 1 − 6.4k + 0.025ke −0.5xi + 0.025ke −0.5yj − 0.7688k 2


− 1.24k 2e −0.5xi − k 2(e −0.5xi )2 + 1.24k 2e −0.5yj cos(ω y )
− 1.24k 2e −0.5yj − k 2(e −0.5yj )2 + k 2(e −0.5yj )2 cos(ω y )
+ 3.2k cos(ωx ) + 3.2k cos(ω y ) + 1.24k 2e −0.5xi cos(ωx )
+ k 2(e −0.5xi )2 cos(ωx ) + 0.3844k 2 cos(ωx )
+ 0.3844k 2 cos(ω y ) − 0.62Ik sin(ω y )
− Ik[e −0.5xi sin(ωx ) + e −0.5yj sin(ω y ) + 0.62 sin(ωx )].

We note that ξ consists of five parameters: xi , yj , k , ωx , ω y .


(i) Since xi , yj ∈ [0, 1], we can choose xi = yj = 1 . We obtain
3D plots of ∣ξ ∣ vs ωx ∈ [− π , π ] vs ω y ∈ [− π , π ] at some
selected values of k , starting with a very small k , say
k = 0.001 , and gradually increasing the value. For stabi-
lity, we need ∣ξ ∣ ≤ 1. We observe that the scheme is
stable when k ≤ 0.14 , as depicted in Figures 2 and 3.
(ii) We now choose xi = yj = 0.5 and repeat the steps in (i).
We observe that the range of values of k for stability is Figure 2: 3D plots of ∣ξ∣ vs ωx ∈ [‒π , π ] vs ω y ∈ [‒π , π ] when xi = yj = 1
again k ≤ 0.14 , as displayed in Figures 4 and 5. and using Δx = Δy = 0.05 and k = 0.001, 0.01, 0.1 : (a) , (b) k = 0.01 , and
(c) k = 0.1 .
6  Appanah Rao Appadu and Hagos Hailu Gidey

Figure 3: 3D plots of ∣ξ∣ vs ωx ∈ [‒π , π ] vs ω y ∈ [‒π , π ] when xi = yj = 1 Figure 4: 3D plots of ∣ξ∣ vs ωx ∈ [‒π , π ] vs ω y ∈ [‒π , π ] when
and using Δx = Δy = 0.05 and k = 0.12, 0.14 , and 0.15: (a) k = 0.12 , (b) xi = yj = 0.5 and using Δx = Δy = 0.05 and k = 0.001, 0.01 , and 0.1: (a)
k = 0.14 , and (c) k = 0.15 (showing unstability). k = 0.001 , (b) k = 0.01 , and (c) k = 0.1 .
Nonconstant coefficient advection–diffusion equations  7

3.2 Du-Fort–Frankel method

Du Fort and Frankel [28] proposed a modification of the


centred time centred space (CTCS) scheme to ensure
second-order accuracy while improving numerical sta-
bility [20]. The idea is to replace the middle term in the
numerator of CTCS method with an average value.
Hence, we have the following scheme to discretise
Eq. (9):

Cin, j+ 1 − Cin, j− 1 ⎛ ui + 1 − ui − 1 n Cin+ 1, j − Cin− 1, j ⎞


+ ⎜ Ci , j + ui ⎟
2k ⎝ 2Δx 2Δx ⎠
⎛ vj + 1 − vj − 1 n Cin, j + 1 − Cin, j − 1 ⎞
+ ⎜ Ci , j + vj ⎟
⎝ 2Δy 2Δy ⎠
(15)
⎛ Cin+ 1, j − Cin, j+ 1 − Cin, j− 1 + Cin− 1, j ⎞
= D 1⎜ ⎟
⎝ (Δx )2 ⎠
⎛ Cin, j + 1 − Cin, j+ 1 − Cin, j− 1 + Cin, j − 1 ⎞
+ D 2⎜ ⎟.
⎝ (Δy )2 ⎠

On rearrangement, we obtain
1
Cin, j+ 1 = {(1 − 2Bx − 2By )Cin, j− 1
1 + 2Bx + 2By
⎛ uik ⎞ ⎛ uik ⎞
+ + 2Bx Cin− 1, j + − + 2Bx Cin+ 1, j
⎝ Δx ⎠ ⎝ Δx ⎠
(16)
⎛ vjk ⎞ ⎛ vjk ⎞
+ ⎜ + 2By Cin, j − 1 + −
⎟ ⎜+ 2By Cin, j + 1 ⎟

⎝ Δy ⎠ ⎝ Δy ⎠
⎡k k n ⎤ ⎫
− ⎢ (u i + 1 − u i − 1 ) + (vj + 1 − vj − 1)⎥Cin, j ⎬,
⎣ Δx Δy ⎦ ⎭
kD kD
where Bx = (Δx )12 and By = (Δy)22 .
The amplification factor ξ satisfies the following equation:

1 ⎧
ξ= ⎨(1 − 2Bx − 2By )ξ −1
1 + 2Bx + 2By ⎩
⎛ uik ⎞ ⎛ uik ⎞
+ + 2Bx e −Iωx + − + 2Bx e Iωx
⎝ Δx ⎠ ⎝ Δx ⎠
(17)
⎛ vjk ⎞ ⎛ vjk ⎞
+ ⎜ + 2By ⎟e −Iω y + ⎜− + 2By ⎟e Iω y
⎝ Δy ⎠ ⎝ Δy ⎠
⎡k k ⎤⎫
− ⎢ (u i + 1 − u i − 1 ) + (vj + 1 − vj − 1)⎥⎬.
⎣ Δx Δy ⎦⎭

We can express ui + 1 − ui − 1 as pe −βxi + 1 − pe −βxi − 1 and vjn+ 1 − vj − 1


as qe −γyj + 1 − qe −γyj − 1 using Eqs. (11) and (12).
Let xi + 1, xi , xi − 1 be denoted by x3 , x2 , x1 and yj + 1 , yj , yj − 1
be denoted by y3 , y2 , y1 , respectively.
Figure 5: 3D plots of ∣ξ∣ vs ωx ∈ [‒π , π ] vs ω y ∈ [‒π , π ] when
xi = yj = 0.5 and using Δx = Δy = 0.05 and k = 0.12, 0.14 , and 0.15: (a) We choose Δx = Δy = 0.05 along with the required
k = 0.12 , (b) k = 0.14 , (c) k = 0.15 (showing unstability). parameters for Problem 1. This gives
8  Appanah Rao Appadu and Hagos Hailu Gidey

1 present Table 1, which summarises the range of values of k


ξ= {(1 − 6.4k )ξ −1
1 + 6.4k for stability. For stability, we need k ≤ 0.16.
+ (20(0.031 + 0.05e −0.5x2 )k + 3.2k )e −Iωx
+ (3.2k − 20(0.031 + 0.05e −0.5x2 )k )e Iωx 3.3 NSFD
+ (3.2k + 20(0.031 + 0.05e −0.5y2 )k )e −Iω y
+ (3.2k − 20(0.031 + 0.05e −0.5x2 )k )e Iω y We refer to Kojouharov and Cheni [29] and Mickens and
− 20k[(0.05e −0.5x3 − 0.05e −0.5x1 ) Washington [30], who constructed a nonstandard finite dif-
+ (0.05e −0.5y3 − 0.05e −0.5y1 )]} . ference scheme for an advection–diffusion reaction equation
of the form:
Since Δx = Δy = 0.05 and x , y ∈ [0, 1], we can choose, for
ut + ν0ux = Duxx − λu − εu1 ∕ 3 ,
instance, among the various possibilities: x3 = 0.55, x2 =
0.5, x1 = 0.45 and y3 = 0.55, y2 = 0.5, y1 = 0.45. This then where ν0, D , and λε are non-negative parameters.
gives the following equation involving the amplification To construct the NSFD scheme for Eq. (9), we use the
factor, ξ : following approximations:
ξ (1 + 6.4k ) = (1 − 6.4k )ξ −1 + 0.0778819120k
+ 4.598800783k (e −Iωx + e −Iω y ) (18)
+ 1.801199217k (e Iωx + e Iω y ) .
From there, we check if the scheme is stable for some selected
values of k . For stability, we need to have ∣ξ ∣ ≤ 1 for ωx ∈
[−π , π ] and ω y ∈ [− π , π ] at those selected values of k . We
start with low value of k and increase k gradually. Let us
choose k = 0.01 . We obtain the following quadratic equation:
ξ 2 − 0.8796992482 − 0.04322181187(cos(ωx )
− I sin(ωx ))ξ − 0.01692856407(cos(ωx )
+ I sin(ωx ))ξ − 0.04322181187(cos(ω y ) (19)
− I sin(ω y ))ξ − 0.01692856407(cos(ω y )
+ I sin(ω y ))ξ − 0.0007320318722ξ = 0.
Let the two roots be ξ1 and ξ2 . We obtain plots of ∣ξ1∣ vs
ωx ∈ [− π , π ] vs ω y ∈ [− π , π ] and also ∣ξ2∣ vs ωx ∈ [− π , π ] vs
ω y ∈ [− π , π ] in Figure 6.
We now repeat the same procedures from Eqs. (18) to (19)
and use different values of k each occasion and check if the
scheme is stable at that value of k . We will not present all the
figures due to restriction in number of pages possible. We

Table 1: Checking stability of Du-Fort–Frankel scheme for Problem 1 at


some values of k when Δx = Δy = 0.05

Value of k Is scheme stable at that value of k ?

0.001 Yes
0.01 Yes
0.1 Yes
0.16 Yes
0.17 No
0.18 No Figure 6: Plots of the modulus of amplification factors vs ωx vs ω y when
Δx = Δy = 0.05 and k = 0.01 : (a) ∣ξ1∣ vs ωx vs ω y and (b) ∣ξ2∣ vs ωx vs ω y .
Nonconstant coefficient advection–diffusion equations  9

n+1 n
∂C Ci , j − Ci , j (21) is used. There is no need to obtain the stability of NSFD
≈ , using von Neumann stability analysis. We can just check if
∂t ϕ (k )
n n the conditions for which NSFD replicates positivity of the
∂C Ci , j − Ci − 1, j
≈ , continuous model.
∂x ψ(Δx )
n n n
∂2C Ci + 1, j − 2Ci , j + Ci − 1, j
≈ ,
∂x 2 (ψ(Δx ))2
n n
∂C Ci , j − Ci , j − 1
≈ ,
4 Derivation and stability analysis
∂y ψ(Δy )
n n n
of the three methods for
∂2C Ci , j + 1 − 2Ci , j + Ci , j − 1
∂y 2

(ψ(Δy ))2
, Problem 2
where ψ(Δx ) = exp(Δx ) − 1 and ϕ(k ) = exp(k ) − 1 . This gives
the NSFD scheme as: 4.1 LW scheme

Cin, j+ 1 − Cin, j ∂u Cin, j − Cin− 1, j The scheme is given by:


+ Cin, j + ui
ϕ (k ) ∂x i ψ(Δx )
Cin, j+ 1 − Cin, j
∂v Cin, j − Cin, j − 1 + 0.01Cin, j
+ Cin, j + vj k
∂y ψ(Δy ) n n
j
(20) ⎡ k Ci , j − Ci − 1, j
Cin+ 1, j − 2Cin, j + Cin− 1, j + ui , j ⎢ui , j
= D1 ⎣ Δx Δx
(ψ(Δx ))2 n n
⎛ k ⎞ Ci + 1, j − Ci − 1, j ⎤
Cin, j + 1 − 2Cin, j + Cin, j − 1 + 1 − ui , j
⎝ ⎥⎦ (23)
+ D2 . Δx ⎠ 2Δx
(ψ(Δy ))2 n n n n
⎡ k Ci , j − Ci , j − 1 ⎛ k ⎞ Ci , j + 1 − Ci , j − 1 ⎤
We choose the functional relation: + vi , j ⎢vi , j + 1 − vi , j
⎜ ⎟
⎥⎦
⎣ Δy Δy ⎝ Δy ⎠ 2Δy
ϕ (k ) ϕ (k ) 1 Cin+ 1, j − 2Cin, j + Cin− 1, j Cin, j + 1 − 2Cin, j + Cin, j − 1
= = , (21) = D1 + D2 ,
[ψ(Δx )]2 [ψ(Δy )]2 2 (Δx )2 (Δy )2
and we obtain the following scheme: where ui , j = 0.01 + 0.005xi − 0.005yj , vi , j = − 0.01 − 0.005xi +
0.005yj , D 1 = 0.0004 , and D 2 = 0.0004 .
⎧ ϕ (k )
Cin, j+ 1 = ⎨1 + pβϕ(k )e −βxi − ui + qγϕ(k )e −γyj Eq. (23) can be written as:
⎩ ψ(Δx )
ϕ (k ) ⎫ D1 n
− vj − D 1 − D 2 ⎬Cin, j + C
ψ(Δy ) ⎭ 2 i + 1, j
(22)
D2 n ⎛ ϕ (k ) D1 ⎞ n
+ C + ui + ⎜ C ⎟

2 i , j + 1 ⎝ ψ(Δx ) 2 ⎠ i − 1, j
⎛ ϕ (k ) D2 ⎞ n
+ ⎜vj + ⎟C .
⎝ ψ(Δy ) 2 ⎠ i,j− 1

To run experiments, we use (21), choose Δx = Δy = 0.05,


and this gives k = ln(1 + 0.5 × 0.052) ≃ 1.249 × 10−3 .
It is clear that the coefficients of Cin+ 1, j and Cin, j + 1 are non-
negative. Also, the coefficients of Cin− 1, j and Cin, j − 1 are non-
negative as we see from Figure 1 that 0.06 ≤ ui ≤ 0.08 and
0.06 ≤ vj ≤ 0.08. We display the variation of coefficient of
Cin, j vs x ∈ [0, 1] vs y ∈ [0, 1] in Figure 7 and see that it is in
the range of 0.9882 to 0.9890 for x ∈ [0, 1] and y ∈ [0, 1].
We therefore conclude that NSFD replicates the positivity
of the continuous model when the functional relation in Figure 7: Coefficient of Cin, j vs x ∈ [0, 1] vs y ∈ [0, 1].
10  Appanah Rao Appadu and Hagos Hailu Gidey

n n
⎡ k Ci , j − Ci − 1, j ⎡ k 1 − e −Iωx
Cin, j+ 1 = Cin, j − 0.01kCin, j − ui , jk ⎢ui , j ξ = 1 − 0.01k − ui , jk ⎢ui , j
⎣ Δx Δx ⎣ Δx Δx
n n
k ⎞ Ci + 1, j − Ci − 1, j ⎤ ⎛ k ⎞ 2I sin(ωx ) ⎤
⎛ + 1 − ui , j
+ 1 − ui , j ⎥⎦ ⎝ Δx ⎠ 2Δx ⎦⎥
⎝ Δx ⎠ 2Δx (24)
⎡ k Cin, j − Cin, j − 1 ⎡ k 1 − e −Iω y ⎛ k ⎞ 2I sin ω y ⎤
− vi , jk ⎢vi , j + ⎜1 − vi , j ⎟
− vi , jk ⎢vi , j ⎣ Δy Δy ⎝ Δy ⎠ 2Δy ⎥⎦
⎣ Δy Δy
n n D 1k D 2k
⎛ k ⎞ Ci , j + 1 − Ci , j − 1 ⎤ + 2
(2 cos(ωx ) − 2) + (2 cos(ω y ) − 2) .
+ 1 − vi , j ⎟
⎜ (Δx ) (Δy )2
⎝ Δy ⎠ 2Δy ⎥⎦
D 1k To find range of values of k when Δx = Δy = 0.05, we
+ (C n − 2Cin, j + Cin− 1, j ) use the approach of Hindmarsh et al. [25].
(Δx )2 i + 1, j
Case 1
D 2k n
+ (C − 2Cin, j + Cin, j − 1) . We fix ωx = π and ω y = π . We substitute ui , j and vi , j in
(Δy )2 i , j + 1
terms of xi and yj and replace Δx and Δy by 0.05 in Eq. (24)
The amplification factor is given by: to obtain
ξ = 1 − 1.29k − 1,600 k 2(0.01 + 0.005xi − 0.005yj )2 .

Figure 9: Plot of numerical solution vs x vs y using LW at time T = 1


Figure 8: Plots of coefficients of Cin‒1, j and Cin, j ‒1 vs x ∈ [0, 1] vs y ∈ [0, 1]: using Δx = Δy = 0.05 and some values of k : (a) k = 0.01 and
(a) coefficient of Cin‒1, j and (b) coefficient of Cin, j ‒1 . (b) k = 0.001 .
Nonconstant coefficient advection–diffusion equations  11

We obtain a 3D plot of ∣ξ ∣ vs xi ∈ [0, 1] vs yj ∈ [0, 1] and ∣ξ ∣2 ≃ 1 + ωx2[0.0002k 3(xi − yj ) − 0.32k + 0.0016k 2


increase k gradually. Range of values of k for stability
− 0.0001xiyj k 3 + 0.0002k 3 + 0.00005k 3(xi2 + yj2 )]
is 0 < k < 1.16.
Case 2 + ωy2[0.0002k 3( − xi + yj ) − 0.32k + 0.0016k 2
Here, we use the approximations sin(ωx ) ≈ ωx and
− 0.0001xiyj k 3 + 0.0002k 3 + 0.00005k 3(xi2 + yj2 )]
ωx2
cos(ωx ) ≈ 1 − . Then, the amplification factor is given by:
2 − 0.01k + 0.000025k 2
ξ ≃ 1 − 0.01k − 0.002k 2(ωx2 + ωy2 ) + 0.02k 2ωx2( − xi + yj ) ≃ 1 + 0.0001k 2 − 0.002k .

+ 0.02k 2ωy2 ( − xi + yj ) + 0.1kω y (xi − yj ) Solving for ∣ξ ∣ ≤ 1 with k > 0, we obtain 0 < k ≤ 200.
Hence, the intersection of the two inequalities gives
− 0.005k 2ωx2(xi2 + yj2 ) + 0.01xiyj k 2(ωx2 + ωy2 )
the region of the stability as 0 < k ≤ 1.16.
+ 0.2Ik ( − ωx + ω y ) + 0.1kωx ( − xi + yj )
− 0.005k 2ωy2 (xi2 + yj2 ) − 0.16k (ωx2 + ωy2 ) . 4.2 Du-Fort–Frankel method
This gives
The scheme is given by:

Figure 11: Plot of numerical solution vs x vs y using Du-Fort–Frankel at


Figure 10: Plot of numerical solution vs x vs y using LW at time T = 5 time T = 1 using Δx = Δy = 0.05 and some values of k : (a) k = 0.01 and
using Δx = Δy = 0.05 some values of k : (a) k = 0.01 and (b) k = 0.001 . (b) k = 0.001 .
12  Appanah Rao Appadu and Hagos Hailu Gidey

Cin, j+ 1 − Cin, j− 1 ⎛ ui + 1, j − ui − 1, j n Cin+ 1, j − Cin− 1, j ⎞ ξ − ξ −1


+ ⎜ Ci , j + ui , j ⎟ 2k
2k ⎝ 2Δx 2Δx ⎠
⎛ (0.01 + 0.005xi + 1 − 0.005yj ) − (0.01 + 0.005xi − 1 − 0.005yj )
+ ⎜
⎛ vi , j + 1 − vi , j − 1 n Cin, j + 1 − Cin, j − 1 ⎞ ⎝ 2(0.05)
+⎜ Ci , j + vi , j ⎟
⎝ 2Δy 2Δy ⎠ 0.01 + 0.005xi − 0.005yj ⎞
+ (2I sin(ωx ))⎟
2(0.05) ⎠
⎛ Cin+ 1, j − Cin, j+ 1
− Cin, j− 1 + Cin− 1, j ⎞
= D 1⎜ ⎟ ⎛ (− 0.01 − 0.005xi + 0.005yj + 1 ) − (− 0.01 − 0.005xi + 0.005yj − 1 )
⎝ (Δx )2 ⎠ + ⎜
⎝ 2(0.05)
(25)
⎛ Cin, j + 1 − Cin, j+ 1 − Cin, j− 1 + Cin, j − 1 ⎞ − 0.01 − 0.005xi + 0.005yj ⎞
+ D 2⎜ ⎟, + (2I sin(ω y ))⎟
⎝ (Δy )2 ⎠ 2(0.05) ⎠
0.0004 Iωx
= (e − ξ − ξ −1 + e −Iωx )
where ui , j = 0.01 + 0.005xi − 0.005yj , vi , j = − 0.01 − 0.005xi + (0.05)2
0.005yj , D 1 = 0.0004 , and D 2 = 0.0004. +
0.0004 Iωy
(e − ξ − ξ −1 + e −Iωy ).
We fix Δx = Δy = 0.05. The amplification factor satis- (0.05)2
fies the following equation:
We let xi + 1 = x3 , xi = x2 and xi − 1 = x1 . and on simplification,
we obtain

Figure 12: Plot of numerical solution vs x vs y using Du-Fort–Frankel at Figure 13: Plot of numerical solution vs x vs y using NSFD at times T = 1
time T = 5 using Δx = Δy = 0.05 some values of k : (a) k = 0.01 and and T = 5 using Δx = Δy = 0.05 and k = 1.249 × 10‒3 : (a) T = 1 and
(b) k = 0.001 . (b) T = 5 .
Nonconstant coefficient advection–diffusion equations  13

ξ − ξ −1 + 0.10kx3 − 0.10kx1 − 0.4Ik sin(ω y ) Solving for ∣ξ ∣ ≤ 1, we obtain


− 0.20Ik sin(ωx )y2 + 0.20Ik sin(ωx )x2 + 0.10ky3 k ∈ [0, ∞) .
− 0.10ky1 + 0.4Ik sin(ωx ) + 0.20Ik sin(ω y )y2
Case 2:
− 0.20Ik sin(ω y )x2 − 0.64k cos(ωx )
We consider the case ωx → 0 and ω y → 0, and Eq. (25)
+ 0.64kξ + 0.64kξ −1 − 0.64k cos(ω y ) = 0. gives
(1 + 0.64k )ξ 2 − 1 + 0.10kξ (x3 − x1) − 0.4Ikω yξ
Case 1:
+ 0.20Ikω yy2 ξ + 0.20Ikωx x2 + 0.10kξ ( y3 − y1 )ξ
We fix ωx = π and ω y = π .
The amplification factor satisfies the following equation: + 0.4Ikωx ξ − 0.20Ikωx y2 ξ − 0.20Ikω yx2ξ
− 1.28kξ + 0.32kωx2ξ + 0.64k + 0.32kωy2ξ = 0.
(1 + 0.64k )ξ 2 − 1 + 0.10kξ (x3 − x1) + 0.10kξ ( y3 − y1 )
As ωx , ω y ≃ 0, we therefore obtain
+ 1.28kξ + 0.64k = 0.
For suitable values of x1, y1 chosen, the difference x3 − x1 (1 + 0.64k )ξ 2 − 1 + 0.10kξ (0.1) + 0.10kξ (0.1) − 1.28kξ
and y3 − y1 will be constant. We have x3 − x1 = 2Δx = 0.1 + 0.64k = 0.
and y3 − y1 = 2Δy = 0.1 . We thus have Solving ∣ξ ∣ ≤ 1 , we obtain k ∈ [0, 8.873565].
(1 + 0.64k )ξ 2 − 1 + 1.3kξ + 0.64k = 0. Hence, the range of values of k for stability is 0 ≤ k ≤
8.873565, when Δx = Δy = 0.05.

Figure 15: Absolute errors vs x vs y , using Du-Fort–Frankel at times T = 1


Figure 14: Absolute errors vs x vs y , using the LW at times T = 1 and and T = 5 using Δx = Δy = 0.05 and k = 0.01 : (a) T = 1 with k = 0.01 and
T = 5 using Δx = Δy = 0.05 and k = 0.01 : (a) T = 1 and (b) T = 5 . (b) T = 5 with k = 0.01 .
14  Appanah Rao Appadu and Hagos Hailu Gidey

4.3 NSFD where ϕ(k ) = e k − 1 , ψ(Δx ) = e Δx − 1 , and ψ(Δy ) = e Δy − 1 .


A single expression for the scheme is
When NSFD is used to solve Problem 2, we obtain the
⎛ ϕ (k ) ϕ (k )
following scheme: Cin, j+ 1 = 1 − 0.01ϕ(k ) − ui , j
⎜ − vi , j
⎝ ψ(Δx ) ψ(Δy )
Cin, j+ 1 − Cin, j Cin, j − Cin− 1, j
+ 0.005Cin, j + ui , j 2D 1ϕ(k ) 2D 2ϕ(k ) ⎞ n D 1 ϕ (k ) n
ϕ (k ) ψ(Δx ) − − C + ⎟ C
[ψ(Δx )]2 [ψ(Δy )]2 ⎠ i , j [ψ(Δx )]2 i + 1, j
Cin, j − Cin, j − 1 (26)
+ 0.005Cin, j + vi , j D 2 ϕ (k ) n ⎛ ϕ (k ) D 1 ϕ (k ) ⎞ n
ψ(Δy ) + C + ui +⎜ C ⎟

[ψ(Δy )]2 i , j + 1 ⎝ ψ(Δx ) [ψ(Δx )]2 ⎠ i − 1, j


Cin+ 1, j − 2Cin, j + Cin− 1, j
= D1 ⎛ ϕ (k ) D 2 ϕ (k ) ⎞ n
[ψ(Δx )]2 + vj ⎜ + Ci , j − 1. ⎟

⎝ ψ(Δy ) [ψ(Δy )]2 ⎠


Cin, j + 1 − 2Cin, j + Cin, j − 1
+ D2 , ϕ(k ) ϕ(k ) 1
[ψ(Δy )]2 We choose [ψ(Δx )]2
= [ψ(Δy )]2
= 4 . Eq. (26) reduces to

Figure 16: Absolute errors vs x vs y , using NSFD at times T = 1 and T = 5


using Δx = Δy = 0.05 and k = 1.249 × 10‒3 : (a) T = 1 and (b) T = 5 . Figure 17: Relative errors vs x vs y , using LW at times T = 1 and T = 5
using Δx = Δy = 0.05 and k = 0.01 : (a) T = 1 and (b) T = 5 .
Nonconstant coefficient advection–diffusion equations  15

⎛ ϕ (k ) ϕ (k ) D1 D2 ⎞ n positive. This confirms that the scheme replicates the posi-


Cin, j+ 1 = ⎜1 − 0.01ϕ(k ) − ui , j − vi , j − − ⎟C

⎝ ψ(Δx ) ψ(Δy ) 2 2 ⎠ i,j tivity of the continuous model when


ϕ(k ) ϕ(k ) 1
D1 n D2 n ⎛ ϕ (k ) D1 ⎞ n [ψ(Δx )]2
= [ψ(Δy )]2
= 4.
+ C + C + ui , j
⎜ + C⎟

4 i + 1, j 4 i , j + 1 ⎝ ψ(Δx ) 4 ⎠ i − 1, j
⎛ ϕ (k ) D2 ⎞ n 5 Numerical results for Problem 1
+ ⎜vi , j + ⎟C ,
⎝ ψ(Δy ) 4 ⎠ i,j− 1

where D 1 = D 2 = 0.0004 . We fix Δx = Δy = 0.05, and this We choose to display results at times, say T = 1 and T = 5.
We fix Δx = Δy = 0.05 and run experiment with k = 0.01
gives k = ln(1 + 0.25 × 0.052) ≃ 6.25 × 10−4 .
and k = 0.001 for both LW and Du-Fort–Frankel methods,
Using these values, the coefficient of Cin, j is 0.9992, coef-
whereas the time step for the NSFD is fixed at k =
ficient of Cin− 1, j is
ln(1 + 0.5(0.052)) ≃ 1.249 × 10−3 . We obtain reasonable
3.2190 × 10−4 + 6.0951 × 10−5xi − 6.0951 × 10−5yj , results as shown in Figures 9–19. From those results
and the coefficient of Cin, j − 1 is 7.8099 × 10−5 − 6.0951 × obtained, it is observed that the LW method gives best
10−5xi + 6.0951 × 10−5yj . We obtain the plots of coefficients approximation followed by NSFD and Du-Fort–Frankel,
of Cin− 1, j and Cin, j − 1 versus x ∈ [0, 1] versus y ∈ [0, 1] in respectively.
Figure 8, and we observe that these coefficients are all Plots of numerical profiles vs x ∈ [0, 1] vs y ∈ [0, 1] at
T = 1 and T = 5 are displayed in Figures 9–13. Plots of

Figure 18: Relative errors vs x vs y , using Du-Fort–Frankel at times T = 1


and T = 5 using Δx = Δy = 0.05 and k = 0.01 : (a) T = 1 and (b) T = 5 . Figure 19: Relative errors vs x vs y , using NSFD at times T = 1 and T = 5
using Δx = Δy = 0.05 with k = 1.249 × 10 3 : (a) T = 1 and (b) T = 5 .
16  Appanah Rao Appadu and Hagos Hailu Gidey

Figure 20: Plots of exact and numerical solutions vs x vs y using LW


scheme with k = 0.15625, Δx = Δy = 0.05 at time T = 40: (a) Exact solu-
tion and (b) numerical solution.

Table 2: Rate of convergence in space when the three methods are used
to solve Problem 1 at time 0.1

Schemes h l2 error Rate (l2 ) CPU


time

LW 0.0500 5.1747 × 10‒6 — 0.053


0.0250 1.3084 × 10‒6 1.9837 0.071
0.0125 3.2793 × 10‒7 1.9963 0.175
0.00625 8.2028 × 10‒8 1.9992 1.534
Du-Fort–Frankel 0.0500 2.3526 × 10‒3 — 0.073
0.0250 1.4019 × 10‒3 0.7468 0.076
0.0125 5.3364 × 10‒4 1.3934 0.086
0.00625 1.5811 × 10‒4 1.7549 0.122
NSFD 0.0500 4.0131 × 10‒4 — 0.070
0.0250 2.0688 × 10‒4 0.9559 0.368 Figure 21: Surface plots of numerical solution using LW vs x vs y using
0.0125 0.9827 12.371 Δx = Δy = 0.05 and some values of k at time T = 1 : (a) initial, (b) LW
1.0469 × 10‒4
using k = 0.01 , and (c) LW using k = 0.1 .
Nonconstant coefficient advection–diffusion equations  17

1 10

0.9
9

0.8
8
0.7
7
0.6

0.5 6
y

0.4
5

0.3
4
0.2
3
0.1

0 2
0 0.2 0.4 0.6 0.8 1
(a) x

1 5.5

0.9 5

0.8
4.5

0.7
4
0.6
3.5
0.5
y

3
0.4
2.5
0.3
2
0.2

0.1 1.5

0 1
0 0.2 0.4 0.6 0.8 1
(b) x

1 5.5

0.9 5

0.8
4.5

0.7
4
0.6
3.5
0.5
y

3
0.4
2.5
0.3
2
0.2

0.1 1.5

0 1
0 0.2 0.4 0.6 0.8 1
(c) x

Figure 22: Contour plots of numerical solution using LW vs x vs y using Figure 23: Surface plots of numerical solution using LW vs x vs y using
Δx = Δy = 0.05 and some values of k at time T = 1 : (a) initial, (b) LW Δx = Δy = 0.05 and some values of k at time T = 5 : (a) LW using k = 0.01 ,
using k = 0.01 , and (c) LW using k = 0.1 . (b) LW using k = 0.1 , and (c) LW using k = 1 .
18  Appanah Rao Appadu and Hagos Hailu Gidey

1 1.8

0.9
1.7

0.8
1.6
0.7
1.5
0.6

0.5 1.4
y

0.4
1.3

0.3
1.2
0.2
1.1
0.1

0 1
0 0.2 0.4 0.6 0.8 1
(a) x

1 1.8

0.9
1.7

0.8
1.6
0.7
1.5
0.6

0.5 1.4
y

0.4
1.3

0.3
1.2
0.2
1.1
0.1

0 1
0 0.2 0.4 0.6 0.8 1
(b) x

1 1.7

0.9
1.6
0.8

0.7 1.5

0.6
1.4

0.5
y

1.3
0.4

0.3 1.2

0.2
1.1
0.1

0 1
0 0.2 0.4 0.6 0.8 1
(c) x

Figure 24: Contour plots of numerical solution using LW vs x vs y using


Δx = Δy = 0.05 and some values of k at time T = 5 : (a) LW using k = 0.01 , Figure 25: Surface plots of numerical solution using Du-Fort–Frankel vs x
(b) LW using k = 0.1 , and (c) LW using k = 1 . vs y using Δx = Δy = 0.05 and some values of k at time T = 1 : (a) initial,
(b) k = 0.01 , and (c) k = 0.1 .
Nonconstant coefficient advection–diffusion equations  19

1 10

0.9
9

0.8
8
0.7
7
0.6

0.5 6
y

0.4
5

0.3
4
0.2
3
0.1

0 2
0 0.2 0.4 0.6 0.8 1
(a) x

1 5.5

0.9 5

0.8
4.5

0.7
4
0.6
3.5
0.5
y

3
0.4
2.5
0.3
2
0.2

0.1 1.5

0 1
0 0.2 0.4 0.6 0.8 1
(b) x

1 5.5

0.9 5

0.8
4.5

0.7
4
0.6
3.5
0.5
y

3
0.4
2.5
0.3
2
0.2

0.1 1.5

0 1
0 0.2 0.4 0.6 0.8 1
(c) x
Figure 27: Surface plots of numerical solution using Du-Fort–Frankel vs x
Figure 26: Surface and contour plots of numerical solution using Du- vs y using Δx = Δy = 0.05 and some values of k at time T = 5 : (a)
Fort–Frankel vs x vs y using Δx = Δy = 0.05 and some values of k at time k = 0.01 , (b) k = 0.1 , and (c) k = 1 .
T = 1 : (a) initial, (b) k = 0.01 , and (c) k = 0.1 .
20  Appanah Rao Appadu and Hagos Hailu Gidey

1 1.9

0.9 1.8

0.8
1.7

0.7
1.6
0.6
1.5
0.5
y

1.4
0.4
1.3
0.3
1.2
0.2

0.1 1.1

0 1
0 0.2 0.4 0.6 0.8 1
(a) x

1 1.9

0.9 1.8

0.8
1.7

0.7
1.6
0.6
1.5
0.5
y

1.4
0.4
1.3
0.3
1.2
0.2

0.1 1.1

0 1
0 0.2 0.4 0.6 0.8 1
(b) x

1 1.9

0.9 1.8

0.8
1.7

0.7
1.6
0.6
1.5
0.5
y

1.4
0.4
1.3
0.3
1.2
0.2

0.1 1.1

0 1
0 0.2 0.4 0.6 0.8 1
(c) x

Figure 28: Contour plots of numerical solution using Du-Fort–Frankel vs


Figure 29: Surface plots of numerical solution using NSFD vs x vs y using
x vs y using Δx = Δy = 0.05 and some values of k at time T = 5 : (a)
Δx = Δy = 0.05 and k ≃ 1.249 × 10‒3 at time T = 1 and T = 5 : (a) initial,
k = 0.01 , (b) k = 0.1 , and (c) k = 1 .
(b) NSFD at T = 1 , and (c) NSFD at T = 5 .
Nonconstant coefficient advection–diffusion equations  21

1 10

0.9
9

0.8
8
0.7
7
0.6

0.5 6
y

0.4
5

0.3
4
0.2
3
0.1

0 2
0 0.2 0.4 0.6 0.8 1
(a) x

1 5.5

0.9 5

0.8
4.5

0.7
4
0.6
3.5
0.5
y

3
0.4
2.5
0.3
2
0.2

0.1 1.5

0 1
0 0.2 0.4 0.6 0.8 1
(b) x

1 1.8

0.9 1.7

0.8 1.6

0.7 1.5

0.6 1.4

0.5 1.3
y

0.4 1.2

0.3 1.1

0.2 1

0.1 0.9

0 0.8
0 0.2 0.4 0.6 0.8 1
(c) x

Figure 30: Contour plots of numerical solution using NSFD vs x vs y Figure 31: Plots of numerical results vs x ∈ [0, 1] vs y ∈ [0, 1] using LW
using Δx = Δy = 0.05 and k ≃ 1.249 × 10‒3 at time T = 1 and T = 5 : (a) when Δx = Δy = 0.05 at time T = 10: (a) LW when k = 0.5 , (b) LW when
initial, (b) NSFD at T = 1 , and (c) NSFD at T = 5 . k = 1 , and (c) LW when k = 2 .
22  Appanah Rao Appadu and Hagos Hailu Gidey

absolute errors and relative errors vs x vs y are depicted in 1D advection–diffusion equation is not straightforward and
Figures 14 and 19. We also show numerically based on here, complication arises as we are considering 2D noncon-
Figure 20 that LW is unstable at T = 40 when k = 0.15625, stant coefficient advection–diffusion equation. However, we
and Δx = Δy = 0.05, and this provides some validation to the have managed to obtain the range of values of k for stability
stability region obtained on page 5, subsection 3.1 (k ≤ 0.14 ). of LW and Du-Fort–Frankel schemes using von Neumann
Information about the relative errors is obtained from stability analysis coupled with other techniques. Third, in
Figures 17–19. At T = 1 , all the three schemes are efficient. the case of NSFD, since we are dealing with non-negative
Maximum relative errors using LW, NSFD, and Du-Fort–Frankel variables, we obtain the condition for which the scheme repli-
are 0.025, 0.3, and 2.5%, respectively. At T = 5, only LW and cates positivity of the solution of the continuous model and
NSFD have maximum relative error less than 5%. Maximum this is not too time-consuming to achieve. Fourth, the numer-
relative errors using LW, NSFD and Du-Fort–Frankel are ical rate of convergence of the three methods is obtained. We
0.008, 1.5, and 10, respectively, at T = 5. compare the CPU times of the three algorithms when used to
To compute numerically the rate of convergence, solve Problem 1. Moreover, we display the results of Problem
we choose time T = 0.1. For the LW scheme, we chose to 2 using the three methods and observe that some dispersive
k oscillations are present in the solutions from the Du-
work with h2
as constant. Thus, starting with k = 0.05 and
Fort–Frankel scheme.
Δx = Δy = 0.05, k is divided by 22 whenever the spatial step
Future work will involve the use of LW and NSFD
size is divided by 2. From Table 2, we deduce that the numer-
schemes to solve some real-life problems dealing with irre-
ical rate of convergence in space for the LW and Du-For-
gular grids and other coefficients of dissipation.
t–Frankel methods is two, while that for NSFD is one.

Acknowledgments: A.R. Appadu is grateful to Nelson


Mandela University to be able to carry out this work during
6 Numerical results for Problem 2 his sabbatical leave from January 2023 to June 2023. The
authors are grateful to the three anonymous reviewers for
We present results of Problem 2 at times T = 1 and T = 5 in the feedback, which enabled them to significantly improve
Figures 21–31. this article in terms of both content and presentation.
We display results at time T = 1 using the three methods
in Figures 21–30 The range of the initial concentration is 1–10. Funding information: AR Appadu is grateful to NMU for
At T = 1 , the range of concentration is 1–5.5 from all the three allowing him to use his publication funds to pay for open
schemes used based on Figures 21, 25, and 29. Some dispersive access fees.
oscillations are seen when Du-Fort–Frankel is used.
Results at time T = 5 are displayed in Figures 23–30. Author contributions: All authors have accepted responsi-
The range of concentration using LW and NSFD is 1 to 1.8, bility for the entire content of this manuscript and
while the range using Du-Fort–Frankel is 1 to 1.9. We approved its submission.
observe some unbounded values in the numerical solution
of LW depicted by Figure 31(c). This validates the result Conflict of interest: The authors state no conflict of interest.
from stability analysis where we deduced that range of k
when Δx = Δy = 0.05 for LW is 0 < k ≤ 1.16. Data availability statement: All data generated or analysed
during this study are included in this published article.

7 Conclusion
References
In this article, three finite difference schemes, LW, Du-
Fort–Frankel, and NSFD, were constructed and used to [1] Parlange JY. Water transport in soils. Annual Rev Fluid Mechanics.
solve a 2D advection–diffusion equation with nonconstant 1980;12(1):77–102.
coefficients. Two problems were considered whereby one [2] Tian ZF and Yu P. A high-order exponential scheme for solving 1D
has an exact solution. First, for the problem with exact unsteady convection-diffusion equations. J Comput Appl Math.
2011;235(8):2477–91.
solution, we deduce that the LW is the most efficient
[3] Kumar RK, Price JE, Sargent NS, and Tarin D. Binding of 125I-
scheme followed by NSFD and least performing scheme labelled concanavalin A by cells from spontaneously arising murine
is Du-Fort–Frankel. Secondly, it is known that the stability mammary carcinomas and experimentally induced metastases.
analysis of standard finite difference schemes discretising Anticancer Res. 1983;3(5):343–6.
Nonconstant coefficient advection–diffusion equations  23

[4] Szymkiewicz R. Numerical modeling in open channel hydraulics. [18] Appadu AR. Numerical solution of the 1D advection-diffusion
Vol. 83. Dordrecht: Springer Science & Business Media, 2010. equation using standard and nonstandard finite difference
[5] Sommeijer BP and Kok J. Implementation and performance of the schemes. J Appl Math. 2013;2013:734374.
time integration of a 3D transport model. Int J Numer Meth Fluids. [19] Appadu AR. Optimized composite finite difference schemes for
1995;20(3):213–31. atmospheric flow modeling. Numer Meth Partial Differ Equ.
[6] Dehghan M. Numerical solution of the three-dimensional advec- 2019;35(6):2171–92.
tion-diffusion equation. Appl Math Comput. 2004;150(1):5–19. [20] Hutomo GD, Kusuma J, Ribal A., Mahie AG, Aris N. Numerical solution
[7] Thongmoon M, McKibbin R. A comparison of some numerical of 2D advection-diffusion equation with variable coefficient using Du-
methods for the advection-diffusion equation. Res Lett Inf Math Fort–Frankel method. in: Journal of Physics : Conference Series. Vol.
Sci. 2006;10:49–62. 1180. Bristol, United Kingdom: IOP Publishing; 2019. p. 012009.
[8] Appadu AR, Djoko JK, Gidey HH. A computational study of three [21] Fromm J. The time dependent flow of an incompressible viscous
numerical methods for some advection-diffusion problems. Appl fluid. Methods Comput Phys. 1964;3:346–82.
Math Comput. 2016;272:629–47. [22] Siemieniuch J, Gladwell I. Analysis of explicit difference methods for
[9] Appadu AR, Djoko JK, Gidey HH. Performance of some finite dif- a diffusion-convection equation. Int J Numer Meth Eng.
ference methods for a 3D advection-diffusion equation. Revista de 1978;12(6):899–916.
la Real Academia de Ciencias Exactas, Físicas y Naturales. Serie A. [23] Rigal A. Stability analysis of explicit finite difference schemes for the
Matemáticas. 2018;112(4):1179–210. Navier-Stokes equations. Int J Numer Meth Eng. 1979;14(4):617–20.
[10] Takacs LL. A two-step scheme for the advection equation with [24] Clancy RM. A note on finite differencing of the advection-diffusion
minimized dissipation and dispersion errors. Monthly Weather Rev. equation. Monthly Weather Review. 1981;109(8):1807–9.
1985;113(6):1050–65. [25] Hindmarsh AC, Gresho PM, Griffiths DF. The stability of explicit
[11] Courant R, Friedrichs K, Lewy H. Über die partiellen euler time-integration for certain finite difference approximations
Differenzengleichungen der mathematischen Physik. Math of the multi-dimensional advection-diffusion equation. Int J Numer
Annalen. 1928;100(1):32–74. Meth Fluids. 1984;4(9):853–97.
[12] Von Neumann J, Richtmyer RD. A method for the numerical cal- [26] Lax PD. Difference schemes with high-order of accuracy for solving
culation of hydrodynamic shocks. J Appl Phys. 1950;21(3):232–7. hyperbolic equations. Commun Pure Appl Math. 1964;17:381.
[13] Kreiss H-O. Stability theory for difference approximations of mixed [27] Smith R, Tang Y. Optimal and near-optimal advection-diffusion
initial boundary value problems. I. Math Comput. finite-difference schemes. V. Error propagation. Proc R Soc London
1968;22(104):703–14. Ser A Math Phys Eng Sci. 2001;457(2008):803–16.
[14] Winnicki I, Jasinski J, Pietrek S. New approach to the Lax–Wendroff [28] Du Fort EC, Frankel SP. Stability conditions in the numerical treat-
modified differential equation for linear and nonlinear advection. ment of parabolic differential equations. Math. Comp.
Numer Meth Partial Differ Equ. 2019;35(6):2275–304. 1953;17:35–152. doi: 10.1090/S0025-5718-1953-0059077-7
[15] Hirt CW. Heuristic stability theory for finite-difference equations. [29] Kojouharov HV, Cheni BM. Nonstandard methods for advection-
J Comput Phys. 1968;2(4):339–55. diffusion-reaction. Applications of Nonstandard Finite Difference
[16] Ru-xun L, Zhao-hui Z. The remainder-effect analysis of finite dif- Schemes. Singapore: World Scientific; 2000. p. 55.
ference schemes and the applications. Appl Math Mechanics. [30] Mickens RE, Washington TM. A note on a positivity preserving
1995;16:87–96. nonstandard finite difference scheme for a modified parabolic
[17] Morton KW, Mayers DF. Numerical solution of partial differential reaction-advection-diffusion PDE. J Differ Equ Appl.
equations. Cambridge: Cambridge University Press; 1994. 2020;26(11–12):1423–7.

You might also like