ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
similarity_funs Struct Reference

#include <ERF_MOSTUtils.H>

Collaboration diagram for similarity_funs:

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m2 (amrex::Real zeta) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_h2 (amrex::Real zeta) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m (amrex::Real zeta) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_h (amrex::Real zeta) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_phi_m (amrex::Real zeta) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_phi_h (amrex::Real zeta) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_zeta_fold (amrex::Real C) const
 

Private Attributes

amrex::Real beta_m {amrex::Real(5.0)}
 Constants from Dyer, BLM, 1974. More...
 
amrex::Real beta_h {amrex::Real(5.0)}
 https://doi.org/amrex::Real(10.1007)/BF00240838 More...
 
amrex::Real gamma_m {amrex::Real(16.0)}
 
amrex::Real gamma_h {amrex::Real(16.0)}
 

Detailed Description

Structure of similarity functions for Moeng formulation

Member Function Documentation

◆ calc_phi_h()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real similarity_funs::calc_phi_h ( amrex::Real  zeta) const
inline

Compute the Businger-Dyer heat gradient function, the exact companion of calc_psi_h: dtheta/dz = theta_* phi_h(zeta) / (kappa z).

See the note in calc_phi_m about the Jimenez pair.

Parameters
[in]zetastability coordinate z/L
203  {
204  if (zeta > 0) {
205  return one + beta_h * zeta;
206  } else {
207  return one / std::sqrt(one - gamma_h * zeta);
208  }
209  }
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
amrex::Real beta_h
https://doi.org/amrex::Real(10.1007)/BF00240838
Definition: ERF_MOSTUtils.H:234
amrex::Real gamma_h
Definition: ERF_MOSTUtils.H:236

◆ calc_phi_m()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real similarity_funs::calc_phi_m ( amrex::Real  zeta) const
inline

Compute the Businger-Dyer momentum gradient function.

This is the exact companion of calc_psi_m: the two are tied by psi_m(zeta) = int_0^zeta (1 - phi_m(x))/x dx, so differentiating the MOST wind profile u(z) = (u_star/kappa)[ln(z/z0) - psi_m(z/L)] gives du/dz = u_* phi_m(zeta) / (kappa z).

NOTE: the surface_temp* flux calculators use the Jimenez psi pair (calc_psi_m2/calc_psi_h2) rather than this one; their companions are not implemented yet, so a prescribed-surface-temperature run gets the Businger-Dyer gradient here.

Parameters
[in]zetastability coordinate z/L
183  {
184  if (zeta > 0) {
185  return one + beta_m * zeta;
186  } else {
187  return one / std::sqrt(std::sqrt(one - gamma_m * zeta));
188  }
189  }
amrex::Real beta_m
Constants from Dyer, BLM, 1974.
Definition: ERF_MOSTUtils.H:233
amrex::Real gamma_m
Definition: ERF_MOSTUtils.H:235

◆ calc_psi_h()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real similarity_funs::calc_psi_h ( amrex::Real  zeta) const
inline

Compute the Businger-Dyer heat stability correction.

Parameters
[in]zetastability coordinate z/L
152  {
153  if (zeta > 0) {
154  return -beta_h * zeta;
155  } else {
156  amrex::Real x = std::sqrt(one - gamma_h * zeta);
157  return two * std::log(myhalf * (one + x));
158  }
159  }
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by compute_if_most_target_vel(), ImmersedForcingBuildings_Scalar(), ImmersedForcingTerrain_Scalar(), ImmersedForcingTerrain_Xmom(), ImmersedForcingTerrain_Ymom(), surface_flux_charnock::iterate_flux(), surface_flux_mod_charnock::iterate_flux(), surface_flux_donelan::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), surface_flux::iterate_flux(), surface_flux_eb::iterate_flux(), and ib_wall::wall_state().

Here is the caller graph for this function:

◆ calc_psi_h2()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real similarity_funs::calc_psi_h2 ( amrex::Real  zeta) const
inline

Compute the Jimenez heat stability correction.

Parameters
[in]zetastability coordinate z/L
105  {
106  if (zeta > 0) {
107  amrex::Real x = std::pow(one + std::pow(zeta, amrex::Real(1.1)), one/amrex::Real(1.1));
108  return ( -amrex::Real(5.3)*std::log(zeta + x) );
109  } else {
110  amrex::Real x = std::sqrt(one - amrex::Real(16.0)*zeta);
111  amrex::Real psi_k_h = two * std::log(myhalf * (one + x));
112  amrex::Real y = std::pow(one - amrex::Real(34.0)*zeta, one/three);
113  amrex::Real psi_c_h = (three/two)*std::log((y*y + y + one)/three)
114  - std::sqrt(three)*std::atan((two*y + one)/std::sqrt(three))
115  + PI/std::sqrt(three);
116  return ( (psi_k_h + zeta*zeta*psi_c_h) / (one + zeta*zeta) );
117  }
118  }
constexpr amrex::Real three
Definition: ERF_NumericalConstants.H:39
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:46

Referenced by surface_temp_charnock::iterate_flux(), surface_temp_mod_charnock::iterate_flux(), surface_temp_donelan::iterate_flux(), surface_temp_wave_coupled::iterate_flux(), surface_temp::iterate_flux(), surface_temp_eb::iterate_flux(), most_rib_resid(), erf_cloud_chamber_wall_flux::most_stability_coordinate(), erf_cloud_chamber_wall_flux::most_wall_coefficients(), and erf_surface_moisture::surface_layer_aerodynamic_resistance().

Here is the caller graph for this function:

◆ calc_psi_m()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real similarity_funs::calc_psi_m ( amrex::Real  zeta) const
inline

Compute the Businger-Dyer momentum stability correction.

Parameters
[in]zetastability coordinate z/L
133  {
134  if (zeta > 0) {
135  return -beta_m * zeta;
136  } else {
137  amrex::Real x = std::sqrt(std::sqrt(one - gamma_m * zeta));
138  return two * std::log(myhalf * (one + x)) + std::log(myhalf * (one + x * x)) -
139  two * std::atan(x) + PIoTwo;
140  }
141  }
constexpr amrex::Real PIoTwo
Definition: ERF_NumericalConstants.H:47

Referenced by compute_if_most_target_vel(), ImmersedForcingBuildings_Scalar(), ImmersedForcingTerrain_Scalar(), ImmersedForcingTerrain_Xmom(), ImmersedForcingTerrain_Ymom(), surface_flux_charnock::iterate_flux(), surface_flux_mod_charnock::iterate_flux(), surface_flux_donelan::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), surface_flux::iterate_flux(), surface_flux_eb::iterate_flux(), and ib_wall::wall_state().

Here is the caller graph for this function:

◆ calc_psi_m2()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real similarity_funs::calc_psi_m2 ( amrex::Real  zeta) const
inline

Compute the Jimenez momentum stability correction.

Parameters
[in]zetastability coordinate z/L
80  {
81  if (zeta > 0) {
82  amrex::Real x = std::pow(one + std::pow(zeta, amrex::Real(2.5)), one/amrex::Real(2.5));
83  return ( -amrex::Real(6.1)*std::log(zeta + x) );
84  } else {
85  amrex::Real x = std::pow(one - amrex::Real(16.0)*zeta, fourth);
86  amrex::Real psi_k_m = two * std::log(myhalf * (one + x)) + std::log(myhalf * (one + x * x)) -
87  two * std::atan(x) + PIoTwo;
88  amrex::Real y = std::pow(one - amrex::Real(10.0)*zeta, one/three);
89  amrex::Real psi_c_m = (three/two)*std::log((y*y + y + one)/three)
90  - std::sqrt(three)*std::atan((two*y + one)/std::sqrt(three))
91  + PI/std::sqrt(three);
92  return ( (psi_k_m + zeta*zeta*psi_c_m) / (one + zeta*zeta) );
93  }
94  }
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:42

Referenced by Compute_roughness(), surface_temp_charnock::iterate_flux(), surface_temp_mod_charnock::iterate_flux(), surface_temp_donelan::iterate_flux(), surface_temp_wave_coupled::iterate_flux(), surface_temp::iterate_flux(), surface_temp_eb::iterate_flux(), most_rib_resid(), erf_cloud_chamber_wall_flux::most_stability_coordinate(), and erf_cloud_chamber_wall_flux::most_wall_coefficients().

Here is the caller graph for this function:

◆ calc_zeta_fold()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real similarity_funs::calc_zeta_fold ( amrex::Real  C) const
inline

Stable z/L at which the prescribed-flux problem folds.

With the Businger-Dyer psi_m = -beta_m z/L and L fixed by u* and the flux, the wind a given u* supports is u* max(C - psi_m, b) / kappa, with b = most_bracket_floor(C). For C > 0 it is smallest at z/L = C / (2 beta_m); for small or negative C (z0 near or above zref) the floor binds first and the minimum is at the kink z/L = (b - C) / beta_m. Below that wind the prescribed stable flux has no solution (Basu et al., BLM 2008). The physical (large u*) branch has z/L below this value, so bounding z/L by it leaves every point that has a solution unchanged. The result is positive for every C.

Parameters
[in]Cln(zref/z0)
228  {
229  return amrex::max(C / (two * beta_m), (most_bracket_floor(C) - C) / beta_m);
230  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real most_bracket_floor(amrex::Real C)
Definition: ERF_MOSTUtils.H:57

Referenced by surface_flux_charnock::iterate_flux(), surface_flux_mod_charnock::iterate_flux(), surface_flux_donelan::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), surface_flux::iterate_flux(), and surface_flux_eb::iterate_flux().

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

Member Data Documentation

◆ beta_h

amrex::Real similarity_funs::beta_h {amrex::Real(5.0)}
private

◆ beta_m

amrex::Real similarity_funs::beta_m {amrex::Real(5.0)}
private

Constants from Dyer, BLM, 1974.

Referenced by calc_phi_m(), calc_psi_m(), and calc_zeta_fold().

◆ gamma_h

amrex::Real similarity_funs::gamma_h {amrex::Real(16.0)}
private

Referenced by calc_phi_h(), and calc_psi_h().

◆ gamma_m

amrex::Real similarity_funs::gamma_m {amrex::Real(16.0)}
private

Referenced by calc_phi_m(), and calc_psi_m().


The documentation for this struct was generated from the following file: