Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

Conservation laws are ubiquitous in continuum physics, they occur in disciplines like fluid dynamics, combustion theory, plasma physics, semiconductor theory etc. These conservation laws are often of advection-diffusion-reaction type, describing the interplay between different processes such as advection or drift, diffusion or conduction and (chemical) reaction or recombination/generation.

In this paper we address (high order) space discretisation methods for these equations. We consider the model problem

$$\displaystyle{ \frac{\mathrm{d}} {\mathrm{d}x}\Big(u\varphi -\varepsilon \frac{\mathrm{d}\varphi } {\mathrm{d}x}\Big) = s, }$$
(1)

where u is the advection velocity, ɛɛ min > 0 a diffusion/conduction coefficient and s a source term. The unknown φ could be for example the mass fraction of a species in a reacting flow. Associated with (1) we introduce the flux f defined by

$$\displaystyle{ f = u\varphi -\varepsilon \frac{\mathrm{d}\varphi } {\mathrm{d}x}, }$$
(2)

thus the conservation law can be concisely written as df∕dx = s.

For space discretisation we apply the finite volume method (FVM), thus we cover the domain with a finite set of control volumes (cells) I j of size h = Δx. We adopt the vertex-centred approach [6], i.e., we choose I j = [x j−1∕2, x j+1∕2] where \(x_{j\pm 1/2} = \tfrac{1} {2}\big(x_{j} + x_{j\pm 1}\big)\) and x j are the grid points where φ has to be approximated. Integrating (1) over the control volume I j , we obtain the integral conservation law

$$\displaystyle{ f(x_{j+1/2}) - f(x_{j-1/2}) =\int _{ x_{j-1/2}}^{x_{j+1/2} }s(x)\,\mathrm{d}x. }$$
(3)

To derive the discrete conservation law, we have to approximate the flux f(x j+1∕2) by a numerical flux F j+1∕2 and we have to approximate the integral in the right hand side. Thus, a generic form of the discrete conservation law reads

$$\displaystyle{ F_{j+1/2} - F_{j-1/2} =\mathrm{ Q}[s;x_{j-1/2},x_{j+1/2}], }$$
(4)

where F j+1∕2 is the numerical flux at the cell interface x = x j+1∕2 and where \(\mathrm{Q}\big[s;x_{j-1/2},x_{j+1/2}\big]\) denotes a (high order) quadrature rule approximation for the integral in the right hand side of (3). A possible choice for the numerical flux is the standard complete flux scheme, which can be written in the form

$$\displaystyle{ F_{j+1/2} =\alpha _{j+1/2}\varphi _{j} -\beta _{j+1/2}\varphi _{j+1} + h\big(\gamma _{j+1/2}s_{j} +\delta _{j+1/2}s_{j+1}\big), }$$
(5)

for some coefficients α j+1∕2 etc., and where φ j φ(x j ) denotes the numerical solution at grid point x j and s j = s(x j ). The standard complete flux approximation results in a compact three-point scheme and is uniformly second order accurate [4]. The purpose of this paper is to derive a compact, high order variant of the complete flux scheme. The numerical flux may only depend on the two neighbouring grid point values of φ and s, and necessarily some values of s at intermediate points. This way we avoid cumbersome (W)ENO reconstruction of interface values for φ. Combined with a high order quadrature rule for s, this gives rise to a compact high order scheme. Consequently, the resulting algebraic system is straightforward to solve and the numerical solution much more accurate than the standard complete flux numerical solution.

We have organised our paper as follows. In Sect. 2 we present the integral representation of the flux, from which we derive the standard complete flux scheme. We combine the standard scheme with the midpoint rule for the source s. Next, in Sect. 3 we present a high order variant of the complete flux scheme. For the corresponding quadrature rule for s we choose the two-point Gauss-Legendre quadrature rule. We demonstrate the performance of both schemes in Sect. 4 and we end with a summary and conclusions in Sect. 5.

2 Standard Complete Flux Scheme

In this section we outline the standard complete flux scheme for Eq. (1), which is based on the integral representation of the flux; for a detailed derivation see [4].

The integral representation of the flux f(x j+1∕2) at the cell interface x = x j+1∕2 is based on the following model boundary value problem (BVP) for φ:

$$\displaystyle{ \frac{\mathrm{d}f} {\mathrm{d}x} = \frac{\mathrm{d}} {\mathrm{d}x}\Big(u\varphi -\varepsilon \frac{\mathrm{d}\varphi } {\mathrm{d}x}\Big) = s,\quad x_{j} <x <x_{j+1}, }$$
(6a)
$$\displaystyle{ \varphi (x_{j}) =\varphi _{j},\quad \varphi (x_{j+1}) =\varphi _{j+1}. }$$
(6b)

We like to emphasize that f(x j+1∕2) corresponds to the solution of the entire equation, implying that f(x j+1∕2) not only depends on u and ɛ, but also on the source term s. We define the following variables:

$$\displaystyle{ a = \frac{u} {\varepsilon },\quad A(x) =\int _{ x_{j+1/2}}^{x}a(\xi )\,\mathrm{d}\xi,\quad S(x) =\int _{ x_{j+1/2}}^{x}s(\xi )\,\mathrm{d}\xi. }$$
(7)

Integrating Eq. (6a) from x j+1∕2 to x ∈ [x j , x j+1] we obtain the relation

$$\displaystyle{ f(x) - f(x_{j+1/2}) = S(x). }$$
(8)

Next, using the definition of A in (7), we rewrite the expression for the flux in its integrating factor formulation, i.e.,

$$\displaystyle{ f = -\varepsilon \frac{\mathrm{d}} {\mathrm{d}x}\Big(\varphi \,\mathrm{e}^{-A}\Big)\,\mathrm{e}^{A}. }$$
(9)

Finally, substituting (9) in (8), integrating the resulting equation from x j to x j+1 and applying the boundary conditions (6b), we obtain the following expressions for the flux

$$\displaystyle{ f(x_{j+1/2}) = f^{\mathrm{h}}(x_{ j+1/2}) + f^{\mathrm{i}}(x_{ j+1/2}), }$$
(10a)
$$\displaystyle{ f^{\mathrm{h}}(x_{ j+1/2}) =\big (\mathrm{e}^{-A(x_{j})}\varphi _{ j} -\mathrm{ e}^{-A(x_{j+1})}\varphi _{ j+1}\big)/\int _{x_{j}}^{x_{j+1} }\varepsilon ^{-1}\mathrm{e}^{-A}\,\mathrm{d}x, }$$
(10b)
$$\displaystyle{ f^{\mathrm{i}}(x_{ j+1/2}) = -\int _{x_{j}}^{x_{j+1} }\varepsilon ^{-1}\mathrm{e}^{-A}S\,\mathrm{d}x/\int _{ x_{j}}^{x_{j+1} }\varepsilon ^{-1}\mathrm{e}^{-A}\,\mathrm{d}x, }$$
(10c)

where f h(x j+1∕2) and f i(x j+1∕2) are the homogeneous and inhomogeneous part of the flux, corresponding to the advection-diffusion operator and the source term, respectively.

For the inhomogeneous flux, we can derive an alternative expression. Indeed, substituting the expression for S in (7) in (10c) and changing the order of integration we obtain the relation

$$\displaystyle{ f^{\mathrm{i}}(x_{ j+1/2}) = h\int _{0}^{1}G(\sigma )s(x_{ j} + h\sigma )\,\mathrm{d}\sigma, }$$
(11)

where σ = (xx j )∕h is the normalised coordinate on [x j , x j+1] and where the function G is defined by

$$\displaystyle{ G(\sigma ) = \left \{\begin{array}{@{}l@{\quad }l@{}} h\int _{0}^{\sigma }\varepsilon ^{-1}\mathrm{e}^{-A}\,\mathrm{d}\eta /\int _{x_{j}}^{x_{j+1}}\varepsilon ^{-1}\mathrm{e}^{-A}\,\mathrm{d}x\quad \quad &\text{for}\quad 0 \leq \sigma \leq \tfrac{1} {2}, \\ -h\int _{\sigma }^{1}\varepsilon ^{-1}\mathrm{e}^{-A}\,\mathrm{d}\eta /\int _{x_{j}}^{x_{j+1}}\varepsilon ^{-1}\mathrm{e}^{-A}\,\mathrm{d}x\quad \quad &\text{for}\quad \tfrac{1} {2} <\sigma \leq 1. \end{array} \right. }$$
(12)

Note that G relates the flux to the source term, and therefore we refer to it as the Green’s function for the flux, similar to the Green’s function which relates the solution of (6) to the source. Summarizing, the flux is completely determined by the expressions (10a), (10b), (11) and (12).

Next, let us consider the special case of constant u and ɛ, the source term s is assumed to be an arbitrary function of x. We introduce the (grid) Péclet number P = uhɛ. In this case, the expression for the homogeneous flux reduces to

$$\displaystyle{ f^{\mathrm{h}}(x_{ j+1/2}) = \frac{\varepsilon } {h}\big(B(-P)\varphi _{j} - B(P)\varphi _{j+1}\big). }$$
(13)

In (13) we have used the Bernoulli function \(B(z):= z/\big(\mathrm{e}^{z} - 1\big)\). We can evaluate all integrals involved in the expressions for G and find

$$\displaystyle{ G(\sigma;P) = \left \{\begin{array}{@{}l@{\quad }l@{}} \quad \frac{1-\mathrm{e}^{-P\sigma }} {1-\mathrm{e}^{-P}}\quad \quad &\text{for}\quad 0 \leq \sigma \leq \tfrac{1} {2}, \\ -\frac{1-\mathrm{e}^{P(1-\sigma )}} {1-\mathrm{e}^{P}} \quad \quad &\text{for}\quad \tfrac{1} {2} <\sigma \leq 1; \end{array} \right. }$$
(14)

see Fig. 1. Note that G explicitly depends on P as a parameter. Moreover, G is discontinuous at \(\sigma = \tfrac{1} {2}\) and satisfies the symmetry condition G(σ; P) = −G(1 −σ; −P). The flux is in this case completely determined by the expressions (10a), (13), (11) and (14).

Fig. 1
figure 1

Green’s function for the flux for P > 0 (left) and P < 0 (right)

To derive expressions for the numerical flux F j+1∕2, we have to apply quadrature rules to all integrals involved. For the general case of variable u and ɛ expressions for the standard complete flux scheme have been derived in [4], whereas a higher order complete flux scheme based on the 2-point Gauss-Legendre quadrature rule is presented in [1].

In the remainder of this paper we restrict ourselves to constant u and ɛ. It is our purpose to derive a new high order flux approximation based on weighted Gauss quadrature rules. As weight function we will use the function G(σ; P) given in (14).

We start with the standard complete flux scheme. For the homogeneous numerical flux F j+1∕2 h we simply take the homogeneous part of the flux, i.e., \(F_{j+1/2}^{\mathrm{h}} = f^{\mathrm{h}}\big(x_{j+1/2}\big)\), which is exact; see (13). This approximation corresponds to the well-known exponentially fitted scheme; see for example [3] and the many references therein. To evaluate the expression (11) for the inhomogeneous flux, we need to approximate the source term on [x j , x j+1]. An obvious choice is the piecewise constant representation, corresponding to the midpoint rule in (4), given by

$$\displaystyle{ s(x_{j}+h\sigma ) = \left \{\begin{array}{@{}l@{\quad }l@{}} s_{j}\quad \quad &\text{if}\quad 0 \leq \sigma \leq \tfrac{1} {2}, \\ s_{j+1}\quad \quad &\text{if}\quad \tfrac{1} {2} <\sigma \leq 1. \end{array} \right. }$$
(15)

Inserting this expression in (11) and evaluating the resulting integrals, we obtain

$$\displaystyle{ F_{j+1/2}^{\mathrm{i}} = h\big(C_{ 2}(-P)s_{j} - C_{2}(P)s_{j+1}\big), }$$
(16)

where \(C_{2}(z):=\big (\mathrm{e}^{z/2} - 1 - z/2\big)/\big(z\big(\mathrm{e}^{z} - 1\big)\big)\). The total numerical flux F j+1∕2 is obviously given by F j+1∕2 = F j+1∕2 h + F j+1∕2 i and is referred to as the complete flux scheme (CFS).

Substituting the numerical flux in the discrete conservation law (4) and applying the midpoint rule \(\mathrm{M}\big[s;x_{j-1/2},x_{j+1/2}\big] = hs_{j}\), we obtain

$$\displaystyle{ F_{j+1/2}^{\mathrm{h}} - F_{ j-1/2}^{\mathrm{h}} = h\big(C_{ 2}^{-}s_{ j-1} +\big (1 - C_{2}^{-}- C_{ 2}^{+}\big)s_{ j} + C_{2}^{+}s_{ j+1}\big), }$$
(17)

where we introduced the short hand notation C 2 ± = C 2P). The left hand side of this equation is the discretised advection-diffusion operator, which can be written as a weighted average of the central difference and upwind discretisations, whereas the right hand side contains a weighted average of the source term values.

3 High Order Complete Flux Scheme: The Constant Coefficient Case

In this section we derive a high order approximation for the numerical flux. Consequently, we also need a high order quadrature rule Q[s; x j−1∕2, x j+1∕2] in (4).

Note that the homogeneous numerical flux F j+1∕2 h is exact for constant u and ɛ, thus we only have to consider the inhomogeneous numerical flux F j+1∕2 i. Since G(σ; P) is discontinuous at \(\sigma = \tfrac{1} {2}\), corresponding to the interface position x = x j+1∕2, we have to split the integral in (10c) in two parts as follows

$$\displaystyle{ f^{\mathrm{i}}(x_{ j+1/2}) = h\,(I_{1} + I_{2}), }$$
(18a)
$$\displaystyle{ I_{1} =\int _{ 0}^{1/2}G(\sigma;P)\tilde{s}(\sigma )\,\mathrm{d}\sigma,\quad I_{ 2} =\int _{ 1/2}^{1}G(\sigma;P)\tilde{s}(\sigma )\,\mathrm{d}\sigma, }$$
(18b)

where \(\tilde{s}(\sigma ) = s(x_{j} + h\sigma )\). We propose the weighted Gauss (WG) quadrature rule

$$\displaystyle{ I_{1} \approx \mathrm{ WG}\big[\tilde{s};0, \tfrac{1} {2}\big] = w_{1}G(\sigma _{1};P)\tilde{s}(\sigma _{1}),\quad I_{2} \approx \mathrm{ WG}\big[\tilde{s}; \tfrac{1} {2},1\big] = w_{2}G(\sigma _{2};P)\tilde{s}(\sigma _{2}), }$$
(19)

with weights w 1, w 2 > 0 and nodes \(\sigma _{1} \in \big (0, \tfrac{1} {2}\big)\) and \(\sigma _{2} \in \big (\tfrac{1} {2},1\big)\). We require that \(I_{1} =\mathrm{ WG}\big[\tilde{s};0, \tfrac{1} {2}\big]\) and \(I_{2} =\mathrm{ WG}\big[\tilde{s}; \tfrac{1} {2},1\big]\) for \(\tilde{s}(\sigma ) = 1\) and \(\tilde{s}(\sigma ) =\sigma\). For the first integral this gives rise to the equations

$$\displaystyle{ C_{2}(-P) = w_{1}G(\sigma _{1};P),\quad \tfrac{1} {2}C_{2}(-P) - C_{3}(P) = w_{1}G(\sigma _{1};P)\sigma _{1}, }$$
(20)

where \(C_{3}(z):=\big (C_{2}(z) -\tfrac{1} {8}B(z)\big)/z\). From the equations in (20) we find the quadrature rule

$$\displaystyle{ I_{1} \approx \mathrm{ WG}\big[\tilde{s};0, \tfrac{1} {2}\big] =\omega _{1}\tilde{s}(\sigma _{1}),\quad \omega _{1} = C_{2}(-P),\quad \sigma _{1} = \tfrac{1} {2} -\frac{C_{3}(-P)} {C_{2}(-P)}. }$$
(21a)

In a similar fashion we find

$$\displaystyle{ I_{2} \approx \mathrm{ WG}\big[\tilde{s}; \tfrac{1} {2},1\big] =\omega _{2}\tilde{s}(\sigma _{2}),\quad \omega _{2} = -C_{2}(P),\quad \sigma _{2} = \tfrac{1} {2} + \frac{C_{3}(P)} {C_{2}(P)}. }$$
(21b)

Alternatively, using the symmetry property of G, we can show that

$$\displaystyle{I_{2} = -\int _{0}^{1/2}G(\sigma;-P)\tilde{s}(1-\sigma )\,\mathrm{d}\sigma.}$$

If we now apply the quadrature rule (21a) to this integral and replace P by − P, we recover (21b). The modified weights ω 1 = w 1 G(σ 1; P), ω 2 = w 2 G(σ 2; P) and the corresponding nodes σ 1, σ 2 as functions of P are shown in Fig. 2. Note that \(0 <\sigma _{1} <\tfrac{1} {2}\) and \(\tfrac{1} {2} <\sigma _{2} <1\), as anticipated.

Fig. 2
figure 2

The weights ω k (left) and nodes σ k (right) (k = 1, 2)

Fig. 3
figure 3

Coefficient in the error term in (23) as a function of P

To investigate the error of the quadrature rules (21), we have to substitute \(\tilde{s}(\sigma ) =\sigma ^{2}\), since this is the lowest order monomial for which the quadrature rules are no longer exact. We restrict ourselves to (21a), thus we have

$$\displaystyle{ I_{1} =\omega _{1}\tilde{s}(\sigma _{1}) + E_{1}, }$$
(22)

where the error E 1 is of the form \(E_{1} = C\tilde{s}^{{\prime\prime}}(\eta )\) for some \(\eta \in (0, \tfrac{1} {2})\), with the prime () denoting differentiation with respect to σ. Substituting \(\tilde{s}(\sigma ) =\sigma ^{2}\) we obtain E 1 = 2C 4(−P) − C 3 2(−P)∕C 2(−P), where \(C_{4}(z) = (C_{3}(z) - \tfrac{1} {48}B(z))/z\). Therefore, for arbitrary \(\tilde{s}(\sigma )\), we have the error term

$$\displaystyle{ E_{1} = h^{2}\Big[C_{ 4}(-P) -\frac{C_{3}^{2}(-P)} {2C_{2}(-P)}\Big] \frac{\mathrm{d}^{2}s} {\mathrm{d}x^{2}}(\xi ),\quad \xi \in (x_{j},x_{j+1/2}), }$$
(23)

implying the approximation is second order accurate. The error coefficient in brackets as a function of P is shown in Fig. 3. From this figure, it is obvious that the error is negligible for P < 0, and small for P > 0. A similar result holds for the quadrature rule (21b).

Applying the quadrature rules in (21), we find the following expression for the inhomogeneous numerical flux

$$\displaystyle{ F_{j+1/2}^{\mathrm{i}} = h\big(C_{ 2}(-P)s(x_{j} + h\sigma _{1}) - C_{2}(P)s(x_{j} + h\sigma _{2})\big), }$$
(24)

which is (at least) third order accurate in view of the error term in (23). Note that this approximation is similar to (16), except for the nodes where s has to be evaluated. It is instructive to consider some limiting cases. First, for P = 0, i.e. no advection, the expression in (24) reduces to

$$\displaystyle{ F_{j+1/2}^{\mathrm{i}} = \tfrac{1} {8}h\big(s(x_{j} + \tfrac{1} {3}h) - s(x_{j} + \tfrac{2} {3}h)\big), }$$
(25a)

corresponding to the piecewise linear limit function G(σ) = σ for \(0 \leq \sigma \leq \tfrac{1} {2}\) and G(σ) = σ − 1 for \(\tfrac{1} {2} <\sigma \leq 1\). Alternatively, for P → +, i.e. u > 0 and no diffusion, we obtain

$$\displaystyle{ F_{j+1/2}^{\mathrm{i}} = \tfrac{1} {2}hs(x_{j} + \tfrac{1} {4}h), }$$
(25b)

which is the midpoint approximation of the integral in (11) for the piecewise constant limit function G(σ) = 1 for \(0 <\sigma <\tfrac{1} {2}\) and G(σ) = 0 for \(\tfrac{1} {2} <\sigma <1\). A similar expression holds when P → −.

To complete the discretisation, we apply the two-point Gauss-Legendre quadrature rule \(\mathrm{GL2}\big[s;x_{j-1/2},x_{j+1/2}\big]\) to the integral of s in (3) to obtain

$$\displaystyle\begin{array}{rcl} F_{j+1/2}^{\mathrm{h}} - F_{ j-1/2}^{\mathrm{h}} = h\big(C_{ 2}^{-}s(x_{ j-1} + h\sigma _{1}) - C_{2}^{+}s(x_{ j-1} + h\sigma _{2})-\ \ & & \\ C_{2}^{-}s(x_{ j} + h\sigma _{1}) + C_{2}^{+}s(x_{ j} + h\sigma _{2})\big) +\mathrm{ GL}2\big[s;x_{j-1/2},x_{j+1/2}\big];& &{}\end{array}$$
(26)

cf. (17).

4 Numerical Example

In this section we apply the standard and high order CF schemes to a model problem to assess their (order of) accuracy.

Consider Eq. (1) defined for 0 < x < 1. Boundary conditions and source term are chosen, such that the exact solution is given by

$$\displaystyle{ \varphi (x) =\big (1 -\tfrac{1} {5}\sin (\pi \omega )\big)\frac{\mathrm{e}^{u(x-1)/\varepsilon } -\mathrm{ e}^{-u/\varepsilon }} {1 -\mathrm{ e}^{-u/\varepsilon }} + \tfrac{1} {5}\sin (\pi \omega x). }$$
(27)

We take the following parameter values: ω = 1, u = 1, ɛ = 10−2 or ɛ = 10−3. In both cases the solution has a boundary layer at the outflow. To determine the accuracy of a numerical solution, we compute \(e_{h} = h\vert \vert \boldsymbol{\varphi }-\boldsymbol{\varphi }^{{\ast}}\vert \vert _{1}\), with \(\boldsymbol{\varphi }\) the numerical solution vector and \(\boldsymbol{\varphi }^{{\ast}}\) the exact solution restricted to the grid, as a function of the grid size h, see Fig. 4. From this figure we conclude that the standard CF-scheme is second order convergent, uniformly in the Péclet number, whereas the high order CF-scheme exhibits fourth order convergence for ɛ = 10−2 and roughly third order for ɛ = 10−3. In both cases the high order scheme has a significant smaller error e h than the standard scheme.

Fig. 4
figure 4

1-norm of the error for ɛ = 10−2 (left) and ɛ = 10−3 (right)

5 Concluding Remarks and Discussion

We have derived the integral representation of the flux for a model advection-diffusion-reaction equation. Applying quadrature rules to this representation, we could derive two flux approximation schemes, i.e., the standard complete flux scheme and a high order variant. The first scheme is second order accurate and the latter even fourth order, uniformly in the Péclet number. Moreover, both schemes only have a three-point coupling, albeit at the cost of a few source term evaluations at intermediate points. The compact stencil makes the discrete schemes easy to solve. A drawback is that quadrature rules for the inhomogeneous flux involving more than two weights and nodes are hard to derive.

Modifications to more complicated problems is not straightforward. This paper is a first attempt in designing high order complete flux schemes, and more research is certainly needed. A few possible modifications are the following. First, for nonlinear conservation laws the weighted Gauss quadrature rule is not feasible, and we first have to formulate a linearized BVP, analogous to (6), to derive a high order flux approximation scheme. However, this linearization is tricky and should use (the structure of) the solution of the corresponding nonlinear BVP. In [2] we have used this idea to derive a nonlinear (low order) flux approximation scheme for the Burgers’ equation. Second, also for two-dimensional equations the scheme doesn’t hold. A possible remedy is to formulate the conservation law in local flow adapted coordinates. This way we have to compute an advection-diffusion flux component aligned with the flow, for which we can use the high order scheme, and a diffusion flux component perpendicular to the flow, for which we can use a compact scheme. In [5] we have carried out this procedure for the standard complete flux scheme. Finally, extension to time-dependent problems is probably the most troublesome. We need a high order approximation for integral of the time derivative and we have to include the time derivative in the inhomogeneous flux; see [4] for details. In both cases we introduce the time derivative at intermediate points, which need to be eliminated. Moreover, we need a high order time integration method.