1 #ifndef ERF_TURB_STRUCT_H_
2 #define ERF_TURB_STRUCT_H_
6 AMREX_ENUM(LESType, None, Smagorinsky, Smagorinsky2D, Deardorff);
10 AMREX_ENUM(PBLType, None, MYJ, MYNN25, MYNNEDMF, YSU, MRF, SHOC);
17 const amrex::ParmParse&
pp,
18 const char* query_string,
23 int count =
pp.countval(query_string);
26 }
else if (count == 1) {
27 pp.query(query_string, query_var);
28 }
else if (count == maxlev + 1) {
29 pp.query(query_string, query_var, lev);
32 "For parmparse variable " +
pp.prefixedName(query_string) +
33 ": if specified, specify once total or once for each level");
43 void init_params (
int lev,
int max_level, std::string pp_prefix)
45 amrex::ParmParse
pp(pp_prefix);
48 std::string les_type_string =
"None";
52 if (
les_type == LESType::Smagorinsky2D) {
58 std::string rans_type_string =
"None";
62 amrex::Error(
"Hybrid RANS-LES not implemented");
66 static std::string pbl_type_string =
"None";
73 amrex::Print() <<
"Selected a PBL model and an LES model: "
74 <<
"Using PBL for vertical transport, LES for horizontal"
77 if (
les_type == LESType::Smagorinsky) {
79 amrex::Error(
"If using Smagorinsky with a PBL model, the 2-D "
80 "formulation should be used");
81 }
else if (
les_type == LESType::Deardorff) {
83 "It is not recommended to use Deardorff LES and a PBL model");
112 }
else if (
pbl_type == PBLType::YSU) {
116 pp,
"pbl_ysu_use_consistent_coriolis",
125 }
else if (
pbl_type == PBLType::MRF) {
135 }
else if (
pbl_type == PBLType::SHOC) {
137 amrex::Abort(
"You set use_shoc to true but didn't build with SHOC; you must rebuild the executable");
164 if (
les_type == LESType::Deardorff) {
173 amrex::Print() <<
"Thermal stratification based on gradient of potential temperature" << std::endl;
175 amrex::Print() <<
"Thermal stratification based on gradient of virtual potential temperature" << std::endl;
177 amrex::Print() <<
"Thermal stratification based on gradient of linearized liquid-water potential temperature" << std::endl;
210 if (
les_type == LESType::Smagorinsky) {
212 amrex::Error(
"Need to specify Cs for Smagorsinky LES");
215 amrex::Print() <<
"Turning off mix_isotropic for 2-D Smagorinsky" << std::endl;
223 amrex::Print() <<
"Turbulence Settings at level " << lev << std::endl;
228 amrex::Print() <<
" Using DNS model at level " << lev << std::endl;
229 }
else if (
les_type == LESType::Smagorinsky) {
231 amrex::Print() <<
" Using 2D Smagorinsky LES model at level " << lev << std::endl;
233 amrex::Print() <<
" Using Smagorinsky LES model at level " << lev << std::endl;
236 amrex::Print() <<
" Smagorinsky accounts for moist stratification" << std::endl;
238 }
else if (
les_type == LESType::Deardorff) {
239 amrex::Print() <<
" Using Deardorff LES model at level " << lev << std::endl;
240 }
else if (
rans_type == RANSType::kEqn) {
242 <<
" Using Axell & Liungman one-equation RANS k model at level " << lev << std::endl;
243 }
else if (
pbl_type == PBLType::MYJ) {
244 amrex::Print() <<
" Using MYJ PBL model at level " << lev << std::endl;
245 }
else if (
pbl_type == PBLType::MYNN25) {
246 amrex::Print() <<
" Using MYNN2.5 PBL model at level " << lev << std::endl;
247 }
else if (
pbl_type == PBLType::MYNNEDMF) {
248 amrex::Print() <<
" Using MYNNEDMF PBL model at level " << lev << std::endl;
249 }
else if (
pbl_type == PBLType::YSU) {
250 amrex::Print() <<
" Using YSU PBL model at level " << lev << std::endl;
251 }
else if (
pbl_type == PBLType::MRF) {
252 amrex::Print() <<
" Using MRF PBL model at level " << lev << std::endl;
254 amrex::Error(
"Unknown turbulence model");
258 if (
les_type == LESType::Smagorinsky) {
259 amrex::Print() <<
" Cs : " <<
Cs << std::endl;
261 if (
les_type == LESType::Deardorff) {
262 amrex::Print() <<
" Ce : " <<
Ce << std::endl;
263 amrex::Print() <<
" Ce at wall : " <<
Ce_wall << std::endl;
264 amrex::Print() <<
" Ck : " <<
Ck << std::endl;
265 amrex::Print() <<
" sigma_k : " <<
sigma_k << std::endl;
269 amrex::Print() <<
" equivalent Cs : " << Cs_equiv
278 amrex::Print() <<
"Cmu0 : " <<
Cmu0 << std::endl;
279 amrex::Print() <<
"sigma_k : " <<
sigma_k << std::endl;
280 amrex::Print() <<
"Cb : " <<
Cb << std::endl;
281 amrex::Print() <<
"Rt_crit : " <<
Rt_crit << std::endl;
282 amrex::Print() <<
"Rt_min : " <<
Rt_min << std::endl;
283 amrex::Print() <<
"max_geom_lscale : " <<
l_g_max << std::endl;
287 if ((
les_type == LESType::Deardorff) ||
291 amrex::Print() <<
" reference theta : " <<
theta_ref << std::endl;
293 amrex::Print() <<
" reference theta : n/a" << std::endl;
298 amrex::Print() <<
" Pr_t : " <<
Pr_t << std::endl;
299 amrex::Print() <<
" Sc_t : " <<
Sc_t << std::endl;
303 amrex::Print() <<
" pbl_mynn_A1 : " <<
pbl_mynn.
A1 << std::endl;
304 amrex::Print() <<
" pbl_mynn_A2 : " <<
pbl_mynn.
A2 << std::endl;
305 amrex::Print() <<
" pbl_mynn_B1 : " <<
pbl_mynn.
B1 << std::endl;
306 amrex::Print() <<
" pbl_mynn_B2 : " <<
pbl_mynn.
B2 << std::endl;
307 amrex::Print() <<
" pbl_mynn_C1 : " <<
pbl_mynn.
C1 << std::endl;
308 amrex::Print() <<
" pbl_mynn_C2 : " <<
pbl_mynn.
C2 << std::endl;
309 amrex::Print() <<
" pbl_mynn_C3 : " <<
pbl_mynn.
C3 << std::endl;
310 amrex::Print() <<
" pbl_mynn_C4 : " <<
pbl_mynn.
C4 << std::endl;
311 amrex::Print() <<
" pbl_mynn_C5 : " <<
pbl_mynn.
C5 << std::endl;
312 }
else if (
pbl_type == PBLType::YSU) {
313 amrex::Print() <<
" pbl_ysu_coriolis_freq : "
315 amrex::Print() <<
" pbl_ysu_use_consistent_coriolis : "
317 amrex::Print() <<
" pbl_ysu_force_over_water : "
319 amrex::Print() <<
" pbl_ysu_land_Ribcr : "
321 amrex::Print() <<
" pbl_ysu_unst_Ribcr : "
323 }
else if (
pbl_type == PBLType::MRF) {
330 amrex::Print() <<
" pbl_mrf_sf : " <<
pbl_mrf_sf
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:233
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_ENUM(LESType, None, Smagorinsky, Smagorinsky2D, Deardorff)
void 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
@ T
Definition: ERF_IndexDefines.H:110
Definition: ERF_MYNNStruct.H:9
amrex::Real SMmax
Definition: ERF_MYNNStruct.H:56
amrex::Real SHmax
Definition: ERF_MYNNStruct.H:58
amrex::Real SQfac
Definition: ERF_MYNNStruct.H:52
amrex::Real C4
Definition: ERF_MYNNStruct.H:48
amrex::Real C1
Definition: ERF_MYNNStruct.H:45
amrex::Real C3
Definition: ERF_MYNNStruct.H:47
amrex::Real C2
Definition: ERF_MYNNStruct.H:46
amrex::Real A2
Definition: ERF_MYNNStruct.H:42
amrex::Real SHmin
Definition: ERF_MYNNStruct.H:57
amrex::Real B1
Definition: ERF_MYNNStruct.H:43
amrex::Real B2
Definition: ERF_MYNNStruct.H:44
amrex::Real C5
Definition: ERF_MYNNStruct.H:49
amrex::Real SMmin
Definition: ERF_MYNNStruct.H:55
amrex::Real A1
Definition: ERF_MYNNStruct.H:41
bool diffuse_moistvars
Definition: ERF_MYNNStruct.H:63
Definition: ERF_MYNNStruct.H:66
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:67
Definition: ERF_TurbStruct.H:41
bool smag2d
Definition: ERF_TurbStruct.H:350
amrex::Real sigma_k
Definition: ERF_TurbStruct.H:366
MYNNLevel25 pbl_mynn
Definition: ERF_TurbStruct.H:385
PBLType pbl_type
Definition: ERF_TurbStruct.H:383
amrex::Real pbl_mrf_const_b
Definition: ERF_TurbStruct.H:421
bool use_pbl_tke
Definition: ERF_TurbStruct.H:393
amrex::Real Sc_t_inv
Definition: ERF_TurbStruct.H:346
amrex::Real Rt_min
Definition: ERF_TurbStruct.H:361
bool use_keqn
Definition: ERF_TurbStruct.H:390
amrex::Real pbl_mrf_coriolis_freq
Definition: ERF_TurbStruct.H:418
MYNNLevel2 pbl_mynn_level2
Definition: ERF_TurbStruct.H:386
RANSType rans_type
Definition: ERF_TurbStruct.H:380
StratType strat_type
Definition: ERF_TurbStruct.H:371
amrex::Real pbl_mrf_Ribcr
Definition: ERF_TurbStruct.H:419
bool advect_tke
Definition: ERF_TurbStruct.H:428
amrex::Real Ck
Definition: ERF_TurbStruct.H:355
amrex::Real Cmu0
Definition: ERF_TurbStruct.H:358
bool pbl_ysu_use_consistent_coriolis
Definition: ERF_TurbStruct.H:407
amrex::Real Cb
Definition: ERF_TurbStruct.H:359
amrex::Real pbl_mrf_sf
Definition: ERF_TurbStruct.H:423
void init_params(int lev, int max_level, std::string pp_prefix)
Definition: ERF_TurbStruct.H:43
bool init_tke_from_ustar
Definition: ERF_TurbStruct.H:400
amrex::Real pbl_ysu_land_Ribcr
Definition: ERF_TurbStruct.H:413
bool mrf_moistvars
Definition: ERF_TurbStruct.H:425
bool use_tke
Definition: ERF_TurbStruct.H:395
bool diffuse_tke_3D
Definition: ERF_TurbStruct.H:430
amrex::Real Cs
Definition: ERF_TurbStruct.H:349
amrex::Real Pr_t_inv
Definition: ERF_TurbStruct.H:342
amrex::Real Ce_wall
Definition: ERF_TurbStruct.H:354
amrex::Real Ce
Definition: ERF_TurbStruct.H:353
LESType les_type
Definition: ERF_TurbStruct.H:338
amrex::Real pbl_ysu_coriolis_freq
Definition: ERF_TurbStruct.H:404
bool pbl_ysu_force_over_water
Definition: ERF_TurbStruct.H:410
void display(int lev)
Definition: ERF_TurbStruct.H:221
bool use_smag_stratification
Definition: ERF_TurbStruct.H:377
amrex::Real Pr_t
Definition: ERF_TurbStruct.H:341
bool use_kturb
Definition: ERF_TurbStruct.H:389
amrex::Real theta_ref
Definition: ERF_TurbStruct.H:369
amrex::Real Sc_t
Definition: ERF_TurbStruct.H:345
amrex::Real Rt_crit
Definition: ERF_TurbStruct.H:360
amrex::Real pbl_ysu_unst_Ribcr
Definition: ERF_TurbStruct.H:415
bool mix_isotropic
Definition: ERF_TurbStruct.H:374
amrex::Real l_g_max
Definition: ERF_TurbStruct.H:362