Verification¶
The following tests are used to verify the correct behavior of different algorithmic components of ERF.
Scalar Advection¶
Here we present spatial and temporal convergence studies for simple scalar advection with a uniform velocity field. The initial data has constant density and pressure, constant velocity \(u=10\) in the x-direction, and a scalar initialized with profile \(cos(\pi x)\) in a domain that is 2 units wide and periodic in the lateral directions with slip walls on top and bottom. The simulation is run for 10 periods, i.e. until time \(t=2.0\)
The first study, shown below on the left, tests the horizontal centered/upwind advection stencils for
second through sixth order. The study on the right tests the WENO 3rd and 5th order stencils,
with and without the smoothing
contributions in the stencil. In all of these cases,
the time step was held fixed at \(\Delta t = 0.0000078125\) to ensure that the spatial error dominates
the temporal error.
Spatial convergence study (centered/upwind) |
Spatial convergence study (WENO) |
The second study tests the temporal accuracy by first setting \(\Delta t = 0.0005\) and \(\Delta x = 1/8\), then reducing both \(\Delta t\) and \(\Delta x\) by a factor of two, keeping the ratio of \(\Delta t\) to \(\Delta x\) constant. These tests were run with the 6th order accurate spatial stencil so that the temporal error dominated the spatial error. Here we recover the expected 3rd order accuracy of the RK3 scheme.
Temporal convergence study |
Nonlinear Density Current¶
The density current problem tests the effects of gravity and the behavior at a slip wall.
A detailed description of the problem and a comparison of solutions using a number of different codes can be found in the Straka 1993 paper
Perturbational potential temperature at t = 600s |
Perturbational potential temperature at t = 900s |
Ekman Spiral¶
The Ekman spiral problem tests the computation of the stress term internally and at no-slip walls, as well as Coriolis and geostrophic forcing.
A description of the problem, including the exact solution, can be found at Ekman Spiral Description
The steady solution is shown below, as well as a log-log plot showing the error scaling as \(O(\Delta z^2)\).
Flow profiles |
Convergence study |
Potential flow over a semi-cylinder¶
The potential flow over a semi-cylinder problem tests the terrain feature in two dimensions and the effectiveness of sponge zones in preventing spurious reflections. This is a classic text book problem which has an exact result. The density is constant and the streamwise velocity is 10 m/s, and sponge zones are used on both the streamwise boundaries as well as the top boundary. The bottom wall is an inviscid, slip wall. The schematic of the computational domain and the comparison of the steady state velocity profiles with the exact solution at two different horizontal and vertical locations are shown below. This case runs without any diffusion.
Potential flow over a hemisphere¶
The potential flow over a hemisphere problem tests the terrain feature in three dimensions and the effectiveness of sponge zones in preventing spurious reflections. This is a classic text book problem which has an exact solution. The density is constant and the streamwise velocity is 10 m/s, and sponge zones are used on both the streamwise boundaries as well as the top boundary. The bottom wall is an inviscid, slip wall. The schematic of the computational domain and the comparison of the steady state velocity profiles with the exact solution at two different horizontal locations are shown below. A small amount of physical diffusion was added to keep the simulation stable in this case. Hence the wall velocities in the plot below do not match exactly to the inviscid solution. But away from the walls, excellent quantitative agreement is observed.
Stokes second problem - viscous flow over an oscillating flat plate¶
The Stokes second problem - viscous flow over an oscillating flat plate in quiescent initial conditions, tests the viscous terms in the governing equations with terrain and the feature for specifying a custom terrain velocity. This is a classic text book problem which has an analytical solution. The bottom wall is specified as a flat terrain and all other boundaries are outflow. The contours of horizontal velocity and the comparison of the numerical and exact solutions at a given time are shown in the figure below.
Dry bubble and moist bubble rise simulations¶
Benchmark simulations of dry and moist bubble rises in Bryan and Fritsch are reproduced. The test case consists of a
warm bubble rising in dry and moist conditions. The potential temperature perturbation and the vertical velocity
are compared as shown in the figures below. Excellent quantitative comparisons are obtained. The dry and moist bubble cases are
in Exec/RegTests/Bubble
with the corresponding input files inputs_BF02_dry_bubble
and inputs_BF02_moist_bubble
.