1. Introduction
We are going to study the following diffusion-reaction equation:
where
u is the unknown concentration, while the known parameters are the diffusion coefficient
α, the coefficient of the linear reaction term
K, and the source of particles
q in case of particle diffusion [
1]. It is well known that this equation can describe heat transfer as well. In this case, the physical meaning of
u is the temperature and α is the thermal diffusivity. If one uses Newton’s law of cooling, then heat transfer by convection can be expressed [
2] (Equation (3)) by a term proportional to
, where
is the ambient temperature which can be considered as constant. It means that
can represent conductive heat transfer. Moreover, heat generation by chemical reactions, radioactive decay, etc. can also be incorporated into
q. According to the Stefan–Boltzmann law [
3] (Chapter 8), the heat transfer due to radiation can be taken into account by a term proportional to
, where the proportionality constant includes the surface area and the Stefan–Boltzmann constant, all of which are nonnegative quantities. The
term can obviously be included into the heat source term
q. Therefore, in this paper, we will use the phrase
radiation term when we talk about the fourth order term
.
At the end of the paper, we will also examine the linear advection–diffusion-reaction equation in its most standard form:
If the medium is not homogeneous, more general forms of the above equations must be used. For example, Equation (1) can be generalized as
where, in case of conductive heat transfer,
and
are the heat conductivity, specific heat and mass density, respectively. The
relation holds between these quantities. Besides,
and
are also known functions of the space and time coordinates.
There are plenty of numerical methods to solve these equations, such as several versions of the finite difference methods (FDM) [
4,
5], finite element methods (FEM) [
6] or a combination of these [
7]. However, these require the full spatial discretization of the system, thus they can be computationally demanding. Scientists and engineers must also deal with systems where the physical properties such as the heat conductivity can be highly different [
8] (p. 15), even in regions of the system which are in the vicinity of each other. This implies that the coefficients such as
or
k, and hence the eigenvalues of the problem may have a range of several orders of magnitude, which means that the problem can be rather stiff.
We explained in our previous papers [
9,
10,
11], and also will demonstrate in this paper that the widely used conventional solvers, either the explicit or the implicit ones, have serious difficulties when they are used for these problems. The explicit methods are usually only conditionally stable, so very small time step sizes have to be used [
12], especially if the stiffness of the problem is high. This is the main reason that these equations are typically solved by implicit methods, as it has been conducted by Zhang and Zhao [
13], Aamoah-Mensah et al. [
14], Nana and Munyakazi [
15], Aminikhah and Alavi [
16], Ali et al. [
17] and Singh et al. [
18]. The authors of [
14] claim that the larger computational cost of implicit methods is compensated by their unrestricted stability. We think that this is perfectly true when the number of cells is small, such as in their study, but when this number is very large, which is almost always the case in two and especially in three space-dimensions, the implicit solvers become extremely slow with huge memory usage.
Nevertheless, the search for and the application of alternative methods are continuous. The most important example are the nonstandard finite difference schemes (NSFD) introduced by Mickens [
19], which have been applied by others to different equations containing the diffusion term [
20,
21,
22]. Since the formerly fast increase of the CPU clock frequencies halted more than a decade and a half ago, and the trend towards increasing parallelism in high performance computing is reinforced [
23,
24], we believe that the easily parallelizable explicit and unconditionally stable methods for numerically solving these equations will have an increasing role in the future. Albeit these methods are less known, some scholars work with them. For example, Karahan used explicit Sauljev-type alternating direction explicit (ADE) method for the advection–diffusion equation [
25]. Sanjaya and Mungkasi examined the performance of the same method and found that it is indeed accurate [
26]. Pourghanbar et al. used ADE/Sauljev to solve a fully nonlinear PDE [
27]. Harley applied the odd-even hopscotch method to the Frank-Kamenetskii reaction-diffusion equation [
28]. Then Al-Bayati et al. compared the ADE, the alternating direction implicit (ADI) and the Hopscotch method in the case of the Gray–Scott reaction-diffusion equation [
29]. These methods perform quite well in an equidistant and regular mesh, but they heavily rely on these beneficial properties of the mesh.
One of the very few alternatives which can be applied for a general mesh is the unconditionally positive finite difference (UPFD) scheme of Chen-Carpentier and Kojouharov [
30]. It is reported that this method is indeed completely stable even for stiff systems [
31], but its accuracy is far from being optimal [
32], even compared to other first order methods, such as the standard explicit (Euler) FDM method [
32,
33] or our recently invented constant-neighbor method [
31]. In this paper, we construct and test a similar method than the UPFD, but it consists of two stages, and therefore it is significantly more accurate. Our current work was inspired by the so-called theta formulas, where the user can adjust the extent of implicitness by the parameter
.
The paper is structured as follows. In
Section 2, we first introduce the new algorithm for the simplest, one dimensional, equidistant mesh. Then, in
Section 2.2, the analytical investigation of the convergence and stability properties of this method is explained. After this, we present the generalization of the algorithm for arbitrary meshes. In
Section 3, we begin with the verification of the new method by comparing it to an analytical solution and the heat conduction equation with the radiation term. Then, in
Section 3.2 and
Section 3.3, two numerical experiments are presented for two space dimensional stiff systems consisting of 12,000 cells without and with the nonlinear radiation term, respectively. In
Section 3.4 we make attempts to apply the new method to the advection–diffusion-reaction equation. In
Section 4, we summarize the conclusions and sketch our future research plans.
2. The New Method
2.1. Construction of the New Method
In one space dimension, we take
, which is a common space discretization. Let us fix the time discretization to
. We introduce the mesh-parameter
and
. The original UPFD method applies the most common [
34] (p. 112) spatial discretization of the diffusion term based on the central difference formula, while it applies the backward difference formula for the advection term. However, the time levels are treated in a tricky way [
32], such that the neighbors are taken into account fully at the old time level, where their values are known, and only the actual cell is treated implicitly. It means that for example
is used instead of
, with which they obtained:
This can be arranged to a fully explicit form to obtain the following Algorithm 1:
Algorithm 1: The original UPFD |
|
Now we adapt this method to Equation (1) where
but
. In principle the nonlinear term can be incorporated into this scheme in many different ways. We choose the following treatment: We insert the radiation term at the level of Equation (4) as
, which again can be expressed in an explicit form, and with this we obtain the following adaptation of the original UPFD algorithm to Equation (3) (Algorithm 2):
Algorithm 2: UPDF for the diffusion-reaction-radiation Equation (3) |
|
If and have arbitrary nonnegative values and the values of u at the beginning of the time stapes are nonnegative, then both the numerator and the denominator is nonnegative in this formula. It means that this formula preserves positivity similarly to the original UPFD formula for the strongly nonlinear case as well. As we will see later, its accuracy is not very good, thus we proceed to construct a two-stage method as well.
We are going to combine the UPFD idea with the so called
-method, which can be applied for the diffusion term in the following way:
where
. If
, this scheme is the forward-time central-space (FTCS) scheme, which is basically the explicit Euler time integration. For smaller values of
, this formula is implicit, and for
one has the implicit (Euler) and the Crank–Nicolson method, respectively [
35]. Using the trick above and incorporating the reaction and the source terms we can write:
If one takes
, the original UPFD treatment is obtained back. The point is that this more general formula can also be easily rearranged to obtain an explicit formula, according to which the new value of the
u variable has the following form in the 1D equidistant case (Algorithm 3):
Algorithm 3: Theta-generalization of Algorithm 2 |
|
Since we formally started from an implicit Formula (6) but made it fully explicit, we started to call these methods
pseudo-implicit. The main novelty of this paper is that we organize Formula (8) into a two-stage method as follows inspired by the well-known predictor-corrector methods [
35,
36,
37]. The calculation starts with taking a fractional-sized time step using the already known
values, and then a full time step is made Algorithm 4.
Algorithm 4: 2-stage pseudo-implicit method for the diffusion-reaction-radiation Equation (1) |
Stage 1 using Formula (8) with parameter θ1:
|
|
Stage 2. We redefine by calculating the linear combination with : |
|
Take a full time step with the (8) formula with parameter
θ2:
where
are real numbers which are considered as free parameters. We must mention that the mathematically correct form of (9) would be
, but we immediately put down it in the form which is to be used in a computer code to spare memory. We also note that with this treatment of the nonlinear term we obtain a second-order method with very good stability properties, as we will see later.
2.2. Analytical Investigations
We perform the calculations of Algorithm 4 for the linear
case. First, we express the new values
by the old values
. For this we calculate the linear combination (9) with the Mathematica software. If we use notations
and
, then we have
which yields
After spatial discretization as discussed above, Equation (1) for
can be written into a brief matrix-form:
The system matrix
M is tridiagonal (in the one-dimensional case) and it is the sum of two terms related to the diffusion and the linear reaction terms, respectively:
In the equidistant case, these matrices have the following elements:
Let us start with the analysis of the convergence properties of the methods in the one-dimensional case for constant values of the mesh ratio r, in other words, when the equidistant spatial discretization is fixed.
Theorem 1. For , the order of convergence of the Algorithm 4 is two for the system (6) of linear ODEs:where M is defined in (11)–(13), if and only if the conditionshold, where M is introduced in (11)–(13), whileandare arbitrary vectors. Proof. We will show that the local error of the numerical solution (10) compared to the analytical solution
of the ODE system (14) is less than second order in the time step size
h. Let us introduce the notation
and express the exact solution in series up to second order in
h:
If we do the same with the numerical solution (10), we obtain:
It can be immediately seen that the two expressions coincide up to first order, but some conditions must be fulfilled for second order equality. From the equality requirement of the coefficients of
, we have
, thus (15) must hold. The same requirement for
gives
which yields (16) and (17) if one uses condition (15). Now we substitute back the conditions obtained until now to the coefficients of
, and obtain
which yields (18), and the proof is now complete. □
We note that our original idea was to organize the original UPFD formula into a two-stage method, which means . With that idea we obtained a new unconditionally positive method, but it was only first and not second order. After Theorem 1 and its proof one can understand the reason of this failure.
Before starting to analyze the stability of the methods, we also note that in the case of the original UPFD Algorithm 1 for , the new values are the convex combinations of the old values which immediately implies not only unconditional stability, but the positivity preserving property, too. If K is increased to any positive number, this latter property still holds since K is in the denominator with a positive sign. However, the new Algorithms 3 and 4 contain the theta-formula for , thus they cannot be not positivity-preserving. This is the price we have to pay for second order accuracy.
We are going to use the most standard von Neumann stability analysis (see [
38], Chapter 8, as well as [
39]) to prove the unconditional stability of the method in the linear case. For this, the
values in the expression of
must be replaced by the errors
and the error-function is decomposed into a Fourier series as follows:
where
is the amplitude of the
m-th term
in the Fourier series of the error and
I is the imaginary unit
. We omit the
m index for the sake of simplicity, and introduce the notation
, with which we obtain the following relations:
Using these expressions and simplifying with one can obtain the amplification factor, which is defined as . If this factor is in the closed interval for arbitrary time step size h, then the errors cannot be amplified regardless of how large h one uses, which means unconditional stability.
Theorem 2. If and , then Algorithm 3 is unconditionally stable for Equation (1) if and only if .
Proof. Performing the substitutions
described above, we obtain the following amplification factor for Algorithm 3:
In the
case,
is obviously between −1 and 1 for any values of
γ and any nonnegative
r, which implies unconditional stability. On the other hand, if
, we have
, which is smaller than −1 for
, and that implies instability for large time step sizes in the
case. □
This statement means that unfortunately we cannot obtain a new unconditionally stable one-stage algorithm with the simple modification of setting the value of to a positive number.
For the investigation of stability of Algorithm 4, we substitute back conditions (15)–(18) into (10) to eliminate the
parameters, set the external source term to zero and the reaction term to the homogeneous
. With notations
and
this we obtain:
Theorem 3. If , , and the conditions (15)–(18) hold, then Algorithm 3 is unconditionally stable for Equation (1).
Proof. We take
K = 0 in the previous expression of
, and introduce the notation
. With this we obtain
This yields the following amplification factor:
Since
, we have
. Now if
, we have
which is guaranteed to be between −1 and 1 if and only if
, i.e.,
. Using this assumption, the
G function will have a simpler form:
which is always in the interval
due to the triangle inequality. □
Remark 1. From Equation (21) one can see that if the holds, the value of does not depend on the parametersand λ. So, for the K = 0 case we will use , which implies that the computer do not need to calculate linear combination (9), and the running times will be slightly shorter.
Now we turn our attention to the case when the linear reaction term is nonzero. We will prove the stability of the method with the following parameters:
which, if substituted to conditions (15)–(18), yields
Theorem 4. If conditions (22) and (23) hold, then Algorithm 3 is unconditionally stable for Equation (1) for arbitrary .
Proof. Applying the assumptions of the theorem to (19) or (20) we obtain
which yields
The
G function is symmetric for
, thus it is enough to examine the
interval. First let us examine the limits of
G. For
we have
which function has a value of unity if
and then it is monotonously decreasing with increasing
towards the limit value −1/2. For
we have
. For
we have
. All of these values are finite and in the interval
.
Since
G is continuous, the limits are finite, the denominator cannot be zero,
G is bounded. Now it is enough to examine the condition
in the extremal values. We start with the variable γ while keeping the other two variables arbitrary.
thus, extremal values can be present in three cases:
In the first case,
which is obviously in the interval
. In the second case,
and it can be checked that the equation
and
have no solution for any positive values of
r and
.
The third case gives an extremal value if
. We obtain the following function:
which can have values only in the interval
again, which completes the proof. □
Remark 2. As the function is obviously continuous in its three variables with no singularities, if there is an extremal value above 1 at a point (K*, g*, r*), then there is a neighborhood of (K*, g*, r*) with values of also above 1. Any sufficiently dense set of points would intersect with this neighborhood. Thus, we independently verify the discussion above by examiningnumerically. We coded three embedded for loops, one to sweep through the values of each of the parameters K, g, and r in the allowed domain as follows During this process the value of has been calculated times while K and r reached values larger than 1083, and it was found that does not exceed unity. Although this numerical procedure cannot be considered as an exact proof, we can conclude again that the algorithm is unconditionally stable if the conditions of Theorem 3 hold.
Remark 3. If we takearbitrary, then we have proved the unconditional stability of Algorithm 3 only for . In fact, it would require enormous energy to thoroughly examine the full multidimensional parameter space. If the assumption does not hold, the amplification factor can take values that are smaller than in many cases. However, it does not mean that violating the assumptions always implies unstable behavior. In fact, according to a large number of numerical experiments, the value of G can be below only if both Kh and r have a rather large value, typically larger than 20, and even in these cases G is still close to, for example , especially ifis not very close to 0. So, Algorithm 4 has very good stability properties in the practically relevant cases for, as we will see in the next section.
Although all the free parameters are fixed due to the analytical considerations, we will still consider
as a free parameter. It means that with conditions (22)–(23) we have Algorithm 5 with only one free parameter:
Algorithm 5: (Algorithm 4) For the diffusion-reaction-radiation Equation (1) |
Stage 1:
|
|
Stage 2. Calculate the linear combination Take a full time step:
|
|
2.3. Generalization for Arbitrary Grids
In the case when one has a general mesh and the material properties are functions of the space variables, the spatially discretized form of Equation (3) can be generalized as follows:
here,
ui refers to the cells of various shapes and properties with heat capacity
Ci., while
is the thermal resistance between cells
i and
j. If we use the notations
for the volume of the cell,
and
for the surface between the cells and for the distance between the cell-centers, then these quantities can be calculated approximately as
respectively. In our previous papers [
9,
11] this generalization procedure (which is based on, e.g., Chapter 5 of the book [
40]) is explained in more details.
Figure 1 can help the reader to visualize these quantities.
In the general case of Equation (3), the nonzero elements of the matrix
introduced in (13) can be given as:
We introduce the following notations
where
is the characteristic time or time constant of cell
i,
is the generalization of
(the usual mesh ratio in the case of the diffusion equation), and
reflects the state of the neighbors of cell
i. Now we can write the modified UPFD and our pseudo-implicit algorithms in the general case as follows (Algorithm 6):
Algorithm 6: (Algorithm 2) UPDF for the diffusion-reaction-radiation equation, general mesh-form |
|
We emphasize that in Algorithm 7,
in both stages. We stress again that Algorithm 4 is proven to be unconditionally stable only for
.
Algorithm 7: (Algorithm 4) 2-stage pseudo-implicit method for the diffusion-reaction Equation (1), general-mesh from |
Stage 1, with the (26) formula:
|
.
|
Stage 2. We redefine by calculating the linear combination
|
|
Take a full time step with the (26) formula:
|
. |
4. Discussion and Summary
In the current paper, we reached our goal to construct a fully explicit and stable numerical algorithm to solve the time-dependent diffusion (or heat) equation with linear and nonlinear reaction terms, where the latter represented heat loss due to radiation. Using the UPFD idea, we organized the theta-formula into a two-stage algorithm, where, in each stage, the latest available u values of the neighbors are used to make the originally implicit theta-formula completely explicit. We analytically proved for the linear case that the obtained method is second order in time step size and unconditionally stable.
For verification, an analytical solution of the nonlinear PDE was used. Then two 2-dimensional stiff systems containing 12,000 cells with discontinuous random parameters and initial conditions were constructed. The performance of the new algorithm as well as several other methods was examined for these systems. According to the numerical results, the new method is quite competitive. It is second order and stable for the nonlinear case as well, and it gives quite accurate results orders of magnitude faster than the professionally optimized MATLAB routines and it is more accurate than all other examined explicit and unconditionally stable methods. Although it is not positivity preserving as the original UPFD algorithm, it is stable for relatively large time step sizes as well, even if the nonlinearity is strong. Moreover, it is easy to implement and can be applied for unstructured grids as well. The conclusion is that this new pseudo-implicit algorithm has the most important advantages of the conventional explicit and the implicit methods at the same time.
In the near future, we are going to search for higher order and thus even more accurate versions of these algorithms and adapt these to nonlinear parabolic equations as well. We also plan to systematically investigate the application of these methods to the advection–diffusion-reaction Equation (2), and, also, to similar nonlinear equations like the Burgers–Fisher and the Burgers–Huxley equations. Moreover, we have started to consider applying these methods to real-life engineering problems, most importantly heat transfer by convection, conduction, and radiation in buildings [
45] and solar panels [
46], to increase energy-efficiency and therefore to contribute to the prevention of the climate-change.