- Research
- Open Access
- Published:
Fourth-order compact finite difference method for solving two-dimensional convection–diffusion equation
Advances in Difference Equations volume 2018, Article number: 234 (2018)
Abstract
A fourth-order compact finite difference scheme of the two-dimensional convection–diffusion equation is proposed to solve groundwater pollution problems. A suitable scheme is constructed to simulate the law of movement of pollutants in the medium, which is spatially fourth-order accurate and temporally second-order accurate. The matrix form and solving methods for the linear system of equations are discussed. The theoretical analysis of unconditionally stable character of the scheme is verified by the Fourier amplification factor method. Numerical experiments are given to demonstrate the efficiency and accuracy of the scheme proposed, and these show excellent agreement with the exact solution.
1 Introduction
In recent years, more and more attention has been paid to the movement of pollutants in groundwater by mathematical modeling [1]. The prediction and evaluation of groundwater dynamic movement and solute transport are important tasks for agricultural pollution and groundwater development [2]. A large number of mathematical models and a variety of effective numerical methods have been widely used to simulate the movement of contaminated groundwater. Convection–diffusion equation is a class of very important equations, it can describe many physical phenomena, such as atmospheric pollutants, distribution and diffusion of the oceans and rivers, heat conduction and so many other physical problems even including bacterial concentration. However, from the existing research results, we could only get the analytical solutions of a few classic models. In the process of dealing with practical problems, for many mathematical models, especially partial differential equations, their analytical solutions are not available in general. Therefore, research for the numerical solutions of partial differential equations is very necessary [3].
During the last three decades, the numerical solution of the convection–diffusion equation has been developed by all kinds of methods, for example, the finite difference method [4], the finite element method [5, 6], the finite volume method [7], the spectral element method [8] and even the Monte Carlo method [9]. But the characteristics of the two-dimensional convection–diffusion equation and the complexity of the mathematical model are a challenge to numerical computation, so constructing the simple and efficient numerical scheme needs to be further studied. A finite difference method is one of the effective and flexible methods to solve the numerical solution of partial differential equations with initial boundary value [10].
For the traditional finite difference methods, a classical spatial discretization, such as the second-order central difference scheme, fails to approach the exact solution of most equations; for obtaining a more accurate numerical solution one needs to add more nodes and use smaller mesh sizes, which would require more storage space and computing time [11]. In order to get more accurate results for constant mesh size, we have to increase the order of accuracy of the numerical approximation, which, in turn, means enlarging the stencil of grid points [12]. However, this results in some problems, for instance, the difficult treatments of the boundary conditions, the approximation of the points next to the boundaries, and the increasing of the bandwidth of the stiffness matrix. For many application problems, it is desirable to use higher-order numerical methods to obtain an accurate solution.
In terms of the above reasons, a compact finite difference scheme is desired to solve lots of differential equations numerically [13–16]. One can compute more accurate solutions using limited grid sizes through developing high-order compact finite difference schemes. Significant work in this field has been done by Turkel and Singer [17] in 1998. In recent years, the high accuracy compact difference method has attracted more and more attention; see [18–22]. Using a Taylor series expansion, Sari et al. [14] developed a tenth-order finite difference scheme, proposed to solve one-dimensional advection–diffusion equation. Gurarslan et al. [16] presented a sixth-order compact difference scheme in space and a fourth-order Runge–Kutta scheme in time to produce numerical solutions of the one-dimensional advection–diffusion equation, it has been seen to be very accurate in solving the contaminant transport equation for \(Pe \leq5\). Based on the Grünwald–Letnikov discretization of the Riemann–Liouville derivative, Cui obtained a fully discrete implicit scheme after approximating the second-order derivative with respect to space by the compact finite difference [19]. Li presented an efficient and stable compact fourth-order method for the phase field crystal equation [21]. Kaysar et al. gave an useful and efficient compact finite difference approximation of a fourth-order scheme for solving linear one-dimensional convection–diffusion equation [22]. All in all, there is a renewed interest in the development and application of compact finite difference methods for the numerical solution of the convection–diffusion equations.
Inspired by the above literature, in this paper, we are interested in the mathematical model of groundwater pollution with seepage only in x direction by integrating the knowledge of fourth-order compact finite difference, which is also unconditional stable. We consider a special class of convection–diffusion equations, which comes from the following practical problem: The leakage of a factory’s sewage pool causes the seepage of sewage, the concentration of pollution substance in the underground water is a function of spatial coordinate and temporal in any point. We take a micro-body in ground water to study, the concentration’s change of which is caused by diffusion (including molecular diffusion and osmotic dispersion), and the mass flux caused by the average liquid motion. We suppose the seepage area to be an infinite plane, assume the groundwater flow belongs to the one-dimensional cases, the diffusion of pollutants is a two-dimensional dispersion in a porous medium. At every stage, contaminant is injected at any region point and at arbitrary time in the river. Applying the mathematical software MATLAB, a numerical simulation is carried out on the problem of water pollution–diffusion to verify the validity and practicability of the model and algorithm. Numerical examples are given to illustrate the accuracy and reliability of the proposed scheme, so as to provide an important basis for water pollution accident disaster emergency disposal and decision-making for environmental protection personnel dealing with a water pollution incident, to be used as a reference.
The paper is organized as follows: in Sect. 2, we present a fourth-order compact difference scheme, in which the Crank–Nicolson scheme is used for temporal discretization and a fourth-order compact finite difference scheme dealing with a one-dimensional convection–diffusion equation is applied to the spatial discretization. In Sect. 3, the matrix form for the difference scheme is given, and the solving methods for the linear system of equations are discussed. In Sect. 4, the theoretical analysis, the Fourier method, namely the amplification factor method (or von Neumann condition) of the proposed scheme is presented. Finally, numerical examples are provided in Sect. 5, the numerical results shown in tables and figures derive the accuracy and prove the convergence order of the scheme, they are in agreement with our theoretical analysis. The paper concludes with a summary in Sect. 6.
2 Fourth-order compact finite difference scheme
In this paper, we consider the following two-dimensional convection–diffusion equation, which is used widely to simulate the motion process of the contaminant in groundwater flow and the water flow with any chemical solute. Here we take the seepage area as an infinite plane, assume the groundwater flow belongs to the one-dimensional cases, the diffusion of pollutants is a two-dimensional dispersion in a porous medium, and the contaminant \(f(x,y,t) \) is injected at any region point \((x, y)\) and at any time t in the river.
Let \(\Omega \subset\mathbf{R}^{2}\) with boundary Γ. We write
where \(\Omega = [0, L_{x}]\times[0, L_{y}]\) is a rectangular domain in \(\mathbf{R}^{2}\), which represents different shapes of the river where the contaminants are located. \(\Gamma = \partial \Omega \) is the boundary of the rectangular domain. The function C stands for the concentration of a solute dependent on time t, here \(C = C(x,y,t)\). x and y are the horizontal coordinates, the unknown \(D_{x}\) and \(D_{y}\) are positive constants representing the longitudinal and transversal dispersion coefficients, respectively, and v is the mean pore velocity. The function \(f(x,y,t) \) is the source term, it refers to all items other than constant items, convection and diffusion items. In the case of pumping and injecting water, \(f = \mathbf{W} / \mathbf {n}\), where W is the amount of contaminant per unit volume of aquifer injected per unit time, it is a function of time and location, and n is the porosity of the porous medium [23]. The term \(g(x,y,t) \) in the right side of the second equation represents a boundary source on Γ, \(C_{0}(x,y)\), \(g(x,y,t)\) and the source term \(f(x,y,t)\) are given as sufficiently smooth functions.
The analytical solution for Eqs. (1) is not available easily, the purpose of this paper is to improve the accuracy in spatial direction, we suggest a fourth-order compact difference scheme. In order to present our scheme, we first introduce some essential notations, which will be used later.
Discretizing the spatial region firstly, let N and M be two positive integers, so that the step sizes are \(h_{x} = \frac{L_{x}}{N}, h_{y} = \frac{L_{y}}{M}\), under this condition, the spatial nodes can be denoted by \((x_{i},y_{j})\), namely, \(x_{i}=ih_{x}, i = 0, 1, \ldots, N-1, N; y_{j}=jh_{y}, j = 0, 1, \ldots, M-1, M\). Let \(\bar{\Omega }_{h}=\{(x_{i},y_{j}) | 0\leq i\leq N, 0\leq j\leq M\}, \Gamma _{h}=\bar{\Omega }_{h}\cap \Gamma , \Omega _{h}=\bar{\Omega }_{h}\cap \Omega \). For simplicity, introduce \(\omega=\{(i,j) | (x_{i},y_{j})\in \Omega _{h}\}, \sigma=\{(i,j) | (x_{i},y_{j})\in \Gamma _{h}\}\), then we have \(\bar{\omega}=\omega\cup\sigma\). Define \(\mathcal{U}_{h}=\{u | u=\{u_{ij} | (i,j)\in\bar{\omega}\}\}\), for any \(u \in\mathcal{U}_{h}\), similar to Ref. [24], introducing the following notations of difference quotients:
Next, for the temporal approximation, take a positive integer K, partition the interval \([0,T]\) into K equal parts of width \(\tau= \frac {T}{K}\); we have the following notations:
where τ is called the temporal step size.
Set \(\mathcal{U}_{\tau}=\{w | w=(w^{0},w^{1},\ldots,w^{K})^{T}\}\), for any \(w\in\mathcal{U}_{\tau}\), introducing some notations as follows:
Define grid functions on \(\bar{\Omega }_{h} \times \Omega _{\tau}\), \(C^{n}_{ij}=C(x_{i},y_{j},t_{n}), (i,j)\in\bar{\omega}, 0\leq n\leq K \). Following Refs. [25, 26], the two-dimensional convection–diffusion equation in Eqs. (1) can be rewritten as the following two equations:
Next, we only need to consider the compact difference scheme with Eq. (2) and Eq. (3), respectively.
For Eq. (2), considering it at the point \((x_{i},y_{j},t_{n+\frac{1}{2}})\), we have
Consider the one-dimensional steady convection–diffusion equation [24]
where α is the constant conductivity, β is a constant representing the convective velocity, f̃ is a sufficiently smooth function of x, and u may represent the concentration of a solute, vorticity, heat, etc.
Its three point fourth-order compact scheme is as follows:
where
and
are the central difference approximations for the first and second derivatives.
We think of the right term
of Eq. (4) as a whole, similar to the right term f̃ of Eq. (5), using the method of Eq. (6), taking the Taylor formula into account [27], applying the Taylor expansion for Eq. (4); it generates
where the truncation error is
Considering Eq. (3) at the point \((x_{i},y_{j},t_{n+\frac{1}{2}})\), we have
For the interior nodes of the spatial of Eq. (3), we use the derivative type fourth-order compact differential formula to deal with the one-dimensional convection–diffusion equation [22].
For convenience, we define a compact difference operator by \(\mathcal {B}\) [12], for any \(u \in\mathcal{U}_{h}\),
By Lemma 1.2(g) [12]: If \(g(x) \in C^{6}[c-h, c+h]\), then we have
where \(\xi_{6} \in(c-h, c+h)\), \(h>0\) and c are two positive constants.
We have
where \(1 \leq i \leq N, 1 \leq j \leq M-1, 1 \leq n \leq K\), and \(\xi _{jk} \in(y_{j-1}, y_{j})\).
Apply compact difference operator \(\mathcal{B}\) to both sides of Eq. (9), combine with Eq. (11); we have
It is easy to observe that Eq. (12) is equal to the following form:
Taking the Taylor formula into account again, applying the Taylor expansion for Eq. (13), we have
where the truncation error is
Adding Eq. (7) to Eq. (14) and using Eq. (1) yield
For the time term of Eq. (16), we make a Crank–Nicolson (C-N) time discretization, noticing the former notations, we can construct
where \(R^{n}_{ij} = \mathcal{O}(\tau^{2} + h_{x}^{4} + h_{y}^{4}) \) is the truncation error.
Taking the initial and boundary conditions of Eq. (1) into account, we have
Ignoring the higher-order terms \(R^{n+\frac{1}{2}}_{ij}\) in (17), and replacing \(C^{n}_{ij}\) with its approximation \(c^{n}_{ij}\), the compact difference scheme of Eq. (1) can be obtained,
The node graph of the scheme (19) is shown in Fig. 1, which is a two layer scheme.
Theorem 2.1
The truncation error of the compact finite difference scheme (19) is
3 Matrix form of the numerical scheme
The numerical scheme of the convection–diffusion equation plays a very important role in computational fluid dynamics to simulate flow problems [20]. Therefore, accurate and stable difference schemes are of vital importance. To achieve the unconditional stability, we resort to the Crank–Nicolson method for a time discretization of Eq. (19). Notice the notations defined in Sect. 2 for the difference scheme (19), which will result in a system of algebraic equations that is sparse; the existence and uniqueness of the solution of the scheme (19) are easily known by the positive definite property. We have
Let
It is obvious that the compact finite difference scheme (21) is a system of linear equations based on the variable \(c^{n}_{ij}, 0\leq i\leq N, 0\leq j\leq M, 0\leq n\leq K\), then Eq. (21) can be written as
where
Let
We can give the matrix form of the scheme by
where
By simply calculating, we can see that the matrix \(\mathbf{P}_{2}\) is the same as the matrix \(\mathbf{P}_{3}\) absolutely. So, we can further write (24) as
The coefficient matrix of the above linear equations is a three diagonal block matrix, and each row has at most nine nonzero elements, therefore we can rewrite the scheme (24) in the following matrix form:
where
Those three matrices are all strictly diagonally dominant tridiagonal matrices, which guarantees the existence and uniqueness of the solution.
4 Stability analysis
For the presentation of the theoretical analysis, we make \(f= 0 \) of the first equation in Eqs. (1) for convenience [1]. Assuming that the boundary conditions are accurate, we apply the Fourier method to the relative difference equation, by calculating the amplification factor to obtain an algebraic criterion for the stability analysis of the scheme (19). Without loss of generality, we choose \(D_{x}\), \(D_{y}\) and v as constants. Following the von Neumann condition [28] for linear stability, we assume that the numerical solution can be expressed in the form of a Fourier series [20].
Let
where \(\eta^{n}\) is the amplitude at time level n, \(\sqrt{-1} \) is called the imaginary unit, \(\xi_{x}\) and \(\xi_{y}\) represent the wave numbers in the x and y directions, respectively, the \(\xi _{x}h_{x}\) and \(\xi_{y}h_{y}\) are named phase angles.
The amplification factor is defined by
Substituting the expression of \(c^{n+1}_{ij}\) and \(c^{n}_{ij}\) into Eq. (25), combining Eq. (26) with Eq. (27), the amplification factor can be written as
where
and
For stability, it has to satisfy the following condition [28]:
Referring to the method of Ref. [29], let
We just need to compare the relationship between p and q. It is sufficient that \(p - q \leq0\), that is to say, then Eq. (30) is proved.
Imposing that condition directly on Eq. (28), it yields
Notice the definitions of \(p_{k}, q_{k}\ (1 \leq k \leq9)\) in (23) and the definitions of \(\gamma_{l}\ (1 \leq l \leq5)\) in (29), with a detailed calculation we obtain, when \(v >0\), \(p - q \leq0\) for any \(h_{x}\), \(h_{y}\) and τ. Besides, we also checked it with MATLAB when \(v >0\) for any \(h_{x}\), \(h_{y}\) and τ. In other words, it shows \(p \leq q \).
As a result, we have
Thus, the following result can be derived:
Hence, we derive the following result.
Theorem 4.1
When \(v >0\), the fourth-order compact finite difference scheme (19) is unconditionally stable.
5 Numerical experiments
In this part, to validate the applicability of the method we provided, two experiments have been considered. To test our fourth-order compact difference scheme (19) according to Sect. 2, those examples with their known exact solutions are chosen in order to show the performance of the high-order compact schemes using computer programs that implement the scheme (19).
There are no differences between square and rectangular domains for the numerical scheme we proposed. In the following numerical experiments, the domain is deliberately set to a square domain for simplicity, all tests are conducted on the domain \(\Omega = [0,1] \times[0,1]\) with a uniform mesh size \(h_{x}\) and \(h_{y}\) in x and y directions, respectively. The computations were performed in a MATLAB environment using version R2014a on a Lenovo notebook computer, and they were executed on Inter(R) Core(TM) i7-6500U CPU @ 2.50 GHz, RAM 8.00 GB (7.44 GB available).
The numerical results will be presented to illustrate the efficiency and accuracy of our method, and the experimental convergence orders are shown in Table 1, Table 3 and Table 5. At the same time, we also compare our results with the results from the previous second-order difference method, as shown in Table 2, Table 4 and Table 6 to illustrate the advance of the scheme (19).
Here the numerical solution and the exact solution are compared with the use of the \(l^{2}\)-norm of the error and the \(l^{\infty}\)-norm of the error. The definitions of these two errors are as follows [30].
The \(l^{2}\)-norm of the error is defined by
The \(l^{\infty}\)-norm of the error is approximated by the formula for the \(l^{2}\)-norm of the error, which is defined by
where N and M are the numbers of sub-intervals, \(U_{ij}\) is the result from the numerical solution, and \(u_{ij}\) is from the analytic solution, K represents the last time level.
In the following tables, we take \(N=M \), the experimental order of convergence Rate is computed by the formula
where \(\mathrm{Error}_{N_{1}} \) and \(\mathrm{Error}_{N_{2}} \) are the \(l^{2}\)-norms of fields with resolutions associated with grid sizes \(N_{1}\) and \(N_{2}\). We have
where \(\mathrm{Error}_{1}\) and \(\mathrm{Error}_{2}\) are computed with mesh size \(h = h_{x} = h_{y}\) with \(\mathrm{Error}_{l^{\infty}}\), accordingly. For example, the orders of convergence are obtained by data from the first line divided by the second line, and the second divided by the third, i.e. we get the results for \(\mathrm{Rate}(h= \frac{1}{4})\) and \(\mathrm{Rate}(h= \frac{1}{8})\), respectively.
Example 1
In this part, we study the following two-dimensional convection–diffusion equation, and give main results for the numerical approximation:
Let the right item
and the exact solution of Eqs. (39),
and we take the temporal range \(t \in[0,T]\), \(D_{x} = D_{y} = v =1 \) in the experiment. Here \(C(x,y,t)= 0\), for all \((x,y)\in \Gamma \), but \(f(x,y,t)\neq0\), for any \((x,y)\in \Gamma \).
The spatial step size chosen in the numerical experiment are different \(h = \frac{1}{4}\), \(h = \frac{1}{8}\), \(h = \frac{1}{16}\), \(h = \frac {1}{32}\), \(h = \frac{1}{64}\), and \(h = \frac{1}{128}\), respectively. Applying the numerical scheme in Sect. 2 to Eqs. (39), the error and convergence order of difference approximation schemes are shown in Table 1 (where \(h= h_{x}=h_{y}\)).
Table 1 demonstrates the \(l^{2}\)-norm and the \(l^{\infty }\)-norm between numerical solution and exact solution in the case of the temporal increment is the same as the spatial increment, i.e. \(\tau^{2} = h \). Besides, we notice that when h is ever more smaller, the accuracy of the scheme (19) grows close to fourth order. Nevertheless, it only reaches two orders with standard difference scheme; see Table 2 (where \(h= h_{x}=h_{y}\)).
From the above two tables, it is obvious that with N increasing, the accuracies of \(l^{2}\)-norm and the \(l^{\infty}\)-norm are decreasing, that is to say, we can adopt a small spatial step size to solve this class of equation if we need the error filled with high accuracy. But for our high accuracy scheme, when \(h = \frac{1}{128}\), the space grid involves \(128 \times128\) points; at the same time, the number of time layers is \(128 \times128\) layers, too. Due to the limitations of computer storage performance, we cannot run the results needed, we have the MATLAB display: Out of memory. For a standard general scheme, when \(h = \frac{1}{128}\), the space grid and time layers are the same, only \(128 \times128\), and it can be computed by a computer.
To further collaborate the applicability of the proposed method, we have clearer pictures of the convergence of the compact difference (19), which are plotted in Fig. 2, the errors in the semi-log scale, which indicates an exponential convergence rate \(\mathcal{O}( \tau^{2} + h^{4}_{x} + h^{4}_{y})\) under the standard of the \(l^{2}\)-norm and the \(l^{\infty}\)-norm, respectively.
\(L^{2}\)-norm errors of the standard difference scheme and the compact difference scheme in Example 1. (a) Approximation order of C in \(L^{2}\)-norm. (b) \(L^{2}\)-norm varying with spatial step
It should be realized that the scheme (19) provides reasonable approximations of the solution in terms of the standard difference scheme. In general, Figs. 2 also show the fact that the present method is computationally stable, effective, simple to use, convergent and giving an accuracy of the solution better than some previously existing methods.
Figures 3, 4 and 5, obtained by MATLAB software, show comparison results and the changes of numerical solution and exact solution with our compact difference scheme (19) under the condition of different step sizes, both spatially and temporally.
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{4}\) and \(\tau= \frac{1}{16}\) in Example 1. (a) \(N=2^{2}\). (b) \(N=2^{2}\)
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{8}\) and \(\tau= \frac{1}{64}\) in Example 1. (a) \(N=2^{4}\). (b) \(N=2^{4}\)
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{32}\) and \(\tau= \frac{1}{1024}\) in Example 1. (a) \(N=2^{5}\). (b) \(N=2^{5}\)
Example 2
The equation with homogeneous Dirichlet boundary condition to be solved is
The exact solution of Eqs. (42) is
We still take the temporal range \(t \in[0,T]\), and we choose the following coefficients of equations \(D_{x} = D_{y} = 1, v = 0.1\) in the numerical experiment.
The spatial step sizes chosen are the same as the former experiment, using the scheme (19) to Eqs. (42), we get the error and convergence order of the difference approximation schemes; see Table 3 (where \(h= h_{x}=h_{y}\)).
Next, we give the numerical results of the standard different scheme obtained by computer experiment; see Table 4 (where \(h= h_{x}=h_{y}\)).
In Tables 3 and 4, we compare the second-order standard finite difference scheme and the fourth-order compact finite difference scheme (19) in the sense of the \(l^{2}\)-norm and the \(l^{\infty }\)-norm at \(T = 1\). We make \(\tau^{2} = h \) in the scheme (19) and \(\tau= h \) in another; applying MATLAB software, we get the numerical solution compared with the exact solution as shown in Fig. 6 and Fig. 7.
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{32}\) and \(\tau= \frac{1}{1024}\) in Example 2. (a) \(N=2^{4}\). (b) \(N=2^{4}\)
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{64}\) and \(\tau= \frac{1}{4096}\) in Example 2. (a) \(N=2^{6}\). (b) \(N=2^{6}\)
Using MATLAB, we can derive Fig. 8. The left one is the picture of the absolute error by employing a fourth-order finite difference scheme. The other one is for the error curves of the \(l^{\infty}\)-norm varying with spatial step. It proves that the degree of the numerical solutions is approximating the exact solutions in different grid points.
Comparison figures of errors between the standard difference scheme and the compact difference scheme in Example 2. (a) Absolute error when \(T = 1, N = 32\) and \(K= N^{2}\). (b) \(l^{\infty}\)-norm varying with spatial step
Example 3
Consider the convection–diffusion equation with non-homogeneous Dirichlet boundary condition
The exact solution of this problem (43) given by
Taking the temporal range \(t \in[0,T]\) still, the coefficients are chosen as \(D_{x} = D_{y} = 1, v = 1\). We use this problem to check the accuracy for two different schemes: the scheme (19): the fourth-order compact finite difference scheme and the standard scheme: the second-order centered difference scheme.
Choosing the same time step sizes as the former ones, we show in Table 4 the errors in \(l^{2}\)-norm and the \(l^{\infty}\)-norm for scheme (19) to Eqs. (43) with different grid points, meanwhile, we also give the error and convergence order of standard second-order difference schemes; see Table 6.
From Table 5 and Table 6, when \(T = 1\), in the sense of either the \(l^{2}\)-norm or the \(l^{\infty}\)-norm, we can see that second-order standard finite difference scheme is worse than the proposed fourth-order compact finite difference scheme (19). Especially, when \(N = 2^{2}\), the convergence order of standard second-order difference schemes is obviously not in conformity with the theoretical results. In addition, with the increase of N, although the \(l^{2}\)-norm gradually converges to second order, for the \(l^{\infty}\)-norm, the numerical results are not very satisfactory, it produces a slight fluctuation with the increase of N. Compared with this, our method is more accurate and shows good convergence; it yields the smallest errors among the two methods.
Applying MATLAB software, we get the numerical solution compared with exact solution as shown in Figs. 9, 10 and 11, these three pictures show the corresponding computational simulation results with varying number of mesh grid N.
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{4}\) and \(\tau= \frac{1}{16}\) in Example 3. (a) \(N=2^{2}\). (b) \(N=2^{2}\)
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{8}\) and \(\tau= \frac{1}{64}\) in Example 3. (a) \(N=2^{3}\). (b) \(N=2^{3}\)
The effect of numerical solution and exact solution at fixed \(T = 1, h = \frac{1}{64}\) and \(\tau= \frac{1}{4096}\) in Example 3. (a) \(N=2^{6}\). (b) \(N=2^{6}\)
Figure 12 shows the absolute error of the scheme (19) for the fixed number of N, and it describes the order between the two difference methods.
Comparison figures of errors between the standard difference scheme and the compact difference scheme in Example 3. (a) Absolute error when \(T = 1, N = 32\) and \(K= N^{2}\). (b) Approximation order of C in \(L^{2}\)-norm
In summary, the numerical experiments performed show the efficiency of the fourth-order compact difference scheme (19), which is reliable for solving a two-dimensional convection–diffusion equation, and it is apparent from Figs. 3, 4, 5, 6, 7, 9, 10 and 11 that the exact solution and numerical solution are better fitted with step size generation encrypting; it turns out that the compact difference scheme (19) we used can be a good approximation to the exact solution.
6 Conclusions
Compact finite difference schemes up to order four for solving the convection–diffusion equation in two dimensions were developed in this paper. To further collaborate the applicability of the proposed method, tables of the \(l^{2}\)-norm and the \(l^{\infty}\)-norm for \(\mathcal {O}(\tau^{2} + h^{4}_{x} + h^{4}_{y})\) compact finite difference schemes and corresponding graphs have been plotted for Examples 1, 2 and 3, for the exact solution versus the numerical solutions at different values of mesh size h. It is found that not only the error norm \(l^{2}\) decreases with the increase of the number of nodes but also the \(l^{\infty}\)-norm shows the same trend; it decreases as the mesh size h decreases, which in turn shows the convergence of the computed solution. To sum up, the present method is computationally stable, effective, simple to use, convergent and giving a better accuracy of the solution than some previously existing methods.
References
Zhu, Q., Wang, Q., Fu, J., Zhang, Z.: New second-order finite difference scheme for the problem of contaminant in groundwater flow. J. Appl. Math. 2012(2012), 129–154 (2012)
Lin, L., Yang, J.Z., Zhang, B., Zhang, B., Zhu, Y.: A simplified numerical model of 3-D groundwater and solute transport at large scale area. J. Hydrodyn. 22(3), 319–328 (2010)
Li, L.Y., Yin, Z.: Numerical simulation of groundwater pollution problems based on convection–diffusion equation. Am. J. Comput. Math. 7(3), 350–370 (2017)
Saqib, M., Hasnain, S., Mashat, D.S.: Computational solutions of two dimensional convection–diffusion equation using Crank–Nicolson and time efficient ADI. Am. J. Comput. Math. 7(3), 208–227 (2017)
Mekuria, G.T., Rao, J.A.: Adaptive finite element method for steady convection–diffusion equation. Am. J. Comput. Math. 6(3), 275–285 (2016)
Qiu, W., Shi, K.: An HDG method for convection–diffusion equation. J. Sci. Comput. 66(1), 346–357 (2016)
Shu, C.W.: Bound-preserving high order finite volume schemes for conservation laws and convection–diffusion equations. In: Finite Volumes for Complex Applications VIII—Methods and Theoretical Aspects, Springer Proceedings, pp. 3–14 (2017)
Ammi, M.R.S., Jamiai, I.: Finite difference and Legendre spectral method for a time-fractional diffusion-convection equation for image restoration. Discrete Contin. Dyn. Syst. 11(1), 103–117 (2017)
Koley, U., Risebro, N.H., Schwab, C., et al.: A multilevel Monte Carlo finite difference method for random scalar degenerate convection–diffusion equations. J. Hyperbolic Differ. Equ. 14(3), 415–454 (2017)
Noye, B.J., Tan, H.H.: Finite difference methods for solving the two-dimensional advection–diffusion equation. Int. J. Numer. Methods Fluids 9(1), 75–98 (1989)
Lu, J.F., Guan, Z.: Numerical Methods for Partial Differential Equations. Qinghua University Press, Beijing (2003)
Sun, Z.Z.: Numerical Methods for Partial Differential Equations. Science Press, Beijing (2005)
Zhang, J.: An explicit fourth-order compact finite difference scheme for three-dimensional convection–diffusion equation. Int. J. Numer. Methods Biomed. Eng. 14(3), 209–218 (2010)
Sari, M., Gürarslan, G., Zeytinoǧlu, A.: High-order finite difference schemes for solving the advection–diffusion equation. Math. Comput. Appl. 15(15), 449–460 (2010)
Qiao, H.L., Jiang, Z.W.: The high accuracy compact finite difference scheme for three dimensional convection–diffusion equation. J. Shandong Univ. Nat. Sci. 1(32), 6–9 (2017)
Gurarslan, G., Karahan, H., Alkaya, D., et al.: Numerical solution of advection–diffusion equation using a sixth-order compact finite difference method. Math. Probl. Eng. 2013(3), 532–546 (2013)
Singer, I., Turkel, E.: High-order finite difference methods for the Helmholtz equation. Comput. Methods Appl. Mech. Eng. 163(1–4), 343–358 (1998)
Bullo, T.A.: Fourth order compact finite difference method for solving one dimensional wave equation. J. Comput. Appl. Math. 8(4), 30–39 (2016)
Cui, M.R.: Compact finite difference method for the fractional diffusion equation. J. Comput. Appl. Phys. 228(20), 7792–7804 (2009)
Tian, Z.F., Ge, Y.B.: A fourth-order compact ADI method for solving two-dimensional unsteady convection–diffusion problems. J. Comput. Appl. Math. 198(1) 268–286 (2007)
Li, Y.B., Kim, J.: An efficient and stable compact fourth-order finite difference scheme for the phase field crystal equation. Comput. Methods Appl. Mech. Eng. 319, 194–216 (2017)
Kaysar, R., Arzigul, Y., Zulpiya, R.: High-order compact finite difference scheme for solving one dimensional convection–diffusion equation. J. Jiamusi Univ. (Nat. Sci. Ed.) 1(32), 135–138 (2014)
Sun, N.Z.: Groundwater Pollution: Mathematical Models and Numerical Methods. Geological Press, China (1989)
Yang, X.J., Wang, Y.: High accuracy explicit compact difference scheme for the diffusion equation. J. Hebei Univ. (Nat. Sci. Ed.) 2(36), 117–123 (2016)
Tian, Z.F., Dai, S.Q.: High-order exponential finite difference methods for convection–diffusion type problems. J. Comput. Phys. 220(2), 952–974 (2007)
Tian, Z.F., Cui, J.: A new method of constructing fourth-order compact scheme for the steady convection–diffusion equation. In: Zhuang, F.G. (ed.) Proceeding 7th International Symposium on Computational Fluid Dynamics, vol. 2, pp. 116–121. International Academic Publishers, Beijing (1997)
Ames, W.F.: Numerical Methods for Partial Differential Equations. Academic Press, New York (1977)
Li, R.H., Liu, B.: Numerical Methods for Partial Differential Equations. Higher Education Press, Beijing (2008)
Liu, M.H.: High-order compact difference method for the 2-D Poisson equation. J. Fujian U. Tech. 4(3), 373–376 (2006)
Zapata, M.U., Balam, R.I.: High-order implicit finite difference schemes for the two-dimensional Poisson equation. Appl. Math. Comput. 309, 222–244 (2017)
Acknowledgements
The authors are very grateful to Xu Qiang of Shandong Normal University, Qiao Haili of Shandong University and Wang Xuanxin of Jinan University for their help and suggestions in the process of numerical calculation. We are also very grateful to the reviewers for their valuable comments.
Availability of data and materials
Not applicable.
Funding
This work is supported by National Natural Science Foundation of China (Nos. 11501335, 11371229), the Natural Science Foundation of Shandong Province of China (No. ZR2017MA020), and the Project of Shandong Province Higher Educational Science and Technology Program (No. J14LI03).
Author information
Authors and Affiliations
Contributions
LL carried out the main part of this article. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare that they have no competing interests.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Li, L., Jiang, Z. & Yin, Z. Fourth-order compact finite difference method for solving two-dimensional convection–diffusion equation. Adv Differ Equ 2018, 234 (2018). https://doi.org/10.1186/s13662-018-1652-5
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s13662-018-1652-5
MSC
- 65N06
- 65N15
- 65N22
Keywords
- Convection–diffusion equation
- Compact finite difference method
- Fourth-order accuracy
- Numerical experiments