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
 

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
173  {
174  if (zeta > 0) {
175  return one + beta_h * zeta;
176  } else {
177  return one / std::sqrt(one - gamma_h * zeta);
178  }
179  }
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:183
amrex::Real gamma_h
Definition: ERF_MOSTUtils.H:185

◆ 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
153  {
154  if (zeta > 0) {
155  return one + beta_m * zeta;
156  } else {
157  return one / std::sqrt(std::sqrt(one - gamma_m * zeta));
158  }
159  }
amrex::Real beta_m
Constants from Dyer, BLM, 1974.
Definition: ERF_MOSTUtils.H:182
amrex::Real gamma_m
Definition: ERF_MOSTUtils.H:184

◆ 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
122  {
123  if (zeta > 0) {
124  return -beta_h * zeta;
125  } else {
126  amrex::Real x = std::sqrt(one - gamma_h * zeta);
127  return two * std::log(myhalf * (one + x));
128  }
129  }
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(), near_surface_diagnostics::evaluate_most_factor(), 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(), and surface_flux_eb::iterate_flux().

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
75  {
76  if (zeta > 0) {
77  amrex::Real x = std::pow(one + std::pow(zeta, amrex::Real(1.1)), one/amrex::Real(1.1));
78  return ( -amrex::Real(5.3)*std::log(zeta + x) );
79  } else {
80  amrex::Real x = std::sqrt(one - amrex::Real(16.0)*zeta);
81  amrex::Real psi_k_h = two * std::log(myhalf * (one + x));
82  amrex::Real y = std::pow(one - amrex::Real(34.0)*zeta, one/three);
83  amrex::Real psi_c_h = (three/two)*std::log((y*y + y + one)/three)
84  - std::sqrt(three)*std::atan((two*y + one)/std::sqrt(three))
85  + PI/std::sqrt(three);
86  return ( (psi_k_h + zeta*zeta*psi_c_h) / (one + zeta*zeta) );
87  }
88  }
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(), 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
103  {
104  if (zeta > 0) {
105  return -beta_m * zeta;
106  } else {
107  amrex::Real x = std::sqrt(std::sqrt(one - gamma_m * zeta));
108  return two * std::log(myhalf * (one + x)) + std::log(myhalf * (one + x * x)) -
109  two * std::atan(x) + PIoTwo;
110  }
111  }
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(), and surface_flux_eb::iterate_flux().

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
50  {
51  if (zeta > 0) {
52  amrex::Real x = std::pow(one + std::pow(zeta, amrex::Real(2.5)), one/amrex::Real(2.5));
53  return ( -amrex::Real(6.1)*std::log(zeta + x) );
54  } else {
55  amrex::Real x = std::pow(one - amrex::Real(16.0)*zeta, fourth);
56  amrex::Real psi_k_m = two * std::log(myhalf * (one + x)) + std::log(myhalf * (one + x * x)) -
57  two * std::atan(x) + PIoTwo;
58  amrex::Real y = std::pow(one - amrex::Real(10.0)*zeta, one/three);
59  amrex::Real psi_c_m = (three/two)*std::log((y*y + y + one)/three)
60  - std::sqrt(three)*std::atan((two*y + one)/std::sqrt(three))
61  + PI/std::sqrt(three);
62  return ( (psi_k_m + zeta*zeta*psi_c_m) / (one + zeta*zeta) );
63  }
64  }
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(), 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:

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(), and calc_psi_m().

◆ 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: