1 #ifndef ERF_TURB_STRUCT_H_
2 #define ERF_TURB_STRUCT_H_
15 int count =
pp.countval(query_string);
18 }
else if (count == 1) {
19 pp.query(query_string, query_var);
20 }
else if (count == maxlev + 1) {
21 pp.query(query_string, query_var, lev);
23 amrex::Error(
"For parmparse variable " +
pp.prefixedName(query_string)
24 +
": if specified, specify once total or once for each level");
38 std::string les_type_string =
"None";
42 std::string rans_type_string =
"None";
46 amrex::Error(
"Hybrid RANS-LES not implemented");
50 static std::string pbl_type_string =
"None";
57 amrex::Print() <<
"Selected a PBL model and an LES model: " <<
58 "Using PBL for vertical transport, LES for horizontal" << std::endl;
59 }
else if (
les_type == LESType::Deardorff) {
60 amrex::Error(
"It is not recommended to use Deardorff LES and a PBL model");
80 }
else if (
pbl_type == PBLType::YSU) {
108 if (
les_type == LESType::Deardorff) {
124 if (
les_type == LESType::Smagorinsky) {
126 amrex::Error(
"Need to specify Cs for Smagorsinky LES");
133 amrex::Print() <<
"Turbulence Settings at level " << lev << std::endl;
136 amrex::Print() <<
" Using DNS model at level " << lev << std::endl;
137 }
else if (
les_type == LESType::Smagorinsky) {
138 amrex::Print() <<
" Using Smagorinsky LES model at level " << lev << std::endl;
139 }
else if (
les_type == LESType::Deardorff) {
140 amrex::Print() <<
" Using Deardorff LES model at level " << lev << std::endl;
141 }
else if (
rans_type == RANSType::kEqn) {
142 amrex::Print() <<
" Using Axell & Liungman one-equation RANS k model at level " << lev << std::endl;
143 }
else if (
pbl_type == PBLType::MYNN25) {
144 amrex::Print() <<
" Using MYNN2.5 PBL model at level " << lev << std::endl;
145 }
else if (
pbl_type == PBLType::YSU) {
146 amrex::Print() <<
" Using YSU PBL model at level " << lev << std::endl;
150 if (
les_type == LESType::Smagorinsky) {
151 amrex::Print() <<
"Cs : " <<
Cs << std::endl;
153 if (
les_type == LESType::Deardorff) {
154 amrex::Print() <<
"Ce : " <<
Ce << std::endl;
155 amrex::Print() <<
"Ce at wall : " <<
Ce_wall << std::endl;
156 amrex::Print() <<
"Ck : " <<
Ck << std::endl;
157 amrex::Print() <<
"sigma_k : " <<
sigma_k << std::endl;
158 amrex::Print() <<
"reference theta : " <<
theta_ref << std::endl;
160 amrex::Real Cs_equiv = std::sqrt(
Ck * std::sqrt(
Ck/
Ce));
161 amrex::Print() <<
"equivalent Cs : " << Cs_equiv << std::endl;
167 amrex::Print() <<
"Cmu0 : " <<
Cmu0 << std::endl;
168 amrex::Print() <<
"sigma_k : " <<
sigma_k << std::endl;
169 amrex::Print() <<
"Cb : " <<
Cb << std::endl;
170 amrex::Print() <<
"Rt_crit : " <<
Rt_crit << std::endl;
171 amrex::Print() <<
"Rt_min : " <<
Rt_min << std::endl;
172 amrex::Print() <<
"max_geom_lscale : " <<
l_g_max << std::endl;
173 amrex::Print() <<
"reference theta : " <<
theta_ref << std::endl;
178 amrex::Print() <<
"Pr_t : " <<
Pr_t << std::endl;
179 amrex::Print() <<
"Sc_t : " <<
Sc_t << std::endl;
183 amrex::Print() <<
" pbl_mynn_A1 : " <<
pbl_mynn.
A1 << std::endl;
184 amrex::Print() <<
" pbl_mynn_A2 : " <<
pbl_mynn.
A2 << std::endl;
185 amrex::Print() <<
" pbl_mynn_B1 : " <<
pbl_mynn.
B1 << std::endl;
186 amrex::Print() <<
" pbl_mynn_B2 : " <<
pbl_mynn.
B2 << std::endl;
187 amrex::Print() <<
" pbl_mynn_C1 : " <<
pbl_mynn.
C1 << std::endl;
188 amrex::Print() <<
" pbl_mynn_C2 : " <<
pbl_mynn.
C2 << std::endl;
189 amrex::Print() <<
" pbl_mynn_C3 : " <<
pbl_mynn.
C3 << std::endl;
190 amrex::Print() <<
" pbl_mynn_C4 : " <<
pbl_mynn.
C4 << std::endl;
191 amrex::Print() <<
" pbl_mynn_C5 : " <<
pbl_mynn.
C5 << std::endl;
192 }
else if (
pbl_type == PBLType::YSU) {
208 amrex::Real
Pr_t = amrex::Real(1.0) / amrex::Real(3.0);
216 amrex::Real
Cs = 0.0;
219 amrex::Real
Ce = 0.93;
221 amrex::Real
Ck = 0.1;
225 amrex::Real
Cb = 0.35;
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:219
AMREX_ENUM(LESType, None, Smagorinsky, 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:13
@ T
Definition: ERF_IndexDefines.H:99
Definition: ERF_MYNNStruct.H:9
amrex::Real SMmax
Definition: ERF_MYNNStruct.H:53
amrex::Real SHmax
Definition: ERF_MYNNStruct.H:55
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:54
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:52
amrex::Real A1
Definition: ERF_MYNNStruct.H:41
bool diffuse_moistvars
Definition: ERF_MYNNStruct.H:60
Definition: ERF_MYNNStruct.H:63
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:64
Definition: ERF_TurbStruct.H:31
amrex::Real sigma_k
Definition: ERF_TurbStruct.H:232
MYNNLevel25 pbl_mynn
Definition: ERF_TurbStruct.H:243
PBLType pbl_type
Definition: ERF_TurbStruct.H:241
bool use_KE
Definition: ERF_TurbStruct.H:255
amrex::Real Sc_t_inv
Definition: ERF_TurbStruct.H:213
amrex::Real Rt_min
Definition: ERF_TurbStruct.H:227
void init_params(int lev, int max_level)
Definition: ERF_TurbStruct.H:33
MYNNLevel2 pbl_mynn_level2
Definition: ERF_TurbStruct.H:244
RANSType rans_type
Definition: ERF_TurbStruct.H:238
bool diffuse_KE_3D
Definition: ERF_TurbStruct.H:256
amrex::Real Ck
Definition: ERF_TurbStruct.H:221
amrex::Real Cmu0
Definition: ERF_TurbStruct.H:224
std::string pp_prefix
Definition: ERF_TurbStruct.H:202
bool pbl_ysu_use_consistent_coriolis
Definition: ERF_TurbStruct.H:249
amrex::Real Cb
Definition: ERF_TurbStruct.H:225
amrex::Real pbl_ysu_land_Ribcr
Definition: ERF_TurbStruct.H:251
amrex::Real Cs
Definition: ERF_TurbStruct.H:216
amrex::Real Pr_t_inv
Definition: ERF_TurbStruct.H:209
amrex::Real Ce_wall
Definition: ERF_TurbStruct.H:220
amrex::Real Ce
Definition: ERF_TurbStruct.H:219
LESType les_type
Definition: ERF_TurbStruct.H:205
amrex::Real pbl_ysu_coriolis_freq
Definition: ERF_TurbStruct.H:248
bool pbl_ysu_force_over_water
Definition: ERF_TurbStruct.H:250
void display(int lev)
Definition: ERF_TurbStruct.H:131
amrex::Real Pr_t
Definition: ERF_TurbStruct.H:208
amrex::Real theta_ref
Definition: ERF_TurbStruct.H:235
amrex::Real Sc_t
Definition: ERF_TurbStruct.H:212
bool advect_KE
Definition: ERF_TurbStruct.H:257
amrex::Real Rt_crit
Definition: ERF_TurbStruct.H:226
amrex::Real pbl_ysu_unst_Ribcr
Definition: ERF_TurbStruct.H:252
amrex::Real l_g_max
Definition: ERF_TurbStruct.H:228