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_eamxx_shoc () const noexcept
 Query whether this level uses the EAMxx SHOC PBL scheme. 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
 
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...
 
bool pbl_ysu_force_over_water
 Whether YSU is forced to use over-water behavior. More...
 
amrex::Real pbl_ysu_land_Ribcr
 Critical bulk Richardson number over land for stable YSU conditions. More...
 
amrex::Real pbl_ysu_unst_Ribcr
 Critical bulk Richardson number for unstable YSU conditions. More...
 
bool enable_ysu_countergradient
 Whether YSU countergradient corrections are enabled. More...
 
bool enable_ysu_terrain_pblh_floor
 Whether YSU applies a terrain-following PBL-height floor. 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 YSU cloud-based PBL-height detection is enabled. More...
 
amrex::Real ysu_qcloud_threshold
 Cloud liquid water threshold for YSUNew [kg/kg]. More...
 
bool ysu_moistvars = false
 Whether YSU applies turbulence to moisture variables. More...
 
bool pbl_ysunew_highres_bounds = false
 Whether YSUNew 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...
 
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 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.
586  {
587  // BC compatibility
589  phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer ) {
590  amrex::Abort("The selected PBL model requires MOST at lower boundary");
591  }
592  if ( (les_type == LESType::Deardorff) && (Ce_wall > 0) &&
593  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer) &&
594  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::slip_wall) &&
595  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::no_slip_wall) )
596  {
597  amrex::Warning("Deardorff LES assumes wall at zlo when applying Ce_wall");
598  }
599  }
@ no_slip_wall
@ surface_layer
amrex::Real Ce_wall
Wall value for the Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:849
LESType les_type
Selected LES closure.
Definition: ERF_TurbStruct.H:826
bool pbl_requires_surface_layer() const noexcept
Query whether the selected PBL scheme requires surface-layer boundary conditions.
Definition: ERF_TurbStruct.H:954
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.
606  {
607  amrex::Print() << "Turbulence Settings at level " << lev << std::endl;
608 
609  if (
611  pbl_type == PBLType::None) {
612  amrex::Print() << " Using DNS model at level " << lev << std::endl;
613  } else if (les_type == LESType::Smagorinsky) {
614  if (smag2d) {
615  amrex::Print() << " Using 2D Smagorinsky LES model at level " << lev << std::endl;
616  } else {
617  amrex::Print() << " Using Smagorinsky LES model at level " << lev << std::endl;
618  }
619  if (use_Ri_correction) {
620  amrex::Print() << " Smagorinsky uses Richardson number correction with Ri_crit = "
621  << Ri_crit << std::endl;
622  }
623  if (smag2d) {
624  amrex::Print() << " WRF slope limiter : " << smag2d_slope_limiter << std::endl;
625  if (smag2d_kh_cap > zero) {
626  amrex::Print() << " K_h cap : " << smag2d_kh_cap << " * Delta_h" << std::endl;
627  } else {
628  amrex::Print() << " K_h cap : none" << std::endl;
629  }
630  }
631  } else if (les_type == LESType::Deardorff) {
632  amrex::Print() << " Using Deardorff LES model at level " << lev << std::endl;
633  } else if (rans_type == RANSType::kEqn) {
634  amrex::Print()
635  << " Using Axell & Liungman one-equation RANS k model at level " << lev
636  << std::endl;
637  } else if (pbl_type == PBLType::MYJ) {
638  amrex::Print() << " Using MYJ PBL model at level " << lev << std::endl;
639  } else if (pbl_type == PBLType::MYNN25) {
640  amrex::Print() << " Using MYNN2.5 PBL model at level " << lev << std::endl;
641  } else if (pbl_type == PBLType::MYNNEDMF) {
642  amrex::Print() << " Using MYNNEDMF PBL model at level " << lev << std::endl;
643  } else if (pbl_type == PBLType::YSU) {
644  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
645  } else if (pbl_type == PBLType::YSUNew) {
646  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
647  } else if (pbl_type == PBLType::MRF) {
648  amrex::Print() << " Using MRF PBL model at level " << lev << std::endl;
649  } else if (pbl_type == PBLType::EAMXX_SHOC) {
650  amrex::Print() << " Using EAMxx SHOC PBL model at level " << lev << std::endl;
651  } else if (pbl_type == PBLType::NATIVE_SHOC) {
652  amrex::Print() << " Using native SHOC PBL model at level " << lev << std::endl;
653  } else {
654  amrex::Error("Unknown turbulence model");
655  }
656 
657  if (les_type != LESType::None) {
658  if (les_type == LESType::Smagorinsky) {
659  amrex::Print() << " Cs : " << Cs << std::endl;
660  }
661  if (les_type == LESType::Deardorff) {
662  amrex::Print() << " Ce : " << Ce << std::endl;
663  amrex::Print() << " Ce at wall : " << Ce_wall << std::endl;
664  amrex::Print() << " Ck : " << Ck << std::endl;
665  amrex::Print() << " sigma_k : " << sigma_k << std::endl;
666 
667  // Sullivan et al 1994, Eqn 14
668  amrex::Real Cs_equiv = std::sqrt(Ck * std::sqrt(Ck / Ce));
669  amrex::Print() << " equivalent Cs : " << Cs_equiv
670  << std::endl;
671  }
672  amrex::Print() << " isotropic mixing : " << mix_isotropic
673  << std::endl;
674  }
675 
676  if (rans_type != RANSType::None) {
677  if (rans_type == RANSType::kEqn) {
678  amrex::Print() << "Cmu0 : " << Cmu0 << std::endl;
679  amrex::Print() << "sigma_k : " << sigma_k << std::endl;
680  amrex::Print() << "Cb : " << Cb << std::endl;
681  amrex::Print() << "Rt_crit : " << Rt_crit << std::endl;
682  amrex::Print() << "Rt_min : " << Rt_min << std::endl;
683  amrex::Print() << "max_geom_lscale : " << l_g_max << std::endl;
684  amrex::Print() << "rans_realizability : " << rans_realizability << std::endl;
685  amrex::Print() << "dirichlet_k : " << dirichlet_k << std::endl;
686  amrex::Print() << "tke_floor : " << tke_floor << std::endl;
687  amrex::Print() << "implicit_tke_dissipation : " << implicit_tke_dissipation << std::endl;
688  amrex::Print() << "consistent diffusivities : " << rans_consistent_diffusivities << std::endl;
689  amrex::Print() << "lscale cap from PBL height : " << rans_lscale_from_pblh
690  << " (floor " << rans_lscale_min << " m)" << std::endl;
691  }
692  }
693 
694  if ((les_type == LESType::Deardorff) ||
695  (rans_type == RANSType::kEqn)) {
696  if (theta_ref > 0) {
697  amrex::Print() << " reference theta : " << theta_ref << std::endl;
698  } else {
699  amrex::Print() << " reference theta : n/a" << std::endl;
700  }
701  }
702 
703  if ((les_type != LESType::None) || (rans_type != RANSType::None)) {
704  amrex::Print() << " Pr_t : " << Pr_t << std::endl;
705  amrex::Print() << " Sc_t : " << Sc_t << std::endl;
706  }
707 
708  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
709  amrex::Print() << " pbl_mynn_Lt_taper_exp : "
710  << pbl_mynn.Lt_taper_exp << std::endl;
711  amrex::Print() << " pbl_mynn_config : "
712  << amrex::getEnumNameString(pbl_mynn.config) << std::endl;
713  amrex::Print() << " pbl_mynn_Lt_alpha : " << pbl_mynn.Lt_alpha << std::endl;
714  amrex::Print() << " pbl_mynn_A1 : " << pbl_mynn.A1 << std::endl;
715  amrex::Print() << " pbl_mynn_A2 : " << pbl_mynn.A2 << std::endl;
716  amrex::Print() << " pbl_mynn_B1 : " << pbl_mynn.B1 << std::endl;
717  amrex::Print() << " pbl_mynn_B2 : " << pbl_mynn.B2 << std::endl;
718  amrex::Print() << " pbl_mynn_C1 : " << pbl_mynn.C1 << std::endl;
719  amrex::Print() << " pbl_mynn_C2 : " << pbl_mynn.C2 << std::endl;
720  amrex::Print() << " pbl_mynn_C3 : " << pbl_mynn.C3 << std::endl;
721  amrex::Print() << " pbl_mynn_C4 : " << pbl_mynn.C4 << std::endl;
722  amrex::Print() << " pbl_mynn_C5 : " << pbl_mynn.C5 << std::endl;
723  } else if (pbl_type == PBLType::YSU || pbl_type == PBLType::YSUNew) {
724  amrex::Print() << " pbl_ysu_coriolis_freq : "
725  << pbl_ysu_coriolis_freq << std::endl;
726  amrex::Print() << " pbl_ysu_use_consistent_coriolis : "
727  << pbl_ysu_use_consistent_coriolis << std::endl;
728  amrex::Print() << " pbl_ysu_force_over_water : "
729  << pbl_ysu_force_over_water << std::endl;
730  amrex::Print() << " pbl_ysu_land_Ribcr : "
731  << pbl_ysu_land_Ribcr << std::endl;
732  amrex::Print() << " pbl_ysu_unst_Ribcr : "
733  << pbl_ysu_unst_Ribcr << std::endl;
734  amrex::Print() << " enable_ysu_countergradient : "
735  << enable_ysu_countergradient << std::endl;
736  amrex::Print() << " enable_ysu_terrain_pblh_floor : "
737  << enable_ysu_terrain_pblh_floor << std::endl;
738  amrex::Print() << " enable_ysu_sat_limiter : "
739  << enable_ysu_sat_limiter << std::endl;
740  amrex::Print() << " enable_ysu_topdown : "
741  << enable_ysu_topdown << std::endl;
742  amrex::Print() << " enable_ysu_entrainment : "
743  << enable_ysu_entrainment << std::endl;
744  amrex::Print() << " enable_ysu_cloud_pblh : "
745  << enable_ysu_cloud_pblh << std::endl;
746  amrex::Print() << " ysu_qcloud_threshold : "
747  << ysu_qcloud_threshold << std::endl;
748  amrex::Print() << " ysu_moistvars : "
749  << ysu_moistvars << std::endl;
750  amrex::Print() << " pbl_ysunew_highres_bounds : "
751  << pbl_ysunew_highres_bounds << std::endl;
752  // Radiative tendency limiter/smoothing (YSUNew-only)
753  amrex::Print() << " enable_ysu_rad_tend_limiter : "
754  << enable_ysu_rad_tend_limiter << std::endl;
755  amrex::Print() << " ysu_rad_tend_limiter_magnitude : "
756  << ysu_rad_tend_limiter_magnitude << std::endl;
757  amrex::Print() << " enable_vh96_shear_correction : "
758  << enable_vh96_shear_correction << std::endl;
759  amrex::Print() << " vh96_shear_const_b : "
760  << vh96_shear_const_b << std::endl;
761  amrex::Print() << " enable_pblh_smoothing : "
762  << enable_pblh_smoothing << std::endl;
763  amrex::Print() << " pblh_smoothing_passes : "
764  << pblh_smoothing_passes << std::endl;
765  amrex::Print() << " pblh_smoothing_weight : "
766  << pblh_smoothing_weight << std::endl;
767  amrex::Print() << " enable_mrf_unbounded_vpert : "
768  << enable_mrf_unbounded_vpert << std::endl;
769  amrex::Print() << " enable_qnse_stable_functions : "
770  << enable_qnse_stable_functions << std::endl;
772  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
773  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
774  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
775  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
776  }
777  } else if (pbl_type == PBLType::MRF) {
778  amrex::Print() << " pbl_mrf_coriolis_freq : " << pbl_mrf_coriolis_freq
779  << std::endl;
780  amrex::Print() << " pbl_mrf_Ribcr : " << pbl_mrf_Ribcr
781  << std::endl;
782  amrex::Print() << " pbl_mrf_const_b : " << pbl_mrf_const_b
783  << std::endl;
784  amrex::Print() << " pbl_mrf_sf : " << pbl_mrf_sf
785  << std::endl;
786  amrex::Print() << " enable_mrf_countergradient : " << enable_mrf_countergradient
787  << std::endl;
788  amrex::Print() << " enable_mrf_cloud_adjustment : " << enable_mrf_cloud_adjustment
789  << std::endl;
790  amrex::Print() << " pbl_mrf_highres_bounds : " << pbl_mrf_highres_bounds
791  << std::endl;
792  amrex::Print() << " enable_mrf_unbounded_vpert : " << enable_mrf_unbounded_vpert
793  << std::endl;
794  amrex::Print() << " pbl_mrf_use_zero_ri_extent : " << pbl_mrf_use_zero_ri_extent
795  << std::endl;
796  amrex::Print() << " pbl_blend_length : " << pbl_blend_length
797  << std::endl;
798  amrex::Print() << " pbl_blend_cs : " << pbl_blend_cs
799  << std::endl;
800  amrex::Print() << " pbl_blend_c_max : " << pbl_blend_c_max
801  << std::endl;
802  amrex::Print() << " pbl_blend_use_smag : " << pbl_blend_use_smag
803  << std::endl;
804  amrex::Print() << " enable_vh96_shear_correction : " << enable_vh96_shear_correction
805  << std::endl;
806  amrex::Print() << " vh96_shear_const_b : " << vh96_shear_const_b
807  << std::endl;
808  amrex::Print() << " enable_pblh_smoothing : " << enable_pblh_smoothing
809  << std::endl;
810  amrex::Print() << " pblh_smoothing_passes : " << pblh_smoothing_passes
811  << std::endl;
812  amrex::Print() << " pblh_smoothing_weight : " << pblh_smoothing_weight
813  << std::endl;
814  amrex::Print() << " enable_qnse_stable_functions : "
815  << enable_qnse_stable_functions << std::endl;
817  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
818  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
819  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
820  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
821  }
822  }
823  }
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ 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 Lt_taper_exp
Definition: ERF_MYNNStruct.H:89
amrex::Real B2
Definition: ERF_MYNNStruct.H:53
amrex::Real C5
Definition: ERF_MYNNStruct.H:58
amrex::Real A1
Definition: ERF_MYNNStruct.H:50
bool pbl_ysu_force_over_water
Whether YSU is forced to use over-water behavior.
Definition: ERF_TurbStruct.H:1001
bool implicit_tke_dissipation
Definition: ERF_TurbStruct.H:888
bool rans_consistent_diffusivities
Definition: ERF_TurbStruct.H:893
amrex::Real Ce
Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:848
bool enable_mrf_unbounded_vpert
Whether MRF leaves VPERT unlimited by GAMCRT.
Definition: ERF_TurbStruct.H:1050
amrex::Real Sc_t
Turbulent Schmidt number.
Definition: ERF_TurbStruct.H:833
amrex::Real sigma_k
TKE diffusivity coefficient denominator.
Definition: ERF_TurbStruct.H:861
bool use_Ri_correction
Whether Richardson-number correction is applied.
Definition: ERF_TurbStruct.H:873
bool pbl_ysu_use_consistent_coriolis
Whether YSU uses the ERF Coriolis frequency.
Definition: ERF_TurbStruct.H:998
amrex::Real pbl_blend_length
Boutle blending length L [m]. 0 = off.
Definition: ERF_TurbStruct.H:1041
amrex::Real Ck
Deardorff eddy-viscosity coefficient.
Definition: ERF_TurbStruct.H:850
bool pbl_mrf_use_zero_ri_extent
Whether MRF uses the Ri=0 K-profile extent.
Definition: ERF_TurbStruct.H:1051
amrex::Real qnse_ah
Definition: ERF_TurbStruct.H:1061
RANSType rans_type
Selected RANS closure.
Definition: ERF_TurbStruct.H:877
bool enable_vh96_shear_correction
Whether Vogelezang & Holtslag (1996) shear-correction term is enabled.
Definition: ERF_TurbStruct.H:1028
amrex::Real theta_ref
Reference potential temperature for stable stratification.
Definition: ERF_TurbStruct.H:864
amrex::Real l_g_max
Maximum geometric length scale.
Definition: ERF_TurbStruct.H:857
bool enable_mrf_cloud_adjustment
Whether MRF cloud-aware stability adjustments are enabled.
Definition: ERF_TurbStruct.H:1048
bool enable_ysu_entrainment
Whether YSU entrainment-layer parameterization is enabled.
Definition: ERF_TurbStruct.H:1016
bool enable_ysu_sat_limiter
Whether YSU applies a saturation limiter to moisture countergradient terms.
Definition: ERF_TurbStruct.H:1012
bool enable_ysu_cloud_pblh
Whether YSU cloud-based PBL-height detection is enabled.
Definition: ERF_TurbStruct.H:1018
amrex::Real pbl_mrf_const_b
MRF constant used to compute PBL height.
Definition: ERF_TurbStruct.H:1036
amrex::Real pblh_smoothing_weight
Center-cell weight in PBLH smoothing stencil (must be in [0,1]).
Definition: ERF_TurbStruct.H:1032
amrex::Real pbl_blend_cs
Smagorinsky coeff for K_h ceiling.
Definition: ERF_TurbStruct.H:1042
amrex::Real tke_floor
Definition: ERF_TurbStruct.H:884
amrex::Real ysu_qcloud_threshold
Cloud liquid water threshold for YSUNew [kg/kg].
Definition: ERF_TurbStruct.H:1020
amrex::Real qnse_bm
Definition: ERF_TurbStruct.H:1060
amrex::Real pbl_blend_c_max
Power-law ceiling coeff [m^(2/3)/s].
Definition: ERF_TurbStruct.H:1043
amrex::Real qnse_bh
Definition: ERF_TurbStruct.H:1062
bool enable_qnse_stable_functions
Definition: ERF_TurbStruct.H:1057
bool enable_mrf_countergradient
Whether MRF countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:1045
bool enable_ysu_countergradient
Whether YSU countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:1008
bool mix_isotropic
Whether subgrid mixing uses isotropic length scales.
Definition: ERF_TurbStruct.H:871
bool enable_pblh_smoothing
Whether spatial smoothing of diagnosed PBLH is enabled.
Definition: ERF_TurbStruct.H:1030
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:842
bool dirichlet_k
Whether TKE uses Dirichlet boundary treatment.
Definition: ERF_TurbStruct.H:879
int pblh_smoothing_passes
Number of PBLH smoothing iterations to apply.
Definition: ERF_TurbStruct.H:1031
amrex::Real rans_realizability
Definition: ERF_TurbStruct.H:906
bool enable_ysu_topdown
Whether YSU top-down mixing is enabled.
Definition: ERF_TurbStruct.H:1014
bool rans_lscale_from_pblh
Definition: ERF_TurbStruct.H:898
amrex::Real ysu_rad_tend_limiter_magnitude
Definition: ERF_TurbStruct.H:1026
amrex::Real rans_lscale_min
Definition: ERF_TurbStruct.H:899
bool pbl_mrf_highres_bounds
Whether MRF applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:1049
amrex::Real Rt_min
Minimum turbulent Reynolds number.
Definition: ERF_TurbStruct.H:856
bool pbl_blend_use_smag
Use Smagorinsky ceiling (else power-law).
Definition: ERF_TurbStruct.H:1044
MYNNLevel25 pbl_mynn
MYNN level-2.5 closure coefficients.
Definition: ERF_TurbStruct.H:973
amrex::Real pbl_ysu_land_Ribcr
Critical bulk Richardson number over land for stable YSU conditions.
Definition: ERF_TurbStruct.H:1004
amrex::Real Cb
One-equation RANS buoyancy coefficient.
Definition: ERF_TurbStruct.H:854
amrex::Real Ri_crit
Critical Richardson number for stability correction.
Definition: ERF_TurbStruct.H:874
amrex::Real pbl_ysu_unst_Ribcr
Critical bulk Richardson number for unstable YSU conditions.
Definition: ERF_TurbStruct.H:1006
amrex::Real Rt_crit
Critical turbulent Reynolds number.
Definition: ERF_TurbStruct.H:855
amrex::Real vh96_shear_const_b
Vogelezang & Holtslag (1996) shear-correction constant b.
Definition: ERF_TurbStruct.H:1029
amrex::Real pbl_mrf_Ribcr
Critical bulk Richardson number for the MRF PBL scheme.
Definition: ERF_TurbStruct.H:1035
amrex::Real qnse_am
Definition: ERF_TurbStruct.H:1059
amrex::Real pbl_mrf_sf
MRF surface flux value used to compute PBL height.
Definition: ERF_TurbStruct.H:1037
amrex::Real Cmu0
One-equation RANS Cmu0 coefficient.
Definition: ERF_TurbStruct.H:853
amrex::Real Cs
Smagorinsky model coefficient.
Definition: ERF_TurbStruct.H:837
amrex::Real Pr_t
Turbulent Prandtl number.
Definition: ERF_TurbStruct.H:829
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:841
amrex::Real pbl_mrf_coriolis_freq
Coriolis frequency used by the MRF PBL scheme.
Definition: ERF_TurbStruct.H:1034
bool pbl_ysunew_highres_bounds
Whether YSUNew applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:1023
amrex::Real pbl_ysu_coriolis_freq
Coriolis frequency used by YSU-family PBL schemes.
Definition: ERF_TurbStruct.H:995
bool ysu_moistvars
Whether YSU applies turbulence to moisture variables.
Definition: ERF_TurbStruct.H:1022
PBLType pbl_type
Selected PBL closure.
Definition: ERF_TurbStruct.H:909
bool enable_ysu_terrain_pblh_floor
Whether YSU applies a terrain-following PBL-height floor.
Definition: ERF_TurbStruct.H:1010
bool smag2d
Whether the 2-D Smagorinsky formulation is used.
Definition: ERF_TurbStruct.H:838
bool enable_ysu_rad_tend_limiter
Definition: ERF_TurbStruct.H:1025

◆ 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.
128  {
129  amrex::ParmParse pp(pp_prefix);
130 
131  // Which LES closure?
132  query_one_or_per_level(pp, "les_type", les_type, lev, max_level);
133  // Immersed-boundary awareness of the MRF and YSUNew schemes (off by default):
134  // the surface of a column with immersed solid cells is the first fluid cell
135  // above them, heights and the boundary-layer depth are measured from it,
136  // the eddy diffusivities are zero inside the solid, and the surface
137  // scales over such a column come from a neutral log law at its top with
138  // the roughness pbl_ib_z0. Only MRF and YSUNew honour it.
139  query_one_or_per_level(pp, "pbl_ib_aware", pbl_ib_aware, lev, max_level);
140  query_one_or_per_level(pp, "pbl_ib_z0", pbl_ib_z0, lev, max_level);
141 
142  // Handle 2-D Smag
143  if (les_type == LESType::Smagorinsky2D) {
144  les_type = LESType::Smagorinsky;
145  smag2d = true;
146  }
147 
148  // Which RANS closure?
149  query_one_or_per_level(pp, "rans_type", rans_type, lev, max_level);
150 
151  if ((rans_type != RANSType::None) && (les_type != LESType::None)) {
152  amrex::Error("Hybrid RANS-LES not implemented");
153  }
154 
155  // Which PBL Closure
156  query_one_or_per_level_enum_case_insensitive(pp, "pbl_type", pbl_type, lev, max_level);
157  if (pbl_type == PBLType::SHOC) {
158  static bool warned_legacy_shoc = false;
159  if (!warned_legacy_shoc) {
160  amrex::Warning("erf.pbl_type = SHOC is deprecated; use erf.pbl_type = EAMXX_SHOC");
161  warned_legacy_shoc = true;
162  }
163  pbl_type = PBLType::EAMXX_SHOC;
164  }
165 
166  // Do some more stuff for PBL Modeling
167  if (pbl_type != PBLType::None) {
168  // Check for compatibility between PBL, LES, Molec Transport
169  if (les_type != LESType::None) {
170  amrex::Print() << "Selected a PBL model and an LES model: "
171  << "Using PBL for vertical transport, LES for horizontal"
172  << std::endl;
173  }
174  if (les_type == LESType::Smagorinsky) {
175  if (!smag2d)
176  amrex::Error("If using Smagorinsky with a PBL model, the 2-D "
177  "formulation should be used");
178  } else if (les_type == LESType::Deardorff) {
179  amrex::Error(
180  "It is not recommended to use Deardorff LES and a PBL model");
181  }
182  // Both the k-eqn RANS closure and these PBL schemes transport RhoKE
183  if ((rans_type == RANSType::kEqn) &&
184  ((pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
185  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family())) {
186  amrex::Error("erf.rans_type = kEqn cannot be combined with erf.pbl_type = " +
187  std::string(amrex::getEnumNameString(pbl_type)) +
188  ": both transport the turbulent kinetic energy");
189  }
190 
191  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
193  pp, "pbl_mynn_Lt_taper_exp", pbl_mynn.Lt_taper_exp, lev, max_level);
194  if (pbl_mynn.Lt_taper_exp < 0) {
195  amrex::Error("erf.pbl_mynn_Lt_taper_exp must be >= 0 "
196  "(0 disables the taper)");
197  }
198  // NN09 (the default) uses Lt_alpha = 0.23 and a 1/l sum for the master
199  // length scale; Chen2021 uses Lt_alpha = 0.10 and a 1/l^2 sum.
201  pp, "pbl_mynn_config", pbl_mynn.config, lev, max_level);
202  // l_T = Lt_alpha*<zq>/<q> follows the config unless set explicitly.
203  pbl_mynn.Lt_alpha = (pbl_mynn.config == MYNNConfigType::Chen2021)
204  ? amrex::Real(0.1) : amrex::Real(0.23);
206  pp, "pbl_mynn_Lt_alpha", pbl_mynn.Lt_alpha, lev, max_level);
207  query_one_or_per_level(pp, "pbl_mynn_A1", pbl_mynn.A1, lev, max_level);
208  query_one_or_per_level(pp, "pbl_mynn_A2", pbl_mynn.A2, lev, max_level);
209  query_one_or_per_level(pp, "pbl_mynn_B1", pbl_mynn.B1, lev, max_level);
210  query_one_or_per_level(pp, "pbl_mynn_B2", pbl_mynn.B2, lev, max_level);
211  query_one_or_per_level(pp, "pbl_mynn_C1", pbl_mynn.C1, lev, max_level);
212  query_one_or_per_level(pp, "pbl_mynn_C2", pbl_mynn.C2, lev, max_level);
213  query_one_or_per_level(pp, "pbl_mynn_C3", pbl_mynn.C3, lev, max_level);
214  query_one_or_per_level(pp, "pbl_mynn_C4", pbl_mynn.C4, lev, max_level);
215  query_one_or_per_level(pp, "pbl_mynn_C5", pbl_mynn.C5, lev, max_level);
219  // Moisture is now always diffused by MYNN, as it is by every other
220  // PBL scheme; catch the retired flag rather than ignoring it silently.
221  if (pp.contains("pbl_mynn_diffuse_moistvars")) {
222  amrex::Abort("erf.pbl_mynn_diffuse_moistvars has been removed. "
223  "MYNN always diffuses the moisture variables now, as "
224  "MYJ, YSU, MRF and SHOC always have; there is no "
225  "longer a way to turn it off.");
226  }
228  pp, "pbl_mynn_SMmin", pbl_mynn.SMmin, lev, max_level);
230  pp, "pbl_mynn_SMmax", pbl_mynn.SMmax, lev, max_level);
232  pp, "pbl_mynn_SHmin", pbl_mynn.SHmin, lev, max_level);
234  pp, "pbl_mynn_SHmax", pbl_mynn.SHmax, lev, max_level);
236  pp, "pbl_mynn_SQfactor", pbl_mynn.SQfac, lev, max_level);
237 
238  // SQ = SQfac*SM, so its bound is tied to SHmax and SQfac; the default member
239  // initializer was evaluated before either could be overridden here.
241 
242  } else if (pbl_type == PBLType::YSU || pbl_type == PBLType::YSUNew) {
244  pp, "pbl_ysu_coriolis_freq", pbl_ysu_coriolis_freq, lev, max_level);
246  pp, "pbl_ysu_use_consistent_coriolis",
247  pbl_ysu_use_consistent_coriolis, lev, max_level);
249  pp, "pbl_ysu_force_over_water", pbl_ysu_force_over_water, lev,
250  max_level);
252  pp, "pbl_ysu_land_Ribcr", pbl_ysu_land_Ribcr, lev, max_level);
254  pp, "pbl_ysu_unst_Ribcr", pbl_ysu_unst_Ribcr, lev, max_level);
255  // YSU now uses theta_v at WRF's thvx sites and theta_l at its thlix
256  // sites; catch the retired switch between them rather than ignoring it.
257  if (pp.contains("enable_ysu_liquid_theta")) {
258  amrex::Abort("erf.enable_ysu_liquid_theta has been removed. YSU uses "
259  "theta_v (all condensate loading) for the bulk Richardson "
260  "number and clear-sky entrainment, and theta_l (cloud "
261  "liquid and ice) for the cloud-top extension scan and "
262  "cloudy entrainment, as WRF does with thvx and thlix.");
263  }
265  pp, "enable_ysu_countergradient", enable_ysu_countergradient, lev, max_level);
267  pp, "enable_ysu_terrain_pblh_floor", enable_ysu_terrain_pblh_floor, lev, max_level);
269  pp, "enable_ysu_sat_limiter", enable_ysu_sat_limiter, lev, max_level);
271  pp, "enable_ysu_topdown", enable_ysu_topdown, lev, max_level);
273  pp, "enable_ysu_entrainment", enable_ysu_entrainment, lev, max_level);
275  pp, "enable_ysu_cloud_pblh", enable_ysu_cloud_pblh, lev, max_level);
277  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
279  pp, "ysu_qcloud_threshold", ysu_qcloud_threshold, lev, max_level);
281  pp, "ysu_moistvars", ysu_moistvars, lev, max_level);
283  pp, "pbl_ysunew_highres_bounds", pbl_ysunew_highres_bounds, lev, max_level);
284  // Radiative tendency limiter (YSUNew-only)
286  pp, "enable_ysu_rad_tend_limiter", enable_ysu_rad_tend_limiter, lev, max_level);
288  pp, "ysu_rad_tend_limiter_magnitude", ysu_rad_tend_limiter_magnitude, lev, max_level);
289  if (!(ysu_rad_tend_limiter_magnitude > 0.0)) {
290  if (amrex::ParallelDescriptor::IOProcessor()) {
291  amrex::Print() << "WARNING: erf.ysu_rad_tend_limiter_magnitude = "
293  << " is not positive; using the default of 1.0 K/s\n";
294  }
296  }
297  // Vogelezang & Holtslag (1996) shear correction
299  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
301  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
302  // PBLH spatial smoothing
304  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
306  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
308  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
309  // Validate pblh_smoothing_weight is in [0,1]
310  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
311  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
312  }
313  // QNSE stable stability functions (Sukoriansky et al. 2005)
315  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
317  pp, "qnse_am", qnse_am, lev, max_level);
319  pp, "qnse_bm", qnse_bm, lev, max_level);
321  pp, "qnse_ah", qnse_ah, lev, max_level);
323  pp, "qnse_bh", qnse_bh, lev, max_level);
324  } else if (pbl_type == PBLType::MRF) {
326  pp, "pbl_mrf_coriolis_freq", pbl_mrf_coriolis_freq, lev, max_level);
328  pp, "pbl_mrf_Ribcr", pbl_mrf_Ribcr, lev, max_level);
330  pp, "pbl_mrf_const_b", pbl_mrf_const_b, lev, max_level);
331  query_one_or_per_level(pp, "pbl_mrf_sf", pbl_mrf_sf, lev, max_level);
333  pp, "enable_mrf_countergradient", enable_mrf_countergradient, lev, max_level);
335  pp, "enable_mrf_cloud_adjustment", enable_mrf_cloud_adjustment, lev, max_level);
337  pp, "pbl_mrf_highres_bounds", pbl_mrf_highres_bounds, lev, max_level);
339  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
341  pp, "pbl_mrf_use_zero_ri_extent", pbl_mrf_use_zero_ri_extent, lev, max_level);
342  // QNSE stable stability functions (Sukoriansky et al. 2005)
344  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
346  pp, "qnse_am", qnse_am, lev, max_level);
348  pp, "qnse_bm", qnse_bm, lev, max_level);
350  pp, "qnse_ah", qnse_ah, lev, max_level);
352  pp, "qnse_bh", qnse_bh, lev, max_level);
353  // Scale-aware PBL-LES blending parameters.
355  pp, "pbl_blend_length", pbl_blend_length, lev, max_level);
357  pp, "pbl_blend_cs", pbl_blend_cs, lev, max_level);
359  pp, "pbl_blend_c_max", pbl_blend_c_max, lev, max_level);
361  pp, "pbl_blend_use_smag", pbl_blend_use_smag, lev, max_level);
362  // Vogelezang & Holtslag (1996) shear correction
364  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
366  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
367  // PBLH spatial smoothing
369  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
371  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
373  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
374  // Validate pblh_smoothing_weight is in [0,1]
375  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
376  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
377  }
378  }
379  if (uses_eamxx_shoc()) {
380 #ifndef ERF_USE_EAMXX_SHOC
381  amrex::Abort("PBLType::EAMXX_SHOC requested, but ERF was not built with ERF_ENABLE_EAMXX_SHOC=ON");
382 #endif
383  }
384 
386  std::string zlo_bc = "none";
387  amrex::ParmParse pp_bc("zlo");
388  pp_bc.get("type",zlo_bc);
389  if (amrex::toLower(zlo_bc) != "surface_layer") {
390  amrex::Abort("You must use the surface_layer BC at zlo with the selected PBL.");
391  }
392  }
393  }
394 
395  // Flags for QKE/TKE equation
396  if (pbl_type == PBLType::MYJ || pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
397  // Add sources/sinks to QKE/TKE? (MYJ does this inline)
398  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
399  use_pbl_tke = true;
400  }
401  // Advect QKE/TKE?
402  query_one_or_per_level(pp, "advect_tke" , advect_tke , lev, max_level);
403  // Apply numerical diffusion to QKE/TKE?
404  query_one_or_per_level(pp, "diffuse_tke_3D", diffuse_tke_3D, lev, max_level);
405  }
406 
407  // There is a default value of 1e-6 but the user can override the value here,
408  // and in addition can add perturbational values. and in addition can add perturbational values.
409  pp.queryAdd("tke_min",tke_min);
410 
411  // LES constants...
412  query_one_or_per_level(pp, "Cs", Cs, lev, max_level);
413 
414  query_one_or_per_level(pp, "Pr_t", Pr_t, lev, max_level);
415  query_one_or_per_level(pp, "Sc_t", Sc_t, lev, max_level);
416 
417  // Compute relevant forms of diffusion parameters
418  Pr_t_inv = one / Pr_t;
419  Sc_t_inv = one / Sc_t;
420 
421  if (les_type == LESType::Deardorff) {
422  query_one_or_per_level(pp, "Ck", Ck, lev, max_level);
423  query_one_or_per_level(pp, "Ce", Ce, lev, max_level);
424  query_one_or_per_level(pp, "Ce_wall", Ce_wall, lev, max_level);
425  }
426 
427  // To quantify atmospheric stability for subgrid modeling
428  const bool strat_type_set = (pp.countval("thermal_stratification") > 0);
429  query_one_or_per_level(pp, "thermal_stratification", strat_type, lev, max_level);
430  // The PBL schemes have always used theta_v for their buoyancy gradient,
431  // which is the physically right choice there. Honour an explicit
432  // erf.thermal_stratification everywhere, but when the user has not set it
433  // keep the historical split: theta for the LES closures, theta_v for the
434  // PBL ones. That way the knob reaches the PBL schemes without silently
435  // changing any existing moist answer.
436  pbl_strat_type = strat_type_set ? strat_type : StratType::thetav;
437  amrex::Print() << "PBL thermal stratification variable: "
438  << amrex::getEnumNameString(pbl_strat_type) << std::endl;
439  if (strat_type == StratType::theta) {
440  amrex::Print() << "Thermal stratification based on gradient of potential temperature" << std::endl;
441  } else if (strat_type == StratType::thetav) {
442  amrex::Print() << "Thermal stratification based on gradient of virtual potential temperature" << std::endl;
443  } else if (strat_type == StratType::thetal) {
444  amrex::Print() << "Thermal stratification based on gradient of linearized liquid-water potential temperature" << std::endl;
445  }
446 
447  // k-eqn constants
448  query_one_or_per_level(pp, "Cmu0", Cmu0, lev, max_level);
449  query_one_or_per_level(pp, "Cb", Cb, lev, max_level);
450  query_one_or_per_level(pp, "Rt_crit", Rt_crit, lev, max_level);
451  query_one_or_per_level(pp, "Rt_min", Rt_min, lev, max_level);
452  query_one_or_per_level(pp, "max_geom_lscale", l_g_max, lev, max_level);
453  query_one_or_per_level(pp, "dirichlet_k", dirichlet_k, lev, max_level);
454  query_one_or_per_level(pp, "tke_floor", tke_floor, lev, max_level);
455  query_one_or_per_level(pp, "implicit_tke_dissipation", implicit_tke_dissipation, lev, max_level);
456  query_one_or_per_level(pp, "rans_consistent_diffusivities", rans_consistent_diffusivities, lev, max_level);
457  query_one_or_per_level(pp, "rans_lscale_from_pblh", rans_lscale_from_pblh, lev, max_level);
458  query_one_or_per_level(pp, "rans_lscale_min", rans_lscale_min, lev, max_level);
459  query_one_or_per_level(pp, "rans_realizability", rans_realizability, lev, max_level);
460  if (rans_realizability != zero) {
461  if (!(rans_realizability >= amrex::Real(0.01) && rans_realizability <= amrex::Real(10))) {
462  amrex::Error("erf.rans_realizability must be 0 (off) or in [0.01, 10]; Cmu0^2 = 0.309 is the neutral equilibrium value");
463  }
464  if (rans_type != RANSType::kEqn) {
465  // One value for the whole hierarchy (a single entry, or a list whose entries are all
466  // equal) is meant for the levels that run the k-eqn closure and is reset here; a list
467  // with different entries names this level on purpose and must not switch the cap on
468  // where there is no closure.
469  amrex::Vector<amrex::Real> all_levels;
470  pp.getarr("rans_realizability", all_levels);
471  bool uniform = true;
472  for (auto v : all_levels) { uniform = uniform && (v == all_levels[0]); }
473  if (uniform) {
474  amrex::Print() << "erf.rans_realizability reset to 0 on level " << lev
475  << " (no k-eqn closure there)" << std::endl;
477  } else {
478  amrex::Error("erf.rans_realizability needs erf.rans_type = kEqn (it caps the k-eqn eddy viscosity; level "
479  + std::to_string(lev) + ")");
480  }
481  }
482  }
483  // After the reset above, so a hierarchy with a PBL scheme on an LES level and the cap on
484  // its k-eqn level is accepted
485  if ((rans_realizability != zero) && (pbl_type != PBLType::None)) {
486  amrex::Error("erf.rans_realizability needs erf.pbl_type = None: a PBL scheme overwrites the vertical "
487  "diffusivities the cap acts on (level " + std::to_string(lev) + ")");
488  }
489  if (rans_lscale_from_pblh && !(rans_lscale_min > 0)) {
490  amrex::Error("erf.rans_lscale_min must be > 0 with erf.rans_lscale_from_pblh");
491  }
492 
493  if (rans_type == RANSType::kEqn) {
494  // The stability functions (AL01 Eqs. 31, 32) have poles at Rt = -3.59869
495  // (cmu) and -3.61011 (cmu'); the Burchard & Petersen smoothing maps
496  // Rt < Rt_crit onto (Rt_min, Rt_crit) and needs Rt_min < Rt_crit <= 0,
497  // with Rt_min above the pole of cmu (AL01::Rt_min_lower_bound) and above
498  // the zero of its numerator (AL01::cmu_numerator_root), so cmu > 0.
499  if (!(Cmu0 > 0)) { amrex::Error("erf.Cmu0 must be > 0 for the k-eqn RANS"); }
500  if (!(Cb > 0)) { amrex::Error("erf.Cb must be > 0 for the k-eqn RANS"); }
501  if (!(l_g_max > 0)) { amrex::Error("erf.max_geom_lscale must be > 0 for the k-eqn RANS"); }
502  if (!(Rt_crit <= 0)) { amrex::Error("erf.Rt_crit must be <= 0 for the k-eqn RANS"); }
503  if (!(Rt_min < Rt_crit)) { amrex::Error("erf.Rt_min must be < erf.Rt_crit for the k-eqn RANS"); }
504  if (!(Rt_min > AL01::Rt_min_lower_bound)) {
505  std::ostringstream msg;
506  msg << std::setprecision(8) << "erf.Rt_min must be > " << AL01::Rt_min_lower_bound
507  << " for the k-eqn RANS: the momentum stability function cmu has a pole at Rt = -3.5986889850,"
508  << " and just below it cmu and the eddy viscosity are negative (level " << lev << ")";
509  amrex::Error(msg.str());
510  }
512  std::ostringstream msg;
513  msg << std::setprecision(8) << "erf.Rt_min must be > -erf.Cmu0/0.108 = " << AL01::cmu_numerator_root(Cmu0)
514  << " for the k-eqn RANS: below it the numerator Cmu0 + 0.108 Rt of cmu is negative;"
515  << " raise erf.Cmu0 or erf.Rt_min (level " << lev << ")";
516  amrex::Error(msg.str());
517  }
518  }
519  if (tke_floor < 0) { amrex::Error("erf.tke_floor must be >= 0"); }
520 
521  // Common inputs (LES or RANS)
522  if (!query_one_or_per_level(pp, "sigma_k", sigma_k, lev, max_level) && rans_type == RANSType::kEqn) {
523  amrex::Print() << "Overriding default sigma_k for k-eqn RANS" << std::endl;
524  sigma_k = one;
525  };
526  query_one_or_per_level(pp, "theta_ref", theta_ref, lev, max_level);
527 
528  query_one_or_per_level(pp, "mix_isotropic", mix_isotropic, lev, max_level);
529  query_one_or_per_level(pp, "use_Ri_correction", use_Ri_correction, lev, max_level);
530  query_one_or_per_level(pp, "Ri_crit", Ri_crit, lev, max_level);
531 
532  // Set common flags
533  use_kturb =
535  (pbl_type != PBLType::None));
536  use_keqn =
537  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn));
538  use_tke =
539  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn) ||
540  (pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
541  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family());
542 
543  if (use_tke) {
544  query_one_or_per_level(pp, "init_tke_from_ustar", init_tke_from_ustar, lev, max_level);
545  }
546 
547  // Validate inputs
548  if (les_type == LESType::Smagorinsky) {
549  if (Cs == 0) {
550  amrex::Error("Need to specify Cs for Smagorsinky LES");
551  }
552  if (smag2d && mix_isotropic) {
553  amrex::Print() << "Turning off mix_isotropic for 2-D Smagorinsky" << std::endl;
554  mix_isotropic = false;
555  }
556  }
557 
558  // Opt-in limits of WRF's Smagorinsky-2D closure (dyn_em/module_diffusion_em.F, smag2d_km):
559  // the slope limiter, which divides K_h by alpha or alpha^2 on terrain-fitted meshes, and the
560  // cap K_h <= smag2d_kh_cap * Delta_h (WRF: 10 m/s). Both are off by default. The mesh check
561  // for the slope limiter is in SolverChoice::init_params, where the terrain type is known.
562  query_one_or_per_level(pp, "smag2d_slope_limiter", smag2d_slope_limiter, lev, max_level);
563  query_one_or_per_level(pp, "smag2d_kh_cap", smag2d_kh_cap, lev, max_level);
564  if (!(smag2d_kh_cap >= zero)) {
565  amrex::Error("erf.smag2d_kh_cap must be >= 0 (0 = no cap; WRF uses 10 m/s)");
566  }
568  if (!smag2d) {
569  // A single value applies to every level; it is meant for the levels that run
570  // Smagorinsky2D (SolverChoice aborts if none does). A per-level list must not
571  // switch the limits on at a level that does not.
572  if (pp.countval("smag2d_slope_limiter") == 1) { smag2d_slope_limiter = false; }
573  if (pp.countval("smag2d_kh_cap") == 1) { smag2d_kh_cap = zero; }
575  amrex::Error("erf.smag2d_slope_limiter and erf.smag2d_kh_cap apply only to "
576  "erf.les_type = Smagorinsky2D (level " + std::to_string(lev) + ")");
577  }
578  }
579  }
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:85
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:43
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:107
bool advect_tke
Whether TKE/QKE is advected.
Definition: ERF_TurbStruct.H:1065
StratType strat_type
Thermodynamic variable used for stability stratification.
Definition: ERF_TurbStruct.H:866
MYNNLevel2 pbl_mynn_level2
MYNN level-2 closure coefficients for limiting.
Definition: ERF_TurbStruct.H:974
bool diffuse_tke_3D
Whether three-dimensional numerical diffusion is applied to TKE/QKE.
Definition: ERF_TurbStruct.H:1067
bool use_tke
Whether any TKE or QKE closure is active.
Definition: ERF_TurbStruct.H:983
StratType pbl_strat_type
Definition: ERF_TurbStruct.H:868
amrex::Real Sc_t_inv
Inverse turbulent Schmidt number.
Definition: ERF_TurbStruct.H:834
bool use_keqn
Whether a microscale TKE closure is active.
Definition: ERF_TurbStruct.H:978
bool uses_eamxx_shoc() const noexcept
Query whether this level uses the EAMxx SHOC PBL scheme.
Definition: ERF_TurbStruct.H:915
bool uses_shoc_family() const noexcept
Query whether this level uses any SHOC-family PBL scheme.
Definition: ERF_TurbStruct.H:933
bool init_tke_from_ustar
Whether initial TKE/QKE profiles are based on surface friction velocity.
Definition: ERF_TurbStruct.H:988
amrex::Real pbl_ib_z0
Definition: ERF_TurbStruct.H:1047
bool pbl_ib_aware
Definition: ERF_TurbStruct.H:1046
bool smag2d_limits_requested
Whether either Smagorinsky-2D limit was given as on for this level.
Definition: ERF_TurbStruct.H:845
amrex::Real tke_min
Minimum TKE/QKE value.
Definition: ERF_TurbStruct.H:991
bool use_kturb
Whether any turbulence model is active.
Definition: ERF_TurbStruct.H:977
amrex::Real Pr_t_inv
Inverse turbulent Prandtl number.
Definition: ERF_TurbStruct.H:830
bool use_pbl_tke
Whether a mesoscale PBL TKE closure is active.
Definition: ERF_TurbStruct.H:981
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).
944  {
945  return ( (les_type == LESType::Smagorinsky && (smag2d || !mix_isotropic)) ||
946  (les_type == LESType::Deardorff && !mix_isotropic) ||
947  (pbl_type != PBLType::None) );
948  }

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.
955  {
956  return (pbl_type == PBLType::MYNN25) ||
957  (pbl_type == PBLType::MYNNEDMF) ||
958  (pbl_type == PBLType::YSU) ||
959  (pbl_type == PBLType::YSUNew) ||
960  (pbl_type == PBLType::MRF) ||
962  }

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.
969  {
970  return uses_shoc_family();
971  }
Here is the call graph for this function:

◆ uses_eamxx_shoc()

bool TurbChoice::uses_eamxx_shoc ( ) const
inlinenoexcept

Query whether this level uses the EAMxx SHOC PBL scheme.

Returns
True if PBLType::EAMXX_SHOC is selected.
916  {
917  return pbl_type == PBLType::EAMXX_SHOC;
918  }

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

Here is the caller 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.
925  {
926  return pbl_type == PBLType::NATIVE_SHOC;
927  }

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 or EAMxx SHOC is selected.
934  {
935  return uses_eamxx_shoc() || uses_native_shoc();
936  }
bool uses_native_shoc() const noexcept
Query whether this level uses the native SHOC PBL scheme.
Definition: ERF_TurbStruct.H:924

Referenced by ComputeTurbulentViscosity(), 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(), ComputeDiffusivityYSUNew(), display(), and init_params().

◆ enable_pblh_smoothing

TurbChoice::enable_pblh_smoothing = false

Whether spatial smoothing of diagnosed PBLH is enabled.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSUNew(), 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(), ComputeDiffusivityYSUNew(), display(), and init_params().

◆ enable_ysu_cloud_pblh

TurbChoice::enable_ysu_cloud_pblh
Initial value:
=
true

Whether YSU cloud-based PBL-height detection is enabled.

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

◆ enable_ysu_countergradient

TurbChoice::enable_ysu_countergradient
Initial value:
=
true

Whether YSU countergradient corrections are enabled.

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

◆ enable_ysu_entrainment

TurbChoice::enable_ysu_entrainment
Initial value:
=
true

Whether YSU entrainment-layer parameterization is enabled.

Referenced by ComputeDiffusivityYSUNew(), 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 ComputeDiffusivityYSUNew(), display(), and init_params().

◆ enable_ysu_terrain_pblh_floor

TurbChoice::enable_ysu_terrain_pblh_floor
Initial value:
=
true

Whether YSU applies a terrain-following PBL-height floor.

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

◆ enable_ysu_topdown

TurbChoice::enable_ysu_topdown
Initial value:
=
true

Whether YSU top-down mixing is enabled.

Referenced by ComputeDiffusivityYSUNew(), 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().

◆ 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 YSUNew 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 (half a cell above its surface, at least 10 m). Off by default; without immersed cells the results are identical. Not supported with terrain-fitted coordinates.

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

◆ pbl_ib_z0

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

Roughness length [m] of that log law.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSUNew(), 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(), ComputeDiffusivityYSUNew(), 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_sf

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

MRF surface flux value used to compute PBL height.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSUNew(), 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(), ComputeDiffusivityYSUNew(), 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(), ComputeDiffusivityYSUNew(), display(), and init_params().

◆ pbl_ysu_force_over_water

TurbChoice::pbl_ysu_force_over_water
Initial value:
=
false

Whether YSU is forced to use over-water behavior.

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(), ComputeDiffusivityYSUNew(), display(), and init_params().

◆ pbl_ysu_unst_Ribcr

TurbChoice::pbl_ysu_unst_Ribcr
Initial value:
=

Critical bulk Richardson number for unstable 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 YSUNew applies high-resolution grid-dependent diffusivity bounds.

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

◆ pblh_smoothing_passes

TurbChoice::pblh_smoothing_passes = 1

Number of PBLH smoothing iterations to apply.

Referenced by ComputeDiffusivityMRF(), ComputeDiffusivityYSUNew(), 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(), ComputeDiffusivityYSUNew(), display(), and init_params().

◆ Pr_t

TurbChoice::Pr_t = one / three

Turbulent Prandtl number.

Referenced by 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

◆ qnse_bh

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

◆ qnse_bm

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

amrex::Real TurbChoice::rans_realizability = zero

◆ rans_type

TurbChoice::rans_type = RANSType::None

◆ 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

Whether the 2-D Smagorinsky formulation is used.

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

◆ 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(), ComputeDiffusivityYSUNew(), display(), and init_params().

◆ ysu_moistvars

TurbChoice::ysu_moistvars = false

Whether YSU applies turbulence to moisture variables.

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

◆ ysu_qcloud_threshold

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

Cloud liquid water threshold for YSUNew [kg/kg].

Referenced by ComputeDiffusivityYSUNew(), 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: