Hydrostatic model with a free surface
The HydrostaticFreeSurfaceModel solves the incompressible Navier-Stokes equations under the Boussinesq and hydrostatic approximations and with an arbitrary number of tracer conservation equations. Physics associated with individual terms in the momentum and tracer conservation equations – the background rotation rate of the equation's reference frame, gravitational effects associated with buoyant tracers under the Boussinesq approximation, generalized stresses and tracer fluxes associated with viscous and diffusive physics, and arbitrary "forcing functions" – are determined by the whims of the user.
Mass conservation and free surface evolution equation
The mass conservation equation is
Given the horizontal flow
The free surface displacement
The momentum conservation equation
The equations governing the conservation of momentum in a rotating fluid, including buoyancy via the Boussinesq approximation are
where
We can recast the advection term
with LatitudeLongitudeGrid or OrthogonalSphericalShellGrid.
The hydrostatic approximation
The terms that appear on the right-hand side of the momentum conservation equation are (in order):
momentum advection:
,Coriolis:
,baroclinic kinematic pressure gradient:
,barotropic kinematic pressure gradient:
,molecular or turbulence viscous stress:
, andan arbitrary internal source of momentum:
.
The tracer conservation equation
The conservation law for tracers is
where
From left to right, the terms that appear on the right-hand side of the tracer conservation equation are
tracer advection:
,molecular or turbulent diffusion:
, andan arbitrary internal source of tracer:
.
Vertical coordinates
We can use either ZCoordinate, that is height coordinate, or the ZStarCoordinate generalized vertical coordinate.
The ZStarCoordinate vertical coordinate conserves tracers and volume with the grid following the evolution of the free surface in the domain (Adcroft and Campin, 2004).
In terms of the notation in the Generalized vertical coordinates section, for a ZCoordinate we have that
and the specific thickness is
The ZStarCoordinate generalized vertical coordinate is often denoted as
where

Note that in both depth and
The ZStarCoordinate definition
All the equations transformed in
For the specific choice of ZStarCoordinate coordinate
An example of how the vertical coordinate surfaces differ for ZCoordinate and the time-varying ZStarCoordinate coordinate is shown below.
using CairoMakie
Lx, Lz = 1e3, 25 # m
x = range(-Lx/2, stop=Lx/2, length=200)
σ = Lx/15 # a horizontal length scale
# bottom, H(x)
x₀, h₀ = -Lx/3, 15 # m
slope = @. h₀ * (1 + tanh(-(x - x₀) / σ)) / 2
x₀, h₀ = Lx/3, 6 # m
mountain = @. h₀ * sech((x - x₀) / σ)^2
H = @. Lz - slope - mountain
# free surface, η(x)
x₀ = -Lx/8
η₀ = 2.5 # m
t = Observable(0.0)
η = @lift @. -η₀ * ((x - x₀)^2 / σ^2 - 1) * exp(-(x - x₀)^2 / 2σ^2) * cos(2π * $t)
fig = Figure(size=(1000, 400))
axis_kwargs = (titlesize = 20, xlabel = "x", ygridvisible = false)
ax1 = Axis(fig[1, 1]; title="ZCoordinate", ylabel="z", axis_kwargs...)
ax2 = Axis(fig[1, 2]; title="ZStarCoordinate", axis_kwargs...)
for ax in (ax1, ax2)
band!(ax, x, -H, η, color = (:dodgerblue, 0.5))
band!(ax, x, -1.1 * Lz, -H, color = (:orange, 0.2))
lines!(ax, x, η, linewidth=5, color=:darkblue)
lines!(ax, x, -H, linewidth=5, color=:darkgrey)
end
for r in range(-Lz, stop=0, length=6)
# ZCoordinate
z = r * ones(size(x))
lines!(ax1, x, z, color=:crimson, linestyle=:dash)
# ZStarCoordinate
z = lift(η) do η_val
@. r * (H + η_val) / H + η_val
end
lines!(ax2, x, z, color=:crimson, linestyle=:dash)
end
Nt = 50
times = 0:1/Nt:1-1/Nt # one period of cos(2πt)
CairoMakie.record(fig, "z-zstar.gif", times, framerate=12) do val
t[] = val
end
Near the top, the surfaces of ZStarCoordinate mimic the free surface. Further away from the fluid's surface, the surfaces of ZStarCoordinate resemble more surfaces of constant depth ZCoordinate.