Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ewquon committed Oct 1, 2024
1 parent 537db05 commit 483d9da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Source/BoundaryConditions/ERF_ABLMost.H
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public:
pp.query("most.pblh_calc", pblh_string);
if (pblh_string == "none") {
pblh_type = PBLHeightCalcType::None;
} else if (pblh_string == "MYNN2.5") {
} else if ((pblh_string == "MYNN2.5") || (pblh_string == "MYNN25")) {
pblh_type = PBLHeightCalcType::MYNN25;
} else if (pblh_string == "YSU") {
pblh_type = PBLHeightCalcType::YSU;
Expand Down
2 changes: 0 additions & 2 deletions Source/DataStructs/ERF_TurbStruct.H
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ struct TurbChoice {
amrex::ParmParse pp(pp_prefix);

// Which LES closure?
std::string les_type_string = "None";
query_one_or_per_level(pp, "les_type", les_type, lev, max_level);

// Which PBL Closure
static std::string pbl_type_string = "None";
query_one_or_per_level(pp, "pbl_type", pbl_type, lev, max_level);

// Do some more stuff for PBL Modeling
Expand Down
26 changes: 9 additions & 17 deletions Source/PBL/ERF_ComputeDiffusivityMYNN25.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,14 @@ ComputeDiffusivityMYNN25 (const MultiFab& xvel,
}

// Calculate nondimensional production terms
Real shearProd = dudz*dudz + dvdz*dvdz;
Real buoyProd = -(CONST_GRAV/theta0) * dthetavdz; // no SGS clouds
Real Lsq = Lm * Lm;
Real qsq = qvel(i,j,k) * qvel(i,j,k);
Real GM = Lsq/qsq * shearProd;
Real GH = Lsq/qsq * buoyProd;
Real shearProd = dudz*dudz + dvdz*dvdz;
Real buoyProd = -(CONST_GRAV/theta0) * dthetavdz; // no SGS clouds
Real Lsq = Lm * Lm;
Real qsq = qvel(i,j,k) * qvel(i,j,k);
Real GM = Lsq/qsq * shearProd;
Real GH = Lsq/qsq * buoyProd;

// Equilibrium (Level-2) q calculation follows NN09, Appendix 2
#if 0
Real Rf = level2.calc_Rf(GM, GH);
Real SM2 = level2.calc_SM(Rf);
Real SH2 = level2.calc_SH(Rf);
Real q2sq = mynn.B1*Lm*Lm*SM2*(1.0-Rf)*shearProd;
#endif
Real SM2, SH2;
level2.calc_SM_SH(SM2, SH2, GM, GH);
Real q2sq = mynn.B1 * Lsq * (SM2*shearProd + SH2*buoyProd);
Expand All @@ -237,20 +231,18 @@ ComputeDiffusivityMYNN25 (const MultiFab& xvel,
//mynn.calc_stability_funcs(SM,SH,GM,GH,alphac);

// Apply limiter to level 2 functions as in original MYNN
// (following WRF)
// (following WRF), not to the level 2.5 functions
SM = SM2 * alphac;
SH = SH2 * alphac;

} else {
// Level 2.5
mynn.calc_stability_funcs(SM,SH,GM,GH);
}

SQ = 3.0 * SM; // revised in NN09

// Clip SM, SH following WRF
SM = amrex::min(amrex::max(SM,mynn.SMmin), mynn.SMmax);
SH = amrex::min(amrex::max(SH,mynn.SHmin), mynn.SHmax);
SM = amrex::min(amrex::max(SM, mynn.SMmin), mynn.SMmax);
SH = amrex::min(amrex::max(SH, mynn.SHmin), mynn.SHmax);

// Finally, compute the eddy viscosity/diffusivities
const Real rho = cell_data(i,j,k,Rho_comp);
Expand Down

0 comments on commit 483d9da

Please sign in to comment.