An important feature of the two-layer shallow flow model is that the resulting system of equations cannot be expressed in conservation-law form. Here, the HLLS and ARoe solvers, derived initially for systems of conservation laws, are reformulated and applied to the two-layer shallow flows in a great variety of problems. Their resulting extension and combination allows us to overcome the loss of the hyperbolic character, ensuring energy or exactly balanced property, guarantees positivity of the solution, and provides a correct drying/wetting advance front without requiring tuning parameters. As a result, in those cases where the rich description of internal and external waves cannot be provided by the ARoe solver, HLLS is applied. Variable density is considered in each layer as a result of a bulk density driven by the mixture of different constituents. A wide variety of test cases is presented confirming the properties of this combination, including exactly balanced scenarios in subcritical and subcritical-transcritical scenarios, dam-break problems over bed variations and wet/dry fronts, non-hyperbolic conditions, transcritical exchange flow with loss of hyperbolicity. Despite the complexity of the test cases presented here, accurate and stable simulations are guaranteed, ensuring positivity of the solution without decreasing the time step.

In gravity currents such as saline gravity currents in submarine environments, turbidity currents in reservoirs or hypersaline plume generated by desalination plants, density may change in processes of entrainment, transport, and deposition, generating layers of different density (Fernández-Torquemada et al. 2009; Zordan et al. 2018). As density may change, it is appropriate to define the bulk density of each layer as a mixture of different species, each one with different concentration and relative density. Most of the gravity currents happen on complex topographies and over varied bed compositions and the erosion, transport, and depositional processes depend on the particle characteristics and on the flow hydrodynamics. Even though the literature on sediment transport and gravity currents is rich, the hydrodynamics of density-driven flows and two-phase flows and the internal flow structure are not completely understood (Zordan et al. 2018), and support through experimental (Capart & Young 1998) and numerical approaches is required (Spinewine et al. 2011).

Successful simulation of shallow water flows has been the target of many researchers for more than one decade and the approaches in the literature have continuously improved the quality of the numerical results and the reliability of numerical predictions. Advances based on Godunov-type methods (Godunov 1959) involve different topics: from the original idea of the C-property (Bermúdez & Vázquez-Cendón 1994) or well-balanced schemes (Greenberg & Leroux 1996) enforcing equilibrium (Rogers et al. 2003; Chacon et al. 2007; Murillo et al. 2007a, 2007b, 2008a, 2008b, 2009; Murillo & Garcia-Navarro 2010a, 2010b) and their extension to energy or exactly balanced schemes (Chinnayya et al. 2004; Noelle et al. 2007; Fjordholm et al. 2011; Murillo & García-Navarro 2012a, 2012b, 2014; Castro Díaz et al. 2013; Xing 2014; Navas-Montilla & Murillo 2015, 2016; Murillo & Navas-Montilla 2016; Valiani & Caleffi 2017), to the definition of appropriate entropy fixes in critical points where one of the eigenvalues vanishes (Harten 1984; Castro et al. 2001, 2004, 2005, 2006; Abgrall & Karni 2009; Murillo & Navas-Montilla 2016), the extension to very high order of accuracy (Castro & Toro 2008; Vignoli et al. 2008; Castro et al. 2012; Montecinos et al. 2012; Navas-Montilla & Murillo 2015, 2016) or the use of dynamically adaptive grid generation (Liang et al. 2004; Rogers et al. 2004; Lee et al. 2011). There is still room for improvement in new areas, such as the problems related to numerical shockwave anomalies (Cameron 1966; Emery 1968; Zaide & Roe 2012; Navas-Montilla & Murillo 2017), that still claim our attention.

In general, for both one- and two-layer shallow water systems of equations, the preservation of steady state solutions for general moving water equilibrium (Noelle et al. 2007; Fjordholm et al. 2011; Castro Díaz et al. 2013; Xing 2014) and water height positivity are a challenge (Cozzolino et al. 2012; Xing & Shu 2014; Zhang et al. 2014; Haleem et al. 2015; Liang & Smith 2015; Barzgaran et al. 2019). Non-physical negative water height becomes traumatic as the eigenvalues do not determine the time step size. This is a result of the non-purely hyperbolic characteristic of the system of equations (Xing et al. 2010; Xing & Zhang 2013; Xing & Shu 2014). Imposing case-dependent threshold values for the water depth, the limitation of the computational domain in the computation of the flow advance over dry bed is the current tendency to avoid numerical difficulties (Delis et al. 2011a, 2011b). Other techniques involve velocity-based limiters (Delis et al. 2011a, 2011b; Vater et al. 2015) to control the stability at wet/dry fronts.

In this work we focus on the combination of two solvers, which are extensions of the well-known HLL solver developed by Harten et al. (1983) and the Roe solver (Roe 1981), maybe the most disseminated approximate Riemann solvers for the resolution of shallow flows. Both methods provide an approximate flux at cell interfaces using an intermediate or star region (Toro 2009), , between cells. In the HLL, the numerical flux arises directly from the definition of a control volume that is centered on a cell interface and integrated over space and time. For the Roe method, a wave decomposition of the Jacobian matrix has to be defined. In contrast to the HLL solver, where alternative sets of wave estimates can be provided (Davis 1988; Einfeldt 1988), the approximate Roe solver provides directly a set of wave celerities that will determine the structure of the numerical solution. Being more computationally expensive, the Roe scheme is usually more suitable than the HLL in terms of accuracy, as the latter only considers two waves, that result in an increased amount of numerical diffusion. The HLLC solver (Toro et al. 1994) incorporates a contact wave in the solution leading to a competitive solver, but is not easily extended to any set of equations. It is also worth saying that the Roe scheme is not either easily applicable to any set of conservation equations as appropriate averages have to be defined (Rosatti et al. 2008; Murillo & García-Navarro 2010a, 2010b; Murillo et al. 2012).

In practical applications of shallow flows, the evaluation of the source term is an aspect of great difficulty. It is possible, for instance, to define Riemann problems (RPs) with large gradients in the bed step that may lead to gross estimations when evaluating its variation in time. In this work, two augmented solvers, which will be referred to as ARoe (augmented Roe) (Murillo & Garcia-Navarro 2010a, 2010b; Murillo & Navas-Montilla 2016) and HLLS (Murillo & García-Navarro 2012a, 2012b) solvers, including the extra wave associated with the presence of bed discontinuity, are used to analyze the effect of the integral approximations made over the source term. They were designed to consider that, in the presence of source terms, the constant state in the approximate solution, , is no longer single-valued. In general problems considering a bottom step, where water elevation is discontinuous, the solutions are bi-valuated at the discontinuity. Both solvers have been successfully used in complex cases described by the one-layer shallow water equations (SWE), as they provide a comprehensive description of the inner states defined in the presence of wetting/drying fronts in steady/unsteady solutions and applied to complex rheology, where the well-balanced property must be redefined to provide accurate stop-and-go triggering mechanisms (Murillo & García-Navarro 2011; Juez et al. 2014). Also, accurate results are obtained for both solvers if using appropriate fixes in the vicinity of critical points (Murillo & Garcia-Navarro 2010a, 2010b; Murillo & Navas-Montilla 2016).

The two-layer SWE represents a complex problem observed in nature driven by internal and external waves, making the application of numerical methods that can assist in the formulation of all the waves of the system, as in the Roe method, desirable. In the two-layer SWE, approximate eigenvalues cannot be described explicitly and numerical treatment of critical cases is of importance. In real flows, intense mixing of the two layers produces shear layer Kelvin–Helmholtz instabilities that may lead to intense mixing of the two layers. Loss of the hyperbolic character of the equations (Abgrall & Karni 2009) is associated with this phenomenon. This problem can be overcome by performing a non-trivial uncoupled treatment of the layers (Bouchut & Morales de Luna 2008), by incorporating in the equations a quadratic friction law between layers that returns the system to the hyperbolic region (Castro et al. 2011) or by remaining close to the boundary of the hyperbolicity (Krvavica et al. 2018). It is worth mentioning the work in Spinewine et al. (2011), where Riemann solvers derived from the HLL formalism were presented including strict preservation of static configurations. The coupling between the two layers did not appear in the Jacobian matrix for the upper layer, allowing a set of explicit and real wave celerites to be obtained.

On the other hand, when the hyperbolic character of the equations is lost, HLLS is still applicable to the unmodified two-layer system. The apparent simplicity of the HLLS solver may hide its numerical capabilities, as it contains the extraordinary power of the approximate Roe's Jacobian matrix. It allows the HLL to include an extra wave accounting for the source term, regardless of the hyperbolic character of the system. Its simplicity makes the HLLS a good candidate to manage wet/dry fronts, allowing positivity over the water depths to be enforced in a simple way, without requiring any tuning parameter.

In the two-layer model equations, layers of different density are considered, resulting from the transport of material at different concentrations in each layer, but assuming a constant value in each one. In environmental problems, transport of mass including spatial variations is frequently analyzed, where the definition of suitable solver is a not minor task (Fernández-Nieto & Narbona-Reina 2008; Murillo et al. 2008a, 2008b; Bai & Jin 2009; Morales et al. 2009; Murillo et al. 2009, 2012; Juez et al. 2013, 2016; Franzini & Soares-Frazao 2018; Gordillo et al. 2020). It is important to remark that the two-layer shallow flow model cannot be expressed in conservation-law form, making unfeasible the use of flux-based solvers, that is, the set of eigenvalues and eigenvectors cannot be determined through a Jacobian matrix derived from a flux function, as done in the one-layer shallow flow model. The same difficulty appears when modeling flow in elastic vessels. In Murillo et al. (2019), the Roe and HLL schemes were adapted to deal with test cases involving extreme collapsing conditions in elastic vessels. To achieve this goal, the system is transformed to provide a conservation-law form, allowing the proper definition of Rankine–Hugoniot conditions. Here, the range of applicability of the presented combination between the ARoe and HLLS is applied to the two-layer SWE with local variable density. Density variation in each layer is the result of variations of a bulk density driven by the mixture of different constituents (Juez et al. 2016).

In order to present and justify the numerical techniques presented here, the structure of the manuscript starts with the mathematical model, where first the integral and next the differential formulations are presented for the -split two-dimensional two-layer SWE. The differential formulation is commonly presented to define the eigenstructure of the problem. Here, differential formulation will also be used as the starting point in the definition of integral approaches over the source terms. We will focus on defining an integral formulation by defining suitable discretizations in scenarios of interest, arriving finally at discretizations that will prove successful when demanding energy balanced solutions, with independence of the numerical solver selected. This will allow us to alternate between HLLS and ARoe solvers depending on the particular needs of the case. In the next section, the linear approximate RP together with a suitable flux function, that will allow description of the updating scheme in terms of a wave-propagation function or in terms of fluxes, will be defined. Once the approximate RP is defined, the ARoe and HLLS will be recalled, respectively, presenting the approximate Jacobian Roe matrix used in both solvers, presenting next the correction/definition of wave speed estimates for ARoe and HLLS solvers. Analysis of transcritical cases is of relevance as they may produce unstable results that have to be properly circumvented. These results are translated to the two-layer system. Next, positivity fixes required to ensure an accurate tracking of wetting/drying fronts in the context of the HLLS solver are presented. The choice between the HLLS or the ARoe schemes in each RP places emphasis on the evolution of the transported materials and is also discussed. Finally, the extension to two-dimensional problems is defined.

Numerical results involve test cases of great difficulty and are presented. A wide variety of test cases are presented, confirming the properties of the combination presented here. Such cases comprise exactly balanced scenarios in subcritical and subcritical-transcritical scenarios, dam-break problems over bed variations and wet/dry fronts, non-hyperbolic situations and transcritical exchange flows with loss of hyperbolicity. The effect of a perturbation in the bulk density and the resulting oscillatory effect is shown. Finally, a 2D dam break around an obstacle that illustrates the stability and robustness of the numerical schemes in the presence of non-uniform bed topography and wetting/drying fronts for both layers, is presented.

Integral formulation

Instead of addressing directly the 2D two-layer shallow water model, in this section, the -split 2D two-layer shallow water equations will be explored first. In this way, the relevant information in the coordinate y is retained while reducing the complexity of the techniques presented here. The resulting analysis of this set of equations can be straightforwardly translated to 2D without loss of generality and no numerical approximations by exploiting the rotational invariance of the governing equations, avoiding redefinition of the numerical fluxes depending on the mesh characteristics (Toro 2009). The coordinate x will be the normal direction (normal to the intercell boundary in the computational domain) and coordinate y will be the tangential direction (parallel to the intercell boundary in the computational domain).

Figure 1 depicts two control volumes, one for each layer. The bed boundary is fixed in time and a unit width configuration is used. Index 1 refers to the upper layer and control volume 1. Index 2 refers to the lower layer and control volume 2. In each control volume the velocity is depth averaged. The relevant integral formulation of the interactions between models derives from the depth-averaged equations for the conservation of mass and momentum.

Figure 1

Control volumes 1 and 2 for upper and lower layers, respectively. Note the variation in the pressure gradient at the interface. This difference stems from the difference between the densities of the two layers.

Figure 1

Control volumes 1 and 2 for upper and lower layers, respectively. Note the variation in the pressure gradient at the interface. This difference stems from the difference between the densities of the two layers.

Close modal

In lower control volume is the bathymetry function and , , are the water depths and averaged velocities in x and in y of layers = 1,2, respectively. Herein, function is the surface level of the lower layer 2 and is the surface level of the upper layer 1. Furthermore, the mathematical model adopted allows a variable density in space in each layer. As a result, a variable density ratio between layers can be defined.

In a Cartesian coordinate system with a vertical -axis, the Reynolds transport for mass conservation leads to:
(1)
Considering that the control volume velocity is nil, Equation (1) in the control volumes 1 and 2 are
(2)
for layers , where the mixture density is given by , is the density of the water and represents the relative density of the bulk mixture to that of the clean water. If represents the scalar depth-averaged volumetric concentration of component p, with and the number of different components transported, r is given by
(3)
where is the relative buoyant density of the solid phase p. If dissolved species with low concentration do not change the bulk density, then . The Reynolds transport theorem can also be written for each -phase, leading to a mass conservation equation
(4)
Instead of working with each transported phase separately, it is more convenient to define an apparent volumetric concentration in each k layer:
(5)
The conservation equation for the apparent volumetric concentration is
(6)
here the difference between Equations (2) and (6) provides the volume conservation.
For the x direction, the momentum conservation equation is written as:
(7)
where the x component of the gravity mass force is . The tensor incorporates the pressure and stresses is defined as:
(8)
with the friction exerted between two layers and p the pressure, assumed hydrostatic. In the control volume 1, Equation (7) becomes
(9)
where is the friction between fluids in layers 1 and 2, and
(10)
The integral of the pressure term in the control volume 1 is:
(11)
involving the integral , that is, the thrust exerted on the lower layer, with and . If we assume that the pressure distribution is hydrostatic over the interface between layers and that the pressure head depends only on the free-surface level of layer 1 on either side of the discontinuity where the surface elevation of layer 2 is lower, is given by
(12)
with , and
(13)
It is also possible to define alternative or approximate expressions for integral , assuming small variations
(14)
with
(15)
The momentum conservation equation for the x direction in control volume 2 is
(16)
with the friction between layers 2 and the bed, and
(17)
The integral of the pressure term in the control volume 2 is:
(18)
with , where the thrust exerted on the bed step is given by
(19)
where and . If we assume that the pressure distribution is hydrostatic over the step and that the pressure head depends only on the side of the discontinuity where the bed elevation is lower, is given by
(20)
with
(21)
that for small or smooth variations, can be approximated by
(22)
If we assume that contact and shear waves are not affected by the presence of forces in the orthogonal direction to the plane, and , we have the following conservation equation for the
(23)
In a Cartesian coordinate system, the relevant integral formulation per unit width of the model, expressed in terms of relative density, , including both layers, is written as:
(24)
where the set of conserved variables and flux are
(25)
and the source term contains the pressure force variation and the source term includes the friction stresses along :
(26)

Differential formulation

The differential formulation is obtained assuming smooth variations of the variables and an infinitesimal width in each control volume. Using the approximations
(27)
and differencing source terms
(28)
where the derivative of pressure terms and along the bottom becomes
(29)
the differential form of (24) becomes
(30)
Now, the momentum equation for layer 1 in differential form in (30) is written as follows:
(31)
while the momentum equation in differential form for layer 2 can be written as:
(32)
The right-hand sides in (31) and (32) only include space derivatives of the bed level. If we want to redefine (30) accordingly, source terms in (30) are split into two new terms, and ,
(33)
where source term is given by:
(34)
and Jacobian matrix is:
(35)
with , and and . Next, Jacobian matrix is derived from flux function
(36)
with
(37)
where . Now, the following differential formulation is presented:
(38)
equivalent to the initial one in (30).

Eigenvalues and critical conditions

Eigenvalues of matrix contain the relevant information to provide the four wave speeds or celerities that dominate the temporal evolution of the equations. They are given by the characteristic equation of the :
(39)
with no simple analytic expression for the eigenvalues in . Two roots associated with shear and contact waves are associated with and . has at least two and a maximum of four real solutions (Blackmore et al. 2008). If using first order expansions over the following expressions appear (Schijf & Schonfeld 1953):
(40)
with (Abgrall & Karni 2009) and s the relative density . The expressions for the two internal waves are related to the propagation speed of baroclinic perturbations and expressions for the two external waves are related to the propagation speed of barotropic perturbations. Under this hypothesis, hyperbolicity is lost when related to the appearance of Kelvin–Helmoltz shear instabilities that may lead, in real flows, to intense mixing of the two layers. When hyperbolicity is lost, external waves in (40) can be used to bound the maximal and minimal wave speed celerities of the system. Other alternatives are possible, for instance, Chen et al. (2007):
(41)
Critical points in the solution appear when one of the eigenvalues vanishes, :
(42)
that expressed in terms of the one-layer Froude number, , becomes
(43)
In two-layer flows, the flow regime is described using the internal Froude number, (Abgrall & Karni 2009). Considering that , Equation (43) provides the critical condition
(44)
used to define the composite Froude number . When , the flow is subcritical and when , the flow is supercritical. The location where is called internal hydraulic control. An insight into the effect on the resulting G number can be found in Abgrall & Karni (2009).

Energy functions

Prior to defining or applying any approximate solver, the differential form of the two-layer equations in (38) must be integrated ensuring that equilibrium is recovered in any control volume defined in a computational domain. Approximate solvers provide solutions to general initial value problems and must also guarantee equilibrium in steady state conditions.

To that end, it is necessary to analyze the physical meaning of the relation of fluxes and source terms. At the bed step discontinuity, a contact wave appears and a choice regarding energy/momentum conservation across such wave must be made. In Valiani & Caleffi (2017), the authors claim that the conservation of energy across the bed step contact wave seems to be the only approach consistent with the classical SWE (LeFloch et al. 2011) and the momentum balance can also be satisfied.

Therefore, in order to analyze the conservation of energy across the contact wave, energy functions are defined first here by the combination of differential forms of mass and momentum equations for upper layer 1 leading to the following conservation equation:
(45)
with head energy level:
(46)
In lower layer 2, the equivalent expression is:
(47)
with head energy level:
(48)

Discrete equilibrium and steady state solutions

Now that the energy functions have been defined, they can be integrated in the computational domain. Their integration will be based on keeping discrete equilibrium while ensuring that momentum balance is also satisfied. In order to clarify the integration steps, quiescent equilibrium is examined first. Next, exact equilibrium under non-zero velocity conditions is analyzed. The integral relations provided here will be used here to guarantee equilibrium in steady state condition with independence of the approximate solvers used.

In the absence of reaction terms in steady state solutions, and are constant, as well as the mass fluxes and . The conditions for momentum are:
(49)
and for energy conservation:
(50)
Differential forms of momentum equation for upper layer 1 in (31) or in system (38) can be integrated in the domain , leading to the following expression in terms of discrete differences:
(51)
with the integral approach of the thrust term for smooth variations in (14). In steady conditions (51) reduces to:
(52)
In cases of quiescent equilibrium, if in the integration domain water levels vary continuously, that is,
(53)
integral approach allows expression of momentum in (52) as:
(54)
providing an exact equilibrium for energy head . In this particular case, the approach in (12), , provides exactly the same result. If a discontinuous variation in the surface elevation is presented and the condition in (53) is no longer true, still provides the correct balance in cases of water at rest and, therefore, it can be used as a plausible alternative to approximate the trust term in (52).
In fact, for equilibrium states where velocity is not zero, it is possible to provide a more ambitious approximation of the source term , using the following linear combination
(55)
with , a suitable non-dimensional parameter that will be derived enforcing exact equilibrium under non-zero velocity. Now, momentum in (51) under steady conditions becomes:
(56)
while differential forms of energy equation for layer 1 in (45) valid for smooth solutions can be integrated in the domain in terms of discrete differences as
(57)
Substracting (57) from (56), the following value for arises
(58)
with , and for both layers. It is important to state that the resulting value of in (58) is independent of the approximations done over the friction source term. Therefore, in cases of equilibrium, thrust term in (55) is given by
(59)
providing an exact balance in smooth solutions for layer 1.
The same analysis can be performed over the momentum equation for lower layer 2 in system (38), which, integrated in the domain and expressed in terms of discrete differences is
(60)
with approximate integral , with defined in (22). In steady conditions, (60) reduces to:
(61)
In cases of water at rest conditions, if water levels vary continuously in the integration domain
(62)
the momentum becomes
(63)
providing now an exact equilibrium for energy head in the lower layer. If combination of thrust terms is expressed as , using approaches and in (20) and (12), respectively, equilibrium is also guaranteed. If the condition in (62) is no longer true, combination in still provides the correct balance in cases of water at rest. Again, this allows us to provide a more ambitious approximation, using the following linear combination
(64)
with and a suitable parameter that will be derived enforcing exact equilibrium under non-zero velocity. The resulting momemtum equation for the lower layer in (51) under steady conditions becomes:
(65)
while the differential form of energy equation for layer 1 in (47), valid for smooth solutions, can be integrated in the domain in terms of discrete differences as
(66)
Subtracting (66) from (65) the following value for arises
(67)
independent of the approximation done over the friction source term. In cases of equilibrium, the thrust term in (64) becomes
(68)
providing an exact balance in smooth solutions.
Between two adjacent cells, i and , of constant length, , a local RP for the system in (30) with the following initial conditions at each edge is defined,
(69)
where is an approximate solution of (69). Following the approach proposed by Godunov, the finite volume discretization of the system in (69) leads to
(70)

is a piecewise constant approximation of the solution at time of the conserved variables in cell i, is the length of the computational cells considered constant, is the time step, and and are the numerical fluxes, yet to be defined, which are computed solving the RPs at the interfaces by means of a suitable Riemann solver.

Analogously, Equation (70) can be rewritten in terms of fluctuations, generally denoted by , leading to
(71)
following the quasi-steady wave-propagation algorithm (LeVeque 1998; Murillo & Garcia-Navarro 2010a, 2010b) with defined as
(72)
defined in the limits . In exactly balanced cases of equilibrium, the desired solution will be . It is remarkable that in order to include the presence of source terms in the structure provided by (71), an extra stationary discontinuity in the Riemann solution must be defined.

With independence of the approximate solver used, the consistency condition must be satisfied, i.e., that the integral of the solution of the linearized RP over a suitable control volume must be equal to the integral of the exact solution over the same control volume. Figure 2 shows an RP, with initial values and a control volume given by the time interval and the space interval , where , being the minimum and maximum wave velocities, respectively, in the domain at . Numerical estimations for and will be defined when discussing the wave-speed estimates of the problem. The notation L and R for the waves at the discrete level is retained here, as in general and can be selected using a wide variety of combinations of the initial information stored in cells i and .

Figure 2

Integration control volume defined by a time interval and a space interval , with and the minimum and maximum possible estimations for the waves of the problem.

Figure 2

Integration control volume defined by a time interval and a space interval , with and the minimum and maximum possible estimations for the waves of the problem.

Close modal
Integrating (69) over the control volume, the resulting condition is
(73)
where the flux difference is written using matrix
(74)
with , where and
(75)
Source terms are split in two terms
(76)
where matrix has the form
(77)
(78)
Average values in and are defined as:
(79)
for layers = 1,2. These sets of average variables are derived from flux difference in (74) and source splitting in (76). Also, they ensure that and when , recovering the differential form in (36) and in (35), respectively.
At this point, only source term remains undefined. Even assuming that the source term can be approximated using the space smooth or discontinuous formulations derived in (12), (14) for and (20) and (22) for , respectively, the question regarding the temporal integration of this term remains unresolved. The time evolution of this term depends on the solution itself. An explicit evaluation is devised as the simplest possibility
(80)
with
(81)
where operators applied to left and right states previously, are now applied to left and right computational cells . Now, and can be computed at each interface using the differential well-balanced forms in (14) and (22) for quiescent equilibrium:
(82)
or using the energy-balanced approximations:
(83)
with in (58) and (67) evaluated at each interface and limited by . In the presence of a critical point or changes in the sign of characteristic polynomial , the differential form in (82) is enforced, as in internal hydraulic jumps, energy is not conserved.
Now that all terms are defined, the integral of the solution in the volume of interest is given by:
(84)
with
(85)
Flux difference and source terms are brought together in matrix difference , and in cases involving equilibrium, the integral in (84) is exact
(86)
allowing us to provide suitable solutions to the RP.

The linear approximate RP

Now that all terms in system (69) have been discretized and the problem linearized, it is possible to express the equivalent problem as a constant coefficient linear RP (Toro 2009). This equivalent formulation does not only allow definition of the approximate Jacobian matrix that provides the set of approximated eigenvalues of the system, but will also allow us to define in a straightforward way a flux formulation of the problem, allowing the use of flux-based numerical solvers. The RP in (69) is now approximated by
(87)
where is a constant matrix yet to be defined. Integrating (87) over the same control volme and performing the same approaches over the source term, the following constraint appears
(88)
that is, . Equilibrium in (86) is then also expressed as:
(89)
with when , recovering the differential form in (38). Formulation in (87) is useful to define a new variable of interest,
(90)
The linear function is not a real physical flux, but it will prove useful for our purposes. It allows the commonly used expression for a constant coefficient linear RP in terms of a flux:
(91)
with the same initial conditions, transforming the integral result in (85) to
(92)
that is, an equilibrim between a flux difference and a source term.
If we assume that all the approximate eigenvalues of given by
(93)
are real, and the set of approximate eigenvalues is ordered as follows:
(94)
it is possible to define approximate matrix , with the following property
(95)
where is a diagonal matrix with approximate eigenvalues in the main diagonal. Detailed expressions for are given in the Appendix.

One result of Roe's linearization is that the resulting approximate Riemann solution consists of only discontinuities and is constructed as a sum of jumps or shocks. The solutions for are governed by the celerities in and each one consists of regions connected by waves, one of them steady, with celerity .

According to the Godunov method, it is sufficient to provide the solution for at the intercell position in order to derive the updating numerical fluxes in (70). In order to recover the value of the approximate intermediate states and at the left and right side of the plane solution, respectively,
(96)
The system in (87) is transformed by using the matrix as follows
(97)
expressing (87) in terms of the characteristic variables , with . This transformation leads to a decoupled system (Toro 2009) that generates the following linear RP
(98)
with , where each equation
(99)
involves the variable and the source term . Equation (99) allows the generation of a set of independent equations that can be solved exactly for each characteristic variable . The solution is constructed using the set of wave strengths
(100)
and the set of source strengths
(101)
It is worth mentioning that wave strengths allow expression of simple linear relations for both conserved variables and flux vector differences as follows:
(102)
The value of the characteristic variables at the left and right side of the intercell position in matrix form, and , is:
(103)
where is a diagonal matrix
(104)
Now, the intermediate states and can be directly obtained by using the matrix. Vector solutions and are recovered from (103) as follows:
(105)
with the following property
(106)
The solution being defined as a sum of jumps or shocks between the different intermediate states, the solution for the approximate linear flux function at the left and right side of the initial discontinuity at , labeled as and , respectively, reads
(107)
The relation between the intercell approximate fluxes can be analyzed using the RH (Rankine–Hugoniot) relation at , that includes a steady contact wave (Li & Chen 2006; Rosatti & Begnudelli 2010) between approximate solutions and . The RH condition reads
(108)
and provides the following relation among fluxes and conserved variables in the inner regions
(109)
confirming condition (106). The telescopic properties of the linear solutions for the approximate flux function provide the definition of fluxes at , , and ,
(110)
At this point, the corresponding intercell flux for the approximate first order Godunov method in (70) is given by
(111)
It is worth mentioning that it is no longer possible to define a general intercell flux function independent of the side of the solution considered, due to the presence of source terms, as in the homogeneous case. The equivalent fluctuation form of the numerical scheme in (71) can be straightforwardly derived by simply using the intercell flux definitions in (111)
(112)
leading to
(113)
with .

Unlike the ARoe solver, in the HLLS solver, which we will use in this work, only two inner states are defined, limiting the number of waves involved in the solution. The selection of the HLLC solver (Toro et al. 1994) or the HLLCS (Murillo & García-Navarro 2012a, 2012b) solver, can be considered a better choice, as both of them avoid excessive smearing of contact waves and vortices in 2D flows if compared with using the HLL or HLLS solvers. Despite these improvements, the HLLS solver has been selected, as it retains a simpler and more efficient analysis of the inner states in wetting/drying processes for both layers while introducing a sufficient level of numerical diffusion in cases of loss of hyperbolicity.

The integral average of the approximate RP between the slowest and fastest signals at time can be derived by simply setting and in the control volume defined in Figure 3. Although it is possible to define the average value, the presence of the source term introduces a variation in in the solution across , leading to two new integral averages and
(114)
as depicted in Figure 3.
Figure 3

Integration control volume defined by a time interval and a space interval . The solutions consist of two inner constant states separated by a stationary shock wave at .

Figure 3

Integration control volume defined by a time interval and a space interval . The solutions consist of two inner constant states separated by a stationary shock wave at .

Close modal
The introduction of the source term also leads to the definition of two new fluxes, and , with the following RH relations across the left and right waves, respectively
(115)
and the following RH relation for the steady shock, of shock speed S, at
(116)
since = 0. Relation (116) gives information about fluxes and , and is exploited here to provide information among conserved intermediate states and by expressing the difference as
(117)
through a matrix . The intermediate states and being unknown, the condition in (108) is adopted from the ARoe solver
(118)
leading to:
(119)
With the set of Equations (115), (116) and (119), it is now possible to define the intermediate states and fluxes. The intermediate states are given by (Murillo & García-Navarro 2012a, 2012b)
(120)
and the intermediate fluxes are
(121)
with
(122)
the solutions for the particular case . The corresponding intercell flux for the approximate Godunov method in (70) is given by two functions
(123)
(124)
If expressed in fluctuation form, results in
(125)
(126)

In order to generate the intercell fluxes it is necessary to compute the speeds and . Suitable approximations are discussed next.

Wave-speed estimates are analyzed in this section. When roots in are real, the ARoe scheme provides the set of approximate eigenvalues or waves of the system, internal and external ones, while the HLLS requires estimation of the external ones. In any case, the time step will be restricted by the largest approximate wave celerity selected when using one specific solver.

Wave-speed estimates in the ARoe solver

Roe's linearization provides an approximate solution constructed as a sm of jumps or shocks, leading to a good approximation for contact and shock waves. In rarefaction waves, a continuous change in flow variables appears, and approximations based on shocks may lead to inaccurate results, especially in transcritical cases. The accuracy of the numerical predictions for the one layer is certainly improved if using the Harten–Hyman entropy fix in (Harten 1984; Toro 2009) in transcritical dam-break problems as well as in steady solutions. This procedure also allows reproducing exactly the sonic point in the presence of source terms (Murillo & García-Navarro 2012a, 2012b).

The same problem is extensible to the two-layer model. The presence of critical points where one of the approximate eigenvalues vanish, given by condition , must be considered to accurately reproduce transcritical problems in two-layer flows. The left transcritical rarefaction is characterized by the internal wave , with and . In this case, the initial solution provided by average value produces inaccurate results. The solution in (Harten 1984; Toro 2009) for the homogeneous case without source terms includes a virtual intermediate state between celerities and as the numerical flux has a single value in the star region. The full description of the overall approximate solution can be bypassed by defining a new wave speed, , leading to a simple modification of the general flux formulation. The approximate solution proposed in the presence of source terms is based on the preservation of the conservative character of the numerical scheme. Following Roe approximation two new jumps are involved in the solution. Flux splitting is redefined considering the new wave and source wave strengths:
(127)
where ,
(128)
and , .
In the case of a right transcritical rarefaction, , the entropy fix procedure is entirely analogous to the left rarefaction case. The single jump in is split into two smaller jumps and and flux splitting is redefined as follows:
(129)
preserving conservation across discontinuities, with , given by
(130)
with and .

Wave-speed estimates in the HLLS solver

Although the two-layer model presents a rich variety of waves, when using the HLLS, only two inner states are defined. The application of the HLLS does not require a decomposition in waves, only computation of appropriate wave bounds and . Direct wave speed estimate of the external waves, and , is the simplest method providing minimum and maximum signal velocities.

The relevant conclusion is that HLLS can be used to strongly simplify our numerical solution and in cases where the set of eigenvalues is not provided, that is, hyperbolicity is lost, generating suitable values for and . Loss of hyperbolicity is a challenge when numerically dealing with two-layer flows and is a limitation for the application of more complete solvers, such as the Roe solver. Whether appropriate wave estimates are provided, the HLLS can be directly applied as the Jacobian matrix is defined even when the roots of the characteristic polynomial in (93) become complex.

Suitable bounding of wave speeds used in this work derive from considerations made directly over initial differential formulation in (30)
(131)
where the resulting Jacobian couples both layers transmitting pressure variations in the upper layer to the lower layer, leading to the following set of celerites (Spinewine et al. 2011):
(132)
where . If the roots of the characteristic polynomial in (93) become complex, and are obtained using the largest differences between minimum and maximum possible estimations
(133)
with
(134)
In any case, matrix can be defined using , resulting in:
(135)
where
(136)
and the characteristic polynomial in (93) when one of one of the wave speeds is zero.
In the case that one of the approximate internal wave celerites, or , approaches to zero, and will provide unrealistic values that will cause numerical failure of the simulation. This is explained by the presence of term in the denominator. When all internal and external approximate eigenvalues are real, both values in (136) can be expressed as
(137)
and and in the denominator force a division by zero in critical cases.

In order to overcome possible numerical anomalies, a critical flow-fix correction is proposed, based on the evaluation of the characteristic polynomial in cells i and in (39).

Depending on the value of the product , matrices and are modified as follows:
(138)
for . The source term is then reconstructed by redefining first as in (135) and using next.

The numerical integration of the source terms can be performed exactly in steady state RPs, but when moving to transient variations, gross estimations of the source term may lead to unphysical results, as negative values of water depth, with independence of the time step selected. A positivity fix of the source terms can be enforced by means of the choice of a suitable control volume in the cell averaging step, or by analyzing each inner state of the approximate solution separately. This procedure has been applied successfully to the one-layer shallow water equations in Murillo & Navas-Montilla (2016) for the ARoe scheme, but cannot be easily extended to the two-layer shallow flows where a large number of waves is included and an explicit evaluation of the approximate eigenvalues cannot be provided. This issue is bypassed here by using the HLLS solver, not only in cases where hyperbolicity is lost, but also in those problems where the water depth of either the upper or lower layer vanishes, as will be seen in the applications.

Using the definition of the inner states in (120) and their relation in (119), it is possible to enforce positivity conditions over the two inner states that shape the approximate solution given by the HLLS solver. Positivity conditions enforce positive values of water depth for both layers at the left and right side of the cell interface, and , respectively. Both states depend on source terms and , and therefore source corrections cannot be directly done by modifications over each value separately. Nevertheless, it is still possible to analyze separately and , allowing a direct control over each layer. If , the following results can be derived for layers , and for with :

  • Positive values of require the following limit over
    (139)
  • In the case that becomes negative, can be replaced by , leading to the following left and right inner states
    (140)
  • ensuring positive values of water depth on the right side of the plane solution. In the case that the left side of the initial solution is dry, if setting the discharge across becomes nil,
    (141)
  • and the modification of the source term acts as the imposition of a reflecting wall.

  • Positive values of lead to the following limit over
    (142)
  • In the case that becomes negative, can be replaced by with the following consequences
    (143)
  • ensuring positive values of water depth in both sides of the solution. In the particular case, with the left side of the initial solution dry, , if enforcing , intercell flux given by (121) becomes zero and the modification of the source strengths acts as the imposition of a reflecting wall in the wet/dry RP.

Therefore, positive values of water depth in each k layer can be ensured if
(144)

If integral approaches of the source terms are modified to ensure the condition in (144) positive values of the space solution are ensured and if one side of the initial solution is dry, a reflexion boundary condition is generated independently over each layer.

In the previous sections the HLLS and the ARoe scheme with application to the two-layer SWE have been detailed. The HLLS can be used even in cases where this system looses the hyperbolic character, by using appropriate wave estimates and . The exclusive use of the HLLS in two-layer flow solver provides inaccurate and excessively diffusive results, as in the hyperbolic region the problem is governed by two internal and two external waves. Only two bounding waves cannot accurately define the solution.

The use of the HLLS is, therefore, enforced here in cases of loss of hyperbolicity and in wetting-drying RPs when one of the water depths at each side of the RP vanishes, allowing a systematic treatment of wetting-drying fronts without imposing any tuning parameter. In any other case, the ARoe scheme is applied.

As we are considering the transport of species with variable concentration in each layer, the numerical update of their value over time must be carried out using a unified framework for the two numerical schemes used, HLLS and ARoe, for the resolution of the flow.

Once the numerical fluxes in (111) or in (123) for the ARoe and HLLS schemes are computed, the computation of the mass fluxes for each p component is straightforward. The procedure used to compute time evolution of the set of transported variables in each layer
(145)
is based by simply using the mixture mass discharge evaluated at , that will be referred to as , given by the first or the fifth component of the numerical flux provided by the HLLS solver in (123),
(146)
or provided by the ARoe solver in (111),
(147)
The updating value of the set of transported variables is finally done using
(148)
where
(149)
and the vector of concentrations of the transported species.

The 2D extension to the two-layer shallow water system is presented, and the updating numerical scheme written in terms of an unstructured mesh can be easily written for a Cartesian mesh if desired. The definition of the updating numerical scheme, based again in intercell flux approximations, arises from exploiting the rotational in variance of the governing equations (Toro 2009).

Depth-averaged equations expressing volume conservation and momentum conservation for the 2D two-layer shallow water can be expressed as:
(150)
where
(151)
with
(152)
(153)
(154)
with the depth-averaged components of the velocity along the x and y coordinates, respectively. Defining Jacobian matrices and
(155)
the following differential formulation appears:
(156)
with and equivalent to
(157)
Let be the time step. Assuming the usual notation, we indicate with the cell-average value of the solution for the -th cell at time . As in the -split case, the reconstruction step has been considered assuming a first order in space approach. A general cell is depicted in Figure 4, where indicates the outward unit normal vector to the cell i at edge k and is the corresponding edge length. To introduce the finite volume scheme, (157) is integrated in a grid cell
(158)
Figure 4

Cell parameters in the 2D model.

Figure 4

Cell parameters in the 2D model.

Close modal
In the -split two-layer shallow water equation model the approximate solution of each RP is obtained from a locally linearized problem in a unique direction. The same strategy is applied in the 2D framework by reducing each RP at each k edge to a Riemann problem projected onto the direction as shown in Figure 5. The RP can be defined along the reference coordinate, x, parallel to vector . This is done here by projecting Jacobian matrices and source terms onto the normal direction to each cell edge. A normal Jacobian matrix appears (Toro 2009):
(159)
while bed and friction slope source terms are expressed in the normal direction as follows:
(160)
with
(161)
with the shear stress evaluated in the normal direction. The shallow water equations satisfy the rotational invariance property (Toro 2009):
(162)
where is the rotation matrix and is its inverse matrix
(163)
Figure 5

Riemann problem in 2D along the normal direction to a cell side.

Figure 5

Riemann problem in 2D along the normal direction to a cell side.

Close modal
With them it is possible to calculate the conserved variable ,
(164)
where is the normal velocity through the interface , and the tangential velocity , equivalent to the -split formulation in (25). The same equivalence applies for fluxes and . If the rotation matrix is applied to the source term, the equivalent vector appears
(165)
This transformation allows us to define a local RP along the normal direction in each k edge, and the 2D shallow water equations can be written in -split form
(166)
as desired. The numerical scheme is written as
(167)
with the length of cell edge k and the number of edges in cell i. The numerical flux can now be determined using the approximate HLLS in (123) or ARoe in (111) solvers presented previously. Therefore, numerical fluxes will be determined first in each -split RP that will provide and also .

The suitability of the combination of the HLLS and ARoe in cases of loss of hyperbolicity or in wetting-drying fronts when one of the water depths of one or both layers vanishes is shown in the applications section. A wide variety of test cases is presented confirming the properties of this combination. They include exactly balanced scenarios in subcritical and subcritical-transcritical scenarios, dam-break problems over bed variations and wet/dry fronts for both layers, non-hyperbolic conditions, transcritical exchange flow with loss of hyperbolicity. Despite the complexity of the test cases presented here, accurate and stable simulations are guaranteed, ensuring positivity of the solution and not requiring a decrease of the time step. Most of the numerical tests presented in this work assume constant density in each layer and constant density ratio, as the test cases presented have been selected from the literature published for two-layer flows. But in environmental flows, density may change, making it necessary to consider for each layer a mixture of different species, each one with different concentration and relative density. In order to demonstrate the capability of the tools presented here in cases where initial conditions involve variable density in space, a new numerical test is presented in this work. This test case, that in conditions of constant density ratio remains in static equilibrium, is modified introducing a mixture of three constituents leading to horizontal variations of density and density ratio. The solution generates an oscillatory movement that is analyzed using cyclic boundary conditions.

Steady subcritical flow with sudden contractions and expansions

In this test case numerical preservation of exact equilibrium is analyzed in cases with velocity. Following the ideas of Stelling (Stelling & Duinmeijer 2003; Murillo & García-Navarro 2012a, 2012b, 2014) regarding energy conservation, a frictionless steady test problem is used to illustrate the differences among solutions when using different approaches in the integration of the source term. This case includes variable and constant bed slopes followed by sharp bed elevations without shocks that result in sudden contractions and expansions. The resulting flow is sub-critical and is defined in the hyperbolic region. Two-layer flow is defined in the interval , and bed elevation is given by
(168)
Numerical discretization is done by dividing the domain first in 100 cells and then in 1,000 cells, setting CFL = 0.45 and r = 0.98. Boundary conditions are , , , and . A subcritical flow develops over the bed level plotted in Figure 6, where upstream, a gradual contraction is followed by a sudden expansion. Next, the sinusoidal bed form provides a smooth or gradual contraction followed by a gradual expansion. Downstream, a sudden contraction is followed by a gradual expansion.
Figure 6

Steady subcritical flow with sudden contractions and expansions. Numerical solutions for water levels and using the approach in (83) in (a) and (c), and the approach in (82) in (b) and (d), using (upper) 100 cells and (lower) 1,000 cells.

Figure 6

Steady subcritical flow with sudden contractions and expansions. Numerical solutions for water levels and using the approach in (83) in (a) and (c), and the approach in (82) in (b) and (d), using (upper) 100 cells and (lower) 1,000 cells.

Close modal

Figure 7 shows the numerical solution using 100 cells. In all cases the unit discharge is constant. This result is independent of the integral approximation over the source term, as it is ensured by the properties of the solvers themselves. However, depending on the approximation done over the trust term, differences in the head energy are observed. Numerical integration in (82) () deviates the total head energy with respect to the exact solution. The symmetry in the bed elevation is responsible for recovering the exact level downstream. When using the approach in (83) () numerical integration conserves exactly at every cell the head energy, with independence of the grid refinement, as confirmed by results in Figure 8, for 1,000 cells.

Figure 7

Steady subcritical flow with sudden contractions and expansions. Numerical errors for energy levels and and unitary discharge and using the approach in (83) () and the approach in (82) (), using 100 cells.

Figure 7

Steady subcritical flow with sudden contractions and expansions. Numerical errors for energy levels and and unitary discharge and using the approach in (83) () and the approach in (82) (), using 100 cells.

Close modal
Figure 8

Steady subcritical flow with sudden contractions and expansions. Numerical errors for energy levels and and unitary discharge and using the approach in (83) () and the approach in (82) (), using 1,000 cells.

Figure 8

Steady subcritical flow with sudden contractions and expansions. Numerical errors for energy levels and and unitary discharge and using the approach in (83) () and the approach in (82) (), using 1,000 cells.

Close modal

Steady transcritical flow with a hydraulic jump

Preservation of exact equilibrium is analyzed in cases of transcritical flow with a hydraulic jump in this section. Two-layer flow is defined in the interval , and the bed elevation is given by . Numerical discretization is done by dividing the domain in 100 cells, setting CFL = 0.45 and . Initial conditions are ,
(169)
and . Free boundary conditions are imposed (Abgrall & Karni 2009) and maximal exchange flow conditions are achieved once steady state conditions are reached. The flow accelerates from sub- to supercritical as it goes over the bump and a hydraulic jump is produced, as shown in Figure 9. The flow is kept in hyperbolic conditions. Figure 10 depicts the energy levels and and unitary discharges and computed using both approaches. The presence of a one-cell spike in the discharge at the location of the jump is clearly observed (Navas-Montilla & Murillo 2017). There are two reasons that explain the presence of such spurious spikes. The first reason is inherent to the scheme chosen, the use of a Godunov-like numerical scheme, where the cell size determines the width of the hydraulic jump, required to impose a shock-averaged value inside the cell containing the jump. Such an issue is related to the second reason. The cell-averaged value in the cell containing the shock is determined by the Rankine–Hugoniot relations. Only when having a linear Hugoniot locus, a discharge value in the cell containing the jump is bounded by the left and right values, otherwise, spikes can appear.
Figure 9

Steady transcritical flow with a hydraulic jump. Numerical solutions for water levels and using the approach in (83) and 100 cells.

Figure 9

Steady transcritical flow with a hydraulic jump. Numerical solutions for water levels and using the approach in (83) and 100 cells.

Close modal
Figure 10

Steady transcritical flow with a hydraulic jump. Energy levels and and unitary discharge and using the approach in (83) () and the approach in (82) (), using 100 cells.

Figure 10

Steady transcritical flow with a hydraulic jump. Energy levels and and unitary discharge and using the approach in (83) () and the approach in (82) (), using 100 cells.

Close modal

An internal dam-break problem

This test was designed in Fernández-Nieto et al. (2011) to evaluate the accuracy of the schemes for non-regular time-dependent solutions over a flat bed and is used here to compare the different source term discretizations proposed in this work. The initial condition is