ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
AL01 Namespace Reference

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real geom_length (amrex::Real l_g_raw, amrex::Real l_g_max)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real smooth_Rt (amrex::Real Rt, amrex::Real Rt_crit, amrex::Real Rt_min)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real turb_length (amrex::Real l_g, amrex::Real N2, amrex::Real tke, amrex::Real Cmu0_pow3, amrex::Real inv_Cb_sq, amrex::Real Rt_crit, amrex::Real Rt_min, amrex::Real eps)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real unstable_length_bound (amrex::Real l_g, amrex::Real Cmu0_pow3, amrex::Real inv_Cb_sq, amrex::Real Rt_min)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real dissipation (amrex::Real rho, amrex::Real Cmu0_pow3, amrex::Real tke, amrex::Real length)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real richardson (amrex::Real length, amrex::Real N2, amrex::Real tke, amrex::Real Cmu0_pow3)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real cmu (amrex::Real Rt, amrex::Real Cmu0)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real cmu_prime (amrex::Real Rt, amrex::Real Cmu0)
 

Variables

constexpr amrex::Real Rt_min_lower_bound = amrex::Real(-3.6)
 

Function Documentation

◆ cmu()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::cmu ( amrex::Real  Rt,
amrex::Real  Cmu0 
)

Momentum stability function (AL01 Eq. 31).

120 {
121  return (Cmu0 + amrex::Real(0.108)*Rt)
122  / (one + amrex::Real(0.308)*Rt + amrex::Real(0.00837)*Rt*Rt);
123 }
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:30
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by ComputeTurbulentViscosityRANS().

Here is the caller graph for this function:

◆ cmu_prime()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::cmu_prime ( amrex::Real  Rt,
amrex::Real  Cmu0 
)

Scalar stability function (AL01 Eq. 32).

128 {
129  return Cmu0 / (1 + amrex::Real(0.277)*Rt);
130 }

Referenced by ComputeTurbulentViscosityRANS().

Here is the caller graph for this function:

◆ dissipation()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::dissipation ( amrex::Real  rho,
amrex::Real  Cmu0_pow3,
amrex::Real  tke,
amrex::Real  length 
)

Dissipation rate per unit volume, rho Cmu0^3 k^1.5 / L (AL01 Eq. 19).

103 {
104  return rho * Cmu0_pow3 * std::pow(tke,amrex::Real(1.5)) / length;
105 }
const Real length
Definition: ERF_InitCustomPert_AnelasticWallDiffusion.H:14
@ rho
Definition: ERF_Kessler.H:25

Referenced by ComputeTurbulentViscosityRANS().

Here is the caller graph for this function:

◆ geom_length()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::geom_length ( amrex::Real  l_g_raw,
amrex::Real  l_g_max 
)

Geometric length scale with the harmonic cap (AL01 Eq. 22 plus limiter).

Parameters
l_g_rawkappa times (wall distance + z0)
l_g_maxupper bound, about kappa times 0.1 zi
25 {
26  return l_g_max * l_g_raw / (l_g_max + l_g_raw);
27 }

Referenced by ComputeTurbulentViscosityRANS().

Here is the caller graph for this function:

◆ richardson()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::richardson ( amrex::Real  length,
amrex::Real  N2,
amrex::Real  tke,
amrex::Real  Cmu0_pow3 
)

Turbulent Richardson number, Eq. 29 combined with Eq. 19: Rt = k^2 N^2 / eps^2 = L^2 N^2 / (k Cmu0^6).

112 {
113  return length*length * N2 / (tke * Cmu0_pow3 * Cmu0_pow3);
114 }

Referenced by ComputeDiffusivityYSU(), and ComputeTurbulentViscosityRANS().

Here is the caller graph for this function:

◆ smooth_Rt()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::smooth_Rt ( amrex::Real  Rt,
amrex::Real  Rt_crit,
amrex::Real  Rt_min 
)

Burchard & Petersen smoothing of Rt below Rt_crit, which maps (-inf, Rt_crit) onto (Rt_min, Rt_crit) so the stability functions stay finite in strongly unstable air: Rt_s = Rt - (Rt - Rt_crit)^2 / (Rt + Rt_min - 2 Rt_crit). Written with x = Rt - Rt_crit and a = Rt_min - Rt_crit as Rt_s = Rt_crit + a x / (x + a), which is the same function without the cancellation of two O(|Rt|) terms that returned garbage for |Rt| beyond about 1e15 (tiny k under a strong unstable N^2). Limits: Rt_crit as x -> 0, Rt_min as x -> -inf.

40 {
41  if (Rt >= Rt_crit) { return Rt; }
42  const amrex::Real x = Rt - Rt_crit; // < 0
43  const amrex::Real a = Rt_min - Rt_crit; // < 0 by input validation
44  return Rt_crit + a * x / (x + a);
45 }

Referenced by ComputeTurbulentViscosityRANS(), and turb_length().

Here is the caller graph for this function:

◆ turb_length()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::turb_length ( amrex::Real  l_g,
amrex::Real  N2,
amrex::Real  tke,
amrex::Real  Cmu0_pow3,
amrex::Real  inv_Cb_sq,
amrex::Real  Rt_crit,
amrex::Real  Rt_min,
amrex::Real  eps 
)

Turbulent length scale: neutral (l_g), stable (Eq. 26) or unstable (Eq. 28).

Unstable: Eq. 28 is Eq. 26 rewritten with the dissipation of Eq. 19 on the right-hand side. Iterating it (dissipation from the new length, length from the new Rt) is the fixed-point map of Eq. 26 with N^2 < 0, which has no fixed point once l_g^2 |N^2| exceeds Cb^2 k (AL01, p. 78), so the length grows without bound in strongly convective, weakly turbulent air. Here Eq. 28 is evaluated once with the dissipation of the geometric length and the Burchard & Petersen smoothed Rt, as in the Kynema KLAxell implementation, which bounds the unstable length by l_g sqrt(1 + Cmu0^6 |Rt_min| / Cb^2), about 1.31 l_g for the defaults.

Parameters
l_gcapped geometric length
N2Brunt-Vaisala frequency squared
tketurbulent kinetic energy (floored, > 0)
Cmu0_pow3Cmu0 cubed
inv_Cb_sqone over Cb squared
Rt_crit,Rt_minsmoothing parameters
epsthreshold below which N2 counts as neutral
73 {
75  if (std::abs(N2) <= eps) {
76  length = l_g;
77  } else if (N2 > eps) {
78  // Stable (AL01, Eqn. 26)
79  length = std::sqrt(one /
80  (one / (l_g * l_g) + inv_Cb_sq * N2 / tke));
81  } else {
82  // Unstable (AL01, Eqn. 28) with Rt from the geometric length
83  // (Eq. 29 with Eq. 19: Rt = l_g^2 N^2 / (k Cmu0^6)), smoothed
84  const amrex::Real Rt = smooth_Rt(l_g*l_g * N2 / (tke * Cmu0_pow3 * Cmu0_pow3),
85  Rt_crit, Rt_min);
86  length = l_g * std::sqrt(one - Cmu0_pow3*Cmu0_pow3 * inv_Cb_sq * Rt);
87  }
88  return length;
89 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real smooth_Rt(amrex::Real Rt, amrex::Real Rt_crit, amrex::Real Rt_min)
Definition: ERF_RANSClosure.H:39

Referenced by ComputeTurbulentViscosityRANS().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unstable_length_bound()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AL01::unstable_length_bound ( amrex::Real  l_g,
amrex::Real  Cmu0_pow3,
amrex::Real  inv_Cb_sq,
amrex::Real  Rt_min 
)

Upper bound of the unstable length for given smoothing parameters.

95 {
96  return l_g * std::sqrt(one - Cmu0_pow3*Cmu0_pow3 * inv_Cb_sq * Rt_min);
97 }

Variable Documentation

◆ Rt_min_lower_bound

constexpr amrex::Real AL01::Rt_min_lower_bound = amrex::Real(-3.6)
constexpr

Lowest admissible Rt_min: the poles of cmu' (Rt = -1/0.277) and of cmu (larger root of 1 + 0.308 Rt + 0.00837 Rt^2) both sit near -3.6.