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
$$ \textstyle\begin{cases} \frac{\partial C}{\partial t} =D_{x} \frac{\partial^{2} C}{\partial x^{2}} + D_{y} \frac{\partial^{2} C}{\partial y^{2}} -v\frac{\partial C}{\partial x} + f, & (x,y)\in \Omega , t>0, \\ C(x,y,0)=C_{0}(x,y),& (x,y)\in \Omega , \\ C(x,y,t)=g(x,y,t),& (x,y)\in \Gamma , t>0, \end{cases} $$
(1)
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:
$$\begin{aligned} \Delta _{x}u_{ij}=\frac{u_{i+1,j}-u_{i-1,j}}{2h_{x}}, \qquad \delta^{2}_{x}u_{ij}=\frac{u_{i-1,j}-2u_{ij}+u_{i+1,j}}{h^{2}_{x}}, \qquad\delta ^{2}_{y}u_{ij}=\frac{u_{i,j-1}-2u_{ij}+u_{i,j+1}}{h^{2}_{y}}. \end{aligned}$$
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:
$$t_{n}=n\tau, \qquad \Omega _{\tau}=\{t_{n} | 0\leq n\leq K\},\qquad t_{n+\frac{1}{2}}= \frac{t_{n}+t_{n+1}}{2},\quad n=0,1,\ldots, K-1, $$
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:
$$w^{n+\frac{1}{2}}=\frac{1}{2} \bigl(w^{n+1}+w^{n} \bigr), \qquad \delta_{t}w^{n+\frac {1}{2}}=\frac{1}{\tau } \bigl(w^{n+1}-w^{n} \bigr),\quad n=0,1,\ldots, K-1. $$
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:
$$\begin{aligned} &D_{x} \frac{\partial^{2} C}{\partial x^{2}} + v\frac{\partial C}{\partial x} = f - \biggl( \frac{\partial C}{\partial t} - D_{y} \frac{\partial^{2} C}{\partial y^{2}} \biggr),\quad (x,y)\in \Omega , t>0, \end{aligned}$$
(2)
$$\begin{aligned} &{-}D_{y} \frac{\partial^{2} C}{\partial y^{2}} = f - \biggl( \frac{\partial C}{\partial t} - D_{x} \frac{\partial^{2} C}{\partial x^{2}} + v\frac{\partial C}{\partial x} \biggr),\quad (x,y)\in \Omega , t>0. \end{aligned}$$
(3)
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
$$\begin{aligned} & D_{x} \frac{\partial^{2} C}{\partial x^{2}}(x_{i},y_{j},t_{n + \frac{1}{2}}) + v\frac{\partial C}{\partial x} (x_{i},y_{j},t_{n + \frac{1}{2}}) \\ &\quad = f (x_{i},y_{j},t_{n + \frac{1}{2}})- [ \frac{\partial C}{\partial t}(x_{i},y_{j},t_{n + \frac{1}{2}}) - D_{y} \frac{\partial^{2} C}{\partial x^{2}}(x_{i},y_{j},t_{n + \frac {1}{2}}), \\ &\qquad (i,j)\in\omega, 0\leq n\leq K-1. \end{aligned}$$
(4)
Consider the one-dimensional steady convection–diffusion equation [24]
$$ - \alpha\frac{\partial^{2} u}{\partial x^{2}} + \beta\frac{\partial u}{\partial x} = \widetilde{f} (x), $$
(5)
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:
$$ - \biggl( \alpha+ \frac{\beta^{2} h^{2}}{12 \alpha} \biggr)\delta^{2}_{x} u(x_{i}) + \beta \Delta _{x} u(x_{i}) = \biggl[ 1 + \frac{h^{2}}{12} \biggl(\delta^{2}_{x} - \frac {\beta}{\alpha} \Delta _{x} \biggr) \biggr] \widetilde{f}(x_{i}), $$
(6)
where
$$\Delta _{x} u(x_{i}) = \frac{u(x_{i+1})- u(x_{i-1})}{2h} $$
and
$$\delta^{2}_{x} u(x_{i}) = \frac{u(x_{i+1})-2u(x_{i}) + u(x_{i-1})}{h^{2}} $$
are the central difference approximations for the first and second derivatives.
We think of the right term
$$f (x_{i},y_{j},t_{n + \frac{1}{2}})- [ \frac{\partial C}{\partial t}(x_{i},y_{j},t_{n + \frac{1}{2}}) - D_{y} \frac{\partial^{2} C}{\partial x^{2}}(x_{i},y_{j},t_{n + \frac{1}{2}}) $$
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
$$\begin{aligned} &{ -} \biggl(D_{x} + \frac{v^{2} h^{2}_{x}}{12 D_{x}} \biggr) \delta^{2}_{x} C^{n + \frac{1}{2}}_{ij} + v \Delta _{x} C^{n + \frac{1}{2}}_{ij} \\ &\quad= \biggl[ 1 + \frac{h^{2}_{x}}{12} \biggl(\delta^{2}_{x} - \frac{v}{D_{x}} \Delta _{x} \biggr) \biggr] \biggl[f^{n + \frac{1}{2}}_{ij} - \biggl( \frac{\partial C}{\partial t} - D_{y} \delta^{2}_{y} C \biggr)| ^{n + \frac{1}{2}}_{ij} \biggr] + R^{n+\frac{1}{2}}_{1ij}, \\ &\qquad (i,j)\in\omega, 0\leq n\leq K-1, \end{aligned}$$
(7)
where the truncation error is
$$\begin{aligned} \bigl\vert R^{n+\frac{1}{2}}_{1ij} \bigr\vert = O \bigl(h^{4}_{x} \bigr),\quad (i,j)\in\omega, 0\leq n\leq K-1. \end{aligned}$$
(8)
Considering Eq. (3) at the point \((x_{i},y_{j},t_{n+\frac{1}{2}})\), we have
$$\begin{aligned} & {-}D_{y} \frac{\partial^{2} C}{\partial y^{2}}(x_{i},y_{j},t_{n + \frac {1}{2}}) \\ &\quad = f (x_{i},y_{j},t_{n + \frac{1}{2}})- \biggl[ \frac{\partial C}{\partial t}(x_{i},y_{j},t_{n + \frac{1}{2}}) - D_{x} \frac{\partial^{2} C}{\partial x^{2}}(x_{i},y_{j},t_{n + \frac{1}{2}}) + v\frac{\partial C}{\partial x}(x_{i},y_{j},t_{n + \frac{1}{2}}) \biggr], \\ &\qquad(i,j)\in\omega, 0\leq n\leq K-1. \end{aligned}$$
(9)
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}\),
$$ (\mathcal{B} u)_{ij} = \textstyle\begin{cases} \frac{u_{i,j-1} + 10 u_{ij} + u_{i,j+1}}{12}, & 1 \leq i \leq N, 1 \leq j \leq M-1, \\ u_{ij},& 1 \leq i \leq N, j = 0, M. \end{cases} $$
(10)
By Lemma 1.2(g) [12]: If \(g(x) \in C^{6}[c-h, c+h]\), then we have
$$ \frac{1}{12} \bigl[g^{\prime\prime}(c-h) +10 g^{\prime\prime} (c) + g^{\prime\prime} (c+h) \bigr] = \frac {1}{h^{2}} \bigl[g(c-h) +10 g(c) + g(c+h) \bigr] + \frac{h^{4}}{240}g^{6}(\xi_{6}), $$
where \(\xi_{6} \in(c-h, c+h)\), \(h>0\) and c are two positive constants.
We have
$$\begin{aligned} \mathcal{B} \frac{\partial^{2}u}{\partial{y^{2}}}(x_{i},y_{j},t_{n}) = \delta ^{2}_{y}u^{n}_{ij} + \frac{h_{y}^{4}}{240} \frac{\partial^{6} u}{\partial {y^{6}}}(x_{i},\xi_{jk},t_{n}), \end{aligned}$$
(11)
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
$$\begin{aligned} & {-}D_{y}\delta^{2}_{y} C^{n + \frac{1}{2}}_{ij} \\ &\quad = \frac{1}{12} \biggl\{ \biggl[f(x_{i},y_{j},t_{n + \frac{1}{2}}) - \biggl(\frac {\partial C}{\partial t} (x_{i},y_{j},t_{n + \frac{1}{2}})- D_{x} \frac{\partial^{2} C}{\partial x^{2}}(x_{i},y_{j},t_{n + \frac{1}{2}}) + v \frac{\partial C}{\partial x}(x_{i},y_{j},t_{n + \frac{1}{2}}) \biggr) \biggr] \\ &\qquad{}+ 10 \biggl[f(x_{i},y_{j},t_{n + \frac{1}{2}}) - \biggl( \frac {\partial C}{\partial t}(x_{i},y_{j},t_{n + \frac{1}{2}}) - D_{x} \frac{\partial^{2} C}{\partial x^{2}}(x_{i},y_{j},t_{n + \frac{1}{2}}) + v \frac{\partial C}{\partial x}(x_{i},y_{j},t_{n + \frac{1}{2}}) \biggr) \biggr] \\ &\qquad{}+ \biggl[f(x_{i},y_{j},t_{n + \frac{1}{2}}) - \biggl( \frac{\partial C}{\partial t} (x_{i},y_{j},t_{n + \frac{1}{2}})- D_{x} \frac{\partial^{2} C}{\partial x^{2}} (x_{i},y_{j},t_{n + \frac{1}{2}}) + v \frac{\partial C}{\partial x}(x_{i},y_{j},t_{n + \frac{1}{2}}) \biggr) \biggr] \biggr\} \\ &\qquad{}+ \frac{h_{y}^{4}}{240} \frac{\partial^{6} u}{\partial {y^{6}}}(x_{i},\xi _{jk},t_{n}),\quad (i,j)\in\omega, 0\leq n\leq K-1. \end{aligned}$$
(12)
It is easy to observe that Eq. (12) is equal to the following form:
$$\begin{aligned} &{ -}D_{y}\delta^{2}_{y} C(x_{i},y_{j},t_{n + \frac {1}{2}}) \\ &\quad= \biggl[1 + \frac{h^{2}_{y}}{12} \delta^{2}_{y} \biggr] \biggl\{ f(x_{i},y_{j},t_{n + \frac {1}{2}})- \biggl[ \frac{\partial C}{\partial t} (x_{i},y_{j},t_{n + \frac {1}{2}}) \\ &\qquad{}- D_{x} \frac{\partial^{2} C}{\partial x^{2}} (x_{i},y_{j},t_{n + \frac {1}{2}}) + v \frac{\partial C}{\partial x}(x_{i},y_{j},t_{n + \frac {1}{2}}) \biggr] \biggr\} + \frac {h_{y}^{4}}{240} \frac{\partial^{6} u}{\partial{y^{6}}}(x_{i},\xi _{jk},t_{n}), \\ &\qquad(i,j)\in\omega, 0\leq n\leq K-1. \end{aligned}$$
(13)
Taking the Taylor formula into account again, applying the Taylor expansion for Eq. (13), we have
$$\begin{aligned} &{-}D_{y}\delta^{2}_{y} C^{n + \frac{1}{2}}_{ij} = \biggl[1 + \frac{h^{2}_{y}}{12} \delta^{2}_{y} \biggr] \biggl[f^{n + \frac{1}{2}}_{i,j} - \biggl(\frac{\partial C}{\partial t} - D_{x} \delta^{2}_{x}C + v \Delta _{x}C \biggr)| ^{n + \frac{1}{2}}_{i,j} \biggr] + R^{n+\frac {1}{2}}_{2ij}, \\ &\quad(i,j)\in\omega, 0\leq n\leq K-1, \end{aligned}$$
(14)
where the truncation error is
$$ \bigl\vert R^{n+\frac{1}{2}}_{2ij} \bigr\vert = O \bigl(h^{4}_{y} \bigr), \quad (i,j)\in\omega, 0\leq n\leq K-1.$$
(15)
Adding Eq. (7) to Eq. (14) and using Eq. (1) yield
$$\begin{aligned} &{-} \biggl(D_{x} + \frac{v^{2} h^{2}_{x}}{12 D_{x}} \biggr) \delta^{2}_{x} C^{n + \frac{1}{2}}_{ij} + v \Delta _{x} C^{n + \frac{1}{2}}_{ij} -D_{y}\delta ^{2}_{y} C^{n + \frac{1}{2}}_{ij} \\ &\quad= \biggl[ 1 + \frac{h^{2}_{x}}{12} \biggl(\delta^{2}_{x} - \frac{v}{D_{x}} \Delta _{x} \biggr) \biggr] \biggl[f^{n + \frac{1}{2}}_{ij} - \biggl( \frac{\partial C}{\partial t} - D_{y} \delta^{2}_{y} C \biggr)| ^{n + \frac{1}{2}}_{ij} \biggr] \\ &\qquad{}+ \biggl[1 + \frac{h^{2}_{y}}{12} \delta^{2}_{y} \biggr] \biggl[f^{n + \frac {1}{2}}_{i,j} - \biggl(\frac{\partial C}{\partial t} - D_{x} \delta^{2}_{x}C + v \Delta _{x}C \biggr)| ^{n + \frac{1}{2}}_{i,j} \biggr] + R^{n+\frac{1}{2}}_{1ij} + R^{n+\frac {1}{2}}_{2ij}. \end{aligned}$$
(16)
For the time term of Eq. (16), we make a Crank–Nicolson (C-N) time discretization, noticing the former notations, we can construct
$$\begin{aligned} & \biggl\{ \frac{1}{2} \biggl[ - \biggl(D_{x} + \frac{v^{2}h^{2}_{x}}{12D_{x}} \biggr) \delta^{2}_{x} + v \Delta _{x}- D_{y} \delta^{2}_{y} - \frac {D_{y}h^{2}_{x} + D_{x}h^{2}_{y}}{12}\delta^{2}_{x}\delta ^{2}_{y}+ \biggl(\frac {D_{y}vh^{2}_{x}}{12D_{x}} + \frac{vh^{2}_{y}}{12} \biggr) \delta^{2}_{y} \Delta _{x} \biggr] \\ &\qquad{}+ \frac{1}{\tau} \biggl[ 1+ \frac{h^{2}_{x}}{12} \biggl( \delta^{2}_{x} - \frac{v}{D_{x}} \Delta _{x} \biggr) + \frac{h^{2}_{y}}{12} \delta^{2}_{y} \biggr] \biggr\} C^{n+1}_{ij} \\ &\quad= \biggl[ 1+ \frac{h^{2}_{x}}{12} \biggl( \delta^{2}_{x} - \frac{v}{D_{x}} \Delta _{x} \biggr) + \frac{h^{2}_{y}}{12} \delta^{2}_{y} \biggr] \} f^{n+\frac{1}{2}}_{ij} \\ &\qquad{}- \biggl\{ \frac{1}{2} \biggl[ - \biggl(D_{x} + \frac {v^{2}h^{2}_{x}}{12D_{x}} \biggr) \delta^{2}_{x} + v \Delta _{x}- D_{y} \delta ^{2}_{y} - \frac{D_{y}h^{2}_{x} + D_{x}h^{2}_{y}}{12}\delta ^{2}_{x}\delta^{2}_{y} \\ &\qquad{}+ \biggl(\frac{D_{y}vh^{2}_{x}}{12D_{x}} + \frac{vh^{2}_{y}}{12} \biggr) \delta^{2}_{y} \Delta _{x} \biggr]- \frac{1}{\tau} \biggl[ 1+ \frac{h^{2}_{x}}{12} \biggl( \delta ^{2}_{x} - \frac{v}{D_{x}} \Delta _{x} \biggr) + \frac{h^{2}_{y}}{12} \delta ^{2}_{y} \biggr] \biggr\} C^{n}_{ij} + R^{n}_{ij}, \\ &\qquad(i,j)\in\omega, 0\leq n\leq K-1, \end{aligned}$$
(17)
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
$$ \begin{aligned}& C^{0}_{ij}=0,\quad (i,j) \in\omega, \\ &C^{n}_{ij}=g(x_{i},y_{j},t_{n}),\quad (i,j)\in\sigma, 0\leq n\leq K. \end{aligned} $$
(18)
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,
$$\begin{aligned} \textstyle\begin{cases} \{ \frac{1}{2} [ - (D_{x} + \frac{v^{2}h^{2}_{x}}{12D_{x}}) \delta^{2}_{x} + v \Delta _{x}- D_{y} \delta^{2}_{y} - \frac {D_{y}h^{2}_{x} + D_{x}h^{2}_{y}}{12}\delta^{2}_{x}\delta^{2}_{y} +(\frac{D_{y}vh^{2}_{x}}{12D_{x}} + \frac{vh^{2}_{y}}{12}) \delta^{2}_{y} \Delta _{x}] \\ \qquad{} + \frac{1}{\tau}[ 1+ \frac{h^{2}_{x}}{12}( \delta^{2}_{x} - \frac{v}{D_{x}} \Delta _{x}) + \frac{h^{2}_{y}}{12} \delta ^{2}_{y}] \} c^{n+1}_{ij} \\ \quad=[ 1+ \frac{h^{2}_{x}}{12}( \delta^{2}_{x} - \frac{v}{D_{x}} \Delta _{x}) + \frac{h^{2}_{y}}{12} \delta^{2}_{y}] f^{n+\frac{1}{2}}_{ij} \\ \qquad{} - \{ \frac{1}{2} [ -(D_{x} + \frac {v^{2}h^{2}_{x}}{12D_{x}}) \delta^{2}_{x} + v \Delta _{x}- D_{y} \delta ^{2}_{y} - \frac{D_{y}h^{2}_{x} + D_{x}h^{2}_{y}}{12}\delta ^{2}_{x}\delta^{2}_{y} + (\frac{D_{y}vh^{2}_{x}}{12D_{x}} + \frac{vh^{2}_{y}}{12}) \delta^{2}_{y} \Delta _{x}]\\ \qquad{}- \frac{1}{\tau}[ 1+ \frac{h^{2}_{x}}{12}( \delta^{2}_{x} - \frac{v}{D_{x}} \Delta _{x}) + \frac{h^{2}_{y}}{12} \delta^{2}_{y}] \} c^{n}_{ij}, \\ \qquad(i,j)\in\omega, 0\leq n\leq K-1, \\ c^{0}_{ij}(x,y)=c_{0}(x_{i},y_{j}),\quad (i,j)\in\omega, \\ c^{n}_{ij}(x,y)=g(x_{i},y_{j},t_{n}),\quad (i,j)\in\omega, 0\leq n\leq K. \end{cases}\displaystyle \end{aligned}$$
(19)
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
$$ \bigl\vert R^{n}_{ij} \bigr\vert = \mathcal{O} \bigl( \tau^{2} + h_{x}^{4} + h_{y}^{4} \bigr),\quad (i,j)\in \omega, 0\leq n\leq K. $$
(20)