Skip to content

Commit

Permalink
Fix bug in SFS calculation of dynamic Smagorinsky (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Sep 23, 2024
1 parent 9c33a6f commit 16b0cca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Source/LES.H
Original file line number Diff line number Diff line change
Expand Up @@ -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<amrex::Real>(dir == 0);
const amrex::Real sigmady =
coeff(iv, comp_Cs2) * alphaij(iv, 1) -
coeff(iv, comp_CI) * alpha(iv) / 3.0 * static_cast<amrex::Real>(dir == 1);
const amrex::Real sigmadz =
coeff(iv, comp_Cs2) * alphaij(iv, 2) -
coeff(iv, comp_CI) * alpha(iv) / 3.0 * static_cast<amrex::Real>(dir == 2);
flx(iv, UMX) = -sigmadx;
flx(iv, UMY) = -sigmady;
flx(iv, UMZ) = -sigmadz;
Expand Down

0 comments on commit 16b0cca

Please sign in to comment.