ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_MOSTUtils.H File Reference
#include "ERF_Constants.H"
Include dependency graph for ERF_MOSTUtils.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  most_data
 
struct  similarity_funs
 

Functions

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real air_viscosity (amrex::Real T_degK)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Charnock_roughness (amrex::Real ustar, amrex::Real Cnk_a, amrex::Real nu, bool visc)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Mod_Charnock_roughness (amrex::Real ustar, amrex::Real Cnk_b)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real COARE3_roughness (amrex::Real zref, amrex::Real umm, amrex::Real ustar, amrex::Real nu, bool visc)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Donelan_roughness (amrex::Real ustar, amrex::Real nu, bool visc)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real WaveCoupled_roughness (amrex::Real Hwave, amrex::Real Lwave, amrex::Real eps, amrex::Real ustar, amrex::Real nu, bool visc)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_roughness (amrex::Real zref, amrex::Real Olen, amrex::Real umm, amrex::Real ustar)
 

Function Documentation

◆ air_viscosity()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real air_viscosity ( amrex::Real  T_degK)

Empirical kinematic viscosity [m2/s] formula from Andreas (1989) CRREL Rep. 89-11, valid between -173 and 277 deg C.

Parameters
[in]T_degKair temperature in Kelvin
149 {
150  amrex::Real TC = T_degK - amrex::Real(273.15);
151  return amrex::Real(1.326e-5)*(one + amrex::Real(6.542e-3)*TC + amrex::Real(8.301e-6)*TC*TC - amrex::Real(4.84e-9)*TC*TC*TC);
152 }
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:30
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by adiabatic_charnock::iterate_flux(), adiabatic_donelan::iterate_flux(), adiabatic_wave_coupled::iterate_flux(), surface_flux_charnock::iterate_flux(), surface_flux_donelan::iterate_flux(), surface_temp_charnock::iterate_flux(), surface_temp_donelan::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), and surface_temp_wave_coupled::iterate_flux().

Here is the caller graph for this function:

◆ Charnock_roughness()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Charnock_roughness ( amrex::Real  ustar,
amrex::Real  Cnk_a,
amrex::Real  nu,
bool  visc 
)

Charnock roughness with optional aerodynamically-smooth contribution

Smooth-flow limit follows z0 = 0.11 nu / u* (Smith 1988; ECMWF; WRF)

Parameters
[in]ustarfriction velocity
[in]cnk_acharnock constant
[in]nuintrinsic fluid viscosity
[in]viscflag to apply smooth flow limit
171 {
172  amrex::Real z0 = (Cnk_a / CONST_GRAV) * ustar * ustar;
173  if (visc) {
174  z0 += amrex::Real(0.11) * nu / std::max(ustar, amrex::Real(0.01));
175  }
176  // From Davis et al 2008 MWR
177  return std::min(std::max(z0, amrex::Real(1.27e-7)), amrex::Real(2.85e-3));
178 }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:56
Real z0
Definition: ERF_InitCustomPertVels_ScalarAdvDiff.H:8

Referenced by adiabatic_charnock::iterate_flux(), surface_flux_charnock::iterate_flux(), and surface_temp_charnock::iterate_flux().

Here is the caller graph for this function:

◆ COARE3_roughness()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real COARE3_roughness ( amrex::Real  zref,
amrex::Real  umm,
amrex::Real  ustar,
amrex::Real  nu,
bool  visc 
)

COARE3.0, following WRF phys/module_sf_mynn.F

Smooth-flow limit follows z0 = 0.11 nu / u* (Smith 1988; ECMWF; WRF)

Parameters
[in]zrefreference height for the wind speed
[in]ummhorizontal wind speed magnitude at zref
[in]ustarfriction velocity
[in]nuintrinsic fluid viscosity
[in]viscflag to apply smooth flow limit
217 {
218  amrex::Real ws10m = umm*std::log(amrex::Real(10.)/amrex::Real(1e-4)) / std::log(zref/amrex::Real(1e-4));
219  amrex::Real Czc = amrex::Real(0.011) + amrex::Real(0.007)*std::min(std::max((ws10m-amrex::Real(10.))/amrex::Real(8.), amrex::Real(0.0)), amrex::Real(1.0));
220  amrex::Real z0 = (Czc / CONST_GRAV) * ustar * ustar;
221  if (visc) {
222  z0 += amrex::Real(0.11) * nu / std::max(ustar, amrex::Real(0.01));
223  }
224  // From Davis et al 2008 MWR
225  return std::min(std::max(z0, amrex::Real(1.27e-7)), amrex::Real(2.85e-3));
226 }

Referenced by adiabatic_charnock::iterate_flux(), surface_flux_charnock::iterate_flux(), and surface_temp_charnock::iterate_flux().

Here is the caller graph for this function:

◆ Compute_roughness()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_roughness ( amrex::Real  zref,
amrex::Real  Olen,
amrex::Real  umm,
amrex::Real  ustar 
)

Invert log-law to get roughness

Parameters
[in]zrefreference height for the wind speed
[in]OlenObukhov length
[in]ummhorizontal wind speed magnitude at zref
[in]ustarfriction velocity
306 {
307  similarity_funs sfuns;
308  amrex::Real zeta = zref / Olen;
309  amrex::Real psi_m = sfuns.calc_psi_m2(zeta);
310  amrex::Real z0 = zref / std::exp(KAPPA*umm/ustar + psi_m);
311  return std::max(z0, amrex::Real(1.0e-7));
312 }
constexpr amrex::Real KAPPA
Definition: ERF_Constants.H:55
Definition: ERF_MOSTUtils.H:37
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m2(amrex::Real zeta) const
Definition: ERF_MOSTUtils.H:49

Referenced by SurfaceLayer::compute_sfc_params_from_lsm_fluxes(), and SurfaceLayer::compute_SurfaceLayer_bcs().

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

◆ Donelan_roughness()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Donelan_roughness ( amrex::Real  ustar,
amrex::Real  nu,
bool  visc 
)

Updated Donelan 2004 as found in AHW

Matches implementations in WRF phys/physics_mmm/sf_sfclayrev.F90 and phys/module_sf_mynn.F

Smooth flow limit is intrinsic in zn2.

Parameters
[in]ustarfriction velocity
[in]nuintrinsic fluid viscosity
[in]viscflag to apply smooth flow limit
246 {
247  constexpr amrex::Real ozo{amrex::Real(1.59e-5)};
248  amrex::Real zw = std::min(std::pow(ustar/amrex::Real(1.06), amrex::Real(0.3)),amrex::Real(1.0));
249  amrex::Real zn1 = amrex::Real(0.011)*ustar*ustar/CONST_GRAV + ozo;
250  amrex::Real zn2 = amrex::Real(10.)*std::exp(-amrex::Real(9.5)*std::pow(ustar, -amrex::Real(.3333)));
251  if (visc) {
252  zn2 += amrex::Real(0.11) * nu / std::max(ustar, amrex::Real(0.01));
253  }
254  amrex::Real z0 = (amrex::Real(1.0)-zw) * zn1 + zw * zn2;
255  // From Davis et al 2008 MWR
256  return std::min(std::max(z0, amrex::Real(1.27e-7)), amrex::Real(2.85e-3));
257 }

Referenced by adiabatic_donelan::iterate_flux(), surface_flux_donelan::iterate_flux(), and surface_temp_donelan::iterate_flux().

Here is the caller graph for this function:

◆ Mod_Charnock_roughness()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Mod_Charnock_roughness ( amrex::Real  ustar,
amrex::Real  Cnk_b 
)

Modified Charnock roughness

Smooth-flow limit is intrinsic.

Parameters
[in]ustarfriction velocity
[in]cnk_bmodified charnock constant
193 {
194  amrex::Real z0 = std::exp( (amrex::Real(2.7)*ustar - amrex::Real(1.8)/Cnk_b) / (ustar + amrex::Real(0.17)/Cnk_b) );
195  return std::min(std::max(z0, amrex::Real(1.27e-7)), amrex::Real(1.0e-2));
196 }

Referenced by adiabatic_mod_charnock::iterate_flux(), surface_flux_mod_charnock::iterate_flux(), and surface_temp_mod_charnock::iterate_flux().

Here is the caller graph for this function:

◆ WaveCoupled_roughness()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real WaveCoupled_roughness ( amrex::Real  Hwave,
amrex::Real  Lwave,
amrex::Real  eps,
amrex::Real  ustar,
amrex::Real  nu,
bool  visc 
)

Wave coupled roughness

Smooth-flow limit follows z0 = 0.11 nu / u* (Smith 1988; ECMWF; WRF)

Parameters
[in]Hwavewave height
[in]Lwavewave length
[in]epsavoid divide by zero
[in]ustarfriction velocity
[in]nuintrinsic fluid viscosity
[in]viscflag to apply smooth flow limit
281 {
282 
283  amrex::Real z0 = amrex::Real(1200.0) * Hwave * std::pow( Hwave/(Lwave+eps), amrex::Real(4.5) );
284  if (visc) {
285  z0 += amrex::Real(0.11) * nu / std::max(ustar, amrex::Real(0.01));
286  }
287  return std::min(std::max(z0, amrex::Real(1.27e-7)), amrex::Real(1.0e-2));
288 }

Referenced by adiabatic_wave_coupled::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), and surface_temp_wave_coupled::iterate_flux().

Here is the caller graph for this function: