1 Introduction

Conservation laws are ubiquitous in continuum physics, they occur in disciplines like fluid mechanics, combustion theory, plasma physics, semiconductor physics 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. Examples are the conservation equations for reacting flow [14] or plasmas [15].

Diffusion in mixtures containing many species is often very complex. In particular, when there is no dominant species Fick’s law, stating that the diffusion velocity of a species is proportional to its mass fraction gradient, is often not adequate. Instead, the diffusion velocities of all species are coupled through the Stefan-Maxwell equations, which relate the mole fraction gradient of a species to the diffusion velocities of all species; see e.g. [2] for a detailed description of multi-species diffusion. This means that the continuity equations for multi-component mixtures are coupled with the Stefan-Maxwell equations [7]. Peerenboom et al. [13] derive from the continuity equations and the Stefan-Maxwell equations a system of conservation laws of advection-diffusion-reaction type, coupled through the diffusion term. The advection/drift velocities of the species in a mixture are often not the same, due to, e.g., different mobilities [15]. Therefore, we study in this paper as model problem a coupled advection-diffusion-reaction system, defined through a diagonal advection matrix and a (full) diffusion matrix.

The numerical solution of such a system requires at least an adequate space discretization. There are many classes of methods available, such as finite element, finite difference, finite volume or spectral methods. We restrict ourselves to finite volume methods; for a detailed account see, e.g., [6, 11, 23]. Finite volume methods are based on the integral formulation of the conservation law, i.e., the equation (system) is integrated over a disjunct set of control volumes covering the domain. The resulting (semi)discrete system involves fluxes at the interfaces of the control volumes, which need to be approximated. Our objective in this paper is to extend the complete flux scheme presented in [18, 19] to advection-diffusion-reaction systems, thereby including the coupling between the constituent equations in the discretization.

For stationary problems, the complete flux approximation, either scalar or vectorial, is derived from a local boundary value problem (BVP) for the entire equation/system, including the source term (vector). As a consequence, the numerical flux is the superposition of a homogeneous and an inhomogeneous flux, corresponding to the advection-diffusion operator and the source term, respectively. The numerical flux vector closely resembles its scalar counterpart and is formulated in terms of matrix functions of the Peclet matrix P, generalizing the well-known (grid) Peclet number P. The inclusion of the inhomogeneous flux is important for dominant advection, since it ensures second order accuracy. For dominant diffusion the inhomogeneous flux is of little importance. The combined finite volume-complete flux scheme has a three-point coupling, resulting in a block-tridiagonal algebraic system which can be solved very efficiently, and virtually never generates spurious oscillations.

For time-dependent conservation laws, the numerical flux (vector) has to be computed from a local, quasi-stationary BVP, containing the time derivative in the right hand side. Consequently, the numerical flux also depends on the time derivative, leading to an implicit block-tridiagonal ODE system. Analogous to the stationary case, for dominant advection second order accurate solutions can only be obtained if the time derivative is included in the inhomogeneous flux.

Coupled discretization schemes are very common for hyperbolic initial value problems, think of the Godunov scheme and all high resolution schemes based on it, which are derived from the (approximate) solution of a local initial value problem (IVP); see, e.g., [20]. To our knowledge, there are very few coupled discretization schemes for advection-diffusion-reaction boundary value systems. Doolan et al. [4] discuss finite difference methods for second order ODE systems, where the coefficient of the second derivative is just a scalar. Another exception is the exponential fitting scheme in [17] for avalanche generation in semiconductors. In that publication, the coupling in the discretization comes from the avalanche generation source term.

In this paper we systematically derive the complete flux scheme for systems of conservation laws, where we assume that the coefficient matrices and the source term vector are given. So, we are not concerned with, e.g., the computation of the flow or the electric field. We have organized our paper as follows. The finite volume method is briefly summarized in Sect. 2. In Sect. 3 we outline the scalar version of the complete flux scheme, which is subsequently generalized to stationary systems in Sect. 4. Next, in Sect. 5 we give the scheme for time-dependent problems. To test the scheme, we apply it in Sect. 6 to several test problems. Finally, we end with a summary and conclusions in Sect. 7.

2 Finite Volume Discretization

In this section we outline the finite volume method (FVM) for a generic system of conservation laws of advection-diffusion-reaction type, restricting ourselves to one-dimensional problems. So, consider the following system

$$ \frac{\partial{ \boldsymbol {\varphi } }}{\partial{t}} + \frac {\partial {}}{\partial{x}} \biggl( \boldsymbol {U} \boldsymbol {\varphi } - \boldsymbol {\mathcal {E}} \frac{\partial{ \boldsymbol {\varphi } }}{\partial{x}} \biggr) = \boldsymbol {s} ,$$
(2.1)

where U=diag(u 1,u 2,…,u m ) is the advection matrix, \(\boldsymbol {\mathcal {E}} = ( \varepsilon_{ij} )\) the diffusion matrix and s the source term vector. This system is a model problem that can be derived from the continuity equations for a mixture combined with the Stefan-Maxwell equations for multi-species diffusion; see [13]. The vector of unknowns φ contains, e.g., the species mass fractions of a reacting flow or a plasma. The matrix U then represents the advection/drift velocities of the individual species and \(\boldsymbol {\mathcal {E}} \) relates the mass diffusion flux to the gradients of the mass fractions. In [3] it is proven that \(\boldsymbol {\mathcal {E}} \) has m positive eigenvalues and a complete set of eigenvectors, and therefore \(\boldsymbol {\mathcal {E}} \) is regular. Note that the constituent equations of (2.1) are coupled through the diffusion matrix \(\boldsymbol {\mathcal {E}} \). The parameters \(\boldsymbol {\mathcal {E}} \) and s are usually (complicated) functions of the unknown φ, and U has to be computed from (flow) equations accompanying (2.1), however, for the sake of discretization, we consider these as given functions of x and t.

Associated with system (2.1) we introduce the flux vector f, defined by

$$ \boldsymbol {f} = \boldsymbol {U} \boldsymbol {\varphi } - \boldsymbol {\mathcal {E}} \frac{\partial{ \boldsymbol {\varphi } }}{\partial{x}} .$$
(2.2)

System (2.1) then reduces to φ/∂t+ f/∂x=s. Integrating this system over an arbitrary interval [α,β] we obtain the integral form of the conservation law, i.e.,

$$ \frac{\mathrm{d} {}}{\mathrm{ d} {t}} \int_{\alpha }^{\beta} \boldsymbol {\varphi } (x,t)\, \mathrm {d} x + \boldsymbol {f} ( \beta,t ) - \boldsymbol {f} ( \alpha,t ) = \int _{\alpha}^{\beta} \boldsymbol{s} (x,t)\, \mathrm {d} x.$$
(2.3)

In the FVM we cover the domain with a finite number of disjunct intervals (control volumes) I j of size Δx. In this paper we choose the vertex-centered approach [23], i.e., we first choose the grid points x j where the variable φ has to be approximated and subsequently define I j :=[x j−1/2,x j+1/2] with \(x_{j \pm1/2} := \tfrac{1}{2} ( x_{j} + x_{j \pm1} )\). Imposing the integral form (2.3) on each of the intervals I j and approximating the integrals by the midpoint rule, we obtain the semi-discrete conservation law

$$ \dot{ \boldsymbol {\varphi } }_{j}(t)\, \Delta x +\boldsymbol {F}_{j+1/2}(t) - \boldsymbol {F}_{j-1/2}(t) = \boldsymbol{s}_{j}(t)\, \Delta x ,$$
(2.4)

where \(\dot{ \boldsymbol {\varphi } }_{j}(t)\) is the numerical approximation of φ(x j ,t)/∂t, F j+1/2(t) the numerical flux (vector) approximating f at x=x j+1/2 and s j (t):=s(x j ,t). In the following we omit the dependence on t. The FVM has to be completed with expressions for the numerical flux. The basic idea of the complete flux scheme is to compute the numerical flux from a local solution of (2.1). This implies that for the stationary case, we require that the numerical flux F j+1/2 linearly depends on φ and s in the neighboring grid points x j and x j+1, i.e., we are looking for an expression of the form

$$ \boldsymbol {F}_{j+1/2} = \boldsymbol {\alpha } \boldsymbol {\varphi } _{j} - \boldsymbol {\beta } \boldsymbol {\varphi } _{j+1} + \Delta x ( \boldsymbol{\gamma} \boldsymbol{s}_{j}+ \boldsymbol {\delta } \boldsymbol{s}_{j+1} ),$$
(2.5)

where the coefficient matrices α etc. are piecewise constant and only depend on U and \(\boldsymbol {\mathcal {E}} \). For time-dependent problems, the time derivative \(\dot{ \boldsymbol {\varphi } }\) can be included as well.

In this paper we restrict ourselves to uniform grids, which is not a real restriction. The derivation of the complete flux scheme in the next sections can be easily extended to nonuniform grids. In fact, we have already employed the homogeneous flux scheme on nonuniform grids to simulate multi-species diffusion [13].

The procedure to compute F j+1/2 is detailed in the next sections. First, in Sect. 3, we outline the flux approximation for a scalar conservation law, and subsequently in Sect. 4 and Sect. 5, we extend the derivation to stationary and time-dependent systems, respectively.

3 Numerical Approximation of the Scalar Flux

In this section we present the (stationary) complete flux scheme for the scalar flux, which is based on the integral representation of the flux. The derivation is a summary of the theory in [18, 22].

The scalar conservation law can be written as df/dx=s with f=ε dφ/dx (ε>0). The integral representation of the flux f j+1/2=f(x j+1/2) at the cell edge x j+1/2 located between the grid points x j and x j+1 is based on the following model boundary value problem for the variable φ

(3.1a)
(3.1b)

In accordance with (2.5), we derive an expression for the flux f j+1/2 corresponding to the solution of the inhomogeneous BVP (3.1a)–(3.1b), implying that f j+1/2 not only depends on u and ε, but also on the source term s. It is convenient to introduce the variables a, P, A and S for x∈(x j ,x j+1) by

$$ a := \frac{u}{\varepsilon}, \qquad P := a \Delta x , \qquad A(x) :=\int_{x_{j+1/2}}^{x} a(\xi)\, \mathrm {d} \xi, \qquad S(x) := \int _{x_{j+1/2}}^{x} s(\xi)\: \mathrm {d} \xi.$$
(3.2)

Here, P and A are the Peclet function and Peclet integral, respectively, generalizing the well-known (numerical) Peclet number. Integrating the differential equation df/dx=s from x j+1/2 to x∈(x j ,x j+1) we get the integral balance f(x)−f j+1/2=S(x). Using the definition of A in (3.2), it is clear that the flux can be rewritten as f=−ε eA d(eAφ)/dx. Substituting this into the integral balance and integrating from x j to x j+1 we obtain the following expressions for the flux

(3.3a)
(3.3b)
(3.3c)

where \(f^{\mathrm{h}}_{j+1/2}\) and \(f^{\mathrm{i}}_{j+1/2}\) are the homogeneous and inhomogeneous part, corresponding to the homogeneous and particular solution of (3.1a)–(3.1b), respectively, and A j =A(x j ).

In the following we assume that u and ε are constant, extension to variable coefficients is discussed in [18, 22]. In this case we can determine all integrals involved. Moreover, substituting the expression for S(x) in (3.3c) and changing the order of integration, we can derive an alternative expression for the inhomogeneous flux. This way we obtain

(3.4a)
(3.4b)

Here B(z)=z/(ez−1) is the generating function of the Bernoulli numbers, in short Bernoulli function, see Fig. 1, and G(σ;P) the Green’s function for the flux, given by

$$ G( \sigma;P ) = \left \{ \begin{array}{l@{\quad}l}\frac{ 1 - \mathrm {e} ^{-P \sigma} }{ 1 - \mathrm {e} ^{-P} } & \text{for } 0 \le \sigma\le\frac{1}{2},\\[7pt]- \frac{ 1 - \mathrm {e} ^{P (1-\sigma)} }{ 1 - \mathrm {e} ^{P} } & \text{for }\frac{1}{2} < \sigma\le1;\end{array}\right .$$
(3.5)

see Fig. 2. Note that the homogeneous flux (3.4a) is the well-known exponential flux [12].

Fig. 1
figure 1

The Bernoulli function B (left) and the function W (right)

Fig. 2
figure 2

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

Next, we give the numerical flux F j+1/2. For the homogeneous component \(F_{j+1/2}^{\mathrm{h}}\) we obviously take (3.4a), i.e., \(F_{j+1/2}^{\mathrm{h}} =f_{j+1/2}^{\mathrm{h}}\). The approximation of the inhomogeneous component \(f^{\mathrm{i}}_{j+1/2}\) depends on P. For dominant diffusion (|P|≪1) the average value of G(σ;P) is small, which implies that the inhomogeneous flux is of little importance. On the contrary, for dominant advection (|P|≫1), the average value of G(σ;P) on the half interval upwind of \(\sigma= \tfrac{1}{2} \), i.e., the interval \([0,\tfrac{1}{2} ]\) for u>0 and \([\tfrac{1}{2} ,1]\) for u<0, is much larger than the average value on the downwind half. This means that for dominant advection the upwind value of s is the relevant one, and therefore we replace s(x(σ)) in (3.4b) by its upwind value s u,j+1/2, i.e., s u,j+1/2=s j if u≥0 and s u,j+1/2=s j+1 if u<0, and evaluate the resulting integral exactly. This way we obtain

$$ F_{j+1/2} = F_{j+1/2}^\mathrm{h} + \biggl(\frac{1}{2} - W(P) \biggr) s_{\mathrm{u},j+1/2}\, \Delta x ,$$
(3.6)

where W(z)=(ez−1−z)/(z(ez−1)); see Fig. 1. From this expression it is once more clear that the inhomogeneous component is only of importance for dominant advection. We refer to (3.6) as the complete flux (CF) scheme, as opposed to the homogeneous flux (HF) scheme for which we omit the inhomogeneous component.

4 Numerical Approximation of the Flux Vector

We extend the derivation in the previous section to systems of conservation laws, including the coupling between the constituent equations in the discretization. The representation of the flux vector turns out to be similar to its scalar counterpart.

Analogous to the scalar case, the integral representation of the flux vector f j+1/2 at the interface x=x j+1/2 is determined from the system BVP

(4.1a)
(4.1b)

where we assume that the matrices U and \(\boldsymbol {\mathcal {E}} \) are constant. Recall that \(\boldsymbol {\mathcal {E}} \) is regular, whereas U might be singular. In the derivation that follows, we need the following variables

$$ \boldsymbol {A} := \boldsymbol {\mathcal {E}} ^{-1} \boldsymbol {U} , \qquad \boldsymbol {P} := \Delta x \boldsymbol {A} , \qquad \boldsymbol {S} (x) := \int_{x_{j+1/2}}^{x} \boldsymbol{s} (\xi) \, \mathrm {d} \xi;$$
(4.2)

cf. (3.2). We refer to P as the Peclet matrix, generalizing the Peclet number. We have to determine several matrix functions g(P) and the matrix sign function sgn(A), which depend on the eigenvalues and eigenvectors of A. We assume that A has m real eigenvalues λ i and m corresponding, linearly independent eigenvectors v i , satisfying the generalized eigenvalue problem

$$ ( \boldsymbol {U} - \lambda \boldsymbol {\mathcal {E}} ) \boldsymbol{v} = \boldsymbol{0}.$$
(4.3)

Although this assumption is not always correct, it does hold for some important cases. First, when U=u I this assumption is trivially satisfied. Second, the assumption is also correct when \(\boldsymbol {\mathcal {E}} \) is symmetric positive definite. Then, \(\boldsymbol {\mathcal {E}} \) has the Cholesky-decomposition \(\boldsymbol {\mathcal {E}} = \boldsymbol {L} \boldsymbol {L} ^{\mathrm{T}}\), and the eigenvalue problem (4.3) can be rewritten as

$$ \bigl( \boldsymbol {L} ^{-1} \boldsymbol {U} \boldsymbol {L} ^{- \mathrm {T} } - \lambda \boldsymbol {I} \bigr) \boldsymbol {w} = \boldsymbol{0},$$
(4.4)

where w=L T v. Since L −1 UL −T is symmetric it has an orthogonal set of eigenvectors w i , and consequently, the corresponding eigenvectors v i are linearly independent.

Since A has a complete set of eigenvectors, its (spectral) decomposition is given by

$$ \boldsymbol {A} = \boldsymbol {V} \boldsymbol {\Lambda } \boldsymbol {V} ^{-1}, \quad \boldsymbol {\Lambda } := \mathrm{diag}( \lambda_{1}, \lambda_{2}, \ldots, \lambda_{m}),\ \boldsymbol {V} := ( \boldsymbol{v}_{1}\ \boldsymbol{v}_{2}\ \ldots\ \boldsymbol{v}_{m} ).$$
(4.5)

Note that the matrices Λ and V are constant. Based on this decomposition, we can determine any matrix function g(P) that is defined on the spectrum of A and the matrix sign function sgn(A) as follows [9, 10]

(4.6)

where we define sgn(0)=1. Moreover, we need the following properties of matrix exponentials

(4.7)

for arbitrary square matrices A 1 and A 2. An alternative representation of g(P) in case A is not diagonalizable is based on the Jordan canonical form, however, this will not be elaborated further.

We can essentially repeat the derivation in Sect. 3. First, integrating the system df/dx=s from x j+1/2 to x∈(x j ,x j+1) we get the integral balance

$$ \boldsymbol {f} (x) - \boldsymbol {f} _{j+1/2} = \boldsymbol {S} (x),$$
(4.8)

with f j+1/2=f(x j+1/2). Using the definition of A in (4.2) and the first property in (4.7), it is clear that the flux vector can be rewritten as

$$ \boldsymbol {f} = - \boldsymbol {\mathcal {E}} \mathrm {e} ^{x \boldsymbol {A} } \frac{\mathrm{ d}{}}{\mathrm{ d} {x}} \bigl( \mathrm {e} ^{-x \boldsymbol {A} }\, \boldsymbol {\varphi } \bigr).$$
(4.9)

Next, substituting this expression in (4.8), isolating the derivative d(exA φ)/dx, integrating from x j to x j+1 and using the first three properties in (4.7) we obtain the following relation for the flux

$$ \int_{x_{j}}^{x_{j+1}} \mathrm {e} ^{-x \boldsymbol {A} }\, \mathrm {d} x\, \boldsymbol {\mathcal {E}} ^{-1} \boldsymbol {f} _{j+1/2} = \mathrm {e} ^{-x_{j} \boldsymbol {A} } \boldsymbol {\varphi } _{j} - \mathrm {e} ^{-x_{j+1} \boldsymbol {A} } \boldsymbol {\varphi } _{j+1} - \int _{x_{j}}^{x_{j+1}} \mathrm {e} ^{-x \boldsymbol {A} } \boldsymbol {\mathcal {E}} ^{-1} \boldsymbol {S} \, \mathrm {d} x.$$
(4.10)

Consider the computation of the integral in the left hand side of (4.10). The difficulty is that A might be singular, in case U is singular. Using the spectral decomposition (4.5) we can compute the integral as follows

(4.11a)
(4.11b)

When A is singular, at least one of its eigenvalues λ i =0. Taking this into consideration the integrals in the right hand side of (4.11b) have to be formulated as

$$ \int_{x_{j}}^{x_{j+1}} \mathrm {e} ^{-x \lambda_{i}}\, \mathrm {d} x = \Delta x \, \mathrm {e} ^{-\lambda_{i} x_{j+1/2}}\, \mathrm {sinhc} \biggl(\frac{1}{2} \lambda_{i} \Delta x \biggr),$$
(4.12)

where the function sinhc is defined as sinhc(z)=sinhz/z for z≠0 and sinhc(0)=1, and therefore (4.12) is correct for both λ i ≠0 and λ i =0. Substituting (4.12) in (4.11a)–(4.11b) and using the definition of matrix functions in (4.6) the integral of exA can be evaluated as

$$ \int_{x_{j}}^{x_{j+1}} \mathrm {e} ^{-x \boldsymbol {A} }\, \mathrm {d} x = \Delta x \, \mathrm {e} ^{-x_{j+1/2} \boldsymbol {A} }\, \mathrm{sinhc} \biggl(\frac{1}{2} \boldsymbol {P} \biggr).$$
(4.13)

Inserting this relation in the left hand side of (4.10), we can derive the following expression for the flux

(4.14)

thus also in the system case the flux is a superposition of a homogeneous and an inhomogeneous component, as anticipated. Note that \(\mathrm{sinhc} ( \tfrac{1}{2} \boldsymbol {P} )\) is regular, even if P is singular.

Consider first the homogeneous flux, which follows from (4.14) if we set S(x)=0. Using the last property in (4.7) we can rewrite the expression for the homogeneous flux as

$$ \boldsymbol {f} ^\mathrm{h}_{j+1/2} = \frac{1}{ \Delta x } \boldsymbol {\mathcal {E}} \bigl( B(- \boldsymbol {P} ) \boldsymbol {\varphi } _{j} - B( \boldsymbol {P} ) \boldsymbol {\varphi } _{j+1} \bigr),$$
(4.15)

analogous to the scalar flux; cf. (3.4a). For the numerical flux we simply take \(\boldsymbol {F}_{j+1/2}^{\mathrm{h}} = \boldsymbol {f} _{j+1/2}^{\mathrm{h}}\). Rearranging terms in (4.15) and using the relation B(−z)−B(z)=z, we can derive the alternative representation

$$ \boldsymbol {F}_{j+1/2}^\mathrm{h} = \frac{1}{2} \boldsymbol {U} ( \boldsymbol {\varphi } _{j} + \boldsymbol {\varphi } _{j+1} ) - \frac{1}{ \Delta x }\frac{1}{2} \boldsymbol {\mathcal {E}} \bigl( B( \boldsymbol {P} ) + B(- \boldsymbol {P} ) \bigr) ( \boldsymbol {\varphi } _{j+1} - \boldsymbol {\varphi } _{j} ),$$
(4.16)

reminiscent of the central difference approximation of (2.2), albeit with a modified diffusion matrix \(\tfrac{1}{2} \boldsymbol {\mathcal {E}} ( B( \boldsymbol {P} ) +B(- \boldsymbol {P} ) )\).

The derivation of the inhomogeneous flux is more involved. Substituting the expression for S(x) in the integral in (4.14) and changing the order of integration, we obtain

$$ \boldsymbol {f} _{j+1/2}^\mathrm{i} = -\frac{1}{ \Delta x } \boldsymbol {\mathcal {E}} \biggl( \mathrm{sinhc} \biggl( \frac{1}{2} \boldsymbol {P} \biggr)\biggr)^{-1} \int_{x_{j}}^{x_{j+1}} \int _{x}^{x_\mathrm{ p}(x)} \mathrm {e} ^{( x_{j+1/2} - \xi) \boldsymbol {A} }\, \mathrm {d} \xi\, \boldsymbol {\mathcal {E}} ^{-1} \boldsymbol {s} (x)\, \mathrm {d} x,$$
(4.17)

where x p(x)=x j for x j xx j+1/2 and x p(x)=x j+1 for x j+1/2<xx j+1, i.e., the x-coordinate of the grid point closest to x. Introducing the scaled coordinate σ(x)=(xx j )/Δx, we can derive the following alternative expression for the inhomogeneous flux

$$ \boldsymbol {f} _{j+1/2}^\mathrm{i} = \Delta x \boldsymbol {\mathcal {E}} \int _{0}^{1} \boldsymbol {G} ( \sigma; \boldsymbol {P} ) \boldsymbol {\mathcal {E}} ^{-1}\boldsymbol{s} \bigl( x(\sigma) \bigr)\, \mathrm {d} \sigma;$$
(4.18)

cf. (3.4b). The matrix G in (4.18), relating the flux vector to the source term vector, is referred to as the Green’s matrix for the flux and is given by

$$ \boldsymbol {G} ( \sigma; \boldsymbol {P} ) = \left \{ \begin{array}{l@{\quad}l}\sigma B( - \boldsymbol {P} ) B( -\sigma \boldsymbol {P} )^{-1}&\text{for } 0 \le\sigma\le \tfrac{1}{2},\\[3pt]-(1-\sigma) B( \boldsymbol {P} ) B( (1-\sigma) \boldsymbol {P} )^{-1}&\text{for } \tfrac {1}{2} < \sigma\le1.\end{array} \right .$$
(4.19a)

Note that the matrices B(−σ P) and B((1−σ)P) are always regular. When the Peclet matrix P is nonsingular, this expression reduces to

$$ \boldsymbol {G} ( \sigma; \boldsymbol {P} ) = \left \{ \begin{array}{l@{\quad}l}( \boldsymbol {I} - \mathrm {e} ^{- \boldsymbol {P} } )^{-1} ( \boldsymbol {I} - \mathrm {e} ^{-\sigma \boldsymbol {P} } )&\text{for } 0 \le\sigma\le\tfrac{1}{2},\\[3pt]- ( \boldsymbol {I} - \mathrm {e} ^{ \boldsymbol {P} } )^{-1} ( \boldsymbol {I} - \mathrm {e} ^{(1-\sigma) \boldsymbol {P} } )&\text{for }\tfrac{1}{2} < \sigma\le1;\end{array} \right .$$
(4.19b)

cf. (3.5). In the derivation of (4.19b) we used that P commutes with g(P) for arbitrary g. The matrix G satisfies the relation \(\boldsymbol {G} ( \tfrac{1}{2} -; \boldsymbol {P} )- \boldsymbol {G} (\tfrac{1}{2} +; \boldsymbol {P} ) = \boldsymbol {I} \), implying that the diagonal entries are discontinuous at \(\sigma=\tfrac{1}{2} \) with jump 1, whereas the off-diagonal entries are continuous. By analogy with the scalar case, we replace in the integral representation (4.18) the source term s(x(σ)) by its upwind value s u,j+1/2, to be specified shortly, and evaluate the resulting integral exactly, to obtain the inhomogeneous numerical flux

$$ \boldsymbol {F}^\mathrm{i}_{j+1/2} = \Delta x \biggl(\frac{1}{2} \boldsymbol {I} - \boldsymbol {\mathcal {E}} W( \boldsymbol {P} ) \boldsymbol {\mathcal {E}} ^{-1} \biggr)\boldsymbol{s}_{\mathrm{u},j+1/2},$$
(4.20)

with W(P) defined in (4.6) with g(z)=W(z).

The upwind value of s is not trivial since different advection velocities are intertwined. Therefore, we first decouple system (4.1a) as follows

$$ \boldsymbol {\Lambda } \frac{\mathrm{ d} { \boldsymbol {\psi } }}{\mathrm{ d} {x}} - \frac{\mathrm{ d}^{2} { \boldsymbol {\psi } }}{\mathrm{ d} {x}^{2}} = ( \boldsymbol {\mathcal {E}} \boldsymbol {V} )^{-1} \boldsymbol{s} =: \tilde{\boldsymbol{s} },$$
(4.21a)

where ψ=V −1 φ, or written componentwise

$$ \lambda_{i} \frac{\mathrm{ d} {\psi_{i}}}{\mathrm{ d}{x}} -\frac{\mathrm{ d}^{2} {\psi_{i}}}{\mathrm{ d} {x}^{2}} = \tilde{s}_{i} \quad (i = 1,2, \ldots,m).$$
(4.21b)

From these scalar advection-diffusion-reaction equations for ψ i we conclude that the upwind values for \(\tilde{s}_{i}\) are \(\tilde{s}_{i, \mathrm {u} ,j+1/2} =\tilde{s}_{i,j}\) if λ i ≥0 and \(\tilde{s}_{i, \mathrm {u} ,j+1/2} = \tilde{s}_{i,j+1}\) if λ i <0, or alternatively,

$$ \tilde{s}_{i, \mathrm {u} ,j+1/2} = \frac{1}{2} \bigl( 1 +\mathrm{sgn}( \lambda_{i} ) \bigr) \tilde{s}_{i,j} +\frac{1}{2} \bigl( 1 - \mathrm{sgn}( \lambda_{i} ) \bigr)\tilde{s}_{i,j+1}.$$
(4.22)

Combining these relations in vector form, using the definition of sgn(Λ) in (4.6), we have

$$ \tilde{\boldsymbol{s} }_{\mathrm{u},j+1/2} = \frac {1}{2}\bigl( \boldsymbol {I} + \mathrm{sgn}( \boldsymbol {\Lambda } ) \bigr) \tilde{\boldsymbol{s} }_{j}+ \frac {1}{2} \bigl( \boldsymbol {I} - \mathrm{sgn}( \boldsymbol {\Lambda } ) \bigr) \tilde{\boldsymbol{s} }_{j+1}.$$
(4.23)

The upwind value of s is then given by \(\boldsymbol {s}_{\mathrm{u},j+1/2} = \boldsymbol {\mathcal {E}} \boldsymbol {V} \tilde{s}_{\mathrm{u},j+1/2}\), which can be expressed in terms of s j and s j+1 as follows

$$ \boldsymbol{s}_{\mathrm{u},j+1/2} = \frac{1}{2} ( \boldsymbol {I} + \boldsymbol {\sigma } ) \boldsymbol{s}_{j} + \frac{1}{2} ( \boldsymbol {I} - \boldsymbol {\sigma } )\boldsymbol{s}_{j+1}, \quad \boldsymbol {\sigma } = \boldsymbol {\mathcal {E}} \mathrm{sgn}( \boldsymbol {A} ) \boldsymbol {\mathcal {E}} ^{-1},$$
(4.24)

with the matrix sign function sgn(A) defined in (4.6).

To summarize, the numerical flux F j+1/2 is the superposition

$$ \boldsymbol {F}_{j+1/2} = \boldsymbol {F}_{j+1/2}^\mathrm{h} +\boldsymbol {F}_{j+1/2}^\mathrm{i},$$
(4.25)

with the homogeneous component \(\boldsymbol {F}_{j+1/2}^{\mathrm{h}} = \boldsymbol {f} _{j+1/2}^{\mathrm{h}}\) defined in (4.15), and the inhomogeneous component \(\boldsymbol {F}_{j+1/2}^{\mathrm{i}}\) defined in (4.20) and (4.24). This flux approximation is referred to as the complete flux (CF) scheme for systems, as opposed to the homogeneous flux (HF) scheme (4.15).

5 Extension to Time-Dependent Conservation Laws

In this section we present the extension of the complete flux scheme to time-dependent conservation laws. We follow the same approach as in [19] where the time-dependent scalar flux is introduced.

For the numerical flux F j+1/2 in (2.4) we have two options. First, we can simply take the stationary flux, henceforth referred to as the stationary complete flux (SCF) scheme. Alternatively, we can take into account φ/∂t if we determine the numerical flux from the following quasi-stationary BVP

(5.1a)
(5.1b)

Thus we have included the time derivative in the modified source term \(\hat{\boldsymbol{s} } := \boldsymbol{s} - \partial \boldsymbol {\varphi } /\partial t\). Repeating the derivation in the previous section, replacing s with \(\hat {\boldsymbol{s} }\), we obtain

$$ \boldsymbol {F}_{j+1/2} = \boldsymbol {F}_{j+1/2}^\mathrm{h} + \Delta x \biggl( \frac{1}{2} \boldsymbol {I} - \boldsymbol {\mathcal {E}} W( \boldsymbol {P} ) \boldsymbol {\mathcal {E}} ^{-1} \biggr) (\boldsymbol{s}_{\mathrm{u},j+1/2} - \dot{ \boldsymbol {\varphi } }_{\mathrm{u},j+1/2} ),$$
(5.2)

where \(\dot{ \boldsymbol {\varphi } }_{\mathrm{u},j+1/2}\) is the upwind value of φ(x j+1/2,t)/∂t, defined analogously to (4.24). This flux contains the upwind value of the time derivative and is referred to as the transient complete flux (TCF) scheme. Analogous to the stationary case, we conclude that inclusion of the time derivative is only of importance for dominant advection.

Combining the expression in (5.2) with the semi-discrete conservation law (2.4) we find

(5.3a)

where the coefficient matrices α, β etc. are defined by

(5.3b)

The equations in (5.3a)–(5.3b) define a block-tridiagonal implicit ODE system. Finally, we have to apply a suitable time integration method, for which we take the trapezoidal rule.

To conclude, we note that the computational cost of computing matrix functions g(P) is rather modest. More specifically, the computation of these matrix functions requires \(\mathcal {O} ( m^{3} )\) flops, usually for small integers m, which is negligible compared to the \(\mathcal {O} ( N m^{3} )\) flops required to solve a block-tridiagonal system of size Nm with block size m.

6 Numerical Examples

In this section we apply the flux approximation schemes from the previous sections to four model problems. The first two serve to verify the order of convergence of the discretization and the latter two relate to mixtures.

Example 1

(Stationary system with interior layer)

We solve the BVP

(6.1a)
(6.1b)

where the advection and the diffusion matrices U and \(\boldsymbol {\mathcal {E}} \) and the source term s are given by

(6.2)

respectively. We take u 1<0 and u 2>0 in agreement with the boundary conditions in (6.1b), i.e., x=1 is the inflow and x=0 the outflow boundary for φ 1, corresponding to the Dirichlet and Neumann boundary condition, respectively, and vice versa for φ 2. The source term has a sharp peak at \(x = \tfrac{1}{2}\), causing a steep interior layer, provided 0<ε≪1. Typical solutions of (6.1a)–(6.1b) are shown in Fig. 3.

Fig. 3
figure 3

Example 1, solutions of the BVP (6.1a)–(6.1b) for ε=10−8 (left) and ε=10−1 (right). Other parameter values are: u 1=−1, u 2=0.1, α=0.05, s max=103, φ 1,R=20 and φ 2,L=10

In order to handle the combination of Dirichlet and Neumann boundary conditions, say at x=0, we require the difference scheme to hold at the first grid point x 1=0, thus introducing the unknown φ 0 in the virtual grid point x 0=−Δx. We have to eliminate φ 0 using the boundary conditions at x=0. Applying the standard central difference approximation to dφ 1(0)/dx=0 and linear extrapolation to φ 2, we obtain the second order approximations φ 1,0=φ 1,2 and φ 2,0=2φ 2,Lφ 2,2, or written in matrix-vector form,

$$ \boldsymbol {\varphi } _{0} = \left(\begin{array}{c@{\quad}c}1 & 0 \\0 & -1\end{array} \right) \boldsymbol {\varphi } _{2} + 2 \varphi_{2,\mathrm{ L}} \begin{pmatrix}0 \\1\end{pmatrix}.$$
(6.3)

The boundary conditions at x=1 are treated in a similar way.

We consider the CF and HF numerical solutions for u 1=−1, u 2=0.1 and ε=10−8, i.e., advection dominated flow. In this case it is meaningful to compare the numerical solutions with the reduced solution φ r of (6.1a)–(6.1b), i.e., the solution with \(\boldsymbol {\mathcal {E}} =\boldsymbol{O}\) and the Neumann outflow boundary conditions omitted. Let hx be the grid size. To determine the accuracy of a numerical solution we compute the average discretization errors e i (h):=h||φ i φ r,i ||1 (i=1,2), where φ r,i denotes the ith component of the reduced solution restricted to the grid. Figure 4 shows e i (h) as a function of h for α=0.05 (strong coupling) and α=0.75 (weak coupling). From this figure it is clear that initially, on rather coarse grids, the discretization errors of both flux approximations are approximately the same, whereas for decreasing h the CF scheme is clearly more accurate. In fact, the CF numerical approximations show second order convergence behavior, whereas the HF solutions are only first order accurate.

Fig. 4
figure 4

Example 1, discretization errors for advection dominated flow for α=0.05 (left) and α=0.75 (right). Other parameter values are: u 1=−1, u 2=0.1, ε=10−8 and s max=103

Example 2

(Traveling waves)

We solve an initial boundary value problem (IBVP) for the advection-diffusion-reaction system (2.1) on the domain 0<x<1, t>0, where U and \(\boldsymbol {\mathcal {E}} \) are defined in (6.2) with −u 1=u 2=u (u>0) and where s is chosen such that the exact solution is given by

Initial and boundary conditions are chosen accordingly. Parameter values for the exact solution are: a 1=8π, b 1=4π, a 2=2a 1 and b 2=5b 1.

As an illustration, we compare the SCF and TCF numerical solutions in Fig. 5. Clearly, the SCF numerical solution is very dissipative, whereas the TCF solution is virtually not damped. This behavior is in agreement with [19], where it is shown that for dominant advection the scalar SCF scheme generally has a much larger dissipation error than the corresponding scalar TCF scheme.

Fig. 5
figure 5

Example 2, highly oscillatory numerical solutions at t=1, computed with the SCF (left) and TCF scheme (right). Parameter values are: u=1, ε=10−4, α=0.2 and Δxt=5×10−3

To determine the order of convergence of the SCF and TCF schemes we take Δxt=:h and compute the average discretization errors \(e_{i}(h) := h || \varphi_{i} - \varphi_{i}^{\ast} ||_{1}\) (i=1,2) at t=1, where \(\varphi_{i}^{\ast}\) denotes the ith component of the exact solution, restricted to the grid. Figure 6 shows the errors e 1(h) for ε=10−8 and α=0.1 (dominant advection and strong coupling) and for ε=10−2 and α=0.75 (dominant diffusion and weak coupling). In the former case, the TCF numerical solution displays second order convergence for h→0, whereas the SCF solution is very inaccurate due to excessive damping. In the latter case, both solutions show second order convergence behavior, although the TCF solution is the more accurate one.

Fig. 6
figure 6

Example 2, discretization errors of the SCF and TCF schemes for ε=10−8 and α=0.1 (left) and ε=10−2 and α=0.75 (right)

Example 3

(Dissociation of H2)

In this example we consider a model problem for multi-component diffusion in a gas mixture. The governing equations for the mass fractions y i of the constituent species can be written as [13]

$$\frac{\partial{}}{\partial{t}} ( \rho y_{i} ) + \nabla\!\boldsymbol {\cdot}\!\biggl( \rho\boldsymbol{v} y_{i} - \sum_{j}\varepsilon_{i j} \nabla y_{j} \biggr) = s_{i},$$

where ρ is the density and v the velocity of the mixture, ε ij are the elements of the diffusion matrix \(\boldsymbol {\mathcal {E}} \) Footnote 1 and s i are the source terms for the species. These equations describe the mass balance for each species and are coupled through the diffusion and the reaction terms.

The diffusion matrix relates the diffusive mass fluxes to the mass fraction gradients. Its derivation proceeds in the following steps; see [7, 13] for a detailed account. First, the Stefan-Maxwell equations have to be inverted to express the diffusion velocities in terms of the species mole fraction gradients. Second, the mole fraction gradients have to be converted to mass fraction gradients. Both steps require a regularization procedure; see e.g. [5, 7, 8]. As a result \(\boldsymbol {\mathcal {E}} = \boldsymbol {R} \widetilde{\boldsymbol {F}}^{-1} \widetilde{ \boldsymbol {M} }\) with R=diag(ρy i ), \(\widetilde{\boldsymbol {F}}\) the regularization of the friction matrix F, which relates the diffusion velocities to the mole fraction gradients, and \(\widetilde{ \boldsymbol {M} }\) the regularization of the matrix relating the mole fraction gradients to the mass fraction gradients. The regularized friction matrix is defined as \(\widetilde{\boldsymbol {F}} = \boldsymbol {F}+ \alpha \boldsymbol {y} \boldsymbol {y} ^{\mathrm{ T}}\) with α>0 a free parameter and y the vector containing all species mass fractions. The diffusion matrix is generally not symmetric.

Since the diffusion matrix and also the source term depend in a nonlinear way on the mass fractions we employ the following iteration scheme. We choose a constant initial guess for all species. From this we compute the diffusion matrix and the source term, determine the CF or HF-discretization scheme, solve the corresponding linear system and obtain a new approximation of the mass fractions. We repeat this procedure until convergence.

As a special case we consider the dissociation of H2 in a binary mixture of H (species 1) and H2 (species 2) governed by the reaction

$$2 \mathrm{H}_{2} \rightarrow2 \mathrm{H} + \mathrm{H}_{2}.$$

For this reaction, the source terms are given by

$$s_{1} = 2 K m_{1} \biggl( \frac{\rho y_{2}}{m_{2}}\biggr)^{2}, \qquad s_{2} = - K m_{2} \biggl(\frac{\rho y_{2}}{m_{2}} \biggr)^{2},$$

with m i (i=1,2) the mass of species i and K the reaction rate coefficient. The dependence of K on the temperature T is given by the Arrhenius expression

$$K(T) = C ( T/T_\mathrm{ ref} )^{\beta} \mathrm {e} ^{-T_\mathrm{a}/T},$$

with parameters C=6×10−16 m3s−1, β=0.073, T ref=1K and T a=5.3381×104 K. The density follows from the ideal gas equation of state which reads

$$\rho= \frac{p m}{ K_\mathrm{ b} T}, \qquad\frac{1}{m} = \frac {y_{1}}{m_{1}} +\frac{y_{2}}{m_{2}},$$

with p the pressure and K b Boltzmann’s constant.

We have computed the steady solution on a one-dimensional domain [0,L] (L=2×10−3 m), subject to the boundary conditions

$$y_{1}(0) = y_{1}(L) = 10^{-4}, \qquad y_{2}(0) = y_{2}(L) = 0.9999.$$

In this case the mass flux ρv=Const and a given parameter. In our numerical simulations we took the somewhat artificial temperature profile

$$T(x) = 6 \times10^{3} - 2 \times10^{4} \biggl(\frac{x}{L} - \frac{1}{2} \biggr)^{2}, \quad0 \le x \le L,$$

in order to create strong reaction terms in the center of the domain. In Fig. 7 we present the numerical solutions computed with the CF and HF schemes. We can distinguish an inflow region, a reaction zone and a boundary layer near x=L. The fine grid solutions differ very little, however for the coarse grid, the CF numerical solution is more accurate in the reaction zone than the HF solution, due to the inclusion of the inhomogeneous flux.

Fig. 7
figure 7

Example 3, mass fractions of H and H2 computed with Δx=10−2 (left) and Δx=10−1 (right). Parameter values are: ρv=2×103 kg/m2 s and p=5×106 Pa

Example 4

(System with stiff source term)

We solve the IBVP

(6.4a)
(6.4b)
(6.4c)

with U and \(\boldsymbol {\mathcal {E}} \) defined in (6.2). The reaction term can be interpreted as a model for the reaction

$$2 \mathcal{S}_{1} \stackrel{k_{1} = 1}{\longrightarrow}\mathcal{S}_{2} \stackrel{k}{\longrightarrow}\mathcal{S}_{3},$$

with φ i the mass fraction of species \(\mathcal{S}_{i}\) and with k 1=1 and k>1 the reaction rates of the first and second reaction, respectively. For k≫1 the second reaction proceeds much faster than the first one, and thus the system is stiff. As an illustration we show in Fig. 8 some numerical solutions of (6.4a)–(6.4c) computed with the TCF scheme. For k=1 the contribution of the source term is relatively small, and the solution is determined by the advection-diffusion balance defined by (6.4a). A boundary layer near x=1 starts to develop. On the other hand, for k=103, the source term is dominant, evidenced by the thin layer near x=0.

Fig. 8
figure 8

Example 4, numerical solution of IBVP (6.4a)–(6.4c) at t=0.2 for k=1 (left) and k=103 (right) computed with Δxt=5×10−3. Other parameter values are: u 1=u 2=1, ε=10−1 and α=0.2

7 Summary, Conclusions and Future Research

We have extended the complete flux scheme to advection-diffusion-reaction systems, including the coupling between the constituent equations in the (space) discretization. To derive the stationary scheme, we first determine an integral representation for the flux vector from a local system BVP for the entire system, including the source term vector. As a result, the flux vector consists of two parts, i.e., a homogeneous and an inhomogeneous flux, corresponding to the advection-diffusion operator and the source term vector, respectively. An alternative expression of the inhomogeneous flux in terms of the so-called Green’s matrix is given. Next, replacing the source term vector by its upwind value, we could derive the numerical flux, which obviously is also a superposition of a homogeneous and inhomogeneous part. The numerical flux is almost identical to its scalar counterpart, the major difference is that the Peclet number P should be replaced by the Peclet matrix P and the functions operating on P should be replaced by their matrix versions.

For time dependent problems, the flux should be computed from a quasi-stationary BVP containing the time derivative in the right hand side. As a consequence, the inhomogeneous flux also depends on the time derivative and the resulting semidiscretization is an implicit ODE system. The inclusion of source term and time derivative in the inhomogeneous flux turns out to be important for advection dominated problems.

Extensions of the scheme we have in mind are the following. First, for nonsmooth, time-dependent problems the complete flux scheme might generate spurious oscillations due to large dispersion errors [19]. This is a shortcoming that should be remedied by applying some form of damping, or possibly, applying (W)ENO reconstruction [16]. Second, extension to two and three-dimensional problems is required; see [18] where the two-dimensional scalar scheme is discussed. Third, we can combine the integral representation of the flux with Gauss quadrature rules to derive higher order schemes; see [1] for the scalar flux. Finally, we will apply the scheme to more problems from continuum physics, like the simulation of plasmas or laminar flames governed by multi-species diffusion. A first effort in this direction is presented in [13, 21] where the homogeneous flux approximation is applied to the numerical simulation of plasmas.