1 Introduction

An important aspect in 3D ocean modelling is the choice of the vertical coordinate system. Three distinct types of vertical coordinates are, in general use, geopotential z-level coordinates, terrain-following σcoordinates and isopycnal coordinates. There is no single coordinate system that is suitable for all applications, as each of these coordinate systems has its own advantages and disadvantages. Here we are interested in coastal ocean modelling and, in particular, in accurately simulating flows in the shallow near shore region, including flooding and drying problems. It is in this region that exchange between the land and ocean occurs; it is a region of increasing importance to oceanographers.

Isopycnal coordinates have been successfully used in large-scale ocean models, such as Miami Isopycnic Coordinate Ocean Model (Bleck et al. 1992) and Hallberg Isopycnic Model (Hallberg 1997). These are capable of retaining sharp interfaces and fronts. In the coastal regions, however, the layers of predefined constant density must be able to collapse into one layer under well-mixed conditions and to inflate into a number of layers under stratified conditions. Together with weak ability to simulate surface and bottom boundary layers, this limits the use of isopycnal coordinates in coastal models.

The main advantage of the σ-coordinate system is the fact that it is fitted to both the moving free surface and bottom topography. This allows one to accurately approximate the vertical flow distribution without a large number of vertical grid points. The terrain-following coordinates allow an efficient grid refinement near the free surface and the bed, which makes it easy to resolve the boundary layers. However, a systematic error in the calculation of the baroclinic pressure gradient terms can arise in regions with steep topography and sharp density gradients when using σ-coordinates. A number of methods exist to reduce the pressure gradient error; some of them are summarised in Stelling and Van Kester (1994) and Kliem and Pietrzak (1999).

Efforts are now underway to create generalised and hybrid coordinate models, such as Hybrid Coordinate Ocean Model (Bleck 2002; Burchard and Petersen 1997), that can employ appropriate coordinates in different regions. Alternative vertical coordinate systems are also being explored. Adcroft and Campin (2004) propose a rescaled height coordinate system which is essentially height-based but shares some similarity with σ-coordinates. Halyer and Lermusiaux (2010) employ time-dependent, terrain-following coordinates. They first define a set of terrain-following depths for the mean sea level and then a set of time variable model depths such that the change in cell thickness is proportional to the relative thickness of the original (undisturbed) cell.

Geopotential z-level coordinates do not suffer from the pressure gradient error associated with σ-coordinates. The main problem with z-level models are connected with flow along a sloping bottom and surface. In this case, the stepwise discontinuous representation of the topography and free surface can generate false flow structures, which we refer to here as the staircase problem. The treatment of the bottom topography can be improved by using a finite volume discretisation which allows one to use variable bottom layer thickness (partial cells) or shaped volumes (“shaved” cells) as proposed by Adcroft et al. (1997). However, as shown here, this is not the complete solution.

The z-coordinates are referenced to a time mean water level. The free-surface displacement moves relative to this coordinates system and is to be implemented as a moving boundary. In Griffies et al. (2001) and Campin et al. (2004), this is done by allowing the top model layer to vary in thickness. The free-surface variation, however, must be smaller than that of the top layer thickness. This becomes a serious limitation with increasing vertical resolution and in shallow regions where extensive flooding and drying can take place. A model can be coded to allow the top layer to vanish as it is done in Delfin (Ham et al. 2005) or to become dry as in SUNTANS (Fringer et al. 2006). The second layer then takes on the role of the surface layer with variable thickness. The major difficulty here is to make the transition of a vanishing layer smooth enough to avoid the staircase problem which leads to the generation of false currents, stability and conservation problems.

In a large-scale hydrostatic model, a vertical structure of the flow must be created only due to physical mechanisms such as sheer stress or complex bottom profiles yielding flow separation. Without that, the results of 2D and 3D models should be identical. Therefore, special attention is required for the discretisation of the momentum equation in the 3D case.

The staircase problem can be avoided by using a semi-Lagrangian advection scheme, such as the schemes by Casulli and Walters (2000) and Ham et al. (2005). This approach is, however, unable to provide momentum conservation and, thus, it is not suitable for the modelling of rapidly varied shallow water flows as typically found in flooding situations, for example, dam break problems or tsunamis. Other schemes, such as the schemes of Fringer et al. (2006) and Stuhne and Peltier (2009) both employing the Eulerian advection scheme by Perot (2000), have the staircase problem. Indeed, the model of Fringer et al. (2006) does not conserve momentum in the cells that contain the free surface. SUNTANS is, however, mainly used for internal gravity wave simulations, and the free surface dynamics are not their main concern. Stuhne and Peltier (2009) in their 3D global M 2 tide simulation note deterioration of results in the coastal regions compared to their 2D simulation.

In this paper, we show how we can design an Eulerian advective approximation which solves the staircase problem and prevents the model from creating an artificial vertical structure. To show the strength of this approach, we even apply it to dam break problems. Although the staircase problem is not related to the choice of the horizontal discretisation as such, in the C-grid class of models, an artificial vertical structure can also be created due to the Coriolis force, since in this class of models a tangential velocity reconstruction has to be used.

The paper is organised as follows: the shallow water equations are described in Section 2 and the general model description is given in Section 3. Section 4 describes the two discretisations of the advection term, as proposed by Perot (2000) and Kramer and Stelling (2008). The scheme of Kramer and Stelling (2008) is generalised for the multi-layer case. In Section 5, we compare the behaviour of the advection schemes using a number of 2D test cases. In Section 6, we show how an artificial vertical structure in the flow can be created. Next we propose a local layer remapping procedure which allows one to remove the staircase problem thus preventing the model from unphysical behaviour. The proposed procedure also deals with the vanishing layer case, thus allowing one to simulate flooding and drying phenomena in the presence of multiple z-layers. Conclusions are given in Section 7.

2 Basic equations

Coastal flows may be modelled using the shallow water equations, a well-known simplification of the Navier–Stokes equations. The shallow water equations are derived under the following assumptions about the flow:

  • Vertical accelerations are small compared with gravity, that is, the pressure p is assumed to be hydrostatic.

  • Density differences are small compared to the reference density ρ 0, and hence, the density ρ may be assumed to be constant except in the pressure gradient term.

In this paper, we do not consider the effects of density differences so the density cancels out of the pressure gradient term. In common with similar models (Casulli and Walters 2000; Baptista et al. 2005), we also disregard horizontal mixing.

Let d be any unit vector in the horizontal plane and let u d  = ud. Then the shallow water equations may be written as follows:

$$ \begin{array}{rll} &&\nabla\cdot{\bf u}=0 \\ && {\displaystyle \frac{\partial u_{\bf d}}{\partial t}\!+\!{\bf u}\!\cdot\!\nabla u_{\bf d} \!+\!g\nabla_{xy}\eta \cdot {\bf d}\!+\! \frac{\partial}{\partial z} \nu^v\frac{\partial u_{\bf d}}{\partial z}\!+\! (2{\bf \Omega}\!\times\! {\bf u})\!\cdot\!{\bf d}=0} \end{array} $$
(1)

where u denotes velocity vector, η is the free surface elevation, ν v is the vertical viscosity and Ω is the Earth’s rotation vector.

Assuming bottom impermeability, the normal component of the velocity at the sea bed must vanish. This is expressed by the following kinematic condition:

$$ w=\frac{Db}{Dt}={\bf u}^{xy}\cdot\nabla_{xy}b \qquad \mbox{at } z=b $$
(2)

where b(x, y) is the bottom height. Here we assume that the vertical coordinate z is pointing upwards and has its origin at the mean sea level. Thus, the total water depth h(x, y, t) is defined as h(x, y, t) = η(x, y, t) − b(x, y).

The kinematic condition at the free-surface is given by

$$ w=\frac{D\eta}{Dt}=\frac{\partial\eta}{\partial t}+ {\bf u}^{xy}\cdot\nabla_{xy}\eta \qquad \mbox{ at } z=\eta $$
(3)

Here \(\frac{D}{D t}=\frac{\partial}{\partial t}+{\bf u}\cdot\nabla\) is the Lagrangian or material derivative with \(\nabla\) being the gradient operator. In this case, a 2D field is encountered; we write \(\nabla_{xy}\) to indicate the 2D gradient operator.

The kinematic boundary conditions 23 may be used in combination with the continuity equation integrated over the water column to produce the following expression for the free surface:

$$ \frac{\partial\eta}{\partial t}+\frac{\partial}{\partial x}\left[\,\int\limits_{b}^{\eta}u dz\right]+ \frac{\partial}{\partial y}\left[\,\int\limits_{b}^{\eta} v dz\right]=0 $$
(4)

3 Model description

We consider a discretisation on triangular meshes for which the component of velocity normal to each mesh edge is stored at the centre of the edge and the surface elevation is stored at the circumcentre of each triangle. The continuity equation is discretised using a finite-volume scheme with a single triangle as the control volume, while the pressure gradient term is discretised using a form of finite-difference scheme.

The following grid notations are adopted (see Fig. 1). We use index c to refer to a column of the grid and index f to refer to a column side. The index k is reserved to refer to the layer of a given cell. The layer of a horizontal face above level k is \(k+\frac12\), and the layer below is naturally \(k-\frac12\). This numbering is physically consistent in that \((k+1)-\frac12=k+\frac12.\) The length of the column side f is referred to as l f . A face belonging to a column side f and lying on a vertical level k we denote as f k . Similarly, c k denotes the cell at a vertical level k of the column c. Height of the face f k is denoted as h f,k, whereas h f refers to the total water depth at the column side f. Similarly, h c and h c,k refer to the water depth at the centre of the column c and to the height of the cell c k in this column. A c denotes the water column cross-section area, that is, the area of the (triangular) base of the column c.

Fig. 1
figure 1

Grid fragment together with the grid notations

Following Casulli and Walters (2000), the model treats the barotropic pressure gradient, the vertical viscosity in the momentum equations and the divergence term in the continuity equation implicitly and all other terms explicitly. The explicit treatment of the advection and Coriolis terms makes the velocity sub-matrix block tridiagonal which can be inverted using fast direct methods. This allows efficient elimination of the velocity variables from the continuity equation resulting in a linear implicit system for the free surface elevation.

We choose a semi-implicit θ-scheme as the temporal discretisation of the free surface equation. The momentum equation is solved for the velocity component normal to each cell face. The advection and Coriolis operators are dealt explicitly relative to the pressure term. For the time evolution of the pressure gradient, we adopt the same θ-method chosen for the free surface equation. A detailed description of the model can be found in Ham et al. (2005).

Friction terms are currently disregarded. Thus, we arrive at the following set of discrete equations:

$$ \begin{array}{rll} A_c\eta_c^{n+1}&=&A_c\eta_c^n-\theta\Delta t\sum\limits_{\scriptscriptstyle f}\left(s_{f,c}l_f \sum\limits_{\scriptscriptstyle k}h_{f,k}^nu^{n+1}_{f,k} \right) \\ &&-\,(1-\theta)\Delta t\sum\limits_{\scriptscriptstyle f}\left(s_{f,c}l_f \sum\limits_{\scriptscriptstyle k}h_{f,k}^nu^n_{f,k} \right)=0 \\ u_{f,k}^{n+1}&=&u_{f,k}^n+\Delta t a^n_{f,k}+F({\bf u})^n_{f,k} \\ &&-\,g\Delta t\big(\theta G_f^{n+1}+(1-\theta) G_f^n\big) \end{array} $$
(5)

where \(u^n_{f,k}\) is the horizontal velocity component in the direction n f normal to the f-th column side of the grid, at the time level n.

Function s f,c is defined for each column side and column such that it is equal to 0 if column c does not contain column side f, 1 if it does and the normal n f at f is the outer one with respect to c, and it is −1 if the normal is the inner one.

Here G is a linear operator for pressure gradient term. The operators a and F are explicit operators which account for the contribution from the discretisation of the momentum advection and Coriolis force, respectively. We use the 3D order Adams–Bashforth scheme for time integration of the Coriolis term; the momentum advection term is integrated using explicit Euler scheme.

The C-grid models only solve for the component of velocity normal to a face. Therefore, in order to evaluate the Coriolis term, it is necessary to interpolate the tangent velocity at the centre of a cell face as a linear combination of normal velocity components of the nearby faces. Following Perot (2000), first the full velocity vector u c,k in the cell interior is reconstructed. Next the velocity vector u f,k at the face centre is reconstructed by taking a linear combination of the velocity vectors located at the centres of the two cells adjacent to the face.

$${ {\bf u}_{c,k}=\sum\limits_{\scriptscriptstyle {f_k}}\delta_{f_k,c_k}d_{f,c}\frac{h_{f,k}l_f} {h_{c,k}A_c}{ u}_{f,k}{\bf n}_f} $$
(6)
$$ { {\bf u}_{f,k}=\sum\limits_{\scriptscriptstyle {c_k}}\delta_{f_k,c_k}\frac{d_{f,c}}{d_f}{\bf u}_{c,k}} $$
(7)

The function \(\delta_{f_k,c_k}\) is defined for each face and cell such that it is equal to 0 if cell c k does not contain face f k and 1 if it does. A detailed description of the spacial discretisation of the Coriolis term we use is given in Kleptsova et al. (2009). In the section below, we focus on the spacial discretisation of the advection operator a.

To implement flooding and drying, it is a common practice to mask a column c as dry if its water depth h c becomes less than a threshold value. Following Stelling and Duinmeijer (2003), we define water depth h f at a column side f using the first-order upwinding as follows:

$$ h_f=\left\{ \begin{array}{ll} h_{c1} \mbox{ if } s_{f,c1}u_f>0 \\[4pt] h_{c2} \mbox{ if } s_{f,c2}u_f<0 \\[4pt] \max(\eta_{c1},\eta_{c2})-\max(b_{c1},b_{c2}) \mbox{ if } u_f=0 \\ \end{array} \right . $$
(8)

The column side f is then masked as dry and the velocity u f at the column side is set to zero once the water depth h f becomes less than a prescribed threshold value h min. Thus, the water depth used to calculate outgoing fluxes of a column c is that of the column itself. Therefore, there will never be a flux out of a dry column. Stelling and Duinmeijer (2003) show that non-negative water depth is ensured if:

$$ \frac{\Delta t u^n_f}{\Delta x}\le 1 $$
(9)

4 Advection

In this section, we consider two Eulerian advection schemes. The first scheme was proposed by Perot (2000) for Navier–Stokes equations. The second scheme based on the scheme by Perot (2000) was derived by Kramer and Stelling (2008) for the depth-integrated and depth-averaged shallow water equations.

4.1 Advection discretisation by Perot (2000)

Following Perot (2000), first a finite-volume discretisation a c,k of the cell-based advection term is derived by integrating the vector \(\boldsymbol{\nabla}\cdot({\bf u}{\bf u}) = {\bf u}\cdot[\nabla u, \nabla v, \nabla w ]\) over a cell using the Gauss’ theorem

$$ \int\limits_{\Omega^3}\boldsymbol{\nabla}\cdot({\bf u}{\bf u})dV= \int\limits_{\partial\Omega}{\bf u}({\bf u}\cdot{\bf N})dS $$
(10)

Assuming a prismatic cell with the base area A c and height h c,k, this yields

$$ \begin{array} {rll} A_{c}h_{c,k}{\bf a}_{c,k}&=& {\displaystyle \sum\limits_{f_k}} s_{f,c}h_{f,k}l_f{ u}_{f,k}{\bf u}_{f,k} \\ &&+ \left[A_c{\bf u}_{c,k+\frac12}\big({\bf u}_{c,k+\frac12}\cdot{\bf n}_{c,k+\frac12}\big)\right. \\ &&{\kern12pt}\left.-A_c{\bf u}_{c,k-\frac12}\big({\bf u}_{c,k-\frac12}\cdot{\bf n}_{c,k-\frac12}\big)\right] \end{array} $$
(11)

where \({\bf n}_{c,k\pm\frac12}\) are the upward pointing vectors normal to the “horizontal” faces of the cell and attached at the centres of the faces. The face velocity vectors u f,k are interpolated as given in Eqs. 6 and 7. The velocity vectors \({\bf u}_{c,k\pm\frac12}\) attached at the centres of the “horizontal” faces of the cell are interpolated as follows:

$$ \begin{array} {lll} &&{\displaystyle {\bf u}_{c,k-\frac12}=\frac{{h}_{c,k-1}}{{h}_{c,k-1}+{h}_{c,k} }{\bf u}_{c,k-1}+ \frac{{h}_{c,k}}{{h}_{c,k-1}+{h}_{c,k} }{\bf u}_{c,k}} \\ && {\displaystyle {\bf u}_{c,k+\frac12}=\frac{{h}_{c,k}}{{h}_{c,k}+{h}_{c,k+1} }{\bf u}_{c,k}+ \frac{{h}_{c,k+1}}{{h}_{c,k}+{h}_{c,k+1} }{\bf u}_{c,k+1}} \end{array} $$
(12)

Observe that the velocity component un normal to the “horizontal” faces of a cell is not, in general, equal to the vertical velocity component w, as can be seen from Fig. 2.

Fig. 2
figure 2

A water column top cell together with vertical and normal to the surface velocities

Integrating the 3D continuity equation in vertical from bottom to a vertical level \(z_{k+\frac12}\) and applying kinematic boundary condition 2 at the bed, we arrive at the following expression for the velocity normal to the “horizontal” faces of a cell:

$$ \big({\bf u}_{c,k+\frac12}\cdot{\bf n}_{c,k+\frac12}\big)=-\frac1{A_c}\sum\limits_{i=k_b}^ks_{f,c}h_{f,i}l_fu_{f,i} $$
(13)

where k b is the index of the column’s bottom layer.

Next the face normal component of the advection term is reconstructed out of a given set of the cell-based vectors a c , by taking the following linear combination:

$$ a_{f,k}=\sum\limits_{{c_k}}\delta_{f_k,c_k}\alpha_{f,c} ({\bf a}_{c,k}\cdot{\bf n}_f) $$
(14)

The weighting coefficients α f,c are defined by Perot (2000) as

$$ \alpha_{f,c}=\frac{d_{f,c}}{d_f} $$
(15)

Other definitions of the weighting factors are possible (see, for example, Wenneker et al. 2002). Influence of the weighting factors on the performance of the depth-integrated scheme is examined in Kramer and Stelling (2008).

Thus, the advection component normal to the face j k shown in Fig. 3 can be written as

$$ \begin{array}{rll} \displaystyle a_{j,k}&=&\sum\limits_{\scriptscriptstyle {c_k}}\delta_{j_k,c_k}\alpha_{j,c} \frac1{A_{c}h_{c,k}} \\ [-6pt] &&\cdot\,\left[ \sum\limits_{\scriptscriptstyle{f_k}} s_{f,c}{h_{f,k}l_f}u_{f,k}({\bf u}_{f,k}\cdot{\bf n}_j)\right. \\ [-6pt] &&{\kern17pt}-\displaystyle \left(\!\big({\bf u}_{c,k+\frac12}\!\cdot\!{\bf n}_j\big)\!\sum\limits_{i=k_b}^k\!s_{f,c}h_{f,i}l_fu_{f,i}\right. \\ [-6pt] &&{\kern33pt}\left.\left.-\big({\bf u}_{c,k-\frac12}\!\cdot\!{\bf n}_j\big)\!\!\sum\limits_{i=k_b}^{k-1}\!s_{f,c}h_{f,i}l_fu_{f,i}\!\right)\!\!\right] \end{array} $$
(16)
Fig. 3
figure 3

The control volume (shaded area) used to discretise the horizontal momentum equation at face j, showing the plan form (left) and side (right) views

In single layer case (k = 1), the horizontal velocity field is assumed to be constant in the vertical. In this case, cells c 1 and faces f 1 correspond to columns c and column sides f. Therefore, height of the cells and faces become equal to the water depth at the respective columns and column sides. Thus, the Eq. 16 reduces to

$$ a_j=\sum\limits_{{c}} \delta_{j,c}\alpha_{j,c} \sum\limits_{{f}} s_{f,c}\frac{h_f\/l_f}{A_ch_c}u_f({\bf u}_f-{\bf u}_c)\cdot{\bf n}_j $$
(17)

4.2 Advection discretisation by Kramer and Stelling (2008)

In Kramer and Stelling (2008), another discretisation of the advection term a j for the depth-averaged equations (i.e. for one-layer case) is presented. This scheme is a combination of the unstructured grid variant of the advection scheme by Stelling and Duinmeijer (2003) with the advection scheme by Perot (2000) described above.

$${a}_j=\sum\limits_{{c}} \delta_{j,c} \alpha_{j,c} \sum\limits_{{f}} s_{f,c}\frac{h_f\/l_f}{A_c\bar{h}_j}u_f({\bf u}^*_f\cdot{\bf n}_j- u_j) $$
(18)

The water depth \(\bar{h}_j\) at the column side (face) j is defined as

$$ \bar{h}_j=\sum\limits_c\alpha_{j,c}h_c $$
(19)

The vector \({\bf u}^*_f\) is the full velocity vector at the column side (face) f reconstructed out of the velocity components from the column (cell) c * upwind of column side (face) f as given in Eq. 6, that is,

$${\bf u}^*_f={\bf u}_{c*} $$
(20)

If the upwind column (cell) is the one containing the column side (face) j, \({\bf u}_f^*\cdot{\bf n}_j\) is approximated as u j . Thus, the fluxes going out of the column (cell) can be omitted without changing of momentum.

This scheme was originally derived applying the Perot (2000) scheme to the depth-integrated velocities h u and rewriting it for the depth-averaged velocities. This was done using the equivalence between the depth-integrated and the depth-averaged momentum equations and the fact that time derivative of h u can be split into a contribution from the change in water volume and a contribution from the change in velocity.

In the case of multiple layers, the contribution from the change in velocity corresponds to the contribution from the vertical faces of the cell; the contribution from the change in water volume corresponds to the contribution from the “horizontal” faces. Thus, to obtain a multi-layer version of scheme by Kramer and Stelling (2008), we can use the following cell-based advection vector a c,k(j k ) calculated for a face j k of the cell c k (the analogue of Eq. 11)

$$ \begin{array}{rll} A_{c}{\bar h}_{j,k}{\bf a}_{c,k}(j_k)&=&{\displaystyle \sum\limits_{f_k}} s_{f,c}h_{f,k}l_f{ u}_{f,k}{\bf u}^*_{f,k} \\ [-2pt] &&+\,A_c{\bf u}_{j,k+\frac12}\left({\bf u}_{c,k+\frac12}\cdot{\bf n}_{c,k+\frac12}\right) \\ [-2pt] &&-\,A_c{\bf u}_{j,k-\frac12}\left({\bf u}_{c,k-\frac12}\cdot{\bf n}_{c,k-\frac12}\right) \end{array} $$
(21)

with

$$ \begin{array}{rll} &&{\displaystyle {\bf u}_{j,k-\frac12}=\frac{\bar{h}_{j,k-1}}{\bar{h}_{j,k-1}+\bar{h}_{j,k} }{\bf u}_{j,k-1}+ \frac{\bar{h}_{j,k}}{\bar{h}_{j,k-1}+\bar{h}_{j,k} }{\bf u}_{j,k}} \\ &&{\displaystyle {\bf u}_{j,k+\frac12}=\frac{\bar{h}_{j,k}}{\bar{h}_{j,k}+\bar{h}_{j,k+1} }{\bf u}_{j,k}+ \frac{\bar{h}_{j,k+1}}{\bar{h}_{j,k}+\bar{h}_{j,k+1} }{\bf u}_{j,k+1}} \end{array} $$
(22)

Thus, the multi-layer version of the advection scheme 18 can be written as follows:

$$ \begin{array}{rll} \displaystyle a_{j,k}&=&\sum\limits_{c_k} \delta_{j_k,c_k} \alpha_{j,c} \sum\limits_{f_k} s_{f,c}\frac1{A_c\bar{h}_{j,k}}\left[\!\vphantom{\left(u_{j,k+\frac12}\sum\limits_{i=k_b}^kh_{f,i}l_fu_{f,i}- u_{j,k-\frac12}\sum\limits_{i=k_b}^{k-1}h_{f,i}l_fu_{f,i}\right)} h_{f,k}l_fu_{f,k}({\bf u}^*_{f,k}\!\cdot\!{\bf n}_j)\right. \\ [-6pt] &&\left.\displaystyle -\left(u_{j,k+\frac12}\sum\limits_{i=k_b}^kh_{f,i}l_fu_{f,i}\!-\! u_{j,k-\frac12}\sum\limits_{i=k_b}^{k-1}h_{f,i}l_fu_{f,i}\right)\!\right] \end{array} $$
(23)

with k b being the index of the column’s bottom layer.

The advection schemes described above will be compared using a number of 2D test cases in the section below.

5 Test cases

All of the simulations described in this section are performed with one layer in vertical, that is, the advection term is discretised according to Eqs. 17 and 18.

5.1 Kelvin wave test case

If the water depth is (locally) close to uniform, then the water depth at a column side (height of a face) is approximately equal to that at the neighbouring columns (cells). Similarly, a cell (column)-based velocity vector projected in the direction normal to a face of the cell (normal to a side of the column) is approximately equal to the face (column side) normal velocity component if the flow velocity is (locally) close to uniform. Thus, the advection schemes described above will behave similarly in the test cases with no sudden changes in water depth and flow velocity.

To illustrate this, we use a Kelvin wave in a shallow circular basin test case, described in Ham et al. (2005). The basin was given a uniform depth of 5 m. The initial state chosen was:

$$ \begin{array}{lll} &&\eta(r,\theta)=0.05 e^{(r-r_0)/L_D}\cos{\theta} \\ && u_{\theta}(r,\theta)=0.05\sqrt{g/h} e^{(r-r_0)/L_D}\cos{\theta} \\ && u_r(r,\theta)=0 \end{array} $$
(24)

where L D is the Rossby radius, in this case approximately 68 km, and r 0 = 250 km is the basin radius. In the limiting case of an infinitely large basin, this is the expression for a Kelvin wave of amplitude 5 cm. The simulation was performed at a specified latitude of 45°. Figure 4 shows the sea surface elevation after 1,666.6 h. As expected, the results obtained using different advection schemes are identical up to visible precision.

Fig. 4
figure 4

Kelvin wave in a circular basin: the sea surface elevation after 1,666.6 h calculated using the advection scheme by Perot (2000) (left) and Kramer and Stelling (2008) (right)

5.2 Dam break test case

A dam break is calculated in a 100-m-long and 10-m-wide channel. At t = 0, the shock starts at x = 50 m with zero initial velocity and the upstream water level of 1 m. For the dam break over wet bed case, the water level downstream is 0.1 m. The nominal triangle edge length of the grid used is 2 m. The time step of 0.01 s was used for the simulation of the dam break over wet bed. The numerical solutions for the interval y ∈ (4, 6)m compared to the analytical solution are shown in Fig. 5. For the simulation of the dam break over dry bed, the time step was set to 0.001 s. Threshold value h min used to mask columns as dry was set to 2.5 mm. Comparison of the numerical solution for the interval y ∈ (4, 6)m to the analytical solution is shown in Fig. 6.

Fig. 5
figure 5

Dam break over wet bed: surface elevation and velocity calculated using the advection schemes given by Eq. 17 (top row) and Eq. 18 (bottom row) compared with the analytical solution (black line)

Fig. 6
figure 6

Dam break over dry bed: surface elevation and velocity calculated using the advection schemes given by Eq. 17 (top row) and Eq. 18 (bottom row) compared with the analytical solution (black line)

In both cases, the results obtained using the advection scheme similar to Kramer and Stelling (2008) given by Eqs. 18 and 23 show better agreement with the analytical solution than the scheme by Perot (2000) given by Eqs. 16 and 17. Besides that, the advection scheme by Kramer and Stelling (2008) leads to a smoother solution due to the first-order upwinding.

5.3 Tsunami run-up on a plane beach

Here we examine run-up and run-down motion of a tsunami-type transient wave onto a plane sloping beach with slope s = 1/10. The initial free surface shown in Fig. 7 is specified according to

$$ \begin{array} {rll} \eta&=&500\big(0.006e^{-0.4444(\frac{x}{\text{5,000}}-4.1209)^2} \\&&{\kern18pt}-0.018e^{-4.0(\frac{x}{\text{5,000}}-1.6384)^2}\big) \end{array} $$
(25)

which corresponds to the leading depression N-wave shape, typically caused by an offshore submarine landslide. This case corresponds to the case D in Carrier et al. (2003), who derived a general semi-analytic solution for such events based on nonlinear shallow water equations.

Fig. 7
figure 7

Tsunami run-up on a plane beach: a portion of the initial surface elevation given by Eq. 25 used in the tsunami run-up simulation

Upon the release of the initial wave form, tsunami-type waves propagate in both landward and offshore directions, though only the landward travelling wave runs up the beach. At the offshore boundary, a closed boundary condition is imposed. Since the computational domain is sufficiently long (50 km), this does not affect the run-up process on the other side of the domain.

Simulation was performed on an 8,681-node grid, with resolution varying from 8 m in the shallow region to 318 m in the deep water. The time step was set to 1 s. The columns were masked as dry if their water depth was less then h min = 1 cm. The initial velocity is set to zero everywhere. Figure 8 shows the comparison of the computed surface elevation against the analytical solution for t = 160, 175 and 220 s.

Fig. 8
figure 8

Tsunami run-up on a plane beach: comparison of the computed surface elevation profiles against the analytical prediction for t = 160 s (top), t = 175 s (middle) and t = 220 s (bottom)

Once again, the results obtained using the advection scheme similar to Kramer and Stelling (2008) given by Eqs. 18 and 23 agree with the analytical solution better than the ones obtained using the scheme by Perot (2000) given by Eqs. 16 and 17.

5.4 Parabolic flood wave

A water mass with a parabolic shape given by

$$ \eta_0=h_0\left(1-\frac{x^2+y^2}{R_0^2} \right) $$
(26)

is released on a flat bed without friction. Here R 0 = 50 km and h 0 = 2 km are the initial radius and the initial height of the water mass, respectively. The analytical solution of the test is given by (see Thacker 1981)

$$ \eta=h_0\left[ \frac{T^2}{t^2+T^2}-\frac{x^2+y^2}{R_0^2}\left(\frac{T^2}{t^2+T^2} \right)^2 \right] $$
(27)

Here

$$ T=\frac{R_0}{\sqrt{2gh_0}}=250~{\rm s} $$
(28)

is the time after which the initial height h 0 has been halved. Initially, the water mass is set at rest. The time step used is Δt = 2 s. The numerical solution for the cross section y = 0 compared with the analytical solution Eq. 27 for t = 200, 600 and 1,000 s is shown in Fig. 9.

Fig. 9
figure 9

Parabolic flood wave: comparison of the computed (dots) surface elevation profile against the analytical prediction (solid line) for t = 200, 600 and 1,000 s

In this case, the advection schemes by Perot (2000) and Kramer and Stelling (2008) give similar results which are in a good agreement with the analytical solution for the time t = 200 s. For the time t = 600 and 1,000 s, results obtained using the scheme by Kramer and Stelling (2008) are much better than that of the scheme by Perot (2000). Moreover, for this test case using of the advection scheme by Perot (2000) led to the model instability. Reducing the time step by the factor of 10 did not solve the stability problem. The results shown here were obtained with h c substituted by \({\bar h}_j\) in the denominator of Eq. 17. Some other experiments also show that substitution of \(\bar{h}_j\) in place of h c in Eq. 18 leads to increased stability and slightly better results.

6 Comments on the advection discretisation in the multi-layer case

The advection scheme by Perot (2000) has been used successfully in a number of unstructured grid models (see, for example, Stuhne and Peltier 2009 and Fringer et al. 2006). However, Stuhne and Peltier (2009) noticed that the results of their multi-layer simulation of the global M 2 tide were much worse in the coastal region than the same results but from a 2D simulation. Whereas the deep ocean amphidromic patterns are similarly resolved in both the 2D and 3D cases. Fringer et al. (2006) successfully use the advection scheme by Perot (2000) for internal wave simulations. They, however, claim that the advection scheme does not conserve momentum in the cells containing the free surfaces. This is quite a surprising statement given the good deep ocean results of Stuhne and Peltier (2009). A possible reason for the lack of conservation could be the use of the vertical velocity w in place of the velocity normal to the “horizontal” faces (see Fig. 2). If that is so, we should not see the deterioration of the results in the case of multiple layer simulation, since the normal velocity interpolation is used.

To assess this, we use a two-layer simulation of the dam break over a wet bed as described in Section 5. Simulations were performed using both the momentum advection schemes 16 and 23; however, only the results for the scheme 23 are shown. Figure 10 shows the surface elevation and the face velocity norm for the two layers at z 1 = 0.08 m and z 2 = 1.0 m above the bed.

Fig. 10
figure 10

Dam break over wet bed: surface elevation and velocity norm for the two-layer calculation compared with the analytical solution

Both the free surface and velocity are represented much worse here than in the one-layer simulation, shown in Fig. 5. Moreover, the calculated flow velocity differs across the layers, whereas it should be uniform. As can be seen, difference in the velocity norm between the layers for the faces on one column side is as high as 3.31 m/s.

Our conjecture is that the poor-free surface representation is caused by the artificial vertical structure in the flow, which is created solely due to the presence of vertical z-layers. For the z-layer models, the face heights are usually defined as h f,k = h c,k, and all of the cell heights h c,k are equal to each other everywhere except for the cells containing the free surface (and bed). Due to this, the contribution to the change of momentum from the change of velocity (contribution from the vertical faces in Eqs. 11 and 21 for the internal layers) is not the same as for the top and bottom layer. Similarly, the velocity reconstruction procedure (Eq. 6) for the internal layers is different from that for the top and bottom layer.

In the next section, using the momentum advection scheme 23 as an example, we show how one can prevent the model from creating artificial vertical structure in the flow.

6.1 Improved implementation of the advection term

In absence of bottom friction, the flow velocity should be constant in depth. That is, the momentum equation 5 should be identical for all of the layers. This means that advection and Coriolis operators for a particular layer should be the same as for the whole water column. This is possible if the ratio of a cell height to the height of its face is the same as the ratio of the respective column water depth to the column side water depth this face belong to. That is, the identity

$$ \frac{h_{f,k}}{h_{c,k}}=\frac{h_f}{h_c} $$
(29)

should be valid for all cells and faces.

Assume the situation shown in the left panel of Fig. 11: The column upwind of the column side j has three layers with heights h u,k, whereas the downwind column has only two layers with heights h d,k. Define for the downwind column adjacent to the column side j exactly three sub-layers whose thickness hd,k is determined by

$$ h'_{d,k}=\frac{h_{j,k}}{h_j}h_d $$
(30)

Since the water depth at the column side j is equal to that of the upwind column and h j,k = h u,k, the relation 29 holds automatically for the column side j and the upwind column. The heights of the other faces need to be redefined according to Eq. 29 for both of the columns.

Fig. 11
figure 11

The side view of the control volume (shaded area) used to discretise the horizontal momentum equation at face

With the above definition, the advection term a j,k given by Eq. 23 becomes

$$ \begin{array}{rll} \displaystyle a_{j,k'}&=&\sum\limits_{c_k'} \delta_{j_{k'},c_{k'}} \alpha_{j,c} \sum\limits_{f_k'} s_{f,c}\frac1{A_c\bar{h}_{j}}\left[\vphantom{\left(u_{j,k'+\frac12}\sum\limits_{i=k'_b}^{k'}h_{f}l_fu_{f,i}- u_{j,k'-\frac12}\sum\limits_{i=k'_b}^{k'-1}h_{f}l_fu_{f,i}\right)} h_{f}l_fu_{f,k'}({\bf u}^*_{f,k'}\cdot{\bf n}_j) \right. \\ && \left.\displaystyle -\left(u_{j,k'+\frac12}\sum\limits_{i=k'_b}^{k'}h_{f}l_fu_{f,i}- u_{j,k'-\frac12}\sum\limits_{i=k'_b}^{k'-1}h_{f}l_fu_{f,i}\right)\right] \end{array} $$
(31)

and the velocity reconstruction procedure (Eq. 6) reads as

$${\bf u}_{c,k'}=\sum\limits_f\delta_{f,c}d_f^{c}\frac{h_f\/l_f}{A_{c}h_{c}}u_{f,k'}{\bf n}_f $$
(32)

Here k′ refers to the index of the sub-layer, not the actual layer.

Note that the sub-layer 2 crosses two actual layers in the downwind column. In that case, the normal velocity component u f,k is approximated as

$$ u_{f,2'}=\frac{h'_{d,21}}{h'_{d,2}}{u_{f,1}}+ \frac{h'_{d,22}}{h'_{d,2}}{u_{f,2}} $$
(33)

where hd,21 and hd,22 are the heights of the parts of the sub-layer 2 belonging to the actual layers 1 and 2, respectively (see Fig. 11). Moreover, the same principle should be applied to the velocity reconstruction procedure (Eqs. 67) also used in the discretisation of the Coriolis term.

The two-layer simulation of the dam break over wet bed described above was repeated using the advection discretisation given by Eq. 31; the results are shown in Fig. 12. As can be seen, the free surface elevation is represented at least as well as in the one-layer case shown in Fig. 5. The difference in the velocity norm between the two layers for the faces on one column side is exactly 0.

Fig. 12
figure 12

Dam break over wet bed: surface elevation (left) compared with the analytical solution (black line) and the difference in velocity norm between the two layers

Simulation of a dam break over a dry bed as described in Section 5 was repeated using ten vertical layers located at z = 0.1, 0.2, 0.3, ..., 0.9 and 1.0 m above the bed. The resulting surface elevation and velocity norm for the bottom layer (shown in Fig. 13) are identical to that of the one-layer simulation (Fig. 6). The velocity norm for the other layers are equal to the velocity norm of the bottom layer in the locations where they are defined.

Fig. 13
figure 13

Dam break over dry bed: surface elevation (left) and the velocity norm for the bottom layer (right) compared with the analytical solution (black line)

All the other experiments from Section 5 were also repeated with multiple layers using the advection scheme 31. The results are not shown here since they are, as expected, identical to the one-layer case.

7 Discussion

Staggered C-grids has been used in a variety of unstructured grid models for large-scale ocean applications. The unstructured finite-volume scheme of Casulli and Walters (2000) combines a semi-implicit time integration of the equations with a semi-Lagrangian approach for the advection term. Such a scheme can be shown to be stable at any flow Courant number. This approach was also adopted in Delfin (Ham et al. 2005). The drawback of such schemes is that most implementations do not provide conservation of momentum and hence are not suitable for simulation of such phenomena as flooding and drying. Accurate simulations of flooding and drying are important for dam break problems and tsunami simulations.

Here we compare two Eulerian advection schemes, namely the scheme by Perot (2000) and Kramer and Stelling (2008) which we generalise to the 3D case. We show that the scheme of Kramer and Stelling (2008) gives better results for dam break problems.

We show that special attention is required to the discretisation of the momentum equation in the presence of multiple z-layers. It is a common practice to vary only the thickness of the top and bottom layers to represent the free surface and bathymetry variation. The thickness of the internal layers which do not contain the free surface and bed is kept constant. The heights of the faces for these layers are usually defined to be equal to the heights of the layers, thus replicating the flat bed case. We show that this generates a staircase problem which leads to inaccurate solutions and may erroneously introduce vertical structure in the flow.

A model must not create a vertical structure in the flow if there is no physical reason for that. Therefore, the discretised momentum equation for a particular layer should be identical to that of any other layer if phenomena such as bottom friction, viscosity and diffusion are disregarded. This means that heights of any two cells sharing a face should have the same ratio as the respective column heights. In addition, the ratio of the cells’ face heights should be the same as the ratio of the heights of the column sides. Here we propose to locally redefine/remap cells and faces in such a way that the above-mentioned conditions are fulfilled. The remapping procedure allows us to always have equal number of (sub)cells to the left and to the right of a particular column side, thus removing the discontinuities associated with the representation of the free surface and bathymetry as a series of steps. It also allows us to simulate flooding and drying phenomena in the presence of multiple z-layers.

In C-grid models, a discretisation of the Coriolis force may become an additional source for the staircase problem, since this class of models only solves for the component of velocity normal to a face and the tangential component is interpolated. Therefore, the same layer remapping procedure should be applied while reconstructing the tangential velocity in order to prevent the model from the creating artificial vertical structure due to the discretisation of the Coriolis term in the presence of multiple z-layers.

Open Access

This article is distributed under the terms of the Creative Commons Attribution Noncommercial License which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.