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 <ERF_MYNNStruct.H>
5 
6 AMREX_ENUM(LESType, None, Smagorinsky, Smagorinsky2D, Deardorff);
7 
8 AMREX_ENUM(RANSType, None, kEqn);
9 
10 AMREX_ENUM(PBLType, None, MYJ, MYNN25, MYNNEDMF, YSU, MRF, SHOC, EAMXX_SHOC, NATIVE_SHOC);
11 
12 AMREX_ENUM(StratType, theta, thetav, thetal);
13 
14 template <typename T>
15 int
17  const amrex::ParmParse& pp,
18  const char* query_string,
19  T& query_var,
20  const int lev,
21  const int maxlev)
22 {
23  int count = pp.countval(query_string);
24  if (count == 0) {
25  return 0; // nothing to do
26  } else if (count == 1) {
27  // In this case, we assume the same value is used at every level
28  return pp.query(query_string, query_var);
29  } else if (count >= maxlev + 1) {
30  // In this case, there may be more values than levels so we
31  // will just read the number of values we need and ignore the
32  // extra levels
33  return pp.query(query_string, query_var, lev);
34  } else {
35  // In this case, there is more than one value AND there
36  // are more levels than values; as an example, if max_level = 2
37  // but count = 2 so we have three levels but only two values --
38  // it is not clear how to interpret this so we abort
39  amrex::Error(
40  "For parmparse variable " + pp.prefixedName(query_string) +
41  ": if specified, specify once total or at least once for each level");
42  return 0; // avoid compiler warning
43  }
44 }
45 
46 template <typename T>
47 int
49  const amrex::ParmParse& pp,
50  const char* query_string,
51  T& query_var,
52  const int lev,
53  const int maxlev)
54 {
55  int count = pp.countval(query_string);
56  if (count == 0) {
57  return 0; // nothing to do
58  } else if (count == 1) {
59  // In this case, we assume the same value is used at every level
60  return pp.query_enum_case_insensitive(query_string, query_var);
61  } else if (count >= maxlev + 1) {
62  // In this case, there may be more values than levels so we
63  // will just read the number of values we need and ignore the
64  // extra levels
65  return pp.query_enum_case_insensitive(query_string, query_var, lev);
66  } else {
67  // In this case, there is more than one value AND there
68  // are more levels than values; as an example, if max_level = 2
69  // but count = 2 so we have three levels but only two values --
70  // it is not clear how to interpret this so we abort
71  amrex::Error(
72  "For parmparse variable " + pp.prefixedName(query_string) +
73  ": if specified, specify once total or at least once for each level");
74  return 0; // avoid compiler warning
75  }
76 }
77 
78 /**
79  * Container holding quantities related to turbulence parametrizations
80  */
81 struct TurbChoice
82 {
83 public:
84  void init_params (int lev, int max_level, std::string pp_prefix)
85  {
86  amrex::ParmParse pp(pp_prefix);
87 
88  // Which LES closure?
89  query_one_or_per_level(pp, "les_type", les_type, lev, max_level);
90 
91  // Handle 2-D Smag
92  if (les_type == LESType::Smagorinsky2D) {
93  les_type = LESType::Smagorinsky;
94  smag2d = true;
95  }
96 
97  // Which RANS closure?
98  query_one_or_per_level(pp, "rans_type", rans_type, lev, max_level);
99 
100  if ((rans_type != RANSType::None) && (les_type != LESType::None)) {
101  amrex::Error("Hybrid RANS-LES not implemented");
102  }
103 
104  // Which PBL Closure
105  query_one_or_per_level_enum_case_insensitive(pp, "pbl_type", pbl_type, lev, max_level);
106  if (pbl_type == PBLType::SHOC) {
107  static bool warned_legacy_shoc = false;
108  if (!warned_legacy_shoc) {
109  amrex::Warning("erf.pbl_type = SHOC is deprecated; use erf.pbl_type = EAMXX_SHOC");
110  warned_legacy_shoc = true;
111  }
112  pbl_type = PBLType::EAMXX_SHOC;
113  }
114 
115  // Do some more stuff for PBL Modeling
116  if (pbl_type != PBLType::None) {
117  // Check for compatibility between PBL, LES, Molec Transport
118  if (les_type != LESType::None) {
119  amrex::Print() << "Selected a PBL model and an LES model: "
120  << "Using PBL for vertical transport, LES for horizontal"
121  << std::endl;
122  }
123  if (les_type == LESType::Smagorinsky) {
124  if (!smag2d)
125  amrex::Error("If using Smagorinsky with a PBL model, the 2-D "
126  "formulation should be used");
127  } else if (les_type == LESType::Deardorff) {
128  amrex::Error(
129  "It is not recommended to use Deardorff LES and a PBL model");
130  }
131 
132  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
133  query_one_or_per_level(pp, "pbl_mynn_A1", pbl_mynn.A1, lev, max_level);
134  query_one_or_per_level(pp, "pbl_mynn_A2", pbl_mynn.A2, lev, max_level);
135  query_one_or_per_level(pp, "pbl_mynn_B1", pbl_mynn.B1, lev, max_level);
136  query_one_or_per_level(pp, "pbl_mynn_B2", pbl_mynn.B2, lev, max_level);
137  query_one_or_per_level(pp, "pbl_mynn_C1", pbl_mynn.C1, lev, max_level);
138  query_one_or_per_level(pp, "pbl_mynn_C2", pbl_mynn.C2, lev, max_level);
139  query_one_or_per_level(pp, "pbl_mynn_C3", pbl_mynn.C3, lev, max_level);
140  query_one_or_per_level(pp, "pbl_mynn_C4", pbl_mynn.C4, lev, max_level);
141  query_one_or_per_level(pp, "pbl_mynn_C5", pbl_mynn.C5, lev, max_level);
146  pp, "pbl_mynn_diffuse_moistvars", pbl_mynn.diffuse_moistvars, lev,
147  max_level);
149  pp, "pbl_mynn_SMmin", pbl_mynn.SMmin, lev, max_level);
151  pp, "pbl_mynn_SMmax", pbl_mynn.SMmax, lev, max_level);
153  pp, "pbl_mynn_SHmin", pbl_mynn.SHmin, lev, max_level);
155  pp, "pbl_mynn_SHmax", pbl_mynn.SHmax, lev, max_level);
157  pp, "pbl_mynn_SQfactor", pbl_mynn.SQfac, lev, max_level);
158  } else if (pbl_type == PBLType::YSU) {
160  pp, "pbl_ysu_coriolis_freq", pbl_ysu_coriolis_freq, lev, max_level);
162  pp, "pbl_ysu_use_consistent_coriolis",
163  pbl_ysu_use_consistent_coriolis, lev, max_level);
165  pp, "pbl_ysu_force_over_water", pbl_ysu_force_over_water, lev,
166  max_level);
168  pp, "pbl_ysu_land_Ribcr", pbl_ysu_land_Ribcr, lev, max_level);
170  pp, "pbl_ysu_unst_Ribcr", pbl_ysu_unst_Ribcr, lev, max_level);
171  } else if (pbl_type == PBLType::MRF) {
173  pp, "pbl_mrf_coriolis_freq", pbl_mrf_coriolis_freq, lev, max_level);
175  pp, "pbl_mrf_Ribcr", pbl_mrf_Ribcr, lev, max_level);
177  pp, "pbl_mrf_const_b", pbl_mrf_const_b, lev, max_level);
178  query_one_or_per_level(pp, "pbl_mrf_sf", pbl_mrf_sf, lev, max_level);
180  pp, "mrf_moistvars", mrf_moistvars, lev, max_level);
181  }
182 
183  if (uses_eamxx_shoc()) {
184 #ifndef ERF_USE_EAMXX_SHOC
185  amrex::Abort("PBLType::EAMXX_SHOC requested, but ERF was not built with ERF_ENABLE_EAMXX_SHOC=ON");
186 #endif
187  }
188 
189  if (uses_native_shoc()) {
190 #ifndef ERF_USE_NATIVE_SHOC
191  amrex::Abort("PBLType::NATIVE_SHOC requested, but ERF was not built with native SHOC enabled");
192 #endif
193  }
194 
196  std::string zlo_bc = "none";
197  amrex::ParmParse pp_bc("zlo");
198  pp_bc.get("type",zlo_bc);
199  if (amrex::toLower(zlo_bc) != "surface_layer") {
200  amrex::Abort("You must use the surface_layer BC at zlo with the selected PBL.");
201  }
202  }
203  }
204 
205  // Flags for QKE/TKE equation
206  if (pbl_type == PBLType::MYJ || pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
207  // Add sources/sinks to QKE/TKE? (MYJ does this inline)
208  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
209  use_pbl_tke = true;
210  }
211  // Advect QKE/TKE?
212  query_one_or_per_level(pp, "advect_tke" , advect_tke , lev, max_level);
213  // Apply numerical diffusion to QKE/TKE?
214  query_one_or_per_level(pp, "diffuse_tke_3D", diffuse_tke_3D, lev, max_level);
215  }
216 
217  // There is a default value of 1e-6 but the user can override the value here,
218  // and in addition can add perturbational values. and in addition can add perturbational values.
219  pp.query("tke_min",tke_min);
220 
221  // LES constants...
222  query_one_or_per_level(pp, "Cs", Cs, lev, max_level);
223 
224  query_one_or_per_level(pp, "Pr_t", Pr_t, lev, max_level);
225  query_one_or_per_level(pp, "Sc_t", Sc_t, lev, max_level);
226 
227  // Compute relevant forms of diffusion parameters
228  Pr_t_inv = one / Pr_t;
229  Sc_t_inv = one / Sc_t;
230 
231  if (les_type == LESType::Deardorff) {
232  query_one_or_per_level(pp, "Ck", Ck, lev, max_level);
233  query_one_or_per_level(pp, "Ce", Ce, lev, max_level);
234  query_one_or_per_level(pp, "Ce_wall", Ce_wall, lev, max_level);
235  }
236 
237  // To quantify atmospheric stability for subgrid modeling
238  query_one_or_per_level(pp, "thermal_stratification", strat_type, lev, max_level);
239  if (strat_type == StratType::theta) {
240  amrex::Print() << "Thermal stratification based on gradient of potential temperature" << std::endl;
241  } else if (strat_type == StratType::thetav) {
242  amrex::Print() << "Thermal stratification based on gradient of virtual potential temperature" << std::endl;
243  } else if (strat_type == StratType::thetal) {
244  amrex::Print() << "Thermal stratification based on gradient of linearized liquid-water potential temperature" << std::endl;
245  }
246 
247  // k-eqn constants
248  query_one_or_per_level(pp, "Cmu0", Cmu0, lev, max_level);
249  query_one_or_per_level(pp, "Cb", Cb, lev, max_level);
250  query_one_or_per_level(pp, "Rt_crit", Rt_crit, lev, max_level);
251  query_one_or_per_level(pp, "Rt_min", Rt_min, lev, max_level);
252  query_one_or_per_level(pp, "max_geom_lscale", l_g_max, lev, max_level);
253  query_one_or_per_level(pp, "dirichlet_k", dirichlet_k, lev, max_level);
254 
255  // Common inputs (LES or RANS)
256  if (!query_one_or_per_level(pp, "sigma_k", sigma_k, lev, max_level) && rans_type == RANSType::kEqn) {
257  amrex::Print() << "Overriding default sigma_k for k-eqn RANS" << std::endl;
258  sigma_k = one;
259  };
260  query_one_or_per_level(pp, "theta_ref", theta_ref, lev, max_level);
261 
262  query_one_or_per_level(pp, "mix_isotropic", mix_isotropic, lev, max_level);
263  query_one_or_per_level(pp, "use_Ri_correction", use_Ri_correction, lev, max_level);
264  query_one_or_per_level(pp, "Ri_crit", Ri_crit, lev, max_level);
265 
266  // Set common flags
267  use_kturb =
268  ((les_type != LESType::None) || (rans_type != RANSType::None) ||
269  (pbl_type != PBLType::None));
270  use_keqn =
271  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn));
272  use_tke =
273  ((les_type == LESType::Deardorff) || (rans_type == RANSType::kEqn) ||
274  (pbl_type == PBLType::MYJ) || (pbl_type == PBLType::MYNN25) ||
275  (pbl_type == PBLType::MYNNEDMF) || uses_shoc_family());
276 
277  if (use_tke) {
278  query_one_or_per_level(pp, "init_tke_from_ustar", init_tke_from_ustar, lev, max_level);
279  }
280 
281  // Validate inputs
282  if (les_type == LESType::Smagorinsky) {
283  if (Cs == 0) {
284  amrex::Error("Need to specify Cs for Smagorsinky LES");
285  }
286  if (smag2d && mix_isotropic) {
287  amrex::Print() << "Turning off mix_isotropic for 2-D Smagorinsky" << std::endl;
288  mix_isotropic = false;
289  }
290  }
291  }
292 
293  void check_params (amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& phys_bc_type)
294  {
295  // BC compatibility
297  phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer ) {
298  amrex::Abort("The selected PBL model requires MOST at lower boundary");
299  }
300  if ( (les_type == LESType::Deardorff) && (Ce_wall > 0) &&
301  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::surface_layer) &&
302  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::slip_wall) &&
303  (phys_bc_type[amrex::Orientation(amrex::Direction::z,amrex::Orientation::low)] != ERF_BC::no_slip_wall) )
304  {
305  amrex::Warning("Deardorff LES assumes wall at zlo when applying Ce_wall");
306  }
307  }
308 
309  void display (int lev)
310  {
311  amrex::Print() << "Turbulence Settings at level " << lev << std::endl;
312 
313  if (
314  les_type == LESType::None && rans_type == RANSType::None &&
315  pbl_type == PBLType::None) {
316  amrex::Print() << " Using DNS model at level " << lev << std::endl;
317  } else if (les_type == LESType::Smagorinsky) {
318  if (smag2d) {
319  amrex::Print() << " Using 2D Smagorinsky LES model at level " << lev << std::endl;
320  } else {
321  amrex::Print() << " Using Smagorinsky LES model at level " << lev << std::endl;
322  }
323  if (use_Ri_correction) {
324  amrex::Print() << " Smagorinsky uses Richardson number correction with Ri_crit = "
325  << Ri_crit << std::endl;
326  }
327  } else if (les_type == LESType::Deardorff) {
328  amrex::Print() << " Using Deardorff LES model at level " << lev << std::endl;
329  } else if (rans_type == RANSType::kEqn) {
330  amrex::Print()
331  << " Using Axell & Liungman one-equation RANS k model at level " << lev
332  << std::endl;
333  } else if (pbl_type == PBLType::MYJ) {
334  amrex::Print() << " Using MYJ PBL model at level " << lev << std::endl;
335  } else if (pbl_type == PBLType::MYNN25) {
336  amrex::Print() << " Using MYNN2.5 PBL model at level " << lev << std::endl;
337  } else if (pbl_type == PBLType::MYNNEDMF) {
338  amrex::Print() << " Using MYNNEDMF PBL model at level " << lev << std::endl;
339  } else if (pbl_type == PBLType::YSU) {
340  amrex::Print() << " Using YSU PBL model at level " << lev << std::endl;
341  } else if (pbl_type == PBLType::MRF) {
342  amrex::Print() << " Using MRF PBL model at level " << lev << std::endl;
343  } else if (pbl_type == PBLType::EAMXX_SHOC) {
344  amrex::Print() << " Using EAMxx SHOC PBL model at level " << lev << std::endl;
345  } else if (pbl_type == PBLType::NATIVE_SHOC) {
346  amrex::Print() << " Using native SHOC PBL model at level " << lev << std::endl;
347  } else {
348  amrex::Error("Unknown turbulence model");
349  }
350 
351  if (les_type != LESType::None) {
352  if (les_type == LESType::Smagorinsky) {
353  amrex::Print() << " Cs : " << Cs << std::endl;
354  }
355  if (les_type == LESType::Deardorff) {
356  amrex::Print() << " Ce : " << Ce << std::endl;
357  amrex::Print() << " Ce at wall : " << Ce_wall << std::endl;
358  amrex::Print() << " Ck : " << Ck << std::endl;
359  amrex::Print() << " sigma_k : " << sigma_k << std::endl;
360 
361  // Sullivan et al 1994, Eqn 14
362  amrex::Real Cs_equiv = std::sqrt(Ck * std::sqrt(Ck / Ce));
363  amrex::Print() << " equivalent Cs : " << Cs_equiv
364  << std::endl;
365  }
366  amrex::Print() << " isotropic mixing : " << mix_isotropic
367  << std::endl;
368  }
369 
370  if (rans_type != RANSType::None) {
371  if (rans_type == RANSType::kEqn) {
372  amrex::Print() << "Cmu0 : " << Cmu0 << std::endl;
373  amrex::Print() << "sigma_k : " << sigma_k << std::endl;
374  amrex::Print() << "Cb : " << Cb << std::endl;
375  amrex::Print() << "Rt_crit : " << Rt_crit << std::endl;
376  amrex::Print() << "Rt_min : " << Rt_min << std::endl;
377  amrex::Print() << "max_geom_lscale : " << l_g_max << std::endl;
378  }
379  }
380 
381  if ((les_type == LESType::Deardorff) ||
382  (rans_type == RANSType::kEqn)) {
383  if (theta_ref > 0) {
384  amrex::Print() << " reference theta : " << theta_ref << std::endl;
385  } else {
386  amrex::Print() << " reference theta : n/a" << std::endl;
387  }
388  }
389 
390  if ((les_type != LESType::None) || (rans_type != RANSType::None)) {
391  amrex::Print() << " Pr_t : " << Pr_t << std::endl;
392  amrex::Print() << " Sc_t : " << Sc_t << std::endl;
393  }
394 
395  if (pbl_type == PBLType::MYNN25 || pbl_type == PBLType::MYNNEDMF) {
396  amrex::Print() << " pbl_mynn_A1 : " << pbl_mynn.A1 << std::endl;
397  amrex::Print() << " pbl_mynn_A2 : " << pbl_mynn.A2 << std::endl;
398  amrex::Print() << " pbl_mynn_B1 : " << pbl_mynn.B1 << std::endl;
399  amrex::Print() << " pbl_mynn_B2 : " << pbl_mynn.B2 << std::endl;
400  amrex::Print() << " pbl_mynn_C1 : " << pbl_mynn.C1 << std::endl;
401  amrex::Print() << " pbl_mynn_C2 : " << pbl_mynn.C2 << std::endl;
402  amrex::Print() << " pbl_mynn_C3 : " << pbl_mynn.C3 << std::endl;
403  amrex::Print() << " pbl_mynn_C4 : " << pbl_mynn.C4 << std::endl;
404  amrex::Print() << " pbl_mynn_C5 : " << pbl_mynn.C5 << std::endl;
405  } else if (pbl_type == PBLType::YSU) {
406  amrex::Print() << " pbl_ysu_coriolis_freq : "
407  << pbl_ysu_coriolis_freq << std::endl;
408  amrex::Print() << " pbl_ysu_use_consistent_coriolis : "
409  << pbl_ysu_use_consistent_coriolis << std::endl;
410  amrex::Print() << " pbl_ysu_force_over_water : "
411  << pbl_ysu_force_over_water << std::endl;
412  amrex::Print() << " pbl_ysu_land_Ribcr : "
413  << pbl_ysu_land_Ribcr << std::endl;
414  amrex::Print() << " pbl_ysu_unst_Ribcr : "
415  << pbl_ysu_unst_Ribcr << std::endl;
416  } else if (pbl_type == PBLType::MRF) {
417  amrex::Print() << " pbl_mrf_coriolis_freq : " << pbl_mrf_coriolis_freq
418  << std::endl;
419  amrex::Print() << " pbl_mrf_Ribcr : " << pbl_mrf_Ribcr
420  << std::endl;
421  amrex::Print() << " pbl_mrf_const_b : " << pbl_mrf_const_b
422  << std::endl;
423  amrex::Print() << " pbl_mrf_sf : " << pbl_mrf_sf
424  << std::endl;
425  amrex::Print() << " mrf_moistvars : " << mrf_moistvars
426  << std::endl;
427  }
428  }
429 
430  // LES model
431  LESType les_type = LESType::None;
432 
433  // Turbulent Prandtl number
436 
437  // Turbulent Schmidt number
440 
441  // Smagorinsky
443  bool smag2d = false;
444 
445  // Deardorff
447  amrex::Real Ce_wall = zero; // if > 0, then set Ce to this at k=0
449 
450  // k-eqn RANS coefficients (Axell & Liungman 2001)
455  amrex::Real l_g_max = amrex::Real(30.0); // ~ kappa * (amrex::Real(0.1) * zi)
456 
457  // Deardorff or k-eqn RANS
458  // - diffusivity of tke is 1/sigma_k times the eddy viscosity
460  // - reference potential temperature used to quantify the stratification in
461  // a stable region
463  // - how to quantify stratification effects
465 
466  // Anisotropic length scales
467  bool mix_isotropic = true;
468 
469  bool use_Ri_correction = true;
471 
472  // RANS type
473  RANSType rans_type = RANSType::None;
474 
475  bool dirichlet_k = false;
476 
477  // PBL model
478  PBLType pbl_type = PBLType::None;
479 
480  bool uses_eamxx_shoc () const noexcept
481  {
482  return pbl_type == PBLType::EAMXX_SHOC;
483  }
484 
485  bool uses_native_shoc () const noexcept
486  {
487  return pbl_type == PBLType::NATIVE_SHOC;
488  }
489 
490  bool uses_shoc_family () const noexcept
491  {
492  return uses_eamxx_shoc() || uses_native_shoc();
493  }
494 
495  bool pbl_requires_surface_layer () const noexcept
496  {
497  return (pbl_type == PBLType::MYNN25) ||
498  (pbl_type == PBLType::MYNNEDMF) ||
499  (pbl_type == PBLType::YSU) ||
500  (pbl_type == PBLType::MRF) ||
502  }
503 
505  {
506  return uses_shoc_family();
507  }
508 
510  MYNNLevel2 pbl_mynn_level2; // limiting in the decaying turbulence regime
511 
512  // Common Flags
513  bool use_kturb = false; // Any turbulence modeling?
514  bool use_keqn =
515  false; // Any microscale turbulence modeling (LES, RANS) with TKE closure?
516  // Then need to populate SmnSmn_lev for production term.
517  bool use_pbl_tke =
518  false; // Any mesoscale turbulence modeling (PBL) with TKE closure?
519  bool use_tke = false; // Any TKE closure (meso or microscale)?
520 
521  // Initialize TKE/QKE with linear profiles whose surface values are a
522  // function of the friction velocity calculated by the surface layer scheme
523  // (e.g., as done in MYNN-EDMF)
524  bool init_tke_from_ustar = false;
525 
526  // This is the value of tke_min in WRF 4.5
528 
529  // Model coefficients - YSU
530  // TODO: Add parmparse for all of these above
532  amrex::Real(1.0e-4); // 1e-4 is hardcoded in WRF, we let the user specify or take the
533  // value from ERF coriolis forcing
535  false; // ignore input pbl_ysu_coriolis_freq, take value from ERF coriolis
536  // forcing instead
538  false; // Force YSU to act as if it is over water regardless of other inputs
539  // (for testing)
541  fourth; // Critical Bulk Richardson number of Land for stable conditions
543  zero; // Critical Bulk Richardson number for unstable conditions
544  // Model coefficients - MRF
546  amrex::Real pbl_mrf_Ribcr = amrex::Real(0.5); // Critical Bulk Richardson number for MRF PBL model
547  amrex::Real pbl_mrf_const_b = amrex::Real(7.8); // Constant b in MRF PBL model, used to compute the PBL height
548  amrex::Real pbl_mrf_sf = amrex::Real(0.1); // MRF surface flux, used to compute the PBL height
549  bool mrf_moistvars = false; // if true, adds turbulence to moisture
550  // MYNN2.5 PBL model
551  // TKE/QKE stuff
552  bool advect_tke = true; // if MYNN2.5 PBL is used default is turb transport in
553  // Z-direction only
554  bool diffuse_tke_3D = true; // if numerical diffusion is turned on
555 };
556 #endif
constexpr amrex::Real three
Definition: ERF_Constants.H:11
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real fourth
Definition: ERF_Constants.H:14
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
@ no_slip_wall
@ surface_layer
ParmParse pp("prob")
Real T
Definition: ERF_InitCustomPert_Bubble.H:105
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_ENUM(LESType, None, Smagorinsky, Smagorinsky2D, Deardorff)
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)
Definition: ERF_TurbStruct.H:48
int query_one_or_per_level(const amrex::ParmParse &pp, const char *query_string, T &query_var, const int lev, const int maxlev)
Definition: ERF_TurbStruct.H:16
@ theta
Definition: ERF_MM5.H:20
Definition: ERF_MYNNStruct.H:11
amrex::Real SMmax
Definition: ERF_MYNNStruct.H:58
amrex::Real SHmax
Definition: ERF_MYNNStruct.H:60
amrex::Real SQfac
Definition: ERF_MYNNStruct.H:54
amrex::Real C4
Definition: ERF_MYNNStruct.H:50
amrex::Real C1
Definition: ERF_MYNNStruct.H:47
amrex::Real C3
Definition: ERF_MYNNStruct.H:49
amrex::Real C2
Definition: ERF_MYNNStruct.H:48
amrex::Real A2
Definition: ERF_MYNNStruct.H:44
amrex::Real SHmin
Definition: ERF_MYNNStruct.H:59
amrex::Real B1
Definition: ERF_MYNNStruct.H:45
amrex::Real B2
Definition: ERF_MYNNStruct.H:46
amrex::Real C5
Definition: ERF_MYNNStruct.H:51
amrex::Real SMmin
Definition: ERF_MYNNStruct.H:57
amrex::Real A1
Definition: ERF_MYNNStruct.H:43
bool diffuse_moistvars
Definition: ERF_MYNNStruct.H:65
Definition: ERF_MYNNStruct.H:68
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)
Definition: ERF_MYNNStruct.H:69
Definition: ERF_TurbStruct.H:82
amrex::Real tke_min
Definition: ERF_TurbStruct.H:527
bool smag2d
Definition: ERF_TurbStruct.H:443
amrex::Real sigma_k
Definition: ERF_TurbStruct.H:459
MYNNLevel25 pbl_mynn
Definition: ERF_TurbStruct.H:509
PBLType pbl_type
Definition: ERF_TurbStruct.H:478
amrex::Real pbl_mrf_const_b
Definition: ERF_TurbStruct.H:547
bool use_pbl_tke
Definition: ERF_TurbStruct.H:517
void check_params(amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
Definition: ERF_TurbStruct.H:293
amrex::Real Sc_t_inv
Definition: ERF_TurbStruct.H:439
amrex::Real Rt_min
Definition: ERF_TurbStruct.H:454
bool use_keqn
Definition: ERF_TurbStruct.H:514
amrex::Real pbl_mrf_coriolis_freq
Definition: ERF_TurbStruct.H:545
MYNNLevel2 pbl_mynn_level2
Definition: ERF_TurbStruct.H:510
amrex::Real Ri_crit
Definition: ERF_TurbStruct.H:470
RANSType rans_type
Definition: ERF_TurbStruct.H:473
StratType strat_type
Definition: ERF_TurbStruct.H:464
bool uses_eamxx_shoc() const noexcept
Definition: ERF_TurbStruct.H:480
bool dirichlet_k
Definition: ERF_TurbStruct.H:475
amrex::Real pbl_mrf_Ribcr
Definition: ERF_TurbStruct.H:546
bool advect_tke
Definition: ERF_TurbStruct.H:552
amrex::Real Ck
Definition: ERF_TurbStruct.H:448
bool uses_shoc_family() const noexcept
Definition: ERF_TurbStruct.H:490
amrex::Real Cmu0
Definition: ERF_TurbStruct.H:451
bool pbl_ysu_use_consistent_coriolis
Definition: ERF_TurbStruct.H:534
bool uses_native_shoc() const noexcept
Definition: ERF_TurbStruct.H:485
amrex::Real Cb
Definition: ERF_TurbStruct.H:452
amrex::Real pbl_mrf_sf
Definition: ERF_TurbStruct.H:548
void init_params(int lev, int max_level, std::string pp_prefix)
Definition: ERF_TurbStruct.H:84
bool use_Ri_correction
Definition: ERF_TurbStruct.H:469
bool init_tke_from_ustar
Definition: ERF_TurbStruct.H:524
amrex::Real pbl_ysu_land_Ribcr
Definition: ERF_TurbStruct.H:540
bool mrf_moistvars
Definition: ERF_TurbStruct.H:549
bool use_tke
Definition: ERF_TurbStruct.H:519
bool diffuse_tke_3D
Definition: ERF_TurbStruct.H:554
amrex::Real Cs
Definition: ERF_TurbStruct.H:442
amrex::Real Pr_t_inv
Definition: ERF_TurbStruct.H:435
bool pbl_suppresses_microphysics_condensation() const noexcept
Definition: ERF_TurbStruct.H:504
amrex::Real Ce_wall
Definition: ERF_TurbStruct.H:447
amrex::Real Ce
Definition: ERF_TurbStruct.H:446
LESType les_type
Definition: ERF_TurbStruct.H:431
amrex::Real pbl_ysu_coriolis_freq
Definition: ERF_TurbStruct.H:531
bool pbl_ysu_force_over_water
Definition: ERF_TurbStruct.H:537
void display(int lev)
Definition: ERF_TurbStruct.H:309
amrex::Real Pr_t
Definition: ERF_TurbStruct.H:434
bool use_kturb
Definition: ERF_TurbStruct.H:513
amrex::Real theta_ref
Definition: ERF_TurbStruct.H:462
amrex::Real Sc_t
Definition: ERF_TurbStruct.H:438
amrex::Real Rt_crit
Definition: ERF_TurbStruct.H:453
amrex::Real pbl_ysu_unst_Ribcr
Definition: ERF_TurbStruct.H:542
bool mix_isotropic
Definition: ERF_TurbStruct.H:467
amrex::Real l_g_max
Definition: ERF_TurbStruct.H:455
bool pbl_requires_surface_layer() const noexcept
Definition: ERF_TurbStruct.H:495