From a2829520498b9d6a9321afe3475cfbf9dcc7b86d Mon Sep 17 00:00:00 2001 From: Bumseok Lee Date: Mon, 9 Sep 2024 14:51:16 -0600 Subject: [PATCH] add const2 --- src/node_kernels/SDRSSTBLTM2015NodeKernel.C | 3 +-- src/node_kernels/TKESSTBLTM2015NodeKernel.C | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/node_kernels/SDRSSTBLTM2015NodeKernel.C b/src/node_kernels/SDRSSTBLTM2015NodeKernel.C index 9379b6474..b2ce0c3bd 100644 --- a/src/node_kernels/SDRSSTBLTM2015NodeKernel.C +++ b/src/node_kernels/SDRSSTBLTM2015NodeKernel.C @@ -88,7 +88,6 @@ SDRSSTBLTM2015NodeKernel::execute( const DblType dVol = dualNodalVolume_.get(node, 0); const DblType fOneBlend = fOneBlend_.get(node, 0); - DblType Pk = 0.0; DblType crossDiff = 0.0; DblType sijMag = 0.0; @@ -111,7 +110,7 @@ SDRSSTBLTM2015NodeKernel::execute( vortMag = stk::math::sqrt(2.0 * vortMag); // Pk based on Kato-Launder formulation - Pk = tvisc * sijMag * vortMag; + const DblType Pk = tvisc * sijMag * vortMag; // Blend constants for SDR const DblType omf1 = (1.0 - fOneBlend); diff --git a/src/node_kernels/TKESSTBLTM2015NodeKernel.C b/src/node_kernels/TKESSTBLTM2015NodeKernel.C index f15e92754..48ca3d3a3 100644 --- a/src/node_kernels/TKESSTBLTM2015NodeKernel.C +++ b/src/node_kernels/TKESSTBLTM2015NodeKernel.C @@ -82,11 +82,9 @@ TKESSTBLTM2015NodeKernel::execute( const DblType CSEP = 1.0; const DblType Retclim = 1100.0; - DblType Pklim = 0.0; DblType sijMag = 1.0e-16; DblType vortMag = 1.0e-16; - DblType Pk = 0.0; for (int i = 0; i < nDim_; ++i) { // const int offset = nDim_ * i; for (int j = 0; j < nDim_; ++j) { @@ -105,13 +103,13 @@ TKESSTBLTM2015NodeKernel::execute( sijMag = stk::math::sqrt(2.0 * sijMag); vortMag = stk::math::sqrt(2.0 * vortMag); - DblType Rev = density * dw * dw * sijMag / visc; - DblType Fonlim = + const DblType Rev = density * dw * dw * sijMag / visc; + const DblType Fonlim = stk::math::min(stk::math::max(Rev / 2.2 / Retclim - 1.0, 0.0), 3.0); // Pk based on Kato-Launder formulation - Pk = gamint * tvisc * sijMag * vortMag; - Pklim = 5.0 * Ck_BLT * stk::math::max(gamint - 0.2, 0.0) * (1.0 - gamint) * + const DblType Pk = gamint * tvisc * sijMag * vortMag; + const DblType Pklim = 5.0 * Ck_BLT * stk::math::max(gamint - 0.2, 0.0) * (1.0 - gamint) * Fonlim * stk::math::max(3.0 * CSEP * visc - tvisc, 0.0) * sijMag * vortMag; const DblType Dk =