1 Introduction

Dynamic processes in continuum physics are modeled using time-dependent partial differential equations (PDE), which are based on the conservation of some physical quantities, such as mass, momentum and energy. The governing equations may involve different physical processes, like advection, diffusion, pressure gradients and drag forces among many others. The time scale associated to each process is not the same, for instance diffusion processes are defined at a much smaller time scale than advection phenomena, or pressure waves travel much faster than material interfaces or contact discontinuities. Specifically, numerical schemes that are able to handle multiple time scales simultaneously are extremely important for real world applications, as well as algorithms which are numerically stable for a wide range of admissible time steps while advancing the solution in time.

These observations led to the idea of splitting the processes on fast and slow time scales and treating them with different numerical techniques. The main strategy consists in treating implicitly only one part of the system to be solved while keeping the remaining explicit [5, 25, 27, 69], hence allowing space and time discretizations to be designed, in which the implicit part of the system is relatively easy to be inverted, typically avoiding nonlinear systems, while keeping robustness and shock-capturing properties in the explicit part. The most popular approach is based on implicit-explicit (IMEX) methods [1, 13, 51] that have proven to be very successful in designing asymptotic-preserving (AP) schemes capable to deal with stiff source terms. Such IMEX schemes typically may achieve high order of accuracy under a time step stability constraint independent of the values of the fast scale. Alternatively, other semi-implicit methods have been proposed [9, 19, 20, 36, 52] where a linearly implicit scheme is derived for the stiff terms in the governing equations, thus avoiding any need of iterative solvers. Let us mention that, semi-implicit hybrid finite volume/finite element schemes have been recently proposed in [3, 14], while semi-implicit methods coupled with discontinuous Galerkin (DG) space discretizations on unstructured staggered meshes have been forwarded for compressible flows [66], on dynamic adaptive meshes [30] and for axially symmetric flows [35]. In most of the aforementioned works, the convective terms of the governing equations are discretized explicitly, because they typically involve a nonlinearity which is difficult to be implicitly solved, requiring the usage of computationally time consuming and numerically less stable nonlinear solvers for the resulting system that need to be inverted. Explicit upwind finite difference and Godunov-type finite volume methods are very popular [32, 38, 47, 48], although these schemes are restricted to a Courant-Friedrichs-Lewy (CFL) stability condition based on the maximum eigenvalues of the Jacobian matrix associated to the hyperbolic system. Another option is given by the so-called semi-Lagrangian (SL) methods, which have recently achieved visibility due to their excellent resolution and stability properties. In the SL framework, the advection term is written in a Lagrangian formulation, which is then discretized accordingly. In particular, semi-Lagrangian schemes require the integration of the material trajectories backward in time to find the foot of the characteristic, where the numerical solution is interpolated. These methods have been originally developed for numerical weather prediction [71, 72]. Nowadays, they can be found in environmental engineering applications, such as free surface flows in rivers and oceans [11, 24, 74] as well as in plasma physics [23] and kinetic equations [18, 22, 58], in applications to image processing [17] or for solving the Hamilton-Jacobi equations [16]. The semi-Lagrangian approach is the only explicit method for the discretization of convective terms that allows for large time steps without imposing a CFL-type stability condition, therefore it constitutes a very interesting alternative to standard explicit upwind solvers. However, the extension of SL methods to deal with shock waves that occur in hyperbolic PDE is not trivial because conservation must be strictly ensured. Conservative semi-Lagrangian methods are described for instance in [34, 37]. In [55] a conservative WENO finite difference scheme with SL treatment of advection is proposed for incompressible flows, while recently in [75] a novel approach for the development of conservative semi-Lagrangian schemes has been introduced, which is based on the backward integration of the scalar advection equation onto a space-time control volume defined for each grid point. Let us also recall that implicit-explicit SL discretizations have been considered in [2] for convection dominated problems, and in [15] Runge-Kutta exponential integrators have been coupled with SL discretizations for nonlinear Vlasov equations.

State-of-the-art semi-Lagrangian methods are mostly used in non-conservative form, for instance in the discretization of the advection contribution for incompressible flows. On the other hand, when kinetic equations with linear transport are considered, the use of conservative SL schemes is adopted, where the characteristics are straight lines and therefore can be easily followed for designing high order methods. If IMEX discretizations based on Runge-Kutta time integrators are used, semi-Lagrangian schemes exhibit an intrinsic difficulty which arises from the fact that space and time cannot be decoupled, since SL methods directly solve the Lagrangian form of advection and, as such, no purely spatial advection fluxes can be retrieved as in standard RK time stepping techniques. This makes the application of semi-Lagrangian schemes to RK integrators not very common in the literature. A recent attempt for the development of conservative SL methods for hyperbolic PDE has been forwarded in [75], which is restricted to the case of the scalar nonlinear advection PDE. In [60, 61] the equations for incompressible fluids are written in flux conservative form and the divergence operator is discretized directly along the Lagrangian trajectories of the spatial coordinates, thus ensuring conservation. Another option to guarantee conservation is given by the backward transport of the entire control volume with subsequent integration of the advected quantity as proposed in [41, 43]. A conservative first order finite volume method based on a semi-Lagrangian discretization of the advection terms has been introduced in [40], where no diffusion is taken into account. An analysis of the accuracy and stability of Godunov-type solvers with arbitrary large time steps has been discussed in [46] for general scalar conservation laws. In [56] a class of advection schemes based on a combination of advective-form and conservative-form is devised, in order to avoid errors induced by operator-splitting techniques. Among existing semi-Lagrangian algorithms, we also mention the class of flux-based methods of characteristics [31] which combine the conservation property exhibited by finite volume discretizations with large time steps achieved by a semi-Lagrangian treatment of advection. High order Discontinuous Galerkin schemes with conservative semi-Lagrangian methods have been used in [57, 70] and applied to the scalar advection equation in multiple space dimensions. Regarding the shallow water system, in [44, 49] semi-implicit second order conservative semi-Lagrangian methods are designed. Most of the aforementioned works are dealing with meteorological flows, thus solving the incompressible Navier-Stokes equations. All of them can guarantee mass conservation but none of them is able to achieve time accuracy of order greater than two.

In this work we aim at constructing a new class of methods that deal with both semi-Lagrangian schemes for advection and IMEX-RK time stepping at the same time. In the first part of the paper, we derive two different algorithms for the non-conservative case and we demonstrate the accuracy and the robustness of the proposed approach by considering the scalar advection-diffusion equation as a prototype, where advection and diffusion are treated explicitly and implicitly, respectively. The second part of the article is devoted to the design of a conservative semi-Lagrangian IMEX scheme for hyperbolic systems of balance laws, namely the one-dimensional shallow water equations (SWE). The 1D SWE represent a simple, but not trivial, prototype example of a hyperbolic system, since they involve both advection and pressure contributions that are suitable for an IMEX scheme with SL treatment of the convective terms. Indeed, a fast scale related to the pressure terms and a slow scale associated with convection coexist. Furthermore, shock waves are part of the eigenstructure of the system, thus requiring a conservative method to properly capture the wave speed and eventually its location. The novel class of methods is addressed with SL-IMEX schemes and is shown to achieve up to third order of accuracy in space and time, while ensuring fully conservation of the state variables. Finally, an asymptotic-preserving SL-IMEX scheme is developed by considering a relaxation system for the SWE, and numerical evidences are proposed.

The outline of this article is as follows. In Sect. 2 we present the scalar advection-diffusion equation, while Sect. 2.1 revisits the classical IMEX schemes with Eulerian discretization of the advection terms. Two different non-conservative versions of the novel SL-IMEX algorithms are derived in Sect. 2.2 and numerical results for this class of methods are shown in Sect. 3. The second part of the article starts with the introduction of the shallow water model in Sect. 5, which is followed by a detailed description of the new conservative SL-IMEX schemes. Next, in Sect. 6, the schemes are extended to deal with the presence of source terms and their AP properties are analyzed. The novel algorithms are validated through a suite of numerical tests that is then proposed in Sect. 7. Finally, conclusions and outlook to future work are given in Sect. 8.

2 Semi-Lagrangian IMEX Schemes for Advection–Diffusion Equations

Let us consider the one-dimensional advection-diffusion equation of a scalar quantity \(q=q(x,t)\) over a given velocity field u(xt) with a constant diffusion coefficient \(\alpha \in \mathbb {R}^+\):

$$\begin{aligned} \frac{\partial {q} }{\partial {t} } + \frac{\partial {u q} }{\partial {x} } = \alpha \frac{\partial ^2 q}{\partial x^2}, \end{aligned}$$
(1)

where \(t \in \mathbb {R}_0^+\) is the time and \(x \in \mathbb {R}\) represents the spatial coordinate. In the semi-Lagrangian framework, the advection term in (1) can be reformulated using the Lagrangian derivative, thus yielding

$$\begin{aligned} \frac{d q}{d t} = \alpha \frac{\partial ^2 q}{\partial x^2}. \end{aligned}$$
(2)

The solution of both (1) and (2) propagates along characteristics, that are defined by the trajectory equation

$$\begin{aligned} \frac{d x}{d t} = u(x,t). \end{aligned}$$
(3)

In the above equation (2), the classical semi-Lagrangian technique is used, with the diffusion terms treated in Eulerian form. The inclusion of the diffusion terms in the semi-Lagrangian approach can be found in [6, 7]. Despite its simplicity, the governing PDE (1) represents a suitable prototype for deriving semi-Lagrangian methods with IMEX time stepping because: i) it contains an advection term which can be discretized at the aid of a semi-Lagrangian scheme; ii) it involves a diffusion contribution that might be conveniently solved implicitly in order to relax the severe stability condition on the time step imposed by parabolic terms. Therefore, the new class of semi-Lagrangian IMEX schemes, denoted as SL-IMEX, will be firstly constructed by studying the advection-diffusion equation (1), or equivalently (2).

2.1 IMEX Schemes with Eulerian Advection

The governing PDE (1) undergoes an implicit-explicit time discretization, where the nonlinear convective contribution is taken explicitly while the diffusion terms are considered implicitly. Therefore, a first order in time semi-discrete scheme writes

$$\begin{aligned} {\frac{q^{n+1} - q^n}{\varDelta t}} + \frac{\partial {(u q)^n} }{\partial {x} } = \alpha \frac{\partial ^2 q^{n+1}}{\partial x^2}, \end{aligned}$$
(4)

with the time step defined as \(\varDelta t = t^{n+1}-t^n\). Let \({\mathcal {H}}(q_E(t),q_I(t))\) denote a spatial approximation of the explicit advection term with \(q_E(t)\) and of the implicit diffusion term with \(q_I(t)\) , that is

$$\begin{aligned} {\mathcal {H}}(q_E(t),q_I(t)) = - \frac{\partial {(u_E q_E)} }{\partial {x} } + \alpha \frac{\partial ^2 q_I}{\partial x^2}. \end{aligned}$$
(5)

Although the time discretization (4) could have been written in a more canonical partitioned form as

$$\begin{aligned} {\mathcal {H}} = {\mathcal {H}}^E(q_E(t))+{\mathcal {H}}^I(q_I(t)), \end{aligned}$$

we prefer to write the PDE under the form of an autonomous system following [8]. This easily allows for a more general framework, where nonlinearities in the implicit part of the PDE can be properly treated, contrarily to the partitioned form [33]. Furthermore, the scope of the advection–diffusion equation (1) is only to furnish an example of application for the development of the SL-IMEX schemes discussed in this work, which in principle might be extended to other physical models. Notice that any Eulerian discretization of the advection term based on flux form fits the formalism (5). The definition (5) allows the semi-discrete form (4) to be written as

$$\begin{aligned} \begin{aligned} \frac{d q_E(t)}{dt}&= {\mathcal {H}}(q_E(t),q_I(t)), \\ \frac{d q_I(t)}{dt}&= {\mathcal {H}}(q_E(t),q_I(t)). \end{aligned} \end{aligned}$$
(6)

In the above formulation (6), the number of unknowns has been formally doubled, which is not the case if the PDE is written in partitioned form. However, for a specific choice of time discretizations and for autonomous systems this duplication is indeed only apparent [8], thus yielding

$$\begin{aligned} \frac{d q(t)}{dt} = {\mathcal {H}}(q_E(t),q_I(t)). \end{aligned}$$
(7)

The above formulation (7) can be readily applied to the framework of classical IMEX Runge-Kutta (IMEX-RK) schemes [8, 51]. These multi-step methods are based on s stages and they are typically described in terms of the double Butcher tableau:

(8)

with the matrices \(({\tilde{A}},A) \in \mathbb {R}^{s \times s}\) and the vectors \(({\tilde{c}},c,{\tilde{b}},b) \in \mathbb {R}^s\). The tilde symbol refers to the explicit scheme and matrix \({\tilde{A}}=({\tilde{a}}_{ij})\) is a lower triangular matrix with zero elements on the diagonal, while \(A=({a}_{ij})\) is a triangular matrix which accounts for the implicit scheme, thus having non-zero elements on the diagonal. From now on we adopt IMEX-RK schemes with \(b={\tilde{b}}\) and the Butcher tableau of the schemes used in this work are reported in Appendix A. A general IMEX-RK scheme aims at computing the numerical solution at the next time step \(q^{n+1}\) starting from \(q^n\), and it can be compactly written as follows:

  • Stage values for \(i=1 \ldots s\)

    $$\begin{aligned} q_E^{(i)}&=q^{n}+\varDelta t \sum \limits _{j=1}^{i-1}{\tilde{a}}_{i,j} \, {\mathcal {H}}(q_E^{ (j)},q_I^{ (j)}), \end{aligned}$$
    (9a)
    $$\begin{aligned} q_{*}^{(i)}&=q^n + \varDelta t \sum \limits _{j=1}^{i-1}a_{i,j} \, {\mathcal {H}}(q_E^{ (j)},q_I^{ (j)}), \end{aligned}$$
    (9b)
    $$\begin{aligned} q_I^{(i)}&=q_{*}^{(i)} +\varDelta t \, a_{i,i} \, {\mathcal {H}}(q_E^{ (i)},q_I^{ (i)}). \end{aligned}$$
    (9c)

    The solution of (9c) involves an implicit evaluation which corresponds to the backward Euler scheme (4).

  • Update of the numerical solution in terms of the spatial fluxes evaluated at the previous stages

    $$\begin{aligned} q^{n+1}=q^n+ \varDelta t \sum \limits _{i=1}^{s} b_i {\mathcal {H}}(q_E^{ (i)},q_I^{ (i)}), \end{aligned}$$
    (10)

    where we recall that \(b={\tilde{b}}\), see Appendix A.

The above approach is then complemented with a suitable space discretization which can be designed independently of the time discretization by adopting, for example, a hybrid finite volume/finite difference scheme for the discretization of the spatial flux \({\mathcal {H}}\). Specifically, a finite volume scheme designed for the hyperbolic advection part can be combined with a centered finite-difference scheme for the diffusion terms (see for example [1, 10, 13]).

2.2 IMEX Schemes with Semi-Lagrangian Advection

Let us now consider a semi-Lagrangian discretization of the advection term in the governing PDE (1), thus the aim is to solve the transport part of the equation by following the characteristics which move with velocity u(xt) according to (3). A semi-Lagrangian method is based on two main steps:

  1. 1.

    backward integration of the Lagrangian trajectories, which is nothing but the integration of the ODE (3), in order to find the foot of the characteristic located at \(x^L\);

  2. 2.

    reconstruction, or interpolation, of the transported quantity q at the point \(x^L\), that in principle never lies on a known grid point.

Then, neglecting the diffusion part, a direct discretization of the Lagrangian form of the PDE (2) simply yields

$$\begin{aligned} q^{n+1} = q^L, \end{aligned}$$
(11)

with \(q^L:=q(x^L)\) being the solution interpolated at the foot of the characteristic \(x^L\). The semi-Lagrangian method (11) is the only explicit discretization that is not constrained by a CFL-type stability condition, hence allowing for more stability and accuracy compared to classical Eulerian methods. The main problem when the semi-Lagrangian approach is considered in combination with an IMEX time discretization is that the solution along the characteristics directly solves the contribution of the Lagrangian derivative \(\frac{dq}{dt}\), instead of handling \(\left( \frac{\partial {q} }{\partial {t} } + \frac{\partial {u q} }{\partial {x} } \right) \) separately. As a consequence, it is not possible to split the spatial discretization from the temporal one as required in the IMEX formalism, hence implying that the PDE can no longer be cast into form (7).

In order to derive a consistent semi-Lagrangian IMEX scheme, labeled with SL-IMEX, we proceed in three steps. First, a pure advection problem is considered. Second, a pure diffusion problem is analyzed. Third, we introduce advection and diffusion simultaneously to solve the governing PDE (1).

2.2.1 Advection Dominated SL Explicit RK Schemes

For an advection dominated problem, the diffusive terms are neglected (\(\alpha =0\)), so that there is no need of computing any implicit contribution in (9c). Let us define a general semi-Lagrangian operator \({\mathcal {L}}\) such that

$$\begin{aligned} q^L(x) = q(x^L,t) = {\mathcal {L}}(q(x,t),\varDelta t^L,u(x,t)), \end{aligned}$$
(12)

which solves the trajectory Eq. (3) with the velocity field u(xt) over a time interval of \(\varDelta t^L=\omega \varDelta t\) with \(\omega \in \mathbb {R}\). The result of (12) is the interpolated quantity \(q^L(x)\) at the foot of the characteristic \(x^L=x-u(x,t)\varDelta t^L\), which is exactly what is required by the semi-Lagrangian scheme (11). The order of accuracy of the Lagrangian operator depends on both the accuracy of the ODE solver for (3) and the reconstruction operator, thus the simple definition \(x^L=x-u(x,t)\varDelta t^L\) is only first order accurate.

Equation (12) suggests to evolve the coordinates x instead of q itself, meaning that the trajectory ODE (3) is the equation to be solved with the RK discretization and not the Lagrangian PDE (2). This is equivalent to consider an augmented PDE system for \({\mathbf {q}}=(q,x)^\top \), with the fluxes \({\mathcal {H}}=(0,{\mathcal {H}}^L)^\top =(0,-u(x,t))^\top \):

$$\begin{aligned} \left\{ \begin{aligned} \frac{d q}{d t}&= 0, \\ \frac{d x}{d t}&= {\mathcal {H}}^L, \qquad {\mathcal {H}}^L = -u(x,t). \\ \end{aligned}\right. \end{aligned}$$
(13)

First, the trajectory equation in (13) must be solved using the explicit Butcher tableau in (8), that is

$$\begin{aligned} x_E^{(i)}=x_E^{n}+\varDelta t \sum \limits _{j=1}^{i-1}{\tilde{a}}_{i,j} {\mathcal {H}}_j^L, \qquad i=1 \ldots s, \end{aligned}$$
(14)

where \(x_E^{n}\) is initialized by x, i.e. \(x_E^{n}=x\), and the Lagrangian fluxes \({\mathcal {H}}_j^L\) are simply evaluated at each stage i as

$$\begin{aligned} {\mathcal {H}}_i^L=-u(x_E^{(i)},t). \end{aligned}$$
(15)

An example of the trajectory drawn by a grid point for the second order three-step Runge Kutta scheme (114) is shown in Fig. 1. The foot of the characteristic is located at \(x^L\), which corresponds to the solution of (3). According to (10), this is given by

$$\begin{aligned} x^L=x_E^{n} + \varDelta t \sum \limits _{i=1}^{s} b_i {\mathcal {H}}_i^L. \end{aligned}$$
(16)

Finally, the solution at the next time level \(t^{n+1}\) for the transported quantity, i.e. \(q^L\), is computed by the reconstruction, or interpolation, of the numerical solution at the foot of the characteristic \(x^L\), thus leading to

$$\begin{aligned} q^{n+1}(x)={\mathcal {R}}\left( q\left( x^L,t^n\right) \right) , \end{aligned}$$
(17)

where \({\mathcal {R}}(\cdot )\) is a suitable reconstruction operator.

The order of convergence of the scheme directly comes from the order of the Runge-Kutta method given by the explicit tableau in (8), which is used to solve the trajectory ODE. Then, the interpolation step (17) must also be of the same order of accuracy of the RK scheme in order to provide a consistent semi-Lagrangian discretization of the advection dominated PDE.

Fig. 1
figure 1

Example of piecewise trajectory solved with SA-SSP(3,3,2) given by (114)

The semi-Lagrangian operator (12) is then a compact definition which embeds all the Eqs. (14)–(17), that are nothing but the method corresponding to point 1 and 2 described at the beginning of Section 2.2.

2.2.2 Diffusion Dominated Implicit RK Schemes

For diffusion dominated problems the SL discretization does not play any role, thus the scheme must be equivalent to the implicit Runge-Kutta method with \({\mathcal {H}}=(0,{\mathcal {H}}^I)\) for \({\mathbf {q}}=(q,x)\):

$$\begin{aligned} \left\{ \begin{aligned} \frac{d q}{d t}&= {\mathcal {H}}^I, \qquad {\mathcal {H}}^I = \alpha \frac{\partial ^2 q}{\partial x^2}, \\ \frac{d x}{d t}&= 0. \\ \end{aligned}\right. \end{aligned}$$
(18)

The implicit fluxes are taken into account by the term \({\mathcal {H}}^I\) and the solution is computed as follows:

  • Stage values for \(i=1 \ldots s\)

    $$\begin{aligned} q_{*}^{(i)}&=q^n + \varDelta t \sum \limits _{j=1}^{i-1}a_{i,j} \, {\mathcal {H}}_{j}^I, \end{aligned}$$
    (19a)
    $$\begin{aligned} q_I^{(i)}&=q_{*}^{(i)} +\varDelta t \, a_{i,i} \, {\mathcal {H}}_i^I { \quad \text{ where } \quad {\mathcal {H}}_i^I=\alpha \frac{\partial {^2 q_{I}^{(i)}} }{\partial {x^2} } }. \end{aligned}$$
    (19b)
  • Update of the solution according to (10) as

    $$\begin{aligned} q^{n+1}=q^n+ \varDelta t \sum \limits _{i=1}^{s} b_i {\mathcal {H}}_i^I. \end{aligned}$$
    (20)

Notice that the determination of the stage value in (19b) implies the solution of an implicit system. The order of convergence is guaranteed in this case by the implicit part of the IMEX Runge-Kutta scheme (8), and no difference with classical IMEX schemes with Eulerian advection arises. For the space discretization we can use, for example, a fourth order central finite difference scheme:

$$\begin{aligned} \frac{\partial ^2 q}{\partial x^2} = \frac{-q_{i+2} + 16 q_{i+1} -30 q_i + 16 q_{i-1} - q_{i-2}}{12\varDelta x^2}+ {\mathcal {O}}(\varDelta x^4), \end{aligned}$$
(21)

with i and \(\varDelta x\) being the cell index and the mesh spacing, respectively.

2.2.3 Advection–Diffusion SL-IMEX Schemes

From the observations illustrated so far, we have seen that, for advection dominated problems, high order of accuracy in time can be achieved by solving the Lagrangian trajectory ODE (3) and then by evaluating the solution at the foot of the characteristic relying on a high order spatial reconstruction operator (17). On the other hand, diffusion dominated problems allow classical IMEX discretizations (9a)–(10) to be directly adopted, since a complete splitting between time and space fluxes takes place. In the sequel we will illustrate three different approaches combining the advective SL solver with the finite difference discretization.

Algorithm 0. To couple advection and diffusion schemes, one is now tempted by i) first moving the solution \(q^n\) along the Lagrangian trajectories to obtain \(q_E\), ii) and then solving the implicit Eq. (9c) for the diffusion terms to evaluate \(q_I\). The algorithm in this case would work as follows:

  • Stage values for \(i=1 \ldots s\)

    $$\begin{aligned} x_E^{(i)}&=x_E^{n}+\varDelta t \sum \limits _{j=1}^{i-1}{\tilde{a}}_{i,j} {\mathcal {H}}_j^L&\quad \end{aligned}$$
    (22a)
    $$\begin{aligned} q_E^{(j+1)}&={\mathcal {L}}\left( q_E^{(j)},{\tilde{a}}_{i,j} \varDelta t, {\mathcal {H}}^L_j \right) +\varDelta t \, {\tilde{a}}_{i,j} {\mathcal {H}}^I_j&\quad j=1 \ldots i-1 \end{aligned}$$
    (22b)
    $$\begin{aligned} q_{*}^{(j+1)}&={\mathcal {L}}\left( q_{*}^{(j)},a_{i,j} \varDelta t, {\mathcal {H}}^L_j \right) +\varDelta t \, a_{i,j} {\mathcal {H}}^I_j&\quad j=1 \ldots i-1 \end{aligned}$$
    (22c)

    with the initialization \(q_E^{(1)}=q^n\) and \(q_{*}^{(1)}=q^n\). The computation of the explicit Lagrangian flux for the trajectory Eq. (3) is given by

    $$\begin{aligned} {\mathcal {H}}^L_i=-u(x_E^{(i)}). \end{aligned}$$
    (23)

    The evaluation of the implicit flux \({\mathcal {H}}^I_i\) for the diffusion terms requires knowledge of the state \(q_I^{(i)}\) that is obtained by solving the following equation

    $$\begin{aligned} q_I^{(i)}-a_{i,i} \varDelta t \, \alpha \frac{\partial ^2 q_I^{(i)} }{\partial x^2} = {\mathcal {L}}\left( q_{*}^{(i)},a_{i,i}\varDelta t, {\mathcal {H}}^L_i \right) , \end{aligned}$$
    (24)

    which leads to the definition of the implicit fluxes

    $$\begin{aligned} {\mathcal {H}}^I_i=\alpha \frac{\partial ^2 q_I^{(i)} }{\partial x^2}. \end{aligned}$$
    (25)
  • Update of the solution \(q^{n+1}\) at the next time level using (10).

Unfortunately this algorithm achieves only first order of accuracy in time, even if high order IMEX schemes are adopted. Indeed, Algorithm 0 is equivalent to a first order splitting, where the governing PDE is split into explicit and implicit part: first, the explicit advection term is solved using (12), then the implicit part is computed employing (19)–(20), and eventually the solution is obtained by summing both contributions. We emphasize that by using higher order splitting approaches the order of accuracy can be increased (see [63] for example). A second order semi-implicit discretization has been proposed in [54], while a two-level advection scheme has been designed in [62]. However, in the sequel, we will not explore these directions further even though, as we will see, Algorithm 2 has similar advantages to a splitting approach and it can easily achieve high order of accuracy.

Algorithm 1. In order to show the idea which yields the construction of high order SL-IMEX schemes, let us consider the simplest combination of advection and diffusion by taking a constant velocity field \(u=const\) as well as a non zero diffusion coefficient \(\alpha >0\). Let then the initial condition be a step function

$$\begin{aligned} q(x,0)=\left\{ \begin{array}{ll} q_L &{} x<0 \\ q_R &{} x\ge 0 \end{array} \right. . \end{aligned}$$
(26)

The exact solution of (1) with initial condition (26) reads

$$\begin{aligned} q(x,t)=\frac{1}{2}(q_L+q_R)+\frac{1}{2} {{\,\mathrm{erf}\,}}\left( \frac{1}{2}\frac{x-ut}{\sqrt{\alpha t}}\right) (q_R-q_L). \end{aligned}$$
(27)

Looking at Eq. (24), it is evident that the semi-Lagrangian contribution moves the solution according to the Lagrangian flux \({\mathcal {H}}^L\) that is derived from (22a) and (23), thus the convective terms are solved at the aid of the explicit Butcher tableau in (8). On the other hand, the implicit flux is defined according to (25) which follows from the solution of (24), that implies the use of the implicit RK scheme in (8). Therefore, the implicit and explicit contributions in (24) are not compatible, meaning that the Lagrangian part is moving while the implicit flux is defined at the wrong time location within the time step \(\varDelta t\). For the simple problem given by (1)–(26), this corresponds advecting the solution up to a certain time fractional step of the explicit RK stage, and then applying the diffusion operator at a different time fractional step given by the implicit RK stage. In classical Eulerian IMEX schemes, the fluxes \({\mathcal {H}}\) are completely independent from time, thus they can be easily used to solve the convective contribution at any desired time fractional step, hence allowing for a perfect compatibility in the solution of the implicit step (9c). Contrarily, semi-Lagrangian schemes implies a full coupling of space and time discretization because they directly solve the Lagrangian Eq. (7).

In order to overcome this problem we underline two aspects. First, if \(u=0\) the Lagrangian contribution does nothing and the flux \({\mathcal {H}}^I\) is automatically correct since it is given by the solution of the pure diffusion equation with the implicit RK scheme (8). Second, if the solution is transported with \(u \ne 0\) and we assume a Lagrangian reference system which moves with the characteristic Eq. (3), then the problem becomes again a diffusion dominated one and we reduce to the previous case. In other words, if we apply a change of coordinates from x to \(x^\prime \) such as \(x^\prime =x-ut\), then we do not see the Lagrangian contribution. Thus, the idea is to move also the spatial flux \({\mathcal {H}}^I\) using the Lagrangian trajectories, so that it can be shifted with a time fractional step \(\omega \) at the same time level of the advection contribution in the RK stages and vice-versa. The way the fluxes are moved has to be consistent with the change of coordinate system and the algorithm reads as follows:

  • Stage values for \(i=1 \ldots s\)

    $$\begin{aligned} \omega&= \sum \limits _{r=1}^j a_{j,r} - \sum \limits _{r=1}^{j-1} a_{i,r}&\quad j=1 \ldots i-1 \end{aligned}$$
    (28a)
    $$\begin{aligned} {\tilde{q}}&= {\mathcal {L}}\left( q_{*}^{(j)},\omega \varDelta t, -u(x,t) \right) + \varDelta t \, a_{i,j} {\mathcal {H}}^I_j&\quad j=1 \ldots i-1 \end{aligned}$$
    (28b)
    $$\begin{aligned} q_{*}^{(j+1)}&= {\mathcal {L}}\left( {\tilde{q}},(a_{i,j}-\omega )\varDelta t, -u(x,t) \right)&\quad j=1 \ldots i-1 \end{aligned}$$
    (28c)

    with the initialization \(q_{*}^{(1)}=q^n\). The implicit flux \({\mathcal {H}}^I_j\) is defined at the time fractional step \(\omega \) given by (28a). Thus, the solution is firstly advected at the time level of the implicit flux, which can then be added to obtain the intermediate state \({\tilde{q}}\) with (28b). Finally, the state \(q_{*}^{(j+1)}\) can be easily obtained by shifting the entire solution, which now accounts for both advection and diffusion at the same compatible time level, to the time level of the current RK stage, i.e. \(a_{i,j}\), see (28c).

    The computation of the implicit flux \({\mathcal {H}}^I_i\) for the diffusion terms at the time level \(a_{i,i}\) implies solving

    $$\begin{aligned} q_I^{(i)}-a_{i,i} \varDelta t \, \alpha \frac{\partial ^2 q_I^{(i)} }{\partial x^2} = {\mathcal {L}}\left( q_{*}^{(i)},a_{i,i}\varDelta t, -u(x,t) \right) , \end{aligned}$$
    (29)

    and then using \(q_I^{(i)}\) to obtain \({\mathcal {H}}^I_i\) from (25).

  • The update of the solution \(q^{n+1}\) at the next time level makes use of the coefficients \(b_i\) for \(i=1 \ldots s\), therefore the entire solution must be shifted again to the correct time location in order to sum both explicit and implicit contributions at the same time level. Therefore, for \(i=1 \ldots s\) with \(q_{*}^{(1)}=q^n\) it holds

    $$\begin{aligned} \omega&= \sum \limits _{r=1}^i a_{i,r} - \sum \limits _{r=1}^{i-1} b_{r} \end{aligned}$$
    (30a)
    $$\begin{aligned} {\tilde{q}}&= {\mathcal {L}}\left( q_{*}^{(i)},\omega \varDelta t, -u(x,t) \right) + \varDelta t \, b_i \, {\mathcal {H}}^I_i \end{aligned}$$
    (30b)
    $$\begin{aligned} q_{*}^{(i+1)}&= {\mathcal {L}}\left( {\tilde{q}},(b_i-\omega )\varDelta t, -u(x,t) \right) \end{aligned}$$
    (30c)

    and the final solution is given by \(q^{n+1}=q_{*}^{s+1}\).

Algorithm 1 is based on the idea of going backward and forward with the entire solution q in order to properly add the implicit contributions at compatible time levels within the Runge-Kutta framework. To guarantee that the formal order of convergence is achieved, this approach requires the crucial property of the closure of the trajectories:

$$\begin{aligned} q ={\mathcal {L}}({\mathcal {L}}(q,\omega \varDelta t, u),-\omega \varDelta t, u). \end{aligned}$$
(31)

The above equation implies that the same solution is recovered at the same spatial point after one back and forth round has been done, for a time interval \(\omega \varDelta t\) over a velocity field u(xt). This property is strictly exhibited only if the characteristic Eq. (3) is solved exactly, thus providing an analytical expression for the trajectory. Apart from very simple velocity fields, obtaining an exact solution is practically not possible when dealing with nonlinear phenomena that typically occur in real world applications. Therefore, condition (31) must be satisfied at the discrete level up to the order of accuracy of the method, so that the solution of (3) does not affect the convergence of the overall IMEX scheme. This is why all semi-Lagrangian operators \({\mathcal {L}}\) present in Algorithm 1 make use of the explicit RK scheme in (8) to solve the characteristic equation according to (14)–(17). In this way, the numerical solution q(xt) can be shifted back and forth without spoiling the accuracy of the method, as experimentally proven by the convergence studies reported in Section 3. A graphical sketch of Algorithm 1 is depicted in Fig. 2 for the SL-IMEX scheme (114).

Fig. 2
figure 2

Illustration of the SL-IMEX scheme (114) for Algorithm 1. Blue lines represent the transport of the solution, i.e. the semi-Lagrangian scheme for the advection terms, while red lines are used for the transport of the coupled solution with fluxes

Algorithm 2. To improve the efficiency of Algorithm 1, we propose to directly shift the implicit fluxes to the final time level, where the new solution \(q^{n+1}\) is assembled by means of the intermediate contributions at the RK stages. The main advantage is that Algorithm 2 does not require a local high order solution of the trajectory Eq. (3), which is instead mandatory in Algorithm 1. Algorithm 2 works as follows:

  • Stage values for \(i=1 \ldots s\)

    $$\begin{aligned} x_E^{(j+1)}&= x_E^{(j)} + {\tilde{a}}_{i,j} \, \varDelta t \, {\mathcal {H}}^L_j&\quad j=1 \ldots i-1 \end{aligned}$$
    (32a)
    $$\begin{aligned} x_{*}^{(j+1)}&= x_{*}^{(j)} + a_{i,j} \, \varDelta t \, {\mathcal {H}}^L_j&\quad j=1 \ldots i-1 \end{aligned}$$
    (32b)
    $$\begin{aligned} \omega&= \sum \limits _{r=1}^j a_{j,r} - \sum \limits _{r=1}^{i-1} a_{i,r}&\quad j=1 \ldots i-1 \end{aligned}$$
    (32c)
    $$\begin{aligned} \tilde{{\mathcal {H}}^I}_{j}&= {\mathcal {L}}\left( {\mathcal {H}}^I_j,-\omega \varDelta t, {\mathcal {H}}^L_j \right)&\quad j=1 \ldots i-1 \end{aligned}$$
    (32d)

    with the initialization \(x_E^{(1)}=x_{*}^{(1)}=x\). The quantities \(\tilde{{\mathcal {H}}^I}_j\) denote the transported implicit fluxes at each time fractional step \(\omega \) given by (32c), while the Lagrangian flux \({\mathcal {H}}^L_i\) is updated with (15) using \(x_E^{(i)}\) coming from (32a). The intermediate state \(q_{*}^{(i)}\) is then computed as

    $$\begin{aligned} q_{*}^{(i)} = {\mathcal {R}}\left( q^n\left( x_{*}^{(i)}\right) \right) + \varDelta t \sum \limits _{j=1}^{i-1} a_{i,j} \, \tilde{{\mathcal {H}}^I}_j, \end{aligned}$$
    (33)

    where we recall that \({\mathcal {R}}\) represents a suitable high order spatial reconstruction operator. As for Algorithm 1, the implicit contribution \({\mathcal {H}}^I_i\) is obtained from (25) where \(q_I^{(i)}\) is the solution of the implicit equation

    $$\begin{aligned} q_I^{(i)}-a_{i,i} \, \varDelta t \, \alpha \frac{\partial ^2 q_I^{(i)} }{\partial x^2} = {\mathcal {L}}\left( q_{*}^{(i)},a_{i,i}\varDelta t, {\mathcal {H}}^L_i \right) , \end{aligned}$$
    (34)

    in which the semi-Lagrangian operator \({\mathcal {L}}\) makes use of a fast first order solver for the trajectory equation, i.e. the foot of the characteristic results to be \(x^L=x-a_{i,i}\varDelta t \, {\mathcal {H}}^L_i\).

  • The final solution is updated by adopting the same strategy, hence shifting the implicit fluxes to the time fractional steps given by the coefficients \(b_i\) in (8). For the stages \(i=1 \ldots s\) one computes

    $$\begin{aligned} x_E^{(i+1)}&= x_E^{(i)} + b_i \, \varDelta t \, {\mathcal {H}}^L_i&\end{aligned}$$
    (35a)
    $$\begin{aligned} \omega&= \sum \limits _{r=1}^i a_{i,r}-\sum \limits _{r=1}^{s} b_r \end{aligned}$$
    (35b)
    $$\begin{aligned} \tilde{{\mathcal {H}}^I}_{i}&= {\mathcal {L}}\left( {\mathcal {H}}^I_i,-\omega \varDelta t, {\mathcal {H}}^L_i \right) \end{aligned}$$
    (35c)

    then the solution at the next time level is obtained by combining the semi-Lagrangian scheme for the advection part and the shifted implicit flux contributions, thus

    $$\begin{aligned} q^{n+1} = {\mathcal {R}}\left( q^n\left( x_{E}^{(s+1)}\right) \right) + \varDelta t \sum \limits _{j=1}^{s}b_j \tilde{{\mathcal {H}}^I}_{j}. \end{aligned}$$
    (36)

Figure 3 shows a schematic of Algorithm 2 for the second order SL-IMEX scheme (114).

One advantage, is that this version of the SL-IMEX scheme can be easily embedded in an already existing semi-Lagrangian code for the explicit part. Indeed, Algorithm 2 only requires the transport of the implicit fluxes according to (32d), which have then to be added to the explicit convection contribution in (33).

Fig. 3
figure 3

Illustration of the SL-IMEX scheme (114) for Algorithm 2. Blue lines represent the transport of the solution, i.e. the semi-Lagrangian scheme for the advection terms. Green lines refer to the transport of the implicit flux only. Red lines are used for the transport of the coupled solution with fluxes

3 Numerical Results for the Advection–Diffusion Equation

In the following, the new semi-Lagrangian IMEX methods (SL-IMEX) are applied to a set of test cases for the advection–diffusion Eq. (1). All simulations are run with both Algorithm 1 and Algorithm 2 using as a reconstruction operator \({\mathcal {R}}\) a simple cubic spline interpolation, which guarantees fourth order of accuracy in space. We study the numerical convergence in time by firstly considering the transport and the diffusion part of the equation separately, then by proposing a non-trivial solution of the PDE that involves advection as well as diffusive terms simultaneously. Specifically, Test 1 is concerned with the solution of (1) with linear transport, thus the advective velocity is maintained constant in space and time. Test 2 deals with only the transport part of the PDE with an advection speed that is space dependent, neglecting the diffusive contribution. Finally, the convective terms as well as the diffusion part of the equation are solved in Test 3 for which an analytical solution is derived. Figure 4 depicts the numerical solution obtained with a third order SL-IMEX scheme for all the three test problems, and a comparison against the reference solution is shown at the final time of each simulation.

Fig. 4
figure 4

Third order numerical results obtained using the SL-IMEX scheme with Algorithm 2 for the test cases involving the advection–diffusion equation: advection–diffusion equation with linear transport at \(t=0.3\) (left), advection equation with space-dependent transport at \(t=9\) (middle) and advection–diffusion equation with space-dependent transport at \(t=0.1\) (right)

The computational domain is defined by \(\varOmega \in [x_L;x_R]\) and is discretized with a total number of cells \(N_x=1000\). In this way, the numerical error related to the spatial discretization is ensured to be smaller than the time error, which is needed in order to properly study the convergence of the IMEX time stepping. In a similar way, \(N_t\) will be used to denote the number of time steps so that \(\varDelta t=(t_{f}-t_{0})/N_t\). The spatial discretization is of fourth order with a finite difference scheme for the implicit part and a cubic spline reconstruction for the convective terms, while the time accuracy can achieve up to third order. Therefore, for all test cases, we always guarantee the inequality \((\varDelta x)^4<(\varDelta t)^3\) to be satisfied and we report both the mesh spacing and the time step used for each simulation. The stability of an explicit scheme for the numerical solution of (1) can be studied relying on a Von Neumann analysis, which shows that the time step \(\varDelta t\) must be chosen respecting the CFL condition for the advection part (\(\varDelta t^h\)), and the parabolic restriction for the diffusion part (\(\varDelta t^p\)), thus yielding

$$\begin{aligned} \varDelta t = \min (\varDelta t^h,\varDelta t^p) \qquad \text {with} \qquad \frac{\varDelta t^h}{\varDelta x} \max |u| \le \text {CFL}, \quad \frac{\varDelta t^p}{\varDelta x^2} \alpha \le \kappa , \end{aligned}$$
(37)

with \(\text {CFL}\le 1\) and \(\kappa \le 1/2\). On the contrary, the novel semi-Lagrangian IMEX methods are free from both stability conditions (37), and in all the test cases illustrated hereafter we choose the time step as \(\varDelta t=\varDelta t^p\) with \(\kappa =400\). Because the parabolic stability condition is typically much more severe than the hyperbolic counterpart, the novel class of SL-IMEX schemes can solve the advection–diffusion equation with a time step that is about 800 times bigger than the time step corresponding to a fully explicit scheme like the well-known finite difference FTCS (Forward in Time Centered in Space) method.

3.1 Test 1: Advection–Diffusion Equation with Linear Transport

The semi-Lagrangian discretization of the advection terms implies the coupling between time and space discretization, thus the standard IMEX schemes can not be directly applied. More precisely, the semi-Lagrangian version of IMEX schemes needs to properly transport the implicit fluxes according to the velocity field in order to be compatible with the Runge-Kutta stages of the IMEX scheme in time. To check this consistency we perform a simple but not trivial test concerning advection and diffusion. We first set a constant velocity field \(u(x,t)=0.1\) and \(\alpha =10^{-3}\) on the computational domain \(\varOmega \in [-2;2]\). The initial condition is prescribed as a step function centered in \(x_0=-0.25\), so that the exact solution is given by the analytical solution of the stationary heat equation which is furthermore transported at a constant advection speed. This explicitly writes

$$\begin{aligned} q(x,t)=\frac{1}{2}-\frac{1}{2} {{\,\mathrm{erf}\,}}\left( \frac{x-x_0-ut}{\sqrt{4\alpha t}} \right) . \end{aligned}$$
(38)

In order to avoid oscillations due to the discontinuity at \(t=0\), the initial condition is taken at time \(t_0\), namely

$$\begin{aligned} q(x,0)=\frac{1}{2}-\frac{1}{2} {{\,\mathrm{erf}\,}}\left( \frac{x-x_0-ut}{\sqrt{4\alpha (t +t_0)}} \right) , \end{aligned}$$
(39)

with \(t_0=10^{-2}\). SL-IMEX schemes with different accuracy in time are used to compute the solution at the final time \(t_f=0.3\) with both Algorithm 1 and Algorithm 2. Table 1 reports the \(L_2\) error norms and the convergence studies for \(p=[0,1,2]\), demonstrating that the formal order accuracy is achieved by the novel SL-IMEX methods.

Table 1 Convergence study for Test 1 involving the advection–diffusion equation with linear transport

In order to highlight the importance of the time consistency between explicit and implicit contributions, the same test is run with Algorithm 0 that does not operate any transport of the fluxes. The resulting errors and convergence rates are reported in Table 2 where it is clear that only first order is achieved. Notice that since the velocity is constant, the Lagrangian trajectory ODE (3) is solved exactly and the pure diffusion term is of fourth order in space. Therefore the error shown in Table 2 is essentially due to the wrong coupling of the transported advection term and the diffusion contribution, which is extremely important in the construction of high order SL-IMEX schemes.

Table 2 Convergence study for Test 1 involving the advection–diffusion equation with linear transport and Algorithm 0

3.2 Test 2: Advection Equation with Space-Dependent Transport

The aim of this test is to verify the high order time accuracy by solving only the advection part of the PDE, while neglecting the diffusion terms. A non-constant velocity field is considered, so that the high order numerical solution of the ODE for the flow trajectories plays a crucial role for obtaining the formal order of accuracy. The computational domain is defined by \(\varOmega =[-3;3]\) and we set \(u(x,t)=u(x,0)=k_0 x\) with \(k_0=0.2\). The initial condition for the scalar quantity q reads

$$\begin{aligned} q(x,0)= e^{-50 \, x^2}, \end{aligned}$$
(40)

and the simulation is run until the final time \(t_f=9\). For this test an exact solution can be found by following the characteristic equation, see [64]:

$$\begin{aligned} q(x,t)= e^{-50 \, (x \, e^{-k_0 \, t})^2}. \end{aligned}$$
(41)

The resulting convergence rates are reported in Table 3 for both versions of the SL-IMEX algorithms, showing that the order of accuracy is correctly reproduced by all schemes with \(p=[0,1,2]\).

Table 3 Convergence study for Test 2 involving the advection equation with space-dependent transport

3.3 Test 3: Advection–Diffusion Equation with Space-Dependent Transport

Since the transport of the velocity field and the fluxes is an important ingredient in order to achieve the formal order of convergence in time, we propose here a test involving advection and diffusion for a non-constant velocity field. Let \(u(x,t)=u(x,0)=-x\) and \(\alpha >0\). We are looking for an exact solution of the advection–diffusion Eq. (1) written in non-conservative form:

$$\begin{aligned} \frac{\partial {q} }{\partial {t} } -x\frac{\partial {q} }{\partial {x} } = \alpha \frac{\partial ^2 q}{\partial x^2}. \end{aligned}$$
(42)

Let us assume that the solution can be expressed as the product of two independent functions, namely \(q(x,t)= G(x)\cdot H(t)\), where \(G=G(x)\) and \(H=H(t)\) are functions of the space and time only, respectively. Then, q is a solution of (1) if it holds

$$\begin{aligned} \frac{\partial {H} }{\partial {t} } G -x H \frac{\partial {G} }{\partial {x} } = H \alpha \frac{\partial ^2 G}{\partial x^2}. \end{aligned}$$
(43)

This requires to find H and G so that

$$\begin{aligned} \left\{ \begin{aligned} \frac{dH(t)}{dt}&=H(t) \, c_1 \\ \alpha \frac{d^2G(x)}{dx^2}&=G(x) \, c_1 - x \frac{dG(x)}{dx} \end{aligned} \right. , \end{aligned}$$
(44)

for a generic constant \(c_1\). By setting \(c_1=1\), a general solution of the previous system writes

$$\begin{aligned} H(t)= & {} c_0 e^t, \nonumber \\ G(x)= & {} c_2 x+c_3\left( \sqrt{2 \pi \alpha } {{\,\mathrm{erf}\,}}\left( \frac{1}{\sqrt{2}x}\right) x -e^{-\frac{x^2}{2\alpha }}\alpha \right) , \end{aligned}$$
(45)

from which we extract a particular solution by setting \(c_0=1\), \(c_2=-1\), \(c_3=-1/2\), hence obtaining

$$\begin{aligned} q_{ex}(x,t)= e^{t} \cdot \left( -x-\frac{1}{2}\sqrt{2 \pi \alpha } {{\,\mathrm{erf}\,}}\left( \frac{1}{\sqrt{2}x}\right) x -e^{-\frac{x^2}{2\alpha }}\alpha \right) . \end{aligned}$$
(46)

We perform the test by setting the initial condition as \(q(x,0)=q_{ex}(x,0)\) on a domain \(\varOmega =[-10;10]\). The diffusion coefficient is \(\alpha =0.1\) and the final time is set to \(t_f=0.1\). Convergence studies are analyzed and shown in Table 4, which confirm the correct behavior of both Algorithm 1 and 2 up to third order in time.

Table 4 Convergence study for Test 3 involving the advection–diffusion equation with space-dependent transport

4 Extension to Multiple Space Dimensions

In multiple space dimensions, the advection–diffusion equation of a scalar quantity \(q=q(x,y,z)\) reads

$$\begin{aligned} \frac{\partial {q} }{\partial {t} } + \frac{\partial {u q} }{\partial {x} } + \frac{\partial {v q} }{\partial {y} } + \frac{\partial {w q} }{\partial {z} } = \alpha \left( \frac{\partial ^2 q}{\partial x^2} + \frac{\partial ^2 q}{\partial y^2} + \frac{\partial ^2 q}{\partial z^2} \right) , \end{aligned}$$
(47)

and it involves the three-dimensional velocity vector \({\mathbf {u}}=(u,v,w)\) in the computational domain \(\varOmega \) defined by the position vector \({\mathbf {x}}=(x,y,z)\). The characteristic mesh spacings are \(\varDelta x,\varDelta y,\varDelta z\) and the domain is discretized with a total number of cubic cells \(N_E=N_x \times N_y \times N_z\). The Algorithm 2 is extended to Cartesian meshes in 3D, therefore the semi-Lagrangian operator \({\mathcal {L}}\) will involve a multidimensional velocity field, namely \({\mathbf {u}}({\mathbf {x}},t)\), and the trajectory ODE becomes

$$\begin{aligned} \frac{d {\mathbf {x}}}{d t} = {\mathbf {u}}({\mathbf {x}},t), \qquad {\mathbf {x}}(t=0)={\mathbf {x}}_0. \end{aligned}$$
(48)

The 3D version of the algorithm makes use of three main building blocks which we briefly recall hereafter.

  1. 1.

    The backward integration of the Lagrangian trajectories needed in (32a)–(32b) is carried out in the reference space with coordinates \(\varvec{\xi }=(\xi ,\eta ,\zeta )\) with \((\xi ,\eta ,\zeta ) \in [0;1]^3\) following the strategy presented in [64]. This approach easily allows the element which contains the foot of the characteristic to be tracked.

  2. 2.

    The reconstruction operator \({\mathcal {R}}\) given by (17) is computed relying on a CWENO procedure developed in a dimension-by-dimension manner as proposed in [13].

  3. 3.

    The implicit linear system (34) involving an elliptic equation for the unknown \(q_I^{(i)}\) is modified to deal with 3D grids simply by using the central finite difference operator (21) along each spatial direction, hence loosing the structure of a tridiagonal linear system, but still retrieving a diagonally dominant system. The same mathematical problem has been solved in the context of compressible flows in [12] for a scalar unknown given by the fluid pressure.

4.1 Test 4: Pure Advection and Pure Diffusion Equation in 3D

To numerically study the convergence of the discretization related to the 3D trajectory equation, let us consider the test case proposed in [64], in which the diffusion terms are neglected, hence setting \(\alpha =0\) in (47). The computational domain is the cube \(\varOmega =[-0.5;0.5] \times [-0.5;0.5] \times [-0.1;0.1]\) which is discretized by a sequence of successively refined meshes in the \(x-y\) plane, while a constant number of \(N_z=4\) elements is maintained in the \(z-\)direction. Dirichlet boundary conditions are imposed on the \(x-y\) plane, while a periodic domain is considered along the vertical coordinate. The space-dependent velocity field is given by \({\mathbf {u}}=(x^2,y^2,0)\) and the exact solution of the characteristic equation (48) is

$$\begin{aligned} x=\frac{x_0}{t x_0 +1}, \qquad y=\frac{y_0}{t y_0 +1}, \qquad z=z_0, \end{aligned}$$
(49)

and allows the analytical solution for the quantity q to be computed as \(q(t,{\mathbf {x}}_0)=q(0,{\mathbf {x}}(t))\). The initial distribution for q is given by

$$\begin{aligned} q(0,{\mathbf {x}})=1+e^{-\frac{r_1^2}{\delta ^2}}+e^{-\frac{r_2^2}{\delta ^2}}, \end{aligned}$$
(50)

with \(\delta =0.05\), \(r_1^2=(x+0.2)^2+(y+0.2)^2\) and \(r_2^2=(x-0.2)^2+(y-0.2)^2\). The final time of the simulation is \(t_f=0.1\) and the second and third order version of the SL-IMEX scheme are used in both space and time to assess the convergence rate. Table 5 reports the errors in \(L_\infty \) norm and the associated order of accuracy, that is in accordance with the theory. The CFL number is set to \(\text {CFL}=8\) and \(\text {CFL}=12\) for second and third order simulations, respectively, hence the time step has been computed with (37).

Table 5 Numerical convergence results for the three-dimensional advection equation using the second and third order version of the SL-IMEX scheme with \(\text {CFL}=8\) and \(\text {CFL}=12\), respectively. The errors are measured in \(L_\infty \) norm for the transported quantity q at time \(t_f=0.1\)

Next, a diffusion dominated behavior is considered, namely the heat conduction test. The computational domain is given by \(\varOmega =[0;1]^3\) and is discretized with a total number of cells \(N_E=32 \times 32 \times 4\). Dirichlet boundaries are imposed in \(x-\)direction, while periodic boundaries are prescribed elsewhere. The velocity field is set to zero, and the quantity \(q({\mathbf {x}},0)\) is initially assigned a discontinuous distribution according to (26) with the discontinuity located at \(x=0.5\). The third order version of the SL-IMEX scheme is used to run the simulation up to the final time \(t_f=1\) with CFL=40. The exact solution is then given by (27), where we set \(\alpha =10^{-2}\) and \(u=v=w=0\). A three-dimensional view of the diffused quantity q on the \(x-y\) plane is depicted in Fig. 5, while a comparison against the reference solution is shown at output times \(t=5\) and \(t=10\), exhibiting an excellent matching despite the rather coarse mesh and time step.

Fig. 5
figure 5

Third order numerical results obtained using the SL-IMEX scheme with Algorithm 2 for the heat conduction test with \(\alpha =10^{-2}\) at time \(t_f=1\). Three-dimensional view of the quantity q (left) and comparison against the reference solution at time \(t=0.5\) (middle) and \(t=1\) (right). We show a one-dimensional cut through the numerical solution with 200 equidistant points along the line \(y=z=0.5\)

4.2 Test 5: Advection–Diffusion Equation in 3D

As a last test for the 3D advection–diffusion equation, we solve the transport of a tracer in a 3D domain, slightly modifying the setup given in [64] by including also diffusion effects. The domain is \(\varOmega =[-0.5;0.5]^3\) with periodic boundaries in \(z-\)direction and Dirichlet boundary conditions elsewhere. A total number of cubic cells \(N_E=32^3\) is used to build the computational grid. The transport velocity is given by \({\mathbf {u}}=(-y,x,-0.1)\), while the quantity q is initially distributed as a Gaussian bubble centered in \({\mathbf {x}}_c=(x,y,z)=(0,0.2,0.3)\), that is

$$\begin{aligned} q(0,{\mathbf {x}})=1+e^{\frac{(y-x_c)^2+(y-y_c)^2+(z-z_c)^2}{0.1^2}}. \end{aligned}$$
(51)

As a result of the velocity field, the bubble moves following a circular pattern in the \(x-y\) plane and linearly with respect to the bottom along the vertical direction. Furthermore, a diffusive process is taken into account by setting \(\alpha =10^{-4}\) in the governing Eq. (47). The final time is \(t_{f}=2\pi \) and the simulation is carried out with \(\text {CFL}=10\) using both first and third order accurate SL-IMEX schemes in time, while keeping fixed at third order the spatial accuracy. Figure 7 shows the time evolution of the quantity q with the three-dimensional streamlines associated to the velocity field. The high order time discretization clearly reduces the numerical dissipation of the semi-Lagrangian scheme, thus allowing to maintain the initial shape of the bubble, apart from the physical viscosity effects. On the other hand, the first order in time scheme introduces larger errors in the discretization of the Lagrangian trajectories, hence obtaining a distorted shape of the Gaussian bubble which is particularly evident at the final time of the simulation.

Finally, the diffusion process is analyzed in Fig. 7 which plots the shape of the bubble at the final time of the simulation along the plane \(y=0.2\). The first order time discretization yields a non-symmetric shape which is unphysical and which is mostly due to numerical viscosity, while the third order results are able to maintain the symmetry of the solution. Furthermore, almost no quantity q is diffused below the plane \(z=-0.5\), which is not the case for the first order results, where one can notice that the diffusion process has gone beyond the bottom of the domain and it has entered from above because of the periodic boundaries.

Fig. 6
figure 6

Transport and diffusion of a quantity q in a three-dimensional domain at output times \(t=2/5\pi \) (top), \(t=7/5\pi \) (middle) and \(t=2\pi \) (bottom). The results are obtained with first order (left column) and third order (right column) time discretization, while keeping fixed the accuracy in space at third order. The iso-surface \(q=1.25\) is shown and the colors refer to the \(z-\)coordinate

Fig. 7
figure 7

Advection–diffusion of a quantity q in a three-dimensional domain with coefficient \(\alpha =10^{-4}\) at the final time \(t=2\pi \) along the plane \(y=0.2\). The results are obtained with first order (left column) and third order (right column) time discretization, while keeping fixed the accuracy in space at third order

5 Conservative Semi-Lagrangian IMEX Schemes for the Shallow Water System

Semi-Lagrangian methods are typically designed for solving the non-conservative form of the advection equation, thus they cannot be directly applied to the solution of hyperbolic systems of conservation laws involving shock waves. In order to extend the SL-IMEX schemes to such systems, with the aim to properly treat the different space-time scales, we propose in the sequel a conservative formulation of the methods. As a prototype problem we will consider the one-dimensional shallow water equations (SWE):

$$\begin{aligned}&\frac{\partial {h} }{\partial {t} } +\frac{\partial {V} }{\partial {x} } =0, \end{aligned}$$
(52)
$$\begin{aligned}&\frac{\partial {V} }{\partial {t} } +\frac{\partial {uV} }{\partial {x} } +\frac{g}{2}\frac{\partial {h^2} }{\partial {x} } =0, \end{aligned}$$
(53)

where u(xt) is the fluid velocity and \(V(x,t)=hu\) denotes the momentum. Let \(h(x,t)=b(x)+\eta (x,t)\) be the total water depth that is computed as the sum of the prescribed bottom topography b(x) and the location of the free surface \(\eta (x,t)\). For the sake of simplicity, a constant flat bottom is assumed, thus \(b(x)=0\) and therefore \(h(x,t)=\eta (x,t)\). Finally, \(g=9.81\) \(m/s^2\) is the constant gravity acceleration and the eigenvalues of system (52)–(53) are \(\lambda _{1,2}=u{\pm } \sqrt{g h}\). The term containing the gradient of the hydraulic head, i.e. \(g/2 \, \partial _x h^2\), might be responsible for a stiffness in the governing equations, especially when the flow velocity is rather low, thus approaching the low Froude regime. This makes the adoption of an implicit-explicit discretization particularly interesting, in order to separate the slow advection scale from the fast scale related to the pressure.

5.1 Time Discretization

A clever discretization based on the IMEX strategy would consider the pressure terms implicitly, which are responsible of the celerity \(\sqrt{g h}\) in the eigenvalues, while keeping an explicit scheme for the solution of the nonlinear convective contribution, which is related to the quantity u in the eigenvalues. This choice would improve the efficiency of the scheme in low Froude number flows, since a milder time step condition based only on the fluid velocity would be enough to ensure numerical stability. In the following we propose two different semi-discrete schemes, which will be referred to as SL-IMEX-H and SL-IMEX.

SL-IMEX-H method. The semi-discrete SL-IMEX-H scheme for the one-dimensional SWE writes

$$\begin{aligned} h^{n+1}= & {} h^{n} - \varDelta t \frac{\partial {V^{n+1}} }{\partial {x} } , \end{aligned}$$
(54)
$$\begin{aligned} V^{n+1}= & {} V^{n} - \frac{\partial }{\partial x}\left( \int \limits _{t^n}^{t^{n+1}}u V \, dt \right) -\varDelta t \frac{g}{2}\frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } , \end{aligned}$$
(55)

where the convective terms retain the time integral notation which will be useful in the sequel. The advection contribution in (55) is discretized with an explicit conservative SL method, while the flux term in the continuity Eq. (54) is approximated by means of an implicit finite difference scheme, thus we address this method as SL-IMEX-Hybrid scheme. The pressure gradient is discretized relying on a semi-implicit approach, hence obtaining \(\partial _x (h^n h^{n+1})\), from which a linear system on the total water depth naturally arises. This strategy has been recently pursued in [13] for the compressible Navier-Stokes equations and makes use of the autonomous form (5) for the application of IMEX RK schemes. Along the lines of [55, 59], a conservative scheme can then be derived by introducing the following definitions:

$$\begin{aligned} H(x):= & {} \int \limits _{t^n}^{t^{n+1}}u V \, dt, \end{aligned}$$
(56)
$$\begin{aligned} F(x):= & {} V^n - \frac{\partial {H(x)} }{\partial {x} } , \end{aligned}$$
(57)

where H(x) is the time integral of the momentum flux and F is an operator that contains the discretization of the explicit convective terms. Formal substitution of the momentum \(V^{n+1}\) given by (55) into the continuity Eq. (54) leads to

$$\begin{aligned} h^{n+1}- \varDelta t^2 \, \frac{g}{2} \frac{\partial {^2 {h}^{n} h^{n+1}} }{\partial {x^2} } =h^n {-}\varDelta t \frac{\partial {F} }{\partial {x} } , \end{aligned}$$
(58)

where the definition (57) has been used and the only unknown is the total water depth at the new time level, i.e. \(h^{n+1}\). Equation (58) represents a linear system for the unknown \(h^{n+1}\) that can be solved using an efficient matrix-free implementation of the conjugate gradient method. Once the solution is obtained, the momentum can readily be updated according to (55).

Remark on shock discontinuities. For further stabilization at strong shock waves, an additional numerical flux should be embedded into the continuity Eq. (54) in order to introduce some numerical diffusion [65]. Specifically, the semi-discrete continuity equation takes the form

$$\begin{aligned} h^{n+1}=h^{n} - \varDelta t \left[ \frac{\partial {V^{n+1}} }{\partial {x} } - \frac{\lambda _{\max }(x)}{2}\frac{\partial {\delta ^{n+1}} }{\partial {x} } \right] , \qquad \delta ^{n+1}=h^{n+1,+} - h^{n+1,-}, \end{aligned}$$
(59)

with \(\lambda _{\max }(x)\) being the maximum eigenvalue of the shallow water system and \(\delta ^{n+1}\) representing a measure of the jump of the solution across cell interfaces in the spatial discretization between right and left state, i.e. \(h^{n+1,+} \) and \(h^{n+1,-}\), respectively. This corresponds to the use of a local Lax-Friedrichs flux in the mass conservation equation. Moreover, the introduction of implicit numerical viscosity in the form (59) does not affect neither the stability of the scheme nor the symmetry of the linear system (58).

SL-IMEX method. Alternatively, the shallow water system can be discretized in time as

$$\begin{aligned} h^{n+1}= & {} G(x), \qquad G(x):=h^{n} - \frac{\partial {} }{\partial {x} } \int \limits _{t^n}^{t^{n+1}}V \, dt, \end{aligned}$$
(60)
$$\begin{aligned} V^{n+1}= & {} F(x) -\varDelta t \frac{g}{2}\frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } , \end{aligned}$$
(61)

where the convective term G(x) in the continuity Eq. (60) is approximated relying on a SL scheme, following the approach which will be discussed for F(x) hereafter. As a consequence, \(h^{n+1}\) is explicitly solvable, thus it is directly substituted into the momentum Eq. (61) for yielding \(V^{n+1}\). The SL algorithm is used twice, namely for the term G(x) and for F(x), hence obtaining a formally semi-implicit method that does not require the solution of an implicit system, differently from the SL-IMEX-H method.

5.2 Space Discretization

As done for the advection–diffusion equation, let \(\varOmega \) be the computational domain defined in the interval \([x_L;x_R]\) and let \(N_x\) represent the total number of cells used to discretize \(\varOmega \). Each cell has a constant spacing of \(\varDelta x=(x_R-x_L)/N_x\) and a cell-centered space discretization is adopted, thus both conserved quantities are defined at the cell barycenter \(x_i\), namely \(h_i:=h(x_i)\) and \((hu)_i :=h(x_i)u(x_i)\).

The discrete version of the differential operators \(\partial _x\) and \(\partial ^2_{x^2}\) for a generic quantity q(x) is based on a fourth order finite difference approximation, hence yielding

$$\begin{aligned} \left. \frac{\partial q}{\partial x} \right| _{x=x_i}= & {} \frac{1}{12 \varDelta x}\left( -q_{i+2} + 8 q_{i+1}- 8 q_{i-1} +q_{i-2} \right) , \end{aligned}$$
(62)
$$\begin{aligned} \left. \frac{\partial ^2 q}{\partial x^2} \right| _{x=x_i}= & {} \frac{1}{12 \varDelta x^2}\left( -q_{i+2} + 16 q_{i+1} + 30 q_{i} + 16 q_{i-1} -q_{i-2} \right) . \end{aligned}$$
(63)

In order to obtain a high order representation of the numerical solution within each computational cell, a CWENO reconstruction operator \({\mathcal {R}}\) is adopted (see [39]). This allows smooth as well as discontinuous solutions to be properly treated ensuring non-oscillatory properties.

Remark on the well-balanced property. A numerical scheme is said to be well-balanced if it is proven to guarantee steady state solutions of the governing PDE without introducing numerical errors that eventually do not preserve an equilibrium state of the system. For the shallow water system, this property is often called the C-property, which will be analyzed for both the SL-IMEX-H and the SL-IMEX algorithm. Without loss of generality, let us assume a one-dimensional computational domain with periodic boundaries and let us consider a constant initial state given by

$$\begin{aligned} h(x,t=0) = h_0, \qquad u(x,t=0)=u_0, \qquad V(x,t=0) = u_0 h_0:=V_0, \end{aligned}$$
(64)

which is an equilibrium solution of the SWE (52)–(53).

For the SL-IMEX-H scheme (54)–(55), the semi-Lagrangian operator F(x) in (57) results to be

$$\begin{aligned} F(x)=V_0 - \frac{\partial }{\partial x} \left( u_0 V_0 \int \limits _{t^n}^{t^{n+1}} \, dt \right) = V_0, \end{aligned}$$
(65)

since central (symmetric) finite difference operators are used for the spatial discretization of the gradient operator according to (62). This also holds true for second derivative operators like (63) applied to any constant state. Therefore \(\partial F/\partial x = 0\) and the continuity equation (58) is given by

$$\begin{aligned} h^{n+1} - h_0 \varDelta t^2 \, \frac{g}{2} \frac{\partial {^2 h^{n+1}} }{\partial {x^2} } =h_0, \end{aligned}$$
(66)

which admits solution \(h^{n+1}=h_0\). The momentum is then updated according to (55), hence

$$\begin{aligned} V^{n+1} = V_0 - \frac{\partial F}{\partial x} - \varDelta t \frac{g}{2} \frac{\partial h_0^2}{\partial x} = V_0, \end{aligned}$$
(67)

therefore one obtains \(h^{n+1}=h_0\) and \(V^{n+1}=V_0\), which is a well-balanced solution.

For the SL-IMEX Algorithm (60)–(61), the evaluation of the operator G(x) leads to

$$\begin{aligned} G(x)=h_0 - \frac{\partial {} }{\partial {x} } V_0 \int \limits _{t^n}^{t^{n+1}} \, dt = h_0, \end{aligned}$$
(68)

thus \(h^{n+1}=h_0\) according to (60). Similarly, the momentum equation yields

$$\begin{aligned} V^{n+1} = F(x) -\varDelta t \frac{g}{2}\frac{\partial {{h}_0^2} }{\partial {x} } = V_0. \end{aligned}$$
(69)

The proposed SL-IMEX-H and SL-IMEX schemes are therefore well-balanced discretizations of the shallow water system.

5.3 Conservative Semi-Lagrangian IMEX Schemes

We present a conservative formulation of the SL method by considering only the advection term F(x), given by (57), in the momentum Eq. (55) for the SL-IMEX-H scheme. The term G(x) in the continuity Eq. (60) for the SL-IMEX algorithm can then be computed following the same approach outlined for F(x).

For the discretization of the convective contribution F(x) in the momentum Eq. (55), the semi-Lagrangian schemes discussed in Sect. 2.2 can be used with no modifications. This would lead to a non-conservative transport of the momentum, which in principle does not represent a problem if incompressible flows are considered [75] or parabolic PDE are likely to be solved. However, if shock waves are part of the eigenstructure of the governing system, as usually occur for hyperbolic PDE like the SWE, then the design of conservative methods is mandatory in order to capture the correct wave speeds and location of the discontinuities and the plateau exhibited by the solution.

Therefore we aim at constructing a conservative version of the semi-Lagrangian IMEX schemes previously introduced. We propose to use here a new philosophy in order to discretize F(x), which has been very recently introduced in [75] for scalar PDE. The idea is the following: given a starting point \(x_i\), the Lagrangian trajectory of this point would travel through the flow lines according to (3) up to the point \(x_i^L\) at time \(t^n\). Looking at Fig. 8, let now \(\varOmega _{t,x}\) be the space-time domain that is the region bounded by the segments \([x_i^L;x_i]\) and \([t^n;t^{n+1}]\), which lies below the trajectory.

Fig. 8
figure 8

Space-time domain \(\varOmega _{t,x}\) used to develop the conservative SL-IMEX schemes

For the sake of simplicity, let us consider only the advection part of the PDE (1), that is nothing but the simple advection equation

$$\begin{aligned} \frac{\partial {q} }{\partial {t} } + \frac{\partial {u q} }{\partial {x} } = 0. \end{aligned}$$
(70)

By defining the space-time divergence operator as \(\nabla _{t,x}=(\partial _t, \partial _x)\), the integration of the advection Eq. (70) over \(\varOmega _{t,x}\) and the use of the divergence theorem in the fully space-time framework leads to

$$\begin{aligned} \int _{\varOmega _{t,x}} \partial _t q +\partial _x (u q) \, dx dt= & {} \int _{\varOmega _{t,x}} \nabla _{t,x}\cdot (q,uq)\, dx dt \nonumber \\= & {} -\int _{\varGamma ^{L}}(q,uq)\cdot \mathbf {n} \, ds - \int _{x_i^L}^{x_i}q \, dx + \int _{t^n}^{t^{n+1}} uq \, dt, \end{aligned}$$
(71)

with \(\varGamma ^{L}\) denoting the boundary defined by the Lagrangian trajectory of the particle traveling from \(x_i\) to \(x_i^L\) (highlighted in red in Fig. 8). By construction, since the tangent vector to \(\varGamma ^{L}\) is given by the velocity of the trajectory, the normal vector results to be \(\mathbf {n}=\beta (1,-1/u)\) with \(\beta =|u|/\sqrt{(u^2+1)}\) and therefore the integral along \(\varGamma ^{L}\) in (71) vanishes, i.e.

$$\begin{aligned} \int _{\varGamma ^{L}}(q,uq)\cdot \mathbf {n} ds = \int _{\varGamma ^{L}} {\beta }\left( q - \frac{1}{u}uq\right) \, ds = 0. \end{aligned}$$
(72)

As a consequence, from (71) it follows a simple way to compute \(H_i:=H(x_i)\) for the advection Eq. (70) that only needs spatial information:

$$\begin{aligned} H_i := \int _{t^n}^{t^{n+1}} uq \, dt = \int _{x_i^L}^{x_i}q \, dx. \end{aligned}$$
(73)

Once \(H_i\) is computed for each computational cell, a CWENO reconstruction operator \({\mathcal {R}}\) can be applied in order to obtain a piecewise high order polynomial representation of \(H_i\). At this point, a classical conservative scheme is used to compute \(F_i:=F(x_i)\), i.e.

$$\begin{aligned} F_i=q_i^n-\frac{1}{\varDelta x}({\hat{H}}_{i+1/2}-{\hat{H}}_{i-1/2}), \end{aligned}$$
(74)

where \({\hat{H}}_{i{\pm }1/2}\) are numerical fluxes given by a local Lax-Friedrichs scheme.

The boundary extrapolated values of H(x) at the interfaces in (74) are provided by the CWENO reconstruction operator. Notice that in the conservative scheme (74) the time step \(\varDelta t\) is missing because it is already incorporated in the space-time integral (73), thus it is contained in the integral over the interval \(x=[x_i^L;x_i]\). Furthermore, this approach allows to reconstruct a purely spatial flux from the semi-Lagrangian discretization that is not possible in a classical formulation of the SL method due to the space-time nature of the Lagrangian trajectories. Therefore, in the construction of a conservative SL-IMEX scheme, for the explicit convective contribution we can use (74) to identify a flux as needed in the Eulerian IMEX scheme (9a)–(10), even though a semi-Lagrangian approach is adopted. The purely spatial part of the flux simply writes \({\hat{H}}_{i{\pm }1/2}/\varDelta t\) because the time step is taken into account by the integral (73).

Remark on the computation of the foot of the trajectory. The conservative SL-IMEX-H scheme can easily be cast into the Eulerian advection form presented in Sect. 2.1. However, the velocity field has in any case to be advected according to the previously described Algorithm 1 in Sect. 2.2. Since the trajectory equation associated to the evaluation of H(x) in (56) might involve a nonlinear transport, the coordinates \(x^L_i\), needed for obtaining \(H_i\) in (73), have to be computed relying on a nonlinear ODE solver for the trajectory equation (3), such as the class of Runge-Kutta Exponential Integrators [15, 21, 75], or a predictor-corrector strategy [73], or even a Taylor method [45, 64] which we rely on in this work.

Unfortunately it is easy to show that the conservative semi-Lagrangian approximation (73)–(74), if applied to the shallow water equations, would lead to a first order (in time) discretization even for constant solutions. Indeed, let u(x) and h(x) be a steady solution of (52)–(53), which might be non-constant in space. Then, the space-time integral (71) is not valid anymore since we also need to introduce the pressure fluxes that are part of the governing PDE system. Therefore, instead of (71), integration of the momentum equation over the same space-time control volume \(\varOmega _{t,x}\) would lead to

$$\begin{aligned} \int _{\varOmega _{t,x}} \partial _t hu +\partial _x (h u^2) \, dx dt= & {} \int _{\varOmega _{t,x}} \nabla _{t,x}\cdot (hu,hu^2) \, dx dt \nonumber \\= & {} - \int _{x_i^L}^{x_i}(hu)^n \, dx + \int _{t^n}^{t^{n+1}} hu^2 \, dt +\frac{g}{2}\int _{\varOmega _{t,x}}\partial _x h^2 \, dx dt. \nonumber \\ \end{aligned}$$
(75)

Compared to (71), the last term on the right hand side of (75) arises because of the pressure contribution in the momentum Eq. (53). Now, this additional multidimensional integral, which will be addressed with \({\mathcal {P}}\), may be split using the property of normal domains as follows

$$\begin{aligned} {\mathcal {P}}:=\frac{g}{2}\int _{\varOmega _{t,x}}\partial _x h^2 \, dx dt=\frac{g}{2}\int _{t^n}^{t^n+1}{\int _{x^L(t)}^{x_i} \partial _x h^2 \, dx dt}= \frac{g}{2}\int _{t^n}^{t^{n+1}} h^2(x_i)-h^2(x^L(t)) \, dt, \end{aligned}$$
(76)

where \(x^L(t)\) is the foot of the characteristic located at time t, so that \(x^L(t^{n+1})=x_i\) and \(x^L(t^n)=x_i^L={\mathcal {L}}(x_i,\varDelta t, u)\). Integration of (76) can be done numerically with a quadrature rule of suitable order of accuracy, see Fig. 8 where the simple midpoint rule is illustrated.

Cauchy–Kovalevskaya procedure. For achieving an order of accuracy greater than one, the quadrature nodes for the evaluation of the additional time integral \({\mathcal {P}}\) in (76) require the knowledge of h inside the space-time domain. First, we observe that the only available high order information comes from the CWENO reconstruction polynomials defined at time \(t^n\). Second, although a time reconstruction would provide the values of h at quadrature nodes, it would demand the knowledge of the solution at N points backward in time, thus needing a sort of initialization which prevents the algorithm to start from time \(t_0\) (see for instance the class of BDF or Adams-Moulton schemes for ODE). Therefore, we propose to use a different strategy, that is based on the approximation of h(t) by means of a Taylor series:

$$\begin{aligned} h(t) = h(t^n) + (t-t^n) \frac{\partial {h} }{\partial {t} } + \frac{(t-t^n)^2}{2} \frac{\partial {^2 h} }{\partial {t^2} } + {\mathcal {O}}(\varDelta t^3), \end{aligned}$$
(77)

which holds true for all cell values located at \(x_i\) with \(i=1 \ldots N_x\). To compute high order time derivatives we rely on the Cauchy-Kovalevskaya procedure which uses repeatedly the governing PDE to convert time partial derivatives into spatial partial derivatives. For the SWE (52)–(53), the terms \(\partial _t h\) and \(\partial _{t^2}^2 h\) in (77) are evaluated as follows:

$$\begin{aligned} \frac{\partial {h} }{\partial {t} }&= - \frac{\partial {V} }{\partial {x} } \end{aligned}$$
(78a)
$$\begin{aligned} \frac{\partial {^2h} }{\partial {t^2} }&= \frac{\partial }{\partial t} \left( - \frac{\partial {V} }{\partial {x} } \right) \nonumber \\&= \frac{\partial }{\partial x} \left( - \frac{\partial {V} }{\partial {t} } \right) \nonumber \\&= \frac{\partial ^2}{\partial x^2} \left( uV + \frac{g}{2} h^2 \right) . \end{aligned}$$
(78b)

The computation of (78a) is readily available from the CWENO reconstruction operator applied to the conserved quantity V, i.e. \({\mathcal {R}}(V(x_i,t^n))\). The evaluation of the term (78b) requires two steps: i) first, the cell value of the flux term must be defined, that is

$$\begin{aligned} G(x_i):= u_i V_i + \frac{g}{2} h_i^2 \qquad i=1\ldots N_x, \end{aligned}$$
(79)

ii) then, the CWENO reconstruction is used to obtain a high order approximation of \(G(x_i)\), i.e. \({\mathcal {R}}(G(x_i))\), so that the second derivatives can be easily extracted and the term (78b) explicitly computed. Once the Taylor series (77) is completely determined, the value of \(h^2\) needed in (76) can be obtained at any time level within the interval \([t^n;t^{n+1}]\). The integral \({\mathcal {P}}\) in (76) is numerically computed using quadrature rules of suitable accuracy, that are listed hereafter up to fourth order accurate schemes.

  • Midpoint rule for second order of accuracy:

    $$\begin{aligned} {\mathcal {P}} = \frac{g}{2} \varDelta t \left[ h^2(x_i,t^{n+1/2})-h^2(x^L(t^{n+1/2})) \right] + {\mathcal {O}}(\varDelta t^2). \end{aligned}$$
    (80)
  • Kepler rule for up to fourth order of accuracy:

    $$\begin{aligned} {\mathcal {P}}= & {} \frac{g}{2} \varDelta t \, \frac{1}{6} \left[ h^2(x_i,t^n)-h^2(x^L(t^{n})) \right] \nonumber \\&+\frac{g}{2} \varDelta t \, \frac{2}{3} \left[ h^2(x_i,t^{n+1/2})-h^2(x^L(t^{n+1/2})) \right] \nonumber \\&+\frac{g}{2} \varDelta t \, \frac{1}{6} \left[ h^2(x_i,t^{n+1})-h^2(x^L(t^{n+1})) \right] + {\mathcal {O}}(\varDelta t^4), \end{aligned}$$
    (81)

    where the solutions \(h^2(x_i,t^{n+1/2})\) and \(h^2(x_i,t^{n+1})\) are readily computed with the Taylor expansion (77).

We recall here that higher order time stepping can be achieved by applying the implicit-explicit discretization presented above to the class of high order IMEX schemes given by (9)–(10) with the tableaux reported in Appendix A.

Remark. The additional term \({\mathcal {P}}\) in (76) can be written, using the mean value theorem, as

$$\begin{aligned} \frac{g}{2}\int _{t^n}^{t^{n+1}} h^2(x_i)-h^2(x^L(t)) dt={ \frac{g}{2}}\left[ h^2(x_i,t_c)-h^2(x^L(t_c))\right] \, \varDelta t \approx { \frac{g}{2}} \delta (t_c) \, \varDelta t, \end{aligned}$$
(82)

where \(t_c \in [t^n;t^{n+1}]\) and \(\delta (t_c)\) is the mean value of the integrand function. For a non-constant solution \(h=h(x,t)\), or even in the case of steady non-constant solutions like \(h=h(x)\), neglecting this contribution as done in (71) would introduce a first order local truncation error.

6 Asymptotic-Preserving Semi-Lagrangian IMEX Schemes

In order to extend the previous scheme (54)-(55) with the novel conservative semi-Lagrangian IMEX methods to the case of hyperbolic balance laws, let us consider the shallow water equations with a relaxation term [51], that is given by

$$\begin{aligned}&\frac{\partial {h} }{\partial {t} } +\frac{\partial {V} }{\partial {x} } =0, \end{aligned}$$
(83)
$$\begin{aligned}&\frac{\partial {V} }{\partial {t} } +\frac{\partial {uV} }{\partial {x} } +\frac{g}{2}\frac{\partial {h^2} }{\partial {x} } =\frac{h}{\varepsilon }\left( \frac{h}{2} - u \right) , \end{aligned}$$
(84)

with \(\varepsilon \) being a relaxation parameter. In the stiff limit, i.e. when \(\varepsilon \rightarrow 0\), system (83)–(84) reduces to the inviscid Burgers equation

$$\begin{aligned} \frac{\partial {h} }{\partial {t} } + \frac{\partial }{\partial x} \left( \frac{h^2}{2}\right) = 0. \end{aligned}$$
(85)

On the other hand, if \(\varepsilon \rightarrow \infty \) the shallow water PDE system (54)–(55) is consistently retrieved because the source term simply vanishes.

Let us now propose two different semi-discrete AP schemes for the relaxation system (83)–(84), which arise from the SL-IMEX-H and SL-IMEX methods illustrated in Sect. 5.3.

SL-IMEX-H AP method. The first method directly follows from (54)–(55) and yields

$$\begin{aligned} h^{n+1}= & {} h^{n} - \varDelta t \frac{\partial {V^{n+1}} }{\partial {x} } , \end{aligned}$$
(86)
$$\begin{aligned} V^{n+1}= & {} F(x) -\varDelta t \frac{g}{2}\frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } + \varDelta t \, \left( \frac{{h}^{n} h^{n+1}}{2 \varepsilon } - \frac{V^{n+1}}{\varepsilon } \right) , \end{aligned}$$
(87)

where the relaxation source is discretized implicitly, so that the second term is linear with respect to \(V^{n+1}\) and can be readily inverted. Notice that the conservative semi-Lagrangian scheme is already embedded in the definition of the term F(x) according to (57). From (87), by solving for \(V^{n+1}\), we obtain

$$\begin{aligned} V^{n+1} \gamma =F(x) -\varDelta t \frac{g}{2}\frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } + \varDelta t \frac{{h}^{n} h^{n+1}}{2 \varepsilon }, \qquad \gamma = \frac{\varepsilon +\varDelta t}{\varepsilon }, \end{aligned}$$
(88)

that can be substituted into the continuity equation (86), hence yielding

$$\begin{aligned} h^{n+1} = h^{n} - \varDelta t \frac{\partial }{\partial x} \left( \frac{F(x)}{\gamma } \right) + \frac{\varDelta t^2}{\gamma } \frac{g}{2} \frac{\partial }{\partial x} \left( \frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } \right) - \frac{\varDelta t^2}{\gamma \varepsilon } \frac{\partial }{\partial x} \left( \frac{{h}^{n} h^{n+1}}{2} \right) . \end{aligned}$$
(89)

Now, the limit of the relaxation system (54)–(55) can be analyzed starting from the semi-discrete form (89), which represents the novel conservative SL scheme introduced in this work. In the limit for \(\varepsilon \rightarrow 0\) it holds

$$\begin{aligned} \lim \limits _{\varepsilon \rightarrow 0} \frac{1}{\gamma } = 0, \qquad \lim \limits _{\varepsilon \rightarrow 0} \frac{1}{\gamma \varepsilon } = \frac{1}{\varDelta t}, \end{aligned}$$
(90)

therefore the scheme given by (89) simplifies to

$$\begin{aligned} h^{n+1} = h^{n} - \varDelta t \frac{\partial }{\partial x} \left( \frac{{h}^{n} h^{n+1}}{2} \right) , \end{aligned}$$
(91)

which is a consistent discretization of the limit model (85). The proposed SL-IMEX-H method is asymptotic preserving (AP). Furthermore, the semi-Lagrangian discretization does not affect the AP property, which is ensured by the IMEX time stepping.

SL-IMEX AP method. The second discretization is based on the scheme (60)–(61), thus the relaxation system (83)–(84) can be discretized in time as

$$\begin{aligned} h^{n+1}= & {} G(x), \qquad G(x):=h^{n} - \frac{\partial {} }{\partial {x} } \int \limits _{t^n}^{t^{n+1}}V \, dt, \end{aligned}$$
(92)
$$\begin{aligned} V^{n+1}= & {} \frac{F(x)}{\gamma } -\frac{\varDelta t}{\gamma } \frac{g}{2}\frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } + \frac{\varDelta t}{\gamma \varepsilon } \frac{{h}^{n} h^{n+1}}{2 \varepsilon }, \qquad \gamma = \frac{\varepsilon +\varDelta t}{\varepsilon }, \end{aligned}$$
(93)

Similarly to what discussed above, we can characterize the limit of (92)-(93) for \(\varepsilon \rightarrow 0\). According to (90), from the momentum Eq. (93) one has \(V^{n+1}\rightarrow (h^{n+1})^2/2\). Therefore, \(u=(V/h)\rightarrow h^{n+1}/2\) and the continuity equation becomes

$$\begin{aligned} {h^{n+1}= h^{n} - \varDelta t \frac{\partial {V^{n+1}} }{\partial {x} } = h^{n} - \varDelta t \frac{\partial }{\partial x} \left( \frac{(h^{n+1})^2}{2}\right) }, \end{aligned}$$
(94)

which is a semi-Lagrangian discretization of the inviscid Burgers Eq. (85) at first order in time. To construct higher order time discretizations, the semi-Lagrangian operator G(x) must be projected in the stiff limit to each intermediate stage of a Runge-Kutta method, as studied in Sect. 2.2. Notice that the advection speed in (94) is consistently retrieved, hence leading to an AP method.

The SL-IMEX scheme (92)–(93) is formally unconditionally stable and completely explicit from the computational viewpoint. Nevertheless, in case of shocks or strong discontinuity exhibited by the solution, it is necessary to supplement the continuity Eq. (92) with additional numerical viscosity according to (59). As already done, we adopt an implicit treatment of the numerical dissipation, that leads to the solution of a linear system for the unknown \(h^{n+1}\). This algorithm makes use of the conservative SL method for the advection of both mass and momentum, thus it is simply denoted with SL-IMEX.

Higher order SL-IMEX AP methods can be derived by adopting the same implicit-explicit partitioning here described in the high order IMEX setting (9)–(10). We omit the details for brevity.

Remark on the low Froude number limit. The approach here designed permits to capture also diffusive behaviors of the shallow water system with relaxation terms. Specifically, the stiffness related to the pressure gradient in the SWE can be highlighted by introducing a scaling based on the Froude number \(Fr=|u|/\sqrt{g h}\) and assuming dimensionless variables. Following [42], the shallow water system supplemented with the relaxation source term introduced in (83)–(84), can be rewritten in the following form

$$\begin{aligned}&\frac{\partial {h} }{\partial {t} } +\frac{\partial {V} }{\partial {x} } =0, \end{aligned}$$
(95)
$$\begin{aligned}&\frac{\partial {V} }{\partial {t} } +\frac{\partial {uV} }{\partial {x} } +\frac{1}{2Fr^2}\frac{\partial {h^2} }{\partial {x} } =\frac{h}{\varepsilon }\left( \frac{h}{2} - u \right) , \end{aligned}$$
(96)

with eigenvalues \(\lambda _{1,2}=u \left( 1 {\pm } 1/Fr\right) \). The derivation of the asymptotic limit of the shallow water equations in the low Froude regime has been studied for instance in [4, 29] and references therein. Here, we limit us to provide the asymptotic limit of (95)–(96). Assuming \(\varepsilon = O(Fr^2)\), in the limit \(\varepsilon \rightarrow 0\) system (95)–(96) reduces to the viscous Burgers equation

$$\begin{aligned} \frac{\partial {h} }{\partial {t} } + \frac{\partial }{\partial x} \left( \frac{h^2}{2}\right) = \frac{1}{2}\frac{\partial ^2 h^2}{\partial x^2}. \end{aligned}$$
(97)

To obtain a numerical scheme which is in principle unconditionally stable, despite the physical scale of the problem under consideration, one might discretize the advection flux term with the novel SL algorithm proposed in this work, while the diffusive terms relying on an implicit finite difference scheme, thus ensuring stability regardless the chosen time step. Under the assumption \(\varepsilon = O(Fr^2)\), the semi-discrete scheme reads then as follows:

$$\begin{aligned} h^{n+1}= & {} G(x), \qquad G(x):=h^{n} - \int \limits _{t^n}^{t^{n+1}} \frac{\partial {V} }{\partial {x} } \, dt, \end{aligned}$$
(98)
$$\begin{aligned} V^{n+1}= & {} \frac{F(x)}{\gamma } -\frac{\varDelta t}{2\gamma \varepsilon } \frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } + \frac{\varDelta t}{\gamma \varepsilon } \frac{{h}^{n} h^{n+1}}{2 }, \qquad \gamma = \frac{\varepsilon +\varDelta t}{\varepsilon }. \end{aligned}$$
(99)

In the limit \(\varepsilon \rightarrow 0\), the momentum Eq. (99) becomes

$$\begin{aligned} V^{n+1} = -\frac{1}{2} \frac{\partial {{h}^{n} h^{n+1}} }{\partial {x} } + \frac{{h}^{n} h^{n+1}}{2 }, \end{aligned}$$
(100)

which, after substitution into the continuity Eq. (98), yields the discrete version of the limit Eq. (97):

$$\begin{aligned} h^{n+1} - {\hat{G}}(x) = \frac{\varDelta t}{2} \frac{\partial {^2 {h}^{n} h^{n+1}} }{\partial {x^2} } , \qquad {\hat{G}}(x) := h^n + \frac{\partial }{\partial x}\int \limits _{t^n}^{t^{n+1}} \frac{h^2}{2} \, dt. \end{aligned}$$
(101)

We underline that the advection flux \({\hat{G}}(x)\) can be computed using the conservative SL schemes, while implicit finite differences might be employed for the diffusive terms.

7 Numerical Results for the Shallow Water System

In this section, we perform some numerical test cases which aim at demonstrating the accuracy and the robustness of the conservative version of the SL-IMEX schemes. First, numerical convergence studies are presented to show that the formal order of accuracy is achieved. Second, a smooth solution involving a pressure wave propagation is used to highlight the benefits of the high order method in terms of energy dissipation. The total energy E is computed as the sum of kinetic K and potential U energy contribution, which are given by

$$\begin{aligned} E = K + U, \qquad K = \int \limits _{\varOmega } \frac{h u^2}{2} \, dx, \qquad U = \int \limits _{\varOmega } \frac{g h^2 }{2} \, dx. \end{aligned}$$
(102)

Third, two Riemann problems are solved which deal with shock waves, where a conservative scheme is crucial for obtaining the correct propagation speed. Fourth, the asymptotic preserving property of the SL-IMEX schemes is verified by solving a set of smooth and discontinuous test cases for the relaxation system of the SWE in the stiff limit.

The CFL stability condition for an explicit solver of the SWE (52)–(53) is given by

$$\begin{aligned} \text {CFL} = \frac{\varDelta t \, \max \left( |u| + \sqrt{g h}\right) }{\varDelta x}, \end{aligned}$$
(103)

which leads to the condition \(\text {CFL}<1\). Because of both the semi-Lagrangian discretizations of the convection terms (SL-IMEX and SL-IMEX-H) and the implicit treatment of the pressure flux in (55) and (61), the proposed method is unconditionally stable for any time step \(\varDelta t\). As a consequence, the time step can be defined only by the physical time scale of the problem under consideration and not by numerical restrictions. For each test case shown in the sequel, we explicitly report the resulting CFL number, according to the definition (103).

7.1 Numerical Convergence Studies

Here, a smooth steady state problem is considered to measure the order of accuracy of the SL-IMEX-H schemes. Notice that the semi-Lagrangian approach directly solves the Lagrangian form of the advection term (2) and, as such, even a steady solution is not trivial to be maintained since the algorithm formally transports backward and forward the numerical solution. On the other hand, we propose a steady state solution of the SWE (52)–(53) because it easily allows an analytical solution to be derived, so that convergence studies can be carried out.

We consider a computational domain \(\varOmega =[-10;10]\) and we prescribe the following initial condition for the fluid velocity at \(t=0\):

$$\begin{aligned} u(x)= 1 + a \cos \left( \frac{2\pi }{10}x \right) , \qquad a \in \mathbb {R}. \end{aligned}$$
(104)

To obtain a steady solution for the momentum, the advection contribution must be exactly balanced by the pressure fluxes, which means solving the following ODE:

$$\begin{aligned} \frac{d hu^2}{d x} = - gh \frac{d h}{x}, \end{aligned}$$
(105)

that yields the sought water depth

$$\begin{aligned} \begin{aligned} h(x) =&\frac{-8 \cos (\alpha x)-\cos (\alpha x)^2 - 16}{16 \, g} \\&+\frac{1}{16 \, g} \sqrt{96\cos (\alpha x)^2+16\cos (\alpha x)^3 +256\cos (\alpha x) + \cos (\alpha x)^4 + 256 -512 g c}, \\&\alpha = \frac{\pi }{5}. \end{aligned}\nonumber \\ \end{aligned}$$
(106)

We set \(a=5\) in (104) and \(c=-1\) in (106), then the continuity Eq. (52) must be supplemented with a source term S(hV) that maintains constant over time the water depth given by (106), thus we solve

$$\begin{aligned} h^{n+1}=h^{n} - \varDelta t \frac{\partial {V^{n+1}} }{\partial {x} } + \varDelta t \, S(h,V)^{n+1}, \qquad S(h,V)^{n+1}=\frac{\partial {V^{n+1}} }{\partial {x} } , \end{aligned}$$
(107)

where the source term is discretized implicitly so that we ensure a perfectly compatible discretization that keeps a constant water depth up to machine precision.

The simulation is run until the final time \(t_f=0.2\) with CFL=2 on a sequence of five successively refined meshes obtained by a refinement factor of 2 applied to the number of cells, i.e. \(N_x=\{50,100,200,400,800\}\). Figure 9 shows a comparison between a third order numerical solution with \(N_x=400\) and the analytical solution, as well as the time evolution of the energy which is perfectly preserved constant over time.

Fig. 9
figure 9

Numerical convergence test with third order SL-IMEX-H scheme at time \(t=0.2\) with \(N_x=400\). Comparison against the reference solution for water height (left) and velocity (middle), and time evolution of potential, kinetic and total energy (right)

Table 6 reports the convergence studies for second and third order SL-IMEX-H schemes, where errors are measured in \(L_\infty \) norm for the momentum V, that is

$$\begin{aligned} L_\infty = \max _i \left| V_i-V_i^{ex}\right| , \qquad i=1 \ldots N_x, \end{aligned}$$
(108)

with the exact momentum \(V_i^{ex}= h(x_i) u(x_i)\) computed from the analytical solution (104)–(106). The formal order of accuracy is achieved by the proposed numerical method, which is possible if the additional integral \({\mathcal {P}}\) in (76) is properly considered. Neglecting the contribution of \({\mathcal {P}}\) would inevitably yield only first order accurate results, despite the high order CWENO reconstruction in space and the high order IMEX scheme in time, as demonstrated by the numerical experiments reported in Table 6.

Table 6 Numerical convergence results for the one-dimensional shallow water equations with CFL=2 using second and third order SL-IMEX-H schemes with and without the time integral term \({\mathcal {P}}\) in the semi-Lagrangian scheme given by (76). The errors are measured in \(L_\infty \) norm and refer to the momentum V at time \(t_f=0.2\)
Table 7 Numerical convergence results for the one-dimensional shallow water equations with CFL=2 using third order SL-IMEX-H schemes with different values of the Froude number. The errors are measured in \(L_\infty \) norm and refer to the momentum V at time \(t_f=0.2\)
Fig. 10
figure 10

Pressure wave propagation at time \(t=1.2\) with CFL=2. Top: comparison of second and third order numerical results against the reference solution for water height (left) and velocity (right). Bottom: time evolution of the potential energy (left) and total mass (right) for both second and third order SL-IMEX-H schemes

Low Froude Convergence We aim at studying the convergence of the SL-IMEX-H scheme also considering different stiffness regimes, namely letting the Froude number \(Fr=|u|/\sqrt{gh}\) ranging from unity to very small values. The convergence test case illustrated in Sect. 7.1 can be used again by simply modifying the meaning of the constant g in the governing PDE. More precisely, looking at the rescaled SWE (95)–(96) and neglecting the source terms, we can recognize the similar mathematical meaning to both g and \(Fr^2\), and the manufactured equilibrium solution (106)–(104) holds true for any arbitrary value of g, which in the rescaled system corresponds to \(Fr^2\). The third order version of the SL-IMEX-H scheme is analyzed and the convergence rates are reported in Table 7 for four different stiffness regimes, confirming that the formal order of accuracy is correctly captured by our numerical scheme. The same spatial and temporal discretizations of the previous convergence test are adopted even in this case and the simulation stops at time \(t_f=0.2\).

7.2 Pressure Wave Propagation

We consider an initially smooth solution that involves the propagation of a pressure wave over the computational domain \(\varOmega =[-10;10]\) which is discretized with a total number of cells \(N_x=400\). The water is initially at rest and the water depth is assigned a Gaussian profile

$$\begin{aligned} h(x,0) = 1 + e^{-x^2}. \end{aligned}$$
(109)

The setup of the test is symmetric, thus two waves are departing from the center of the domain at \(x=0\) and traveling towards the boundaries. The initial profile of the water front is smooth, but a shock wave arises after \(t \approx 0.9\). The reference solution is obtained with a MUSCL-TVD scheme on a very fine mesh composed of 20000 cells, which is used to compare the numerical solution of the SL-IMEX-H methods in Figure 10. The second order scheme is more dissipative compared to the third order version, that is highlighted in the dissipation of the potential energy U according to (102). Finally, we also monitor the conservation of the total mass given by

$$\begin{aligned} m=\int \limits _{\varOmega } h \, dx, \end{aligned}$$
(110)

which is satisfied up to machine precision thanks to the conservative version of the SL schemes.

7.3 Riemann Problems

Here, we propose some computational results for two different Riemann problems. The Riemann problem is a special initial value problem for system (52)–(53), where a discontinuity separates two piecewise constant states that represent the initial data. Since these problems involve shock waves, they are traditionally solved by explicit conservative methods, while here we make use of the novel class of implicit-explicit schemes with a conservative semi-Lagrangian treatment of the advection terms. The initial condition is given in terms of the state vector \({\mathbf {Q}}(x,0)=(h(x,0),V(x,0))\) assigned to the left L and the right R part of the domain, that is

$$\begin{aligned} {\mathbf {Q}}(x,0) = \left\{ \begin{array}{lll} {\mathbf {Q}}_L &{} \text {if} &{} x \le x_d \\ {\mathbf {Q}}_R &{} \text {if} &{} x > x_d \end{array} \right. , \end{aligned}$$
(111)

with \(x_d\) denoting the location of the initial discontinuity. The initial condition for the two Riemann problems is reported in Table 8 and the computational domain is discretized using \(N_x=400\) control volumes. The exact solution can be computed relying on the Riemann solver given in [67].

Table 8 Initialization of Riemann problems. Initial states left (L) and right (R) are reported as well as the final time of the simulation \(t_f\), the computational domain \([x_L;x_R]\) and the position of the initial discontinuity \(x_d\)

The first Riemann problem RP1 generates two non-symmetric rarefaction waves, hence this solution is continuous, but with discontinuous derivatives. The results obtained with the conservative SL-IMEX-H scheme run with CFL=3 are compared against the reference solution in Fig. 11, where second and third order accurate methods are used. Both numerical schemes generate profiles for the solution that are in excellent agreement with the exact solution and the third order method is slightly less dissipative, which can be appreciated looking at the heads and tails of the rarefaction waves.

Fig. 11
figure 11

Riemann problem RP1 at time \(t=1\) with CFL=3. Second (top row) and third (bottom row) order numerical results compared against the reference solution for water height (left) and velocity (right)

The second Riemann problem RP2 is directly inspired from the well-known Sod shock tube problem in gas dynamics [68] and consists in one rarefaction wave and one shock wave traveling towards opposite directions. We use again both second and third order SL-IMEX-H schemes, and the results depicted in Fig. 12 allows us to confirm that the conservative schemes correctly capture the location of the discontinuities as well as the values along the plateau exhibited by the exact solution. We underline that this is only possible if a conservative discretization of the momentum equation is adopted. Finally, Fig. 13 shows the time evolution of the total energy, namely potential and kinetic contributions, as well as the evolution of the total mass computed with (110), that clearly remains constant for the entire simulation.

Fig. 12
figure 12

Riemann problem RP2 at time \(t=1.5\) with CFL=2. Second (top row) and third (bottom row) order numerical results compared against the reference solution for water height (left) and velocity (right)

Fig. 13
figure 13

Riemann problem RP2. Time evolution of potential, kinetic and total energy (left) and total mass (right) for the third order SL-IMEX-H scheme

Finally, Fig. 14 depicts the spatial distribution of the Froude number at the final time of the simulation for the pressure wave propagation test as well as for the Riemann problems RP1-RP2.

Fig. 14
figure 14

Distribution of the Froude number at the final time of the simulation for the wave propagation test (left) and for the Riemann problems RP1 (middle) and RP2 (right)

Table 9 Numerical convergence results in time for the relaxation system of SWE with different CFL numbers using second and third order SL-IMEX-H schemes. The errors are measured in \(L_\infty \) norm and refer to the water depth h at time \(t_f=0.05\)
Fig. 15
figure 15

Numerical convergence test with third order SL-IMEX scheme at time \(t=0.2\) with \(N_x=400\) for the relaxation system of SWE with \(\varepsilon =10^{-14}\). Comparison against the reference solution for water height and velocity (left), and time evolution of total mass m and momentum p (right)

Table 10 Initialization of Riemann problems for the relaxation system of SWE. Initial states left (L) and right (R) are reported as well as the final time of the simulation \(t_f\), the computational domain \([x_L;x_R]\) and the position of the initial discontinuity \(x_d\)
Fig. 16
figure 16

Riemann problems with third order SL-IMEX scheme with \(N_x=400\) for the relaxation system of SWE with \(\varepsilon =10^{-14}\). Top: rarefaction solution (B1 test) at time \(t=0.3\). Bottom: shock solution (B2 test) at time \(t=0.04\). Comparison against the reference solution for water height (left) and velocity (right)

Fig. 17
figure 17

Riemann problems RP1 (top) and RP2 (bottom) with third order SL-IMEX scheme with \(N_x=400\) for the relaxation system of SWE with \(\varepsilon =10^{-14}\). Comparison against the reference solution for water height (left) and velocity (right)

Fig. 18
figure 18

Left: time evolution of the total mass m for RP2 with third order SL-IMEX scheme. Right: comparison against the reference solution for RP1 with third order SL-IMEX (black squares) and SL-IMEX-H (blue triangles) scheme with \(N_x=400\) for the relaxation system of SWE with \(\varepsilon =10^{-14}\). Zoom on the velocity profile across the tail and head of the left rarefaction wave

7.4 Relaxation System of SWE: Stiff Limit Tests

This section is devoted to the validation of the novel SL-IMEX schemes applied to the relaxation system of SWE given by (83)–(84). Three different test cases are presented in the stiff limit of the model, thus setting \(\varepsilon =10^{-14}\) as relaxation parameter, so that the numerical results can be directly compared with the solution of the inviscid Burgers Eq. (85). As discussed in Sect. 6, the new methods are Asymptotic Preserving, therefore the proposed numerical schemes must retrieve a consistent discretization of the limit model, according to (91) and (94), when the relaxation parameter tends to zero. For the sake of brevity, since the SL method is applied to the advection part of the governing PDE, we want to verify that the advection velocity of the limit system is correctly captured by the scheme, thus we only consider the stiffness in the parameter \(\varepsilon \) for the relaxation system (83)–(84), neglecting the stiffness related to the low Froude number. The SL-IMEX scheme (92)–(93) is also tested in the limit \(\varepsilon \rightarrow \infty \) in order to demonstrate the capability of correctly capturing the behavior of the original SWE system.

First, the numerical convergence in time is studied. To this aim, let us consider a computational domain \(\varOmega =[0;1]\) with periodic boundary conditions, which is discretized with a total number of cells \(N_x=400\). The initial condition reads [51]:

$$\begin{aligned} h(x,0) = 1 + 0.2 \sin (8\pi x), \qquad u(x,0)=\frac{h}{2}, \end{aligned}$$
(112)

and the final time is set to \(t_f=0.05\). Table 9 reports the convergence rates for six successively refined values of the CFL number in (103), showing that the formal order of accuracy is obtained for both second and third order SL-IMEX-H schemes. The same test is then run using the SL-IMEX method until the final time \(t_f=0.2\), so that no shocks are present in the solution. Figure 15 plots the numerical solution at the final time for both the water depth and the velocity, as well as the time evolution of the total mass and momentum which are fully preserved by the novel conservative SL methods.

Second, two different Riemann problems are solved with the relaxation system of SWE. The initial setting is given in Table 10 and the initial condition is assigned according to (111).

Riemann problem B1 involves a rarefaction wave, while the test case B2 is concerned with a shock wave. Conservation in the numerical scheme is then crucial in order to correctly capture the location of the discontinuities, thus both B1 and B2 represent a validation of both SL-IMEX-H and SL-IMEX schemes in the stiff limit of the relaxation system (83)–(84). The computational domain is defined as \(\varOmega =[-1;1]\) and counts a total number of control volumes \(N_x=400\). The CFL number is set to \(\text {CFL}=4\) and a comparison between the third order numerical results and the exact solution is depicted in Fig. 16. Even in this case, both SL-IMEX-H and SL-IMEX schemes are able to capture the correct wave speeds while running the simulation with a time step which is four times larger than the one of an explicit scheme. Furthermore, the results are proven to be consistent with the limit model, i.e. the inviscid Burgers equation. Notice that also the velocity relaxes to the correct asymptotic limit, that is \(u \rightarrow h/2\), for all the test cases shown in this section. The SL-IMEX scheme is clearly less dissipative than the SL-IMEX-H version, which is visible from the resolution of the tail and head of the rarefaction wave in test B1, as well as in the sharp resolution of the shock front for problem B2.

Finally, the SL-IMEX scheme (92)–(93) is used to run the Riemann problems RP1 and RP2 in the case \(\epsilon \rightarrow \infty \). The initial condition is reported in Table 8 and the third order results are depicted in Fig. 17, where an excellent agreement with the reference solution can be appreciated. Moreover, mass is fully conserved and even for these test cases the SL-IMEX schemes are less dissipative than the SL-IMEX-H methods, as shown in Fig. 18 with a zoom on the tail and head of the rarefaction wave for RP1.

8 Conclusions

In this work a novel class of semi-Lagrangian schemes with IMEX Runge-Kutta time stepping has been derived and discussed. First, the method is presented for a simple advection–diffusion equation, where the nonlinear convective terms have been discretized explicitly using a high order semi-Lagrangian technique, while the diffusion part of the equation has been treated implicitly. The resulting scheme is therefore unconditionally stable and a suite of test cases has been shown to demonstrate the achievement of the formal order of accuracy. Second, the SL-IMEX methods have been extended to ensure conservation of the transported quantities in the case of hyperbolic systems of conservation laws by means of a novel technique based on the integration of the governing PDE onto the space-time control volume generated by the motion of the grid points along the characteristics. As a prototype model the shallow water system has been used.

The space discretization relies on high order CWENO reconstruction operators, while a Cauchy-Kovalevskaya procedure allows the semi-Lagrangian scheme to reach high order of accuracy in time as well. The conservative version of the schemes has then be applied to test problems involving shocks, rarefaction waves and contact discontinuities. The conservation property exhibited by the schemes is crucial to correctly capture and locate shock waves and plateau of the solution. The IMEX Runge-Kutta method is used for the time stepping, with explicit convective contribution and implicit pressure terms, so that the CFL-type stability condition can be completely relaxed. Finally, the asymptotic preserving (AP) property of the schemes has been studied as well considering the shallow water systems with relaxation terms, for which two different AP schemes are derived, both in terms of a semi-Lagrangian IMEX discretization. Numerical experiments demonstrate that the novel SL-IMEX methods provide a consistent discretization in the stiff regime of the limit model given by the inviscid Burgers equation.

Future research will concern the extension of the novel class of SL-IMEX schemes to multiple space dimensions, including the usage of unstructured meshes. Complex hyperbolic PDE systems like the magnetohydrodynamics equations (MHD) or the GPR unified model for continuum mechanics [53] are also planned to be investigated. Finally, a space-time predictor strategy along the line of [11, 28] might also be useful to overcome the Cauchy-Kovalevskaya procedure, thus constituting another potential future topic of research.