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

#include <ERF_TurbStruct.H>

Collaboration diagram for TurbChoice:

Public Member Functions

void init_params (int lev, int max_level, std::string pp_prefix)
 Read turbulence options for one AMR level from the input parameter database. More...
 
void check_params (amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
 Validate turbulence options against physical boundary conditions. More...
 
void display (int lev)
 Print turbulence settings for one AMR level. More...
 
bool uses_native_shoc () const noexcept
 Query whether this level uses the native SHOC PBL scheme. More...
 
bool uses_shoc_family () const noexcept
 Query whether this level uses any SHOC-family PBL scheme. More...
 
bool kh_kv_can_differ () const noexcept
 Query whether the horizontal and vertical eddy viscosities can differ on this level. More...
 
bool pbl_requires_surface_layer () const noexcept
 Query whether the selected PBL scheme requires surface-layer boundary conditions. More...
 
bool pbl_suppresses_microphysics_condensation () const noexcept
 Query whether the selected PBL scheme suppresses microphysics condensation. More...
 

Public Attributes

LESType les_type = LESType::None
 Selected LES closure. More...
 
amrex::Real Pr_t = one / three
 Turbulent Prandtl number. More...
 
amrex::Real Pr_t_inv = three
 Inverse turbulent Prandtl number. More...
 
amrex::Real Sc_t = one
 Turbulent Schmidt number. More...
 
amrex::Real Sc_t_inv = one
 Inverse turbulent Schmidt number. More...
 
amrex::Real Cs = zero
 Smagorinsky model coefficient. More...
 
bool smag2d = false
 Whether the 2-D Smagorinsky formulation is used. More...
 
bool smag2d_slope_limiter = false
 Apply WRF's Smagorinsky-2D slope limiter (K_h / alpha or / alpha^2) on terrain-fitted meshes. More...
 
amrex::Real smag2d_kh_cap = zero
 Cap K_h <= smag2d_kh_cap * Delta_h for Smagorinsky-2D (m/s); 0 means no cap. More...
 
bool smag2d_limits_requested = false
 Whether either Smagorinsky-2D limit was given as on for this level. More...
 
amrex::Real Ce = amrex::Real(0.93)
 Deardorff dissipation coefficient. More...
 
amrex::Real Ce_wall = zero
 Wall value for the Deardorff dissipation coefficient. More...
 
amrex::Real Ck = amrex::Real(0.1)
 Deardorff eddy-viscosity coefficient. More...
 
amrex::Real Cmu0 = amrex::Real(0.5562)
 One-equation RANS Cmu0 coefficient. More...
 
amrex::Real Cb = amrex::Real(0.35)
 One-equation RANS buoyancy coefficient. More...
 
amrex::Real Rt_crit = -one
 Critical turbulent Reynolds number. More...
 
amrex::Real Rt_min = -three
 Minimum turbulent Reynolds number. More...
 
amrex::Real l_g_max = amrex::Real(30.0)
 Maximum geometric length scale. More...
 
amrex::Real sigma_k = amrex::Real(0.5)
 TKE diffusivity coefficient denominator. More...
 
amrex::Real theta_ref = zero
 Reference potential temperature for stable stratification. More...
 
StratType strat_type = StratType::theta
 Thermodynamic variable used for stability stratification. More...
 
StratType pbl_strat_type = StratType::thetav
 
bool mix_isotropic = true
 Whether subgrid mixing uses isotropic length scales. More...
 
bool use_Ri_correction = true
 Whether Richardson-number correction is applied. More...
 
amrex::Real Ri_crit = fourth
 Critical Richardson number for stability correction. More...
 
RANSType rans_type = RANSType::None
 Selected RANS closure. More...
 
bool dirichlet_k = false
 Whether TKE uses Dirichlet boundary treatment. More...
 
amrex::Real tke_floor = zero
 
bool implicit_tke_dissipation = false
 
bool rans_consistent_diffusivities = false
 
bool rans_lscale_from_pblh = false
 
amrex::Real rans_lscale_min = one
 
amrex::Real rans_realizability = zero
 
RANSShearStencil rans_shear_stencil = RANSShearStencil::central
 
bool rans_moist_buoyancy = false
 
PBLType pbl_type = PBLType::None
 Selected PBL closure. More...
 
MYNNLevel25 pbl_mynn
 MYNN level-2.5 closure coefficients. More...
 
MYNNLevel2 pbl_mynn_level2
 MYNN level-2 closure coefficients for limiting. More...
 
bool use_kturb = false
 Whether any turbulence model is active. More...
 
bool use_keqn
 Whether a microscale TKE closure is active. More...
 
bool use_pbl_tke
 Whether a mesoscale PBL TKE closure is active. More...
 
bool use_tke = false
 Whether any TKE or QKE closure is active. More...
 
bool init_tke_from_ustar = false
 Whether initial TKE/QKE profiles are based on surface friction velocity. More...
 
amrex::Real tke_min = amrex::Real(1.e-6)
 Minimum TKE/QKE value. More...
 
amrex::Real pbl_ysu_coriolis_freq
 Coriolis frequency used by YSU-family PBL schemes. More...
 
bool pbl_ysu_use_consistent_coriolis
 Whether YSU uses the ERF Coriolis frequency. More...
 
amrex::Real pbl_ysu_land_Ribcr
 Critical bulk Richardson number over land for stable YSU conditions. More...
 
bool enable_ysu_countergradient
 Whether YSU countergradient corrections are enabled. More...
 
bool enable_ysu_sat_limiter
 Whether YSU applies a saturation limiter to moisture countergradient terms. More...
 
bool enable_ysu_topdown
 Whether YSU top-down mixing is enabled. More...
 
bool enable_ysu_entrainment
 Whether YSU entrainment-layer parameterization is enabled. More...
 
bool enable_ysu_cloud_pblh
 Whether the YSU PBL-top cell index is raised by one where that cell is cloudy. More...
 
amrex::Real ysu_qcloud_threshold
 Cloud water plus cloud ice threshold for YSU [kg/kg]. More...
 
bool ysu_moistvars = false
 Whether YSU applies turbulence to moisture variables. More...
 
bool pbl_ysunew_highres_bounds = false
 Whether YSU applies high-resolution grid-dependent diffusivity bounds. More...
 
bool enable_ysu_rad_tend_limiter = false
 
amrex::Real ysu_rad_tend_limiter_magnitude = amrex::Real(1.0)
 
bool enable_vh96_shear_correction = false
 Whether Vogelezang & Holtslag (1996) shear-correction term is enabled. More...
 
amrex::Real vh96_shear_const_b = amrex::Real(100.0)
 Vogelezang & Holtslag (1996) shear-correction constant b. More...
 
bool enable_pblh_smoothing = false
 Whether spatial smoothing of diagnosed PBLH is enabled. More...
 
int pblh_smoothing_passes = 1
 Number of PBLH smoothing iterations to apply. More...
 
amrex::Real pblh_smoothing_weight = amrex::Real(0.5)
 Center-cell weight in PBLH smoothing stencil (must be in [0,1]). More...
 
amrex::Real pbl_mrf_coriolis_freq = amrex::Real(1.0e-4)
 Coriolis frequency used by the MRF PBL scheme. More...
 
amrex::Real pbl_mrf_Ribcr = amrex::Real(0.5)
 Critical bulk Richardson number for the MRF PBL scheme. More...
 
amrex::Real pbl_mrf_const_b = amrex::Real(7.8)
 MRF constant used to compute PBL height. More...
 
amrex::Real pbl_mrf_sf = amrex::Real(0.1)
 MRF surface flux value used to compute PBL height. More...
 
amrex::Real pbl_blend_length = amrex::Real(0.0)
 Boutle blending length L [m]. 0 = off. More...
 
amrex::Real pbl_blend_cs = amrex::Real(0.17)
 Smagorinsky coeff for K_h ceiling. More...
 
amrex::Real pbl_blend_c_max = amrex::Real(0.1)
 Power-law ceiling coeff [m^(2/3)/s]. More...
 
bool pbl_blend_use_smag = true
 Use Smagorinsky ceiling (else power-law). More...
 
bool enable_mrf_countergradient = false
 Whether MRF countergradient corrections are enabled. More...
 
bool pbl_ib_aware = false
 
amrex::Real pbl_ib_z0 = amrex::Real(0.01)
 
bool enable_mrf_cloud_adjustment = false
 Whether MRF cloud-aware stability adjustments are enabled. More...
 
bool pbl_mrf_highres_bounds = false
 Whether MRF applies high-resolution grid-dependent diffusivity bounds. More...
 
amrex::Real pbl_mrf_Sc_t = amrex::Real(0)
 MRF turbulent Schmidt number of the passive scalars (erf.pbl_mrf_Sc_t): their vertical diffusivity is the heat one times erf.Pr_t / Sc_t; 0 (the default) leaves it equal to the heat one. More...
 
bool enable_mrf_unbounded_vpert = false
 Whether MRF leaves VPERT unlimited by GAMCRT. More...
 
bool pbl_mrf_use_zero_ri_extent = false
 Whether MRF uses the Ri=0 K-profile extent. More...
 
bool mrf_fire_thermal_excess = false
 
amrex::Real mrf_fire_q_threshold = amrex::Real(50.0)
 
bool enable_qnse_stable_functions = false
 
amrex::Real qnse_am = amrex::Real(2.5)
 
amrex::Real qnse_bm = amrex::Real(0.2)
 
amrex::Real qnse_ah = amrex::Real(2.5)
 
amrex::Real qnse_bh = amrex::Real(0.2)
 
bool advect_tke = true
 Whether TKE/QKE is advected. More...
 
bool diffuse_tke_3D = true
 Whether three-dimensional numerical diffusion is applied to TKE/QKE. More...
 

Detailed Description

Container holding quantities related to turbulence parametrizations

Member Function Documentation

◆ check_params()

void TurbChoice::check_params ( amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &  phys_bc_type)
inline

Validate turbulence options against physical boundary conditions.

Parameters
phys_bc_typePhysical boundary-condition types.
672  {
673  // BC compatibility
675  phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer ) {
676  amrex::Abort("The selected PBL model requires MOST at lower boundary");
677  }
678  if ( (les_type == LESType::Deardorff) && (Ce_wall > 0) &&
679  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer) &&
680  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::slip_wall) &&
681  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::no_slip_wall) )
682  {
683  amrex::Warning("Deardorff LES assumes wall at zlo when applying Ce_wall");
684  }
685  }
@ no_slip_wall
@ surface_layer
amrex::Real Ce_wall
Wall value for the Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:932
LESType les_type
Selected LES closure.
Definition: ERF_TurbStruct.H:909
bool pbl_requires_surface_layer() const noexcept
Query whether the selected PBL scheme requires surface-layer boundary conditions.
Definition: ERF_TurbStruct.H:1039
Here is the call graph for this function:

◆ display()

void TurbChoice::display ( int  lev)
inline

Print turbulence settings for one AMR level.

Parameters
levAMR level index.
692  {
693  amrex::Print() << "Turbulence Settings at level " << lev << std::endl;
694 
695  if (
697  pbl_type == PBLType::None) {
698  amrex::Print() << " Using DNS model at level " << lev << std::endl;
699  } else if (les_type == LESType::Smagorinsky) {
700  if (smag2d) {
701  amrex::Print() << " Using 2D Smagorinsky LES model at level " << lev << std::endl;
702  } else {
703  amrex::Print() << " Using Smagorinsky LES model at level " << lev << std::endl;
704  }
705  if (use_Ri_correction) {
706  amrex::Print() << " Smagorinsky uses Richardson number correction with Ri_crit = "
707  << Ri_crit << std::endl;
708  }
709  if (smag2d) {
710  amrex::Print() << " WRF slope limiter : " << smag2d_slope_limiter << std::endl;
711  if (smag2d_kh_cap > zero) {
712  amrex::Print() << " K_h cap : " << smag2d_kh_cap << " * Delta_h" << std::endl;
713  } else {
714  amrex::Print() << " K_h cap : none" << std::endl;
715  }
716  }
717  } else if (les_type == LESType::Deardorff) {
718  amrex::Print() << " Using Deardorff LES model at level " << lev << std::endl;
719  } else if (rans_type == RANSType::kEqn) {
720  amrex::Print()
721  << " Using Axell & Liungman one-equation RANS k model at level " << lev
722  << std::endl;
723  } else if (pbl_type == PBLType::MYJ) {
724  amrex::Print() << " Using MYJ PBL model at level " << lev << std::endl;
725  } else if (pbl_type == PBLType::MYNN25) {
726  amrex::Print() << " Using MYNN2.5 PBL model at level " << lev << std::endl;
727  } else if (pbl_type == PBLType::MYNNEDMF) {
728  amrex::Print() << " Using MYNNEDMF PBL model at level " << lev << std::endl;
729  } else if (pbl_type == PBLType::YSU) {
730  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
731  } else if (pbl_type == PBLType::MRF) {
732  amrex::Print() << " Using MRF PBL model at level " << lev << std::endl;
733  } else if (pbl_type == PBLType::NATIVE_SHOC) {
734  amrex::Print() << " Using native SHOC PBL model at level " << lev << std::endl;
735  } else {
736  amrex::Error("Unknown turbulence model");
737  }
738 
739  if (les_type != LESType::None) {
740  if (les_type == LESType::Smagorinsky) {
741  amrex::Print() << " Cs : " << Cs << std::endl;
742  }
743  if (les_type == LESType::Deardorff) {
744  amrex::Print() << " Ce : " << Ce << std::endl;
745  amrex::Print() << " Ce at wall : " << Ce_wall << std::endl;
746  amrex::Print() << " Ck : " << Ck << std::endl;
747  amrex::Print() << " sigma_k : " << sigma_k << std::endl;
748 
749  // Sullivan et al 1994, Eqn 14
750  amrex::Real Cs_equiv = std::sqrt(Ck * std::sqrt(Ck / Ce));
751  amrex::Print() << " equivalent Cs : " << Cs_equiv
752  << std::endl;
753  }
754  amrex::Print() << " isotropic mixing : " << mix_isotropic
755  << std::endl;
756  }
757 
758  if (rans_type != RANSType::None) {
759  if (rans_type == RANSType::kEqn) {
760  amrex::Print() << "Cmu0 : " << Cmu0 << std::endl;
761  amrex::Print() << "sigma_k : " << sigma_k << std::endl;
762  amrex::Print() << "Cb : " << Cb << std::endl;
763  amrex::Print() << "Rt_crit : " << Rt_crit << std::endl;
764  amrex::Print() << "Rt_min : " << Rt_min << std::endl;
765  amrex::Print() << "max_geom_lscale : " << l_g_max << std::endl;
766  amrex::Print() << "rans_realizability : " << rans_realizability << std::endl;
767  amrex::Print() << "rans_shear_stencil : " << amrex::getEnumNameString(rans_shear_stencil) << std::endl;
768  amrex::Print() << "rans_moist_buoyancy : " << rans_moist_buoyancy << std::endl;
769  amrex::Print() << "dirichlet_k : " << dirichlet_k << std::endl;
770  amrex::Print() << "tke_floor : " << tke_floor << std::endl;
771  amrex::Print() << "implicit_tke_dissipation : " << implicit_tke_dissipation << std::endl;
772  amrex::Print() << "consistent diffusivities : " << rans_consistent_diffusivities << std::endl;
773  amrex::Print() << "lscale cap from PBL height : " << rans_lscale_from_pblh
774  << " (floor " << rans_lscale_min << " m)" << std::endl;
775  }
776  }
777 
778  if ((les_type == LESType::Deardorff) ||
779  (rans_type == RANSType::kEqn)) {
780  if (theta_ref > 0) {
781  amrex::Print() << " reference theta : " << theta_ref << std::endl;
782  } else {
783  amrex::Print() << " reference theta : n/a" << std::endl;
784  }
785  }
786 
787  if ((les_type != LESType::None) || (rans_type != RANSType::None)) {
788  amrex::Print() << " Pr_t : " << Pr_t << std::endl;
789  amrex::Print() << " Sc_t : " << Sc_t << std::endl;
790  }
791 
792  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
793  amrex::Print() << " pbl_mynn_config : "
794  << amrex::getEnumNameString(pbl_mynn.config) << std::endl;
795  amrex::Print() << " pbl_mynn_Lt_alpha : " << pbl_mynn.Lt_alpha << std::endl;
796  amrex::Print() << " pbl_mynn_A1 : " << pbl_mynn.A1 << std::endl;
797  amrex::Print() << " pbl_mynn_A2 : " << pbl_mynn.A2 << std::endl;
798  amrex::Print() << " pbl_mynn_B1 : " << pbl_mynn.B1 << std::endl;
799  amrex::Print() << " pbl_mynn_B2 : " << pbl_mynn.B2 << std::endl;
800  amrex::Print() << " pbl_mynn_C1 : " << pbl_mynn.C1 << std::endl;
801  amrex::Print() << " pbl_mynn_C2 : " << pbl_mynn.C2 << std::endl;
802  amrex::Print() << " pbl_mynn_C3 : " << pbl_mynn.C3 << std::endl;
803  amrex::Print() << " pbl_mynn_C4 : " << pbl_mynn.C4 << std::endl;
804  amrex::Print() << " pbl_mynn_C5 : " << pbl_mynn.C5 << std::endl;
805  amrex::Print() << " pbl_mynn_surface_lm : " << pbl_mynn.surface_lm << std::endl;
806  } else if (pbl_type == PBLType::YSU) {
807  amrex::Print() << " pbl_ysu_coriolis_freq : "
808  << pbl_ysu_coriolis_freq << std::endl;
809  amrex::Print() << " pbl_ysu_use_consistent_coriolis : "
810  << pbl_ysu_use_consistent_coriolis << std::endl;
811  amrex::Print() << " pbl_ysu_land_Ribcr : "
812  << pbl_ysu_land_Ribcr << std::endl;
813  amrex::Print() << " enable_ysu_countergradient : "
814  << enable_ysu_countergradient << std::endl;
815  amrex::Print() << " enable_ysu_sat_limiter : "
816  << enable_ysu_sat_limiter << std::endl;
817  amrex::Print() << " enable_ysu_topdown : "
818  << enable_ysu_topdown << std::endl;
819  amrex::Print() << " enable_ysu_entrainment : "
820  << enable_ysu_entrainment << std::endl;
821  amrex::Print() << " enable_ysu_cloud_pblh : "
822  << enable_ysu_cloud_pblh << std::endl;
823  amrex::Print() << " ysu_qcloud_threshold : "
824  << ysu_qcloud_threshold << std::endl;
825  amrex::Print() << " ysu_moistvars : "
826  << ysu_moistvars << std::endl;
827  amrex::Print() << " pbl_ysunew_highres_bounds : "
828  << pbl_ysunew_highres_bounds << std::endl;
829  // Radiative tendency limiter/smoothing (YSU only)
830  amrex::Print() << " enable_ysu_rad_tend_limiter : "
831  << enable_ysu_rad_tend_limiter << std::endl;
832  amrex::Print() << " ysu_rad_tend_limiter_magnitude : "
833  << ysu_rad_tend_limiter_magnitude << std::endl;
834  amrex::Print() << " enable_vh96_shear_correction : "
835  << enable_vh96_shear_correction << std::endl;
836  amrex::Print() << " vh96_shear_const_b : "
837  << vh96_shear_const_b << std::endl;
838  amrex::Print() << " enable_pblh_smoothing : "
839  << enable_pblh_smoothing << std::endl;
840  amrex::Print() << " pblh_smoothing_passes : "
841  << pblh_smoothing_passes << std::endl;
842  amrex::Print() << " pblh_smoothing_weight : "
843  << pblh_smoothing_weight << std::endl;
844  amrex::Print() << " enable_mrf_unbounded_vpert : "
845  << enable_mrf_unbounded_vpert << std::endl;
846  amrex::Print() << " enable_qnse_stable_functions : "
847  << enable_qnse_stable_functions << std::endl;
849  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
850  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
851  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
852  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
853  }
854  } else if (pbl_type == PBLType::MRF) {
855  amrex::Print() << " pbl_mrf_coriolis_freq : " << pbl_mrf_coriolis_freq
856  << std::endl;
857  amrex::Print() << " pbl_mrf_Ribcr : " << pbl_mrf_Ribcr
858  << std::endl;
859  amrex::Print() << " pbl_mrf_const_b : " << pbl_mrf_const_b
860  << std::endl;
861  amrex::Print() << " pbl_mrf_sf : " << pbl_mrf_sf
862  << std::endl;
863  amrex::Print() << " enable_mrf_countergradient : " << enable_mrf_countergradient
864  << std::endl;
865  amrex::Print() << " enable_mrf_cloud_adjustment : " << enable_mrf_cloud_adjustment
866  << std::endl;
867  amrex::Print() << " pbl_mrf_highres_bounds : " << pbl_mrf_highres_bounds
868  << std::endl;
869  amrex::Print() << " pbl_mrf_Sc_t : " << pbl_mrf_Sc_t
870  << std::endl;
871  amrex::Print() << " enable_mrf_unbounded_vpert : " << enable_mrf_unbounded_vpert
872  << std::endl;
873  amrex::Print() << " pbl_mrf_use_zero_ri_extent : " << pbl_mrf_use_zero_ri_extent
874  << std::endl;
875  amrex::Print() << " pbl_mrf_fire_thermal_excess : " << mrf_fire_thermal_excess
876  << std::endl;
877  amrex::Print() << " mrf_fire_q_threshold : " << mrf_fire_q_threshold
878  << std::endl;
879  amrex::Print() << " pbl_blend_length : " << pbl_blend_length
880  << std::endl;
881  amrex::Print() << " pbl_blend_cs : " << pbl_blend_cs
882  << std::endl;
883  amrex::Print() << " pbl_blend_c_max : " << pbl_blend_c_max
884  << std::endl;
885  amrex::Print() << " pbl_blend_use_smag : " << pbl_blend_use_smag
886  << std::endl;
887  amrex::Print() << " enable_vh96_shear_correction : " << enable_vh96_shear_correction
888  << std::endl;
889  amrex::Print() << " vh96_shear_const_b : " << vh96_shear_const_b
890  << std::endl;
891  amrex::Print() << " enable_pblh_smoothing : " << enable_pblh_smoothing
892  << std::endl;
893  amrex::Print() << " pblh_smoothing_passes : " << pblh_smoothing_passes
894  << std::endl;
895  amrex::Print() << " pblh_smoothing_weight : " << pblh_smoothing_weight
896  << std::endl;
897  amrex::Print() << " enable_qnse_stable_functions : "
898  << enable_qnse_stable_functions << std::endl;
900  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
901  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
902  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
903  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
904  }
905  }
906  }
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
@ None
Definition: ERF_LSM_Types.H:6
amrex::Real Lt_alpha
Definition: ERF_MYNNStruct.H:77
amrex::Real C4
Definition: ERF_MYNNStruct.H:57
amrex::Real C1
Definition: ERF_MYNNStruct.H:54
MYNNConfigType config
Definition: ERF_MYNNStruct.H:71
amrex::Real C3
Definition: ERF_MYNNStruct.H:56
amrex::Real C2
Definition: ERF_MYNNStruct.H:55
amrex::Real A2
Definition: ERF_MYNNStruct.H:51
amrex::Real B1
Definition: ERF_MYNNStruct.H:52
amrex::Real B2
Definition: ERF_MYNNStruct.H:53
amrex::Real C5
Definition: ERF_MYNNStruct.H:58
bool surface_lm
Definition: ERF_MYNNStruct.H:82
amrex::Real A1
Definition: ERF_MYNNStruct.H:50
bool implicit_tke_dissipation
Definition: ERF_TurbStruct.H:971
bool rans_consistent_diffusivities
Definition: ERF_TurbStruct.H:976
amrex::Real Ce
Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:931
amrex::Real pbl_mrf_Sc_t
MRF turbulent Schmidt number of the passive scalars (erf.pbl_mrf_Sc_t): their vertical diffusivity is...
Definition: ERF_TurbStruct.H:1128
bool enable_mrf_unbounded_vpert
Whether MRF leaves VPERT unlimited by GAMCRT.
Definition: ERF_TurbStruct.H:1129
amrex::Real Sc_t
Turbulent Schmidt number.
Definition: ERF_TurbStruct.H:916
amrex::Real sigma_k
TKE diffusivity coefficient denominator.
Definition: ERF_TurbStruct.H:944
bool use_Ri_correction
Whether Richardson-number correction is applied.
Definition: ERF_TurbStruct.H:956
bool pbl_ysu_use_consistent_coriolis
Whether YSU uses the ERF Coriolis frequency.
Definition: ERF_TurbStruct.H:1082
amrex::Real pbl_blend_length
Boutle blending length L [m]. 0 = off.
Definition: ERF_TurbStruct.H:1119
amrex::Real Ck
Deardorff eddy-viscosity coefficient.
Definition: ERF_TurbStruct.H:933
bool pbl_mrf_use_zero_ri_extent
Whether MRF uses the Ri=0 K-profile extent.
Definition: ERF_TurbStruct.H:1130
amrex::Real qnse_ah
Definition: ERF_TurbStruct.H:1142
amrex::Real mrf_fire_q_threshold
Definition: ERF_TurbStruct.H:1132
RANSType rans_type
Selected RANS closure.
Definition: ERF_TurbStruct.H:960
RANSShearStencil rans_shear_stencil
Definition: ERF_TurbStruct.H:994
bool enable_vh96_shear_correction
Whether Vogelezang & Holtslag (1996) shear-correction term is enabled.
Definition: ERF_TurbStruct.H:1106
amrex::Real theta_ref
Reference potential temperature for stable stratification.
Definition: ERF_TurbStruct.H:947
amrex::Real l_g_max
Maximum geometric length scale.
Definition: ERF_TurbStruct.H:940
bool enable_mrf_cloud_adjustment
Whether MRF cloud-aware stability adjustments are enabled.
Definition: ERF_TurbStruct.H:1126
bool enable_ysu_entrainment
Whether YSU entrainment-layer parameterization is enabled.
Definition: ERF_TurbStruct.H:1093
bool enable_ysu_sat_limiter
Whether YSU applies a saturation limiter to moisture countergradient terms.
Definition: ERF_TurbStruct.H:1089
bool enable_ysu_cloud_pblh
Whether the YSU PBL-top cell index is raised by one where that cell is cloudy.
Definition: ERF_TurbStruct.H:1095
amrex::Real pbl_mrf_const_b
MRF constant used to compute PBL height.
Definition: ERF_TurbStruct.H:1114
amrex::Real pblh_smoothing_weight
Center-cell weight in PBLH smoothing stencil (must be in [0,1]).
Definition: ERF_TurbStruct.H:1110
amrex::Real pbl_blend_cs
Smagorinsky coeff for K_h ceiling.
Definition: ERF_TurbStruct.H:1120
amrex::Real tke_floor
Definition: ERF_TurbStruct.H:967
amrex::Real ysu_qcloud_threshold
Cloud water plus cloud ice threshold for YSU [kg/kg].
Definition: ERF_TurbStruct.H:1098
amrex::Real qnse_bm
Definition: ERF_TurbStruct.H:1141
amrex::Real pbl_blend_c_max
Power-law ceiling coeff [m^(2/3)/s].
Definition: ERF_TurbStruct.H:1121
amrex::Real qnse_bh
Definition: ERF_TurbStruct.H:1143
bool enable_qnse_stable_functions
Definition: ERF_TurbStruct.H:1138
bool enable_mrf_countergradient
Whether MRF countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:1123
bool enable_ysu_countergradient
Whether YSU countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:1087
bool mix_isotropic
Whether subgrid mixing uses isotropic length scales.
Definition: ERF_TurbStruct.H:954
bool enable_pblh_smoothing
Whether spatial smoothing of diagnosed PBLH is enabled.
Definition: ERF_TurbStruct.H:1108
amrex::Real smag2d_kh_cap
Cap K_h <= smag2d_kh_cap * Delta_h for Smagorinsky-2D (m/s); 0 means no cap.
Definition: ERF_TurbStruct.H:925
bool rans_moist_buoyancy
Definition: ERF_TurbStruct.H:1000
bool dirichlet_k
Whether TKE uses Dirichlet boundary treatment.
Definition: ERF_TurbStruct.H:962
int pblh_smoothing_passes
Number of PBLH smoothing iterations to apply.
Definition: ERF_TurbStruct.H:1109
amrex::Real rans_realizability
Definition: ERF_TurbStruct.H:989
bool enable_ysu_topdown
Whether YSU top-down mixing is enabled.
Definition: ERF_TurbStruct.H:1091
bool rans_lscale_from_pblh
Definition: ERF_TurbStruct.H:981
amrex::Real ysu_rad_tend_limiter_magnitude
Definition: ERF_TurbStruct.H:1104
amrex::Real rans_lscale_min
Definition: ERF_TurbStruct.H:982
bool pbl_mrf_highres_bounds
Whether MRF applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:1127
bool mrf_fire_thermal_excess
Definition: ERF_TurbStruct.H:1131
amrex::Real Rt_min
Minimum turbulent Reynolds number.
Definition: ERF_TurbStruct.H:939
bool pbl_blend_use_smag
Use Smagorinsky ceiling (else power-law).
Definition: ERF_TurbStruct.H:1122
MYNNLevel25 pbl_mynn
MYNN level-2.5 closure coefficients.
Definition: ERF_TurbStruct.H:1057
amrex::Real pbl_ysu_land_Ribcr
Critical bulk Richardson number over land for stable YSU conditions.
Definition: ERF_TurbStruct.H:1085
amrex::Real Cb
One-equation RANS buoyancy coefficient.
Definition: ERF_TurbStruct.H:937
amrex::Real Ri_crit
Critical Richardson number for stability correction.
Definition: ERF_TurbStruct.H:957
amrex::Real Rt_crit
Critical turbulent Reynolds number.
Definition: ERF_TurbStruct.H:938
amrex::Real vh96_shear_const_b
Vogelezang & Holtslag (1996) shear-correction constant b.
Definition: ERF_TurbStruct.H:1107
amrex::Real pbl_mrf_Ribcr
Critical bulk Richardson number for the MRF PBL scheme.
Definition: ERF_TurbStruct.H:1113
amrex::Real qnse_am
Definition: ERF_TurbStruct.H:1140
amrex::Real pbl_mrf_sf
MRF surface flux value used to compute PBL height.
Definition: ERF_TurbStruct.H:1115
amrex::Real Cmu0
One-equation RANS Cmu0 coefficient.
Definition: ERF_TurbStruct.H:936
amrex::Real Cs
Smagorinsky model coefficient.
Definition: ERF_TurbStruct.H:920
amrex::Real Pr_t
Turbulent Prandtl number.
Definition: ERF_TurbStruct.H:912
bool smag2d_slope_limiter
Apply WRF's Smagorinsky-2D slope limiter (K_h / alpha or / alpha^2) on terrain-fitted meshes.
Definition: ERF_TurbStruct.H:924
amrex::Real pbl_mrf_coriolis_freq
Coriolis frequency used by the MRF PBL scheme.
Definition: ERF_TurbStruct.H:1112
bool pbl_ysunew_highres_bounds
Whether YSU applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:1101
amrex::Real pbl_ysu_coriolis_freq
Coriolis frequency used by YSU-family PBL schemes.
Definition: ERF_TurbStruct.H:1079
bool ysu_moistvars
Whether YSU applies turbulence to moisture variables.
Definition: ERF_TurbStruct.H:1100
PBLType pbl_type
Selected PBL closure.
Definition: ERF_TurbStruct.H:1003
bool smag2d
Whether the 2-D Smagorinsky formulation is used.
Definition: ERF_TurbStruct.H:921
bool enable_ysu_rad_tend_limiter
Definition: ERF_TurbStruct.H:1103

◆ init_params()

void TurbChoice::init_params ( int  lev,
int  max_level,
std::string  pp_prefix 
)
inline

Read turbulence options for one AMR level from the input parameter database.

Parameters
levAMR level index.
max_levelMaximum AMR level configured for the run.
pp_prefixParmParse prefix for the ERF input namespace.
138  {
139  amrex::ParmParse pp(pp_prefix);
140 
141  // Which LES closure?
142  query_one_or_per_level(pp, "les_type", les_type, lev, max_level);
143  // Immersed-boundary awareness of the MRF and YSU schemes (off by default):
144  // the surface of a column with immersed solid cells is the first fluid cell
145  // above them, heights and the boundary-layer depth are measured from it,
146  // the eddy diffusivities are zero inside the solid, and the surface
147  // scales over such a column come from a neutral log law at its top with
148  // the roughness pbl_ib_z0. Only MRF and YSU honor it.
149  query_one_or_per_level(pp, "pbl_ib_aware", pbl_ib_aware, lev, max_level);
150  query_one_or_per_level(pp, "pbl_ib_z0", pbl_ib_z0, lev, max_level);
151 
152  // Handle 2-D Smag
153  if (les_type == LESType::Smagorinsky2D) {
154  les_type = LESType::Smagorinsky;
155  smag2d = true;
156  }
157 
158  // Which RANS closure?
159  query_one_or_per_level(pp, "rans_type", rans_type, lev, max_level);
160 
161  if ((rans_type != RANSType::None) && (les_type != LESType::None)) {
162  amrex::Error("Hybrid RANS-LES not implemented");
163  }
164 
165  // Which PBL Closure
166  query_one_or_per_level_enum_case_insensitive(pp, "pbl_type", pbl_type, lev, max_level);
167  // SHOC used to select the EAMxx SHOC, which has been removed; it now selects native SHOC
168  if (pbl_type == PBLType::SHOC) {
169  static bool warned_legacy_shoc = false;
170  if (!warned_legacy_shoc && amrex::ParallelDescriptor::IOProcessor()) {
171  amrex::Warning("erf.pbl_type = SHOC now selects the native SHOC (erf.pbl_type = NATIVE_SHOC); "
172  "it used to select the EAMxx SHOC, which has been removed");
173  }
174  warned_legacy_shoc = true;
175  pbl_type = PBLType::NATIVE_SHOC;
176  }
177  if (pbl_type == PBLType::EAMXX_SHOC) {
178  amrex::Abort("erf.pbl_type = EAMXX_SHOC is no longer available: the EAMxx SHOC has been "
179  "removed; use erf.pbl_type = NATIVE_SHOC");
180  }
181  // The former YSUNew is now the only YSU; the name is still accepted
182  if (pbl_type == PBLType::YSUNew) {
183  static bool warned_ysunew = false;
184  if (!warned_ysunew && amrex::ParallelDescriptor::IOProcessor()) {
185  amrex::Warning("erf.pbl_type = YSUNew is deprecated; it is now erf.pbl_type = YSU");
186  }
187  warned_ysunew = true;
188  pbl_type = PBLType::YSU;
189  }
190 
191  // Do some more stuff for PBL Modeling
192  if (pbl_type != PBLType::None) {
193  // Check for compatibility between PBL, LES, Molec Transport
194  if (les_type != LESType::None) {
195  amrex::Print() << "Selected a PBL model and an LES model: "
196  << "Using PBL for vertical transport, LES for horizontal"
197  << std::endl;
198  }
199  if (les_type == LESType::Smagorinsky) {
200  if (!smag2d)
201  amrex::Error("If using Smagorinsky with a PBL model, the 2-D "
202  "formulation should be used");
203  } else if (les_type == LESType::Deardorff) {
204  amrex::Error(
205  "It is not recommended to use Deardorff LES and a PBL model");
206  }
207  // Both the k-eqn RANS closure and these PBL schemes transport RhoKE
208  if ((rans_type == RANSType::kEqn) &&
209  ((pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
210  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family())) {
211  amrex::Error("erf.rans_type = kEqn cannot be combined with erf.pbl_type = " +
212  std::string(amrex::getEnumNameString(pbl_type)) +
213  ": both transport the turbulent kinetic energy");
214  }
215 
216  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
217  // NN09 (the default) uses Lt_alpha = 0.23 and a 1/l sum for the master
218  // length scale; Chen2021 uses Lt_alpha = 0.10 and a 1/l^2 sum.
220  pp, "pbl_mynn_config", pbl_mynn.config, lev, max_level);
221  // l_T = Lt_alpha*<zq>/<q> follows the config unless set explicitly.
222  pbl_mynn.Lt_alpha = (pbl_mynn.config == MYNNConfigType::Chen2021)
223  ? amrex::Real(0.1) : amrex::Real(0.23);
225  pp, "pbl_mynn_Lt_alpha", pbl_mynn.Lt_alpha, lev, max_level);
226  query_one_or_per_level(pp, "pbl_mynn_A1", pbl_mynn.A1, lev, max_level);
227  query_one_or_per_level(pp, "pbl_mynn_A2", pbl_mynn.A2, lev, max_level);
228  query_one_or_per_level(pp, "pbl_mynn_B1", pbl_mynn.B1, lev, max_level);
229  query_one_or_per_level(pp, "pbl_mynn_B2", pbl_mynn.B2, lev, max_level);
230  query_one_or_per_level(pp, "pbl_mynn_C1", pbl_mynn.C1, lev, max_level);
231  query_one_or_per_level(pp, "pbl_mynn_C2", pbl_mynn.C2, lev, max_level);
232  query_one_or_per_level(pp, "pbl_mynn_C3", pbl_mynn.C3, lev, max_level);
233  query_one_or_per_level(pp, "pbl_mynn_C4", pbl_mynn.C4, lev, max_level);
234  query_one_or_per_level(pp, "pbl_mynn_C5", pbl_mynn.C5, lev, max_level);
238  // Moisture is now always diffused by MYNN, as it is by every other
239  // PBL scheme; catch the retired flag rather than ignoring it silently.
240  if (pp.contains("pbl_mynn_diffuse_moistvars")) {
241  amrex::Abort("erf.pbl_mynn_diffuse_moistvars has been removed. "
242  "MYNN always diffuses the moisture variables now, as "
243  "MYJ, YSU, MRF and SHOC always have; there is no "
244  "longer a way to turn it off.");
245  }
247  pp, "pbl_mynn_SMmin", pbl_mynn.SMmin, lev, max_level);
249  pp, "pbl_mynn_SMmax", pbl_mynn.SMmax, lev, max_level);
251  pp, "pbl_mynn_SHmin", pbl_mynn.SHmin, lev, max_level);
253  pp, "pbl_mynn_SHmax", pbl_mynn.SHmax, lev, max_level);
255  pp, "pbl_mynn_SQfactor", pbl_mynn.SQfac, lev, max_level);
256 
257  // SQ = SQfac*SM, so its bound is tied to SHmax and SQfac; the default member
258  // initializer was evaluated before either could be overridden here.
260 
261  // Surface-layer length scale alone in the first cell (see MYNNLevel25::surface_lm).
263  pp, "pbl_mynn_surface_lm", pbl_mynn.surface_lm, lev, max_level);
264  if (pbl_mynn.surface_lm && pbl_type != PBLType::MYNN25) {
265  amrex::Abort("erf.pbl_mynn_surface_lm is only implemented for erf.pbl_type = MYNN25");
266  }
267 
268  } else if (pbl_type == PBLType::YSU) {
270  pp, "pbl_ysu_coriolis_freq", pbl_ysu_coriolis_freq, lev, max_level);
272  pp, "pbl_ysu_use_consistent_coriolis",
273  pbl_ysu_use_consistent_coriolis, lev, max_level);
275  pp, "pbl_ysu_land_Ribcr", pbl_ysu_land_Ribcr, lev, max_level);
276  // Only the YSU that the former YSUNew replaced read these; catch them rather
277  // than ignoring them silently.
278  for (const char* removed : {"pbl_ysu_force_over_water", "pbl_ysu_unst_Ribcr"}) {
279  if (pp.contains(removed)) {
280  amrex::Abort(std::string("erf.") + removed + " has been removed along with "
281  "the original YSU scheme; erf.pbl_type = YSU (formerly YSUNew) "
282  "does not use it.");
283  }
284  }
285  // YSU now uses theta_v at WRF's thvx sites and theta_l at its thlix
286  // sites; catch the retired switch between them rather than ignoring it.
287  if (pp.contains("enable_ysu_liquid_theta")) {
288  amrex::Abort("erf.enable_ysu_liquid_theta has been removed. YSU uses "
289  "theta_v (all condensate loading) for the bulk Richardson "
290  "number and clear-sky entrainment, and theta_l (cloud "
291  "liquid and ice) for the cloud-top extension scan and "
292  "cloudy entrainment, as WRF does with thvx and thlix.");
293  }
295  pp, "enable_ysu_countergradient", enable_ysu_countergradient, lev, max_level);
296  // The floor of the YSU PBL height is the top face of the first cell on
297  // every mesh type. This switch selected it on terrain-fitted and
298  // stretched meshes (its default); constant-dz meshes, where the floor was
299  // the first cell center, now use it too (erf-model/ERF#5252). Catch the
300  // retired switch rather than ignoring it.
301  if (pp.contains("enable_ysu_terrain_pblh_floor")) {
302  amrex::Abort("erf.enable_ysu_terrain_pblh_floor has been removed. The floor "
303  "of the YSU PBL height is the top face of the first cell (at "
304  "least 10 m) on every mesh type (erf-model/ERF#5252).");
305  }
307  pp, "enable_ysu_sat_limiter", enable_ysu_sat_limiter, lev, max_level);
309  pp, "enable_ysu_topdown", enable_ysu_topdown, lev, max_level);
311  pp, "enable_ysu_entrainment", enable_ysu_entrainment, lev, max_level);
313  pp, "enable_ysu_cloud_pblh", enable_ysu_cloud_pblh, lev, max_level);
315  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
317  pp, "ysu_qcloud_threshold", ysu_qcloud_threshold, lev, max_level);
318  // A negative threshold would count every cell as cloudy, clear air included
320  "erf.ysu_qcloud_threshold must not be negative");
322  pp, "ysu_moistvars", ysu_moistvars, lev, max_level);
324  pp, "pbl_ysunew_highres_bounds", pbl_ysunew_highres_bounds, lev, max_level);
325  // Radiative tendency limiter (YSU only)
327  pp, "enable_ysu_rad_tend_limiter", enable_ysu_rad_tend_limiter, lev, max_level);
329  pp, "ysu_rad_tend_limiter_magnitude", ysu_rad_tend_limiter_magnitude, lev, max_level);
330  if (!(ysu_rad_tend_limiter_magnitude > 0.0)) {
331  if (amrex::ParallelDescriptor::IOProcessor()) {
332  amrex::Print() << "WARNING: erf.ysu_rad_tend_limiter_magnitude = "
334  << " is not positive; using the default of 1.0 K/s\n";
335  }
336  ysu_rad_tend_limiter_magnitude = amrex::Real(1.0);
337  }
338  // Vogelezang & Holtslag (1996) shear correction
340  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
342  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
343  // PBLH spatial smoothing
345  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
347  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
349  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
350  // Validate pblh_smoothing_weight is in [0,1]
351  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
352  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
353  }
354  // QNSE stable stability functions (Sukoriansky et al. 2005)
356  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
358  pp, "qnse_am", qnse_am, lev, max_level);
360  pp, "qnse_bm", qnse_bm, lev, max_level);
362  pp, "qnse_ah", qnse_ah, lev, max_level);
364  pp, "qnse_bh", qnse_bh, lev, max_level);
365  } else if (pbl_type == PBLType::MRF) {
367  pp, "pbl_mrf_coriolis_freq", pbl_mrf_coriolis_freq, lev, max_level);
369  pp, "pbl_mrf_Ribcr", pbl_mrf_Ribcr, lev, max_level);
371  pp, "pbl_mrf_const_b", pbl_mrf_const_b, lev, max_level);
372  query_one_or_per_level(pp, "pbl_mrf_sf", pbl_mrf_sf, lev, max_level);
374  pp, "enable_mrf_countergradient", enable_mrf_countergradient, lev, max_level);
376  pp, "enable_mrf_cloud_adjustment", enable_mrf_cloud_adjustment, lev, max_level);
378  pp, "pbl_mrf_highres_bounds", pbl_mrf_highres_bounds, lev, max_level);
379  query_one_or_per_level(pp, "pbl_mrf_Sc_t", pbl_mrf_Sc_t, lev, max_level);
380  if (pbl_mrf_Sc_t < amrex::Real(0)) {
381  amrex::Abort("erf.pbl_mrf_Sc_t must be >= 0 (0: the passive scalars mix as heat does)");
382  }
384  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
386  pp, "pbl_mrf_use_zero_ri_extent", pbl_mrf_use_zero_ri_extent, lev, max_level);
388  pp, "pbl_mrf_fire_thermal_excess", mrf_fire_thermal_excess, lev, max_level);
390  pp, "mrf_fire_q_threshold", mrf_fire_q_threshold, lev, max_level);
391  if (mrf_fire_q_threshold < amrex::Real(0)) {
392  amrex::Abort("erf.mrf_fire_q_threshold must be >= 0");
393  }
394 #ifndef ERF_USE_FIRE
396  amrex::Abort("erf.pbl_mrf_fire_thermal_excess = true needs the fire coupling"
397  "; rebuild with it (CMake ERF_ENABLE_FIRE=ON, GNU make USE_FIRE=TRUE)");
398  }
399 #endif
400  // QNSE stable stability functions (Sukoriansky et al. 2005)
402  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
404  pp, "qnse_am", qnse_am, lev, max_level);
406  pp, "qnse_bm", qnse_bm, lev, max_level);
408  pp, "qnse_ah", qnse_ah, lev, max_level);
410  pp, "qnse_bh", qnse_bh, lev, max_level);
411  // Scale-aware PBL-LES blending parameters.
413  pp, "pbl_blend_length", pbl_blend_length, lev, max_level);
415  pp, "pbl_blend_cs", pbl_blend_cs, lev, max_level);
417  pp, "pbl_blend_c_max", pbl_blend_c_max, lev, max_level);
419  pp, "pbl_blend_use_smag", pbl_blend_use_smag, lev, max_level);
420  // Vogelezang & Holtslag (1996) shear correction
422  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
424  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
425  // PBLH spatial smoothing
427  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
429  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
431  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
432  // Validate pblh_smoothing_weight is in [0,1]
433  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
434  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
435  }
436  }
438  std::string zlo_bc = "none";
439  amrex::ParmParse pp_bc("zlo");
440  pp_bc.get("type",zlo_bc);
441  if (amrex::toLower(zlo_bc) != "surface_layer") {
442  amrex::Abort("You must use the surface_layer BC at zlo with the selected PBL.");
443  }
444  }
445  }
446 
447  // Flags for QKE/TKE equation
448  if (pbl_type == PBLType::MYJ || pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
449  // Add sources/sinks to QKE/TKE? (MYJ does this inline)
450  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
451  use_pbl_tke = true;
452  }
453  // Advect QKE/TKE?
454  query_one_or_per_level(pp, "advect_tke" , advect_tke , lev, max_level);
455  // Apply numerical diffusion to QKE/TKE? (no effect while the 6th-order numerical
456  // diffusion is deactivated, see erf.num_diff_coeff)
457  if (query_one_or_per_level(pp, "diffuse_tke_3D", diffuse_tke_3D, lev, max_level) && lev == 0) {
458  amrex::Warning("erf.diffuse_tke_3D is ignored: the 6th-order numerical diffusion is currently deactivated");
459  }
460  }
461 
462  // There is a default value of 1e-6 but the user can override the value here,
463  // and in addition can add perturbational values. and in addition can add perturbational values.
464  pp.queryAdd("tke_min",tke_min);
465 
466  // LES constants...
467  query_one_or_per_level(pp, "Cs", Cs, lev, max_level);
468 
469  query_one_or_per_level(pp, "Pr_t", Pr_t, lev, max_level);
470  query_one_or_per_level(pp, "Sc_t", Sc_t, lev, max_level);
471 
472  // Compute relevant forms of diffusion parameters
473  Pr_t_inv = one / Pr_t;
474  Sc_t_inv = one / Sc_t;
475 
476  if (les_type == LESType::Deardorff) {
477  query_one_or_per_level(pp, "Ck", Ck, lev, max_level);
478  query_one_or_per_level(pp, "Ce", Ce, lev, max_level);
479  query_one_or_per_level(pp, "Ce_wall", Ce_wall, lev, max_level);
480  }
481 
482  // To quantify atmospheric stability for subgrid modeling
483  const bool strat_type_set = (pp.countval("thermal_stratification") > 0);
484  query_one_or_per_level(pp, "thermal_stratification", strat_type, lev, max_level);
485  // The PBL schemes have always used theta_v for their buoyancy gradient,
486  // which is the physically right choice there. Honor an explicit
487  // erf.thermal_stratification everywhere, but when the user has not set it
488  // keep the historical split: theta for the LES closures, theta_v for the
489  // PBL ones. That way the knob reaches the PBL schemes without silently
490  // changing any existing moist answer.
491  pbl_strat_type = strat_type_set ? strat_type : StratType::thetav;
492  amrex::Print() << "PBL thermal stratification variable: "
493  << amrex::getEnumNameString(pbl_strat_type) << std::endl;
494  if (strat_type == StratType::theta) {
495  amrex::Print() << "Thermal stratification based on gradient of potential temperature" << std::endl;
496  } else if (strat_type == StratType::thetav) {
497  amrex::Print() << "Thermal stratification based on gradient of virtual potential temperature" << std::endl;
498  } else if (strat_type == StratType::thetal) {
499  amrex::Print() << "Thermal stratification based on gradient of linearized liquid-water potential temperature" << std::endl;
500  }
501 
502  // k-eqn constants
503  query_one_or_per_level(pp, "Cmu0", Cmu0, lev, max_level);
504  query_one_or_per_level(pp, "Cb", Cb, lev, max_level);
505  query_one_or_per_level(pp, "Rt_crit", Rt_crit, lev, max_level);
506  query_one_or_per_level(pp, "Rt_min", Rt_min, lev, max_level);
507  query_one_or_per_level(pp, "max_geom_lscale", l_g_max, lev, max_level);
508  query_one_or_per_level(pp, "dirichlet_k", dirichlet_k, lev, max_level);
509  query_one_or_per_level(pp, "tke_floor", tke_floor, lev, max_level);
510  query_one_or_per_level(pp, "implicit_tke_dissipation", implicit_tke_dissipation, lev, max_level);
511  query_one_or_per_level(pp, "rans_consistent_diffusivities", rans_consistent_diffusivities, lev, max_level);
512  query_one_or_per_level(pp, "rans_lscale_from_pblh", rans_lscale_from_pblh, lev, max_level);
513  query_one_or_per_level(pp, "rans_lscale_min", rans_lscale_min, lev, max_level);
514  query_one_or_per_level(pp, "rans_realizability", rans_realizability, lev, max_level);
515  if (rans_realizability != zero) {
516  if (!(rans_realizability >= amrex::Real(0.01) && rans_realizability <= amrex::Real(10))) {
517  amrex::Error("erf.rans_realizability must be 0 (off) or in [0.01, 10]; Cmu0^2 = 0.309 is the neutral equilibrium value");
518  }
519  if (rans_type != RANSType::kEqn) {
520  // One value for the whole hierarchy (a single entry, or a list whose entries are all
521  // equal) is meant for the levels that run the k-eqn closure and is reset here; a list
522  // with different entries names this level on purpose and must not switch the cap on
523  // where there is no closure.
524  amrex::Vector<amrex::Real> all_levels;
525  pp.getarr("rans_realizability", all_levels);
526  bool uniform = true;
527  for (auto v : all_levels) { uniform = uniform && (v == all_levels[0]); }
528  if (uniform) {
529  amrex::Print() << "erf.rans_realizability reset to 0 on level " << lev
530  << " (no k-eqn closure there)" << std::endl;
532  } else {
533  amrex::Error("erf.rans_realizability needs erf.rans_type = kEqn (it caps the k-eqn eddy viscosity; level "
534  + std::to_string(lev) + ")");
535  }
536  }
537  }
538  // After the reset above, so a hierarchy with a PBL scheme on an LES level and the cap on
539  // its k-eqn level is accepted
540  if ((rans_realizability != zero) && (pbl_type != PBLType::None)) {
541  amrex::Error("erf.rans_realizability needs erf.pbl_type = None: a PBL scheme overwrites the vertical "
542  "diffusivities the cap acts on (level " + std::to_string(lev) + ")");
543  }
544  if (rans_lscale_from_pblh && !(rans_lscale_min > 0)) {
545  amrex::Error("erf.rans_lscale_min must be > 0 with erf.rans_lscale_from_pblh");
546  }
547  // Moist TKE buoyancy of the k-eqn closure (the Deardorff LES, which shares the TKE source,
548  // keeps the dry form). One value for the hierarchy is meant for its k-eqn levels and is
549  // reset on the others, as erf.rans_realizability is; a per-level list must not name a level
550  // without the closure.
551  query_one_or_per_level(pp, "rans_moist_buoyancy", rans_moist_buoyancy, lev, max_level);
552  if (rans_moist_buoyancy && rans_type != RANSType::kEqn) {
553  if (pp.countval("rans_moist_buoyancy") == 1) {
554  amrex::Print() << "erf.rans_moist_buoyancy reset to false on level " << lev
555  << " (no k-eqn closure there)" << std::endl;
556  rans_moist_buoyancy = false;
557  } else {
558  amrex::Error("erf.rans_moist_buoyancy needs erf.rans_type = kEqn (it is the k-eqn TKE buoyancy; level "
559  + std::to_string(lev) + ")");
560  }
561  }
562 
563  // Log-consistent vertical shear of the k-eqn closure (ERF_LogShear.H). One value for the
564  // hierarchy is meant for its k-eqn levels and is reset on the others, as
565  // erf.rans_moist_buoyancy is; a per-level list must not name a level without the closure.
566  // An unknown name stops the run in the query.
567  query_one_or_per_level_enum_case_insensitive(pp, "rans_shear_stencil", rans_shear_stencil, lev, max_level);
568  if (rans_shear_stencil != RANSShearStencil::central && rans_type != RANSType::kEqn) {
569  if (pp.countval("rans_shear_stencil") == 1) {
570  amrex::Print() << "erf.rans_shear_stencil reset to central on level " << lev
571  << " (no k-eqn closure there)" << std::endl;
572  rans_shear_stencil = RANSShearStencil::central;
573  } else {
574  amrex::Error("erf.rans_shear_stencil = log_law needs erf.rans_type = kEqn (it is the shear of the k-eqn "
575  "production; level " + std::to_string(lev) + ")");
576  }
577  }
578 
579  if (rans_type == RANSType::kEqn) {
580  // The stability functions (AL01 Eqs. 31, 32) have poles at Rt = -3.59869
581  // (cmu) and -3.61011 (cmu'); the Burchard & Petersen smoothing maps
582  // Rt < Rt_crit onto (Rt_min, Rt_crit) and needs Rt_min < Rt_crit <= 0,
583  // with Rt_min above the pole of cmu (AL01::Rt_min_lower_bound) and above
584  // the zero of its numerator (AL01::cmu_numerator_root), so cmu > 0.
585  if (!(Cmu0 > 0)) { amrex::Error("erf.Cmu0 must be > 0 for the k-eqn RANS"); }
586  if (!(Cb > 0)) { amrex::Error("erf.Cb must be > 0 for the k-eqn RANS"); }
587  if (!(l_g_max > 0)) { amrex::Error("erf.max_geom_lscale must be > 0 for the k-eqn RANS"); }
588  if (!(Rt_crit <= 0)) { amrex::Error("erf.Rt_crit must be <= 0 for the k-eqn RANS"); }
589  if (!(Rt_min < Rt_crit)) { amrex::Error("erf.Rt_min must be < erf.Rt_crit for the k-eqn RANS"); }
590  if (!(Rt_min > AL01::Rt_min_lower_bound)) {
591  std::ostringstream msg;
592  msg << std::setprecision(8) << "erf.Rt_min must be > " << AL01::Rt_min_lower_bound
593  << " for the k-eqn RANS: the momentum stability function cmu has a pole at Rt = -3.5986889850,"
594  << " and just below it cmu and the eddy viscosity are negative (level " << lev << ")";
595  amrex::Error(msg.str());
596  }
598  std::ostringstream msg;
599  msg << std::setprecision(8) << "erf.Rt_min must be > -erf.Cmu0/0.108 = " << AL01::cmu_numerator_root(Cmu0)
600  << " for the k-eqn RANS: below it the numerator Cmu0 + 0.108 Rt of cmu is negative;"
601  << " raise erf.Cmu0 or erf.Rt_min (level " << lev << ")";
602  amrex::Error(msg.str());
603  }
604  }
605  if (tke_floor < 0) { amrex::Error("erf.tke_floor must be >= 0"); }
606 
607  // Common inputs (LES or RANS)
608  if (!query_one_or_per_level(pp, "sigma_k", sigma_k, lev, max_level) && rans_type == RANSType::kEqn) {
609  amrex::Print() << "Overriding default sigma_k for k-eqn RANS" << std::endl;
610  sigma_k = one;
611  };
612  query_one_or_per_level(pp, "theta_ref", theta_ref, lev, max_level);
613 
614  query_one_or_per_level(pp, "mix_isotropic", mix_isotropic, lev, max_level);
615  query_one_or_per_level(pp, "use_Ri_correction", use_Ri_correction, lev, max_level);
616  query_one_or_per_level(pp, "Ri_crit", Ri_crit, lev, max_level);
617 
618  // Set common flags
619  use_kturb =
621  (pbl_type != PBLType::None));
622  use_keqn =
623  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn));
624  use_tke =
625  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn) ||
626  (pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
627  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family());
628 
629  if (use_tke) {
630  query_one_or_per_level(pp, "init_tke_from_ustar", init_tke_from_ustar, lev, max_level);
631  }
632 
633  // Validate inputs
634  if (les_type == LESType::Smagorinsky) {
635  if (Cs == 0) {
636  amrex::Error("Need to specify Cs for Smagorsinky LES");
637  }
638  if (smag2d && mix_isotropic) {
639  amrex::Print() << "Turning off mix_isotropic for 2-D Smagorinsky" << std::endl;
640  mix_isotropic = false;
641  }
642  }
643 
644  // Opt-in limits of WRF's Smagorinsky-2D closure (dyn_em/module_diffusion_em.F, smag2d_km):
645  // the slope limiter, which divides K_h by alpha or alpha^2 on terrain-fitted meshes, and the
646  // cap K_h <= smag2d_kh_cap * Delta_h (WRF: 10 m/s). Both are off by default. The mesh check
647  // for the slope limiter is in SolverChoice::init_params, where the terrain type is known.
648  query_one_or_per_level(pp, "smag2d_slope_limiter", smag2d_slope_limiter, lev, max_level);
649  query_one_or_per_level(pp, "smag2d_kh_cap", smag2d_kh_cap, lev, max_level);
650  if (!(smag2d_kh_cap >= zero)) {
651  amrex::Error("erf.smag2d_kh_cap must be >= 0 (0 = no cap; WRF uses 10 m/s)");
652  }
654  if (!smag2d) {
655  // A single value applies to every level; it is meant for the levels that run
656  // Smagorinsky2D (SolverChoice aborts if none does). A per-level list must not
657  // switch the limits on at a level that does not.
658  if (pp.countval("smag2d_slope_limiter") == 1) { smag2d_slope_limiter = false; }
659  if (pp.countval("smag2d_kh_cap") == 1) { smag2d_kh_cap = zero; }
661  amrex::Error("erf.smag2d_slope_limiter and erf.smag2d_kh_cap apply only to "
662  "erf.les_type = Smagorinsky2D (level " + std::to_string(lev) + ")");
663  }
664  }
665  }
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
ParmParse pp("prob")
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
int query_one_or_per_level_enum_case_insensitive(const amrex::ParmParse &pp, const char *query_string, T &query_var, const int lev, const int maxlev)
Query a scalar or per-level enum input value using case-insensitive matching.
Definition: ERF_TurbStruct.H:95
int query_one_or_per_level(const amrex::ParmParse &pp, const char *query_string, T &query_var, const int lev, const int maxlev)
Query a scalar or per-level input value.
Definition: ERF_TurbStruct.H:53
constexpr amrex::Real Rt_min_lower_bound
Definition: ERF_RANSClosure.H:142
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real cmu_numerator_root(amrex::Real Cmu0)
Definition: ERF_RANSClosure.H:148
@ theta
Definition: ERF_Kessler.H:26
amrex::Real SMmax
Definition: ERF_MYNNStruct.H:65
amrex::Real SHmax
Definition: ERF_MYNNStruct.H:67
amrex::Real SQfac
Definition: ERF_MYNNStruct.H:61
amrex::Real SHmin
Definition: ERF_MYNNStruct.H:66
amrex::Real SMmin
Definition: ERF_MYNNStruct.H:64
amrex::Real SQmax
Definition: ERF_MYNNStruct.H:69
void init_coeffs(amrex::Real A1_lvl25, amrex::Real A2_lvl25, amrex::Real B1, amrex::Real B2, amrex::Real C1, amrex::Real C2, amrex::Real C3, amrex::Real, amrex::Real C5)
Initialize Level 2 closure coefficients from Level 2.5 coefficients.
Definition: ERF_MYNNStruct.H:100
bool advect_tke
Whether TKE/QKE is advected.
Definition: ERF_TurbStruct.H:1146
StratType strat_type
Thermodynamic variable used for stability stratification.
Definition: ERF_TurbStruct.H:949
MYNNLevel2 pbl_mynn_level2
MYNN level-2 closure coefficients for limiting.
Definition: ERF_TurbStruct.H:1058
bool diffuse_tke_3D
Whether three-dimensional numerical diffusion is applied to TKE/QKE.
Definition: ERF_TurbStruct.H:1148
bool use_tke
Whether any TKE or QKE closure is active.
Definition: ERF_TurbStruct.H:1067
StratType pbl_strat_type
Definition: ERF_TurbStruct.H:951
amrex::Real Sc_t_inv
Inverse turbulent Schmidt number.
Definition: ERF_TurbStruct.H:917
bool use_keqn
Whether a microscale TKE closure is active.
Definition: ERF_TurbStruct.H:1062
bool uses_shoc_family() const noexcept
Query whether this level uses any SHOC-family PBL scheme.
Definition: ERF_TurbStruct.H:1018
bool init_tke_from_ustar
Whether initial TKE/QKE profiles are based on surface friction velocity.
Definition: ERF_TurbStruct.H:1072
amrex::Real pbl_ib_z0
Definition: ERF_TurbStruct.H:1125
bool pbl_ib_aware
Definition: ERF_TurbStruct.H:1124
bool smag2d_limits_requested
Whether either Smagorinsky-2D limit was given as on for this level.
Definition: ERF_TurbStruct.H:928
amrex::Real tke_min
Minimum TKE/QKE value.
Definition: ERF_TurbStruct.H:1075
bool use_kturb
Whether any turbulence model is active.
Definition: ERF_TurbStruct.H:1061
amrex::Real Pr_t_inv
Inverse turbulent Prandtl number.
Definition: ERF_TurbStruct.H:913
bool use_pbl_tke
Whether a mesoscale PBL TKE closure is active.
Definition: ERF_TurbStruct.H:1065
Here is the call graph for this function:

◆ kh_kv_can_differ()

bool TurbChoice::kh_kv_can_differ ( ) const
inlinenoexcept

Query whether the horizontal and vertical eddy viscosities can differ on this level.

Returns
True for Smagorinsky-2D, anisotropic Smagorinsky or Deardorff, and any PBL scheme (which sets the vertical diffusivities on its own).
1029  {
1030  return ( (les_type == LESType::Smagorinsky && (smag2d || !mix_isotropic)) ||
1031  (les_type == LESType::Deardorff && !mix_isotropic) ||
1032  (pbl_type != PBLType::None) );
1033  }

Referenced by ERF::ComputeDt().

Here is the caller graph for this function:

◆ pbl_requires_surface_layer()

bool TurbChoice::pbl_requires_surface_layer ( ) const
inlinenoexcept

Query whether the selected PBL scheme requires surface-layer boundary conditions.

Returns
True if the PBL scheme requires a lower surface-layer boundary.
1040  {
1041  return (pbl_type == PBLType::MYNN25) ||
1042  (pbl_type == PBLType::MYNNEDMF) ||
1043  (pbl_type == PBLType::YSU) ||
1044  (pbl_type == PBLType::MRF) ||
1045  uses_shoc_family();
1046  }

Referenced by check_params(), and init_params().

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

◆ pbl_suppresses_microphysics_condensation()

bool TurbChoice::pbl_suppresses_microphysics_condensation ( ) const
inlinenoexcept

Query whether the selected PBL scheme suppresses microphysics condensation.

Returns
True when the PBL scheme owns condensation handling.
1053  {
1054  return uses_shoc_family();
1055  }
Here is the call graph for this function:

◆ uses_native_shoc()

bool TurbChoice::uses_native_shoc ( ) const
inlinenoexcept

Query whether this level uses the native SHOC PBL scheme.

Returns
True if PBLType::NATIVE_SHOC is selected.
1010  {
1011  return pbl_type == PBLType::NATIVE_SHOC;
1012  }

Referenced by erf_slow_rhs_post(), erf_slow_rhs_pre(), and uses_shoc_family().

Here is the caller graph for this function:

◆ uses_shoc_family()

bool TurbChoice::uses_shoc_family ( ) const
inlinenoexcept

Query whether this level uses any SHOC-family PBL scheme.

Returns
True if native SHOC is selected (the only SHOC since the EAMxx one was removed).
1019  {
1020  return uses_native_shoc();
1021  }
bool uses_native_shoc() const noexcept
Query whether this level uses the native SHOC PBL scheme.
Definition: ERF_TurbStruct.H:1009

Referenced by init_params(), pbl_requires_surface_layer(), and pbl_suppresses_microphysics_condensation().

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

Member Data Documentation

◆ advect_tke

TurbChoice::advect_tke = true

Whether TKE/QKE is advected.

Referenced by erf_slow_rhs_post(), and init_params().

◆ Cb

TurbChoice::Cb = amrex::Real(0.35)

One-equation RANS buoyancy coefficient.

Referenced by ComputeTurbulentViscosityRANS(), display(), and init_params().

◆ Ce

TurbChoice::Ce = amrex::Real(0.93)

Deardorff dissipation coefficient.

Referenced by ComputeTurbulentViscosityLES(), display(), and init_params().

◆ Ce_wall

TurbChoice::Ce_wall = zero

Wall value for the Deardorff dissipation coefficient.

Referenced by check_params(), ComputeTurbulentViscosityLES(), display(), and init_params().

◆ Ck

TurbChoice::Ck = amrex::Real(0.1)

Deardorff eddy-viscosity coefficient.

Referenced by ComputeTurbulentViscosityLES(), display(), and init_params().

◆ Cmu0

TurbChoice::Cmu0 = amrex::Real(0.5562)

One-equation RANS Cmu0 coefficient.

Referenced by ComputeTurbulentViscosityRANS(), display(), and init_params().

◆ Cs

TurbChoice::Cs = zero

Smagorinsky model coefficient.

Referenced by ComputeTurbulentViscosityLES(), ComputeTurbulentViscosityLES_EB(), display(), and init_params().

◆ diffuse_tke_3D

TurbChoice::diffuse_tke_3D = true

Whether three-dimensional numerical diffusion is applied to TKE/QKE.

Referenced by init_params(), and make_sources().

◆ dirichlet_k

TurbChoice::dirichlet_k = false

Whether TKE uses Dirichlet boundary treatment.

Referenced by display(), erf_slow_rhs_post(), and init_params().

◆ enable_mrf_cloud_adjustment

TurbChoice::enable_mrf_cloud_adjustment = false

Whether MRF cloud-aware stability adjustments are enabled.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ enable_mrf_countergradient

TurbChoice::enable_mrf_countergradient = false

Whether MRF countergradient corrections are enabled.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ enable_mrf_unbounded_vpert

TurbChoice::enable_mrf_unbounded_vpert = false

Whether MRF leaves VPERT unlimited by GAMCRT.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ enable_pblh_smoothing

TurbChoice::enable_pblh_smoothing = false

Whether spatial smoothing of diagnosed PBLH is enabled.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ enable_qnse_stable_functions

bool TurbChoice::enable_qnse_stable_functions = false

◆ enable_vh96_shear_correction

TurbChoice::enable_vh96_shear_correction = false

Whether Vogelezang & Holtslag (1996) shear-correction term is enabled.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ enable_ysu_cloud_pblh

TurbChoice::enable_ysu_cloud_pblh
Initial value:
=
true

Whether the YSU PBL-top cell index is raised by one where that cell is cloudy.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ enable_ysu_countergradient

TurbChoice::enable_ysu_countergradient
Initial value:
=
true

Whether YSU countergradient corrections are enabled.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ enable_ysu_entrainment

TurbChoice::enable_ysu_entrainment
Initial value:
=
true

Whether YSU entrainment-layer parameterization is enabled.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ enable_ysu_rad_tend_limiter

bool TurbChoice::enable_ysu_rad_tend_limiter = false

◆ enable_ysu_sat_limiter

TurbChoice::enable_ysu_sat_limiter
Initial value:
=
false

Whether YSU applies a saturation limiter to moisture countergradient terms.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ enable_ysu_topdown

TurbChoice::enable_ysu_topdown
Initial value:
=
true

Whether YSU top-down mixing is enabled.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ implicit_tke_dissipation

bool TurbChoice::implicit_tke_dissipation = false

◆ init_tke_from_ustar

TurbChoice::init_tke_from_ustar = false

Whether initial TKE/QKE profiles are based on surface friction velocity.

Referenced by init_params().

◆ l_g_max

TurbChoice::l_g_max = amrex::Real(30.0)

Maximum geometric length scale.

Referenced by ComputeTurbulentViscosityRANS(), display(), and init_params().

◆ les_type

◆ mix_isotropic

TurbChoice::mix_isotropic = true

Whether subgrid mixing uses isotropic length scales.

Referenced by ComputeTurbulentViscosityLES(), ComputeTurbulentViscosityLES_EB(), display(), init_params(), and kh_kv_can_differ().

◆ mrf_fire_q_threshold

amrex::Real TurbChoice::mrf_fire_q_threshold = amrex::Real(50.0)

◆ mrf_fire_thermal_excess

bool TurbChoice::mrf_fire_thermal_excess = false

◆ pbl_blend_c_max

amrex::Real TurbChoice::pbl_blend_c_max = amrex::Real(0.1)

Power-law ceiling coeff [m^(2/3)/s].

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ pbl_blend_cs

amrex::Real TurbChoice::pbl_blend_cs = amrex::Real(0.17)

Smagorinsky coeff for K_h ceiling.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ pbl_blend_length

amrex::Real TurbChoice::pbl_blend_length = amrex::Real(0.0)

Boutle blending length L [m]. 0 = off.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ pbl_blend_use_smag

bool TurbChoice::pbl_blend_use_smag = true

Use Smagorinsky ceiling (else power-law).

Referenced by display(), and init_params().

◆ pbl_ib_aware

TurbChoice::pbl_ib_aware = false

When true, the MRF and YSU schemes treat the first fluid cell above the immersed solid of a column (buildings or terrain by immersed forcing) as that column's surface: the bulk Richardson heights, the boundary-layer depth and the K profile are measured from it, the diffusivities vanish inside the solid, and the surface scales of such a column are a neutral log law at its top (u* from the wind there and pbl_ib_z0, theta* = 0). The boundary-layer height both schemes store (pblh, Lturb) stays the absolute height above the domain bottom; with enable_pblh_smoothing the stencil runs on that absolute height, and the smoothed value is kept at or above each column's own floor (YSU: the top face of its first fluid cell, at least 10 m). Off by default; without immersed cells the results are identical. Not supported with terrain-fitted coordinates.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), and init_params().

◆ pbl_ib_z0

TurbChoice::pbl_ib_z0 = amrex::Real(0.01)

Roughness length [m] of that log law.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), and init_params().

◆ pbl_mrf_const_b

TurbChoice::pbl_mrf_const_b = amrex::Real(7.8)

MRF constant used to compute PBL height.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ pbl_mrf_coriolis_freq

TurbChoice::pbl_mrf_coriolis_freq = amrex::Real(1.0e-4)

Coriolis frequency used by the MRF PBL scheme.

Referenced by display(), and init_params().

◆ pbl_mrf_highres_bounds

TurbChoice::pbl_mrf_highres_bounds = false

Whether MRF applies high-resolution grid-dependent diffusivity bounds.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ pbl_mrf_Ribcr

TurbChoice::pbl_mrf_Ribcr = amrex::Real(0.5)

Critical bulk Richardson number for the MRF PBL scheme.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ pbl_mrf_Sc_t

TurbChoice::pbl_mrf_Sc_t = amrex::Real(0)

MRF turbulent Schmidt number of the passive scalars (erf.pbl_mrf_Sc_t): their vertical diffusivity is the heat one times erf.Pr_t / Sc_t; 0 (the default) leaves it equal to the heat one.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ pbl_mrf_sf

TurbChoice::pbl_mrf_sf = amrex::Real(0.1)

MRF surface flux value used to compute PBL height.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ pbl_mrf_use_zero_ri_extent

TurbChoice::pbl_mrf_use_zero_ri_extent = false

Whether MRF uses the Ri=0 K-profile extent.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ pbl_mynn

TurbChoice::pbl_mynn

MYNN level-2.5 closure coefficients.

Referenced by AddTurbKESources(), ComputeDiffusivityMYNN25(), ComputeDiffusivityMYNNEDMF(), display(), and init_params().

◆ pbl_mynn_level2

TurbChoice::pbl_mynn_level2

MYNN level-2 closure coefficients for limiting.

Referenced by ComputeDiffusivityMYNN25(), ComputeDiffusivityMYNNEDMF(), and init_params().

◆ pbl_strat_type

◆ pbl_type

◆ pbl_ysu_coriolis_freq

TurbChoice::pbl_ysu_coriolis_freq
Initial value:
=
amrex::Real(1.0e-4)

Coriolis frequency used by YSU-family PBL schemes.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ pbl_ysu_land_Ribcr

TurbChoice::pbl_ysu_land_Ribcr
Initial value:
=
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:42

Critical bulk Richardson number over land for stable YSU conditions.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ pbl_ysu_use_consistent_coriolis

TurbChoice::pbl_ysu_use_consistent_coriolis
Initial value:
=
false

Whether YSU uses the ERF Coriolis frequency.

Referenced by display(), and init_params().

◆ pbl_ysunew_highres_bounds

TurbChoice::pbl_ysunew_highres_bounds = false

Whether YSU applies high-resolution grid-dependent diffusivity bounds.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ pblh_smoothing_passes

TurbChoice::pblh_smoothing_passes = 1

Number of PBLH smoothing iterations to apply.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ pblh_smoothing_weight

TurbChoice::pblh_smoothing_weight = amrex::Real(0.5)

Center-cell weight in PBLH smoothing stencil (must be in [0,1]).

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ Pr_t

TurbChoice::Pr_t = one / three

Turbulent Prandtl number.

Referenced by ComputeDiffusivityMRF(), display(), and init_params().

◆ Pr_t_inv

TurbChoice::Pr_t_inv = three

◆ qnse_ah

amrex::Real TurbChoice::qnse_ah = amrex::Real(2.5)

◆ qnse_am

amrex::Real TurbChoice::qnse_am = amrex::Real(2.5)

◆ qnse_bh

amrex::Real TurbChoice::qnse_bh = amrex::Real(0.2)

◆ qnse_bm

amrex::Real TurbChoice::qnse_bm = amrex::Real(0.2)

◆ rans_consistent_diffusivities

bool TurbChoice::rans_consistent_diffusivities = false

◆ rans_lscale_from_pblh

bool TurbChoice::rans_lscale_from_pblh = false

◆ rans_lscale_min

amrex::Real TurbChoice::rans_lscale_min = one

◆ rans_moist_buoyancy

bool TurbChoice::rans_moist_buoyancy = false

◆ rans_realizability

amrex::Real TurbChoice::rans_realizability = zero

◆ rans_shear_stencil

RANSShearStencil TurbChoice::rans_shear_stencil = RANSShearStencil::central

◆ rans_type

◆ Ri_crit

TurbChoice::Ri_crit = fourth

Critical Richardson number for stability correction.

Referenced by ComputeTurbulentViscosityLES(), ComputeTurbulentViscosityLES_EB(), display(), and init_params().

◆ Rt_crit

TurbChoice::Rt_crit = -one

Critical turbulent Reynolds number.

Referenced by ComputeTurbulentViscosityRANS(), display(), and init_params().

◆ Rt_min

TurbChoice::Rt_min = -three

Minimum turbulent Reynolds number.

Referenced by ComputeTurbulentViscosityRANS(), display(), and init_params().

◆ Sc_t

TurbChoice::Sc_t = one

Turbulent Schmidt number.

Referenced by display(), and init_params().

◆ Sc_t_inv

TurbChoice::Sc_t_inv = one

◆ sigma_k

TurbChoice::sigma_k = amrex::Real(0.5)

◆ smag2d

TurbChoice::smag2d = false

◆ smag2d_kh_cap

TurbChoice::smag2d_kh_cap = zero

Cap K_h <= smag2d_kh_cap * Delta_h for Smagorinsky-2D (m/s); 0 means no cap.

Referenced by ERF::ComputeDt(), ComputeTurbulentViscosityLES(), display(), init_params(), and ERF::WarnSteepTerrainAtOpenFaces().

◆ smag2d_limits_requested

TurbChoice::smag2d_limits_requested = false

Whether either Smagorinsky-2D limit was given as on for this level.

Referenced by init_params().

◆ smag2d_slope_limiter

TurbChoice::smag2d_slope_limiter = false

Apply WRF's Smagorinsky-2D slope limiter (K_h / alpha or / alpha^2) on terrain-fitted meshes.

Referenced by ERF::ComputeDt(), ComputeTurbulentViscosityLES(), display(), init_params(), ERF::ReportTerrainSlopeFactor(), and ERF::WarnSteepTerrainAtOpenFaces().

◆ strat_type

TurbChoice::strat_type = StratType::theta

Thermodynamic variable used for stability stratification.

Referenced by ComputeTurbulentViscosityLES(), and init_params().

◆ theta_ref

TurbChoice::theta_ref = zero

Reference potential temperature for stable stratification.

Referenced by AddTurbKESources(), ComputeTurbulentViscosityLES(), ComputeTurbulentViscosityRANS(), display(), and init_params().

◆ tke_floor

amrex::Real TurbChoice::tke_floor = zero

◆ tke_min

TurbChoice::tke_min = amrex::Real(1.e-6)

Minimum TKE/QKE value.

Referenced by init_params().

◆ use_keqn

TurbChoice::use_keqn
Initial value:
=
false

Whether a microscale TKE closure is active.

Referenced by AddTurbKESources(), erf_slow_rhs_post(), and init_params().

◆ use_kturb

◆ use_pbl_tke

TurbChoice::use_pbl_tke
Initial value:
=
false

Whether a mesoscale PBL TKE closure is active.

Referenced by AddTurbKESources(), and init_params().

◆ use_Ri_correction

TurbChoice::use_Ri_correction = true

Whether Richardson-number correction is applied.

Referenced by ComputeTurbulentViscosityLES(), ComputeTurbulentViscosityLES_EB(), display(), and init_params().

◆ use_tke

TurbChoice::use_tke = false

Whether any TKE or QKE closure is active.

Referenced by erf_slow_rhs_post(), init_params(), and make_sources().

◆ vh96_shear_const_b

TurbChoice::vh96_shear_const_b = amrex::Real(100.0)

Vogelezang & Holtslag (1996) shear-correction constant b.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSU(), display(), and init_params().

◆ ysu_moistvars

TurbChoice::ysu_moistvars = false

Whether YSU applies turbulence to moisture variables.

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ ysu_qcloud_threshold

TurbChoice::ysu_qcloud_threshold
Initial value:
=
amrex::Real(1.0e-4)

Cloud water plus cloud ice threshold for YSU [kg/kg].

Referenced by ComputeDiffusivityYSU(), display(), and init_params().

◆ ysu_rad_tend_limiter_magnitude

amrex::Real TurbChoice::ysu_rad_tend_limiter_magnitude = amrex::Real(1.0)

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