From 483d9dac5655c93d558f3514e4ed17a1fcb128d8 Mon Sep 17 00:00:00 2001 From: Eliot Quon Date: Tue, 1 Oct 2024 10:53:21 -0600 Subject: [PATCH] Cleanup --- Source/BoundaryConditions/ERF_ABLMost.H | 2 +- Source/DataStructs/ERF_TurbStruct.H | 2 -- Source/PBL/ERF_ComputeDiffusivityMYNN25.cpp | 26 +++++++-------------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/Source/BoundaryConditions/ERF_ABLMost.H b/Source/BoundaryConditions/ERF_ABLMost.H index e821f2e46..b977a9b05 100644 --- a/Source/BoundaryConditions/ERF_ABLMost.H +++ b/Source/BoundaryConditions/ERF_ABLMost.H @@ -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; diff --git a/Source/DataStructs/ERF_TurbStruct.H b/Source/DataStructs/ERF_TurbStruct.H index 25eef0d32..ee8c7f879 100644 --- a/Source/DataStructs/ERF_TurbStruct.H +++ b/Source/DataStructs/ERF_TurbStruct.H @@ -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 diff --git a/Source/PBL/ERF_ComputeDiffusivityMYNN25.cpp b/Source/PBL/ERF_ComputeDiffusivityMYNN25.cpp index da21a305c..0b29d42df 100644 --- a/Source/PBL/ERF_ComputeDiffusivityMYNN25.cpp +++ b/Source/PBL/ERF_ComputeDiffusivityMYNN25.cpp @@ -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); @@ -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);