From a2e70e22af1faf2efaec923fdab77c37972ce942 Mon Sep 17 00:00:00 2001 From: AMLattanzi Date: Tue, 11 Jun 2024 17:32:08 -0700 Subject: [PATCH] clean up botched merge. --- .../Diffusion/ComputeTurbulentViscosity.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Source/Diffusion/ComputeTurbulentViscosity.cpp b/Source/Diffusion/ComputeTurbulentViscosity.cpp index c0311c597..05e46acce 100644 --- a/Source/Diffusion/ComputeTurbulentViscosity.cpp +++ b/Source/Diffusion/ComputeTurbulentViscosity.cpp @@ -116,12 +116,10 @@ void ComputeTurbulentViscosityLES (const MultiFab& Tau11, const MultiFab& Tau22, //*********************************************************************************** else if (turbChoice.les_type == LESType::Deardorff) { - const Real l_C_k = turbChoice.Ck; - const Real l_C_e = turbChoice.Ce; - const Real l_C_e_wall = turbChoice.Ce_wall; - const Real Ce_lcoeff = amrex::max(0.0, l_C_e - 1.9*l_C_k); - const Real l_abs_g = const_grav; - const Real l_inv_theta0 = 1.0 / turbChoice.theta_ref; + const Real l_C_k = turbChoice.Ck; + const Real l_C_e = turbChoice.Ce; + const Real l_C_e_wall = turbChoice.Ce_wall; + const Real Ce_lcoeff = amrex::max(0.0, l_C_e - 1.9*l_C_k); #ifdef _OPENMP #pragma omp parallel if (Gpu::notInLaunchRegion()) @@ -174,13 +172,14 @@ void ComputeTurbulentViscosityLES (const MultiFab& Tau11, const MultiFab& Tau22, dtheta_dz = 0.5 * ( cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp) - cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp) )*dzInv; } - Real E = cell_data(i,j,k,RhoKE_comp) / cell_data(i,j,k,Rho_comp); - Real strat = l_abs_g * dtheta_dz * l_inv_theta0; // stratification + Real E = cell_data(i,j,k,RhoKE_comp) / cell_data(i,j,k,Rho_comp); + Real N2 = Brunt_Vaisala_Freq(i, j, k, dzInv, cell_data); + Real N = std::sqrt(N2); // stratification Real length; - if (strat <= eps) { + if (N2 <= eps) { length = DeltaMsf; } else { - length = 0.76 * std::sqrt(E / strat); + length = 0.76 * std::sqrt(E / N); // mixing length should be _reduced_ for stable stratification length = amrex::min(length, DeltaMsf); // following WRF, make sure the mixing length isn't too small