Generalized vertical coordinates
Often the numerics benefit from using a vertical coordinate that is different than
We denote any such generalized vertical coordinate that evolves with space and time as
Transforming the equations of motions (including their discrete analogues) in this new generalized coordinate involves a series of chain rules for partial differentiation. We have that for any field
The quantity
where the subscripts next to
The chain rules for differentiation with respect of
The horizontal spatial derivatives of the
so that the chain rule
Similarly, we get equivalent expressions for
Mass conservation
With the Boussinesq approximation, the mass conservation reduces to the flow being divergence-less, i.e.,
Using the chain rules above, the divergence of the flow in
We can rewrite
Note that
Then, the vertical velocity across the
With the definition of
which implies that the mass conservation is equivalent to:
Tracer equation
The evolution equation for a tracer
Using the same procedure we followed for the continuity equation, the left-hand-side of
We recover the time derivative of the tracer at constant
As such, the left-hand-side of
Including the vertical diffusion to the right-hand side we recover the tracer equation:
Momentum equations in vector invariant form
The horizontal momentum equations under the hydrostatic approximation read
where
The above is complemented by the hydrostatic relation
Of the above, the Coriolis term is independent of the vertical frame of reference and the viscous stress is treated similarly to the diffusion of a tracer. In this derivation we focus on:
Hydrostatic relation
Using the definition
Material derivative in vector invariant form
We set out to transform in
where
Here, we focus on the
Above, we utilized
Using the definition of
As done above for the tracer, the last term on the right-hand side, using the chain rule for the time derivative yields
Which completes the derivation of the
We can further split the vertical advection term into a conservative vertical advection and a horizontal divergence term:
and last using the continuity equation
Horizontal pressure gradient
The horizontal pressure gradients, e.g.,
and combined with the hydrostatic relation
The last term on the right hand side above describes the pressure gradient associated with the horizontal tilting of the grid. Similarly, the gradient of the free surface transforms to
Finite volume discretization
It is useful to describe how the above equations translate into discrete form in a finite volume staggered C-grid framework.
To do so, we integrate over the cell volume i, j, k below correspond to the x, y, and the vertical directions respectively.
Mass conservation
Using the notation for cell-averages
We use
where
Tracer equation
The tracer equation
leading to
where
For an explicit formulation of the diffusive fluxes and a time-discretization using forward Euler scheme, imply:
where z-grid.
Note that in case of a multi-step method, e.g., second-order Adams-Bashforth, the grid at different time-steps must be accounted for, and the time-discretization becomes
For this reason, we store the tendencies pre-multiplied by z-grid as if the grid was static, using the grid at