|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Classes | |
| struct | WallCond |
| struct | WallState |
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | is_fluid (amrex::Real beta, amrex::Real small) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | is_solid (amrex::Real beta, amrex::Real small) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | is_wall_cell (amrex::Real b_km1, amrex::Real b_k, amrex::Real b_kp1, amrex::Real small) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | wall_beta (amrex::Real b_k, amrex::Real small) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | friction_velocity (amrex::Real ut, amrex::Real ut_ref, amrex::Real beta, amrex::Real dz, amrex::Real z0) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | face_above_factor (amrex::Real beta, amrex::Real dz, amrex::Real z0, int spacing) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | virtual_theta (amrex::Real theta, amrex::Real q) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | virtual_thetastar (const WallState &w, amrex::Real theta, amrex::Real q) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | phi (amrex::Real d, amrex::Real z0, amrex::Real psi) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE WallState | wall_state (amrex::Real ut, amrex::Real ut_ref, amrex::Real theta, amrex::Real theta_ref, amrex::Real q, amrex::Real q_ref, amrex::Real beta, amrex::Real dz, amrex::Real z0, const WallCond &c) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE WallState | wall_state (amrex::Real ut, amrex::Real ut_ref, amrex::Real theta, amrex::Real theta_ref, amrex::Real beta, amrex::Real dz, amrex::Real z0, const WallCond &c) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | decay_toward (amrex::Real flux, amrex::Real delta, amrex::Real dt) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | heat_source (const WallState &w, amrex::Real theta, const WallCond &c, amrex::Real dz, amrex::Real dt) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | moist_source (const WallState &w, amrex::Real q, const WallCond &c, amrex::Real dz, amrex::Real dt) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | stress_rate (amrex::Real ustar, amrex::Real ut, amrex::Real dz, amrex::Real dt) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | wall_tke (const WallState &w, amrex::Real beta, amrex::Real dz, amrex::Real z0, amrex::Real Cmu0, amrex::Real bstar, amrex::Real btheta) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | wall_tke (const WallState &w, amrex::Real beta, amrex::Real dz, amrex::Real z0, amrex::Real theta, amrex::Real Cmu0) noexcept |
The wall cell of immersed-forcing terrain and the fraction-stress wall law (erf.if_wall_form = fraction_stress), shared by the momentum sources, the wall-face masks of the diffusion and the RANS wall distance so they cannot disagree.
A column of solid fractions beta (terrain_blanking) meets the air in its WALL CELL: a partial cell with fluid above it, or a fluid cell sitting on a solid cell. The surface is at h = z_bot + beta dz of that cell (beta = 0 for the fluid cell), the wall cell's fluid centroid at d1 = (1 - beta) dz / 2 above it and the center of the cell above at d2 = (3/2 - beta) dz. The fraction-stress law takes the friction velocity u*^2 = (1 - beta) u*_own^2 + beta u*_ref^2, u*_own = kappa |u_t| / ln(d1/z0), u*_ref = kappa |u_t,ref| / ln(d2/z0), so a nearly full fluid cell uses its own velocity (on a face-aligned surface, beta = 0, that is the plain surface-layer law of flat ground at dz/2) and a thin fluid sliver the better resolved cell above, and applies it as a wall stress spread over the cell height, integrated exactly over the step: F = -rho C u_t, C = (1 - exp(-r dt)) / dt, r = u*^2 / (dz |u_t|). The resolved diffusive flux through the wall face (the bottom face of the wall cell) is switched off, so the column loses exactly u*^2 through the wall. This is form 7 of the kynema-sgf immersed terrain, written for the vertical columns of ERF's immersed forcing (horizontal velocity, vertical distances) and neutral stratification.
|
noexcept |
A wall flux (per unit mass, already divided by the cell height) that is proportional to delta = value - surface value, integrated exactly over dt as a decay so the cell cannot overshoot the surface value; a flux that is not a decay (rate <= 0) is applied as it stands.
Referenced by heat_source(), and moist_source().


|
noexcept |
Factor on the diffusive coupling through the face above the wall cell (the face between the wall cell, whose fluid centroid sits d1 = (1-beta) dz/2 above the surface, and the cell above, at d2 = (3/2-beta) dz). The solver differences across that face over dz; the factor dz/dz_eff replaces dz by spacing = 0 (grid): dz (factor 1) spacing = 1 (physical): d2 - d1 = (1 - beta/2) dz spacing = 2 (log): (d1 + d2) ln(d2/d1) / (2 ln 3), the spacing that gives the face flux, with the face viscosity the mean of the two cells' kappa u* z, the same relative error for a log profile as the first interior face of flat ground (d1 = dz/2, d2 = 3 dz/2), where it equals dz: ln 3 u*^2 for every beta All three are 1 for beta = 0, so a surface on a cell face stays flat ground. The factor is bounded only while z0 < dz/4 (d2 > d1 for every beta): the inputs require that.
|
noexcept |
Friction velocity of the fraction-stress law.
| ut | horizontal speed in the wall cell |
| ut_ref | horizontal speed in the cell above |
| beta | wall_beta of the wall cell |
| dz | cell height |
| z0 | roughness length The distances are floored at 2 z0 so that ln(d/z0) stays above ln 2 in a thin sliver, where the (1 - beta) weight of the own estimate is small anyway. |
|
noexcept |
Source of the wall heat flux in the wall cell, per unit mass (d theta / dt): the kinematic flux -u* theta* spread over the cell height. With a given surface temperature theta* is proportional to theta - theta_s and the term is a decay, integrated exactly over dt so it cannot overshoot the surface temperature; otherwise the flux is applied as it stands.
Referenced by ImmersedForcingTerrain_Scalar_FractionStress().


|
noexcept |
A cell whose solid fraction is below small counts as fluid
Referenced by immersed_wall_dist(), is_wall_cell(), and wall_beta().

|
noexcept |
A cell whose solid fraction is within small of one counts as solid
Referenced by immersed_wall_dist(), and is_wall_cell().

|
noexcept |
Cell k, with solid fractions b_km1, b_k, b_kp1 in cells k-1, k, k+1, is the wall cell: a partial cell with fluid above it, or a fluid cell on top of a solid cell.
Referenced by ComputeTurbulentViscosityRANS(), ImmersedForcingTerrain_HorizMom_FractionStress(), ImmersedForcingTerrain_Scalar_FractionStress(), and ERF::make_if_projection_sigma().


|
noexcept |
Source of the wall moisture flux in the wall cell, per unit mass (d q / dt): the kinematic flux -u* q* spread over the cell height; with a given surface mixing ratio the term is a decay toward q_s, integrated exactly as heat_source does toward theta_s (as there, the reference-cell part of a partial cell's q* is folded into the decay rate, so the wall cell never passes q_s). Zero without a moisture condition (q* = 0).
Referenced by ImmersedForcingTerrain_Scalar_FractionStress().


|
noexcept |
ln(d/z0) - psi, floored at ln 2 (the value the 2 z0 distance floor gives in neutral air)
Referenced by GeneralAD::compute_freestream_velocity(), SimpleAD::compute_freestream_velocity(), ReadBndryPlanes::define_level_data(), UPWIND3SL::Evaluate(), FillZeroAreaFaceFluxes(), ibseb::hemisphere_direction(), TerminalVelocity< RT >::IceBohm(), ERF::ImposeBCsOnPhi(), erf_actuator::erf_detail_ActuatorSampling::node_level_table(), obs_nudging::obs_nudging_tendency(), BuildingsLevelsetIF::operator()(), orbital_avg_cos_zenith(), plane_index(), ERF::poisson_wall_dist(), ERF::project_momenta(), ERF::project_velocity_tb(), ERF::read_box_for_refinement(), ERF::ReadParameters(), erf_actuator::sample_cell_scalar(), erf_actuator::sample_velocity_local(), erf_detail_MakeNewArrays::set_test_mapfactor(), solve_with_EB_mlmg(), ERF::solve_with_flat_mlmg(), ERF::solve_with_gmres(), ERF::solve_with_if_gmres(), ERF::solve_with_if_mlmg(), solve_with_mlmg(), ERF::solve_with_terrain_mlmg(), EWP::source_terms_cellcentered(), GeneralAD::source_terms_cellcentered(), SimpleAD::source_terms_cellcentered(), erf_actuator::terrain_heights(), and wall_state().

|
noexcept |
Effective rate C of the wall stress u*^2 spread over the cell height dz, integrated exactly over dt: the momentum source is -rho C u_t.
Referenced by ImmersedForcingTerrain_HorizMom_FractionStress().

|
noexcept |
Virtual potential temperature of the wall law, theta (1 + epsv q), water vapor only (the flat surface layer's plane average subtracts rain water too; the two agree without rain)
Referenced by ImmersedForcingTerrain_Scalar_FractionStress(), and wall_state().

|
noexcept |
Scale of the virtual heat flux, theta_v* = theta* (1 + epsv q) + epsv theta q*, so that -u* theta_v* = (1 + epsv q) <w'theta'> + epsv theta <w'q'> is the buoyancy flux (the flat surface layer's tstv)
Referenced by ImmersedForcingTerrain_Scalar_FractionStress(), and wall_state().

|
noexcept |
Solid fraction of a wall cell as the wall law uses it (zero for a fluid wall cell)
Referenced by ImmersedForcingTerrain_HorizMom_FractionStress(), and ImmersedForcingTerrain_Scalar_FractionStress().


|
noexcept |
The wall state without moisture (q = q_ref = 0; c.moist and c.moist_type are expected unset)

|
noexcept |
Wall state of the fraction-stress law with MOST stability functions (the functions of the flat surface layer, similarity_funs::calc_psi_m / calc_psi_h with Dyer's or QNSE's stable side as erf.most.stable_functions says, zeta clamped to +-100): u*^2 = (1-b) (kappa ut / phi_m(d1))^2 + b (kappa ut_ref / phi_m(d2))^2 theta* = -q / u* (heat_flux) = (1-b) kappa (theta - theta_s) / phi_h(d1)
Referenced by ImmersedForcingTerrain_HorizMom_FractionStress(), ImmersedForcingTerrain_Scalar_FractionStress(), and wall_state().


|
noexcept |
Wall value of the k-eqn TKE in the wall cell (erf.if_wall_tke), the value erf.dirichlet_k holds in the first cell over flat ground (Axell & Liungman 2001, Eq. 16): k = (u*^3 + kappa B d1)^(2/3) / Cmu0^2, B = -g u* bstar / btheta (unstable only), with u* from the wall state, the buoyancy scale bstar and its temperature btheta (theta* and theta; with a moisture model theta_v* and theta_v, see virtual_thetastar) and d1 the fluid-centroid height of the wall cell (floored at 2 z0, as the wall state does). kynema-sgf relaxes its immersed wall cells toward the same value.
Referenced by ImmersedForcingTerrain_Scalar_FractionStress(), make_sources(), and wall_tke().

|
noexcept |
The dry wall value: B from theta* and theta
