ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_TurbStruct.H
Go to the documentation of this file.
1 #ifndef ERF_TURB_STRUCT_H_
2 #define ERF_TURB_STRUCT_H_
3 
4 #include <AMReX_ParallelDescriptor.H>
5 #include <ERF_MYNNStruct.H>
6 
7 /**
8  * @brief Large-eddy simulation closure type.
9  */
10 AMREX_ENUM(LESType, None, Smagorinsky, Smagorinsky2D, Deardorff);
11 
12 /**
13  * @brief Reynolds-averaged turbulence closure type.
14  */
15 AMREX_ENUM(RANSType, None, kEqn);
16 
17 /**
18  * @brief Planetary boundary-layer closure type.
19  */
20 AMREX_ENUM(PBLType, None, MYJ, MYNN25, MYNNEDMF, YSU, YSUNew, MRF, SHOC, EAMXX_SHOC, NATIVE_SHOC);
21 
22 /**
23  * @brief Thermodynamic variable used for stability stratification.
24  */
25 AMREX_ENUM(StratType, theta, thetav, thetal);
26 
27 /**
28  * @brief Query a scalar or per-level input value.
29  * @tparam T Value type accepted by ParmParse::query.
30  * @param pp ParmParse object to query.
31  * @param query_string Input key to query.
32  * @param query_var Destination value for the requested level.
33  * @param lev AMR level index.
34  * @param maxlev Maximum AMR level configured for the run.
35  * @return ParmParse query result, or zero if the key is absent.
36  */
37 template <typename T>
38 int
40  const amrex::ParmParse& pp,
41  const char* query_string,
42  T& query_var,
43  const int lev,
44  const int maxlev)
45 {
46  int count = pp.countval(query_string);
47  if (count == 0) {
48  return 0; // nothing to do
49  } else if (count == 1) {
50  // In this case, we assume the same value is used at every level
51  return pp.query(query_string, query_var);
52  } else if (count >= maxlev + 1) {
53  // In this case, there may be more values than levels so we
54  // will just read the number of values we need and ignore the
55  // extra levels
56  return pp.query(query_string, query_var, lev);
57  } else {
58  // In this case, there is more than one value AND there
59  // are more levels than values; as an example, if max_level = 2
60  // but count = 2 so we have three levels but only two values --
61  // it is not clear how to interpret this so we abort
62  amrex::Error(
63  "For parmparse variable " + pp.prefixedName(query_string) +
64  ": if specified, specify once total or at least once for each level");
65  return 0; // avoid compiler warning
66  }
67 }
68 
69 /**
70  * @brief Query a scalar or per-level enum input value using case-insensitive matching.
71  * @tparam T Enum type accepted by ParmParse::query_enum_case_insensitive.
72  * @param pp ParmParse object to query.
73  * @param query_string Input key to query.
74  * @param query_var Destination enum value for the requested level.
75  * @param lev AMR level index.
76  * @param maxlev Maximum AMR level configured for the run.
77  * @return ParmParse query result, or zero if the key is absent.
78  */
79 template <typename T>
80 int
82  const amrex::ParmParse& pp,
83  const char* query_string,
84  T& query_var,
85  const int lev,
86  const int maxlev)
87 {
88  int count = pp.countval(query_string);
89  if (count == 0) {
90  return 0; // nothing to do
91  } else if (count == 1) {
92  // In this case, we assume the same value is used at every level
93  return pp.query_enum_case_insensitive(query_string, query_var);
94  } else if (count >= maxlev + 1) {
95  // In this case, there may be more values than levels so we
96  // will just read the number of values we need and ignore the
97  // extra levels
98  return pp.query_enum_case_insensitive(query_string, query_var, lev);
99  } else {
100  // In this case, there is more than one value AND there
101  // are more levels than values; as an example, if max_level = 2
102  // but count = 2 so we have three levels but only two values --
103  // it is not clear how to interpret this so we abort
104  amrex::Error(
105  "For parmparse variable " + pp.prefixedName(query_string) +
106  ": if specified, specify once total or at least once for each level");
107  return 0; // avoid compiler warning
108  }
109 }
110 
111 /**
112  * Container holding quantities related to turbulence parametrizations
113  */
115 {
116 public:
117  /**
118  * @brief Read turbulence options for one AMR level from the input parameter database.
119  * @param lev AMR level index.
120  * @param max_level Maximum AMR level configured for the run.
121  * @param pp_prefix ParmParse prefix for the ERF input namespace.
122  */
123  void init_params (int lev, int max_level, std::string pp_prefix)
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  }
530 
531  /**
532  * @brief Validate turbulence options against physical boundary conditions.
533  * @param phys_bc_type Physical boundary-condition types.
534  */
535  void check_params (amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& phys_bc_type)
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  }
550 
551  /**
552  * @brief Print turbulence settings for one AMR level.
553  * @param lev AMR level index.
554  */
555  void display (int lev)
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  }
775 
776  // LES model
778 
779  // Turbulent Prandtl number
782 
783  // Turbulent Schmidt number
786 
787  // Smagorinsky
789  bool smag2d = false;
790  // WRF smag2d_km limits (opt-in): slope limiter K_h /= alpha or alpha^2 on terrain-fitted
791  // meshes, and the cap K_h <= smag2d_kh_cap * Delta_h (m/s; 0 = no cap)
792  bool smag2d_slope_limiter = false;
794  // whether either limit was given as on for this level, before a single value is
795  // dropped at a level without Smagorinsky2D
797 
798  // Deardorff
800  amrex::Real Ce_wall = zero; // if > 0, then set Ce to this at k=0
802 
803  // k-eqn RANS coefficients (Axell & Liungman 2001)
808  amrex::Real l_g_max = amrex::Real(30.0); // ~ kappa * (amrex::Real(0.1) * zi)
809 
810  // Deardorff or k-eqn RANS
811  // - diffusivity of tke is 1/sigma_k times the eddy viscosity
813  // - reference potential temperature used to quantify the stratification in
814  // a stable region
816  // - how to quantify stratification effects
818  // Stratification variable used by the PBL schemes; see init_params.
819  StratType pbl_strat_type = StratType::thetav;
820 
821  // Anisotropic length scales
822  bool mix_isotropic = true;
823 
824  bool use_Ri_correction = true;
826 
827  // RANS type
829 
830  bool dirichlet_k = false;
831 
832  // Runtime floor on the turbulent kinetic energy [m2/s2] in the k-equation
833  // update and the RANS closure; 0 means machine epsilon on rho*k (the
834  // historical floor). Distinct from tke_min, the initial TKE value.
836 
837  // Treat the TKE dissipation implicitly: eps = (Cmu0^3 sqrt(k_old)/L) * k_new
838  // folded into the update (Deardorff and k-eqn RANS)
840 
841  // k-eqn RANS: horizontal heat, scalar and moisture diffusivities follow the
842  // AL01 scalar stability function (cmu') like the vertical heat diffusivity,
843  // instead of Pr_t and Sc_t times the eddy viscosity
845 
846  // k-eqn RANS: cap the geometric length at kappa * 0.1 * PBL height (from
847  // erf.most.pblh_calc), clamped to [rans_lscale_min, max_geom_lscale],
848  // instead of the fixed max_geom_lscale
849  bool rans_lscale_from_pblh = false;
851 
852  // PBL model
854 
855  /**
856  * @brief Query whether this level uses the EAMxx SHOC PBL scheme.
857  * @return True if PBLType::EAMXX_SHOC is selected.
858  */
859  bool uses_eamxx_shoc () const noexcept
860  {
861  return pbl_type == PBLType::EAMXX_SHOC;
862  }
863 
864  /**
865  * @brief Query whether this level uses the native SHOC PBL scheme.
866  * @return True if PBLType::NATIVE_SHOC is selected.
867  */
868  bool uses_native_shoc () const noexcept
869  {
870  return pbl_type == PBLType::NATIVE_SHOC;
871  }
872 
873  /**
874  * @brief Query whether this level uses any SHOC-family PBL scheme.
875  * @return True if native or EAMxx SHOC is selected.
876  */
877  bool uses_shoc_family () const noexcept
878  {
879  return uses_eamxx_shoc() || uses_native_shoc();
880  }
881 
882  /**
883  * @brief Query whether the horizontal and vertical eddy viscosities can differ on this level.
884  * @return True for Smagorinsky-2D, anisotropic Smagorinsky or Deardorff, and any PBL scheme
885  * (which sets the vertical diffusivities on its own).
886  */
887  bool kh_kv_can_differ () const noexcept
888  {
889  return ( (les_type == LESType::Smagorinsky && (smag2d || !mix_isotropic)) ||
890  (les_type == LESType::Deardorff && !mix_isotropic) ||
891  (pbl_type != PBLType::None) );
892  }
893 
894  /**
895  * @brief Query whether the selected PBL scheme requires surface-layer boundary conditions.
896  * @return True if the PBL scheme requires a lower surface-layer boundary.
897  */
898  bool pbl_requires_surface_layer () const noexcept
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  }
907 
908  /**
909  * @brief Query whether the selected PBL scheme suppresses microphysics condensation.
910  * @return True when the PBL scheme owns condensation handling.
911  */
913  {
914  return uses_shoc_family();
915  }
916 
918  MYNNLevel2 pbl_mynn_level2; // limiting in the decaying turbulence regime
919 
920  // Common Flags
921  bool use_kturb = false; // Any turbulence modeling?
922  bool use_keqn =
923  false; // Any microscale turbulence modeling (LES, RANS) with TKE closure?
924  // Then need to populate SmnSmn_lev for production term.
925  bool use_pbl_tke =
926  false; // Any mesoscale turbulence modeling (PBL) with TKE closure?
927  bool use_tke = false; // Any TKE closure (meso or microscale)?
928 
929  // Initialize TKE/QKE with linear profiles whose surface values are a
930  // function of the friction velocity calculated by the surface layer scheme
931  // (e.g., as done in MYNN-EDMF)
932  bool init_tke_from_ustar = false;
933 
934  // This is the value of tke_min in WRF 4.5
936 
937  // Model coefficients - YSU
938  // TODO: Add parmparse for all of these above
940  amrex::Real(1.0e-4); // 1e-4 is hardcoded in WRF, we let the user specify or take the
941  // value from ERF coriolis forcing
943  false; // ignore input pbl_ysu_coriolis_freq, take value from ERF coriolis
944  // forcing instead
946  false; // Force YSU to act as if it is over water regardless of other inputs
947  // (for testing)
949  fourth; // Critical Bulk Richardson number of Land for stable conditions
951  zero; // Critical Bulk Richardson number for unstable conditions
953  true; // if true, use liquid-water virtual potential temperature in YSU stability
955  true; // if true, apply YSU-style HGAMT/HGAMQ/HGAMU/HGAMV countergradient correction
957  true; // if true, apply terrain-following floor on PBL height
959  false; // if true, apply saturation limiter to moisture countergradient
961  true; // if true, enable top-down mixing for cloud-topped boundary layers
963  true; // if true, enable entrainment layer parameterization
965  true; // if true, enable cloud-based PBL height detection
967  amrex::Real(1.0e-4); // Cloud liquid water threshold for YSUNew (kg/kg)
968  bool ysu_moistvars = false; // if true, adds turbulence to moisture
969  bool pbl_ysunew_highres_bounds = false; // if true, apply high-resolution grid-dependent diffusivity bounds
970  // Radiative tendency limiter (YSUNew-only)
971  bool enable_ysu_rad_tend_limiter = false; // if true, guard and bound the qheating_rates top-down forcing
972  amrex::Real ysu_rad_tend_limiter_magnitude = amrex::Real(1.0); // Bound on the limited radiative tendency (K/s)
973  // Vogelezang & Holtslag (1996) shear correction and PBLH smoothing for YSU/YSUNew
974  bool enable_vh96_shear_correction = false; // if true, use VH96 shear correction term instead of ad-hoc floor
975  amrex::Real vh96_shear_const_b = amrex::Real(100.0); // VH96 shear correction constant b
976  bool enable_pblh_smoothing = false; // if true, apply spatial smoothing to diagnosed PBLH
977  int pblh_smoothing_passes = 1; // number of smoothing iterations
978  amrex::Real pblh_smoothing_weight = amrex::Real(0.5); // center-cell weight in smoothing stencil
979  // Model coefficients - MRF
981  amrex::Real pbl_mrf_Ribcr = amrex::Real(0.5); // Critical Bulk Richardson number for MRF PBL model
982  amrex::Real pbl_mrf_const_b = amrex::Real(7.8); // Constant b in MRF PBL model, used to compute the PBL height
983  amrex::Real pbl_mrf_sf = amrex::Real(0.1); // MRF surface flux, used to compute the PBL height
984  // Scale-aware PBL-LES blending parameters.
985  // Boutle et al. (2014): https://doi.org/10.1175/MWR-D-13-00229.1
986  // Set pbl_blend_length = 0 to disable (default). Recovers original behaviour.
987  amrex::Real pbl_blend_length = amrex::Real(0.0); ///< Boutle blending length L [m]. 0 = off.
988  amrex::Real pbl_blend_cs = amrex::Real(0.17); ///< Smagorinsky coeff for K_h ceiling.
989  amrex::Real pbl_blend_c_max = amrex::Real(0.1); ///< Power-law ceiling coeff [m^(2/3)/s].
990  bool pbl_blend_use_smag = true; ///< Use Smagorinsky ceiling (else power-law).
991  bool enable_mrf_countergradient = false; // if true, apply WRF-style HGAMT/HGAMQ correction to PBL height
992  bool pbl_ib_aware = false; // MRF / YSUNew: measure heights from the top of immersed solid columns
993  amrex::Real pbl_ib_z0 = amrex::Real(0.01); // roughness [m] of the neutral log law at the top of an immersed column
994  bool enable_mrf_cloud_adjustment = false; // if true, apply cloud-aware stability function adjustments in MRF scheme
995  bool pbl_mrf_highres_bounds = false; // if true, apply high-resolution grid-dependent diffusivity bounds instead of global forecast bounds
996  bool enable_mrf_unbounded_vpert = false; // if true, does not limit VPERT to GAMCRT
997  bool pbl_mrf_use_zero_ri_extent = false; // if true, use Ri=0 (pbli_zero_arr) for K-profile extent; default false uses Ri=0.5 corrector (pbli_arr) for WRF compatibility
998  // QNSE (Quasi-Normal Scale Elimination) spectral stable stability functions
999  // Sukoriansky, S., B. Galperin, and V. Perov, 2005: Application of a New Spectral
1000  // Theory of Stably Stratified Turbulence to the Atmospheric Boundary Layer over
1001  // Sea Ice. Boundary-Layer Meteorology, 117, 231–257.
1002  // https://doi.org/10.1007/s10546-004-6848-4
1003  bool enable_qnse_stable_functions = false; // if true, use QNSE spectral stability functions
1004  // instead of linear Businger-Dyer form for stable conditions
1005  amrex::Real qnse_am = amrex::Real(2.5); // QNSE momentum stability function coefficient (dimensionless)
1006  amrex::Real qnse_bm = amrex::Real(0.2); // QNSE momentum stability function coefficient (dimensionless)
1007  amrex::Real qnse_ah = amrex::Real(2.5); // QNSE heat stability function coefficient (dimensionless)
1008  amrex::Real qnse_bh = amrex::Real(0.2); // QNSE heat stability function coefficient (dimensionless)
1009  // MYNN2.5 PBL model
1010  // TKE/QKE stuff
1011  bool advect_tke = true; // if MYNN2.5 PBL is used default is turb transport in
1012  // Z-direction only
1013  bool diffuse_tke_3D = true; // if numerical diffusion is turned on
1014 };
1015 
1016 /**
1017  * @var TurbChoice::les_type
1018  * @brief Selected LES closure.
1019  * @var TurbChoice::Pr_t
1020  * @brief Turbulent Prandtl number.
1021  * @var TurbChoice::Pr_t_inv
1022  * @brief Inverse turbulent Prandtl number.
1023  * @var TurbChoice::Sc_t
1024  * @brief Turbulent Schmidt number.
1025  * @var TurbChoice::Sc_t_inv
1026  * @brief Inverse turbulent Schmidt number.
1027  * @var TurbChoice::Cs
1028  * @brief Smagorinsky model coefficient.
1029  * @var TurbChoice::smag2d
1030  * @brief Whether the 2-D Smagorinsky formulation is used.
1031  * @var TurbChoice::smag2d_slope_limiter
1032  * @brief Apply WRF's Smagorinsky-2D slope limiter (K_h / alpha or / alpha^2) on terrain-fitted meshes.
1033  * @var TurbChoice::smag2d_kh_cap
1034  * @brief Cap K_h <= smag2d_kh_cap * Delta_h for Smagorinsky-2D (m/s); 0 means no cap.
1035  * @var TurbChoice::smag2d_limits_requested
1036  * @brief Whether either Smagorinsky-2D limit was given as on for this level.
1037  * @var TurbChoice::Ce
1038  * @brief Deardorff dissipation coefficient.
1039  * @var TurbChoice::Ce_wall
1040  * @brief Wall value for the Deardorff dissipation coefficient.
1041  * @var TurbChoice::Ck
1042  * @brief Deardorff eddy-viscosity coefficient.
1043  * @var TurbChoice::Cmu0
1044  * @brief One-equation RANS Cmu0 coefficient.
1045  * @var TurbChoice::Cb
1046  * @brief One-equation RANS buoyancy coefficient.
1047  * @var TurbChoice::Rt_crit
1048  * @brief Critical turbulent Reynolds number.
1049  * @var TurbChoice::Rt_min
1050  * @brief Minimum turbulent Reynolds number.
1051  * @var TurbChoice::l_g_max
1052  * @brief Maximum geometric length scale.
1053  * @var TurbChoice::sigma_k
1054  * @brief TKE diffusivity coefficient denominator.
1055  * @var TurbChoice::theta_ref
1056  * @brief Reference potential temperature for stable stratification.
1057  * @var TurbChoice::strat_type
1058  * @brief Thermodynamic variable used for stability stratification.
1059  * @var TurbChoice::mix_isotropic
1060  * @brief Whether subgrid mixing uses isotropic length scales.
1061  * @var TurbChoice::use_Ri_correction
1062  * @brief Whether Richardson-number correction is applied.
1063  * @var TurbChoice::Ri_crit
1064  * @brief Critical Richardson number for stability correction.
1065  * @var TurbChoice::rans_type
1066  * @brief Selected RANS closure.
1067  * @var TurbChoice::dirichlet_k
1068  * @brief Whether TKE uses Dirichlet boundary treatment.
1069  * @var TurbChoice::pbl_type
1070  * @brief Selected PBL closure.
1071  * @var TurbChoice::pbl_mynn
1072  * @brief MYNN level-2.5 closure coefficients.
1073  * @var TurbChoice::pbl_mynn_level2
1074  * @brief MYNN level-2 closure coefficients for limiting.
1075  * @var TurbChoice::use_kturb
1076  * @brief Whether any turbulence model is active.
1077  * @var TurbChoice::use_keqn
1078  * @brief Whether a microscale TKE closure is active.
1079  * @var TurbChoice::use_pbl_tke
1080  * @brief Whether a mesoscale PBL TKE closure is active.
1081  * @var TurbChoice::use_tke
1082  * @brief Whether any TKE or QKE closure is active.
1083  * @var TurbChoice::init_tke_from_ustar
1084  * @brief Whether initial TKE/QKE profiles are based on surface friction velocity.
1085  * @var TurbChoice::tke_min
1086  * @brief Minimum TKE/QKE value.
1087  * @var TurbChoice::pbl_ysu_coriolis_freq
1088  * @brief Coriolis frequency used by YSU-family PBL schemes.
1089  * @var TurbChoice::pbl_ysu_use_consistent_coriolis
1090  * @brief Whether YSU uses the ERF Coriolis frequency.
1091  * @var TurbChoice::pbl_ysu_force_over_water
1092  * @brief Whether YSU is forced to use over-water behavior.
1093  * @var TurbChoice::pbl_ysu_land_Ribcr
1094  * @brief Critical bulk Richardson number over land for stable YSU conditions.
1095  * @var TurbChoice::pbl_ysu_unst_Ribcr
1096  * @brief Critical bulk Richardson number for unstable YSU conditions.
1097  * @var TurbChoice::enable_ysu_liquid_theta
1098  * @brief Whether YSU uses liquid-water virtual potential temperature for stability.
1099  * @var TurbChoice::enable_ysu_countergradient
1100  * @brief Whether YSU countergradient corrections are enabled.
1101  * @var TurbChoice::enable_ysu_terrain_pblh_floor
1102  * @brief Whether YSU applies a terrain-following PBL-height floor.
1103  * @var TurbChoice::enable_ysu_sat_limiter
1104  * @brief Whether YSU applies a saturation limiter to moisture countergradient terms.
1105  * @var TurbChoice::enable_ysu_topdown
1106  * @brief Whether YSU top-down mixing is enabled.
1107  * @var TurbChoice::enable_ysu_entrainment
1108  * @brief Whether YSU entrainment-layer parameterization is enabled.
1109  * @var TurbChoice::enable_ysu_cloud_pblh
1110  * @brief Whether YSU cloud-based PBL-height detection is enabled.
1111  * @var TurbChoice::ysu_qcloud_threshold
1112  * @brief Cloud liquid water threshold for YSUNew [kg/kg].
1113  * @var TurbChoice::ysu_moistvars
1114  * @brief Whether YSU applies turbulence to moisture variables.
1115  * @var TurbChoice::pbl_ysunew_highres_bounds
1116  * @brief Whether YSUNew applies high-resolution grid-dependent diffusivity bounds.
1117  * @var TurbChoice::enable_vh96_shear_correction
1118  * @brief Whether Vogelezang & Holtslag (1996) shear-correction term is enabled.
1119  * @var TurbChoice::vh96_shear_const_b
1120  * @brief Vogelezang & Holtslag (1996) shear-correction constant b.
1121  * @var TurbChoice::enable_pblh_smoothing
1122  * @brief Whether spatial smoothing of diagnosed PBLH is enabled.
1123  * @var TurbChoice::pblh_smoothing_passes
1124  * @brief Number of PBLH smoothing iterations to apply.
1125  * @var TurbChoice::pblh_smoothing_weight
1126  * @brief Center-cell weight in PBLH smoothing stencil (must be in [0,1]).
1127  * @var TurbChoice::pbl_mrf_coriolis_freq
1128  * @brief Coriolis frequency used by the MRF PBL scheme.
1129  * @var TurbChoice::pbl_mrf_Ribcr
1130  * @brief Critical bulk Richardson number for the MRF PBL scheme.
1131  * @var TurbChoice::pbl_mrf_const_b
1132  * @brief MRF constant used to compute PBL height.
1133  * @var TurbChoice::pbl_mrf_sf
1134  * @brief MRF surface flux value used to compute PBL height.
1135  * @var TurbChoice::enable_mrf_countergradient
1136  * @brief Whether MRF countergradient corrections are enabled.
1137  * @var TurbChoice::pbl_ib_aware
1138  * When true, the MRF and YSUNew schemes treat the first fluid cell above the
1139  * immersed solid of a column (buildings or terrain by immersed forcing) as
1140  * that column's surface: the bulk Richardson heights, the boundary-layer
1141  * depth and the K profile are measured from it, the diffusivities vanish
1142  * inside the solid, and the surface scales of such a column are a neutral
1143  * log law at its top (u* from the wind there and pbl_ib_z0, theta* = 0). The
1144  * boundary-layer height both schemes store (pblh, Lturb) stays the absolute
1145  * height above the domain bottom; with enable_pblh_smoothing the stencil runs
1146  * on that absolute height, and the smoothed value is kept at or above each
1147  * column's own floor (half a cell above its surface, at least 10 m). Off by
1148  * default; without immersed cells the results are identical. Not supported
1149  * with terrain-fitted coordinates.
1150  * @var TurbChoice::pbl_ib_z0
1151  * Roughness length [m] of that log law.
1152  * @var TurbChoice::enable_mrf_cloud_adjustment
1153  * @brief Whether MRF cloud-aware stability adjustments are enabled.
1154  * @var TurbChoice::pbl_mrf_highres_bounds
1155  * @brief Whether MRF applies high-resolution grid-dependent diffusivity bounds.
1156  * @var TurbChoice::enable_mrf_unbounded_vpert
1157  * @brief Whether MRF leaves VPERT unlimited by GAMCRT.
1158  * @var TurbChoice::pbl_mrf_use_zero_ri_extent
1159  * @brief Whether MRF uses the Ri=0 K-profile extent.
1160  * @var TurbChoice::advect_tke
1161  * @brief Whether TKE/QKE is advected.
1162  * @var TurbChoice::diffuse_tke_3D
1163  * @brief Whether three-dimensional numerical diffusion is applied to TKE/QKE.
1164  */
1165 #endif
@ no_slip_wall
@ surface_layer
ParmParse pp("prob")
constexpr amrex::Real three
Definition: ERF_NumericalConstants.H:39
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:42
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_ENUM(LESType, None, Smagorinsky, Smagorinsky2D, Deardorff)
Large-eddy simulation closure type.
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
@ None
Definition: ERF_LSM_Types.H:6
@ theta
Definition: ERF_Kessler.H:26
@ T
Definition: ERF_IndexDefines.H:131
Coefficients and stability functions for the Level 2.5 MYNN closure.
Definition: ERF_MYNNStruct.H:18
amrex::Real SMmax
Definition: ERF_MYNNStruct.H:65
amrex::Real SHmax
Definition: ERF_MYNNStruct.H:67
amrex::Real Lt_alpha
Definition: ERF_MYNNStruct.H:77
amrex::Real SQfac
Definition: ERF_MYNNStruct.H:61
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 SHmin
Definition: ERF_MYNNStruct.H:66
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 SMmin
Definition: ERF_MYNNStruct.H:64
amrex::Real A1
Definition: ERF_MYNNStruct.H:50
amrex::Real SQmax
Definition: ERF_MYNNStruct.H:69
Coefficients and stability functions for the Level 2 MYNN closure.
Definition: ERF_MYNNStruct.H:95
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
Definition: ERF_TurbStruct.H:115
bool advect_tke
Whether TKE/QKE is advected.
Definition: ERF_TurbStruct.H:1011
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
StratType strat_type
Thermodynamic variable used for stability stratification.
Definition: ERF_TurbStruct.H:817
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
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
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 Ce_wall
Wall value for the Deardorff dissipation coefficient.
Definition: ERF_TurbStruct.H:800
amrex::Real qnse_ah
Definition: ERF_TurbStruct.H:1007
RANSType rans_type
Selected RANS closure.
Definition: ERF_TurbStruct.H:828
StratType pbl_strat_type
Definition: ERF_TurbStruct.H:819
void check_params(amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
Validate turbulence options against physical boundary conditions.
Definition: ERF_TurbStruct.H:535
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 Sc_t_inv
Inverse turbulent Schmidt number.
Definition: ERF_TurbStruct.H:785
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 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 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
bool uses_shoc_family() const noexcept
Query whether this level uses any SHOC-family PBL scheme.
Definition: ERF_TurbStruct.H:877
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
bool init_tke_from_ustar
Whether initial TKE/QKE profiles are based on surface friction velocity.
Definition: ERF_TurbStruct.H:932
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
bool uses_native_shoc() const noexcept
Query whether this level uses the native SHOC PBL scheme.
Definition: ERF_TurbStruct.H:868
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 kh_kv_can_differ() const noexcept
Query whether the horizontal and vertical eddy viscosities can differ on this level.
Definition: ERF_TurbStruct.H:887
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
LESType les_type
Selected LES closure.
Definition: ERF_TurbStruct.H:777
void init_params(int lev, int max_level, std::string pp_prefix)
Read turbulence options for one AMR level from the input parameter database.
Definition: ERF_TurbStruct.H:123
amrex::Real pbl_ib_z0
Definition: ERF_TurbStruct.H:993
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
bool pbl_ib_aware
Definition: ERF_TurbStruct.H:992
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
bool smag2d_limits_requested
Whether either Smagorinsky-2D limit was given as on for this level.
Definition: ERF_TurbStruct.H:796
bool pbl_suppresses_microphysics_condensation() const noexcept
Query whether the selected PBL scheme suppresses microphysics condensation.
Definition: ERF_TurbStruct.H:912
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 tke_min
Minimum TKE/QKE value.
Definition: ERF_TurbStruct.H:935
amrex::Real pbl_ysu_coriolis_freq
Coriolis frequency used by YSU-family PBL schemes.
Definition: ERF_TurbStruct.H:939
void display(int lev)
Print turbulence settings for one AMR level.
Definition: ERF_TurbStruct.H:555
bool use_kturb
Whether any turbulence model is active.
Definition: ERF_TurbStruct.H:921
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
amrex::Real Pr_t_inv
Inverse turbulent Prandtl number.
Definition: ERF_TurbStruct.H:781
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
bool pbl_requires_surface_layer() const noexcept
Query whether the selected PBL scheme requires surface-layer boundary conditions.
Definition: ERF_TurbStruct.H:898
bool use_pbl_tke
Whether a mesoscale PBL TKE closure is active.
Definition: ERF_TurbStruct.H:925