Unstructured grid ocean models are advantageous for simulating the coastal ocean and river–estuary–plume systems. However, unstructured grid models tend to be diffusive and/or computationally expensive, which limits their applicability to real-life problems. In this paper, we describe a novel discontinuous Galerkin (DG) finite element discretization for the hydrostatic equations. The formulation is fully conservative and second-order accurate in space and time. Monotonicity of the advection scheme is ensured by using a strong stability-preserving time integration method and slope limiters. Compared to previous DG models, advantages include a more accurate mode splitting method, revised viscosity formulation, and new second-order time integration scheme. We demonstrate that the model is capable of simulating baroclinic flows in the eddying regime with a suite of test cases. Numerical dissipation is well-controlled, being comparable or lower than in existing state-of-the-art structured grid models.

Numerical modeling of the coastal ocean is important for many environmental and industrial applications. Typical scenarios include modeling circulation at regional scales, coupled river–estuary–plume systems, river networks, lagoons, and harbors. Length scales range from some tens of meters in rivers and embayments to tens of kilometers in the coastal ocean; water depth ranges from less than a meter to kilometer scale at the shelf break. The timescales of the relevant processes range from minutes to hours, yet typical simulations span weeks or even decades. The dynamics are highly non-linear, characterized by local small-scale features such as fronts and density gradients, internal waves, and baroclinic eddies. These physical characteristics imply that coastal ocean modeling is intrinsically multi-scale, which imposes several technical challenges.

Most coastal ocean models solve the hydrostatic Navier–Stokes equations under
the Boussinesq approximation – a valid approximation for mesoscale and
submesoscale (1 km) processes. Small-scale processes (

Historically, regional ocean models have used structured, (deformed)
rectilinear lattice grids. Although structured grids offer better
computational performance

In this article, we focus on solving the hydrostatic equations on an
unstructured grid. While many unstructured grid models exist, their drawbacks
tend to be excessive numerical diffusion that smooths out important physical
features

Maintaining high numerical accuracy is crucial in ocean applications. The
ocean is a forced dissipative system where the mixing of water masses only
takes place at the molecular level

In global circulation models, numerical mixing is a major bottleneck as
(diapycnal) diffusion is very low in the deep ocean basins and water masses
can remain largely unchanged for hundreds of years

The most common spatial discretization scheme is the finite volume (FV)
method, used in the MITgcm

Some unstructured grid models are based on the continuous Galerkin finite
element (FE) method or hybrid FE–FV formulations. Such models include ADCIRC

In recent years, discontinuous Galerkin (DG) methods have gained attention in
geophysical modeling

a vertically extruded, layered mesh;

accurate representation of free surface dynamics;

a second-order accurate, monotone tracer advection scheme;

explicit time integration of 3-D variables (except for vertical diffusion); and

low numerical mixing.

All numerical ocean models include some form of friction, either in the form
of a numerical closure or a physical parameterization

In this article, we present an efficient DG implementation of the
three-dimensional hydrostatic equations. The model is implemented in the
Thetis project – an open-source coastal ocean circulation model
freely available online (see

Thetis is implemented using the Firedrake finite element modeling platform

The governing equations are presented in Sect.

Let

The horizontal momentum equation reads

Under the hydrostatic assumption, the horizontal pressure gradient can be
written as a combination of external, internal, and atmospheric pressure
gradients:

Neglecting atmospheric pressure, the full horizontal momentum equation reads

At the bottom boundary, we impose quadratic bottom stress:

Following

The 2-D and 3-D modes are coupled using the additional term

In this paper, a linear equation of state is used:

Baroclinic flows require some form of viscosity to filter out grid-scale
noise. In this paper, we only consider Laplacian horizontal viscosity, set to
a constant

In most test cases, vertical viscosity is set to a constant. In certain
cases, we use the gradient Richardson number dependent parameterization by

This section describes the spatial discretization of the governing equations.
In Sect.

Prognostic and diagnostic variables and their function spaces.

The prognostic variables of the coupled 2-D–3-D system
(Eqs.

Our discretization is based on the linear discontinuous Galerkin function
space,

Achieving an accurate and monotone 3-D tracer advection scheme is one of our
main design criteria. The tracers, therefore, are also considered within a
discontinuous function space,

Note that this choice of function spaces is not mimetic

In the weak forms, we use the following notation for volume and interface
integrals:

Let

Let

Let

The weak formulation of the tracer equations is derived analogously: find

The presented discretization is unstable for elliptic operators, and the
diffusion operators require additional stabilization. Here, we use the
symmetric interior penalty Galerkin (SIPG) method

The vertical velocity

The water density is computed diagnostically using the equation of state. We
use the same

The baroclinic head is computed from Eq. (

Finally, taking a test function

We use vertex-based

The coupled 2-D–3-D system is advanced in time with a two-stage ALE time integration scheme. In this section, we present the ALE formulation and summarize the final time integration scheme.

To accurately account for the free surface movement, one must move the mesh in
the vertical direction. In this work, we adopt the ALE method

In three dimensions, an ALE update consists of solving an advection–diffusion
equation between two domains,

Let

The coupled 2-D–3-D system is advanced in time with a two-stage ALE time
integration scheme. For convenience, we rewrite the 3-D momentum and tracer
equations as

The explicit 3-D equations are advanced in time with a second-order SSP Runge–Kutta scheme, SSPRK(2,2)

When applied to the explicit 3-D momentum and tracer equations,
Eqs. (

After the SSPRK update, the implicit terms are advanced with the backward
Euler method. This step is computed in domain

The 2-D equations are advanced in time with an implicit scheme to circumvent
the strict time step constraint imposed by surface gravity waves. To ensure
consistency between the movement of the 3-D mesh and the 2-D mode, the 2-D time
integration scheme must be compatible with the aforementioned SSPRK(2,2)
method. Here, we use a combination of a forward Euler and trapezoidal steps:

The 2-D system is solved first, resulting in an updated elevation field
(

The time integration method is second order for all the terms. The whole algorithm is summarized in Algorithm 1.

The maximal admissible time step is constrained by the stability of the
coupled time integrator. The presented SSPRK(2,2) scheme has a CFL
(Courant–Friedrichs–Lewy) factor 1. The 2-D scheme
(Eq.

The horizontal advection term imposes a constraint:

Analogously, the time step constraint for vertical advection is

Given a horizontal viscosity scale

In the simulations presented herein, the minimal admissible time step is evaluated on the mesh based on constant a-priori velocity and viscosity scales. The time step is kept constant throughout the simulation.

We demonstrate the performance of the proposed discretization with a suite of test cases of increasing complexity. We first evaluate the conservation and convergence of the solver in a barotropic standing wave test case. The convergence of baroclinic terms is then examined in a specific steady-state test case. The baroclinic solver and its numerical mixing are then evaluated with a non-rotating lock exchange test case and a rotating baroclinic eddy test, followed by the Dynamics of Overflow Mixing and Entrainment (DOME) overflow test.

We first evaluate the performance of the solver in a barotropic standing wave
test case. The domain is a

The simulation is run for two full wave periods, approximately 3831.31 s.
To investigate tracer conservation and consistency properties, two
passive tracers are included: salinity is set to a constant 4.5 psu,
while temperature varies between 5.0 and 15.0

The domain was discretized with a split-quad mesh using 40 elements along the
channel (1500 m edge length) and four vertical layers. The time step is

During the simulation, the volume of the 3-D domain was conserved to accuracy

To investigate the order of convergence of the solver, we used a smaller
initial elevation perturbation (

Convergence of the

We ran the simulation, varying the horizontal mesh resolution between
3 km and 300 m; the number of vertical levels varied between 2
and 20. In each case, the channel was made one element wide, and the time step
was chosen to meet the CFL criterion for horizontal advection. At the end of
the simulation, the

Verifying model accuracy under baroclinic forcing is more challenging as no
analytical solutions are available. Here, we use the method of manufactured
solutions

Salinity is set to a constant 35 psu. We use the linear equation of
state (Eq.

Without any additional forcing, the initial conditions lead to a
time-dependent solution. Following the MMS strategy, we add analytical source
terms in the dynamic equations that cancel all the active terms in the
equations, leading to a steady-state solution. The remaining error is purely
the discretization error of the advection, pressure gradient, and Coriolis
operators. The source terms are derived analytically and projected to the
corresponding function space. The analytical formulae are given in
Appendix

The coarsest mesh contains four elements both in

The variation of the

Convergence of the

The validity of the baroclinic solver and its level of spurious mixing is
investigated with the standard lock exchange test case

Stabilizing the internal pressure gradient requires some form of friction. To
this end, we apply a constant Laplacian horizontal viscosity, using values

Figure

Assuming that, in the absence of bottom friction, all available potential
energy is transformed into kinetic energy, the maximum front propagation
speed can be estimated as

Figure

Water density in the lock exchange test case in the center of the
domain (

Diagnostics of the lock exchange test.

To diagnose the role of spurious mixing, we use the reference potential energy
(RPE;

In order to investigate the role of the Lax–Friedrichs flux on numerical
mixing, we ran the lock exchange test case with zero viscosity. After 17 h of
simulation, the RPE value was approximately

We investigate the model's ability to generate baroclinic eddies with the
eddying channel test case of

Initially, the domain is linearly stratified with warmer water at the
surface. In addition, the northern half of the domain is warmer, with a
narrow sinusoidal transition band separating the warm (northern) and cold
(southern) water masses (Fig.

The baroclinic Rossby radius of deformation is 20 km

As the simulation progresses, baroclinic eddies develop at the center of the domain, quickly propagating elsewhere. This is a spin-down experiment, i.e., the domain is a closed system with no forcing at the boundaries. Therefore, all the energy in the system originates from the initial potential energy, which is being dissipated during the simulation; again, the RPE is used as a metric for the energy transfer or the loss of energy due to mixing.

Experimental setup for baroclinic eddy test case. Listed are the horizontal mesh resolution (min. triangle edge length), number of vertical levels, time step, horizontal viscosity, and the approximate grid Reynolds number.

Figure

The evolution of the normalized RPE during the simulation is shown in
Fig.

Sea surface temperature fields for the eddying channel test case at
4 km horizontal mesh resolution. Horizontal viscosity is 200

The test cases were run on a Linux cluster with 16-core Intel Xeon E5620
processors and Mellanox Infiniband interconnect. The 320-day simulation took
roughly 42 h to run on 96 cores with the 4 km resolution mesh and
140.26 s time step. It should be noted, however, that the time step
employed here is smaller than the maximal allowed time step. We also carried
out a strong scaling test with the 4 km mesh. In the scaling test, the
simulation was run for 40 time steps, recording the total elapsed wall-clock
time and time spent in different parts of the solver. Figure

Diagnostics of the eddying channel test case.

Strong parallel scaling for the baroclinic eddies test case on a
4 km mesh (

The scaling efficiency of the separate solvers is plotted with colored lines
in Fig.

To further assess the CPU cost, we compared Thetis timing against the SLIM
3-D model

It should be noted, however, that Thetis performance is currently not fully optimized. We expect that the performance can be significantly improved both in terms of serial and strong scaling performance. These will be addressed in future work.

Horizontal mesh and bathymetry for the DOME test case. The domain is
extended 120 km further to the west to avoid boundary effects (shaded
region). Horizontal element size ranges from 6 to 22 km. There are

Next, we investigate the model's ability to simulate density-driven overflows
with the DOME benchmark

At the inlet, a dense inflow (temperature 10

The domain is discretized with an unstructured grid (Fig.

As the inflowing current reaches the basin, it turns to the west and forms a
coastal plume that is approximately 150 km wide
(Fig.

Figure

The 47-day simulation took roughly 42 h to run on 90 cores with a 39.65 s time step on the same Linux cluster.

Bottom tracer concentration in the DOME test case after
10

Histogram of tracer in the DOME test case versus the

This paper describes a DG implementation of an eddy-permitting, unstructured
grid coastal ocean model. The solver is second-order accurate in space and
time. We have demonstrated that the formulation is fully conservative and
preserves monotonicity. The test cases indicate that the model is capable of
reproducing the expected physical behavior, including baroclinic eddies.
Moreover, numerical mixing is well-controlled and comparable to other
established structured grid models, such as MITgcm and ROMS, and the
large-scale finite volume model MPAS-Ocean. Finding an accurate formulation
is important, as commonly used unstructured grid models tend to be overly
diffusive, preventing accurate modeling of certain coastal domains

Future work will include solving the equations on a sphere, DG implementation of a biharmonic viscosity operator, two-equation turbulence closure models, wetting–drying treatment, and development of an adjoint solver, as well as improving the computational efficiency and parallel scaling of the solver.

All code used to perform the experiments in this papers is
publicly available. Firedrake, and its components, may be obtained from

For reproducibility, we also cite archives of the exact software versions
used to produce the results in this paper. All major Firedrake components
have been archived on Zenodo

No external data were used in this paper.

Using the analytical velocity and temperature fields, we can derive the steady-state solution for the remaining
fields:

Now, we can evaluate the different terms that appear in the momentum and
tracer equations:

A strong scaling test was carried out with both Thetis and the SLIM 3-D model

CPU time in the baroclinic eddies test case for Thetis and the SLIM
3-D model. Both models ran on identical triangular mesh (4 km resolution,
40 vertical levels) using

TK designed and implemented most of the solver and carried out the numerical simulations. SK and LM contributed to the design and implementation of the model. AB, DH, and MP supervised the work and guided the implementation of the model and the manuscript.

The authors declare that they have no conflict of interest.

The National Science Foundation partially supported this research through cooperative agreement OCE-0424602. The National Oceanic and Atmospheric Administration (NA11NOS0120036 and AB-133F-12-SE-2046), Bonneville Power Administration (00062251), and Corps of Engineers (W9127N-12-2-007 and G13PX01212) provided partial motivation and additional support. This work was supported by the UK's Engineering and Physical Science Research Council (grant numbers EP/M011054/1, EP/L000407/1) and the Natural Environment Research Council (grant number NE/K008951/1). This work used the Extreme Science and Engineering Discovery Environment (XSEDE), which is supported by National Science Foundation grant number ACI-1053575. The authors acknowledge the Texas Advanced Computing Center (TACC) at the University of Texas at Austin for providing HPC resources that have contributed to the research results reported within this paper. Edited by: James Annan Reviewed by: James Annan and one anonymous referee