Keywords

1 Introduction

Nowadays, shallow water equations are widely used to model flows in various contexts, such as overland flow [1, 2], rivers [3, 4], flooding [5, 6], dam breaks [7, 8], near shore [9, 10], tsunami [1113]. This system of partial differential equations (PDEs), proposed by Adhémar Barré de Saint–Venant in 1871 to model flows in a channel [14], consists in a system of conservation laws describing the evolution of the height and mean velocity of the fluid.

In real situations (realistic geometry, sharp spatial or temporal variations in the parameters), it is impossible to give an analytic formula for the solutions of this system of PDEs. Thus, there is a necessity to develop specific numerical schemes to compute approximate solutions for these PDEs [1517]. Implementation of such methods implies a subsequent step of code validation.

Validation of a model (that is, the equations, the numerical methods and their implementation) is essential to know if it describes suitably the considered phenomena. At least three complementary kinds of numerical tests help us ensure that a numerical code is suitable for the considered system of equations. First, we can perform convergence or stability analysis (e.g. by refining the mesh). But this validates only the numerical method and its implementation. Second, approximate solutions can be compared with analytic solutions available for some simplified or specific cases. Finally, numerical results can be applied on experimental data, produced indoor or outdoor. This step should be done after the previous two; it is the most difficult one and must be validated by a specialist of the domain. In [18], we have focused on the second approach.

In numerical code validation, analytic solutions seem to be underused. We think that there are two possible reasons. First, each analytic solution has a limited scope in terms of flow conditions. Second, as they are dispersed through the literature, they are difficult to find. However, an important number of published analytic solutions allow us to embrace a wide range of flow conditions. Thus, overall, the existing analytic solutions have a large potential for numerical code validation. In the literature, we can find benchmarks for hydraulic river modelling software [19]. But they are too specific (weirs, pump, culverts… treatment validation), and there are too few tests available for numerical methods for shallow water equations.

In Ref. [18], we have tried to overcome these problems both by gathering a significant set of analytic solutions and by providing the corresponding source codes. Reference [18] describes the analytic solutions and gives some comments about their use and advantage. The source codes are freely available through the Shallow Water Analytic Solutions for Hydraulic and Environmental Studies (SWASHES) library. With SWASHES software, we do not pretend to list all existing analytic solutions. Indeed, SWASHES is a framework to which users are invited to contribute by sending other analytic solutions together with the dedicated code.

The chapter is organized as follows: in Sect. 2, we briefly present the notations we use and the main properties of shallow water equations. In Sect. 3, we will focus on stationary solutions which are well known by the hydraulics community but much less by mathematicians, that is, “backwater curves”. Lastly, in Sect. 4, we will present SWASHES and the interest of solutions described in [18].

2 Equations, Notations and Properties

In the first section, we give the “complete” shallow water system in two space dimensions, that is, with topography, rain, infiltration, soil friction and viscous term. Then, we give this system in one space dimension and its main properties are recalled.

2.1 General Settings

The Shallow-Water equations in two space dimensions take the following form:

$$ {\begin{aligned} \partial_{t} h \,+\, \partial_{x} \left( {hu}\right) \,+\, \partial_{y} \left( {hv} \right) \,= &\, R - I \\\partial_{t} \left( {hu} \right)\, +\, \partial_{x} \left( {hu^{2} \,+\,\frac{{gh^{2} }}{2}} \right)\, +\, \partial_{y} \left( {huv} \right)\,= &\, gh\left( {S_{{O_{x} }} \,-\, S_{{f_{x} }} } \right) \,+\, \mu S_{{d_{x} }} \\ \partial_{t} \left( {hv} \right) \,+\, \partial_{x} \left( {huv} \right) \,+\, \partial_{y} \left( {hu^{2} \,+\,\frac{{gh^{2} }}{2}} \right) \,= &\, gh\left( {S_{{O_{y} }} \,-\,S_{{f_{y} }} } \right) \,+\, \mu S_{{d_{y} }} \\\end{aligned}}, $$
(1)

where the unknowns of the model are the water height (\( {h\left( {t,x,y} \right)} \)[L]) and \( {u\left( {t,x,y} \right)} \), \( {v\left( {t,x,y} \right)} \) the horizontal components of the vertically averaged velocity \( {\left[ {L/T} \right]} \) (Fig. 1a) and \( {g = 9.81\,\text{m/s}^{2} } \) is the gravity constant. The first equation is the mass conservation equation. The other two equations are the momentum conservation equations; they involve forces such as gravity and friction. We give now a short description of all the terms with their physical dimensions.

Fig. 1
figure 1

Illustration of variables of a shallow water equations and b zones for classification of free surface profiles

  • \( z \) is the topography \( {\left[ L \right]} \), since erosion is not considered here, it depends only on space, \( {z\left( {x,y} \right)} \), and \( {S_{{O_{x} }} } \) (resp. \( {S_{{O_{y} }} } \)) is the opposite of the slope in the \( x \) (resp. \( y \)) direction, \( {S_{{O_{x} }} = - \partial_{x} z\left( {x,y} \right)} \) (resp. \( {S_{{O_{y} }} = - \partial_{y} z\left( {x,y} \right)} \));

  • \( {R \ge 0} \) is the rain intensity \( {\left[ {L/T} \right]} \), and it is a given function \( {R\left( {t,x,y} \right) \ge 0} \). In [20], it is considered uniform in space;

  • \( I \) is the infiltration rate \( {\left[ {L/T} \right]} \). It is given by another model (such as Horton, Philip, Green-Ampt, Richards …) and is not taken into account in the following;

  • \( {S_{f} = \left( {S_{{f_{x} }} ,S_{{f_{y} }} } \right)} \) is the friction force/law and may take various forms, depending on both soil and flow properties. In the formulas below, \( U \) is the velocity vector,\( {U = \left( {u,v} \right)} \) with \( {\left| U \right| = \sqrt {u^{2} + v^{2} } } \) and \( Q \) is the discharge \( {Q = \left( {hu,hv} \right)} \). In hydrological models, two families of friction laws are encountered based on empirical considerations. On the one hand, we have the family of Manning–Strickler’s friction laws

    $$ {S_{f} = C_{f} \frac{U\left| U \right|}{{h^{4/3} }} = C_{f} \frac{Q\left| Q \right|}{{h^{10/3} }}} $$
    (2)

    \( {C_{f} = n^{2} } \), where \( n \) is the Manning’s coefficient\( {\left[ {L^{ - 1/3} T} \right]} \).

    On the other hand, the laws of Darcy–Weisbach’s and Chézy’s family write

    $$ {S_{f} = C_{f} \frac{U\left| U \right|}{h} = C_{f} \frac{Q\left| Q \right|}{{h^{3} }}} $$
    (3)

    With \( {C_{f} = {f \mathord{\left/ {\vphantom {f {\left( {8g} \right)}}} \right. \kern-0pt} {\left( {8g} \right)}}} \), \( f \) a dimensionless coefficient (resp. \( {C_{f} = 1/C^{2} } \),\( {C\left[ {L^{1/2} /T} \right]} \)), we get the Darcy–Weisbach’s (resp. Chézy’s) friction law. Notice that the friction may depend on the space variable, especially for large areas. In the following this will not be considered.

  • finally, \( {\mu S_{d} = \left( {\mu S_{{d_{x} }} ,\mu S_{{d_{y} }} } \right)} \) is the viscous term with \( {\mu \ge 0} \) the viscosity of the fluid \( {\left[ {L^{2} /T} \right]} \).

2.2 Properties

In this section, some properties of the shallow water model are recalled. These properties are useful to the flow description. To simplify, we consider the one-dimensional model, but extensions to two dimensions are straightforward. The 2D shallow water system (1) rewrites

$$ {\begin{aligned} \partial_{t} h\, + \,\partial_{x} \left( {hu} \right)\, = & \,R\, - \,I \\ \partial_{t} \left( {hu} \right)\, + \,\partial_{x} \left( {hu^{2} \, + \,\frac{{gh^{2} }}{2}} \right)\, = & \,gh\left( {S_{{O_{x} }} \, - \,S_{f} } \right)\, + \,\mu \partial_{x} \left( {h\partial_{x} u} \right) \\ \end{aligned} }. $$
(4)

The left-hand side of this system is the transport part of the model. It corresponds to the flow of an ideal fluid in a flat channel, without friction, rain or infiltration. It is in fact the model introduced by Saint–Venant in [14]. Several important properties of the flow are included in this model. The one-dimensional equations are rewritten using vectors’ form, in order to highlight these properties:

$$ {\partial_{t} W\, + \,\partial_{x} F\left( W \right)\, = \,0,\,\,{\text{where}}\,\,W = \left( {\begin{array}{*{20}c} h \\ {hu} \\ \end{array} } \right),\,F\left( W \right)\, = \,\left( {\begin{array}{*{20}c} {hu} \\ {hu^{2} \, + \,\frac{{gh^{2} }}{2}} \\ \end{array} } \right)}, $$
(5)

with \( {F\left( W \right)} \) the flux of the equation. With the following nonconservative form, where \( {A\left( W \right) = F^{\prime}\left( W \right)} \) is the jacobian matrix or the matrix of transport coefficients

$$ {\partial_{t} W + A\left( W \right)\partial_{x} W = 0,\,{\text{with }}\,A\left( W \right) = F^{\prime}\left( W \right) = \left( {\begin{array}{*{20}c} 0 \hfill & 1 \hfill \\ {-u^{2} + gh} \hfill & {2u} \hfill \\ \end{array} } \right)}, $$
(6)

the transport is more clearly evidenced. More precisely, when the matrix turns out to be diagonalizable, with eigenvalues

$$ {\lambda_{1} \left( W \right) = u - \sqrt {gh} \le u + \sqrt {gh} = \lambda_{2} \left( W \right)}. $$
(7)

If the water height is strictly positive, lambda_1(W) < lambda_2(W), the system is said to be strictly hyperbolic (see among others [21]). The eigenvalues (7) are the velocities of surface waves on the fluid. For dry zones (i.e. if \({h = 0\,\text{m}} \)), the eigenvalues coincide. In that case, the system is no longer hyperbolic, and this induces difficulties at both theoretical and numerical levels, such as negative water depths. Designing numerical schemes that preserve positivity for \( h \) is very important in this context.

With these formulas we recover a useful classification of flows. Indeed, if \( {\left| u \right| < \sqrt {gh} } \), the characteristic velocities (of the fluid \( u \) and of the waves \( {\sqrt {gh} } \)) have opposite signs and information propagates upwards as well as downwards the flow. The flow is said to be subcritical or fluvial. In the other case, when \( {\left| u \right| > \sqrt {gh} } \) the flow is supercritical, or torrential, all the information goes downwards. A transcritical regime exists when some parts of a flow are subcritical, other supercritical.

Since we have two unknowns \( h \) and \( u \) (or equivalently \( h \) and \( {q = hu} \)), a subcritical flow is therefore determined by one upstream and one downstream value, whereas a supercritical flow is completely determined by the two upstream values. Thus, for numerical simulations, we have to impose one variable for subcritical inflow/outflow. For supercritical inflow, we impose both variables and free boundary conditions are considered (see for example [2224]).

Two quantities allow us to determine the type of flow. The first one is a dimensionless parameter called the Froude number

$$ {Fr = \frac{\left| u \right|}{{\sqrt {gh} }}}\,. $$
(8)

Its analogue in gas dynamics is the Mach number. If \( {Fr < 1} \) (resp. \( {Fr > 1} \)), the flow is subcritical (resp. supercritical). The other essential quantity is the critical height \( {h_{c} } \) which writes

$$ {h_{c} = \left( {\frac{q}{\sqrt g }} \right)^{2/3} }, $$
(9)

for a given discharge \( {q = hu} \). It is a very readable criterion for criticality: the flow is subcritical (resp. supercritical) if \( {h > h_{c} } \) (resp. \( {h < h_{c} } \)).

In the presence of additional terms, we have to consider other properties, such as the occurrence of steady-state (or equilibrium) solutions. In Sect. 3, we will focus on backwater curves which are specific steady-state solutions.

3 Backwater Curves

By considering system (4) at steady state (\( {\partial_{t} h = \partial_{t} u = \partial_{t} q} \)), without rain and diffusion (\( {R = 0} \) and \( {\mu = 0} \)), it rewrites

$$ {\begin{aligned} q =\, & q_{0} \\ \partial_{x} h = & \frac{{S_{0} - S_{f} }}{{1 - Fr^{2} }} .\\ \end{aligned} } $$
(10)

In hydraulics, Eq. (10) is used as a base for theoretical analysis of the water surface profiles obtained for different flow conditions in open channels [2527]. It is called the gradually varied flow equation [25, 26]. Water surface profiles can be deduced theoretically and drawn qualitatively by studying the relative position of the profile (\( h \)) with respect to the critical-depth line (\( {h_{c} } \)) and the normal-depth line (\( {h_{n} } \), the height solution of equation \( {S_{0} - S_{f} = 0} \)). We notice that the normal height \( {h_{n} } \) depends on the slope \( {S_{0} } \), while the critical height \( {h_{c} } \) does not depend on \( {S_{ 0} } \). Bottom slopes are classified into five categories (designated by the first letter of the name): mild M if \( {h_{n} > h_{c} } \), critical C if \( {h_{n} = h_{c} } \), steep S if \( {h_{n} < h_{c} } \), horizontal H if \( {S_{0} = 0} \) and adverse A if \( {S_{0} < 0} \). Now, we have to designate the relative position of the free surface. In the cases of the mild and steep slopes, the space above the topography is divided into three regions by the normal height and the critical height (Fig. 1b). For the adverse, horizontal and critical slopes, there are only two regions because the normal height does not exist for the first two slopes and is the same as the critical one for the critical slope. The region between the lower line and the topography is designated as “zone 3”, and the region between the upper and lower lines is designated as “zone 2” and that above both lines is designated as “zone 1”. Thus, we have 13 different types of water height profiles. This technique allows us to make qualitative observations about various types of free surface profiles. These observations allow us to draw the profile without any detailed calculations. For example, we know if the water height increases or decreases with distance, how the profiles end at downstream and upstream limits. It is possible to put end-to-end several backwater curves to obtain a complete profile. In some cases, it is possible to generate this method to section average model (i.e. to take into account the shape of the cross-section).

For engineering applications, it is necessary to compute the flow conditions. But the gradually varied flow equation (10) is nonlinear, and the dependence on \( h \) is complicated, so the obtention of a general analytic solution is not possible: we have to use higher-order numerical methods [24]. We start the computations from downstream if the flow is subcritical and from upstream otherwise (see [2527]). Some computer programs such as HEC-RAS are based on this method. In the next section, we will describe SWASHES library.

4 Advanced Analytic Solutions

SWASHES is freely available to the community through the SWASHES repository hosted at http://www.univ-orleans.fr/mapmo/soft/SWASHES. It is distributed under CeCILL-V2 (GPL compatible) free software licence. When running the software, the user must specify the choice of the solution as well as the number of cells for the discretization of the chosen analytic solution. The solution is calculated and is redirected in a gnuplot-compatible ASCII file. SWASHES is written in object-oriented ISO C++ that allows us to easily implement a new solution.

We claim that SWASHES can be a useful tool for developers of shallow water codes to evaluate the performances and properties of their own code. Indeed, SWASHES has been created because we have been developing a free software for the resolution of shallow water equations, namely FullSWOF [28, 29], and we wanted to validate it against analytic solutions. With SWASHES, a wide range of flow conditions are available as developed in the following subsection: steady-state solutions and transitory solutions.

4.1 Steady-State Solutions

In case of steady states (\( {\partial_{t} h = \partial_{t} u = \partial_{t} q = 0} \)), the one-dimensional shallow water Eq. (4) is reduced in the following system

$$ {\begin{aligned} q =\, & Rx + q_{0} \\ \partial_{x} z = & \frac{1}{gh}\left( {\frac{{q^{2} }}{{h^{2} }} - gh} \right)\partial_{x} h - S_{f} \left( {h,q} \right) + \frac{\mu }{gh}\partial_{x} \left( {h\partial_{x} \frac{q}{h}} \right) \\ \end{aligned} }. $$
(11)

System (11) enables us to produce an infinity of analytic solutions. For these solutions, the strategy consists in choosing either a topography and getting the associated water height or a water height and deducing the associated topography. With the first approach, we can get, for example, the well-known solutions for flow over a bump [30, 31], the backwater curves (Sect. 3)… With the second approach, we get the MacDonald’s solutions (which are section-averaged) [32, 33] and all their one-dimensional variants [20, 28].

Since [34] it is well known that the topography source term treatment is a crucial point in preserving steady states. Thanks to the steady-state solutions gathered in [18], one can check whether the steady state at rest and dynamic steady-state solutions are satisfied by the considered schemes. These solutions, integrated in SWASHES, cover a wide variety of flow conditions (fluvial, torrential, transcritical, with shock…). Moreover, different source terms (topography, friction, rain and diffusion) are taken into account, which allow us to validate each source term treatment.

4.2 Transitory Solutions

In previous subsection, we dealt with the steady-state solutions of SWASHES. These solutions can be used to check whether the numerical methods are able to keep/catch steady-state flows. But even if the initial conditions differ from the expected steady state, we do not have information about the transitory behaviour. Thus, transitory solutions are also included in SWASHES, such as the dam-break solutions of increasing complexity [3537, 42], 1D and 2D Thacker’s and variants solutions [3840, 41]. These solutions allow us to test moving wet/dry transitions, moving shock, moving wet/dry transitions with friction…

5 Conclusions

We have developed SWASHES, a free tool for benchmarking in hydraulics. It is open to user’s contributions. We think that it might be useful for codes/numerical testing.