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
 
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_liquid_theta
 Whether YSU uses liquid-water virtual potential temperature for stability. 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.
536  {
537  // BC compatibility
539  phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer ) {
540  amrex::Abort("The selected PBL model requires MOST at lower boundary");
541  }
542  if ( (les_type == LESType::Deardorff) && (Ce_wall > 0) &&
543  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer) &&
544  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::slip_wall) &&
545  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::no_slip_wall) )
546  {
547  amrex::Warning("Deardorff LES assumes wall at zlo when applying Ce_wall");
548  }
549  }
@ no_slip_wall
@ surface_layer
amrex::Real Ce_wall
Wall value for the Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:800
LESType les_type
Selected LES closure.
Definition: ERF_TurbStruct.H:777
bool pbl_requires_surface_layer() const noexcept
Query whether the selected PBL scheme requires surface-layer boundary conditions.
Definition: ERF_TurbStruct.H:898
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.
556  {
557  amrex::Print() << "Turbulence Settings at level " << lev << std::endl;
558 
559  if (
561  pbl_type == PBLType::None) {
562  amrex::Print() << " Using DNS model at level " << lev << std::endl;
563  } else if (les_type == LESType::Smagorinsky) {
564  if (smag2d) {
565  amrex::Print() << " Using 2D Smagorinsky LES model at level " << lev << std::endl;
566  } else {
567  amrex::Print() << " Using Smagorinsky LES model at level " << lev << std::endl;
568  }
569  if (use_Ri_correction) {
570  amrex::Print() << " Smagorinsky uses Richardson number correction with Ri_crit = "
571  << Ri_crit << std::endl;
572  }
573  if (smag2d) {
574  amrex::Print() << " WRF slope limiter : " << smag2d_slope_limiter << std::endl;
575  if (smag2d_kh_cap > zero) {
576  amrex::Print() << " K_h cap : " << smag2d_kh_cap << " * Delta_h" << std::endl;
577  } else {
578  amrex::Print() << " K_h cap : none" << std::endl;
579  }
580  }
581  } else if (les_type == LESType::Deardorff) {
582  amrex::Print() << " Using Deardorff LES model at level " << lev << std::endl;
583  } else if (rans_type == RANSType::kEqn) {
584  amrex::Print()
585  << " Using Axell & Liungman one-equation RANS k model at level " << lev
586  << std::endl;
587  } else if (pbl_type == PBLType::MYJ) {
588  amrex::Print() << " Using MYJ PBL model at level " << lev << std::endl;
589  } else if (pbl_type == PBLType::MYNN25) {
590  amrex::Print() << " Using MYNN2.5 PBL model at level " << lev << std::endl;
591  } else if (pbl_type == PBLType::MYNNEDMF) {
592  amrex::Print() << " Using MYNNEDMF PBL model at level " << lev << std::endl;
593  } else if (pbl_type == PBLType::YSU) {
594  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
595  } else if (pbl_type == PBLType::YSUNew) {
596  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
597  } else if (pbl_type == PBLType::MRF) {
598  amrex::Print() << " Using MRF PBL model at level " << lev << std::endl;
599  } else if (pbl_type == PBLType::EAMXX_SHOC) {
600  amrex::Print() << " Using EAMxx SHOC PBL model at level " << lev << std::endl;
601  } else if (pbl_type == PBLType::NATIVE_SHOC) {
602  amrex::Print() << " Using native SHOC PBL model at level " << lev << std::endl;
603  } else {
604  amrex::Error("Unknown turbulence model");
605  }
606 
607  if (les_type != LESType::None) {
608  if (les_type == LESType::Smagorinsky) {
609  amrex::Print() << " Cs : " << Cs << std::endl;
610  }
611  if (les_type == LESType::Deardorff) {
612  amrex::Print() << " Ce : " << Ce << std::endl;
613  amrex::Print() << " Ce at wall : " << Ce_wall << std::endl;
614  amrex::Print() << " Ck : " << Ck << std::endl;
615  amrex::Print() << " sigma_k : " << sigma_k << std::endl;
616 
617  // Sullivan et al 1994, Eqn 14
618  amrex::Real Cs_equiv = std::sqrt(Ck * std::sqrt(Ck / Ce));
619  amrex::Print() << " equivalent Cs : " << Cs_equiv
620  << std::endl;
621  }
622  amrex::Print() << " isotropic mixing : " << mix_isotropic
623  << std::endl;
624  }
625 
626  if (rans_type != RANSType::None) {
627  if (rans_type == RANSType::kEqn) {
628  amrex::Print() << "Cmu0 : " << Cmu0 << std::endl;
629  amrex::Print() << "sigma_k : " << sigma_k << std::endl;
630  amrex::Print() << "Cb : " << Cb << std::endl;
631  amrex::Print() << "Rt_crit : " << Rt_crit << std::endl;
632  amrex::Print() << "Rt_min : " << Rt_min << std::endl;
633  amrex::Print() << "max_geom_lscale : " << l_g_max << std::endl;
634  amrex::Print() << "dirichlet_k : " << dirichlet_k << std::endl;
635  amrex::Print() << "tke_floor : " << tke_floor << std::endl;
636  amrex::Print() << "implicit_tke_dissipation : " << implicit_tke_dissipation << std::endl;
637  amrex::Print() << "consistent diffusivities : " << rans_consistent_diffusivities << std::endl;
638  amrex::Print() << "lscale cap from PBL height : " << rans_lscale_from_pblh
639  << " (floor " << rans_lscale_min << " m)" << std::endl;
640  }
641  }
642 
643  if ((les_type == LESType::Deardorff) ||
644  (rans_type == RANSType::kEqn)) {
645  if (theta_ref > 0) {
646  amrex::Print() << " reference theta : " << theta_ref << std::endl;
647  } else {
648  amrex::Print() << " reference theta : n/a" << std::endl;
649  }
650  }
651 
652  if ((les_type != LESType::None) || (rans_type != RANSType::None)) {
653  amrex::Print() << " Pr_t : " << Pr_t << std::endl;
654  amrex::Print() << " Sc_t : " << Sc_t << std::endl;
655  }
656 
657  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
658  amrex::Print() << " pbl_mynn_Lt_taper_exp : "
659  << pbl_mynn.Lt_taper_exp << std::endl;
660  amrex::Print() << " pbl_mynn_config : "
661  << amrex::getEnumNameString(pbl_mynn.config) << std::endl;
662  amrex::Print() << " pbl_mynn_Lt_alpha : " << pbl_mynn.Lt_alpha << std::endl;
663  amrex::Print() << " pbl_mynn_A1 : " << pbl_mynn.A1 << std::endl;
664  amrex::Print() << " pbl_mynn_A2 : " << pbl_mynn.A2 << std::endl;
665  amrex::Print() << " pbl_mynn_B1 : " << pbl_mynn.B1 << std::endl;
666  amrex::Print() << " pbl_mynn_B2 : " << pbl_mynn.B2 << std::endl;
667  amrex::Print() << " pbl_mynn_C1 : " << pbl_mynn.C1 << std::endl;
668  amrex::Print() << " pbl_mynn_C2 : " << pbl_mynn.C2 << std::endl;
669  amrex::Print() << " pbl_mynn_C3 : " << pbl_mynn.C3 << std::endl;
670  amrex::Print() << " pbl_mynn_C4 : " << pbl_mynn.C4 << std::endl;
671  amrex::Print() << " pbl_mynn_C5 : " << pbl_mynn.C5 << std::endl;
672  } else if (pbl_type == PBLType::YSU || pbl_type == PBLType::YSUNew) {
673  amrex::Print() << " pbl_ysu_coriolis_freq : "
674  << pbl_ysu_coriolis_freq << std::endl;
675  amrex::Print() << " pbl_ysu_use_consistent_coriolis : "
676  << pbl_ysu_use_consistent_coriolis << std::endl;
677  amrex::Print() << " pbl_ysu_force_over_water : "
678  << pbl_ysu_force_over_water << std::endl;
679  amrex::Print() << " pbl_ysu_land_Ribcr : "
680  << pbl_ysu_land_Ribcr << std::endl;
681  amrex::Print() << " pbl_ysu_unst_Ribcr : "
682  << pbl_ysu_unst_Ribcr << std::endl;
683  amrex::Print() << " enable_ysu_liquid_theta : "
684  << enable_ysu_liquid_theta << std::endl;
685  amrex::Print() << " enable_ysu_countergradient : "
686  << enable_ysu_countergradient << std::endl;
687  amrex::Print() << " enable_ysu_terrain_pblh_floor : "
688  << enable_ysu_terrain_pblh_floor << std::endl;
689  amrex::Print() << " enable_ysu_sat_limiter : "
690  << enable_ysu_sat_limiter << std::endl;
691  amrex::Print() << " enable_ysu_topdown : "
692  << enable_ysu_topdown << std::endl;
693  amrex::Print() << " enable_ysu_entrainment : "
694  << enable_ysu_entrainment << std::endl;
695  amrex::Print() << " enable_ysu_cloud_pblh : "
696  << enable_ysu_cloud_pblh << std::endl;
697  amrex::Print() << " ysu_qcloud_threshold : "
698  << ysu_qcloud_threshold << std::endl;
699  amrex::Print() << " ysu_moistvars : "
700  << ysu_moistvars << std::endl;
701  amrex::Print() << " pbl_ysunew_highres_bounds : "
702  << pbl_ysunew_highres_bounds << std::endl;
703  // Radiative tendency limiter/smoothing (YSUNew-only)
704  amrex::Print() << " enable_ysu_rad_tend_limiter : "
705  << enable_ysu_rad_tend_limiter << std::endl;
706  amrex::Print() << " ysu_rad_tend_limiter_magnitude : "
707  << ysu_rad_tend_limiter_magnitude << std::endl;
708  amrex::Print() << " enable_vh96_shear_correction : "
709  << enable_vh96_shear_correction << std::endl;
710  amrex::Print() << " vh96_shear_const_b : "
711  << vh96_shear_const_b << std::endl;
712  amrex::Print() << " enable_pblh_smoothing : "
713  << enable_pblh_smoothing << std::endl;
714  amrex::Print() << " pblh_smoothing_passes : "
715  << pblh_smoothing_passes << std::endl;
716  amrex::Print() << " pblh_smoothing_weight : "
717  << pblh_smoothing_weight << std::endl;
718  amrex::Print() << " enable_mrf_unbounded_vpert : "
719  << enable_mrf_unbounded_vpert << std::endl;
720  amrex::Print() << " enable_qnse_stable_functions : "
721  << enable_qnse_stable_functions << std::endl;
723  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
724  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
725  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
726  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
727  }
728  } else if (pbl_type == PBLType::MRF) {
729  amrex::Print() << " pbl_mrf_coriolis_freq : " << pbl_mrf_coriolis_freq
730  << std::endl;
731  amrex::Print() << " pbl_mrf_Ribcr : " << pbl_mrf_Ribcr
732  << std::endl;
733  amrex::Print() << " pbl_mrf_const_b : " << pbl_mrf_const_b
734  << std::endl;
735  amrex::Print() << " pbl_mrf_sf : " << pbl_mrf_sf
736  << std::endl;
737  amrex::Print() << " enable_mrf_countergradient : " << enable_mrf_countergradient
738  << std::endl;
739  amrex::Print() << " enable_mrf_cloud_adjustment : " << enable_mrf_cloud_adjustment
740  << std::endl;
741  amrex::Print() << " pbl_mrf_highres_bounds : " << pbl_mrf_highres_bounds
742  << std::endl;
743  amrex::Print() << " enable_mrf_unbounded_vpert : " << enable_mrf_unbounded_vpert
744  << std::endl;
745  amrex::Print() << " pbl_mrf_use_zero_ri_extent : " << pbl_mrf_use_zero_ri_extent
746  << std::endl;
747  amrex::Print() << " pbl_blend_length : " << pbl_blend_length
748  << std::endl;
749  amrex::Print() << " pbl_blend_cs : " << pbl_blend_cs
750  << std::endl;
751  amrex::Print() << " pbl_blend_c_max : " << pbl_blend_c_max
752  << std::endl;
753  amrex::Print() << " pbl_blend_use_smag : " << pbl_blend_use_smag
754  << std::endl;
755  amrex::Print() << " enable_vh96_shear_correction : " << enable_vh96_shear_correction
756  << std::endl;
757  amrex::Print() << " vh96_shear_const_b : " << vh96_shear_const_b
758  << std::endl;
759  amrex::Print() << " enable_pblh_smoothing : " << enable_pblh_smoothing
760  << std::endl;
761  amrex::Print() << " pblh_smoothing_passes : " << pblh_smoothing_passes
762  << std::endl;
763  amrex::Print() << " pblh_smoothing_weight : " << pblh_smoothing_weight
764  << std::endl;
765  amrex::Print() << " enable_qnse_stable_functions : "
766  << enable_qnse_stable_functions << std::endl;
768  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
769  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
770  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
771  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
772  }
773  }
774  }
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:945
bool implicit_tke_dissipation
Definition: ERF_TurbStruct.H:839
bool rans_consistent_diffusivities
Definition: ERF_TurbStruct.H:844
amrex::Real Ce
Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:799
bool enable_mrf_unbounded_vpert
Whether MRF leaves VPERT unlimited by GAMCRT.
Definition: ERF_TurbStruct.H:996
amrex::Real Sc_t
Turbulent Schmidt number.
Definition: ERF_TurbStruct.H:784
amrex::Real sigma_k
TKE diffusivity coefficient denominator.
Definition: ERF_TurbStruct.H:812
bool use_Ri_correction
Whether Richardson-number correction is applied.
Definition: ERF_TurbStruct.H:824
bool pbl_ysu_use_consistent_coriolis
Whether YSU uses the ERF Coriolis frequency.
Definition: ERF_TurbStruct.H:942
amrex::Real pbl_blend_length
Boutle blending length L [m]. 0 = off.
Definition: ERF_TurbStruct.H:987
amrex::Real Ck
Deardorff eddy-viscosity coefficient.
Definition: ERF_TurbStruct.H:801
bool pbl_mrf_use_zero_ri_extent
Whether MRF uses the Ri=0 K-profile extent.
Definition: ERF_TurbStruct.H:997
amrex::Real qnse_ah
Definition: ERF_TurbStruct.H:1007
RANSType rans_type
Selected RANS closure.
Definition: ERF_TurbStruct.H:828
bool enable_vh96_shear_correction
Whether Vogelezang & Holtslag (1996) shear-correction term is enabled.
Definition: ERF_TurbStruct.H:974
amrex::Real theta_ref
Reference potential temperature for stable stratification.
Definition: ERF_TurbStruct.H:815
amrex::Real l_g_max
Maximum geometric length scale.
Definition: ERF_TurbStruct.H:808
bool enable_mrf_cloud_adjustment
Whether MRF cloud-aware stability adjustments are enabled.
Definition: ERF_TurbStruct.H:994
bool enable_ysu_entrainment
Whether YSU entrainment-layer parameterization is enabled.
Definition: ERF_TurbStruct.H:962
bool enable_ysu_sat_limiter
Whether YSU applies a saturation limiter to moisture countergradient terms.
Definition: ERF_TurbStruct.H:958
bool enable_ysu_cloud_pblh
Whether YSU cloud-based PBL-height detection is enabled.
Definition: ERF_TurbStruct.H:964
amrex::Real pbl_mrf_const_b
MRF constant used to compute PBL height.
Definition: ERF_TurbStruct.H:982
amrex::Real pblh_smoothing_weight
Center-cell weight in PBLH smoothing stencil (must be in [0,1]).
Definition: ERF_TurbStruct.H:978
amrex::Real pbl_blend_cs
Smagorinsky coeff for K_h ceiling.
Definition: ERF_TurbStruct.H:988
amrex::Real tke_floor
Definition: ERF_TurbStruct.H:835
amrex::Real ysu_qcloud_threshold
Cloud liquid water threshold for YSUNew [kg/kg].
Definition: ERF_TurbStruct.H:966
amrex::Real qnse_bm
Definition: ERF_TurbStruct.H:1006
amrex::Real pbl_blend_c_max
Power-law ceiling coeff [m^(2/3)/s].
Definition: ERF_TurbStruct.H:989
amrex::Real qnse_bh
Definition: ERF_TurbStruct.H:1008
bool enable_qnse_stable_functions
Definition: ERF_TurbStruct.H:1003
bool enable_mrf_countergradient
Whether MRF countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:991
bool enable_ysu_countergradient
Whether YSU countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:954
bool mix_isotropic
Whether subgrid mixing uses isotropic length scales.
Definition: ERF_TurbStruct.H:822
bool enable_pblh_smoothing
Whether spatial smoothing of diagnosed PBLH is enabled.
Definition: ERF_TurbStruct.H:976
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:793
bool dirichlet_k
Whether TKE uses Dirichlet boundary treatment.
Definition: ERF_TurbStruct.H:830
int pblh_smoothing_passes
Number of PBLH smoothing iterations to apply.
Definition: ERF_TurbStruct.H:977
bool enable_ysu_topdown
Whether YSU top-down mixing is enabled.
Definition: ERF_TurbStruct.H:960
bool rans_lscale_from_pblh
Definition: ERF_TurbStruct.H:849
amrex::Real ysu_rad_tend_limiter_magnitude
Definition: ERF_TurbStruct.H:972
amrex::Real rans_lscale_min
Definition: ERF_TurbStruct.H:850
bool pbl_mrf_highres_bounds
Whether MRF applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:995
amrex::Real Rt_min
Minimum turbulent Reynolds number.
Definition: ERF_TurbStruct.H:807
bool pbl_blend_use_smag
Use Smagorinsky ceiling (else power-law).
Definition: ERF_TurbStruct.H:990
MYNNLevel25 pbl_mynn
MYNN level-2.5 closure coefficients.
Definition: ERF_TurbStruct.H:917
amrex::Real pbl_ysu_land_Ribcr
Critical bulk Richardson number over land for stable YSU conditions.
Definition: ERF_TurbStruct.H:948
amrex::Real Cb
One-equation RANS buoyancy coefficient.
Definition: ERF_TurbStruct.H:805
amrex::Real Ri_crit
Critical Richardson number for stability correction.
Definition: ERF_TurbStruct.H:825
amrex::Real pbl_ysu_unst_Ribcr
Critical bulk Richardson number for unstable YSU conditions.
Definition: ERF_TurbStruct.H:950
amrex::Real Rt_crit
Critical turbulent Reynolds number.
Definition: ERF_TurbStruct.H:806
amrex::Real vh96_shear_const_b
Vogelezang & Holtslag (1996) shear-correction constant b.
Definition: ERF_TurbStruct.H:975
amrex::Real pbl_mrf_Ribcr
Critical bulk Richardson number for the MRF PBL scheme.
Definition: ERF_TurbStruct.H:981
amrex::Real qnse_am
Definition: ERF_TurbStruct.H:1005
amrex::Real pbl_mrf_sf
MRF surface flux value used to compute PBL height.
Definition: ERF_TurbStruct.H:983
amrex::Real Cmu0
One-equation RANS Cmu0 coefficient.
Definition: ERF_TurbStruct.H:804
amrex::Real Cs
Smagorinsky model coefficient.
Definition: ERF_TurbStruct.H:788
amrex::Real Pr_t
Turbulent Prandtl number.
Definition: ERF_TurbStruct.H:780
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:792
amrex::Real pbl_mrf_coriolis_freq
Coriolis frequency used by the MRF PBL scheme.
Definition: ERF_TurbStruct.H:980
bool pbl_ysunew_highres_bounds
Whether YSUNew applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:969
amrex::Real pbl_ysu_coriolis_freq
Coriolis frequency used by YSU-family PBL schemes.
Definition: ERF_TurbStruct.H:939
bool ysu_moistvars
Whether YSU applies turbulence to moisture variables.
Definition: ERF_TurbStruct.H:968
PBLType pbl_type
Selected PBL closure.
Definition: ERF_TurbStruct.H:853
bool enable_ysu_terrain_pblh_floor
Whether YSU applies a terrain-following PBL-height floor.
Definition: ERF_TurbStruct.H:956
bool enable_ysu_liquid_theta
Whether YSU uses liquid-water virtual potential temperature for stability.
Definition: ERF_TurbStruct.H:952
bool smag2d
Whether the 2-D Smagorinsky formulation is used.
Definition: ERF_TurbStruct.H:789
bool enable_ysu_rad_tend_limiter
Definition: ERF_TurbStruct.H:971

◆ 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.
124  {
125  amrex::ParmParse pp(pp_prefix);
126 
127  // Which LES closure?
128  query_one_or_per_level(pp, "les_type", les_type, lev, max_level);
129  // Immersed-boundary awareness of the MRF and YSUNew schemes (off by default):
130  // the surface of a column with immersed solid cells is the first fluid cell
131  // above them, heights and the boundary-layer depth are measured from it,
132  // the eddy diffusivities are zero inside the solid, and the surface
133  // scales over such a column come from a neutral log law at its top with
134  // the roughness pbl_ib_z0. Only MRF and YSUNew honour it.
135  query_one_or_per_level(pp, "pbl_ib_aware", pbl_ib_aware, lev, max_level);
136  query_one_or_per_level(pp, "pbl_ib_z0", pbl_ib_z0, lev, max_level);
137 
138  // Handle 2-D Smag
139  if (les_type == LESType::Smagorinsky2D) {
140  les_type = LESType::Smagorinsky;
141  smag2d = true;
142  }
143 
144  // Which RANS closure?
145  query_one_or_per_level(pp, "rans_type", rans_type, lev, max_level);
146 
147  if ((rans_type != RANSType::None) && (les_type != LESType::None)) {
148  amrex::Error("Hybrid RANS-LES not implemented");
149  }
150 
151  // Which PBL Closure
152  query_one_or_per_level_enum_case_insensitive(pp, "pbl_type", pbl_type, lev, max_level);
153  if (pbl_type == PBLType::SHOC) {
154  static bool warned_legacy_shoc = false;
155  if (!warned_legacy_shoc) {
156  amrex::Warning("erf.pbl_type = SHOC is deprecated; use erf.pbl_type = EAMXX_SHOC");
157  warned_legacy_shoc = true;
158  }
159  pbl_type = PBLType::EAMXX_SHOC;
160  }
161 
162  // Do some more stuff for PBL Modeling
163  if (pbl_type != PBLType::None) {
164  // Check for compatibility between PBL, LES, Molec Transport
165  if (les_type != LESType::None) {
166  amrex::Print() << "Selected a PBL model and an LES model: "
167  << "Using PBL for vertical transport, LES for horizontal"
168  << std::endl;
169  }
170  if (les_type == LESType::Smagorinsky) {
171  if (!smag2d)
172  amrex::Error("If using Smagorinsky with a PBL model, the 2-D "
173  "formulation should be used");
174  } else if (les_type == LESType::Deardorff) {
175  amrex::Error(
176  "It is not recommended to use Deardorff LES and a PBL model");
177  }
178  // Both the k-eqn RANS closure and these PBL schemes transport RhoKE
179  if ((rans_type == RANSType::kEqn) &&
180  ((pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
181  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family())) {
182  amrex::Error("erf.rans_type = kEqn cannot be combined with erf.pbl_type = " +
183  std::string(amrex::getEnumNameString(pbl_type)) +
184  ": both transport the turbulent kinetic energy");
185  }
186 
187  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
189  pp, "pbl_mynn_Lt_taper_exp", pbl_mynn.Lt_taper_exp, lev, max_level);
190  if (pbl_mynn.Lt_taper_exp < 0) {
191  amrex::Error("erf.pbl_mynn_Lt_taper_exp must be >= 0 "
192  "(0 disables the taper)");
193  }
194  // NN09 (the default) uses Lt_alpha = 0.23 and a 1/l sum for the master
195  // length scale; Chen2021 uses Lt_alpha = 0.10 and a 1/l^2 sum.
197  pp, "pbl_mynn_config", pbl_mynn.config, lev, max_level);
198  // l_T = Lt_alpha*<zq>/<q> follows the config unless set explicitly.
199  pbl_mynn.Lt_alpha = (pbl_mynn.config == MYNNConfigType::Chen2021)
200  ? amrex::Real(0.1) : amrex::Real(0.23);
202  pp, "pbl_mynn_Lt_alpha", pbl_mynn.Lt_alpha, lev, max_level);
203  query_one_or_per_level(pp, "pbl_mynn_A1", pbl_mynn.A1, lev, max_level);
204  query_one_or_per_level(pp, "pbl_mynn_A2", pbl_mynn.A2, lev, max_level);
205  query_one_or_per_level(pp, "pbl_mynn_B1", pbl_mynn.B1, lev, max_level);
206  query_one_or_per_level(pp, "pbl_mynn_B2", pbl_mynn.B2, lev, max_level);
207  query_one_or_per_level(pp, "pbl_mynn_C1", pbl_mynn.C1, lev, max_level);
208  query_one_or_per_level(pp, "pbl_mynn_C2", pbl_mynn.C2, lev, max_level);
209  query_one_or_per_level(pp, "pbl_mynn_C3", pbl_mynn.C3, lev, max_level);
210  query_one_or_per_level(pp, "pbl_mynn_C4", pbl_mynn.C4, lev, max_level);
211  query_one_or_per_level(pp, "pbl_mynn_C5", pbl_mynn.C5, lev, max_level);
215  // Moisture is now always diffused by MYNN, as it is by every other
216  // PBL scheme; catch the retired flag rather than ignoring it silently.
217  if (pp.contains("pbl_mynn_diffuse_moistvars")) {
218  amrex::Abort("erf.pbl_mynn_diffuse_moistvars has been removed. "
219  "MYNN always diffuses the moisture variables now, as "
220  "MYJ, YSU, MRF and SHOC always have; there is no "
221  "longer a way to turn it off.");
222  }
224  pp, "pbl_mynn_SMmin", pbl_mynn.SMmin, lev, max_level);
226  pp, "pbl_mynn_SMmax", pbl_mynn.SMmax, lev, max_level);
228  pp, "pbl_mynn_SHmin", pbl_mynn.SHmin, lev, max_level);
230  pp, "pbl_mynn_SHmax", pbl_mynn.SHmax, lev, max_level);
232  pp, "pbl_mynn_SQfactor", pbl_mynn.SQfac, lev, max_level);
233 
234  // SQ = SQfac*SM, so its bound is tied to SHmax and SQfac; the default member
235  // initializer was evaluated before either could be overridden here.
237 
238  } else if (pbl_type == PBLType::YSU || pbl_type == PBLType::YSUNew) {
240  pp, "pbl_ysu_coriolis_freq", pbl_ysu_coriolis_freq, lev, max_level);
242  pp, "pbl_ysu_use_consistent_coriolis",
243  pbl_ysu_use_consistent_coriolis, lev, max_level);
245  pp, "pbl_ysu_force_over_water", pbl_ysu_force_over_water, lev,
246  max_level);
248  pp, "pbl_ysu_land_Ribcr", pbl_ysu_land_Ribcr, lev, max_level);
250  pp, "pbl_ysu_unst_Ribcr", pbl_ysu_unst_Ribcr, lev, max_level);
252  pp, "enable_ysu_liquid_theta", enable_ysu_liquid_theta, lev, max_level);
254  pp, "enable_ysu_countergradient", enable_ysu_countergradient, lev, max_level);
256  pp, "enable_ysu_terrain_pblh_floor", enable_ysu_terrain_pblh_floor, lev, max_level);
258  pp, "enable_ysu_sat_limiter", enable_ysu_sat_limiter, lev, max_level);
260  pp, "enable_ysu_topdown", enable_ysu_topdown, lev, max_level);
262  pp, "enable_ysu_entrainment", enable_ysu_entrainment, lev, max_level);
264  pp, "enable_ysu_cloud_pblh", enable_ysu_cloud_pblh, lev, max_level);
266  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
268  pp, "ysu_qcloud_threshold", ysu_qcloud_threshold, lev, max_level);
270  pp, "ysu_moistvars", ysu_moistvars, lev, max_level);
272  pp, "pbl_ysunew_highres_bounds", pbl_ysunew_highres_bounds, lev, max_level);
273  // Radiative tendency limiter (YSUNew-only)
275  pp, "enable_ysu_rad_tend_limiter", enable_ysu_rad_tend_limiter, lev, max_level);
277  pp, "ysu_rad_tend_limiter_magnitude", ysu_rad_tend_limiter_magnitude, lev, max_level);
278  if (!(ysu_rad_tend_limiter_magnitude > 0.0)) {
279  if (amrex::ParallelDescriptor::IOProcessor()) {
280  amrex::Print() << "WARNING: erf.ysu_rad_tend_limiter_magnitude = "
282  << " is not positive; using the default of 1.0 K/s\n";
283  }
285  }
286  // Vogelezang & Holtslag (1996) shear correction
288  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
290  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
291  // PBLH spatial smoothing
293  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
295  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
297  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
298  // Validate pblh_smoothing_weight is in [0,1]
299  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
300  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
301  }
302  // QNSE stable stability functions (Sukoriansky et al. 2005)
304  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
306  pp, "qnse_am", qnse_am, lev, max_level);
308  pp, "qnse_bm", qnse_bm, lev, max_level);
310  pp, "qnse_ah", qnse_ah, lev, max_level);
312  pp, "qnse_bh", qnse_bh, lev, max_level);
313  } else if (pbl_type == PBLType::MRF) {
315  pp, "pbl_mrf_coriolis_freq", pbl_mrf_coriolis_freq, lev, max_level);
317  pp, "pbl_mrf_Ribcr", pbl_mrf_Ribcr, lev, max_level);
319  pp, "pbl_mrf_const_b", pbl_mrf_const_b, lev, max_level);
320  query_one_or_per_level(pp, "pbl_mrf_sf", pbl_mrf_sf, lev, max_level);
322  pp, "enable_mrf_countergradient", enable_mrf_countergradient, lev, max_level);
324  pp, "enable_mrf_cloud_adjustment", enable_mrf_cloud_adjustment, lev, max_level);
326  pp, "pbl_mrf_highres_bounds", pbl_mrf_highres_bounds, lev, max_level);
328  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
330  pp, "pbl_mrf_use_zero_ri_extent", pbl_mrf_use_zero_ri_extent, lev, max_level);
331  // QNSE stable stability functions (Sukoriansky et al. 2005)
333  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
335  pp, "qnse_am", qnse_am, lev, max_level);
337  pp, "qnse_bm", qnse_bm, lev, max_level);
339  pp, "qnse_ah", qnse_ah, lev, max_level);
341  pp, "qnse_bh", qnse_bh, lev, max_level);
342  // Scale-aware PBL-LES blending parameters.
344  pp, "pbl_blend_length", pbl_blend_length, lev, max_level);
346  pp, "pbl_blend_cs", pbl_blend_cs, lev, max_level);
348  pp, "pbl_blend_c_max", pbl_blend_c_max, lev, max_level);
350  pp, "pbl_blend_use_smag", pbl_blend_use_smag, lev, max_level);
351  // Vogelezang & Holtslag (1996) shear correction
353  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
355  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
356  // PBLH spatial smoothing
358  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
360  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
362  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
363  // Validate pblh_smoothing_weight is in [0,1]
364  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
365  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
366  }
367  } else if (pbl_type == PBLType::SHOC) {
368 #ifndef ERF_USE_SHOC
369  amrex::Abort("You set use_shoc to true but didn't build with SHOC; you must rebuild the executable");
370  }
371 #endif
372  if (uses_eamxx_shoc()) {
373 #ifndef ERF_USE_EAMXX_SHOC
374  amrex::Abort("PBLType::EAMXX_SHOC requested, but ERF was not built with ERF_ENABLE_EAMXX_SHOC=ON");
375 #endif
376  }
377 
379  std::string zlo_bc = "none";
380  amrex::ParmParse pp_bc("zlo");
381  pp_bc.get("type",zlo_bc);
382  if (amrex::toLower(zlo_bc) != "surface_layer") {
383  amrex::Abort("You must use the surface_layer BC at zlo with the selected PBL.");
384  }
385  }
386  }
387 
388  // Flags for QKE/TKE equation
389  if (pbl_type == PBLType::MYJ || pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
390  // Add sources/sinks to QKE/TKE? (MYJ does this inline)
391  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
392  use_pbl_tke = true;
393  }
394  // Advect QKE/TKE?
395  query_one_or_per_level(pp, "advect_tke" , advect_tke , lev, max_level);
396  // Apply numerical diffusion to QKE/TKE?
397  query_one_or_per_level(pp, "diffuse_tke_3D", diffuse_tke_3D, lev, max_level);
398  }
399 
400  // There is a default value of 1e-6 but the user can override the value here,
401  // and in addition can add perturbational values. and in addition can add perturbational values.
402  pp.queryAdd("tke_min",tke_min);
403 
404  // LES constants...
405  query_one_or_per_level(pp, "Cs", Cs, lev, max_level);
406 
407  query_one_or_per_level(pp, "Pr_t", Pr_t, lev, max_level);
408  query_one_or_per_level(pp, "Sc_t", Sc_t, lev, max_level);
409 
410  // Compute relevant forms of diffusion parameters
411  Pr_t_inv = one / Pr_t;
412  Sc_t_inv = one / Sc_t;
413 
414  if (les_type == LESType::Deardorff) {
415  query_one_or_per_level(pp, "Ck", Ck, lev, max_level);
416  query_one_or_per_level(pp, "Ce", Ce, lev, max_level);
417  query_one_or_per_level(pp, "Ce_wall", Ce_wall, lev, max_level);
418  }
419 
420  // To quantify atmospheric stability for subgrid modeling
421  const bool strat_type_set = (pp.countval("thermal_stratification") > 0);
422  query_one_or_per_level(pp, "thermal_stratification", strat_type, lev, max_level);
423  // The PBL schemes have always used theta_v for their buoyancy gradient,
424  // which is the physically right choice there. Honour an explicit
425  // erf.thermal_stratification everywhere, but when the user has not set it
426  // keep the historical split: theta for the LES closures, theta_v for the
427  // PBL ones. That way the knob reaches the PBL schemes without silently
428  // changing any existing moist answer.
429  pbl_strat_type = strat_type_set ? strat_type : StratType::thetav;
430  amrex::Print() << "PBL thermal stratification variable: "
431  << amrex::getEnumNameString(pbl_strat_type) << std::endl;
432  if (strat_type == StratType::theta) {
433  amrex::Print() << "Thermal stratification based on gradient of potential temperature" << std::endl;
434  } else if (strat_type == StratType::thetav) {
435  amrex::Print() << "Thermal stratification based on gradient of virtual potential temperature" << std::endl;
436  } else if (strat_type == StratType::thetal) {
437  amrex::Print() << "Thermal stratification based on gradient of linearized liquid-water potential temperature" << std::endl;
438  }
439 
440  // k-eqn constants
441  query_one_or_per_level(pp, "Cmu0", Cmu0, lev, max_level);
442  query_one_or_per_level(pp, "Cb", Cb, lev, max_level);
443  query_one_or_per_level(pp, "Rt_crit", Rt_crit, lev, max_level);
444  query_one_or_per_level(pp, "Rt_min", Rt_min, lev, max_level);
445  query_one_or_per_level(pp, "max_geom_lscale", l_g_max, lev, max_level);
446  query_one_or_per_level(pp, "dirichlet_k", dirichlet_k, lev, max_level);
447  query_one_or_per_level(pp, "tke_floor", tke_floor, lev, max_level);
448  query_one_or_per_level(pp, "implicit_tke_dissipation", implicit_tke_dissipation, lev, max_level);
449  query_one_or_per_level(pp, "rans_consistent_diffusivities", rans_consistent_diffusivities, lev, max_level);
450  query_one_or_per_level(pp, "rans_lscale_from_pblh", rans_lscale_from_pblh, lev, max_level);
451  query_one_or_per_level(pp, "rans_lscale_min", rans_lscale_min, lev, max_level);
452  if (rans_lscale_from_pblh && !(rans_lscale_min > 0)) {
453  amrex::Error("erf.rans_lscale_min must be > 0 with erf.rans_lscale_from_pblh");
454  }
455 
456  if (rans_type == RANSType::kEqn) {
457  // The stability functions (AL01 Eqs. 31, 32) have poles near Rt = -3.6;
458  // the Burchard & Petersen smoothing maps Rt < Rt_crit onto
459  // (Rt_min, Rt_crit) and needs Rt_min < Rt_crit <= 0.
460  if (!(Cmu0 > 0)) { amrex::Error("erf.Cmu0 must be > 0 for the k-eqn RANS"); }
461  if (!(Cb > 0)) { amrex::Error("erf.Cb must be > 0 for the k-eqn RANS"); }
462  if (!(l_g_max > 0)) { amrex::Error("erf.max_geom_lscale must be > 0 for the k-eqn RANS"); }
463  if (!(Rt_crit <= 0)) { amrex::Error("erf.Rt_crit must be <= 0 for the k-eqn RANS"); }
464  if (!(Rt_min < Rt_crit)) { amrex::Error("erf.Rt_min must be < erf.Rt_crit for the k-eqn RANS"); }
465  if (!(Rt_min > amrex::Real(-3.6))) {
466  amrex::Error("erf.Rt_min must be > -3.6 for the k-eqn RANS (stability functions have poles near -3.61)");
467  }
468  }
469  if (tke_floor < 0) { amrex::Error("erf.tke_floor must be >= 0"); }
470 
471  // Common inputs (LES or RANS)
472  if (!query_one_or_per_level(pp, "sigma_k", sigma_k, lev, max_level) && rans_type == RANSType::kEqn) {
473  amrex::Print() << "Overriding default sigma_k for k-eqn RANS" << std::endl;
474  sigma_k = one;
475  };
476  query_one_or_per_level(pp, "theta_ref", theta_ref, lev, max_level);
477 
478  query_one_or_per_level(pp, "mix_isotropic", mix_isotropic, lev, max_level);
479  query_one_or_per_level(pp, "use_Ri_correction", use_Ri_correction, lev, max_level);
480  query_one_or_per_level(pp, "Ri_crit", Ri_crit, lev, max_level);
481 
482  // Set common flags
483  use_kturb =
485  (pbl_type != PBLType::None));
486  use_keqn =
487  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn));
488  use_tke =
489  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn) ||
490  (pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
491  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family());
492 
493  if (use_tke) {
494  query_one_or_per_level(pp, "init_tke_from_ustar", init_tke_from_ustar, lev, max_level);
495  }
496 
497  // Validate inputs
498  if (les_type == LESType::Smagorinsky) {
499  if (Cs == 0) {
500  amrex::Error("Need to specify Cs for Smagorsinky LES");
501  }
502  if (smag2d && mix_isotropic) {
503  amrex::Print() << "Turning off mix_isotropic for 2-D Smagorinsky" << std::endl;
504  mix_isotropic = false;
505  }
506  }
507 
508  // Opt-in limits of WRF's Smagorinsky-2D closure (dyn_em/module_diffusion_em.F, smag2d_km):
509  // the slope limiter, which divides K_h by alpha or alpha^2 on terrain-fitted meshes, and the
510  // cap K_h <= smag2d_kh_cap * Delta_h (WRF: 10 m/s). Both are off by default. The mesh check
511  // for the slope limiter is in SolverChoice::init_params, where the terrain type is known.
512  query_one_or_per_level(pp, "smag2d_slope_limiter", smag2d_slope_limiter, lev, max_level);
513  query_one_or_per_level(pp, "smag2d_kh_cap", smag2d_kh_cap, lev, max_level);
514  if (!(smag2d_kh_cap >= zero)) {
515  amrex::Error("erf.smag2d_kh_cap must be >= 0 (0 = no cap; WRF uses 10 m/s)");
516  }
518  if (!smag2d) {
519  // A single value applies to every level; it is meant for the levels that run
520  // Smagorinsky2D (SolverChoice aborts if none does). A per-level list must not
521  // switch the limits on at a level that does not.
522  if (pp.countval("smag2d_slope_limiter") == 1) { smag2d_slope_limiter = false; }
523  if (pp.countval("smag2d_kh_cap") == 1) { smag2d_kh_cap = zero; }
525  amrex::Error("erf.smag2d_slope_limiter and erf.smag2d_kh_cap apply only to "
526  "erf.les_type = Smagorinsky2D (level " + std::to_string(lev) + ")");
527  }
528  }
529  }
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:81
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:39
@ 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:1011
StratType strat_type
Thermodynamic variable used for stability stratification.
Definition: ERF_TurbStruct.H:817
MYNNLevel2 pbl_mynn_level2
MYNN level-2 closure coefficients for limiting.
Definition: ERF_TurbStruct.H:918
bool diffuse_tke_3D
Whether three-dimensional numerical diffusion is applied to TKE/QKE.
Definition: ERF_TurbStruct.H:1013
bool use_tke
Whether any TKE or QKE closure is active.
Definition: ERF_TurbStruct.H:927
StratType pbl_strat_type
Definition: ERF_TurbStruct.H:819
amrex::Real Sc_t_inv
Inverse turbulent Schmidt number.
Definition: ERF_TurbStruct.H:785
bool use_keqn
Whether a microscale TKE closure is active.
Definition: ERF_TurbStruct.H:922
bool uses_eamxx_shoc() const noexcept
Query whether this level uses the EAMxx SHOC PBL scheme.
Definition: ERF_TurbStruct.H:859
bool uses_shoc_family() const noexcept
Query whether this level uses any SHOC-family PBL scheme.
Definition: ERF_TurbStruct.H:877
bool init_tke_from_ustar
Whether initial TKE/QKE profiles are based on surface friction velocity.
Definition: ERF_TurbStruct.H:932
amrex::Real pbl_ib_z0
Definition: ERF_TurbStruct.H:993
bool pbl_ib_aware
Definition: ERF_TurbStruct.H:992
bool smag2d_limits_requested
Whether either Smagorinsky-2D limit was given as on for this level.
Definition: ERF_TurbStruct.H:796
amrex::Real tke_min
Minimum TKE/QKE value.
Definition: ERF_TurbStruct.H:935
bool use_kturb
Whether any turbulence model is active.
Definition: ERF_TurbStruct.H:921
amrex::Real Pr_t_inv
Inverse turbulent Prandtl number.
Definition: ERF_TurbStruct.H:781
bool use_pbl_tke
Whether a mesoscale PBL TKE closure is active.
Definition: ERF_TurbStruct.H:925
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).
888  {
889  return ( (les_type == LESType::Smagorinsky && (smag2d || !mix_isotropic)) ||
890  (les_type == LESType::Deardorff && !mix_isotropic) ||
891  (pbl_type != PBLType::None) );
892  }

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.
899  {
900  return (pbl_type == PBLType::MYNN25) ||
901  (pbl_type == PBLType::MYNNEDMF) ||
902  (pbl_type == PBLType::YSU) ||
903  (pbl_type == PBLType::YSUNew) ||
904  (pbl_type == PBLType::MRF) ||
906  }

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.
913  {
914  return uses_shoc_family();
915  }
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.
860  {
861  return pbl_type == PBLType::EAMXX_SHOC;
862  }

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.
869  {
870  return pbl_type == PBLType::NATIVE_SHOC;
871  }

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.
878  {
879  return uses_eamxx_shoc() || uses_native_shoc();
880  }
bool uses_native_shoc() const noexcept
Query whether this level uses the native SHOC PBL scheme.
Definition: ERF_TurbStruct.H:868

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_liquid_theta

TurbChoice::enable_ysu_liquid_theta
Initial value:
=
true

Whether YSU uses liquid-water virtual potential temperature for stability.

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

◆ 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(), and ERF::ReportTerrainSlopeFactor().

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