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 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...
 
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...
 
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.
484  {
485  // BC compatibility
487  phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer ) {
488  amrex::Abort("The selected PBL model requires MOST at lower boundary");
489  }
490  if ( (les_type == LESType::Deardorff) && (Ce_wall > 0) &&
491  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer) &&
492  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::slip_wall) &&
493  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::no_slip_wall) )
494  {
495  amrex::Warning("Deardorff LES assumes wall at zlo when applying Ce_wall");
496  }
497  }
@ no_slip_wall
@ surface_layer
amrex::Real Ce_wall
Wall value for the Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:728
LESType les_type
Selected LES closure.
Definition: ERF_TurbStruct.H:712
bool pbl_requires_surface_layer() const noexcept
Query whether the selected PBL scheme requires surface-layer boundary conditions.
Definition: ERF_TurbStruct.H:812
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.
504  {
505  amrex::Print() << "Turbulence Settings at level " << lev << std::endl;
506 
507  if (
508  les_type == LESType::None && rans_type == RANSType::None &&
509  pbl_type == PBLType::None) {
510  amrex::Print() << " Using DNS model at level " << lev << std::endl;
511  } else if (les_type == LESType::Smagorinsky) {
512  if (smag2d) {
513  amrex::Print() << " Using 2D Smagorinsky LES model at level " << lev << std::endl;
514  } else {
515  amrex::Print() << " Using Smagorinsky LES model at level " << lev << std::endl;
516  }
517  if (use_Ri_correction) {
518  amrex::Print() << " Smagorinsky uses Richardson number correction with Ri_crit = "
519  << Ri_crit << std::endl;
520  }
521  } else if (les_type == LESType::Deardorff) {
522  amrex::Print() << " Using Deardorff LES model at level " << lev << std::endl;
523  } else if (rans_type == RANSType::kEqn) {
524  amrex::Print()
525  << " Using Axell & Liungman one-equation RANS k model at level " << lev
526  << std::endl;
527  } else if (pbl_type == PBLType::MYJ) {
528  amrex::Print() << " Using MYJ PBL model at level " << lev << std::endl;
529  } else if (pbl_type == PBLType::MYNN25) {
530  amrex::Print() << " Using MYNN2.5 PBL model at level " << lev << std::endl;
531  } else if (pbl_type == PBLType::MYNNEDMF) {
532  amrex::Print() << " Using MYNNEDMF PBL model at level " << lev << std::endl;
533  } else if (pbl_type == PBLType::YSU) {
534  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
535  } else if (pbl_type == PBLType::YSUNew) {
536  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
537  } else if (pbl_type == PBLType::MRF) {
538  amrex::Print() << " Using MRF PBL model at level " << lev << std::endl;
539  } else if (pbl_type == PBLType::EAMXX_SHOC) {
540  amrex::Print() << " Using EAMxx SHOC PBL model at level " << lev << std::endl;
541  } else if (pbl_type == PBLType::NATIVE_SHOC) {
542  amrex::Print() << " Using native SHOC PBL model at level " << lev << std::endl;
543  } else {
544  amrex::Error("Unknown turbulence model");
545  }
546 
547  if (les_type != LESType::None) {
548  if (les_type == LESType::Smagorinsky) {
549  amrex::Print() << " Cs : " << Cs << std::endl;
550  }
551  if (les_type == LESType::Deardorff) {
552  amrex::Print() << " Ce : " << Ce << std::endl;
553  amrex::Print() << " Ce at wall : " << Ce_wall << std::endl;
554  amrex::Print() << " Ck : " << Ck << std::endl;
555  amrex::Print() << " sigma_k : " << sigma_k << std::endl;
556 
557  // Sullivan et al 1994, Eqn 14
558  amrex::Real Cs_equiv = std::sqrt(Ck * std::sqrt(Ck / Ce));
559  amrex::Print() << " equivalent Cs : " << Cs_equiv
560  << std::endl;
561  }
562  amrex::Print() << " isotropic mixing : " << mix_isotropic
563  << std::endl;
564  }
565 
566  if (rans_type != RANSType::None) {
567  if (rans_type == RANSType::kEqn) {
568  amrex::Print() << "Cmu0 : " << Cmu0 << std::endl;
569  amrex::Print() << "sigma_k : " << sigma_k << std::endl;
570  amrex::Print() << "Cb : " << Cb << std::endl;
571  amrex::Print() << "Rt_crit : " << Rt_crit << std::endl;
572  amrex::Print() << "Rt_min : " << Rt_min << std::endl;
573  amrex::Print() << "max_geom_lscale : " << l_g_max << std::endl;
574  amrex::Print() << "dirichlet_k : " << dirichlet_k << std::endl;
575  amrex::Print() << "tke_floor : " << tke_floor << std::endl;
576  amrex::Print() << "implicit_tke_dissipation : " << implicit_tke_dissipation << std::endl;
577  amrex::Print() << "consistent diffusivities : " << rans_consistent_diffusivities << std::endl;
578  amrex::Print() << "lscale cap from PBL height : " << rans_lscale_from_pblh
579  << " (floor " << rans_lscale_min << " m)" << std::endl;
580  }
581  }
582 
583  if ((les_type == LESType::Deardorff) ||
584  (rans_type == RANSType::kEqn)) {
585  if (theta_ref > 0) {
586  amrex::Print() << " reference theta : " << theta_ref << std::endl;
587  } else {
588  amrex::Print() << " reference theta : n/a" << std::endl;
589  }
590  }
591 
592  if ((les_type != LESType::None) || (rans_type != RANSType::None)) {
593  amrex::Print() << " Pr_t : " << Pr_t << std::endl;
594  amrex::Print() << " Sc_t : " << Sc_t << std::endl;
595  }
596 
597  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
598  amrex::Print() << " pbl_mynn_A1 : " << pbl_mynn.A1 << std::endl;
599  amrex::Print() << " pbl_mynn_A2 : " << pbl_mynn.A2 << std::endl;
600  amrex::Print() << " pbl_mynn_B1 : " << pbl_mynn.B1 << std::endl;
601  amrex::Print() << " pbl_mynn_B2 : " << pbl_mynn.B2 << std::endl;
602  amrex::Print() << " pbl_mynn_C1 : " << pbl_mynn.C1 << std::endl;
603  amrex::Print() << " pbl_mynn_C2 : " << pbl_mynn.C2 << std::endl;
604  amrex::Print() << " pbl_mynn_C3 : " << pbl_mynn.C3 << std::endl;
605  amrex::Print() << " pbl_mynn_C4 : " << pbl_mynn.C4 << std::endl;
606  amrex::Print() << " pbl_mynn_C5 : " << pbl_mynn.C5 << std::endl;
607  } else if (pbl_type == PBLType::YSU || pbl_type == PBLType::YSUNew) {
608  amrex::Print() << " pbl_ysu_coriolis_freq : "
609  << pbl_ysu_coriolis_freq << std::endl;
610  amrex::Print() << " pbl_ysu_use_consistent_coriolis : "
611  << pbl_ysu_use_consistent_coriolis << std::endl;
612  amrex::Print() << " pbl_ysu_force_over_water : "
613  << pbl_ysu_force_over_water << std::endl;
614  amrex::Print() << " pbl_ysu_land_Ribcr : "
615  << pbl_ysu_land_Ribcr << std::endl;
616  amrex::Print() << " pbl_ysu_unst_Ribcr : "
617  << pbl_ysu_unst_Ribcr << std::endl;
618  amrex::Print() << " enable_ysu_liquid_theta : "
619  << enable_ysu_liquid_theta << std::endl;
620  amrex::Print() << " enable_ysu_countergradient : "
621  << enable_ysu_countergradient << std::endl;
622  amrex::Print() << " enable_ysu_terrain_pblh_floor : "
623  << enable_ysu_terrain_pblh_floor << std::endl;
624  amrex::Print() << " enable_ysu_sat_limiter : "
625  << enable_ysu_sat_limiter << std::endl;
626  amrex::Print() << " enable_ysu_topdown : "
627  << enable_ysu_topdown << std::endl;
628  amrex::Print() << " enable_ysu_entrainment : "
629  << enable_ysu_entrainment << std::endl;
630  amrex::Print() << " enable_ysu_cloud_pblh : "
631  << enable_ysu_cloud_pblh << std::endl;
632  amrex::Print() << " ysu_qcloud_threshold : "
633  << ysu_qcloud_threshold << std::endl;
634  amrex::Print() << " ysu_moistvars : "
635  << ysu_moistvars << std::endl;
636  amrex::Print() << " pbl_ysunew_highres_bounds : "
637  << pbl_ysunew_highres_bounds << std::endl;
638  // Radiative tendency limiter/smoothing (YSUNew-only)
639  amrex::Print() << " enable_ysu_rad_tend_limiter : "
640  << enable_ysu_rad_tend_limiter << std::endl;
641  amrex::Print() << " ysu_rad_tend_limiter_magnitude : "
642  << ysu_rad_tend_limiter_magnitude << std::endl;
643  amrex::Print() << " enable_vh96_shear_correction : "
644  << enable_vh96_shear_correction << std::endl;
645  amrex::Print() << " vh96_shear_const_b : "
646  << vh96_shear_const_b << std::endl;
647  amrex::Print() << " enable_pblh_smoothing : "
648  << enable_pblh_smoothing << std::endl;
649  amrex::Print() << " pblh_smoothing_passes : "
650  << pblh_smoothing_passes << std::endl;
651  amrex::Print() << " pblh_smoothing_weight : "
652  << pblh_smoothing_weight << std::endl;
653  amrex::Print() << " enable_mrf_unbounded_vpert : "
654  << enable_mrf_unbounded_vpert << std::endl;
655  amrex::Print() << " enable_qnse_stable_functions : "
656  << enable_qnse_stable_functions << std::endl;
658  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
659  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
660  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
661  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
662  }
663  } else if (pbl_type == PBLType::MRF) {
664  amrex::Print() << " pbl_mrf_coriolis_freq : " << pbl_mrf_coriolis_freq
665  << std::endl;
666  amrex::Print() << " pbl_mrf_Ribcr : " << pbl_mrf_Ribcr
667  << std::endl;
668  amrex::Print() << " pbl_mrf_const_b : " << pbl_mrf_const_b
669  << std::endl;
670  amrex::Print() << " pbl_mrf_sf : " << pbl_mrf_sf
671  << std::endl;
672  amrex::Print() << " enable_mrf_countergradient : " << enable_mrf_countergradient
673  << std::endl;
674  amrex::Print() << " enable_mrf_cloud_adjustment : " << enable_mrf_cloud_adjustment
675  << std::endl;
676  amrex::Print() << " pbl_mrf_highres_bounds : " << pbl_mrf_highres_bounds
677  << std::endl;
678  amrex::Print() << " enable_mrf_unbounded_vpert : " << enable_mrf_unbounded_vpert
679  << std::endl;
680  amrex::Print() << " pbl_mrf_use_zero_ri_extent : " << pbl_mrf_use_zero_ri_extent
681  << std::endl;
682  amrex::Print() << " pbl_blend_length : " << pbl_blend_length
683  << std::endl;
684  amrex::Print() << " pbl_blend_cs : " << pbl_blend_cs
685  << std::endl;
686  amrex::Print() << " pbl_blend_c_max : " << pbl_blend_c_max
687  << std::endl;
688  amrex::Print() << " pbl_blend_use_smag : " << pbl_blend_use_smag
689  << std::endl;
690  amrex::Print() << " enable_vh96_shear_correction : " << enable_vh96_shear_correction
691  << std::endl;
692  amrex::Print() << " vh96_shear_const_b : " << vh96_shear_const_b
693  << std::endl;
694  amrex::Print() << " enable_pblh_smoothing : " << enable_pblh_smoothing
695  << std::endl;
696  amrex::Print() << " pblh_smoothing_passes : " << pblh_smoothing_passes
697  << std::endl;
698  amrex::Print() << " pblh_smoothing_weight : " << pblh_smoothing_weight
699  << std::endl;
700  amrex::Print() << " enable_qnse_stable_functions : "
701  << enable_qnse_stable_functions << std::endl;
703  amrex::Print() << " qnse_am (momentum coeff) : " << qnse_am << std::endl;
704  amrex::Print() << " qnse_bm (momentum coeff) : " << qnse_bm << std::endl;
705  amrex::Print() << " qnse_ah (heat coeff) : " << qnse_ah << std::endl;
706  amrex::Print() << " qnse_bh (heat coeff) : " << qnse_bh << std::endl;
707  }
708  }
709  }
amrex::Real Real
Definition: ERF_ShocInterface.H:19
amrex::Real C4
Definition: ERF_MYNNStruct.H:53
amrex::Real C1
Definition: ERF_MYNNStruct.H:50
amrex::Real C3
Definition: ERF_MYNNStruct.H:52
amrex::Real C2
Definition: ERF_MYNNStruct.H:51
amrex::Real A2
Definition: ERF_MYNNStruct.H:47
amrex::Real B1
Definition: ERF_MYNNStruct.H:48
amrex::Real B2
Definition: ERF_MYNNStruct.H:49
amrex::Real C5
Definition: ERF_MYNNStruct.H:54
amrex::Real A1
Definition: ERF_MYNNStruct.H:46
bool pbl_ysu_force_over_water
Whether YSU is forced to use over-water behavior.
Definition: ERF_TurbStruct.H:859
bool implicit_tke_dissipation
Definition: ERF_TurbStruct.H:765
bool rans_consistent_diffusivities
Definition: ERF_TurbStruct.H:770
amrex::Real Ce
Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:727
bool enable_mrf_unbounded_vpert
Whether MRF leaves VPERT unlimited by GAMCRT.
Definition: ERF_TurbStruct.H:910
amrex::Real Sc_t
Turbulent Schmidt number.
Definition: ERF_TurbStruct.H:719
amrex::Real sigma_k
TKE diffusivity coefficient denominator.
Definition: ERF_TurbStruct.H:740
bool use_Ri_correction
Whether Richardson-number correction is applied.
Definition: ERF_TurbStruct.H:750
bool pbl_ysu_use_consistent_coriolis
Whether YSU uses the ERF Coriolis frequency.
Definition: ERF_TurbStruct.H:856
amrex::Real pbl_blend_length
Boutle blending length L [m]. 0 = off.
Definition: ERF_TurbStruct.H:901
amrex::Real Ck
Deardorff eddy-viscosity coefficient.
Definition: ERF_TurbStruct.H:729
bool pbl_mrf_use_zero_ri_extent
Whether MRF uses the Ri=0 K-profile extent.
Definition: ERF_TurbStruct.H:911
amrex::Real qnse_ah
Definition: ERF_TurbStruct.H:921
RANSType rans_type
Selected RANS closure.
Definition: ERF_TurbStruct.H:754
bool enable_vh96_shear_correction
Whether Vogelezang & Holtslag (1996) shear-correction term is enabled.
Definition: ERF_TurbStruct.H:888
amrex::Real theta_ref
Reference potential temperature for stable stratification.
Definition: ERF_TurbStruct.H:743
amrex::Real l_g_max
Maximum geometric length scale.
Definition: ERF_TurbStruct.H:736
bool enable_mrf_cloud_adjustment
Whether MRF cloud-aware stability adjustments are enabled.
Definition: ERF_TurbStruct.H:908
bool enable_ysu_entrainment
Whether YSU entrainment-layer parameterization is enabled.
Definition: ERF_TurbStruct.H:876
bool enable_ysu_sat_limiter
Whether YSU applies a saturation limiter to moisture countergradient terms.
Definition: ERF_TurbStruct.H:872
bool enable_ysu_cloud_pblh
Whether YSU cloud-based PBL-height detection is enabled.
Definition: ERF_TurbStruct.H:878
amrex::Real pbl_mrf_const_b
MRF constant used to compute PBL height.
Definition: ERF_TurbStruct.H:896
amrex::Real pblh_smoothing_weight
Center-cell weight in PBLH smoothing stencil (must be in [0,1]).
Definition: ERF_TurbStruct.H:892
amrex::Real pbl_blend_cs
Smagorinsky coeff for K_h ceiling.
Definition: ERF_TurbStruct.H:902
amrex::Real tke_floor
Definition: ERF_TurbStruct.H:761
amrex::Real ysu_qcloud_threshold
Cloud liquid water threshold for YSUNew [kg/kg].
Definition: ERF_TurbStruct.H:880
amrex::Real qnse_bm
Definition: ERF_TurbStruct.H:920
amrex::Real pbl_blend_c_max
Power-law ceiling coeff [m^(2/3)/s].
Definition: ERF_TurbStruct.H:903
amrex::Real qnse_bh
Definition: ERF_TurbStruct.H:922
bool enable_qnse_stable_functions
Definition: ERF_TurbStruct.H:917
bool enable_mrf_countergradient
Whether MRF countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:905
bool enable_ysu_countergradient
Whether YSU countergradient corrections are enabled.
Definition: ERF_TurbStruct.H:868
bool mix_isotropic
Whether subgrid mixing uses isotropic length scales.
Definition: ERF_TurbStruct.H:748
bool enable_pblh_smoothing
Whether spatial smoothing of diagnosed PBLH is enabled.
Definition: ERF_TurbStruct.H:890
bool dirichlet_k
Whether TKE uses Dirichlet boundary treatment.
Definition: ERF_TurbStruct.H:756
int pblh_smoothing_passes
Number of PBLH smoothing iterations to apply.
Definition: ERF_TurbStruct.H:891
bool enable_ysu_topdown
Whether YSU top-down mixing is enabled.
Definition: ERF_TurbStruct.H:874
bool rans_lscale_from_pblh
Definition: ERF_TurbStruct.H:775
amrex::Real ysu_rad_tend_limiter_magnitude
Definition: ERF_TurbStruct.H:886
amrex::Real rans_lscale_min
Definition: ERF_TurbStruct.H:776
bool pbl_mrf_highres_bounds
Whether MRF applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:909
amrex::Real Rt_min
Minimum turbulent Reynolds number.
Definition: ERF_TurbStruct.H:735
bool pbl_blend_use_smag
Use Smagorinsky ceiling (else power-law).
Definition: ERF_TurbStruct.H:904
MYNNLevel25 pbl_mynn
MYNN level-2.5 closure coefficients.
Definition: ERF_TurbStruct.H:831
amrex::Real pbl_ysu_land_Ribcr
Critical bulk Richardson number over land for stable YSU conditions.
Definition: ERF_TurbStruct.H:862
amrex::Real Cb
One-equation RANS buoyancy coefficient.
Definition: ERF_TurbStruct.H:733
amrex::Real Ri_crit
Critical Richardson number for stability correction.
Definition: ERF_TurbStruct.H:751
amrex::Real pbl_ysu_unst_Ribcr
Critical bulk Richardson number for unstable YSU conditions.
Definition: ERF_TurbStruct.H:864
amrex::Real Rt_crit
Critical turbulent Reynolds number.
Definition: ERF_TurbStruct.H:734
amrex::Real vh96_shear_const_b
Vogelezang & Holtslag (1996) shear-correction constant b.
Definition: ERF_TurbStruct.H:889
amrex::Real pbl_mrf_Ribcr
Critical bulk Richardson number for the MRF PBL scheme.
Definition: ERF_TurbStruct.H:895
amrex::Real qnse_am
Definition: ERF_TurbStruct.H:919
amrex::Real pbl_mrf_sf
MRF surface flux value used to compute PBL height.
Definition: ERF_TurbStruct.H:897
amrex::Real Cmu0
One-equation RANS Cmu0 coefficient.
Definition: ERF_TurbStruct.H:732
amrex::Real Cs
Smagorinsky model coefficient.
Definition: ERF_TurbStruct.H:723
amrex::Real Pr_t
Turbulent Prandtl number.
Definition: ERF_TurbStruct.H:715
amrex::Real pbl_mrf_coriolis_freq
Coriolis frequency used by the MRF PBL scheme.
Definition: ERF_TurbStruct.H:894
bool pbl_ysunew_highres_bounds
Whether YSUNew applies high-resolution grid-dependent diffusivity bounds.
Definition: ERF_TurbStruct.H:883
amrex::Real pbl_ysu_coriolis_freq
Coriolis frequency used by YSU-family PBL schemes.
Definition: ERF_TurbStruct.H:853
bool ysu_moistvars
Whether YSU applies turbulence to moisture variables.
Definition: ERF_TurbStruct.H:882
PBLType pbl_type
Selected PBL closure.
Definition: ERF_TurbStruct.H:779
bool enable_ysu_terrain_pblh_floor
Whether YSU applies a terrain-following PBL-height floor.
Definition: ERF_TurbStruct.H:870
bool enable_ysu_liquid_theta
Whether YSU uses liquid-water virtual potential temperature for stability.
Definition: ERF_TurbStruct.H:866
bool smag2d
Whether the 2-D Smagorinsky formulation is used.
Definition: ERF_TurbStruct.H:724
bool enable_ysu_rad_tend_limiter
Definition: ERF_TurbStruct.H:885

◆ 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) {
188  query_one_or_per_level(pp, "pbl_mynn_A1", pbl_mynn.A1, lev, max_level);
189  query_one_or_per_level(pp, "pbl_mynn_A2", pbl_mynn.A2, lev, max_level);
190  query_one_or_per_level(pp, "pbl_mynn_B1", pbl_mynn.B1, lev, max_level);
191  query_one_or_per_level(pp, "pbl_mynn_B2", pbl_mynn.B2, lev, max_level);
192  query_one_or_per_level(pp, "pbl_mynn_C1", pbl_mynn.C1, lev, max_level);
193  query_one_or_per_level(pp, "pbl_mynn_C2", pbl_mynn.C2, lev, max_level);
194  query_one_or_per_level(pp, "pbl_mynn_C3", pbl_mynn.C3, lev, max_level);
195  query_one_or_per_level(pp, "pbl_mynn_C4", pbl_mynn.C4, lev, max_level);
196  query_one_or_per_level(pp, "pbl_mynn_C5", pbl_mynn.C5, lev, max_level);
201  pp, "pbl_mynn_diffuse_moistvars", pbl_mynn.diffuse_moistvars, lev,
202  max_level);
204  pp, "pbl_mynn_SMmin", pbl_mynn.SMmin, lev, max_level);
206  pp, "pbl_mynn_SMmax", pbl_mynn.SMmax, lev, max_level);
208  pp, "pbl_mynn_SHmin", pbl_mynn.SHmin, lev, max_level);
210  pp, "pbl_mynn_SHmax", pbl_mynn.SHmax, lev, max_level);
212  pp, "pbl_mynn_SQfactor", pbl_mynn.SQfac, lev, max_level);
213 
214  // SQ = SQfac*SM, so its bound is tied to SHmax and SQfac; the default member
215  // initializer was evaluated before either could be overridden here.
217 
218  } else if (pbl_type == PBLType::YSU || pbl_type == PBLType::YSUNew) {
220  pp, "pbl_ysu_coriolis_freq", pbl_ysu_coriolis_freq, lev, max_level);
222  pp, "pbl_ysu_use_consistent_coriolis",
223  pbl_ysu_use_consistent_coriolis, lev, max_level);
225  pp, "pbl_ysu_force_over_water", pbl_ysu_force_over_water, lev,
226  max_level);
228  pp, "pbl_ysu_land_Ribcr", pbl_ysu_land_Ribcr, lev, max_level);
230  pp, "pbl_ysu_unst_Ribcr", pbl_ysu_unst_Ribcr, lev, max_level);
232  pp, "enable_ysu_liquid_theta", enable_ysu_liquid_theta, lev, max_level);
234  pp, "enable_ysu_countergradient", enable_ysu_countergradient, lev, max_level);
236  pp, "enable_ysu_terrain_pblh_floor", enable_ysu_terrain_pblh_floor, lev, max_level);
238  pp, "enable_ysu_sat_limiter", enable_ysu_sat_limiter, lev, max_level);
240  pp, "enable_ysu_topdown", enable_ysu_topdown, lev, max_level);
242  pp, "enable_ysu_entrainment", enable_ysu_entrainment, lev, max_level);
244  pp, "enable_ysu_cloud_pblh", enable_ysu_cloud_pblh, lev, max_level);
246  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
248  pp, "ysu_qcloud_threshold", ysu_qcloud_threshold, lev, max_level);
250  pp, "ysu_moistvars", ysu_moistvars, lev, max_level);
252  pp, "pbl_ysunew_highres_bounds", pbl_ysunew_highres_bounds, lev, max_level);
253  // Radiative tendency limiter (YSUNew-only)
255  pp, "enable_ysu_rad_tend_limiter", enable_ysu_rad_tend_limiter, lev, max_level);
257  pp, "ysu_rad_tend_limiter_magnitude", ysu_rad_tend_limiter_magnitude, lev, max_level);
258  if (!(ysu_rad_tend_limiter_magnitude > 0.0)) {
259  if (amrex::ParallelDescriptor::IOProcessor()) {
260  amrex::Print() << "WARNING: erf.ysu_rad_tend_limiter_magnitude = "
262  << " is not positive; using the default of 1.0 K/s\n";
263  }
265  }
266  // Vogelezang & Holtslag (1996) shear correction
268  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
270  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
271  // PBLH spatial smoothing
273  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
275  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
277  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
278  // Validate pblh_smoothing_weight is in [0,1]
279  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
280  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
281  }
282  // QNSE stable stability functions (Sukoriansky et al. 2005)
284  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
286  pp, "qnse_am", qnse_am, lev, max_level);
288  pp, "qnse_bm", qnse_bm, lev, max_level);
290  pp, "qnse_ah", qnse_ah, lev, max_level);
292  pp, "qnse_bh", qnse_bh, lev, max_level);
293  } else if (pbl_type == PBLType::MRF) {
295  pp, "pbl_mrf_coriolis_freq", pbl_mrf_coriolis_freq, lev, max_level);
297  pp, "pbl_mrf_Ribcr", pbl_mrf_Ribcr, lev, max_level);
299  pp, "pbl_mrf_const_b", pbl_mrf_const_b, lev, max_level);
300  query_one_or_per_level(pp, "pbl_mrf_sf", pbl_mrf_sf, lev, max_level);
302  pp, "enable_mrf_countergradient", enable_mrf_countergradient, lev, max_level);
304  pp, "enable_mrf_cloud_adjustment", enable_mrf_cloud_adjustment, lev, max_level);
306  pp, "pbl_mrf_highres_bounds", pbl_mrf_highres_bounds, lev, max_level);
308  pp, "enable_mrf_unbounded_vpert", enable_mrf_unbounded_vpert, lev, max_level);
310  pp, "pbl_mrf_use_zero_ri_extent", pbl_mrf_use_zero_ri_extent, lev, max_level);
311  // QNSE stable stability functions (Sukoriansky et al. 2005)
313  pp, "enable_qnse_stable_functions", enable_qnse_stable_functions, lev, max_level);
315  pp, "qnse_am", qnse_am, lev, max_level);
317  pp, "qnse_bm", qnse_bm, lev, max_level);
319  pp, "qnse_ah", qnse_ah, lev, max_level);
321  pp, "qnse_bh", qnse_bh, lev, max_level);
322  // Scale-aware PBL-LES blending parameters.
324  pp, "pbl_blend_length", pbl_blend_length, lev, max_level);
326  pp, "pbl_blend_cs", pbl_blend_cs, lev, max_level);
328  pp, "pbl_blend_c_max", pbl_blend_c_max, lev, max_level);
330  pp, "pbl_blend_use_smag", pbl_blend_use_smag, lev, max_level);
331  // Vogelezang & Holtslag (1996) shear correction
333  pp, "enable_vh96_shear_correction", enable_vh96_shear_correction, lev, max_level);
335  pp, "vh96_shear_const_b", vh96_shear_const_b, lev, max_level);
336  // PBLH spatial smoothing
338  pp, "enable_pblh_smoothing", enable_pblh_smoothing, lev, max_level);
340  pp, "pblh_smoothing_passes", pblh_smoothing_passes, lev, max_level);
342  pp, "pblh_smoothing_weight", pblh_smoothing_weight, lev, max_level);
343  // Validate pblh_smoothing_weight is in [0,1]
344  if (enable_pblh_smoothing && (pblh_smoothing_weight < 0 || pblh_smoothing_weight > 1)) {
345  amrex::Error("pblh_smoothing_weight must be in [0, 1]");
346  }
347  } else if (pbl_type == PBLType::SHOC) {
348 #ifndef ERF_USE_SHOC
349  amrex::Abort("You set use_shoc to true but didn't build with SHOC; you must rebuild the executable");
350  }
351 #endif
352  if (uses_eamxx_shoc()) {
353 #ifndef ERF_USE_EAMXX_SHOC
354  amrex::Abort("PBLType::EAMXX_SHOC requested, but ERF was not built with ERF_ENABLE_EAMXX_SHOC=ON");
355 #endif
356  }
357 
359  std::string zlo_bc = "none";
360  amrex::ParmParse pp_bc("zlo");
361  pp_bc.get("type",zlo_bc);
362  if (amrex::toLower(zlo_bc) != "surface_layer") {
363  amrex::Abort("You must use the surface_layer BC at zlo with the selected PBL.");
364  }
365  }
366  }
367 
368  // Flags for QKE/TKE equation
369  if (pbl_type == PBLType::MYJ || pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
370  // Add sources/sinks to QKE/TKE? (MYJ does this inline)
371  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
372  use_pbl_tke = true;
373  }
374  // Advect QKE/TKE?
375  query_one_or_per_level(pp, "advect_tke" , advect_tke , lev, max_level);
376  // Apply numerical diffusion to QKE/TKE?
377  query_one_or_per_level(pp, "diffuse_tke_3D", diffuse_tke_3D, lev, max_level);
378  }
379 
380  // There is a default value of 1e-6 but the user can override the value here,
381  // and in addition can add perturbational values. and in addition can add perturbational values.
382  pp.queryAdd("tke_min",tke_min);
383 
384  // LES constants...
385  query_one_or_per_level(pp, "Cs", Cs, lev, max_level);
386 
387  query_one_or_per_level(pp, "Pr_t", Pr_t, lev, max_level);
388  query_one_or_per_level(pp, "Sc_t", Sc_t, lev, max_level);
389 
390  // Compute relevant forms of diffusion parameters
391  Pr_t_inv = one / Pr_t;
392  Sc_t_inv = one / Sc_t;
393 
394  if (les_type == LESType::Deardorff) {
395  query_one_or_per_level(pp, "Ck", Ck, lev, max_level);
396  query_one_or_per_level(pp, "Ce", Ce, lev, max_level);
397  query_one_or_per_level(pp, "Ce_wall", Ce_wall, lev, max_level);
398  }
399 
400  // To quantify atmospheric stability for subgrid modeling
401  query_one_or_per_level(pp, "thermal_stratification", strat_type, lev, max_level);
402  if (strat_type == StratType::theta) {
403  amrex::Print() << "Thermal stratification based on gradient of potential temperature" << std::endl;
404  } else if (strat_type == StratType::thetav) {
405  amrex::Print() << "Thermal stratification based on gradient of virtual potential temperature" << std::endl;
406  } else if (strat_type == StratType::thetal) {
407  amrex::Print() << "Thermal stratification based on gradient of linearized liquid-water potential temperature" << std::endl;
408  }
409 
410  // k-eqn constants
411  query_one_or_per_level(pp, "Cmu0", Cmu0, lev, max_level);
412  query_one_or_per_level(pp, "Cb", Cb, lev, max_level);
413  query_one_or_per_level(pp, "Rt_crit", Rt_crit, lev, max_level);
414  query_one_or_per_level(pp, "Rt_min", Rt_min, lev, max_level);
415  query_one_or_per_level(pp, "max_geom_lscale", l_g_max, lev, max_level);
416  query_one_or_per_level(pp, "dirichlet_k", dirichlet_k, lev, max_level);
417  query_one_or_per_level(pp, "tke_floor", tke_floor, lev, max_level);
418  query_one_or_per_level(pp, "implicit_tke_dissipation", implicit_tke_dissipation, lev, max_level);
419  query_one_or_per_level(pp, "rans_consistent_diffusivities", rans_consistent_diffusivities, lev, max_level);
420  query_one_or_per_level(pp, "rans_lscale_from_pblh", rans_lscale_from_pblh, lev, max_level);
421  query_one_or_per_level(pp, "rans_lscale_min", rans_lscale_min, lev, max_level);
422  if (rans_lscale_from_pblh && !(rans_lscale_min > 0)) {
423  amrex::Error("erf.rans_lscale_min must be > 0 with erf.rans_lscale_from_pblh");
424  }
425 
426  if (rans_type == RANSType::kEqn) {
427  // The stability functions (AL01 Eqs. 31, 32) have poles near Rt = -3.6;
428  // the Burchard & Petersen smoothing maps Rt < Rt_crit onto
429  // (Rt_min, Rt_crit) and needs Rt_min < Rt_crit <= 0.
430  if (!(Cmu0 > 0)) { amrex::Error("erf.Cmu0 must be > 0 for the k-eqn RANS"); }
431  if (!(Cb > 0)) { amrex::Error("erf.Cb must be > 0 for the k-eqn RANS"); }
432  if (!(l_g_max > 0)) { amrex::Error("erf.max_geom_lscale must be > 0 for the k-eqn RANS"); }
433  if (!(Rt_crit <= 0)) { amrex::Error("erf.Rt_crit must be <= 0 for the k-eqn RANS"); }
434  if (!(Rt_min < Rt_crit)) { amrex::Error("erf.Rt_min must be < erf.Rt_crit for the k-eqn RANS"); }
435  if (!(Rt_min > amrex::Real(-3.6))) {
436  amrex::Error("erf.Rt_min must be > -3.6 for the k-eqn RANS (stability functions have poles near -3.61)");
437  }
438  }
439  if (tke_floor < 0) { amrex::Error("erf.tke_floor must be >= 0"); }
440 
441  // Common inputs (LES or RANS)
442  if (!query_one_or_per_level(pp, "sigma_k", sigma_k, lev, max_level) && rans_type == RANSType::kEqn) {
443  amrex::Print() << "Overriding default sigma_k for k-eqn RANS" << std::endl;
444  sigma_k = one;
445  };
446  query_one_or_per_level(pp, "theta_ref", theta_ref, lev, max_level);
447 
448  query_one_or_per_level(pp, "mix_isotropic", mix_isotropic, lev, max_level);
449  query_one_or_per_level(pp, "use_Ri_correction", use_Ri_correction, lev, max_level);
450  query_one_or_per_level(pp, "Ri_crit", Ri_crit, lev, max_level);
451 
452  // Set common flags
453  use_kturb =
454  ((les_type != LESType::None) || (rans_type != RANSType::None) ||
455  (pbl_type != PBLType::None));
456  use_keqn =
457  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn));
458  use_tke =
459  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn) ||
460  (pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
461  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family());
462 
463  if (use_tke) {
464  query_one_or_per_level(pp, "init_tke_from_ustar", init_tke_from_ustar, lev, max_level);
465  }
466 
467  // Validate inputs
468  if (les_type == LESType::Smagorinsky) {
469  if (Cs == 0) {
470  amrex::Error("Need to specify Cs for Smagorsinky LES");
471  }
472  if (smag2d && mix_isotropic) {
473  amrex::Print() << "Turning off mix_isotropic for 2-D Smagorinsky" << std::endl;
474  mix_isotropic = false;
475  }
476  }
477  }
ParmParse pp("prob")
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:30
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_SLM.H:19
amrex::Real SMmax
Definition: ERF_MYNNStruct.H:61
amrex::Real SHmax
Definition: ERF_MYNNStruct.H:63
amrex::Real SQfac
Definition: ERF_MYNNStruct.H:57
amrex::Real SHmin
Definition: ERF_MYNNStruct.H:62
amrex::Real SMmin
Definition: ERF_MYNNStruct.H:60
bool diffuse_moistvars
Definition: ERF_MYNNStruct.H:70
amrex::Real SQmax
Definition: ERF_MYNNStruct.H:65
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:88
bool advect_tke
Whether TKE/QKE is advected.
Definition: ERF_TurbStruct.H:925
StratType strat_type
Thermodynamic variable used for stability stratification.
Definition: ERF_TurbStruct.H:745
MYNNLevel2 pbl_mynn_level2
MYNN level-2 closure coefficients for limiting.
Definition: ERF_TurbStruct.H:832
bool diffuse_tke_3D
Whether three-dimensional numerical diffusion is applied to TKE/QKE.
Definition: ERF_TurbStruct.H:927
bool use_tke
Whether any TKE or QKE closure is active.
Definition: ERF_TurbStruct.H:841
amrex::Real Sc_t_inv
Inverse turbulent Schmidt number.
Definition: ERF_TurbStruct.H:720
bool use_keqn
Whether a microscale TKE closure is active.
Definition: ERF_TurbStruct.H:836
bool uses_eamxx_shoc() const noexcept
Query whether this level uses the EAMxx SHOC PBL scheme.
Definition: ERF_TurbStruct.H:785
bool uses_shoc_family() const noexcept
Query whether this level uses any SHOC-family PBL scheme.
Definition: ERF_TurbStruct.H:803
bool init_tke_from_ustar
Whether initial TKE/QKE profiles are based on surface friction velocity.
Definition: ERF_TurbStruct.H:846
amrex::Real pbl_ib_z0
Definition: ERF_TurbStruct.H:907
bool pbl_ib_aware
Definition: ERF_TurbStruct.H:906
amrex::Real tke_min
Minimum TKE/QKE value.
Definition: ERF_TurbStruct.H:849
bool use_kturb
Whether any turbulence model is active.
Definition: ERF_TurbStruct.H:835
amrex::Real Pr_t_inv
Inverse turbulent Prandtl number.
Definition: ERF_TurbStruct.H:716
bool use_pbl_tke
Whether a mesoscale PBL TKE closure is active.
Definition: ERF_TurbStruct.H:839
Here is the call 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.
813  {
814  return (pbl_type == PBLType::MYNN25) ||
815  (pbl_type == PBLType::MYNNEDMF) ||
816  (pbl_type == PBLType::YSU) ||
817  (pbl_type == PBLType::YSUNew) ||
818  (pbl_type == PBLType::MRF) ||
820  }

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.
827  {
828  return uses_shoc_family();
829  }
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.
786  {
787  return pbl_type == PBLType::EAMXX_SHOC;
788  }

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.
795  {
796  return pbl_type == PBLType::NATIVE_SHOC;
797  }

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

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

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

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:
=
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:29

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

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

◆ tke_floor

◆ 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 erf_slow_rhs_post(), erf_slow_rhs_pre(), 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 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: