ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_NestedBaseState.cpp File Reference
#include <ERF.H>
#include <ERF_EOS.H>
#include <ERF_Constants.H>
#include <ERF_Utils.H>
#include <AMReX_MultiFabUtil.H>
Include dependency graph for ERF_NestedBaseState.cpp:

Detailed Description

The base state of a level below the finest the run allows, as the average of the base state of the mesh at max_level resolution, with the cell-center heights placed so that it is in discrete hydrostatic balance.

With the coarse metrics built from the finest mesh (metrics_from_finest), the volume of a coarse cell is the sum of the volumes of the fine cells it holds. Each level's base state is in hydrostatic balance and satisfies the equation of state, but built separately on each level the base-state mass of a coarse cell is not that of the fine cells it holds, so a regrid changes the composite mass by the difference. Here the coarse base state is instead

  1. the volume-weighted average of rho_0, rho_0 theta_0 and rho_0 qv_0 of the base state built (as the finest level builds its own) on the max_level mesh over the coarse columns,
  2. with p_0 and pi_0 from the equation of state, and
  3. with the cell-center heights z_phys_cc placed, column by column from the lowest cell up, so that it is in the discrete hydrostatic balance rebalance_columns enforces: p_0(k) - p_0(k-1) = -g (z_cc(k) - z_cc(k-1)) (rho_t(k) + rho_t(k-1)) / 2, rho_t = rho_0 (1 + qv_0). The vertical pressure gradient, in the slow and the fast terms, uses that same distance between the cell centers. The volumes and areas (from the nodes) are not changed, and z_cc(k) differs from the average of the nodes by a small fraction of the cell.

A level's base state depends only on its own columns, not on where the finer levels are, so a regrid changes no base state, and a fine cell's base state is the one its coarse cell's was averaged from.