Skip to content

Commit

Permalink
removed some comments throughout the codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bumseok Lee committed Sep 9, 2024
1 parent 814a239 commit 7b2d06e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 44 deletions.
2 changes: 1 addition & 1 deletion include/ShearStressTransportEquationSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ShearStressTransportEquationSystem : public EquationSystem

const double tkeMinValue_{1.0e-8};
const double sdrMinValue_{1.0e-8};
const double gammaMinValue_{0.02}; // 1/ce2=1/50=0.02
const double gammaMinValue_{0.02};
const double gammaMaxValue_{1.0};
};

Expand Down
1 change: 0 additions & 1 deletion src/SpecificDissipationRateEquationSystem.C
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include <node_kernels/ScalarGclNodeKernel.h>
#include <node_kernels/SDRKONodeKernel.h>

// Transition model
#include <node_kernels/SDRSSTBLTM2015NodeKernel.h>

// ngp
Expand Down
1 change: 0 additions & 1 deletion src/TurbKineticEnergyEquationSystem.C
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
#include <node_kernels/TKERodiNodeKernel.h>
#include <node_kernels/TKEKONodeKernel.h>

// Transition
#include <node_kernels/TKESSTBLTM2015NodeKernel.h>

// ngp
Expand Down
27 changes: 7 additions & 20 deletions src/node_kernels/BLTGammaM2015NodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,12 @@ BLTGammaM2015NodeKernel::execute(
sijMag = stk::math::sqrt(2.0 * sijMag);
vortMag = stk::math::sqrt(2.0 * vortMag);

// Computation of the turbulence intensity
// The original formulation computes the local turbulence intensity using the local values of k, omega, and wall distance in the boundary layer.
// This approach has accuracy issues with a coarse grid. On the other hand, a constant turbulence intensity, which is mainly used in transition models
// with the S-A turbulence model, gives more robust and accurate results.
// Strictly speaking, however, a constant turbulence intensity is only valid for external flow simulations without any downwash
// (e.g., airfoils or single turbines). The validation of each approach is completed.
// Options for the selection of turbulence intensity computations will be implemented.

//========= local turbulence intensity: original formualtion ========
// local Tu
//TuL = stk::math::min(100.0 * stk::math::sqrt(2.0/3.0*tke) / sdr / (minD + 1.0e-10), 100.0);
//====== freestream turbulence intensity from Nalu-Wind input ======

// constant Tu from input
TuL = fsti_;
//===================================================================

lamda0L = -7.57e-3 * dvnn * minD * minD * density / visc + 0.0128;
lamda0L = stk::math::min(stk::math::max(lamda0L, -1.0), 1.0);
Re0c = Ctu1 + Ctu2 * stk::math::exp(-Ctu3 * TuL * FPG(lamda0L));
Expand All @@ -170,10 +163,7 @@ BLTGammaM2015NodeKernel::execute(
DblType Dgamma =
caTwo * density * vortMag * fturb * gamint * (ceTwo * gamint - 1.0);

////========================== Exact Jacobian ================================//
// Exact Jacobian has unphysical negative intermittecy issues, resulting in convergence stall.
// Instead of the exact Jacobian, the positivity is applied in the implicit operator
////==========================================================================//
//// Exact Jacobian
// DblType PgammaDir =
// flength * density * sijMag * fonset * (1.0 - 2.0 * gamint);
// DblType DgammaDir =
Expand All @@ -182,10 +172,7 @@ BLTGammaM2015NodeKernel::execute(
// rhs(0) += (Pgamma - Dgamma) * dVol;
// lhs(0, 0) += (DgammaDir - PgammaDir) * dVol;

//========= Jacobian with the Positivity in the implicit operator =============//
// The original idea by Spalart and Allmaras (1992) for the S-A turbulence model.
// The approach adpated by Lee (2021)
////==========================================================================//
//// Jacobian with the Positivity in the implicit operator
DblType PgammaDir =
flength * density * sijMag * fonset * (1.0 - gamint);
DblType PgammaDirP =
Expand All @@ -201,7 +188,7 @@ BLTGammaM2015NodeKernel::execute(

rhs(0) += (Pgamma - Dgamma) * dVol;
lhs(0, 0) += (gamma_pos1 + gamma_pos2*gamint) * dVol;
//==============================================================--=============//
//

}

Expand Down
25 changes: 4 additions & 21 deletions src/node_kernels/SDRSSTBLTM2015NodeKernel.C
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,8 @@ SDRSSTBLTM2015NodeKernel::execute(

DblType Pk = 0.0;
DblType crossDiff = 0.0;
//================= original model w/o transition ================//
// for (int i = 0; i < nDim_; ++i) {
// crossDiff += dkdx_.get(node, i) * dwdx_.get(node, i);
// const int offset = nDim_ * i;
// for (int j = 0; j < nDim_; ++j) {
// const auto dudxij = dudx_.get(node, offset + j);
// Pk += dudxij * (dudxij + dudx_.get(node, j * nDim_ + i));
// }
// }
// Pk *= tvisc;
//
// const DblType Dk = betaStar_ * density * sdr * tke;
//
// // Clip production term and clip negative productions
// Pk = stk::math::min(tkeProdLimitRatio_ * Dk, stk::math::max(Pk, 0.0));
//
//==================Transition model============================//

// Transition model
DblType sijMag = 0.0;
DblType vortMag = 0.0;

Expand All @@ -125,9 +110,8 @@ SDRSSTBLTM2015NodeKernel::execute(
sijMag = stk::math::sqrt(2.0*sijMag);
vortMag = stk::math::sqrt(2.0*vortMag);

Pk = tvisc * sijMag * vortMag; // Pk based on Kato-Launder formulation.

//===============================================================//
// Pk based on Kato-Launder formulation
Pk = tvisc * sijMag * vortMag;

// Blend constants for SDR
const DblType omf1 = (1.0 - fOneBlend);
Expand Down Expand Up @@ -165,7 +149,6 @@ SDRSSTBLTM2015NodeKernel::execute(
gammaOne_apply = gammaOne_;
gammaTwo_apply = gammaTwo_;
}
//const DblType gamma = fOneBlend * gammaOne_apply + omf1 * gammaTwo_apply;

// Production term with appropriate clipping of tvisc
const DblType Pw = gamma * density * Pk / stk::math::max(tvisc, 1.0e-16);
Expand Down

0 comments on commit 7b2d06e

Please sign in to comment.