Shallow Water Equations
The two-dimensional shallow water equations can be written in the conservative form
Here,
is the solution vector, with components
- \(h\), the flow depth
- \(u\), the vertically-averaged velocity in the \(x\) direction
- \(v\), the vertically-averaged velocity in the \(y\) direction
The terms \(\mathbf{E}\) and \(\mathbf{G}\) on the left hand side of \(\eqref{1}\) are the flux vectors in the \(x\) and \(y\) spatial dimensions:
where \(g\) is the acceleration due to gravity.
The three source terms on the right hand side of \(\eqref{1}\) represent contributions to \(\mathbf{U}\) from
- \(\mathbf{S}_r\), net runoff (water) production
- \(\mathbf{S}_b\), bed elevation slope
- \(\mathbf{S}_f\), bed friction roughness.
These source terms are
and
It is sometimes convenient to interpret the terms involving \(\mathbf{E}\) and \(\mathbf{G}\) as the (two-dimensional) divergence of a multi-component spatial vector called the flux function \(\mathbf{\vec{F}}\).
where \(\mathbf{\vec{F}} = (\mathbf{F}_x, \mathbf{F}_y) = (\mathbf{E}, \mathbf{G})\).
We have written \(\mathbf{\vec{F}}\) and \(\mathbf{S}\) in \(\eqref{2}\) in a way that emphasizes that these functions depend on the solution vector \(\mathbf{U}\).
Spatial Discretization
We can rewrite the shallow water equations in a form more convenient for numerical treatment by defining a computational domain \(\Omega\) bounded by a piecewise linear closed curve \(\Gamma = \partial\Omega\).
We create a discrete representation by partitioning \(\Omega\) into disjoint cells, with \(\Omega_i\) representing cell \(i\). The boundary of cell \(i\), written \(\partial\Omega_i\), is the set of faces separating it from its neighboring cells. Using this notation, we obtain a discrete set of equations for the solution in cell \(i\) by integrating \(\eqref{1}\) over \(\Omega_i\) and using Green's theorem:
This equation can be used to approximate discontinuous flows, because all quantities appear under integrals. By contrast, \(\eqref{1}\) cannot be used where derivatives of \(\mathbf{U}\) don't exist.
We can interpret the line integral in \(\eqref{3}\) in terms of the flux \(\mathbf{\vec{F}} = (\mathbf{F}_x, \mathbf{F}_y)\) between a cell \(i\) and its neighboring cells.
Here, we have defined a unit normal vector \(\vec{n} = (n_x, n_y)\) pointing outward along the cell boundary \(\partial\Omega_i\). \(\eqref{4}\) is a "surface integral" with a differential arc length \(dl\) integrated over the boundary of cell \(i\). One obtains this surface integral by integrating \(\eqref{2}\) over the domain \(\Omega\) and applying the (two-dimensional) divergence theorem to the flux term.
In the rest of this section, we use the flux form \(\eqref{4}\) of the shallow water equations.
We can obtain a finite volume method for these equations by defining horizontally-averaged quantities for flow depth and velocities:
where \(A_i = \int_{\Omega_i}d\Omega_i\) is the area enclosed within cell \(i\). We also introduce the horizontally-averaged solution vector
and the horizontally-averaged source vector
Finally, we define the face-averaged normal flux vector between cell \(i\) and an adjoining cell \(j\):
where \(l_{ij}\) is the length of the face connecting cells \(i\) and \(j\).
With these definitions, the shallow water equations in cell \(i\) are
where the index \(j\) in each term of the sum refers to a neighboring cell of cell \(i\).
Boundary conditions
To incorporate boundary conditions, we partition the domain boundary \(\Gamma\) into disjoint line segments, each of which represents a boundary face \(\Gamma_i\). Every cell \(j\) that touches the boundary \(\Gamma\) has at least one boundary face. Such a cell is a boundary cell. The boundary \(\Gamma\) consists entirely of faces of boundary cells.
In dealing with boundary conditions, we must distinguish between the faces a boundary cell \(i\) does and does not share with the boundary \(\Gamma\):
To enforce boundary conditions, we must compute the effective boundary fluxes \(\mathbf{F}_{ij}^{\Gamma}\) that appear in the first sum in \(\eqref{7}\). These boundary fluxes have specific forms depending on their respective boundary conditions.
Evaluating normal fluxes
We have reduced the spatial discretization of our finite volume method to the calculation of normal fluxes between neighboring cells and on boundary faces. The normal flux function is
We can evaluate \(\mathbf{F}_{ij} \approx \mathbf{\vec{F}}\cdot\vec{n}\), the approximate normal flux at a face shared shared by interior cells \(i\) and \(j\), by solving the relevant Riemann problem using Roe's method. If we designate \(\phi\) as the angle between \(\vec{n}\) and the \(x\) axis and adopt \(i\) and \(j\) subscripts for quantities respectively in cells \(i\) and \(j\), we can approximate the normal flux by the expression
where \(\Delta f\) is the variation of the quantity of \(f\) along a face. In particular,
where
\(\Delta f = f_j - f_i\) is the change in the quantity \(f\) moving from cell \(i\) to \(j\), and \(w_\parallel = \vec{w}\cdot\vec{n}\) and \(w_\perp = |\vec{w} - w_\parallel \vec{n}|\) for any vector \(\vec{w}\).
We have used asterisks in the expression for \(|\mathbf{\hat{\Lambda}}|\) to indicate that the eigenvalues \(\hat{\lambda}_1 = \hat{u}_\perp - \hat{a}\) and \(\hat{\lambda}_3 = \hat{u}_\perp + \hat{a}\) must be adjusted, since Roe's method does not provide the correct flux for critical flow.
Source terms
Recall that there are three source terms \(\mathbf{S}_r\), \(\mathbf{S}_b\), and \(\mathbf{S}_f\). In this section, we write the source terms for the momentum vector as \(\mathbf{S}_b = [0, \mathbf{\vec{S}}_b]^T\) and \(\mathbf{S}_f = [0, \mathbf{\vec{S}}_f]^T\) because their second and third components correspond to the spatial components of the momentum vector.
Net runoff production \(\mathbf{S}_r\)
This source term contributes only to height of the water, and is expressed as \(\mathbf{S}_r = [Q_r, 0, 0]^T\), where \(Q_r\), the net runoff production, with units of water height per unit time, is
- a constant
- a spatially homogeneous time-dependent function \(Q_r(t)\), or
- a spatially heterogeneous time-dependent function \(Q_r(x, y, t)\).
In any case, we can approximate the integral of this term using the mean value theorem of calculus:
where \(A_i\) is the area of cell \(i\).
Bed elevation slope term \(\mathbf{S}_b\)
This term represents the force of gravity on the water and can be approximated as
where \(\nabla z = (\partial z/\partial x, \partial z/\partial y)\) is the two-dimensional gradient of the bed elevation function \(z\).
For a triangular grid cell,
Bed friction roughness term \(\mathbf{S}_f\)
Like the runoff term, this term involves only quantities within a single cell and can be approximated by the mean value theorem:
where \(C_D = g n_i^2 h_i^{-1/3}\) and \(\vec{u}_i = (u, v)\) are, respectively, the drag coefficient and the flow velocity vector in cell \(i\). The \(x\) and \(y\) spatial components of \(\mathbf{\vec{S}}_f\) contribute to the second and third components of the source term.
Temporal Discretization
The above spatial discretization produces a "semi-discrete" system of equations that can be integrated using various methods for solving systems of ordinary differential equations. The following methods of integration are provided by PETSc and supported for RDycore: