ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_CFFluxHistory.cpp File Reference
#include "ERF.H"
#include "ERF_Constants.H"
Include dependency graph for ERF_CFFluxHistory.cpp:

Detailed Description

The fluxes through the coarse/fine faces of a refined level, taken from the coarse level's acoustic substeps.

The density flux that each level applies over a time step is the time integral, over its acoustic substeps, of the momentum on each face (the slow part, built from the stage momenta, cancels against the stage momenta in the fast update). The fine level's coarse/fine faces are set from the coarse level at the substep times, interpolated linearly in time between the coarse level's old and new states. Unless the coarse momentum on a face changes linearly over the coarse step – and acoustic waves through a face make it anything but – the two integrals differ. Density is not refluxed, so the difference is lost: mass is not conserved, and at large time steps the run blows up (issue #4325).

So the coarse level records, in thin slabs of faces under the coarse/fine faces of the fine level, the flux each face applied over each substep of its last RK stage (the stage whose fluxes are the step's), and the vertical quantity on its z-faces at the substep times: (rho w) without terrain, Omega with it. The fine level, in its own last RK stage, takes on each coarse/fine face the average of the coarse flux over each of its substeps, interpolated conservatively in space, and in z that vertical quantity at the end of the substep. Whatever the substeps of the two levels, its fluxes through the face then add up, over the coarse step, to the coarse level's.

With terrain (erf_substep_T) the fluxes are those the terrain integrator forms: h_zeta (rho u)/m through x- and y-faces, whose area h_zeta is, and Omega through z-faces. The fine level sets the Omega of its coarse/fine z-faces, and so (rho w) there follows from its own (rho u) and (rho v) and the terrain slopes.

This is done for the fast integrators without terrain and with fixed terrain (erf_substep_NS, erf_substep_T), not with moving terrain (erf_substep_MT). It is done under one-way coupling too, so that the fine level sees the same fluxes through its coarse/fine faces whether or not it is averaged down and refluxed onto the coarse level.