1 Introduction

Interfaces with discontinuous conditions are present in many applications involving wave propagation through different materials. Typical examples include problems governed by Maxwell’s equations [15, 19], as well as earthquake simulations with faults governed by the elastic wave equations [4, 10]. Discontinuous solutions involving jumps at shocks are also present in many non-linear problems [5, 14].

In this paper we study fundamental properties such as well-posedness, stability and conservation for a discontinuous linear advection equation which we use as a simplified model for the problems mentioned above. In our problem, the wave-speed changes at an interface separating two spatial domains. We also impose a time-independent jump-condition, which makes the solution discontinuous.

We extend the analysis in [2, 3, 7] for the case of identical velocities, by varying the parameters related to the wave-speed and the jump-condition in a controlled manner. We derive new and completely general conditions for well-posed, stable, conservative and non-conservative interface treatments.

The main focus of the analysis in on the relation between stability and conservation in a completely general mathematical setting. Spectral analysis is used in order to compare convergence properties of the spectra of the conservative and non-conservative semi-discrete operators. The convergence to the spectrum of the continuous problem is investigated with and without the use of artificial dissipation.

As our numerical approximation we use high-order finite difference methods based on Summation-By-Part (SBP) form [1, 12, 21]. The boundary and interface conditions are imposed using the Simultaneous-Approximation-Term (SAT) techniques [1, 3, 7]. For a comprehensive review of the SBP–SAT development so far, see [22].

The rest of the paper proceeds as follows. In Sect. 2 we study well-posedness and conservation properties of the continuous problem. Section 3 deals with the semi-discrete case. In Sect. 4 we discuss the relation between the stability and conservation conditions of the schemes. A spectral analysis is performed in Sect. 5. Numerical calculations and verifications are presented in Sect. 6. Finally, in Sect. 7, we summarize the findings and draw conclusions.

2 The discontinuous interface problem

Consider the Cauchy problem for the advection equation with two different real constant advection velocities

$$\begin{aligned} \begin{array}{r l l c} u_t+a u_x &{} = &{} 0, &{} \quad x\le 0,\;t\ge 0, \\ u_t+b u_x &{} = &{} 0, &{} \quad x>0,\;t\ge 0, \\ u(x,0) &{} = &{} f(x), &{} \quad x\in \mathbf {R},\;t=0.\end{array} \end{aligned}$$
(2.1)

Without loss of generality we assume that a and b are positive (opposite signs for the velocities decouples the domains). Continuous solutions of (2.1) at the interface point \(x=0\) require

$$\begin{aligned} \lim _{x\rightarrow 0^+}u(x,t) := u^+(0,t)=u^-(0,t)=: \lim _{x\rightarrow 0^-}u(x,t),\qquad t\ge 0. \end{aligned}$$

However this is a specific choice among many possible coupling conditions. We will consider the more general case

$$\begin{aligned} u^+(0,t)=c u^-(0,t),\qquad t\ge 0, \end{aligned}$$
(2.2)

where c is a real constant which makes the solution discontinuous at the interface whenever \(c \ne 1\).

2.1 Well-posedness

We divide problem (2.1) into the following two coupled problems:

$$\begin{aligned}&\begin{array}{rllll} u_t+a u_x &{} = &{} 0, &{} \qquad \;\;\; x \le 0,\; t\ge 0, \\ u(x,0) &{} = &{} f_l(x), &{} \qquad \;\;\; x \le 0, \end{array} \end{aligned}$$
(2.3)
$$\begin{aligned}&\begin{array}{rllll} v_t+b v_x &{} = &{} 0, &{} \quad x>0,\; t\ge 0, \\ v(x,0) &{} = &{} f_r(x), &{} \quad x>0,\; \\ v(0,t) &{} = &{} c u(0,t), &{} \quad t\ge 0, \end{array} \end{aligned}$$
(2.4)

and define the following norm

$$\begin{aligned} ||u,v ||^2_{\alpha _c}=||u||^2+\alpha _c||v||^2. \end{aligned}$$
(2.5)

Here, \(\alpha _c\) is a positive free weight and \(||\cdot ||\) indicate the standard \(L^2-\)norm.

Our first result is

Proposition 2.1

The coupled problem (2.3)–(2.4) is well-posed for any real constant c and advection velocities satisfying sgn(a) = sgn(b).

Proof

The problem (2.3)–(2.4) is well-posed if a solution exists, is unique and has a bounded temporal growth. See [8, 17, 20] for more details about well-posedness. We apply the energy method by multiplying both sides of Eqs. (2.3) and (2.4) with u and v, respectively. By considering only the boundary terms at the interface, integration by parts leads to

$$\begin{aligned} \dfrac{d}{dt}||u,v||^2_{\alpha _c}= u(0,t)^2(- a+\alpha _c b c^2). \end{aligned}$$
(2.6)

In order to obtain an energy estimate we require that \(- a+\alpha _c b c^2\le 0,\) which gives

$$\begin{aligned} 0< \alpha _c\le a/b c^2. \end{aligned}$$
(2.7)

Time-integration of (2.6) with condition (2.7) leads to

$$\begin{aligned} ||u, v||^2_{\alpha _c } \le ||f_l ||^2 + \alpha _c||f_r ||^2. \end{aligned}$$
(2.8)

Uniqueness of the solution can be proved by using the same technique. Suppose that two pairs of solutions of (2.3)–(2.4), exist with the same boundary and initial data, namely \(u^{(1)},v^{(1)}\) and \(u^{(2)},v^{(2)}\). By linearity of the problem, the functions \(\bar{u}=u^{(1)}-u^{(2)}\) and \(\bar{v}=v^{(1)}-v^{(2)}\) are also a solution pair of (2.3)–(2.4) with homogeneous boundary, interface and initial conditions. Using the energy-estimate (2.8) with zero data we find \((\bar{u},\bar{v})\equiv (0,0)\), i.e. the solution of (2.3)–(2.4) is unique.

Existence can be proved by using the Laplace transform technique for the initial boundary value problem, see [9, 11, 18] for details. The Laplace transform of the coupled problem (2.3)–(2.4) is

$$\begin{aligned} \begin{array}{l} s\hat{u}+a\hat{u}_x = f_l(x) \\ s\hat{v}+b\hat{v}_x = f_r(x) \\ \hat{v}(0,s) = c\hat{u}(0). \end{array} \end{aligned}$$
(2.9)

The general solutions of (2.9) are \( \hat{u}=\hat{u}_h+\hat{u}_p\text { and } \hat{v}=\hat{v}_h+\hat{v}_p, \) where \(\hat{u}_h=c_l(s)e^{-\frac{s}{a}x}\) and \(\hat{v}_h=c_r(s)e^{-\frac{s}{b}x}\) are the general solutions of the homogeneous problems. \(\hat{u}_p=\hat{u}_p(f_l(x))\) and \(\hat{v}_p=\hat{v}_p(f_r(x))\) are the particular solutions determined by the initial data, which we consider as known. To determine \(c_l\) and \(c_r\), we also need to introduce a boundary condition for the left equation. We choose \(u(-1,t)=g(t)\) which in Laplace space becomes \(\hat{u}(-1,s)= \hat{g}\). Then the boundary and interface conditions can be written in matrix-vector form as

$$\begin{aligned} E(s)\underline{c}=\left[ \begin{array}{ll} e^{\frac{s}{a}} &{} 0 \\ c &{} -1 \end{array}\right] \left[ \begin{array}{l} c_l\\ c_r \end{array}\right] = \left[ \begin{array}{l} \hat{u}_p(-1) - g \\ c\hat{u}_p(0) - \hat{v}_p(0) \end{array}\right] . \end{aligned}$$
(2.10)

Solving the non-singular linear system (2.10) gives

$$\begin{aligned} \begin{array}{cl} \hat{u}(x,s) &{} = \left( \hat{g}-\hat{u}_p(-1,s)\right) e^{-\frac{s}{a}(x+1)}+\hat{u}_p(x,s)\\ \hat{v}(x,s) &{} = \left[ c\left( \hat{g}-\hat{u}_p(-1,s)\right) e^{-\frac{s}{a}}+\left( c\hat{u}_p(0,s) -\hat{v}_p(0,s)\right) \right] e^{-\frac{s}{b}x}+\hat{v}_p(x). \end{array} \end{aligned}$$

Finally, by taking the inverse Laplace transform of \(\hat{u}\) and \(\hat{v}\), which can be done since no singularities exist, we have proved existence. This concludes the proof. \(\square \)

2.2 Conservation

The conservation properties of the coupled problem (2.3)–(2.4) can be discussed in the context of conservation laws, see [5, 14] for a complete description. A conservation law in one space dimension is defined as

$$\begin{aligned} \begin{array}{rll} w_t+F(w)_x= & {} 0, \end{array}\qquad \begin{array}{lll} x\in & {} \mathbf {R},\;t>0. \end{array} \end{aligned}$$
(2.11)

Here F is the flux function and \(w=w(x,t)\) is the unknown variable. In a conservation law the total quantity of w in \(R=[x_1,x_2]\) changes only as a result of the fluxes at the boundaries of the region. More precisely, the evolution of the total quantity is given by

$$\begin{aligned} \dfrac{\partial }{\partial t}\int _R w(x,t) dx = -F(w(x_2,t)) + F(w(x_1,t)), \quad \forall t>0. \end{aligned}$$
(2.12)

If the right hand side in (2.11) is identically zero, then the total quantity does not change in time and w is conserved in the region R. With a slight abuse of notation, we say that w is conserved even if the fluxes do not balance out. This case is the only practically interesting one.

From (2.11), conservation can be interpreted as the property of the flux to “telescope” across a domain to the boundaries. This property does not necessarily exist in the presence of an interface, as we will show later.

Motivated by the fact that the coupled problem (2.3)–(2.4) is a linear version of a conservation law with the flux given by

$$\begin{aligned} F(w) =\left\{ \begin{array}{llc} a u, &{}&{} x\le 0,\; t\ge 0, \\ b v, &{}&{} x> 0,\; t\ge 0, \end{array}\right. \quad \text {where}\quad w=\left\{ \begin{array}{llc} u , &{}&{} x\le 0, \\ v , &{}&{} x> 0, \end{array}\right. \end{aligned}$$
(2.13)

we reformulate (2.3)–(2.4) as (2.11) with F defined by (2.13). Following the concept of conservation described by (2.12), we integrate (2.11) in space between \([x_1,0]\) and \([0,x_2]\) and get

$$\begin{aligned} \frac{\partial }{\partial t}\int _R w(x,t) dx = -F(w(x_2,t)) + F(w(x_1,t)) + u(0,t)[a-bc], \quad \forall t>0. \quad \end{aligned}$$
(2.14)

In (2.14), we replace v by u at \(x=0\) using (2.2). Hence, in the presence of an interface, the total quantity of w is conserved in \(R=[x_1,x_2]\) in the sense of (2.11) if the last term on the right hand side is zero. We summarize the result in the following proposition.

Proposition 2.2

The solution to the conservation law (2.11) with the flux function defined in (2.13) is conserved if the jump condition satisfies

$$\begin{aligned} c=\dfrac{a}{b}. \end{aligned}$$
(2.15)

We conclude by defining a conservative interface problem:

Definition 2.1

The interface problem (2.3)–(2.4) is a conservative problem if the parameter \(a,\;b\) and c satisfy the jump condition (2.15).

3 The semi-discrete approximation

The spatial derivative is discretized using the technique based on SBP finite difference operators introduced in [12, 21, 22]. In this paper we use the standard SBP operator, even though more general formulations exist, see for instance [6] and references therein. To be consistent with the continuous case in the following analysis we will ignore the outer boundary terms. The first derivative in space is approximated using

$$\begin{aligned} u_x\approx D\mathbf u =P^{-1}Q\mathbf u , \end{aligned}$$
(3.1)

where \(\mathbf u =(\ldots ,u_i,\ldots )^T\) is the discrete grid function approximating the solution. P is a symmetric positive definite matrix, Q is almost skew-symmetric and satisfies the SBP property \(Q+Q^T=\) diag\([-1,0,\ldots ,0,1]\). From now on we indicate the difference operator with \(P^{-1}_{l,r}Q_{l,r}\), where the subscripts l and r refer to the left and right spatial intervals, respectively. We also introduce the grid vectors \(\mathbf x _l=[\ldots ,x_i,\ldots ,x_N=0]\) and \(\mathbf x _r=[y_0=0,\ldots ,y_i,\ldots ]\), that coincide at the interface point, \(x_N=y_0=0\).

With this notation we can write the approximation of the system (2.3)–(2.4) together with the SAT procedure [1, 2], for boundary and interface conditions as

$$\begin{aligned} \begin{array}{ccl} \mathbf u _t+a P^{-1}_lQ_l\mathbf u &{} = &{} P^{-1}_l\sigma _{L}(c u_N-v_0)e_N, \\ \mathbf v _t+b P^{-1}_rQ_r\mathbf v &{} = &{} P^{-1}_r\sigma _{R}(v_0-cu_N)e_0, \end{array} \end{aligned}$$
(3.2)

where, the vectors \(\mathbf u \) and \(\mathbf v \) indicate the solution in the left and right domain, respectively. The vectors \(e_N=(0,\ldots ,0,1)^T\) and \(e_0=(1,0,\ldots ,0)^T\) have the length of the left and right mesh, respectively. Note that \(v_0\approx c u_N\).

Remark 1

The penalty term defined by the coefficient \(\sigma _L\) determines the amount of dissipation at the interface [2]. It can vary in a range of values which guarantee stability at the interface and provide different levels of dissipation.

3.1 Stability of the semi-discrete approximation

Similarly to the continuous case, we consider two discrete \(L^2\) norms

$$\begin{aligned} ||\mathbf w ||_{P_l}^2=w^TP_lw,\qquad ||\mathbf w ||_{P_r}^2=w^TP_rw \end{aligned}$$

and combine them to form the following norm

$$\begin{aligned} ||\mathbf u,v ||_{\alpha _d}^2= ||\mathbf u ||_{P_l}^2+\alpha _d||\mathbf v ||_{P_r}^2. \end{aligned}$$
(3.3)

In (3.3), \(\alpha _d\) is a positive weight [not necessarily the same as in the continuous norm (2.5)]. We multiply both sides of (3.2) with \(\mathbf u ^T P_l\),\(\mathbf v ^T P_r\) respectively and add the corresponding transposes. From the SBP properties of the discrete operators, we obtain

$$\begin{aligned} \dfrac{\mathrm {d}}{\hbox {d}t} ||\mathbf u,v ||_{\alpha _d}^2 =\text { IT}, \end{aligned}$$
(3.4)

where

$$\begin{aligned} \text {IT}=u_N^2(-a+2c \sigma _{L}) + v_0^2\alpha _d(b+2\sigma _{R}) - 2\sigma _{L}u_n v_0-2\alpha _d\sigma _{R}c u_0v_N . \end{aligned}$$

Next, we rewrite IT as a quadratic form given by

$$\begin{aligned} \text {IT}=\left( \begin{array}{l} u_N \\ v_0 \end{array}\right) ^T H \left( \begin{array}{l} u_N \\ v_0 \end{array}\right) , \quad H=\left[ \begin{array}{ll} (-a+2c\sigma _{L})&{}\quad -(\sigma _{L}+\alpha _dc\sigma _{R})\\ -(\sigma _{L}+\alpha _dc\sigma _{R})&{}\quad \alpha _d(b+2\sigma _{R}) \end{array}\right] . \end{aligned}$$
(3.5)

We have IT \(\le 0\) if H is a negative semi-definite matrix. Hence, we need conditions on \(\sigma _{L}\) and \(\sigma _{R}\) such that this is ensured. The characteristic equation related to (3.5) is

$$\begin{aligned} \det (H-\lambda I)=\lambda ^2-\lambda (h_{11}+h_{22}) +(h_{11} h_{22}-h_{12}^2)=0, \end{aligned}$$

where \(h_{ij}\), in which \(i,j\in \{1,2\}\), are the elements of H. By the properties of solutions to quadratic equations, we know that

$$\begin{aligned} h_{11}+h_{22}=\lambda _1+\lambda _2, \qquad (h_{11} h_{22}-h_{12}^2)=\lambda _1\lambda _2. \end{aligned}$$

Then \(\lambda _{1,2}\le 0\) if and only if \(h_{11}+h_{22}\le 0\) and \((h_{11} h_{22}-h_{12}^2)\ge 0\). We summarize the results as

Proposition 3.1

The semi-discrete scheme (3.2) for the coupled advection equations (2.3)–(2.4) has a stable interface treatment, with respect to the norm (3.3), when the penalty coefficients \(\sigma _{L,R}\) satisfy the inequalities

$$\begin{aligned} \begin{array}{r l l} (-a+2c\sigma _{L})+\alpha _d(b+2\sigma _{R})&{}\le &{} 0,\\ (-a+2c\sigma _{L})\alpha _d(b+2\sigma _{R})-(\sigma _{L}+\alpha _dc\sigma _{R})^2&{}\ge &{} 0.\end{array} \end{aligned}$$
(3.6)

Remark 2

In the continuous case, well-posedness is proved in Proposition 2.1 by using a modified \(L^2\) norm defined by the weight \(\alpha _c\). Similarly, in the semi-discrete case, the stability conditions depend on the weight \(\alpha _d\) which defines the discrete \(L^2\) norm used for the energy method in (3.4). In Sect. 4, we derive explicit stability intervals for \(\sigma _{L,R}\) from (3.6) using values of \(\alpha _d\) that renders them real.

3.2 Conservation properties of the semi-discrete approximation

The semi-discrete form of the conservation law (2.11) is

$$\begin{aligned} \mathbf w _t+P^{-1}Q F(\mathbf w )=0, \end{aligned}$$
(3.7)

where the variable \(\mathbf w =(\ldots ,w_i,\ldots )^T\) and the flux \(F(\mathbf w )=(\ldots ,F_j,\ldots )^T\) are vectors. The spatial derivative of the flux has been replaced by an SBP operator of type (3.1). Multiplying (3.7) by \(\mathbf 1 ^T P\), where \(\mathbf 1 ^T=(1,1,\ldots ,1,1)\), (the discrete analogous of spatial integration), we obtain

$$\begin{aligned} \mathbf 1 ^T P \mathbf w _t+ \mathbf 1 ^T (Q F)= & {} \dfrac{d}{dt}\left( \mathbf 1 ^T P \mathbf w \right) +\mathbf 1 ^T ( Q F)\nonumber \\= & {} \dfrac{d}{dt}\left( \mathbf 1 ^T P \mathbf w \right) + \mathbf 1 ^T ([-Q^T+B] F)=0. \end{aligned}$$
(3.8)

Here, \(B=(Q+Q^T)\) and \(B=\text {diag}[-1,0,\ldots ,0,1]\). Since \(\mathbf 1 ^T Q^T=0\), (3.8) yields

$$\begin{aligned} \dfrac{d}{dt}\left( \mathbf 1 ^T P \mathbf w \right) = -F_N + F_0, \end{aligned}$$
(3.9)

where \(F_0\) and \(F_N\) are the discrete fluxes at the boundaries. Note that \((\mathbf 1 ^T P \mathbf w )\approx \int _{x_1}^{x_2}w\;dx\), i.e. it is a high order accurate approximation of the integral in (2.12). This means that relation (3.9) implies that \((\mathbf 1 ^T P \mathbf w )\) is conserved. It also shows that the properties of P and Q matrices mimic the conservation property of the continuous differential operator in a domain without interface.

Unfortunately, the equivalence of the conservation property of the continuous and semi-discrete operators does not necessarily apply at an interface coupling [2, 3, 7]. More precisely, the approximation (3.2) requires additional conditions to be conservative in the sense of (3.9).

We follow the path of the continuous analysis in Sect. 2.2 by considering the vector functions \(\mathbf u ^T=(u_0,\ldots ,u_N)\) and \(\mathbf v ^T=(v_0,\ldots ,v_M)\) evaluated on the discrete regions \(\mathbf x _l=[x_0,..,x_N]\) and \(\mathbf y =[y_0,..,y_M]\), where \(x_N=y_0\). Multiplying the equations in (3.2) by the \(\mathbf 1 ^TP_l\) and \(\mathbf 1 ^TP_r\), respectively, leads to

$$\begin{aligned} \begin{array}{c c c} \mathbf 1 ^TP_l\mathbf u _t+a\mathbf 1 ^TQ_l\mathbf u &{}=&{}\sigma _{L}(c u_N-v_0),\\ \mathbf 1 ^TP_r \mathbf v _t+b\mathbf 1 ^TQ_r\mathbf v &{}=&{}\sigma _{R}(v_0-cu_N). \end{array} \end{aligned}$$
(3.10)

Using again \(B_{l,r}=(Q_{l,r}+Q_{l,r}^T)\) and \(Q_{l,r}\mathbf 1 =0\), we rewrite (3.10) as

$$\begin{aligned} \begin{array}{c c c} \mathbf 1 ^TP_l\mathbf u _t = -a(u_N-u_0) +\sigma _{L}(c u_N-v_0), \\ \mathbf 1 ^TP_r \mathbf v _t = +b(v_0+v_N) +\sigma _{R}(v_0-cu_N). \end{array} \end{aligned}$$

Rearranging the terms on the right hand side and adding the equations, we obtain

$$\begin{aligned} \begin{array}{l l} \mathbf 1 ^T P_l\mathbf u _t + \mathbf 1 ^T P_r \mathbf v _t= a u_0 - b v_M+ \left[ u_N (-a+c\sigma _{L}-c\sigma _{R})+ v_0 (b+\sigma _{R}-\sigma _{L})\right] . \end{array} \end{aligned}$$
(3.11)

Similarly to the continuous case, we indicate with \(\mathbf w ^T=(\mathbf u ^T,\mathbf v ^T)\) the discrete variable and \(\mathbf F ^T=(a\mathbf u ^T,b\mathbf v ^T)\) the discrete flux of (3.2). Then, (3.11) becomes

$$\begin{aligned} \begin{array}{l l} \mathbf 1 ^T P \mathbf w _t= F_0 - F_M+ \left[ u_N (-a+c\sigma _{L}-c\sigma _{R})+ v_0 (b+\sigma _{R}-\sigma _{L})\right] , \end{array} \end{aligned}$$
(3.12)

where \(P=\text {diag} \left( P_l , P_r\right) \). The quantity \((\mathbf 1 ^T P \mathbf w )\) in (3.12) is conserved in the sense of (3.9) if the interface terms at the points \(x_N\) and \(y_0\) vanish, which require

$$\begin{aligned} -a+c\sigma _{L}-c\sigma _{R}= 0 \quad \text {and} \quad b+\sigma _{R}-\sigma _{L}=0 \end{aligned}$$
(3.13)

We have proved

Proposition 3.2

The quantity \((\mathbf 1 ^T P \mathbf w )\) is conserved by the approximation (3.2) in the region \(\mathbf x =[\mathbf x _r,\mathbf x _r]\) if the jump condition satisfies the condition (2.15) and

$$\begin{aligned} \sigma _{R}=\sigma _{L}-b. \end{aligned}$$
(3.14)

In the rest of the paper we will use the following definition of conservative scheme for the interface problem (2.3)–(2.4).

Definition 3.1

The semi-discrete scheme (3.2) with the continuous conservation condition (2.15) is a conservative approximation of the coupled problem (2.3)–(2.4) in the sense of (3.9) if the penalty coefficients \(\sigma _L\) and \(\sigma _R\) satisfy the condition (3.14).

Remark 3

Semi-discrete conservation for our problem requires a conservative continuous problem, since otherwise the system (3.13) has no solution. This is natural since any other result would have suggested an error of order one.

4 The relation between stability and conservation

In Sect. 2 we have shown well-posedness and derived the conservation condition for the interface problem (2.3)–(2.4) in the continuous case. In Sect. 3 we have derived stability and conservation conditions for the semi-discrete approximation of the same problem. All conditions are summarized below:

The continuous case:

  • well-posedness \(\quad \forall c\in \mathbb {R}\quad \text { (A1)},\)

  • conservation \( \;\;\quad \quad c=a/b\quad \text { (A2)}\),

The semi-discrete case:

  • \(\text {stability }\quad \begin{array}{r l l} (-a+2c \sigma _{L})+\alpha _d(b+2\sigma _{R})&{}\le &{} 0,\quad \text {(B1.a)} \\ (-a+2c \sigma _{L})\alpha _d(b+2\sigma _{R}) -(\sigma _{L}+\alpha _dc\sigma _{R})^2&{}\ge &{} 0,\quad \text {(B1.b)} \end{array}\)

  • conservation \(\qquad \qquad \qquad \qquad \qquad \quad \; \sigma _{R}-\sigma _{L}+b\;\;=\;\;0.\quad \text {(B2)}\)

We recall that problem (2.3)–(2.4) is well-posed since (A1) always holds. The semi-discrete approximation (3.2) is stable with respect to the norm (3.3) when (B1.a–b) are both satisfied. The approximation is stable and conservative if (B2) holds together with (B1.a–b). In this section we derive explicit conditions for \(\sigma _{L,R}\) from (B1.a–b) as functions of the weight \(\alpha _d\) in the norm (3.3) for different type of problems and approximations.

4.1 The non-conservative interface problem

We start by considering the most general well-posed interface problem and investigate stability without conservation. To have (B1.a) valid at the same time as (B1.b), we require \((-a+2c \sigma _{L})\le 0\) and \((b+2\sigma _{R})\le 0\). This leads to

$$\begin{aligned} \sigma _{L}\le \frac{a}{2c}\quad (a)\qquad \text {and}\qquad \sigma _{R}\le \frac{-b}{2}\quad (b). \end{aligned}$$
(4.1)

Remark 4

(B1.a) is also satisfied for \( \left| (-a+2c\sigma _{L})\right| \le - \left| \alpha _d(b+2\sigma _{R})\right| \) but then (B1.b) cannot hold.

By adopting the variable \(\theta = 1/(\alpha _d c)\), (B1.b) can be rewritten as the following second order inequality

$$\begin{aligned} -\theta ^2 \sigma _{L}^2+2\theta ( b +\sigma _{R})\sigma _{L} +\left[ -\theta \frac{a b}{c}-2 \theta \frac{a }{c} \sigma _{R}-\sigma _{R}^2 \right] \ge 0. \end{aligned}$$
(4.2)

The inequality (4.2) can be associated to a second order equation for \(\sigma _{L}\) which is well-defined when the discriminant \((b+2\sigma _{R})\left( b-\theta a/c\right) \) is non-negative. According to (4.1), this is true when \(\left( b-\theta a/c\right) \le 0\). Since the weight \(\alpha _d\) is a positive free parameter we can always make the choice \(\alpha _d\le a/ b c^2\) such that \(\theta \ge b c /a\) holds. Then, the inequality (4.2) is valid for

$$\begin{aligned} \frac{b+\sigma _{R}-\sqrt{(b+2\sigma _{R})(b-\theta \left( \frac{a}{c}\right) )}}{\theta } \le \sigma _{L}\le \frac{b+\sigma _{R}+\sqrt{(b+2\sigma _{R})\left( b-\theta \left( \frac{a}{c}\right) \right) }}{\theta }. \end{aligned}$$
(4.3)

Next, we must compare (4.1.a) and (4.3) by letting \(\sigma _{R}= -b/2 -k/2\) with \(k\ge 0\). We find

$$\begin{aligned} \dfrac{a}{2c} -\dfrac{b+\sigma _{R} + \sqrt{(b+2\sigma _{R})(b-\theta (\frac{a}{c}))}}{\theta } = \dfrac{\left( \theta \dfrac{a}{c}-b\right) +k - 2\sqrt{k\left( \theta \dfrac{a}{c}-b\right) }}{2\theta } \ge 0, \end{aligned}$$

where we have used that \(x+y \ge 2\sqrt{x y}\) for any \(x,y\ge 0.\)

We conclude that conditions (4.1.b) and (4.3) are the relevant conditions and summarize the result in

Proposition 4.1

The semi-discrete approximation (3.2) is stable with respect to the norm (3.3) defined by \(0<\alpha _d\le a/ b c^2\) and for all parameters ab and c when the penalty coefficients \(\sigma _{L},\sigma _{R}\) satisfy (4.1.b) and (4.3) with \(\theta \ge b c /a\).

Remark 5

The values of \(\alpha _d\) for which it is possible to derive real expressions for \(\sigma _{L,R}\) from the stability conditions (3.6), are the same ones needed in (2.7) for showing well-posedness in the continuous case. This makes the stability results of Proposition 4.1 consistent with the well-posed analysis of Proposition 2.1.

4.2 The conservative continuous and non-conservative semi-discrete problem

Consider now the stability analysis for a conservative continuous interface problem by assuming that also condition (A2) is valid. Then, by letting \(c\rightarrow a/b\), (4.1.b) remains unchanged while (4.3) becomes

$$\begin{aligned} \begin{array}{l l} \dfrac{b+\sigma _{R} - \sqrt{b(b+2\sigma _{R})(1-\theta )}}{\theta } \le \sigma _{L} \le \dfrac{b+\sigma _{R} + \sqrt{b(b+2\sigma _{R})(1-\theta )}}{\theta }. \end{array} \end{aligned}$$
(4.4)

In (4.4) we have used \(\theta = b/(a\alpha _d)\). As in Sect. 4.1, we can always choose \(\alpha _d\le b/a\) such that \(\theta \ge 1\) holds. In particular if \(\alpha _d = b/a\) then \(\theta = 1\) and (4.4) becomes identical to (B2), i.e. the discrete conservation condition.

We have proved

Proposition 4.2

The continuous conservation condition (A2) leads to a stable semi-discrete approximation with respect to the norm (3.3) defined by \(0<\alpha _d\le b/ a\), if the penalty parameters \(\sigma _{L},\sigma _{R}\) satisfy (4.1.b) and (4.4) with \(\theta \ge 1\).

Remark 6

Note that conservation and stability are two independent properties of the approximation (3.2). We have a stable and non-conservative semi-discretization if the assumptions of Proposition 4.2 are satisfied.

4.3 The conservative continuous and semi-discrete problem

Consider the fully conservative case by assuming that (A2) and (B2) are both valid. Then (B1.a) leads to

$$\begin{aligned} \sigma _{L}\le \dfrac{b}{2}. \end{aligned}$$
(4.5)

By substituting (A2), (B2) and (4.5) into (B1.b) and following the same techniques as in the previous section, we obtain

$$\begin{aligned} \dfrac{b}{1-\sqrt{\theta }}\le \sigma _{L}\le \dfrac{b}{1+\sqrt{\theta }}, \end{aligned}$$
(4.6)

where \(\theta =b/a\alpha _d.\) We can again choose \(\alpha _d\le b/a\) such that \(\theta \ge 1\) holds. Note that as \(\theta \rightarrow 1^+\), (4.6) converges from below to (4.5). Again (4.6) is more strict than (4.5). We have proved

Proposition 4.3

The conditions (A2), (B2) and (4.6) with \(\theta \ge 1\) lead to a conservative scheme and stable approximation with respect to the norm (3.3) defined by \(0<\alpha _d\le b/ a\).

Remark 7

The choice \(\theta =1\) makes (4.6) identical to (4.5), which becomes the only relevant stability condition.

4.4 The special case with continuous velocities

The result for a continuous advection velocity follows directly by going to the limit \(b\rightarrow a\) in (4.1.b) and (4.3). Thus, we get

$$\begin{aligned} \sigma _{R}\le \frac{-a}{2} \end{aligned}$$
(4.7)

and

$$\begin{aligned} \begin{array}{l l} \dfrac{a+\sigma _{R}-\sqrt{a(a+2\sigma _{R})(1-\frac{\theta }{c})}}{\theta } \le \sigma _{L}\le \dfrac{a+\sigma _{R}+\sqrt{a(a+2\sigma _{R})(1-\frac{\theta }{c})}}{\theta }, \end{array} \end{aligned}$$
(4.8)

respectively, with \(\theta =1/(\alpha _dc)\) and \(\alpha _d\le 1/ c^2\). Furthermore, when \(c= 1\) then \(\alpha _d=\theta =1\) and (4.8) becomes \( \sigma _{L}=\sigma _{R}+a, \) which is the conservation condition (B2) for a constant advection velocity derived in [2, 3, 7].

5 Spectrum analysis for stability at the interface

In this section we study the effect of the interface treatment on the continuous and semi-discrete spectra. First, we restrict the problem to a finite domain for enabling the numerical computations which will be presented in Sect. 6. This restriction requires the introduction of boundary conditions which we choose such that the dissipative effect on the outer boundaries is negligible with respect to the interface treatment in the semi-discrete approximation. In the rest of the section we derive the spectrum of the continuous and semi-discrete problem using the derived non-dissipative boundary conditions.

5.1 Non-dissipative semi-discrete boundary conditions

Consider the discontinuous interface problem (2.3)–(2.4). To calculate the spectrum of the problem we must restrict ourselves to a finite spatial domain. Without any loss of generality, we choose \([-1,1]\). To isolate the effect of the interface treatment, we introduce a boundary closure of the form

$$\begin{aligned} u(-1,t)=d v(1,t),\qquad t\ge 0, \end{aligned}$$
(5.1)

where the scalar d has to be chosen such that the dissipative effect of the outer boundary terms is removed.

Consider the SBP–SAT approximation of (2.3)–(2.4), including condition (5.1)

$$\begin{aligned} \begin{array}{c c l} \mathbf u _t+a P^{-1}_lQ_l\mathbf u &{}=&{} P^{-1}_l\left[ \sigma _{BL}(u_0-d v_N)e_0 + \sigma _{L}(c u_N-v_0)e_N\right] ,\\ \mathbf v _t+b P^{-1}_rQ_r\mathbf v &{}=&{} P^{-1}_r\left[ \sigma _{BR}(d v_N-u_0)e_N + \sigma _{R}(v_0-c u_N)e_0\right] . \end{array} \end{aligned}$$
(5.2)

Now the discrete energy method leads to

$$\begin{aligned} \begin{array}{l l} \dfrac{d}{d t}||\mathbf u ,\mathbf v ||_{\alpha _d}^2= \text {IT }+ \text {BT}, \end{array} \end{aligned}$$

where IT is equal to the previously analyzed (3.5) and

$$\begin{aligned} \text {BT}=u_0^2(a+2\sigma _{BL}) -2 u_0 v_N \left( d\sigma _{BL} + \alpha _d\sigma _{BR} \right) + v_N^2 \alpha _d (-b +2d\sigma _{BR}). \end{aligned}$$

With the choice

$$\begin{aligned} \sigma _{BL}= -\dfrac{a}{2}, \quad \sigma _{BR} = \dfrac{1}{2}\dfrac{b}{d}\quad \text {and} \quad d=\sqrt{\alpha _d\left( \dfrac{b}{a}\right) }, \end{aligned}$$
(5.3)

we obtain BT \(=\) 0. This implies that the boundary terms do not influence the semi-discrete energy estimate.

5.2 The spectrum of the continuous and semi-discrete operator

To determine the spectrum of the continuous operator of (2.3)–(2.4), we use the Laplace transform as in [9, 11, 18]. The initial conditions are omitted since they do not contribute to the spectral analysis. We obtain

$$\begin{aligned} \begin{array}{c c c c c} s\hat{u}+a\hat{u}_x = 0,&\; -1\le x\le 0&\text { and }&s\hat{v}+b\hat{v}_x = 0,&\; 0< x \le 1, \end{array} \end{aligned}$$

which have the general solutions

$$\begin{aligned} \begin{array}{c c c} \hat{u}=c_l e^{-\frac{s}{a}x}&\text {and}&\hat{v}=c_r e^{-\frac{s}{b}x}. \end{array} \end{aligned}$$

The boundary and interface conditions lead to

$$\begin{aligned} E(s)\underline{c}=\left[ \begin{array}{ll} e^{\frac{s}{a}} &{} -d e^{-\frac{s}{b}} \\ c &{} -1 \end{array}\right] \left[ \begin{array}{l} c_l\\ c_r \end{array}\right] =0 . \end{aligned}$$
(5.4)

The system (5.4) has a non-trivial solution when the determinant of E(s) is zero, i.e. when \( det(E(s))=-e^{s/a}+c d e^{-s/b}=0.\) For \(c d\ne 0\) we get

$$\begin{aligned} s=\frac{a b}{a+b}\left[ log(|c d|)+2i\pi k\right] ,\quad k\in \mathbf {Z}. \end{aligned}$$
(5.5)

The infinite sequence (5.5) defines the spectrum of (2.3)–(2.4) in combination with (5.1). In particular

  • if \(|c d|=1\) then we have a purely imaginary spectrum,

  • if \(|c d|>1\) we have eigenvalues in the right half plane,

  • if \(|c d|<1\) we have eigenvalues in the left half plane.

Remark 8

We are interested in the non-growing cases for the continuous problem, i.e. the ones where \(|c d|\le 1\).

Remark 9

Note that the possibility of having a purely imaginary spectrum for the continuous problem is independent of the type of problem. Therefore, there exist combinations of boundary and interface conditions defined by the coefficients c and d which lead to \(|c d|=1\) both for conservative or non-conservative problems.

To determine the corresponding semi-discrete spectrum we rewrite (5.2) in matrix form as

$$\begin{aligned} \left( \begin{array}{l} \mathbf u \\ \mathbf v \end{array} \right) _t=P^{-1}\tilde{Q}\left( \begin{array}{l} \mathbf u \\ \mathbf v \end{array}\right) , \end{aligned}$$
(5.6)

where

$$\begin{aligned} P=\left[ \begin{array}{ll} P_l&{}\quad 0 \\ 0 &{} \quad P_r \end{array} \right] , \tilde{Q}=- Q_{{\varLambda }}+{\varSigma }\; \text { and }\; Q_{{\varLambda }}= \left[ \begin{array}{ll} a Q_l&{} \quad 0 \\ 0 &{} \quad b Q_r \end{array} \right] . \end{aligned}$$

The penalty matrix \({\varSigma }\), which is zero everywhere except at the boundary and interface points, is given by

$$\begin{aligned} {\varSigma }=\left[ \begin{array}{llllll} \sigma _{BL} &{} &{} &{} &{} &{} -d\sigma _{BL}\\ &{} \ddots &{} &{} &{} &{} \\ &{} &{} c\sigma _{L} &{} \quad -\sigma _{L} &{} &{} \\ &{} &{} -c\sigma _{R} &{} \quad \sigma _{R} &{} &{} \\ &{} &{} &{} &{} \ddots &{} \\ -\sigma _{BR} &{} &{} &{} &{} &{} d\sigma _{BR} \end{array}\right] . \end{aligned}$$

The semi-discrete spectrum is given by the eigenvalues of \(P^{-1}\tilde{Q}\).

By multiplying both sides of (5.6) with \(\bar{P}=\text {diag}(P_l,\alpha _d P_r)\) and adding the transpose we have

$$\begin{aligned} \frac{d}{dt} ||\mathbf u , \mathbf v ||^2_{\alpha _d} =\left( \begin{array}{l} \mathbf u \\ \mathbf v \end{array}\right) ^T \left[ \bar{\tilde{Q}}+\bar{\tilde{Q}}^T\right] \left( \begin{array}{l} \mathbf u \\ \mathbf v \end{array}\right) , \end{aligned}$$

where \(\bar{\tilde{Q}}=\bar{P} P^{-1}\tilde{Q}\). By considering \(\sigma _{BL,BR}\) and d as in (5.3), the matrix \(\bar{\tilde{Q}}+\bar{\tilde{Q}}^T\) is non zero only at the interface block, which is the \(2\times 2\) matrix given in (3.5). We can prove

Proposition 5.1

The conditions (B1.a–b), (5.3) and \(|c d|\le 1\) imply that \(P^{-1}\tilde{Q}\) in (5.6) has eigenvalues with negative semi-definite real parts.

Proof

Let \(\mathbf x \) be a complex eigenvector of the spatial operator \(P^{-1}\tilde{Q}\). Then

$$\begin{aligned} \mathbf x ^*\bar{\tilde{Q}}\mathbf x = \mathbf x ^*\bar{P} P^{-1} \tilde{Q} \mathbf x = \mathbf x ^* \bar{P} \lambda \mathbf x = \lambda \mathbf x ^* \bar{P}\mathbf x , \end{aligned}$$
(5.7)

where \(\lambda \) is the corresponding eigenvalue relative to \(\mathbf x \). By applying the same procedure to \(\bar{\tilde{Q}}^T\) we get

$$\begin{aligned} \mathbf x ^* \bar{\tilde{Q}}^T \mathbf x = \bar{\lambda } \mathbf x ^* \bar{P} \mathbf x . \end{aligned}$$
(5.8)

Summing (5.7) and (5.8) and recalling that \(\bar{P}>0\) and diagonal, it follows that

$$\begin{aligned} \mathbf x ^* \left[ \bar{\tilde{Q}}+\bar{\tilde{Q}}^T \right] \mathbf x = \left( \lambda + \bar{\lambda } \right) \mathbf x ^* \bar{P} \mathbf x = 2\mathbb {R}e(\lambda ) \mathbf x ^* \bar{P}\mathbf x . \end{aligned}$$
(5.9)

Hence, \(\mathbb {R}e(\lambda ) \le 0 \) since \(\bar{\tilde{Q}}+\bar{\tilde{Q}}^T\le 0\). \(\square \)

6 Numerical results

In this section we present numerical tests concerning various aspects of the interface treatment focusing on the accuracy and spectral analysis of the approximation (5.2).

As an example, we first present a wave solution propagating with different speeds in different domains. In Fig. 1 we show a few of the frames of the time-evolution between the initial time \(T=0\) and \(T=1.5\) of the solution to a conservative problem (2.3)–(2.4). The initial data is zero in both domains. The boundary data is given by the function \(g(t)=\sin (4\pi (-1+3t))\) and it is weakly imposed at the inflow boundary using SAT procedure. The wave is propagating with velocity \(a=2\) in the left domain and \(b=1\) in the right domain. The jump condition satisfying (2.15) is \(c=2\).

Fig. 1
figure 1

Time-evolution of a conservative solution of (2.3)–(2.4) between the initial time \(T=0\) and \(T=1.5\) with a conservative approximation (Proposition 4.3). The boundary data is sin(4\(\pi \)(\(-1\,+\,\)3t)). The parameters are: \(a=2\), \(b=1\) and \(c=2\). \(\sigma _L=0.3,\sigma _R = 0.5\) and \(\theta =1.3\)

For this test we have used the approximation (3.2) adding \(P^{-1}_l\left[ \sigma _{BL}(u_0-g(t))\right] e_0\) to the left domain equation as a SAT term for imposing the boundary condition. Here, the penalty coefficient is set to be \(\sigma _{BL}=-a\) according to the stability condition derived in [1, 22]. Computations are performed using the 5th order accurate SBP84 operator, see [21], with 300 grid points in each domain. The penalty \(\sigma _{L,R}\) satisfy the conservation conditions of Proposition 4.3. In particular we have chosen: \(\sigma _L=0.3,\sigma _R = 0.5\) and \(\theta =1.3.\) Here and for all the tests in this paper, we have used the explicit standard fourth-order Runge-Kutta (RK4) scheme for integrating in time, with Courant number \(CFL=0.1\). The relation determining the time step is

$$\begin{aligned} \max (a,b)\frac{{\varDelta }t}{{\varDelta }x} = CFL, \end{aligned}$$

where \({\varDelta }t\) and \({\varDelta }x\) are the temporal and spatial step respectively.

6.1 Accuracy

Consider the semi-discrete approximation (5.2). We choose

$$\begin{aligned} \begin{array}{r l l} u_l(x,t)&{}=&{}\sin (2\pi (x-t)), \\ u_r(x,t)&{}=&{}\cos (3\pi (x-3t)), \end{array}\quad \begin{array}{r l l} -1&{}\le x\le &{} 0,t\ge 0,\\ 0&{}\le x\le &{} 1,t\ge 0, \end{array} \end{aligned}$$
(6.1)

as manufactured solutions. They satisfy the forced equations

$$\begin{aligned} \begin{array}{lcc} (u_l)_t+a(u_l)_x&{}=&{}F_l,\\ (u_r)_t+b(u_r)_x&{}=&{}F_r, \end{array}\quad \begin{array}{rcl} -1&{}\le x\le &{} 0,t\ge 0,\\ 0&{}\le x\le &{} 1,t\ge 0, \end{array} \end{aligned}$$
(6.2)

where \(F_l\) and \(F_r\) are forcing terms obtained by inserting (6.1) in (2.3)–(2.4). The solutions (6.1) are connected by the jump condition

$$\begin{aligned} u(0,t)- c v(0,t) = \sin (-2\pi t) - c \cos (-9\pi t) \end{aligned}$$
(6.3)

and the periodic boundary conditions

$$\begin{aligned} u(-1,t)- d v(1,t) = \sin (2\pi (-1+t)) - d \cos (3\pi (1+t)). \end{aligned}$$
(6.4)

We present the accuracy analysis for a non-conservative problem and approximation with stability conditions from Proposition 4.1. Namely: \(a=3,b=2,c=3\) and \(\sigma _L=0.3,\sigma _R=-1.1\) with \(\theta =6.\) We consider SBP21, SBP42, SBP63 and SBP84 operators (where the first number refers to the interior accuracy and the second to the accuracy at the boundaries and interface) with 2nd, 3th, 4th and 5th overall expected order of accuracy [21] respectively. The error is evaluated with respect to the discrete \(L^2\) norm and computed as

$$\begin{aligned} ||u-\nu ^{(h)}||_2 =\left( \sum _{i=1}^{N} h|u(x_i,T)-\nu _i^{(h)} |^{2} \right) ^{1/2}, \end{aligned}$$

as well as the \(l^{\infty }\) norm (or maximum norm) defined as

$$\begin{aligned} ||u-\nu ^{(h)}||_{\infty } = \max _{i=1,\ldots ,N} |u(x_i,T)-\nu _i^{(h)}|. \end{aligned}$$

Here u is the analytic solution at the final time \(T=1\) and \(\nu ^{(h)}\) the corresponding numerical approximation calculated using N points and spatial step h. The rate of convergence q is obtained as

$$\begin{aligned} q=log_2\left( \dfrac{||u-\nu ^{(2h)} ||_p}{||u-\nu ^{(h)} ||_p} \right) , \end{aligned}$$

where the index p indicates the type of norm considered. The actual errors and the convergence rates are shown in Tables 1 and 2 respectively. The results agree well with the design order of accuracy for the schemes. We obtain analogous results for a conservative problem with both conservative and non-conservative approximation.

Table 1 Discrete \(L^2\) and \(l^{\infty }\) error norms for the numerical approximation of a non-conservative interface problem (6.2) and semi-discretization (5.2) computed with N grid points
Table 2 Convergence rate as a function of N grid points for the non-conservative interface problem (6.2) and semi-discretization (5.2)

6.2 The spectrum

Given that our numerical scheme is accurate, we now return to the analysis of the spectrum. We are interested in showing that the interface treatment produces a negative semi-definite spectrum for \(P^{-1}\tilde{Q}\) (as was stated in Proposition 5.1) which converges to the continuous spectrum. We are also interested in knowing to what extent the conservation conditions (B1.a–b) influence the spectrum.

We start with convergence of the discrete spectrum. Let \(\lambda _i^c\) denote the eigenvalues from the spectrum of the continuous operator, and \(\lambda _i(N)\) the eigenvalues of the semi-discrete spectrum calculated with N grid-points. The index i refers to an ordering of the magnitude of the imaginary parts of the eigenvalues, i.e. we have \(\text {Im}(\lambda _i(N))<\text {Im}(\lambda _{i+1}(N)).\) Note that not all the semi-discrete eigenvalues converge. Thus, we consider indices i small enough such that the related numerical eigenvalues converge to the continuous ones. For each convergent eigenvalue we compute

$$\begin{aligned} Error(N,i)=\left| \lambda (N)_i- \lambda _i^c\right| ,\text { for } i=1,\ldots ,N,\text { where }N = 40, 80, 160, \text { and }320. \end{aligned}$$

The order of convergence of \(\lambda _i(N)\) is given by \(p=log_2(Error(2N,i)/Error(N,i)).\) In Table 3 we show the convergence rates for the semi-discrete spectra of the SBP21, SPB42, SBP63 and SBP84 operators. The problem and the approximation are both conservative with \(a=3,b=1,c=3\). The penalty coefficients are from Proposition 4.3, namely \(\sigma _L=0.3,\sigma _R=-0.6\) and \(\theta =1.8.\) The data in the table refer to one specific eigenvalue of each spectrum which is indicative of the behavior of its operator. Note that Table 3 shows that the convergence is the same as the order of the internal approximation.

Table 3 Rate of convergence of semi-discrete eigenvalues of SBP21, SPB42, SBP63 and SBP84 operators

Now we show the validity of Proposition 5.1, which states that the stability conditions (B1.a, b) make the operator (5.6) negative semi-definite. We have tested all the different interface treatments presented in Sect. 4 and different orders of accuracy for the spatial discretization. In Fig. 2a–c we present one example for each of the interface cases using the 4th order accurate SBP63 operator. In all the figures we plot the semi-discrete spectrum of the operator and the corresponding continuous spectrum.

In Fig. 2a we have a non-conservative problem with \(a=2\), \(b=1\) and \(c=0.5\). The penalty coefficients satisfy the stability conditions of Proposition 4.1: \(\sigma _L=1.6,\sigma _R=-1.6\) and \(\theta =6\). In Fig. 2b, c we have a conservative continuous problem with \(a=2\), \(b=1\) and \(c=a/b\). In Fig. 2b the penalty coefficients satisfy the non-conservative stability conditions of Proposition 4.2: \(\sigma _L=0.4,\sigma _R=-0.6\) and \(\theta =1.3\), while in Fig. 2c, they satisfy the conditions of Proposition 4.3: \(\sigma _L=0.3,\sigma _R=-0.7\) and \(\theta =1.3\). We see that the spectra have eigenvalues with negative real parts, which implies well-posedness for the continuous problem and a stable semi-discrete scheme as stated in Proposition 5.1.

Fig. 2
figure 2

Continuous and semi-discrete spectrum of 4th order SBP–SAT approximation. Penalty coefficients \(\sigma _{L},\sigma _{R}\) as in Proposition 4.1 (a), Proposition 4.2 (b), Proposition 4.3 (c)

6.2.1 Strict stability and artificial dissipation

All the plots in Fig. 2a–c show that all the eigenvalues of the discrete spectra are located in the left half plane, which was guaranteed by Proposition 5.1. On the other hand, a few discrete eigenvalues are located to the right of the continuous spectrum. According to the definition of strict stability, [8, 9, 11, 18], the time growth rate of a strictly stable approximation is bounded by the growth rate of the corresponding continuous problem. We prefer that the eigenvalues of the semi-discrete spectrum lies on the left side of the spectrum of the continuous operator. By adding suitable artificial dissipation terms to the semi-discretization (5.2), we can move the discrete spectrum to the left side of the continuous one without reducing the accuracy.

In our tests we have added artificial dissipation operators of the form

$$\begin{aligned} A_{2p}=-\tilde{P}^{-1}\tilde{D_p}^{-T} B_p \tilde{D_p}, \end{aligned}$$

with accuracy of order 2p. Here \(D_p=({\varDelta }_x)^{-p}\tilde{D_p}\) is a consistent approximation of \(d^p/dx^p\) with minimal width and spatial step \({\varDelta }_x\). \(P=(1/{\varDelta }_x) \tilde{P}\) is the norm used for a 2pth order accurate scheme [12, 13, 21]. \(B_p\) is a matrix with a positive semi-definite symmetric part. For a discussion on how to build artificial dissipation operators for SBP operators of the form just described, without loosing accuracy and stability, see [16].

Figure 3 shows the spectrum of the conservative approximation (5.2) using the SBP63 operator with and without artificial dissipation and the spectrum of the continuous operator. The semi-discrete eigenvalues in Fig. 3b converge from the left side implying strict stability. We get similar results for SBP21 and SBP42 operators and also for the non-conservative approximations. The rate of convergence is not changed by introducing the artificial dissipation, as can be seen in Table 4.

Fig. 3
figure 3

Close-up of the continuous and the semi-discrete spectrum of 4th order SBP–SAT approximation without dissipation (a), and with dissipation (b). Penalty coefficients \(\sigma _{L},\sigma _{R}\) satisfy a conservative interface treatment as in Proposition 4.3. Parameter setting: \(a=2\), \(b=1\), and \(c= 2\)

Table 4 Rate of convergence of semi-discrete eigenvalues of SBP21, SPB42, SBP63 and SBP84 operators with artificial dissipation

The benefit of such operators on the spectrum has been also shown in [18].

6.2.2 The dissipative effect of a conservative scheme

Finally we discuss the difference between a non-conservative and conservative approximation for a conservative continuous problem. From Propositions 4.2 and 4.3 we know that it is possible to obtain a stable approximation in both cases. Here we are interested in knowing what we gain or lose by choosing a conservative or non-conservative scheme. With this motivation in mind we show the spectra of conservative schemes and spectra of a non-conservative type in Fig. 4a–f. In Fig. 4a, c, e the scheme is stable and conservative, while in Fig. 4b, d, f) the scheme is stable and non-conservative. In each row we have the same value of \(\theta \), i.e. the same norm \(\alpha _d\). In all cases we use a 4th order accurate scheme.

Fig. 4
figure 4

Comparison between conservative, (a, c, e), and non conservative (b, d, f), semi-discrete spectra for a conservative continuous problem

For \(\theta =1\), Fig. 4a, b, the spectra are identical since the stability conditions imply conservation, see (4.4) and (4.6). Note that in this case the scheme is automatically strictly stable since the discrete spectrum is completely located on the left side of the continuous one. In all the other examples we note that the non-conservative approximation has a few more eigenvalues on the right side of the continuous spectrum compared with the conservative approximation. This observation suggests that a non-conservative approximation is less dissipative than a conservative one.

We can check how dissipative the interface treatment is by considering the energy rate (3.4). We recall that IT represents the effect of the interface treatment on the energy growth. We can measure how the interface treatment contributes to the estimate by computing the eigenvalues of H in (3.5) which define the quadratic form IT. In Fig. 5 we show the eigenvalues \(h_1\) and \(h_2\) for different values of \(\theta \) for a non-conservative scheme (pink line) and a conservative scheme (green line). Note that the eigenvalues of the latter are always below those of the former. This indicates that the conservative approximation is more dissipative than the non-conservative one.

Fig. 5
figure 5

Trend of the eigenvalues \(h_1\) (a), and \(h_2\) (b), of H in (3.5) for different values of \(\theta \). The pink and the green markers correspond to the non-conservative and the conservative scheme respectively. These latter are always below the former, indicating that the conservative approximation is more dissipative than the non-conservative one (color figure online)

7 Conclusions

We have presented a complete analysis of the discontinuous interface problem. It has been shown that such a problem is always well-posed and we have investigated when it is conservative.

We have derived stable SBP–SAT schemes for a conservative and non-conservative continuous problem. The schemes have been tested for accuracy and stability using numerical simulations with the method of manufactured solutions and spectral analysis.

It has been proved that for a conservative continuous problem one can choose between a conservative or non-conservative scheme with respect to a modified \(L^2\) norm. It has also been proved that a unique norm exists for which stability lead to conservation.

In the spectral analysis we have shown that the spectrum of the semi-discrete operator converges to the spectrum of the continuous problem. Furthermore, the numerical approximations can be made strictly stable by adding artificial dissipation without reducing the accuracy. Finally, the dissipative properties of a conservative and non-conservative scheme have been compared. The results indicate that the conservative scheme is more dissipative.