An Arbitrary High Order Well-Balanced ADER-DG Numerical Scheme for the Multilayer Shallow-Water Model with Variable Density

In this work, we present a novel numerical discretization of a variable pressure multilayer shallow water model. The model can be written as a hyperbolic PDE system and allows the simulation of density driven gravity currents in a shallow water framework. The proposed discretization consists in an unlimited arbitrary high order accurate (ADER) Discontinuous Galerkin (DG) method, which is then limited with the MOOD paradigm using an a posteriori subcell finite volume limiter. The resulting numerical scheme is arbitrary high order accurate in space and time for smooth solutions and does not destroy the natural subcell resolution inherent in the DG methods in the presence of strong gradients or discontinuities. A numerical strategy to preserve non-trivial stationary solutions is also discussed. The final method is very accurate in smooth regions even using coarse or very coarse meshes, as shown in the numerical simulations presented here. Finally, a comparison with a laboratory test, where empirical data are available, is also performed.

). In this framework, a vertically averaged horizontal velocity is considered, while the vertical component of the velocity is assumed small and it is neglected. Although this kind of approach has been largely used in many applications, this limits the amount of information that the model is able to provide. Although the lack on information in the vertical direction is a potential drawback of this technique, it is counterbalanced by much less computational effort compared to fully three-dimensional models, which is essential for efficient simulations of geophysical flows. Indeed, it reduces the dimension of the problem by one, making it more affordable to simulate large domains with a good horizontal resolution. However, there are geophysical flows where the vertical component may be important in order to understand the behavior of the full system. In recent years, multilayer shallow water models have been developed to address this issue, and are commonly considered as a good compromise between the traditional one layer shallow water model and the direct numerical simulation of the full 3D system. In the multilayer approach, a vertical division or discretization into a given number of layers is considered. For each layer, similar assumptions to the ones in standard shallow water models are imposed (see [4,6,53]). This allows, for instance, to recover a detailed vertical profile of the velocity. Let us remark that the layers are just a means of capturing complex vertical profiles and do not correspond necessarily to physical layers.
In the framework of multilayer shallow water systems, one may find different strategies concerning the interaction between the layers. For instance, [10,19,28,57] assume immiscible layers. For the multilayer systems considered in [3,49], the layers are not immiscible and a continuous exchange between the layers is assumed. This is done through the incorporation of the mass and momentum transfer terms that could be written as non-conservative terms appearing in the equations. Some recent works on multilayer shallow water systems even consider a variable number of layers, where the number of layers locally adapts depending on the presence of relevant vertical effects (see [9]).
Many recent works related to multilayer shallow water models focus in the incorporation and numerical treatment of non-hydrostatic effects, associated with an estimation of the vertical acceleration of the fluid derived from the Boussinesq-type wave equations (see [11,46,50] or [76]). By doing so, the dispersive properties of the model are enhanced and simulation of more physical effects becomes possible. Of course, the computational effort is bigger, but still more affordable than a fully three dimensional model. For recent first order hyperbolic reformulations of nonlinear dispersive shallow water systems, the reader is referred to [7,14,45,48].
In this work, we employ a model described in [5,54]. The considered model includes the effect of relative changes in density in the pressure terms of the system. There are many physical and practical situations where these density changes are relevant. One classical example can be found at the Strait of Gibraltar, where two different currents, varying in terms of temperature and salinity, meet. Indeed, the water from the Mediterranean sea is warmer but also has a higher salinity concentration than the water from the Atlantic ocean, resulting in a higher density for water coming from the Mediterranean sea. In order to accurately simulate this kind of situations, it is essential to take into account these changes in relative density.
Many multilayer models incorporating density variations may be found in the literature in recent years. In [12,64], for instance, the differences in density are due to suspended sediments, where sediment species have their own sedimentary velocity. Another approach is given in [1], which considers a two layer model where the water entrainment is approximated by means of an heuristic-dependent source term. Furthermore, in [5] the authors propose a multilayer shallow water model that takes into account density variations due to a given tracer, such as the temperature. The model used in this paper follows a similar approach. Another example is [51], where the authors derive a semi-implicit time discretization approach for a variable density shallow water model with a variable number of layers to improve flexibility and efficiency. For an overview about the history of efficient semi-implicit discretizations of hydrostatic and non-hydrostatic shallow water flows, including flows with multi-valued free surface, the reader is referred to the work of Casulli, see e.g. [22][23][24][25][26].
When the vertical flow features are relevant and become the dominant effect, one may need a big number of layers in order to resolve them. As a consequence, the computational effort increases and we thus partially lose the advantage of using multilayer shallow water models when compared to the full three dimensional system. In this work we propose the use of the Discontinuous Galerkin (DG) method as a way to enhance the subcell resolution of the scheme, allowing coarser meshes while keeping a good accuracy in the vertical direction.
The Discontinuous Galerkin (DG) method itself dates back to the early work by Reed and Hill in [68]. It was later developed by Cockburn and Shu, who set a sound theoretical foundation for these numerical schemes in a series of well-known publications ( [30,31,33,34] among others), where the DG methods were extended to non-linear hyperbolic systems of conservation laws.
The DG framework provides the necessary tools that allow to reach arbitrary high order of accuracy in space and time. A natural approach regarding explicit DG methods is to use an explicit time discretization via high order Runge-Kutta schemes, leading to the family of Runge-Kutta discontinuous Galerkin schemes [30,31,33,34]. Space-time DG methods where space-time basis and test functions are employed were first developed in [42,59,78,79]. The resulting schemes are unconditionally stable. For semi-implicit DG schemes, the reader is referred to [15,40,70,77]. An alternative approach to building high-order space-time DG approximations is to consider the Cauchy-Kovaleskaya procedure as the one used in ADER schemes first developed by Toro and Titarev in the finite volume method framework, see ( [16,[71][72][73][74][75]), using Taylor series expansions of the variables while substituting time derivatives by spatial derivatives, which are then treated by the DG scheme. It is well known that the Cauchy-Kovaleskaya (CK) technique often involves complex computations of time derivatives that can quickly become too cumbersome. To overcome these difficulties, one may use a local space-time DG predictor procedure, which allows to reach arbitrary high order in time while completely avoiding the CK procedure, see [37,41]. The latter formulation of the ADER approach is based on the approximate solution of generalized Riemann problems by means of an element-local fixed point algorithm, the convergence of which was proven in [13], leading naturally to high order fully discrete one-step schemes. This shall be the approximation used in this paper.
DG and ADER-DG have been successfully applied to geophysical flows in the shallow water framework. See for instance the works for the one-layer shallow water model [62,63,81,82] among others. Application of this technique to immiscible two-layer models can be found in [28,39,57]. Some works can be found also for multilayer flows in [56]. As far as we know, this is the first attempt to adapt this technique for variable density multilayer shallow water models, obtaining a well-balanced scheme for non-trivial steady states.
Notice that, no limiter is applied up to that point and therefore some way of coping with the Gibbs phenomena associated to non-linear high order schemes must also be provided. In this work, we use a multi-dimensional optimal order detection (MOOD) (see [29,36]), which is a posteriori approach to the problem of limiting. In this way, the unlimited solution of the ADER-DG method is a candidate solution, which is then evaluated by the MOOD procedure to find its admissibility. If the solution is found inadequate in any given cell, then it will be discarded and recomputed by means of a robust finite volume solver, which would become the corrected solution in the cell. Notice that the use of a finite volume solver could destroy the subcell resolution of the DG scheme. In order to preserve it, an optimal subcell discretization is used, see [44].
One of the main advantages of the MOOD technique is that it allows to analyze different properties of the solutions, and therefore whether it is meaningful from the physical and numerical point of view. For instance, in this paper we consider that the solution must fulfill a relaxed discrete maximum principle to avoid spurious oscillations related to sharp gradients or discontinuities, but also some physical properties like positivity or a relative density equal or greater that a given threshold. The proper set up of these criteria is very important for the admissibility of the solutions, as it will be shown in this work.
Another major issue for the simulation of geophysical flows is the preservation of stationary solutions. Indeed, in practical situations, we often find flows that are small perturbations of an equilibrium state or they converge to one those for long simulation times. Thus, the numerical scheme must be able to exactly preserve this kind of solutions. In this work, we will present a technique to preserve stationary solutions in the framework of the ADER-DG schemes and Riemann solvers. As it will be later discussed, the considered model has several families of stationary solutions of interest, including stationary solutions with non-trivial density profiles.
This paper is organized as follows. In Sect. 2, the model and its key features are presented. The stationary solutions are also discussed in that section. In Sect. 3 the discretization of the model is detailed, including the limiting techniques considered here, alongside the strategy to preserve a certain class of stationary solutions exactly at the discrete level. Section 4 presents different numerical tests in order to analyze the behavior of the proposed numerical solver. Preservation of steady state solutions and a comparison with laboratory data is included. Finally, Sect. 5 gives some conclusions.

Model Description
In this section, we briefly recall the governing equations for the system studied here. It is not the aim of this paper to make an exhaustive derivation of the model. The interested reader may refer to [5] or [54] for further details. The model is derived from the incompressible Euler equations with free surface, where two continuity equations are considered: the one corresponding to an incompressible flow with constant density ρ 0 and another one corresponding to an advected flow with variable density ρ a . The total density of the flow can be seen as a sum of the density ρ 0 plus the density fluctuation, ρ 1 , with respect to ρ 0 . The total density of the fluid is then, Instead of considering total density, we may introduce the relative density resulting in the following Euler equations, where v is the velocity field, k is the canonical vertical unitary vector, and g is the gravity. For the sake of simplicity, let us focus on the two dimensional (x, z) case. A multilayer approach is considered, dividing the fluid into M layers, and the equations (2.3) are vertically averaged within each layer, under the usual hypotheses of shallow-water models. We then obtain the following density-dependent pressure expression in each layer α, Here, f α refers to the value of the variable f in the α-layer, whereas p α+ 1 2 is the kinematic pressure at the interface between layers α and α + 1. Finally, h α refers to the thickness of layer α and p S denotes the pressure at the free surface, which is usually set to zero. Figure 1 shows a sketch of the problem.
Using this procedure, the following model is obtained from (2.3) (see [49,64]): where h is the total height of the water column, η = h + z b is the free surface, and z b is the bathymetry function. Finally, u α refers to the horizontal velocity in the α-layer and G α± 1 2 α = 1, · · · M − 1, are the mass transfer terms between layers. Note that the full system (2.6) is obtained under the assumption of some closure relations, which will allow us to properly define the mass transfer terms. More explicitly, it is assumed that the layer thickness is proportional to the total height, h α = l α h, with l α ∈ [0, 1], α = 1, . . . , M such that M α=1 l α = 1. Under this assumption, the expression for the mass transfer terms is given by We will assume no mass transfer at the bottom or the free surface, that is G 1/2 = G M+1/2 = 0. Finally θ α+1/2 and u α+1/2 are some approximations of u and θ at the layer interfaces. Typically, Note that the full PDE system given by equations (2.6) has a number of different stationary solutions. The most intuitive ones are probably the steady states corresponding to homogeneous density profiles. For the case of constant density, the standard multilayer shallow-water equations are obtained, Therefore, we are able to recover the particular case of the lake-at-rest stationary solutions with constant density, θ α = const, u α = 0, for α = 1, . . . , M, η = const.
However, system (2.6) also admits lake-at-rest stationary solutions corresponding to nontrivial density profiles. Indeed, stationary solutions with u α = 0, α = 1, . . . , M for the system (2.6) correspond to the solutions of the following ODE system, and then going downwards throughout the lower layers. Notice that there is an infinite number of solutions for η(x) = h(x)+z b (x) and θ α (x) for α = 1, . . . , M. However, we are interested in stationary solutions corresponding to a stratified fluid with constant free surface, that is Unfortunately, the vertical discretization into layers of the model (2.6) does not allow a perfectly linear density profile as a stationary solution, unless the bathymetry is flat. Furthermore, it is easy to check that (2.9) is not a solution of (2.8) for a non-trivial bathymetry function. However, system (2.8) can be solved recursively, which results into a stratified density profile that could be seen as an approximation of (2.9) associated to the multilayer approach. In particular, those solutions are given by the following expression, with whereθ α is a free choice constant parameter corresponding to the constant of integration of the ODE and set a particular profile for the stationary solution. Figures 2 and 3 depicts how the solution (2.10) behaves as we increase the number of layers. Finally, we can give an approximation of the wave propagation speed of the PDE system (2.6). While a complete study of the hyperbolicity of the model (2.6) falls outside the scope of this work and the full spectral behavior of the model is unknown, empirically we observe that the model remains hyperbolic throughout all kind of situations. Furthermore, some previous work by Fernández et al. [12] allows us to consider a bound for the maximum and minimum wave propagation speed λ max , λ min , given by,

Numerical Scheme
In this section we describe an ADER-DG numerical scheme for (2.6) based on a discretization on uniform meshes with a posteriori subcell finite volume limiter of the MOOD type. System (2.6) may be expressed in the following form, where w is the vector of the conserved variables, The physical convective flux F C (w) is defined by, and P(w, ∂ x w, ∂ x η) corresponds to the pressure term, which depends on the relative density θ α and the free surface η, and has the following form, Finally, the term T (w, ∂ x w) corresponds to the mass, density, and momentum exchange between layers: is described by (2.7). The system of equations (3.1) is solved by applying the family of pure discontinuous Galerkin schemes P N P N , as described in [37], which provides high order of accuracy in space and time. The numerical scheme can be formulated as a predictor-corrector method: in the predictor step, a high order approximation of the solution of (3.1) is computed by solving a local Cauchy problem in the small, without interaction with the neighbor cells.
Next, the corrector step will use this approximation with an explicit DG method that solves the Riemann problem taking into account the neighbor states.
We consider a computational domain Ω discretized into a set of conforming elements . As usual, the computational grid is the union of all the elements From now on, we shall use the following notation: for any variable f defined on a volume T i , we denote by f i± 1 2 the values at the interface, depending on whether it is the right or left side of the cell. However, when the values correspond to projected or reconstructed variables into the interface, they will generally be denoted with the super index f ± , depending on whether they correspond to the left or to the right side of the intercell.
In the following, the discrete solution of the PDE system (3.1) at time t n is denoted by w h (x, t n ) and is defined in terms of piecewise polynomials of degree N on the spatial direction. We shall denote by U h the space of piecewise polynomials up to degree N so that w h (·, t n ) ∈ U h . In this work, a nodal basis defined by the Lagrange interpolation polynomials over the (N + 1) Gauss-Legendre quadrature nodes on the element T i is adopted. As usual in the discontinuous Galerkin (DG) approach, the discrete solution w h may be discontinuous across the intercells, as in finite volume methods. At each cell T i , the discrete solution is written in terms of the nodal spatial basis functions Φ l (x) and some unknown degrees of freedomŵ n i,l , where the Einstein summation convention over two repeated indices has been considered. The spatial basis functions are defined on the reference interval [0, 1] and the transformation from physical coordinates x ∈ T i to reference coordinates ξ ∈ [0, 1] is given by the linear With this choice, the spatial basis function is written in terms of the nodal basis function ϕ k (ξ ), which satisfy the interpolation property ϕ k (ξ j ) = δ k j , where δ k j is the usual Kronecker symbol, ξ j are the nodal quadrature points, and the resulting basis is by construction orthogonal. Therefore, we write, Furthermore, due to this particular choice of a nodal basis, all integral operators can be decomposed into a sequence of one-dimensional operators acting only on the N + 1 degrees of freedom in each dimension. In order to derive the ADER-DG method, we first multiply the governing PDE system (3.1) with a test function Φ k ∈ U h and integrate over the space-time control volume T i ×[t n , t n+1 ]. This leads to As already mentioned, the discrete solution is allowed to jump across element interfaces, which means that the resulting jump terms have to be properly taken into account. In our scheme this is achieved via numerical flux functions in the form of approximate Riemann solvers that follows the path-conservative approach that was developed by Parés, Castro and collaborators in the finite volume framework [18,67] and which has later been extended to the discontinuous Galerkin finite element framework in [38,43,69].
In classical Runge-Kutta DG schemes [32], only a weak form in space of the PDE is obtained, while time is still kept continuous, thus reducing the problem to a nonlinear system of differential equations, which is subsequently integrated with classical Runge-Kutta methods in time. In the ADER-DG framework, a completely different strategy is used. Here, higher order in time is achieved with the use of an element-local space-time predictor, denoted by q h (x, t) in the following, and which will be discussed in more detail later. Using (3.8), integrating the first term by parts in time and integrating the flux derivative term by parts in space, taking into account the jumps between elements and making use of this local spacetime predictor solution q h instead of w h , the weak formulation (3.9) can be rewritten as where T • i corresponds to the interior of T i and η h stands for the projection of η onto the are the extrapolated values of the bathymetry at the intercells.
Remark that, due to the polynomial representation of z b at each cell, The first integral in (3.10) leads to the element mass matrix, which is diagonal since our basis is orthogonal. Note that the jumps across elements interfaces will be approximated with a Riemann solver, described in Sect. 3.2.

ADER-DG Space-Time Predictor
As already mentioned, the element-local space-time predictor is an important feature of ADER-DG schemes. The computation of the predictor solution q h (x, t) is based on a weak formulation of the governing PDE system in space-time starting from the known solution w h (x, t n ). The PDE system is approximated with a so-called Cauchy problem in the small, i.e. without considering the interaction with the neighbour elements. For an element T i , the predictor solution q h is now expanded in terms of a local space-time basis, with the multi-index l = (l 0 , l 1 ) and where the space-time basis functions θ l (x, t) = ϕ l 0 (τ )ϕ l 1 (ξ ) are again generated from the same one-dimensional nodal basis functions ϕ k (ξ ) as before, i.e. the Lagrange interpolation polynomials of degree N passing through N + 1 Gauss-Legendre quadrature nodes. The spatial mapping x = x(ξ ) is also the same as before and the physical time is mapped to the reference time τ ∈ [0, 1] via t = t n + τ Δt. Multiplication of the PDE system (3.1) with a test function θ k and integration over the space-time control volume T i × [t n , t n+1 ] yields the following weak form of the governing PDE, which we remark that it is different from (3.9), since now the test and basis functions are both space and time dependent: where η h represents now the projection of η onto the local space-time polynomials, that is, the projection of the bottom topography, which only depends on space, onto the space U h .
Since we are only interested in an element local predictor solution, without considering interactions with the neighbor elements, the jump terms across interfaces are not taken into account at this stage. Instead, it will be done in the final corrector step of the ADER-DG scheme (3.10). This leads to, Using the local space-time ansatz (3.11), Eq. (3.13) becomes a local nonlinear system for the unknown degrees of freedomq i l of the space-time polynomials q h . The solution of (3.13) can be easily found via a simple and fast converging fixed point iteration detailed e.g. in [41,55] and the convergence of which was proven in [13]. For linear homogeneous systems, the iteration converges in a finite number of, at most, N +1 steps since the associated iteration matrix is nilpotent [58].
We stress that the choice of an appropriate initial guess q 0 h (x, t) for q h (x, t) is of great importance in the convergence rate and thus the computational efficiency of the scheme. Several strategies exist to speed up the algorithm: in [83] it is suggested an extrapolation of q h from the previous time interval [t n−1 , t n ] while in [55] the authors propose a secondorder accurate MUSCL-Hancock-type approach based on discrete derivatives computed at time t n . As an alternative, one can also use a Taylor series expansion of the solution q h (x, t) about time t n and then use a continuous extension Runge-Kutta scheme (CERK) in order to generate the initial guess for the space-time predictor, as pointed out in [47]. For details, see [47] and [52,66].
If an initial guess with polynomial degree N − 1 in time is chosen, it is sufficient to use a single Picard iteration to solve (3.13) to the desired accuracy, (see [37]). For an efficient taskbased formalism of ADER-DG schemes, see [27]. However, for the simulations considered in this work, we consider the initial guess to be q 0 h (x, t) = w h (x, t n ). This completes the description of the unlimited high order accurate and fully discrete ADER-DG schemes.

A Hydrostatic Reconstruction Riemann Solver
As in [54], here we use a path-conservative solver based on the hydrostatic reconstruction technique (see [2,20,65]). Let us briefly recall its definition, In order to make the notation easier, we shall neglect in what follows the subindex h, which accounts for the element-local space-time predictor q h . Now, for any variable f , we shall define its average at the intercell i + 1 2 as: In particular, for a variable f α defined within the layer α, we shall write The difference at the intercell i + 1 2 will be written as (3.17) We shall denote the average of a variable f α at the layer interface α + 1 2 by In addition, at the bottom or free surface interfaces, we shall assume According to [54], q H R,± , we consider first and h H R,± where ( f ) + is the positive part of f . Using (3.21), we define Remark that the notation (3.15)- (3.19) are now defined in terms of the reconstructed variables. For instance, (3.15) reads now as follows, Once, the reconstructed states q H R,± i+ 1 2 are defined, the Riemann solver can be expressed as, (3.24) and with Note that in order to make the notation less cumbersome, we have neglected the subindex i + 1 2 , so that here h stands for h i+ 1 2 , Δh stands for (Δh) i+ 1 2 and so on.
The term T i+ 1 2 corresponds to the discretization of the transfer terms. As pointed in [54], those terms should be discretized in a vertical upwind manner as follows: The coefficients α 0,i+ 1 2 and α 1,i+ 1 2 are related with the numerical viscosity of the scheme and are defined in terms of the upper and lower bounds of the maximum and minimum of the waves speeds (see [17] for more details): Finally, the terms S ± i+ 1 2 correspond to the corrections due to the use of the hydrostatic reconstruction and guarantee the consistency of the scheme as well as the well-balanced property [8] for the lake-at-rest with constant density steady states. S ± i+ 1 2 are defined as, and Δf Note that the simplified expression (3.27) derives from the fact that, in the hydrostatic reconstruction, the primitive variables u α , θ α , and η remain constant.
The term T ± i+ 1 2 is defined by Similar for uθ ± and G 1 2 ± = G M+ 1 2 ± = 0. It is then straightforward to check that the numerical scheme (3.10) is exactly wellbalanced for the solutions corresponding to water at rest with constant density.

Upwind Transference Terms at the Volume Integrals
As discussed before, according to [54], a direct discretization of transference terms may yield non-physical results, like relative densities below the unity, which directly conflicts with (2.2). Indeed, the transference terms can be interpreted as a vertical flux between layers, but by writing them as non-conservaive products, the information relative to the flux direction is lost. In [5], it is suggested that this behavior can be avoided by an upwind approximation of the transference terms that incorporate this information into the discretization. Therefore, we perform a similar discretization as the one proposed at the intercells, that is, we consider a vertical upwinding discretization of those terms at each degree of freedom l using the following discretization, = 0, and we also denote, θ α+ 1 2 ,l = 1 2 θ α+1,l + θ α,l and analogously for uθ α+ 1 2 ,l . The term G α+ 1 2 , defined in (2.7), is approximated according to the the polynomial basis used in the spatial discretization.

A Posteriori Subcell Finite Volume Limiter
The numerical discretization proposed before is unlimited, in the sense that there is no mechanism that prevents the appearance of Gibbs oscillations associated with high order in the proximity of shocks or steep gradients. Certainly, there is no need for any measure when the solution is smooth, but providing a non-linear limiter in the presence of shock waves or discontinuities is essential. The limiter used in this work follows the ideas presented in [44,60,80]. The limiting procedure acts in two steps: first it detects which cells need limiting, and second it introduces some kind of numerical viscosity into the solution in these regions.
The unlimited solution of the governing equation given by (3.13) is now considered as a candidate solution, w * h (x, t n+1 ). This candidate solution will remain unchanged if it is considered acceptable. However, the candidate solution will be overridden when it does not satisfy some selection criteria. The cells where this occurs are denominated troubled cells. In the cells that are deemed troubled, we recompute the solution with a fully discrete second order accurate MUSCL-Hancock finite volume scheme. In order to do this, we first project the solution w h (x, t n ) into a subgrid of K s elements in T i and denoted by S i, j and verifying T i = j S i, j for j = 1, . . . , K s . The projection can be seen as an alternative data representation, denoted by v h (x, t n ), and consists of a set of piecewise constant subcell averages. These averages are a L 2 projection that preserves the mean of The subcell averages v h (x, t n ) are evolved with an explicit second order finite volume solver. The solution of this solver, v h (x, t n+1 ), has to be reconstructed into a limited DG polynomial. This is achieved through a classical least square reconstruction operator that preserves the average of the projected solutions, Since a subcell resolution K s > N + 1 is admitted, this problem may be overdetermined. Hence, the following constraint must also be considered, In this way, the final solution w h (x, t n+1 ) is the candidate solution in regions where the solution is deemed adequate and the reconstructed solution in the regions that it is not. Note that v h (x, t n+1 ) is kept in memory in case that its cell T i is again considered troubled in the next time step. In this case, the finite volume solver uses v h (x, t n+1 ) as initial data and not the projected DG polynomial (3.32).
The main advantage of this approach to limitation is that it allows to verify any number of physical and numerical properties for the numerical scheme. Indeed, the nature of the limiter, which evaluates the suitability of the candidate solution w * h (x, t n+1 ) a posteriori, allows to consider the cell as troubled not only in the presence of discontinuities, but also if the solution does not fulfill some prescribed properties. In our particular case, we set a numerical criteria and two physical ones. Physical admissibility criteria The physical admissibility of the solution must be tightly correlated with the system of governing PDE (3.1). We set that the candidate solution, w * h (x, t n+1 ), has to fulfill positivity of water column height, h, and that the relative density, θ α , must always be equal or greater that one (see 2.2). Numerical admissibility criteria A relaxed discrete maximum principle, adapted to polynomials, is used to detect discontinuities (see [44]). The criteria is applied in a posteriori manner as follows, where the projection v h (x, t n+1 ) is used as a discrete form of the polynomial w h (x, t n+1 ), V i is a set containing T i and its neighbors cells and δ is a small value that relaxes the criteria to allow some very small overshoot or undershoot and avoid roundoff errors that would arise if (3.34) is applied strictly. A suitable number of subcells, K s , also has to be chosen. In particular, we choose an optimal subgrid satisfying K s = 2N + 1. This choice is optimal in the sense that it allows to keep the same time step calculated for the DG polynomial and also to have a CFL number close to the theoretical maximum for the finite volume numerical scheme (see [44]). Note that in the case of a troubled cell next to a non-troubled cell, there will be a non-consistent numerical flux caused by the two different methods used in the troubled and non-troubled cell. Thus, it is important to update the flux in the non-troubled cell to be consistent with the flux calculated in the troubled cell, and keep intact the conservation properties of the numerical scheme.

Preserving Stationary Solutions in the ADER-DG Framework
In [21], the authors have proposed a general procedure to construct well-balanced high-order finite volumes schemes, i.e. numerical methods that satisfy the so-called C-property found in [8]. In this section, we propose to adapt the strategy described in [21] to define a wellbalanced DG numerical scheme that exactly preserves the stationary solutions given in (2.10), that corresponds to a stationary stratified fluid.
The first step in this algorithm is to determine a local stationary solution of the family (2.10) at each cell denoted by u e,i (x), x ∈ T i at each time step. Let us remark that the stationary solution is computed in every cell T i at each time step t n . Nevertheless, we do not write the dependence on t n in order to make the notation more readable. Notice that u e,i is fully determined by h e,i and θ 1,e,i , . . . θ M,e,i , since stationary solutions (2.10) assumes u α,e,i = 0, 1 ≤ α ≤ M. According to (2.10), u e,i are determined by setting M + 1 locally computed constants, denoted byη i ,θ α,i , 1 ≤ α ≤ M. In particular,η ī 1 Δx Once these constants are computed, the local stationary solution u e,i (x) is determined at each cell. Note that the local stationary solutions satisfy the pressure terms (2.8) at each cell, Now, we can replace the numerical scheme (3.10) by the following equivalent wellbalanced ADER-DG scheme, where (u e,i ) h and ∂ x (u e,i ) h are respectively the projections of u e,i and ∂ x u e,i into U h .
Moreover, the extrapolated values at the cell interfaces, denoted by q ± h,i± 1 2 , are computed in the following way, Similarly, .
). Note that if the bathymetry is a smooth function, it remains continuous at the cell interfaces and the hydrostatic reconstruction is no longer needed. The ADER space-time predictor step is also modified according to this previous idea: an iterative algorithm that computes the fluctuation with respect to the local stationary solution u e,i is proposed. In particular, the following well-balanced space-time predictor is considered, whereq h (x, t) is the projection of the fluctuation about the stationary solution u e, Finally, to clean possible spurious oscillations due to the absence of numerical viscosity in stationary solutions, we apply the following procedure: first we compute the average of the fluctuation with respect to the local stationary solution, if w h,i < δ , then w h (x, t n ) is redefined as follows, Some numerical tests applying the techniques presented in this section can be found in Sect. 4.

Time Step Restriction
The DG method has a rather severe Courant-Friedrichs-Lewy (CFL) number that decreases with the order of the approximation polynomial, N . The time step for the explicit DG method in a multiple dimension framework follows, with CFL < 1 and where d is the dimension space (here d = 1) and |λ max | is an approximation of the maximum wave speed, given by (2.11). This restrictive CFL condition has to be seen with perspective. While it is true that it imposes a small and restrictive time step, the enhanced subcell resolution of the DG scheme allows coarse or even very coarse meshes, compensating the severe 1 2N +1 restriction.

Numerical Tests
In this section we present some numerical tests in order to show the efficiency of the new well-balanced ADER-DG solver for multi-layer shallow water systems described previously.
In particular, we consider a standard test to measure the order of accuracy of the numerical scheme, several test cases where the well-balanced properties of the scheme presented in Sect. 3.5 are shown, including a challenging test corresponding to a density stratified fluid with non-trivial density profiles. Additionally, a comparison of the numerical solution of the model and laboratory data of a simulation corresponding to an evolution of an internal density wave is also included. Finally, two more simulations of an initially smooth density profile and a highly discontinuous lock-exchange test are also considered. Concerning the boundary conditions, it is well-known that the imposition of wall-type and/or open boundary condition is difficult for DG solvers. In this work, the numerical tests where open-boundary conditions is considered, we simply mark the boundary cells as always troubled and impose the boundary conditions using the second-order FV scheme. Finally, throughout all the numerical test presented in this section, the CFL parameter is set to 0.5.

Accuracy Test
We now seek to check numerically the order of accuracy of the numerical scheme. Since the proposed ADER-DG method is arbitrary high order in space and time, a second, third and fourth order version have been chosen for this test. We consider a 10 m long channel on the interval [−5, 5] with 5 vertical layers, discretized with 25, 50, 100, 200 and 400 uniform cells. The initial condition is given by:  and the bathymetry is given by, The final simulation time is t = 0.5 s and periodic boundary conditions are considered. The free surface and the velocity are depicted in Fig. 4 at the final simulation time t = 0.5 s for the fourth order scheme using the 200 cells mesh. Tables 1, 2 and 3 show the errors and order of accuracy for the conserved variables h, hθ 1 , and hθ 1 u 1 . These variables have been chosen since they correspond to the bottom layer and thus the pressure and transfer terms are more relevant. Similar results are obtained for the other unknowns. The numerical solutions are compared to a reference solution, which has been computed with the same numerical scheme on a finer mesh of 2400 points. As expected, the numerical accuracy is achieved.

Well-Balanced Property
We now intend to validate the well-balanced property of the scheme thanks to the techniques introduced in Sect. 3.5. Three test cases are considered: a classical lake at rest solution with constant density, a lake at rest solution with a non-trivial density profile and a perturbation of the free surface of the preceding test.
For the first one, we consider again a 10m long channel within the interval [−5, 5] and 5 vertical layers of constant density θ α = 1 for α = 1, . . . , M. As initial condition, we fix a constant free surface η = 2, and bottom topography given by, The simulation is run up to t = 500 seconds on a uniform mesh composed of 50 cells and a fourth order ADER-DG scheme in space and time is considered. Figures 5 and 6 show the surface and density profiles, respectively. As we can see, the scheme preserves the steady state solution up to machine precision for long simulations times. More sophisticated stationary solutions can also be preserved, as described in Sect. 2. As it was discussed, system (2.6) also admits stationary solutions corresponding to steady lakeat-rest states with non-constant density profile. In particular, let us consider the bathymetry function (4.1) and the lake-at-rest steady state with constant free surface η = 2 and the following θ α profiles for the particular case of three layers,   Figures 7 and 8 show that the steady state is indeed preserved up to machine precision (Fig. 9). Finally, we consider a small perturbation of the previously described stationary lake-at-rest solution with non-constant density profile. The same bathymetry function, relative density profiles and number of cells are considered, but the free surface is now given by, Wall boundary conditions are set. The results are shown in Figs. 10, 11, 12, 13. As it can be seen, the numerical scheme reaches another stationary solution, as wall boundary conditions are set. As expected, the stationary free surface achieved at time t = 500 seconds has increased, due to the initial perturbation (see 12). The final velocity profiles could be seen in Fig. 12, and they are close to 0. Finally, a new stratified solution is achieved.

Smooth Distribution of Relative Density
In this example, we consider an initially smooth distribution of relative density given by The free surface is initially constant and equal to η = 2, while the bathymetry is continuous and equal to 0. The spatial domain [−4, 4] is divided into just 30 cells and we consider M = 10 layers. The relative density is assumed to be the same across all layers. Figure 14 shows this initial density distribution. We consider open boundary conditions and the fifth order numerical scheme will be used. In the sequence of Figs. 15, 16, 17, 18 and 19 we see the time evolution of the density profiles. In order to better describe the behavior of the relative density in all these figures, a dual representation has been chosen. On the left, the actual profile and values of the relative density is displayed for a few selected layers. This is done for the sake of clarity. On the right, the vertical relative density profile is shown through a heat map whiting the domain.  We observe that the density in each layer tends to move towards the boundaries at different speeds. At time t = 5 we see that a shock is formed, even though the initial density profile is smooth. The appearance of this shock means that the limiter is then activated. To see this fact, we have included in the figures a parameter β that accounts for the limiter activation. It is equal to 1 when it is not activated and greater than 1 otherwise.

Lock-Exchange Experiment in a Flat Channel
We now intend to validate the numerical approach introduced here by comparison with a laboratory test presented in [1], where experimental data is available. The experiment consists in a lock-exchange process between two fluids with different densities ρ 0 and ρ 1 in a flat channel. The channel is 3 m long and the height of the water at the initial time is 0.3 m. The fluid with density ρ 1 is in a gatebox of 0.1 m placed on the left of the channel, which is then released into the fluid of density ρ 0 . This initial condition can be seen in Fig. 20. The density ρ 0 is 1000 kg/m 3 while ρ 1 is 1034 kg/m 3 . Therefore we set     with the actual profile and values of the relative density for a few selected layers on the left, and a heat map of the vertical density distribution on the right. Again, β stands for the activation of the limiter.
The immediate formation of a shock can be observed, due to the discontinuous nature of the initial condition. We see that the limiter is being activated throughout the jump in density and it tracks the traveling wave corresponding to the perturbation of the free surface due to the density change. Some high frequency oscillations associated with the high order can also be appreciated, but the additional viscosity provided by the limiter manages to smooth the solution. The agreement with experimental data is excellent, which is noteworthy since nonhydrostatic effects present in situations such as this (see for example [46]) generally prevent an accurate prediction of the front position of hydrostatic shallow water models. Let us also remark that this is achieved with a coarse discretization used in both the horizontal and vertical directions.

Lock Exchange on a Non-Flat Bathymetry
We now consider a dam break in relative density problem with a continuous bathymetry function in a channel on the interval [−5, 5]. Initially, a constant free surface η = 2 m is set. The bathymetry function is given by and the following discontinuous profile in relative density is imposed (4.8) Figure 28 shows the initial condition. The channel is discretized with M = 25 layers on the vertical direction and only 50 cells on the horizontal direction. Free-flow boundary conditions are considered. We show the simulations at different times obtained with the first and fourth order schemes in Figs. 29, 30, 31, 32 and 33. The enhanced resolution of the high order scheme allows to appreciate the sharp transition between fluids, that are expected to evolve in gravity currents over obstacles (see [61]). The first order scheme is unable to accurately describe this solution, with this coarse discretization, and ends up with nearly uniform density solution due to the numerical viscosity. Conversely, the fourth order scheme accurately describes the experiment and the typical profile in such physical situations is obtained.

Conclusions
We have presented a novel discretization for a multi-layer shallow water model with a density dependent pressure function. The proposed numerical scheme falls into the category of ADER discontinuous Galerkin finite element schemes with a posteriori subcell finite volume limiter. It is arbitrarily high order accurate in space and time, allowing to accurately capture detailed solutions, even with coarse or very coarse meshes. Moreover, a suitable well-balancing strategy has been presented that allows to preserve a set of non-trivial stationary solutions corresponding to stationary density stratified lake-at-rest type solutions. The numerical results are promising, with excellent agreement with experimental data. Moreover, the computational results satisfy a discrete maximum principle for the relative density, thanks to its finite volume based a posteriori subcell limiter technique.