Next Article in Journal
Improved Oscillation Criteria for 2nd-Order Neutral Differential Equations with Distributed Deviating Arguments
Next Article in Special Issue
Sliding Modes Control for Heat Transfer in Geodesic Domes
Previous Article in Journal
New Criteria for Meromorphic Starlikeness and Close-to-Convexity
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Second-Order Well-Balanced Finite Volume Scheme for the Multilayer Shallow Water Model with Variable Density

by
Ernesto Guerrero Fernández
1,
Manuel Jesús Castro-Díaz
1,* and
Tomás Morales de Luna
2
1
Departamento de Análisis Matemático, Facultad de Ciencias, Universidad de Málaga, Campus de Teatinos S/N, 29081 Málaga, Spain
2
Departamento de Matemáticas, Universidad de Córdoba, Campus de Rabanales, 14071 Córdoba, Spain
*
Author to whom correspondence should be addressed.
Mathematics 2020, 8(5), 848; https://doi.org/10.3390/math8050848
Submission received: 3 May 2020 / Revised: 16 May 2020 / Accepted: 19 May 2020 / Published: 23 May 2020
(This article belongs to the Special Issue Modeling and Numerical Analysis of Energy and Environment)

Abstract

:
In this work, we consider a multilayer shallow water model with variable density. It consists of a system of hyperbolic equations with non-conservative products that takes into account the pressure variations due to density fluctuations in a stratified fluid. A second-order finite volume method that combines a hydrostatic reconstruction technique with a MUSCL second order reconstruction operator is developed. The scheme is well-balanced for the lake-at-rest steady state solutions. Additionally, hints on how to preserve a general class of stationary solutions corresponding to a stratified density profile are also provided. Some numerical results are presented, including validation with laboratory data that show the efficiency and accuracy of the approach introduced here. Finally, a comparison between two different parallelization strategies on GPU is presented.

1. Introduction

Shallow-water (or Saint–Venant) type systems are among the most widely used models to study geophysical flows (see [1,2]). However, these types of models have a main limitation or drawback: the consideration of an averaged horizontal velocity while neglecting the vertical components. In order to overcome this limitation, multilayer shallow water models have been developed in recent years. This multilayer approach allows for capturing complex vertical effects and profiles that single layer shallow water models cannot (see [3,4,5]). These multilayer models have been applied by several authors for different geophysical problems, like tsunamis ([6,7,8,9,10]), flooding events ([11,12,13,14,15]), or storm-surges ([16,17,18]).
One possible approach to introduce multilayer shallow water models is the one described by Audusse et al. in [19]. There, the domain is discretized in the vertical direction with an a priori arbitrary number of layers. In each layer, similar assumptions as in the classical shallow water framework are made: the velocity is averaged in the vertical direction, vertical effects are neglected, and the pressure is assumed hydrostatic. In order to allow mass and momentum exchange between layers, an approximation of the vertical flux in the layer is incorporated into the model through non-conservative terms (see [20,21] or [4]). In this way, we are able to obtain a detailed vertical profile of the velocity. Recent developments in multilayer shallow water models concern the local change of the number of layers according to the presence of relevant vertical effects (see [22]).
Another approach to capture complex vertical profiles, but avoiding fully 3D models while calculating the free surface directly, are the so-called σ -coordinate models ([23]). In those models, as in the multilayer approach, the free surface is defined as a function of the horizontal coordinates. In this way, the free surface is always located at the upper boundary and can be derived from the standard free surface conditions. This simplification provides a new set of models that allows turbulence, solute transport, and also short wave propagation (see [24,25,26]).
A further step in the development of the multilayer shallow-water models is given by the derivation of multilayer shallow water models with non-hydrostatic pressure (see [27,28] or [29]). These models include effects due to the vertical acceleration of the fluid that are derived from the Boussinesq-type wave equations. By doing so, the dispersive properties of the model are enhanced and simulation of more physical effects becomes possible at the cost of a greater computational effort.
While multilayer shallow-water models can satisfactorily capture vertical stratification due to velocity, they fail to provide an adequate solution when the stratification is due to general changes in density, like the ones due to variations in temperature and/or salinity. The examples of density driven currents in natural geophysical flows are numerous. One classical example is at the Strait of Gibraltar, where two currents, one from the Atlantic Ocean and the other from the Mediterranean Sea, meet. These two flows are different in terms of temperature and salinity. The water from the Mediterranean sea has more salinity due to greater evaporation. Thus, the Mediterranean flow is denser and tends to flow under the current from the Atlantic Ocean. Capturing the vertical profile in this situation is impossible for standard shallow water equations, and it is necessary to apply a model that takes into account these buoyancy effects.
In this framework, several authors have proposed multilayer shallow water models with variable density. In [30,31], for instance, the differences in density are due to suspended sediment. In [32], the authors propose a multilayer shallow water model that takes into account density variations due to a given tracer such as the temperature.
Here, we shall consider a similar model to the one presented in [32]. The main differences concern the derivation, where we propose a slightly different approximation of the exchange terms between layers, and especially in the numerical discretization of the model. Moreover, we also propose a parallel implementation on GPUs.
The model considered is quite different from other approximations that assume immiscible layers (see [33,34]) or consider the water entrainment as an heuristic-dependent source term (see [35]). Here, we allow the density variations to circulate freely between the layers. Let us remark that the layers are just a means of capturing a complex vertical profile and do not correspond to physical layers.
Concerning the numerical approximation of shallow water type models, a relevant issue is the exact preservation of some equilibrium states. In particular, in the simulation of geophysical flows, an important problem consists of a perturbation of these equilibrium states. The design of numerical schemes that are well-balanced, that is, that preserve the stationary solutions of the model exactly, is of great importance for the long-term numerical stability of the simulation. The exact preservation of these stationary solutions, especially for the shallow water equations, is a relevant research topic (see [36,37,38], or [39], and the references therein ).
In this work, we propose a path-conservative numerical scheme based on a modified hydrostatic reconstruction ([40]) combined with a second order reconstruction procedure. The well-balanced properties of the scheme are also discussed.
The paper is organized as follows. In Section 2, we describe the governing equations of the problem, we provide a general formulation for the multilayer approach, we give the general expression of the multilayer model and we present some relevant stationary solutions. Section 3 is dedicated to introduce the second-order numerical scheme used to discretize the multilayer system. The proposed numerical scheme is a well-balanced path-conservative second order numerical scheme based on a modified hydrostatic reconstruction. Moreover, hints on how to preserve a general class of stationary solutions corresponding to a stratified density profile are also given. In Section 4, we present some numerical tests, including comparison between the model and a laboratory experiment. Section 5 summarizes some conclusions. Finally, in Appendix A, a study of performance and computational cost for different parallelization strategies is addressed and in Appendix B, a thorough description of the model derivation is provided.

2. Governing Equations and Model

The free surface Navier–Stokes equation in a d-dimensional space ( d = 2 , 3 ) are considered. We denote by v = ( u , w ) the velocity function with u R d 1 the horizontal components of the velocity and w the vertical one. We will consider two continuity equations: one corresponding to an incompressible flow with constant density ρ 0 and the other corresponding to the advected flow with variable density, ρ ,
· v = 0 , t ρ + · ( ρ v ) = 0 , t ( ρ v ) + · ( ρ v v ) = g ρ k + · Σ ,
where k = ( 0 , 1 ) T , g is the constant gravity function, ρ is the total density of the fluid, and the total stress tensor is given by Σ = p I + T , with I the identity tensor, p the pressure term, and T the tensor corresponding to the viscous terms,
T = T H T x z T x z T z z .
We shall decompose the total density ρ as the sum of a reference density, denoted by ρ 0 , and the corresponding variation from that reference density, denoted by ρ 1 ,
ρ = ρ 0 + ρ 1 .
If we now divide (1) by ρ 0 , we obtain the following system:
· v = 0 , t ( θ ) + · ( θ v ) = 0 , t ( θ v ) + · ( θ v v ) = g θ k + 1 ρ 0 · Σ ,
with
θ = ρ ρ 0 = 1 + ρ 1 ρ 0 .
We shall now consider a multilayer shallow water approach to system (4). In the multilayer approach, the fluid domain Ω F ( t ) is divided along the vertical dimension into a set of M N layers of thickness h α ( t , x ) with M + 1 smooth interfaces Γ α + 1 2 ( t ) , which shall be described as (see Figure 1):
Γ α + 1 2 ( t ) = ( x , z ) Ω F ( t ) , such that z = z α + 1 2 ( t , x ) , α = 0 , 1 , , M .
The layers will be then described as
Ω α ( t ) = ( x , z ) Ω F ( t ) , such that z α 1 2 ( t , x ) < z < z α + 1 2 ( t , x ) , α = 1 , , M .
We shall denote by z B = z 1 2 and z S = z M + 1 2 the bottom and the free-surface, respectively. Let us define h α = z α + 1 2 z α 1 2 as the thickness of each layer. The total height of the fluid column is then given by h = z S z B = α = 1 M h α .
Following the usual approach in multilayer shallow water models, we consider the horizontal velocity and relative density fluctuations to be independent of the vertical variable z:
v | Ω α ( t ) : = v α : = ( u α , w α ) , θ | Ω α : = θ α , p | Ω α : = p α ,
where u α is the horizontal velocity and w α is the vertical one. We also assume that both w α and p α are linear in z inside each layer. Moreover, we suppose that pressure is also continuous at the interfaces and hydrostatic pressure is assumed, so that
p α ( t , x , z ) = p α + 1 2 + θ α g ( z α + 1 2 z ) ,
with
p α + 1 2 ( t , x ) = p S ( t , x ) + g β = α + 1 M θ β h β ( t , x ) .
Here, the component p α + 1 2 is the hydrostatic pressure at Γ α + 1 2 ( t ) and p S denotes the pressure at the free surface. Therefore, the unknowns of the system are the depths of the layers, the density fluctuation, and the horizontal velocities in each layer. Remark that z w α = · u α and therefore it is not considered as an unknown. As it is usual in multilayer shallow water type systems, we shall consider l α ( 0 , 1 ) , α = 1 , , M such that α = 1 M l α = 1 . Then, the layer thickness is assumed to be proportional to the total depth, so that h α = l α h .
There is no hope for such a particular set v α , θ α , p α to be a solution of the complete equations in the layer Ω α ( t ) . Instead, we shall consider a reduced weak formulation with particular test functions. A detailed derivation of the vertical integration procedure can be found in [20,30], or [4]. A thorough derivation of this specific model is given in Appendix B. For the sake of simplicity, from now on, we will suppose d = 2 and merely present the final version of the model, where the horizontal viscosity terms have been neglected
{ t h + x h β = 1 M l β u β = 0 , t ( h θ α ) + x ( h θ α u α ) = 1 l α θ α + 1 2 G α + 1 2 θ α 1 2 G α 1 2 , t ( h θ α u α ) + x ( h θ α u α 2 ) + g h θ α x η + g h β = α + 1 M l β ( θ β θ α ) x h + g h β = α + 1 M l β h x θ β + 1 2 g l α h 2 x θ α = 1 l α u α + 1 2 θ α + 1 2 G α + 1 2 u α 1 2 θ α 1 2 G α 1 2 ,
where η = h + b is the free surface and G α ± 1 2 α = 1 , , M 1 , are the mass exchange terms between layers, defined by
G α + 1 2 = β = 1 α l β t h + x ( h u β ) = β = 1 α l β x ( h u β ) x h γ = 1 M l γ u γ .
We will also consider no mass exchange at the bottom and the free surface, that is, G 1 2 = G M + 1 2 = 0 . In addition, θ α + 1 2 and u α + 1 2 are some approximation of u and θ at the interfaces Γ α + 1 2 , α = 1 , , M 1 . Typically,
u α + 1 2 = u α + 1 + u α 2 , θ α + 1 2 = θ α + 1 + θ α 2 , α = 1 , , M 1 ,
with u 1 2 = u 1 , u M + 1 2 = u M and θ 1 2 = θ 1 , θ M + 1 2 = θ M .
System (8) may be rewritten in the following form:
{ t h + x h β = 1 M l β u β = 0 , t ( h θ α ) + x ( h θ α u α ) = 1 l α θ α + 1 2 G α + 1 2 θ α 1 2 G α 1 2 , t ( h θ α u α ) + x ( h θ α u α 2 ) + g h θ α x η + g l α 2 h x ( h θ α ) h θ α x h + g β = α + 1 M l β h x ( h θ β ) h θ α x h = 1 l α u α + 1 2 θ α + 1 2 G α + 1 2 u α 1 2 θ α 1 2 G α 1 2 .
Note that pressure terms have been rewritten and reduce to
P α : = g l α 2 x ( h 2 θ α ) + h x p α + 1 2 + g h θ α x z α 1 2 = g h θ α x η + g l α 2 h x ( h θ α ) h θ α x h + g β = α + 1 M l β h x ( h θ β ) h θ α x h .
One can easily check that system (10) has non-trivial stationary solutions. Here, we are interested in the particular stationary solutions that satisfy u α = 0 , α = 1 , , M . For this particular case, one can distinguish two families of stationary solutions: the one corresponding to the choice of a constant relative density function θ α = K , α = 1 , , M , and the more general case where θ α is not constant.
In the first case, the stationary solution reduces to the well-known lake-at-rest stationary solutions, characterized in this case by
u α = 0 , θ α = K 1 , η = h + b = K 2 ,
where K 1 1 and K 2 are two given constants.
For the second more general case, we shall consider smooth stationary solutions. Then, given two known smooth functions b ( x ) and h ( x ) 0 , the stationary solutions are characterized as the regular solutions of the following ODE system:
l α 2 ( θ α ) + β = α + 1 M l β ( θ β ) = 1 h θ α ( h + b ) + β = α + 1 M l β ( θ β θ α ) h , α = 1 , , M .
Note that the ODE (12) can be solved by an iterative procedure: starting from α = M , where the equation only depends on θ M ,
( θ M ) = 2 h l M ( h + b ) θ M ,
and then continue to solve downwards on α so that once that θ M , θ M 1 , , θ α + 1 have been calculated, (12) corresponds to a scalar ODE for θ α that may be solved.
Note that there exists a trivial class of stationary solutions for the original system (4), which corresponds to a stratified fluid with constant free surface, that is,
u = 0 , η ( x ) = b ( x ) + h ( x ) = K , θ ( z ) = θ s u r f a c e + α ( η z ) .
Unfortunately, these types of solutions are not an exact solution of (12). Therefore, they are not stationary solutions for the multilayer system (10), except for the case of constant bottom b ( x ) = c s t . This is due to the particular choice of the vertical discretization used in the multilayer approach. The layers are proportional to the total thickness and the variables have been averaged inside the layer. As a result, averaging of stratified solutions does not result in a stratified solution (space independent of θ ) for the multilayer system, unless the bottom and free surface are constant.
Nevertheless, stationary stratified solutions (13) may be approximated in the multilayer framework by the following set of stationary solutions:
u α = 0 , η ( x ) = b ( x ) + h ( x ) = K , θ M ( x ) = θ ¯ M 1 , θ α ( x ) = θ ¯ α h 2 ( M α ) ( x ) + β = α + 1 M S 2 ( M β ) ( M α + 1 ) θ ¯ β h 2 ( M β ) ( x ) ,
with
S β ( α ) = ( β + 1 ) · A β + 2 2 + 1 ( α ) A p ( k ) = 1 if p k , ( p 1 ) γ = 2 k p ( 1 + ( p 2 ) C γ ) if p < k , C γ = C γ 1 1 Q γ Q γ = Q γ 1 + i + 1 C 0 = Q 0 = 1
Here, θ ¯ α are given constants that should be properly chosen to determine a physical stable solution.
The stationary solutions (14) have been obtained from (12) by the iterative procedure described before.
Figure 2 and Figure 3 show a particular realization of these types of stationary solutions. In particular, we see the vertical distribution of θ α ( x ) , α = 1 , , M , along a given channel for the values M = 5 , M = 10 , M = 50 , and M = 100 . We see from the pictures that (14) converges to (13) as M + .
The study of the hyperbolicity of the proposed model (10) is not an easy task. The model is hyperbolic for the case M = 1 but remains an open question in general. Nevertheless, numerical simulations show that the eigenvalues of the system are real. It is possible to give an upper and lower bound for the largest and smallest wave speed, λ max , λ min , respectively. Following [31], the minimum and maximum of the wave speeds are bounded by:
λ min u ¯ Ψ , λ max u ¯ + Ψ
where
Ψ = 2 M 1 2 M 2 α = 1 M ( u ¯ u α ) 2 + g h 1 + 1 M β = 1 M ( 2 β 1 ) θ β ,
and
u ¯ = 1 M α = 1 M u α .

3. Numerical Scheme

The full system (10) can be written in the form of an hyperbolic system with conservative fluxes and non-conservative products as follows:
t w + x F C ( w ) + P ( w , η , x w , x η ) T ( w , x w ) = 0 ,
where w is the vector of the conserved variables,
w = ( h | h θ α | h θ α u α ) T R 2 M + 1 .
Remark that the Einstein notation is used to represent the block structures in the previous vector.
We denote by F C ( w ) the advected or transport flux, given by
F C ( w ) = h β = 1 M l β u β | h θ α u α | h θ α u α 2 T R 2 M + 1 .
Here, P ( w , η , x w , x η ) corresponds to the pressure term, which depend on the relative density and the free surface, and is defined by
P ( w , η , x w , x η ) = 0 | 0 | P α R 2 M + 1 ,
where
P α = g h θ α x η + g l α 2 ( h x h θ α h θ α x h ) + g β = α + 1 M l β ( h x h θ β h θ α x h ) .
Finally, the terms T ( w , x w ) correspond to the mass, density, and momentum exchange between layers:
T ( w , x w ) = 0 | 1 l α ( θ α + 1 2 G α + 1 2 θ α 1 2 G α 1 2 ) | 1 l α ( u α + 1 2 θ α + 1 2 G α + 1 2 u α 1 2 θ α 1 2 G α 1 2 ) T R 2 M + 1 .
We recall that G α + 1 2 is described by (9).
We will consider a well-balanced second-order finite volume scheme where pressure terms are discretized using the path-conservative framework introduced by Parés [41]. First, we describe the first order solver and then present its extension to second order, which is done by means of a reconstruction operator that preserves the well-balanced properties of the first order scheme.
Let us suppose, for simplicity, a uniform discretization of the domain in computational cells I i = [ x i 1 2 , x i + 1 2 ] , with a constant length of Δ x = x i + 1 2 x i 1 2 . We denote by w i n the cell average approximation of the solution at time t n = n Δ t given by the numerical scheme:
w i n 1 Δ x x i 1 2 x i + 1 2 w ( x , t n ) d x .
Let us also denote by z B , i the approximation of cell average of the bottom bathymetry at cell I i , that is,
z B , i 1 Δ x x i 1 2 x i + 1 2 z B ( x ) d x .
In what follows, for any variable f, we shall define its average at the intercell i + 1 2 as:
f ¯ f ¯ i + 1 2 = 1 2 f i + f i + 1 .
In particular, for a variable f α defined within the layer α , we shall write
f α ¯ , i + 1 2 = 1 2 f α , i + f α , i + 1 .
The difference at the intercell i + 1 2 will be written as
Δ f ( Δ f ) i + 1 2 = f i + 1 f i .
We shall denote the average of a variable f α at the layer interface α + 1 2 by
f α + 1 2 = 1 2 f α + 1 + f α .
In addition, at the bottom or free surface interfaces, we shall assume
f 1 2 = f 1 , f M + 1 2 = f M .

3.1. First Order HLL-Type Scheme

Following [42], we define a HLL-type scheme for (18) by
w i n + 1 = w i n Δ t Δ x D i 1 2 + ( w i 1 n , w i n , z B , i 1 , z B , i ) + D i + 1 2 ( w i n , w i + 1 n , z B , i , z B , i + 1 ) ,
where
D i + 1 2 = 1 2 ( 1 α 1 , i + 1 2 ) E i + 1 2 α 0 , i + 1 2 ( w i + 1 w i ) + F C ( w i ) , D i + 1 2 + = 1 2 ( 1 + α 1 , i + 1 2 ) E i + 1 2 + α 0 , i + 1 2 ( w i + 1 w i ) F C ( w i + 1 ) ,
and
E i + 1 2 = F C ( w i + 1 ) F C ( w i ) + P i + 1 2 T i + 1 2 ,
with
P i + 1 2 = 0 0 g h θ α ¯ Δ η + g l α 2 ( h ¯ Δ ( h θ α ) h θ α ¯ Δ h ) + g β = α + 1 M l β ( h ¯ Δ ( h θ β ) h θ α ¯ Δ h ) .
Remark 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 approximation of the exchange between layers at the layer interfaces on the intercell i + 1 2 ,
T i + 1 2 = 0 1 l α ( θ ¯ α + 1 2 G α + 1 2 ˜ θ ¯ α 1 2 G α 1 2 ˜ ) 1 l α ( u ¯ α + 1 2 θ ¯ α + 1 2 G α + 1 2 ˜ u ¯ α 1 2 θ ¯ α 1 2 G α 1 2 ˜ ) ,
where again to simplify notation, we denote
θ ¯ α + 1 2 = θ ¯ i + 1 2 α + 1 2 = 1 2 θ α + 1 ¯ , i + 1 2 + θ α ¯ , i + 1 2 = 1 4 θ α + 1 , i + θ α + 1 , i + 1 + θ α , i + θ α , i + 1 ,
and analogously for u ¯ α + 1 2 .
Finally, G 1 2 ˜ = G M + 1 2 ˜ = 0 and
G α + 1 2 ˜ = ( G α + 1 2 ) ˜ i + 1 2 = β = 1 α l β Δ ( h u β ) Δ γ = 1 M l γ h u γ 1 α < M .
The coefficients α 0 , i + 1 2 and α 1 , 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 [42] for more details):
α 0 , i + 1 2 = λ i + 1 2 + | λ i + 1 2 | λ i + 1 2 | λ i + 1 2 + | λ i + 1 2 + λ i + 1 2 , α 1 , i + 1 2 = | λ i + 1 2 + | | λ i + 1 2 | λ i + 1 2 + λ i + 1 2 ,
where
λ i + 1 2 ± = u ¯ i + 1 2 ± Ψ i + 1 2 ,
with
u ¯ i + 1 2 = 1 M α = 1 M u α ¯ , i + 1 2 ,
and
Ψ i + 1 2 = 2 M 1 2 M 2 α = 1 M ( u ¯ i + 1 2 u α ¯ , i + 1 2 ) 2 + g h i + 1 2 ¯ 1 + 1 M β = 1 M ( 2 β 1 ) θ β ¯ , i + 1 2 .

3.2. Hydrostatic Reconstruction

The numerical scheme defined previously is not well-balanced in the sense that it cannot preserve lake-at-rest steady states as the numerical viscosity term α 0 , i + 1 / 2 ( w i + 1 w i ) does not vanish. In order to obtain a well-balanced scheme, we will combine it with a modified hydrostatic reconstruction technique [43]. Given the states w i n and w i + 1 n , and z B , i and z B , i + 1 , we shall define the reconstructed states at the interfaces w i + 1 2 H R , ± and z B , 1 + / 2 . To do so, we consider
z B , i + 1 2 = max z B , i , z B , i + 1 ,
and
h i + 1 2 H R , = h i n + z B , i z B , i + 1 2 + , h i + 1 2 H R , + = h i + 1 n + z B , i + 1 z B , i + 1 2 + ,
where ( f ) + is the positive part of f. Using (28), we define
w i + 1 2 H R , ± = h i + 1 2 H R , ± | h i + 1 2 H R , ± θ α , i | h i + 1 2 H R , ± θ α , i u α , i T R 2 M + 1 .
Note that in (28), the reconstructed heights have been defined as h H R = ( · ) + , that is, using the positive part of the values therein. In [43], the authors show that the hydrostatic reconstruction technique is positive provided that the underlying conservative scheme used is positive. To prove this fact, the authors prove that it is essential to preserve the positivity of the reconstructed water heights, which justifies the use of the positive part. Remark that in general, for smooth topographies, one would have that the jumps of the bottom at cell interfaces are small and therefore the positive part is not needed when h is positive. Nevertheless, in the presence of big gradients of the bottom, this is needed in order to avoid non-physical negative water thickness.
In order to maintain an easier notation, we denote by
θ α , i = ( θ 1 , , θ M ) i T , θ α , i u α , i = ( θ 1 u 1 , , θ M u M ) i T
the cell averages of the vectors θ α and θ α u α on the cell I i .
Remark that the averages and differences (23)–(25) are now defined in terms of the reconstructed variables, that is,
f ¯ = 1 2 ( f i + 1 2 H R + + f i + 1 2 H R ) , Δ f = 1 2 ( f i + 1 2 H R + f i + 1 2 H R )
and also
f + ¯ = f i + 1 2 H R , + + f i + 1 2 , f ¯ = f i + f i + 1 2 H R , 2 ,
and
Δ f + = f i + 1 2 H R , + f i + 1 , Δ f = f i f i + 1 2 H R , .
Now, we can redefine the numerical scheme (26) in the following way:
w i n + 1 = w i n Δ t Δ x D i 1 2 + ( w i 1 2 H R , w i 1 2 H R + , z B , i 1 2 , z B , i 1 2 ) + D i + 1 2 ( w i + 1 2 H R , w i + 1 2 H R + , z B , i + 1 2 , z B , i + 1 2 ) + S i 1 2 + + S i + 1 2 ,
where D i + 1 2 ± are defined in Section 3.1. We remark that the terms g h θ α ¯ Δ η in P i + 1 / 2 , reduce now to g h θ α ¯ Δ h .
Finally, the term S i + 1 2 ± corresponds 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:
S i + 1 2 ± = P i + 1 2 ± T i + 1 2 ± ,
where
P i + 1 2 ± = 0 | 0 | P α , i + 1 2 ± T R 2 M + 1 ,
with
P α , i + 1 2 ± = g β = α + 1 M l β h ± ¯ Δ ± h ( θ β , i + ( 1 2 ± 1 2 ) θ α , i + ( 1 2 ± 1 2 ) ) .
Remark 1.
The term P α , i + 1 2 ± comes from the evaluation of the integral of
P = g h θ α x η + g l α 2 h x ( h θ α ) h θ α x h + g β = α + 1 M l β h x ( h θ β ) h θ α x h ,
between the center of the cell and the intercell along the path that defines the reconstruction (see [40,44]). Thanks to the definitions (29), we have that u α , θ α , and η remain constant, which justifies the given definition for P α , i + 1 2 ± .
The term T i + 1 2 ± is defined by
T i + 1 2 ± = 0 1 l α θ α + 1 2 i + ( 1 2 ± 1 2 ) G α + 1 2 ± θ α 1 2 i + ( 1 2 ± 1 2 ) G α 1 2 ± 1 l α u α + 1 2 θ α + 1 2 i + ( 1 2 ± 1 2 ) G α + 1 2 ± u α 1 2 θ α 1 2 i + ( 1 2 ± 1 2 ) G α 1 2 ± .
We recall that
f α + 1 2 i + ( 1 2 ± 1 2 ) = 1 2 f α , i + ( 1 2 ± 1 2 ) + f α + 1 , i + ( 1 2 ± 1 2 ) ,
for any variable f.
In addition, finally, G α + 1 2 ± are defined as
G α + 1 2 ± = β = 1 α l β Δ h u β , i + ( 1 2 ± 1 2 ) γ = 1 M l γ u γ , i + ( 1 2 ± 1 2 ) ,
with G 1 2 ± = G M + 1 2 ± = 0 .
The resulting numerical scheme (33) is then first order accurate in space and time, well-balanced for the stationary solution corresponding to water at rest and constant density and positive preserving for the water high with the standard C F L 1 / 2 restriction.
In fact, it is trivial to check that the scheme is well-balanced for the stationary solution corresponding to water at rest: indeed, D i + 1 2 ± = 0 as F C ( w i + 1 2 H R , + ) = F C ( w i + 1 2 H R , ) = 0 , T i + 1 2 = T i + 1 2 ± = 0 and u α , i = 0 , for all i and 1 α M . The discretization of the pressure terms, P i + 1 2 and P i / 2 ± , is also zero if θ α , i are a constant value and Δ h = h i + 1 2 H R , + h i + 1 2 H R , = 0 as h i + 1 2 H R , + = h i + 1 2 H R , in a water at rest solution with constant relative density. Finally, the positivity of the numerical scheme is a consequence of the fact that the scheme for the equation of the total thickness corresponds to a HLL scheme, therefore positivity is granted under a suitable CFL condition.

3.3. Upwind Approximation of the Exchange Terms between Layers

The numerical scheme defined previously has a major drawback: we cannot ensure that θ α 1 for 1 α M , which could result in non-physical solutions. In fact, if we consider the following initial condition that corresponds to a dam break in relative density with M = 4 layers:
u α = 0 , h ( x , 0 ) = 1 1 2 e x 2 , z B ( x ) = 1 2 e x 2 , θ α ( x , 0 ) = 1 if   x < 0 , 1.01 if   x 0 ,
the previous numerical scheme produces a numerical solution where θ 2 is clearly below the unity, which conflicts with (5). This is shown in Figure 4.
According to [32], this could be solved if the exchange terms between layers T i + 1 2 and T i + 1 2 ± are properly discretized. In what follows, we describe an upwind discretization of those terms.
The exchange terms between layers in (10) could be seen as the vertical flux between layers. However, by writing this flux as non-conservative products, we lose information about the direction of these vertical fluxes, leading to non-physical solutions. In order to incorporate this directional information, we perform an upwind approximation of the exchange terms between layers as proposed in [32].
In particular, we propose to discretize them as follows:
T i + 1 2 = 0 1 l α θ G α + 1 2 , i + 1 2 U P θ G α 1 2 , i + 1 2 U P 1 l α u θ G α + 1 2 , i + 1 2 U P u θ G α 1 2 , i + 1 2 U P ,
where
θ G α + 1 2 , i + 1 2 U P = θ α + 1 2 , i + 1 2 G α + 1 2 ˜ 1 2 | G α + 1 2 ˜ | ( θ α + 1 ¯ , i + 1 2 θ α ¯ , i + 1 2 ) ,
u θ G α + 1 2 , i + 1 2 U P = u θ α + 1 2 , i + 1 2 G α + 1 2 ˜ 1 2 | G α + 1 2 ˜ | ( ( u θ ) α + 1 ¯ , i + 1 2 ( u θ ) α ¯ , i + 1 2 ) ,
and
T i + 1 2 ± = 0 1 l α θ G α + 1 2 U P ± θ G α 1 2 U P ± 1 l α u θ G α + 1 2 U P ± u θ G α 1 2 U P ± ,
where
θ G α + 1 2 U P ± = θ α + 1 2 , i + ( 1 2 ± 1 2 ) G α + 1 2 ± 1 2 | G α + 1 2 ± | ( θ α + 1 , + ( 1 2 ± 1 2 ) θ α , + ( 1 2 ± 1 2 ) ) ,
u θ G α + 1 2 U P ± = u θ α + 1 2 , i + ( 1 2 ± 1 2 ) G α + 1 2 ± 1 2 | G α + 1 2 ± | ( ( u θ ) α + 1 , + ( 1 2 ± 1 2 ) ( u θ ) α , + ( 1 2 ± 1 2 ) ) ,
with θ G 1 2 , i + 1 2 U P = θ G M + 1 2 , i + 1 2 U P = u θ G 1 2 , i + 1 2 U P = u θ G M + 1 2 , i + 1 2 U P = 0 , and θ G 1 2 U P ± = θ G M + 1 2 U P ± = u θ G 1 2 U P ± = u θ G M + 1 2 U P ± = 0 .
Note that this numerical treatment is equivalent to adding the following vertical diffusion terms to the system:
z h α | G | z θ , and   z h α | G | z ( u θ ) .
Now, if we reproduce the previous numerical example, we obtain that θ α 1 , as it can be seen in Figure 5.
Remark 2.
Summing up all the equations for l α h θ α , the terms in T i + 1 2 ± cancel out. This means that, in fact, the scheme reduces to a classical HLL scheme for the variable α = 1 M l α h θ α . Therefore, by following the usual arguments used for HLL, one could prove that α = 1 M l α θ α 1 . We could not formally prove that θ α 1 . Nevertheless, the numerical experiments carried out verified that these properties are fulfilled.

3.4. Second Order Approximation

In order to achieve second order in space, we combine the previous first order numerical scheme with a second order reconstruction operator at each cell, that is, at each time step t n and at each cell I i = [ x i 1 2 , x i + 1 2 ] , we define a regular reconstruction function R i t ( x ) = w ( x , t ) + O ( Δ x 2 ) , x I i . R i t ( x ) is defined from the cell averages { w j ( t ) , j S i } , where S i is called the stencil of the reconstruction operator. We also use the standard notation:
lim x x i 1 2 + R i t ( x ) = w i 1 2 + ( t ) , lim x x i + 1 2 R i t ( x ) = w i + 1 2 ( t ) .
Following [39], the natural extension of the first order numerical scheme (33) may be written as follows:
w i ( t ) = 1 Δ x D i 1 2 + ( t ) + D i + 1 2 ( t ) , 1 Δ x x i 1 2 x i + 1 2 P ( R i t , R i η , t , x R i t , x R i η , t ) T ( R i t , x R i t ) d x ,
where
D i 1 2 + ( t ) = D i 1 2 + ( w i 1 2 ( t ) , w i 1 2 + ( t ) , z B , i 1 2 , z B , i 1 2 + ) , D i + 1 2 ( t ) = D i + 1 2 ( w i + 1 2 ( t ) , w i + 1 2 + ( t ) , z B , i + 1 2 , z B , i + 1 2 + ) .
In what follows, for the sake of simplicity, we shall drop the dependence on time.
Remark 3.
The evaluation of the numerical scheme (33) on the reconstructed states w i 1 2 ± , z B , i 1 2 ± means that one has to perform the hydrostatic reconstruction procedure (27)–(29) from the reconstructed states. More explicitly, the hydrostatic reconstructed states become
z B , i + 1 2 = max z B , i + 1 2 , z B , i + 1 2 +
and
h i + 1 2 H R , = h i + 1 2 + z B , i + 1 2 z B , i + 1 2 + , h i + 1 2 H R , + = h i + 1 2 + + z B , i + 1 2 + z B , i + 1 2 + .
In the previous expression, the notation h H R = ( · ) + denotes the positive part while z B , i + 1 2 ± are the reconstructed values of the bathymetry z B at x i + 1 2 for the cells I i + 1 and I i , respectively. That is, we consider a reconstruction operator for the bottom R i z B ( x ) = z B ( x ) + O ( Δ x 2 ) , x I i and denote by,
lim x x i 1 2 + R i z B ( x ) = z B , i 1 2 + , lim x x i + 1 2 R i z B ( x ) = z B , i + 1 2 .
We shall denote the components of R i = ( R h | R α h θ | R α h θ u ) .
According to [39], in order to preserve the well-balanced properties of the first order numerical scheme, the reconstruction operators should be also well-balanced, that is, the reconstruction operators should preserve the stationary solutions corresponding to water at rest with constant density. More explicitly, for a lake-at-rest steady state solution, one should have
R i h + R i z B = c s t .
Therefore, the reconstruction operator R i z B cannot be arbitrarily chosen. In practice, we consider a reconstruction operator for the free surface R i η , defined from the cell averages of the surface { η j , j S i } . Then, define the bottom reconstruction operator by
R i z B = R i η R i h .
This grants that the reconstruction operator satisfies
R i h ( x ) + R i z B ( x ) = R i η ( x ) ,
and the well-balanced property is achieved provided that R i η reduces to a constant whenever the states η j in the stencil are constant.
In this work, we use the MUSCL reconstruction operator (see [45]). In each cell I i , we define a piece-wise linear operator of the form
R i ( x ) = w i + σ i ( x x i ) ,
where σ i is the vector which provides the slope of the reconstruction for each variable and x i is the center of cell I i . As usual, it is also necessary to provide a slope limiter to avoid spurious oscillations at jump discontinuities, while keeping the second order accuracy when the solution is smooth. In this work, we use an average limiter (avg), defined by
[ σ i ] k = a v g [ w i + 1 w i ] k Δ x , [ w i w i 1 ] k Δ x ,
where the subindex k refers the k-th component of the vector and the a v g operator is defined as
a v g ( a , b ) = | a | b + a | b | | a | + | b | if | a | + | b | > 0 , 0 otherwise .
Let us detail the reconstruction procedure for the conserved variables and the bathymetry:
  • First, we consider the reconstruction of the water depth h and free surface η that is R i h ( x ) and R i η ( x ) and the reconstruction of the bathymetry is recovered by setting R z B ( x ) = R i η ( x ) R i h ( x ) . In order to guarantee the positivity of the water depth during the reconstruction, we use the technique introduced in [46].
  • Next, we consider the reconstruction of the relative density θ α at each cell, R i θ α ( x ) . Let us denote by σ i θ α the slope of the reconstruction of θ α and σ i h the corresponding slope for the water depth. Then, we define R i h θ α ( x ) = ( h θ α ) i + σ i h θ α ( x x i ) where
    σ i h θ α = θ α , i σ i h + h i σ i θ α .
    Again, we follow [46] to guarantee that R i θ α ( x ) 1 , x I i .
  • Finally, we consider the reconstruction of the velocity u α at each cell. Let us denote by σ i u α the slope of the reconstruction of u α at the cell I i , then we define R i h θ α u α ( x ) = ( h θ α u α ) i + σ i h θ α u α ( x x i ) where
    σ i h θ α u α = u α , i σ i h θ α + ( h θ α ) i σ i u α .
Remark 4.
The definition of σ i h θ α and σ i h θ α u α grants that
σ i h θ α = x R i h θ α = R i h ( x i ) x R i θ α + R i θ α ( x i ) x R i h ,
σ i h θ α u α = x R i h θ α = R i u α ( x i ) x R i h θ α + R i h θ α ( x i ) x R i u α .
The integral term in (35) is approximated by the middle point quadrature formula that results in:
1 Δ x x i 1 2 x i + 1 2 P ( R i , R i η , x R i , x R i η ) T ( R i , x R i ) d x P i T i ,
where
P i = 0 0 g ( h θ α ) i σ i η + g l α 2 ( h i σ i h θ α ( h θ α ) i σ i h ) + g β = α + 1 M l β ( h i σ i h θ β ( h θ α ) i σ i h ) .
T i = 0 1 l α θ G ¯ ¯ α + 1 2 θ G ¯ ¯ α 1 2 1 l α u θ G ¯ ¯ α + 1 2 u θ G ¯ ¯ α 1 2 ,
where
θ G ¯ ¯ α + 1 2 = θ α + 1 2 , i G α + 1 2 , i ¯ 1 2 | G α + 1 2 , i ¯ | ( θ α + 1 , i θ α , i ) , 1 α < M ,
u θ G ¯ ¯ α + 1 2 = u θ α + 1 2 , i G α + 1 2 , i ¯ 1 2 | G α + 1 2 , i ¯ | ( ( u θ ) α + 1 , i ( u θ ) α , i ) , 1 α < M ,
with
G α + 1 2 ¯ i = β = 1 α l β σ i h u β γ = 1 M l γ σ i h u γ ,
and
σ i h u α = h i σ i u α + u α , i σ i h .
We shall consider θ G ¯ ¯ 1 2 = u θ G ¯ ¯ 1 2 = 0 and θ G ¯ ¯ M + 1 2 = u θ G ¯ ¯ M + 1 2 = 0 .
Finally, the second order in time is achieved via a total variation diminish (TVD) Runge–Kutta method (see [47]).
The second order numerical scheme is thus well-balanced for the stationary solution corresponding to water at rest and constant density and positive preserving for the water depth.

4. Numerical Tests

In this section, we present several numerical simulations with the main objective to show the capabilities of the model and of the numerical scheme previously presented. Unless stated otherwise, the second order scheme is used. The first two numerical subsections will show the accuracy and well-balanced properties of the scheme. Then, an academic test case with a smooth distribution of relative density is shown in Section 4.3. The numerical strategy will be validated in Section 4.4, which corresponds to a lock-exchange in density that generates a gravity current, where laboratory data are available. In particular, the influence of the number of layers on the accuracy of the results will be discussed. The numerical test presented in Section 4.5 also corresponds to a dam break problem in density but with a non-constant bathymetry function, where we will show that the model is able to reproduce the general behaviour of this type of problem. Finally, a 2D problem will be considered in Section 4.6.

4.1. Order of Accuracy Test

The objective of this numerical test is to check numerically the order of accuracy of the numerical scheme. We consider a 5-layer simulation with an initial condition given by:
u α ( x , 0 ) = 0 , θ α ( x , 0 ) = 1 + 0.05 e 4 x 2 , 1 α 5 ,
h ( x , 0 ) = 1.0 0.5 e x 2 + 0.1 e 10 x 2 ,
and the bathymetry is given by
z b ( x ) = 0.5 e x 2 .
The CFL parameter is set to 0.5 and the final time is t = 0.5 s. Periodic boundary conditions are set.
The errors and order of accuracy are shown in Table 1 and Table 2 for h, h θ 1 , and h θ 1 u 1 for a horizontal discretization of 25, 50, 100, 200, and 400 volume cells for the first and second order schemes, respectively. The numerical solutions are compared to a reference solution, which has been computed with the same numerical scheme on a fine mesh of 3200 volume cells. Similar results are obtained for h θ α and h θ α u α , for α > 1 . Here, h θ 1 has been chosen in particular due to the fact that the pressure term for α = 1 is the most sophisticated one, as it depends on h θ α , 1 α 5 .
Figure 6 shows the free surface (left) and the velocities u α , 1 α 5 at the final time t = 0.5 s for the second order scheme using the 200 cell mesh.

4.2. Well-Balanced Test

In order to show the well-balance properties of the numerical scheme, we perform a numerical simulation of a lake-at-rest steady test. We set the following bathymetry function,
b ( x ) = 1 2 e x 2 ,
and a constant free surface η = 2 . In this problem, the relative density is set to 1, and the initial velocity is zero. Figure 7 (left) depicts the free surface and bathymetry at t = 150 s, unchanged with respect to the initial condition. Figure 7 (right) shows a zoom on the surface and we can see that the model is exact up to machine precision, even for long time simulations.
A more interesting situation corresponds to the stratified solution described by (14). Let us consider here a particular solution of this family with three layers ( 1 α 3 ):
u α = 0 , η ( x ) = 1 , z b ( x ) = 1 2 e x 2 , h ( x ) = 1 z b ( x ) , θ 1 ( x ) = h ( x ) 4 K 3 + 3 h ( x ) 2 K 2 + K 1 , θ 2 ( x ) = h ( x ) 2 K 2 + K 1 , θ 3 ( x ) = K 1 .
The constant values K i are chosen in order to have a stable stratified profile in the vertical direction, that is, θ 3 ( x ) θ 2 ( x ) θ 1 ( x ) . Here, we consider K 1 = 1.01 , K 2 = 0.02 and K 3 = 0 . Note that, if a stratification expression like (13) is used, then the coefficients K i tends to zero with the increasing of the number of layers.
The numerical scheme described in Section 3 cannot preserve the steady state (42). Figure 8 shows the free surface and velocities at t = 10 s when (42) is given as initial condition on the domain [ 5 , 5 ] , discretized with 200 cells.
Nevertheless, it is possible to modify scheme (35) or (33) in order to improve their well-balanced properties and, in particular, to preserve this stationary solution. Following [48], it is possible to modify the reconstruction procedure in such a way that these particular solutions are preserved. Remark that here we are focusing on preserving just this particular solution. The procedure is briefly described in what follows. Future and ongoing works will aim at generalizing the technique so that the numerical scheme is able to preserve a larger family of steady states.
Let us modify (35) in order to improve its well-balanced property and, in particular, to preserve the stationary solution (42). We denote by w e ( x ) this particular stationary solution. According to [48], the first stage is to define a reconstruction operator that preserves w e ( x ) . The idea is quite simple: first define the fluctuation with respect to w e ( x ) that is at each cell and at each time step we compute the quantities,
w f , i n ( t ) = w i n w e ( x i ) ,
where x i is the center of the cell I i . Note that w e ( x i ) is the evaluation of the stationary solution at the center of the cell that is a second order approximation of its cell average on the cell I i . Next, we apply the standard second order reconstruction previously described to the fluctuations w f , i n . Let us denote these reconstructions by R i f ( x ) . Finally, the reconstruction for w is defined as follows:
R i ( x ) = w e ( x ) + R i f ( x ) .
Special care should be taken for the quadrature formula applied for the integral appearing in (35). Again, we follow [48] in order to propose a quadrature formula that preserves the well-balanced character of the reconstruction and, therefore, of the numerical scheme.
Now, if we apply (35) with the previous reconstruction procedure, the numerical scheme also preserves the stationary solution (42). Figure 9 shows the errors for the relative density and velocities at time t = 150 s when compared to the exact steady state and those are of the order of the machine precision.
Now, let us consider a small perturbation on the stationary solution (42), where now we consider
η ( x , 0 ) = 1 + 1 10 e 10 x 2 ,
as the initial free surface. The relative densities θ α and velocities u α remain the same. The initial free surface and relative densities are shown in Figure 10. We consider the same domain as previously, discretized with the same number of cells. The relative densities and the free surface are fixed as the right boundary condition, while open boundary conditions are considered on the left. Figure 11 and Figure 12 show the difference of the relative density with respect to the one given by the steady state. As it can be seen, the relative density slowly converges to the stationary solution up to machine precision (see Figure 12).

4.3. Simulation for a Smooth Distribution of Relative Density

We perform now a simulation with a smooth profile for the relative density θ . We fix the domain [ 4 , 4 ] , discretized with 800 volume cells and we choose M = 10 layers. The relative density θ is initially equal in all the layers and given by
θ α ( t = 0 , x ) = 1 + 1 100 e 10 x 2 ,
while the bathymetry and the free surface are constant and equal to 0.5 and 1.5 , respectively. We consider open boundary conditions. The initial condition is shown in Figure 13. Figure 14, Figure 15, Figure 16 and Figure 17 show the evolution of the relative density for different times. We see that the relative density tends to go downwards and towards the sides, but, at different velocities, due to the difference of pressure between layers, forming a shock (see Figure 16). Eventually, for large times, the solution becomes stratified in layers (see Figure 17). A dual representation has been chosen for the relative density. On the right-hand side of the figure, we show the graph of the relative density for a choice of some layers, so that they are representative of the evolution of the problem. On the left-hand side, we show the relative density within the layers through a heat map.

4.4. Simulation of a Lock-Exchange in a Flat Channel

We propose now to perform the test corresponding to the experimental data presented in [35]. There, the authors propose a laboratory experiment in a 3 m long channel, where a gatebox of length 0.1 m is placed within the channel containing a fluid with density ρ 1 . The rest of the channel contains a fluid of density ρ 0 , with ρ 1 > ρ 0 The gate box is opened and its fluid is released into the flume. The density ρ 0 is 1000 kg/m 3 while ρ 1 is 1034 kg/m 3 . Thus, we consider
θ ( x ) = 1.034 if x 0.1 , 1.0 if x > 0.1 .
The initial height of the water is constant and equal to 0.3 m while the bathymetry is the constant function b = 0.5 . This initial condition is shown in Figure 18. We consider the domain in [ 0 , 3 ] discretized with 800 volume cells. We impose reflecting no-slip boundary conditions.
For the particular case of M = 40 layers, we show in Figure 19, Figure 20, Figure 21, Figure 22, Figure 23, Figure 24 and Figure 25 the evolution of the density distribution at different times. We observe how a shock is formed once the fluid in the gate box is released. The propagation of this shock corresponds to the front position described earlier. The relative density profile at the left boundary of the channel is not an effect of the numerical treatment of the reflecting no-slip boundary conditions. A similar effect can be also observed in the laboratory experiment performed in [35].
In [35], the authors obtain the position of the head of the gravity current with respect to time. In Figure 26 and Figure 27, we can see the comparison for the front position between the experimental data and the results obtained with the numerical approach presented here. The numerical simulations have been obtained using M = 15 , 20 , 30 , and 40 layers. We see that the larger the number of layers, the better agreement we have between experimental and numerical data. Even for M = 20 , the results are quite good, despite the fact that non-hydrostatic effects, usually present in such situations (see [49]), are not taken into account.

4.5. Simulation of a Dam Break Problem with a Non Constant Bathymetry Function

We consider the domain [ 5 , 5 ] and a bathymetry function given by
z B ( x ) = 1 2 e x 2 ,
and a constant free surface η = 2 m. A dam break problem in the relative density is considered as an initial condition by setting
θ ( x ) = 1.0 if x 0 , 1.02 if x > 0 .
We fix M = 30 as the number of layers and discretize the domain with 1000 volume cells. Free-flow open boundary conditions are considered. The initial condition is shown in Figure 28 while the evolution of the fluid is depicted in Figure 29, Figure 30, Figure 31, Figure 32 and Figure 33 for different times. In this test, we also compare the first and second order schemes. In particular, we observe a sharp transition of density over the obstacle, especially in the second order case. This kind of profile is common in gravity currents over obstacles (see [50]).

4.6. Simulation of a Dam Break Problem in Two Dimensions

As we have said, although the models and numerical scheme are introduced for the 1D case for the sake of simplicity, everything can be easily extended to the 2D case. To illustrate this fact, we show here a 2D simulation. We fix the domain ( x , y ) [ 5 , 5 ] × [ 1 , 1 ] where non-constant bottom is considered described by
z B ( x , y ) = 1 2 e ( ( x + 2 ) 2 + y 2 ) + 1 2 e ( ( x 2 ) 2 + y 2 ) .
A constant free surface equal to 2 meters is considered initially. The relative density distribution is set as
θ α ( t = 0 , x , y ) = 1.0 if x 0 , 1.02 if x > 0 .
The domain discretized with 36,000 uniform cells with Δ x = 1 / 60 and Δ y = 1 / 30 . We impose reflecting no-slip boundary condition at the horizontal walls and free-flow boundary conditions at the vertical ones. We use M = 15 layers. The initial condition can be seen in Figure 34 and time evolution of the fluid is shown in Figure 35, Figure 36, Figure 37 and Figure 38, where cuts for the y = 0 and x = 2 planes are considered. Figure 39 and Figure 40 also show the upper view of the density distribution for the layer 7. These results are second order accurate.
The numerical simulations performed in this section show that the numerical Section 3 is both robust and accurate, and that the model Section 2 is useful to better understand flows with density fluctuations.

5. Conclusions

We have presented a multilayer shallow water model with variable density. We propose first and second order numerical schemes that preserve the stationary solutions corresponding to water at rest with constant density. Some insight has been briefly given on how to modify the scheme in order to preserve some stratified stationary solutions. The numerical scheme is also positive preserving for the water height. According to the numerical experiments, it seems that it also satisfies the maximum principle for θ α . The numerical tests performed are promising, showing robustness and great agreement with laboratory experimental data. The model used and the numerical strategy introduced here will certainly help with a better understanding of density driven currents in geophysical flows.

Author Contributions

E.G.F.: Formal analysis, investigation, data curation, software, validation, visualization, writing–original draft preparation, and writing—review and editing. M.J.C.-D.: Conceptualization, methodology, investigation, software, writing—review and editing, supervision, project administration, and funding acquisition. T.M.d.L.: Conceptualization, methodology, investigation, visualization, supervision, writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This research has been partially supported by the Spanish Government and FEDER through the coordinated Research projects RTI2018-096064-B-C2(1/2) and from Junta de Andalucía and FEDER through the project UMA18-FEDERJA-161.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Parallelization on GPU

In this appendix, we will discuss how the numerical scheme discussed in Section 3 is implemented on GPUs. Parallelizations on GPU are useful when dealing with large computational domains, as they are able to provide a very significant speed-up with respect to a sequential version of the code. There are different ways to develop GPU parallel codes. One method consists of developing the entire code on CUDA (see [7] and the references therein). There are numerous examples in the literature where different numerical schemes and models have been written directly in CUDA, obtaining extremely good results from the computational efficiency point of view. Another way to develop GPU parallel codes is to use OpenACC directives (see [51]). While CUDA is a well-known approach to parallelize finite volume numerical schemes and has successfully been applied to solve large problems (see for example [6]), OpenACC is a newer paradigm, offering a friendlier approach to GPU-based parallelization.
Several authors have studied the results of parallelizing a code under CUDA and OpenACC (see for example [52]). In general, the speed-ups obtained are favorable to CUDA, which has a greater control over data management and load balancing. Nevertheless, OpenACC also presents some advantages over CUDA. The main one is that the work needed on adapting a sequential code to OpenACC is much less demanding than the one required for CUDA. When developing a CUDA code, the construction of the accelerator kernel, the part of the code that will be executed by the GPU, requires that the particular structure of the problem and the target accelerator hardware have to be taken into account. This means that the performance of the CUDA code highly depends on its specific adaptation to the architecture being used. It is not an easy task to develop a good performing CUDA code and the acceleration gained depends mostly on the capabilities of the developer in adapting the particular algorithm used. Contrary to CUDA, OpenACC merely needs to add some instructions in the form of pragmas to the code. In this way, most of the burden of the parallelization of the code falls into the compiler, which is the one who has to translate the information contained in the pragmas to build the accelerator kernel, and not the developer. Therefore, it is not necessary to recode the whole program, but rather instruct your compiler with enough and suitable hints in the code to generate a parallel version. While it is true that some authors have achieved similar performance with OpenACC and CUDA for some reference problems (see for instance [53]), this requires a heavy personalization of the OpenACC version, potentially losing its accessibility, and getting closer to a CUDA implementation.
Note that the usual work required to parallelize a sequential code in CUDA is also present in OpenACC. However, the tools provided by OpenACC are friendlier than the ones provided by CUDA. Specifically, OpenACC allows easy data transference to the accelerator hardware and an easy parallelization of those loops susceptible to be parallelizable. In this sense, it is somehow similar to OpenMP, the programming interface for parallelization on CPUs.
Comparisons have been made between OpenACC and CUDA version of the code for the one layer and one-dimensional case. For the CUDA code, we follow the procedure described in [54]. The results are shown in Figure A1 (left). As we can see, CUDA is two times faster than OpenACC. However, OpenACC speed-ups are also very good and the effort required to obtain an OpenACC version from the sequential code is much less demanding than the one required to obtain the CUDA version.
Figure A1 (right) shows a comparison of the elapsed real time for two different versions of the code: a multi-CPU version and a GPU one (run on two different GPU architectures). We see that the GPU implementation is better by far than the CPU one and offers great scalability. Nevertheless, one should take into account that the elapsed real time is very sensitive to the GPU used.
Figure A1. Speed up of OpenACC vs. CUDA (left). Running time of a OpenMP version vs. running time of an OpenACC version in two different graphical processor units.
Figure A1. Speed up of OpenACC vs. CUDA (left). Running time of a OpenMP version vs. running time of an OpenACC version in two different graphical processor units.
Mathematics 08 00848 g0a1

Appendix B. Model Derivation

As stated in Section 2, we consider a fluid domain Ω F ( t ) for a given time t [ 0 , T ] , with T R + . We denote by I F ( t ) the projection of Ω F ( t ) onto the horizontal plane. In the multilayer approach, the fluid domain is divided along the vertical dimension into a set of M N layers of thickness h α ( t , x ) with M + 1 interfaces Γ α + 1 2 ( t ) of equations z α + 1 2 for α = 0 , 1 , , M and x I F ( t ) (see Figure 1). We assume that the interfaces Γ α + 1 2 ( t ) are smooth, concretely at least of class C 1 in time and space.
We shall now consider a multilayer shallow water approach to system (1). In the multilayer approach, the fluid domain Ω F ( t ) is divided along the vertical dimension into a set of M N layers of thickness h α ( t , x ) with M + 1 smooth interfaces Γ α + 1 2 ( t ) , which shall be described as (see Figure 1):
Γ α + 1 2 ( t ) = ( x , z ) Ω F ( t ) , such that x I F ( t ) and z = z α + 1 2 ( t , x ) , α = 0 , 1 , , M .
The layers will be then described as
Ω α ( t ) = ( x , z ) ; such that x I F ( t ) and z α 1 2 < z < z α + 1 2 , α = 1 , , M .
We shall denote by z B = z 1 2 and z S = z M + 1 2 and by Γ B ( t ) and Γ S ( t ) , the bottom and the free-surface interfaces, respectively. We also have h α = z α + 1 2 z α 1 2 and z α = z B + β = 1 α h β for α = 1 , , M . Then, the total height of the fluid column is given by h = z S z B = β = 1 M h β . Moreover, we have Ω F ( t ) = Γ B ( t ) Γ S ( t ) Θ ( t ) , where Θ ( t ) is the inflow/outfow boundary which we assume here to be vertical. The fluid domain is split as Ω F ( t ) = α = 1 M Ω α ( t ) .
We also set for a function f and α = 0 , 1 , , N ,
f α + 1 2 : = ( f | Ω α ( t ) ) | Γ α + 1 2 ( t ) and f α + 1 2 + : = ( f | Ω α + 1 ( t ) ) | Γ α + 1 2 ( t ) .
If the function is continuous across Γ α + 1 2 we simply set
f α + 1 2 : = f | Γ α + 1 2 ( t ) .
We will denote by η α + 1 2 the space unit normal vector to the interface Γ α + 1 2 outward to the layer Ω α ( t ) for any given time t and for α = 0 , 1 , , N . This vector is defined by
η α + 1 2 = x z α + 1 2 , 1 1 + x z α + 1 2 2 .
Additionally, [ ( a ; b ) ] Γ α + 1 2 shall denote the jump of the concatenated pair ( a ; b ) across Γ α + 1 2 ,
[ ( a ; b ) ] Γ α + 1 2 = ( a ; b ) | Ω α + 1 ( t ) ( a ; b ) | Ω α ( t ) | Γ α + 1 2 .
Finally, we define the operator x = ( x 1 , , x d 1 ) .

Appendix B.1. Weak Solutions with Discontinuities

Let us recall the conditions to be satisfied by a piece-wise smooth weak solution ( v , θ , p ) of system (4). More precisely, let us suppose that the velocity v , the density fluctuation θ , and the pressure p are smooth in each Ω α ( t ) , but possibly discontinuous across the predetermined hypersurfaces Γ α + 1 2 ( t ) for α = 1 , , N 1 . Then, the triplet ( v , θ , p ) is a solution of (1) if the following conditions hold:
  • ( v , θ , p ) is a standard weak solution of (1) in each layer Ω α ( t ) .
  • ( v , θ , p ) satisfies the normal flux conditions at Γ α + 1 2 ( t ) for α = 0 , 1 , , M :
    • For the continuity equations,
      [ ( θ ; θ v ) ] | Γ α + 1 2 ( t ) · t z α + 1 2 , x z α + 1 2 , 1 = 0 .
    • For the mass conservation law,
      [ θ v ; θ v v Σ ] | Γ α + 1 2 ( t ) · t z α + 1 2 , x z α + 1 2 , 1 = 0 .
We shall denote
v | Ω α ( t ) : = v α : = ( u α , w α ) , θ | Ω α : = θ α , p | Ω α : = p α ,
where u α is the horizontal velocity and w α is the vertical one. Following the usual approaches in multilayer shallow water models, we shall make the following assumptions:
  • the horizontal velocity u α and the density fluctuation θ α do not depend on z inside each layer,
  • both w α and p α are lineal in z inside each layer.
There is no hope for such a particular set v α , θ , p α to be a solution of the complete equations in the layer Ω α ( t ) . Instead, we shall consider a reduced weak formulation with particular test functions that we will describe in Appendix B.3.

Appendix B.1.1. Mass Conservation Jump Conditions

Following previous hypothesis, we get that
u α 1 2 + ( t , x ) = u α + 1 2 ( t , x ) = u α ( t , x ) and θ α 1 2 + ( t , x ) = θ α + 1 2 ( t , x ) = θ α ( t , x ) .
Then, mass conservation jump conditions are satisfied provided that
G θ , α + 1 2 = G θ , α + 1 2 = G θ , α + 1 2 +
where
G θ , α + 1 2 + = θ α + 1 t z α + 1 2 + u α + 1 · x z α + 1 2 w α + 1 2 + , G θ , α + 1 2 = θ α t z α + 1 2 + u α · x z α + 1 2 w α + 1 2 .
It is also clear that the corresponding jump conditions for the mass equation · v = 0 are
G α + 1 2 = G α + 1 2 = G α + 1 2 + ,
and thus
G α + 1 2 + = t z α + 1 2 + u α + 1 · x z α + 1 2 w α + 1 2 + , G α + 1 2 = t z α + 1 2 + u α · x z α + 1 2 w α + 1 2 .

Appendix B.1.2. Momentum Conservation Jump Conditions

The momentum conservation jump condition (A4) is
θ v ; θ v v Σ | Γ α + 1 2 ( t ) · t z α + 1 2 , x z α + 1 2 , 1 = 0 .
which can be rewritten as
Σ | Γ α + 1 2 ( t ) · x z α + 1 2 , 1 = θ v ; θ v v Σ | Γ α + 1 2 ( t ) · t z α + 1 2 , x z α + 1 2 , 1 .
Using (A6), we have
θ v ; θ v v Σ | Γ α + 1 2 ( t ) · t z α + 1 2 , x z α + 1 2 , 1 = θ α G θ , α + 1 2 [ v ] | Γ α + 1 2 ( t ) .
Then, we have that
Σ | Γ α + 1 2 ( t ) · x z α + 1 2 , 1 = θ α G θ , α + 1 2 [ v ] | Γ α + 1 2 ( t ) .
In addition, condition (A4) can thus be written as
Σ | Γ α + 1 2 ( t ) · η α + 1 2 = 1 1 + x z α + 1 2 θ α G θ , α + 1 2 [ v ] | Γ α + 1 2 ( t ) .
The total stress tensor across Γ α + 1 2 writes
Σ α + 1 2 ± = p α + 1 2 I + T α + 1 2 ± ,
where p α + 1 2 is the kinematic pressure, continuous across Γ α + 1 2 and T α + 1 2 ± are the limit approximation of T ( v ) at Γ α + 1 2 . Combining (A10) with (A11), we obtain
T α + 1 2 + T α + 1 2 · η α + 1 2 = 1 1 + x z α + 1 2 θ α G θ , α + 1 2 [ v ] | Γ α + 1 2 ( t ) .
Moreover, T α + 1 2 ± should also satisfy a consistency condition,
1 2 T α + 1 2 + + T α + 1 2 = T ˜ α + 1 2 = T ˜ H , α + 1 2 T ˜ x z , α + 1 2 T ˜ x z , α + 1 2 T ˜ z z , α + 1 2 ,
where T ˜ α + 1 2 is an approximation of T ( v ) | Γ α + 1 2 that we define as follows:
T ˜ α + 1 2 = μ D ˜ α + 1 2 = D H u α + 1 + u α 2 x w α + 1 2 + + w α + 1 2 2 + Q H , α + 1 2 x w α + 1 2 + + w α + 1 2 2 + ( Q H , α + 1 2 ) 2 Q v , α + 1 2 .
where Q α + 1 2 = Q ( u ˜ ) at Γ α + 1 2 and Q satisfies the equations
Q z v = 0 , with Q = ( Q H , Q v ) .
To approximate Q , a solution of (A15), we approximate v by u ˜ that is a linear interpolation in z, such that u ˜ | z = 1 2 ( z α 1 2 + z α + 1 2 ) = u α . Finally, we can solve the system defined by (A12) and the equation resulting from multiplying scalarly (A13) by η α + 1 2 . In this way, we can obtain the expressions of T α + 1 2 ± that satisfy the jump condition and the consistency condition on the interface. We can easily solve it and we obtain
T α + 1 2 ± · η α + 1 2 = T ˜ α + 1 2 · η α + 1 2 ± 1 1 + x z α + 1 2 θ α G θ , α + 1 2 [ v ] | Γ α + 1 2 ( t ) .

Appendix B.2. Vertical Velocity

Here, we show how the vertical velocity is derived from its horizontal components at each layer. Note that u α is a classic solution of the equations in Ω α ( t ) , for z [ z α + 1 2 , z α 1 2 ] , and therefore the vertical integration of the incompressibility equations yields
w α ( t , x , z ) = w α 1 2 + ( t , x ) ( z z α 1 2 ) x · u α ( t , x ) , for α = 1 , , N .
From conditions (A8) and (A9), we can also deduce
w α 1 2 + = ( u α u α 1 ) · x z α 1 2 + w α 1 2 ,
where
w α 1 2 = w α 1 | Γ α 1 2 ( t ) = w α 3 2 + h α 1 x · u H , α 1 .
Therefore, using the horizontal velocities obtained from the model, we can compute the averaged vertical velocities in the layers by fulfilling the following steps:
  • First, the quantity w 1 2 + is determined from the given mass exchange through the bottom, G 1 2 and using (A9) by
    w 1 2 + = u H , 1 · x z B + t z B G 1 2 ,
  • Then, for α = 1 , , N and z [ z α + 1 2 , z α 1 2 ] , we set
    w α ( t , x , z ) = w α 1 2 + ( t , x ) ( z z α 1 2 ) x · u H , α ( t , x ) ,
    w α + 1 2 = w α | Γ α + 1 2 ( t ) = w α 1 2 + h α x · u H , α ,
    w α + 1 2 + = ( u α + 1 u α ) · x z α + 1 2 + w α + 1 2 .

Appendix B.3. A Particular Weak Solution with Hydrostatic Pressure

In this section, we complete the derivation of the model under the assumption of hydrostatic pressure. This means that
p α ( t , x , z ) = p α + 1 2 + θ α g ( z α + 1 2 z ) ,
with
p α + 1 2 ( t , x ) = p S ( t , x ) + g β = α + 1 M θ β h β ( t , x ) .
Here, the component p α + 1 2 is the kinematic pressure at Γ α + 1 2 ( t ) and p S denotes the pressure at the free surface. Then, the unknowns of the system are the depths of the layers, the density fluctuation, and the horizontal velocities in each layer.
Let us consider the weak formulation of system (1) in Ω α ( t ) , with v α a weak solution of the system. Assuming v α L 2 ( 0 , T ; H 1 ( Ω α ( t ) ) 3 ) , t v α L 2 ( 0 , T ; L 2 ( Ω α ( t ) ) 3 ) and p α L 2 ( 0 , T ; L 2 ( Ω α ( t ) ) ) , a weak formulation of the original equations in Ω α ( t ) for α = 1 , , M should satisfy
{ Ω α ( t ) ( · v α ) φ d Ω = 0 , Ω α ( t ) ( t θ α + · ( θ v ) ) φ d Ω = 0 , Ω α ( t ) t ( θ v ) ϑ d Ω + Ω α ( t ) · ( θ v v ) ϑ d Ω = Ω α ( t ) g θ k ϑ d Ω + Ω α ( t ) ( · Σ ) ϑ d Ω ,
for all φ L 2 ( Ω α ( t ) ) and for all ϑ H 1 ( Ω α ( t ) ) 3 with ϑ | I F = 0 . We consider the following vertical structure of the test function,
z φ = 0 ,
ϑ ( t , x , z ) = ϑ H ( t , x ) , ( z z B ) V ( t , x ) ,
where ϑ H and V ( t , x ) are smooth functions that do not depend on z. After some calculations (similar to those in [30]), we get,
{ t h α + x ( h α u α ) = G α + 1 2 G α 1 2 , t ( h α θ α ) + x ( h α θ α u α ) = θ α + 1 + θ α 2 G α + 1 2 θ α + θ α 1 2 G α 1 2 , t ( h α θ α u α ) + x ( h α θ α u α 2 ) + g h α θ α x η x ( h α T H ) ( T ˜ H , α + 1 2 ( x z α + 1 2 ) T ˜ x z , α + 1 2 ) ( T ˜ H , α 1 2 ( x z α 1 2 ) T ˜ x z , α 1 2 ) + g h α β = α + 1 M ( θ β θ α ) x h β + g h α β = α + 1 M h β x θ β + 1 2 g h α 2 x θ α = u α + 1 + u α 2 θ α + 1 + θ α 2 G α + 1 2 u α + u α 1 2 θ α + θ α 1 2 G α 1 2 .

Appendix B.4. Closure of the Model

The model can be further simplified if we consider layers having thickness proportional to the total height. That is, for α = 1 , , M , h α = l α h with l α positive constants such that
α = 1 M l α = 1
By summing up Equation (8) up to any given α < M , we get
β = 1 α t h β + x ( h β u β ) = G α + 1 2 G 1 2 .
For the particular case α = M and by applying (A23), we get the global continuity equation
t h + x h β = 1 M l β u β = G M + 1 2 G 1 2 .
where we will assume G M + 1 2 = G 1 2 = 0 .
This allows us to give a simpler expression for the mass exchange terms between layers using (A23) and (A24):
G α + 1 2 = β = 1 α l β t h + x ( h u β ) = β = 1 α l β x ( h u β ) x h γ = 1 M l γ u γ .
This expression can be written as
G α + 1 2 = γ = 1 M ξ α , γ x ( h u γ ) ,
with
ξ α , γ : = β = 1 α ( δ β γ l β ) l γ = ( 1 ( l 1 + + l α ) ) l γ , if γ α , ( l 1 + + l α ) l γ , otherwise ,
where δ β γ is the standard Kronecker symbol. In this way, we define the mass exchange terms between layers across each layer as a function of the horizontal velocities in the layers.
We can now write the full system. Here, we neglect the viscosity terms and, for the sake of simplicity, we consider the one-dimensional case:
{ t h + x h β = 1 M l β u β = 0 , t ( h θ α ) + x ( h θ α u α ) = θ α + 1 + θ α 2 l α G α + 1 2 θ α + θ α 1 2 l α G α 1 2 , t ( h θ α u α ) + x ( h θ α u α 2 ) + g h θ α x η + g h β = α + 1 M l β ( θ β θ α ) x h + g h β = α + 1 M l β h x θ β + 1 2 g l α h 2 x θ α = u α + 1 + u α 2 l α θ α + 1 + θ α 2 G α + 1 2 u α + u α 1 2 l α θ α + θ α 1 2 G α 1 2 .

References

  1. De St. Venant, B. Theorie du mouvement non-permanent des eaux avec application aux crues des rivers et a l’introduntion des Marees dans leur lit. Acad. Sci. Comptes Redus 1871, 73, 148–154. [Google Scholar]
  2. Cushman-Roisin, B.; Beckers, J.M. Introduction to Geophysical Fluid Dynamics: Physical and Numerical Aspects; Academic Press: Cambridge, MA, USA, 2011. [Google Scholar]
  3. Audusse, E.; Bristeau, M.O. Finite-Volume Solvers for a Multilayer Saint–Venant System. Appl. Math. Comput. Sci. 2007, 17, 311–320. [Google Scholar] [CrossRef] [Green Version]
  4. Audusse, E.; Bristeau, M.O.; Perthame, B.; Sainte-Marie, J. A multilayer Saint–Venant system with mass exchanges for shallow water flows. Derivation and numerical validation. ESAIM Math. Model. Numer. Anal. 2011, 45, 169–200. [Google Scholar] [CrossRef]
  5. Gosse, L. A well-balanced scheme using non-conservative products designed for hyperbolic systems of conservation laws with source terms. Math. Model. Methods Appl. Sci. 2001, 11, 339–365. [Google Scholar] [CrossRef] [Green Version]
  6. Macias, J.; Castro, M.J.; González-Vida, J.M.; de la Asunción, M.; Ortega, S. HySEA: An operational GPU-based model for Tsunami Early Warning Systems. In Proceedings of the EGU General Assembly 2014, Vienna, Austria, 27 April–2 May 2014; p. 14217. [Google Scholar]
  7. de la Asunción, M.; Castro, M.; Mantas, J.; Ortega, S. Numerical simulation of tsunamis generated by landslides on multiple GPUs. Adv. Eng. Softw. 2016, 99, 59–72. [Google Scholar] [CrossRef]
  8. LeVeque, R.J.; George, D.L.; Berger, M.J. Tsunami modelling with adaptively refined finite volume methods. Acta Numer. 2011, 20, 211–289. [Google Scholar] [CrossRef] [Green Version]
  9. Barthélemy, E. Nonlinear shallow water theories for coastal waves. Surv. Geophys. 2004, 25, 315–337. [Google Scholar] [CrossRef]
  10. Lastra, M.; Mantas, J.M.; Ureña, C.; Castro, M.J.; García-Rodríguez, J.A. Simulation of shallow-water systems using graphics processing units. Math. Comput. Simul. 2009, 80, 598–618. [Google Scholar] [CrossRef]
  11. Brufau, P.; Vázquez-Cendón, M.; García-Navarro, P. A numerical model for the flooding and drying of irregular domains. Int. J. Numer. Methods Fluids 2002, 39, 247–275. [Google Scholar] [CrossRef]
  12. Gonzalez-Sanchis, M.; Murillo, J.; Latorre, B.; Comin, F.; Garcia-Navarro, P. Transient Two-Dimensional Simulation of Real Flood Events in a Mediterranean Floodplain. J. Hydraul. Eng. ASCE 2012, 138, 629–641. [Google Scholar] [CrossRef] [Green Version]
  13. Ersoy, M.; Lakkis, O.; Townsend, P. A Saint–Venant shallow water model for overland flows with precipitation and recharge. arXiv 2017, arXiv:1705.05470. [Google Scholar]
  14. Martínez-Cantó, R.; Hidalgo, A. A Methodology Based on Numerical Simulation to Study River Floods. Application to Lower River Omaña Basin. Water Resour. 2019, 46, 844–852. [Google Scholar] [CrossRef]
  15. Ersoy, M.; Lakkis, O.; Townsend, P. Numerical simulation of flood inundation using a well-balanced kinetic scheme for the shallow water equations with bulk recharge and discharge. In Proceedings of the EGU General Assembly 2016, Vienna, Austria, 17 April–22 April 2016; Volume 18. [Google Scholar]
  16. Dawson, C.; Kubatko, E.J.; Westerink, J.J.; Trahan, C.; Mirabito, C.; Michoski, C.; Panda, N. Discontinuous Galerkin methods for modeling hurricane storm surge. Adv. Water Resour. 2011, 34, 1165–1176. [Google Scholar] [CrossRef] [Green Version]
  17. Mandli, K.T.; Dawson, C.N. Adaptive mesh refinement for storm surge. Ocean Model. 2014, 75, 36–50. [Google Scholar] [CrossRef] [Green Version]
  18. Tanaka, S.; Bunya, S.; Westerink, J.J.; Dawson, C.; Luettich, R.A. Scalability of an unstructured grid continuous Galerkin based hurricane storm surge model. J. Sci. Comput. 2011, 46, 329–358. [Google Scholar] [CrossRef]
  19. Audusse, E.; Bristeau, M.O. A well-balanced positivity preserving “second-order” scheme for shallow water flows on unstructured meshes. J. Comput. Phys. 2005, 206, 311–333. [Google Scholar] [CrossRef]
  20. Fernández-Nieto, E.D.; Koné, E.H.; Chacón Rebollo, T. A Multilayer Method for the Hydrostatic Navier–Stokes Equations: A Particular Weak Solution. J. Sci. Comput. 2014, 60, 408–437. [Google Scholar] [CrossRef] [Green Version]
  21. Audusse, E.; Bristeau, M.; Decoene, A. Numerical simulations of 3D free surface flows by a multilayer Saint–Venant model. Int. J. Numer. Methods Fluids 2008, 56, 331–350. [Google Scholar] [CrossRef]
  22. Bonaventura, L.; Fernández-Nieto, E.D.; Garres-Díaz, J.; Narbona-Reina, G. Multilayer shallow water models with locally variable number of layers and semi-implicit time discretization. J. Comput. Phys. 2018, 364, 209–234. [Google Scholar] [CrossRef] [Green Version]
  23. Casulli, V.; Stelling, G.S. Numerical simulation of 3D quasi-hydrostatic, free-surface flows. J. Hydraul. Eng. 1998, 124, 678–686. [Google Scholar] [CrossRef]
  24. Casulli, V. A semi-implicit finite difference method for non-hydrostatic, free-surface flows. Int. J. Numer. Methods Fluids 1999, 30, 425–440. [Google Scholar] [CrossRef]
  25. Casulli, V.; Zanolli, P. Semi-implicit numerical modeling of nonhydrostatic free-surface flows for environmental problems. Math. Comput. Model. 2002, 36, 1131–1149. [Google Scholar] [CrossRef]
  26. Ma, G.; Shi, F.; Kirby, J.T. Shock-capturing non-hydrostatic model for fully dispersive surface wave processes. Ocean Model. 2012, 43, 22–35. [Google Scholar] [CrossRef]
  27. Bristeau, M.O.; Mangeney, A.; Sainte-Marie, J.; Seguin, N. An energy-consistent depth-averaged Euler system: Derivation and properties. arXiv 2014, arXiv:1406.6565. [Google Scholar] [CrossRef]
  28. Fernández-Nieto, E.D.; Parisot, M.; Penel, Y.; Sainte-Marie, J. A hierarchy of dispersive layer-averaged approximations of Euler equations for free surface flows. Commun. Math. Sci. 2018, 16, 1169–1202. [Google Scholar] [CrossRef] [Green Version]
  29. Tumolo, G.; Bonaventura, L. Simulations of Non-hydrostatic Flows by an Efficient and Accurate p-Adaptive DG Method. In Numerical Methods for Flows: FEF 2017 Selected Contributions; Springer International Publishing: Cham, Switzerland, 2020; pp. 41–53. [Google Scholar] [CrossRef]
  30. de Luna, T.M.; Fernández Nieto, E.; Castro Díaz, M.J. Derivation of a Multilayer Approach to Model Suspended Sediment Transport: Application to Hyperpycnal and Hypopycnal Plumes. Commun. Comput. Phys. 2017, 22, 1439–1485. [Google Scholar] [CrossRef] [Green Version]
  31. Bürger, R.; Fernández-Nieto, E.D.; Andrés Osores, V. A dynamic multilayer shallow water model for polydisperse sedimentation. ESAIM Math. Model. Numer. Anal. 2019. [Google Scholar] [CrossRef] [Green Version]
  32. Audusse, E.; Bristeau, M.O.; Pelanti, M.; Sainte-Marie, J. Approximation of the hydrostatic Navier–Stokes system for density stratified flows by a multilayer model: Kinetic interpretation and numerical solution. J. Comput. Phys. 2011, 230, 3453–3478. [Google Scholar] [CrossRef]
  33. Bouchut, F.; Zeitlin, V. A robust well-balanced scheme for multi-layer shallow water equations. Discret. Contin. Dyn. Syst. Ser. B 2010, 13, 739–758. [Google Scholar] [CrossRef] [Green Version]
  34. Castro, M.; Macías, J.; Parés, C. A Q-scheme for a class of systems of coupled conservation laws with source term. Application to a two-layer 1D shallow water system. ESAIM Math. Model. Numer. Anal. 2001, 35, 107–127. [Google Scholar] [CrossRef] [Green Version]
  35. Adduce, C.; Sciortino, G.; Proietti, S. Gravity Currents Produced by Lock Exchanges: Experiments and Simulations with a Two-Layer Shallow-Water Model with Entrainment. J. Hydraul. Eng. 2012, 138, 111–121. [Google Scholar] [CrossRef]
  36. Bermúdez, A.; Vázquez, M.E. Upwind methods for hyperbolic conservation laws with source terms. Comput. Fluids 1994, 23, 1049–1071. [Google Scholar] [CrossRef]
  37. Creaco, E.; Campisano, A.; Khe, A.; Modica, C.; Russo, G. Head reconstruction method to balance flux and source terms in shallow water equations. J. Eng. Mech. 2010, 136, 517–523. [Google Scholar] [CrossRef]
  38. Russo, G.; Khe, A. High order well-balanced schemes based on numerical reconstruction of the equilibrium variables. In Waves and Stability in Continuous Media; World Scientific: Singapore, 2010; pp. 230–241. [Google Scholar]
  39. Castro, M.J.; de Luna, T.M.; Parés, C. Well-balanced schemes and path-conservative numerical methods. In Handbook of Numerical Analysis; Elsevier: Amsterdam, The Netherlands, 2017; Volume 18, pp. 131–175. [Google Scholar]
  40. Castro, M.J.; Pardo Milanés, A.; Parés, C. Well-balanced numerical schemes based on a generalized hydrostatic reconstruction technique. Math. Model. Methods Appl. Sci. 2007, 17, 2055–2113. [Google Scholar] [CrossRef]
  41. Parés, C. Numerical methods for nonconservative hyperbolic systems: A theoretical framework. SIAM J. Numer. Anal. 2006, 44, 300–321. [Google Scholar] [CrossRef]
  42. Castro, M.; Fernández-Nieto, E. A Class of Computationally Fast First, Order Finite Volume Solvers: PVM Methods. SIAM J. Sci. Comput. 2012, 34. [Google Scholar] [CrossRef] [Green Version]
  43. Audusse, E.; Bouchut, F.; Bristeau, M.O.; Klein, R.; Perthame, B. A Fast and Stable Well-Balanced Scheme with Hydrostatic Reconstruction for Shallow Water Flows. SIAM J. Sci. Comput. 2004, 25, 2050–2065. [Google Scholar] [CrossRef]
  44. Morales de Luna, T.; Castro Díaz, M.; Parés, C. Reliability of first order numerical schemes for solving shallow water system over abrupt topography. Appl. Math. Comput. 2013, 219, 9012–9032. [Google Scholar] [CrossRef] [Green Version]
  45. Van Leer, B. Towards the ultimate conservative difference scheme. V. A second-order sequel to Godunov’s method. J. Comput. Phys. 1979, 32, 101–136. [Google Scholar] [CrossRef]
  46. Zhang, X.; Shu, C.W. On maximum-principle-satisfying high order schemes for scalar conservation laws. J. Comput. Phys. 2010, 229, 3091–3120. [Google Scholar] [CrossRef]
  47. Gottlieb, S.; Shu, C.W. Total Variation Diminishing Runge–Kutta Schemes. Math. Comput. 1996, 67. [Google Scholar] [CrossRef] [Green Version]
  48. Castro, M.J.; Parés, C. Well-Balanced High-Order Finite Volume Methods for Systems of Balance Laws. J. Sci. Comput. 2020, 82, 48. [Google Scholar] [CrossRef]
  49. Escalante, C.; de Luna, T.M.; Castro, M. Non-hydrostatic pressure shallow flows: GPU implementation using finite volume and finite difference scheme. Appl. Math. Comput. 2018, 338, 631–659. [Google Scholar] [CrossRef] [Green Version]
  50. Lane-Serff, G.F.; Beal, L.M.; Hadfield, T.D. Gravity current flow over obstacles. J. Fluid Mech. 1995, 292, 39–53. [Google Scholar] [CrossRef]
  51. Chandrasekaran, S.; Juckeland, G. OpenACC for Programmers: Concepts and Strategies; Addison-Wesley Professional: Boston, MA, USA, 2017. [Google Scholar]
  52. Christgau, S.; Spazier, J.; Schnor, B.; Hammitzsch, M.; Babeyko, A.; Waechter, J. A comparison of CUDA and OpenACC: Accelerating the Tsunami Simulation EasyWave. In Proceedings of the ARCS 2014—2014 Workshop Proceedings on Architecture of Computing Systems, Luebeck, Germany, 25–28 February 2014; pp. 1–5. [Google Scholar]
  53. Hoshino, T.; Maruyama, N.; Matsuoka, S.; Takaki, R. CUDA vs OpenACC: Performance Case Studies with Kernel Benchmarks and a Memory-Bound CFD Application. In Proceedings of the 2013 13th IEEE/ACM International Symposium on Cluster, Cloud, and Grid Computing, Delft, The Netherlands, 13–16 May 2013; pp. 136–143. [Google Scholar]
  54. Mantas, J.M.; De la Asunción, M.; Castro, M.J. An introduction to GPU computing for numerical simulation. In Numerical Simulation in Physics and Engineering; Springer: Berlin, Germany, 2016; pp. 219–251. [Google Scholar]
Figure 1. Sketch of the multilayer approach.
Figure 1. Sketch of the multilayer approach.
Mathematics 08 00848 g001
Figure 2. Solution of the ODE (12) for an stratified fluid with M = 5 (left) and M = 10 (right).
Figure 2. Solution of the ODE (12) for an stratified fluid with M = 5 (left) and M = 10 (right).
Mathematics 08 00848 g002
Figure 3. Solution of the ODE (12) for an stratified fluid with M = 50 (left) and M = 100 (right).
Figure 3. Solution of the ODE (12) for an stratified fluid with M = 50 (left) and M = 100 (right).
Mathematics 08 00848 g003
Figure 4. Simulation with M = 4 number of layers for a version of the code without an upwind approximation. The relative density θ α is shown.
Figure 4. Simulation with M = 4 number of layers for a version of the code without an upwind approximation. The relative density θ α is shown.
Mathematics 08 00848 g004
Figure 5. Simulation with M = 4 number of layers for a version of the code with an upwind approximation. The relative density θ α is shown.
Figure 5. Simulation with M = 4 number of layers for a version of the code with an upwind approximation. The relative density θ α is shown.
Mathematics 08 00848 g005
Figure 6. Free surface (left) and velocities (right) at time t = 0.5 s for the second order scheme.
Figure 6. Free surface (left) and velocities (right) at time t = 0.5 s for the second order scheme.
Mathematics 08 00848 g006
Figure 7. Free surface and bathymetry (left) and zoom of the free surface (right) at time t = 150 s.
Figure 7. Free surface and bathymetry (left) and zoom of the free surface (right) at time t = 150 s.
Mathematics 08 00848 g007
Figure 8. Free surface (left) and velocities (right) at time t = 10 s: solution obtained with the numerical scheme (35).
Figure 8. Free surface (left) and velocities (right) at time t = 10 s: solution obtained with the numerical scheme (35).
Mathematics 08 00848 g008
Figure 9. Difference between the numerical solution at t = 100 s and the exact steady state solution for the relative density θ α (left) and velocities (right).
Figure 9. Difference between the numerical solution at t = 100 s and the exact steady state solution for the relative density θ α (left) and velocities (right).
Mathematics 08 00848 g009
Figure 10. Initial condition for a perturbation of a well-balanced steady state with M = 3 layers. Free surface is on the left and relative densities on the right.
Figure 10. Initial condition for a perturbation of a well-balanced steady state with M = 3 layers. Free surface is on the left and relative densities on the right.
Mathematics 08 00848 g010
Figure 11. Difference on the relative density between the perturbed and unperturbed steady state.
Figure 11. Difference on the relative density between the perturbed and unperturbed steady state.
Mathematics 08 00848 g011
Figure 12. Difference on the relative density between the perturbed and unperturbed steady state.
Figure 12. Difference on the relative density between the perturbed and unperturbed steady state.
Mathematics 08 00848 g012
Figure 13. Relative density initial condition.
Figure 13. Relative density initial condition.
Mathematics 08 00848 g013
Figure 14. Evolution of the relative density at t = 2.5 s.
Figure 14. Evolution of the relative density at t = 2.5 s.
Mathematics 08 00848 g014
Figure 15. Evolution of the relative density at t = 5 s.
Figure 15. Evolution of the relative density at t = 5 s.
Mathematics 08 00848 g015
Figure 16. Evolution of the relative density at t = 10 s.
Figure 16. Evolution of the relative density at t = 10 s.
Mathematics 08 00848 g016
Figure 17. Evolution of the relative density at t = 50 s.
Figure 17. Evolution of the relative density at t = 50 s.
Mathematics 08 00848 g017
Figure 18. Initial condition.
Figure 18. Initial condition.
Mathematics 08 00848 g018
Figure 19. Evolution of the density driven current at t = 0.5 s.
Figure 19. Evolution of the density driven current at t = 0.5 s.
Mathematics 08 00848 g019
Figure 20. Evolution of the density driven current at t = 1 s.
Figure 20. Evolution of the density driven current at t = 1 s.
Mathematics 08 00848 g020
Figure 21. Evolution of the density driven current at t = 1.5 s.
Figure 21. Evolution of the density driven current at t = 1.5 s.
Mathematics 08 00848 g021
Figure 22. Evolution of the density driven current at t = 2.5 s.
Figure 22. Evolution of the density driven current at t = 2.5 s.
Mathematics 08 00848 g022
Figure 23. Evolution of the density driven current at t = 5 s.
Figure 23. Evolution of the density driven current at t = 5 s.
Mathematics 08 00848 g023
Figure 24. Evolution of the density driven current at t = 10 s.
Figure 24. Evolution of the density driven current at t = 10 s.
Mathematics 08 00848 g024
Figure 25. Evolution of the density driven current at t = 20 s.
Figure 25. Evolution of the density driven current at t = 20 s.
Mathematics 08 00848 g025
Figure 26. Evolution of the head of the gravity current over time. The left figure depicts the problem with M = 15 number of layers while the right shows the case with M = 20 .
Figure 26. Evolution of the head of the gravity current over time. The left figure depicts the problem with M = 15 number of layers while the right shows the case with M = 20 .
Mathematics 08 00848 g026
Figure 27. Evolution of the head of the gravity current over time. The left figure depicts the problem with M = 30 number of layers while the right shows the case with M = 40 .
Figure 27. Evolution of the head of the gravity current over time. The left figure depicts the problem with M = 30 number of layers while the right shows the case with M = 40 .
Mathematics 08 00848 g027
Figure 28. Initial condition.
Figure 28. Initial condition.
Mathematics 08 00848 g028
Figure 29. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Figure 29. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Mathematics 08 00848 g029
Figure 30. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Figure 30. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Mathematics 08 00848 g030
Figure 31. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Figure 31. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Mathematics 08 00848 g031
Figure 32. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Figure 32. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Mathematics 08 00848 g032
Figure 33. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Figure 33. Distribution of the relative density θ . The first row corresponds to the first order scheme and the second row to the second order scheme.
Mathematics 08 00848 g033
Figure 34. Initial condition for a cut in the planes y = 0 (upper row) and x = 2 (lower row).
Figure 34. Initial condition for a cut in the planes y = 0 (upper row) and x = 2 (lower row).
Mathematics 08 00848 g034
Figure 35. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Figure 35. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Mathematics 08 00848 g035
Figure 36. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Figure 36. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Mathematics 08 00848 g036
Figure 37. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Figure 37. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Mathematics 08 00848 g037
Figure 38. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Figure 38. Distribution of θ for a cut in the plane y = 0 (upper row) and x = 2 (lower row).
Mathematics 08 00848 g038aMathematics 08 00848 g038b
Figure 39. Upper view of θ distribution in layer 7.
Figure 39. Upper view of θ distribution in layer 7.
Mathematics 08 00848 g039
Figure 40. Upper view of θ distribution in layer 7.
Figure 40. Upper view of θ distribution in layer 7.
Mathematics 08 00848 g040
Table 1. Order of accuracy for the first order scheme.
Table 1. Order of accuracy for the first order scheme.
h h θ 1 h θ 1 u 1
N. CellsErrorOrderErrorOrderErrorOrder
255.97 × 10 2 -4.74 × 10 2 -2.14 × 10 1 -
504.51 × 10 2 0.413.71 × 10 2 0.351.72 × 10 1 0.31
1002.82 × 10 2 0.682.46 × 10 2 0.591.13 × 10 1 0.61
2001.60 × 10 2 0.821.50 × 10 2 0.726.57 × 10 2 0.78
4008.16 × 10 3 0.978.03 × 10 3 0.903.38 × 10 2 0.96
Table 2. Order of accuracy for the second order scheme.
Table 2. Order of accuracy for the second order scheme.
h h θ 1 h θ 1 u 1
N. CellsErrorOrderErrorOrderErrorOrder
252.18 × 10 3 -2.32 × 10 2 -5.92 × 10 2 -
501.17 × 10 2 0.901.34 × 10 2 0.793.77 × 10 2 0.64
1005.06 × 10 3 1.215.47 × 10 3 1.291.73 × 10 2 1.12
2001.53 × 10 3 1.721.57 × 10 3 1.805.21 × 10 3 1.74
4003.82 × 10 4 2.003.87 × 10 4 2.021.30 × 10 3 2.00

Share and Cite

MDPI and ACS Style

Guerrero Fernández, E.; Castro-Díaz, M.J.; Morales de Luna, T. A Second-Order Well-Balanced Finite Volume Scheme for the Multilayer Shallow Water Model with Variable Density. Mathematics 2020, 8, 848. https://doi.org/10.3390/math8050848

AMA Style

Guerrero Fernández E, Castro-Díaz MJ, Morales de Luna T. A Second-Order Well-Balanced Finite Volume Scheme for the Multilayer Shallow Water Model with Variable Density. Mathematics. 2020; 8(5):848. https://doi.org/10.3390/math8050848

Chicago/Turabian Style

Guerrero Fernández, Ernesto, Manuel Jesús Castro-Díaz, and Tomás Morales de Luna. 2020. "A Second-Order Well-Balanced Finite Volume Scheme for the Multilayer Shallow Water Model with Variable Density" Mathematics 8, no. 5: 848. https://doi.org/10.3390/math8050848

APA Style

Guerrero Fernández, E., Castro-Díaz, M. J., & Morales de Luna, T. (2020). A Second-Order Well-Balanced Finite Volume Scheme for the Multilayer Shallow Water Model with Variable Density. Mathematics, 8(5), 848. https://doi.org/10.3390/math8050848

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop