From 16b0cca875584c1669614d9ef8d831fc5fcb1ecd Mon Sep 17 00:00:00 2001 From: "Marc T. Henry de Frahan" Date: Mon, 23 Sep 2024 12:18:16 -0600 Subject: [PATCH] Fix bug in SFS calculation of dynamic Smagorinsky (#849) --- Source/LES.H | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/LES.H b/Source/LES.H index 686c83621..cf7b8fb20 100644 --- a/Source/LES.H +++ b/Source/LES.H @@ -484,9 +484,14 @@ pc_dynamic_smagorinsky_sfs_term( // SFS stress const amrex::Real sigmadx = - coeff(iv, comp_Cs2) * alphaij(iv, 0) - coeff(iv, comp_CI) * alpha(iv) / 3.0; - const amrex::Real sigmady = coeff(iv, comp_Cs2) * alphaij(iv, 1); - const amrex::Real sigmadz = coeff(iv, comp_Cs2) * alphaij(iv, 2); + coeff(iv, comp_Cs2) * alphaij(iv, 0) - + coeff(iv, comp_CI) * alpha(iv) / 3.0 * static_cast(dir == 0); + const amrex::Real sigmady = + coeff(iv, comp_Cs2) * alphaij(iv, 1) - + coeff(iv, comp_CI) * alpha(iv) / 3.0 * static_cast(dir == 1); + const amrex::Real sigmadz = + coeff(iv, comp_Cs2) * alphaij(iv, 2) - + coeff(iv, comp_CI) * alpha(iv) / 3.0 * static_cast(dir == 2); flx(iv, UMX) = -sigmadx; flx(iv, UMY) = -sigmady; flx(iv, UMZ) = -sigmadz;