Skip to content

Commit

Permalink
Merge branch 'develop' into supersonic_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarruscag authored Aug 5, 2024
2 parents fbc8a9d + 476acd3 commit 8aede98
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 9 deletions.
14 changes: 14 additions & 0 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,8 @@ class CConfig {
ReThetaT_FreeStream, /*!< \brief Freestream Transition Momentum Thickness Reynolds Number (for LM transition model) of the fluid. */
NuFactor_FreeStream, /*!< \brief Ratio of turbulent to laminar viscosity. */
NuFactor_Engine, /*!< \brief Ratio of turbulent to laminar viscosity at the engine. */
KFactor_LowerLimit, /*!< \Non dimensional coefficient for lower limit of K in SST model. */
OmegaFactor_LowerLimit, /*!< \Non dimensional coefficient for lower limit of omega in SST model. */
SecondaryFlow_ActDisk, /*!< \brief Ratio of turbulent to laminar viscosity at the actuator disk. */
Initial_BCThrust, /*!< \brief Ratio of turbulent to laminar viscosity at the actuator disk. */
Pressure_FreeStream, /*!< \brief Total pressure of the fluid. */
Expand Down Expand Up @@ -2008,6 +2010,18 @@ class CConfig {
*/
su2double GetNuFactor_FreeStream(void) const { return NuFactor_FreeStream; }

/*!
* \brief Get the k constant factor define a lower limit by multiplication with values in SST turbulence model.
* \return Non-dimensionalized freestream intensity.
*/
su2double GetKFactor_LowerLimit(void) const { return KFactor_LowerLimit; }

/*!
* \brief Get the w constant factor define a lower limit by multiplication with values in SST turbulencemodel.
* \return Non-dimensionalized freestream intensity.
*/
su2double GetOmegaFactor_LowerLimit(void) const { return OmegaFactor_LowerLimit; }

/*!
* \brief Get the value of the non-dimensionalized engine turbulence intensity.
* \return Non-dimensionalized engine intensity.
Expand Down
6 changes: 6 additions & 0 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ enum class SST_OPTIONS {
UQ, /*!< \brief Menter k-w SST model with uncertainty quantification modifications. */
COMP_Wilcox, /*!< \brief Menter k-w SST model with Compressibility correction of Wilcox. */
COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */
DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */
};
static const MapType<std::string, SST_OPTIONS> SST_Options_Map = {
MakePair("NONE", SST_OPTIONS::NONE)
Expand All @@ -1006,6 +1007,7 @@ static const MapType<std::string, SST_OPTIONS> SST_Options_Map = {
MakePair("UQ", SST_OPTIONS::UQ)
MakePair("COMPRESSIBILITY-WILCOX", SST_OPTIONS::COMP_Wilcox)
MakePair("COMPRESSIBILITY-SARKAR", SST_OPTIONS::COMP_Sarkar)
MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL)
};

/*!
Expand All @@ -1019,6 +1021,7 @@ struct SST_ParsedOptions {
bool modified = false; /*!< \brief Bool for modified (m) SST model. */
bool compWilcox = false; /*!< \brief Bool for compressibility correction of Wilcox. */
bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */
bool dll = false; /*!< \brief Bool dimensionless lower limit. */
};

/*!
Expand Down Expand Up @@ -1056,6 +1059,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
const bool sst_uq = IsPresent(SST_OPTIONS::UQ);
const bool sst_compWilcox = IsPresent(SST_OPTIONS::COMP_Wilcox);
const bool sst_compSarkar = IsPresent(SST_OPTIONS::COMP_Sarkar);
const bool sst_dll = IsPresent(SST_OPTIONS::DLL);

if (sst_1994 && sst_2003) {
SU2_MPI::Error("Two versions (1994 and 2003) selected for SST_OPTIONS. Please choose only one.", CURRENT_FUNCTION);
Expand Down Expand Up @@ -1090,6 +1094,8 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
SSTParsedOptions.uq = sst_uq;
SSTParsedOptions.compWilcox = sst_compWilcox;
SSTParsedOptions.compSarkar = sst_compSarkar;
SSTParsedOptions.dll = sst_dll;

return SSTParsedOptions;
}

Expand Down
13 changes: 12 additions & 1 deletion Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,10 @@ void CConfig::SetConfig_Options() {
/* DESCRIPTION: */
addDoubleOption("FREESTREAM_NU_FACTOR", NuFactor_FreeStream, 3.0);
/* DESCRIPTION: */
addDoubleOption("LOWER_LIMIT_K_FACTOR", KFactor_LowerLimit, 1.0e-15);
/* DESCRIPTION: */
addDoubleOption("LOWER_LIMIT_OMEGA_FACTOR", OmegaFactor_LowerLimit, 1e-05);
/* DESCRIPTION: */
addDoubleOption("ENGINE_NU_FACTOR", NuFactor_Engine, 3.0);
/* DESCRIPTION: */
addDoubleOption("ACTDISK_SECONDARY_FLOW", SecondaryFlow_ActDisk, 0.0);
Expand Down Expand Up @@ -6165,7 +6169,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
if (sstParsedOptions.version == SST_OPTIONS::V1994) cout << "-1994";
else cout << "-2003";
if (sstParsedOptions.modified) cout << "m";
if (sstParsedOptions.sust) cout << " with sustaining terms, and";
if (sstParsedOptions.sust) cout << " with sustaining terms,";

switch (sstParsedOptions.production) {
case SST_OPTIONS::KL:
Expand All @@ -6188,6 +6192,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
cout << " with no production modification";
break;
}

if (sstParsedOptions.dll){
cout << "\nusing non dimensional lower limits relative to infinity values clipping by Coefficients:" ;
cout << " C_w= " << OmegaFactor_LowerLimit << " and C_k= " <<KFactor_LowerLimit ;
}
else cout << "\nusing default hard coded lower limit clipping";

cout << "." << endl;
break;
}
Expand Down
23 changes: 16 additions & 7 deletions SU2_CFD/src/solvers/CTurbSSTSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh
constants[5] = 0.0828; //beta_2
constants[6] = 0.09; //betaStar
constants[7] = 0.31; //a1

if (sstParsedOptions.version == SST_OPTIONS::V1994){
constants[8] = constants[4]/constants[6] - constants[2]*0.41*0.41/sqrt(constants[6]); //alfa_1
constants[9] = constants[5]/constants[6] - constants[3]*0.41*0.41/sqrt(constants[6]); //alfa_2
Expand All @@ -108,12 +107,6 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh
constants[9] = 0.44; //gamma_2
constants[10] = 10.0; // production limiter constant
}
/*--- Initialize lower and upper limits---*/
lowerlimit[0] = 1.0e-10;
upperlimit[0] = 1.0e10;

lowerlimit[1] = 1.0e-4;
upperlimit[1] = 1.0e15;

/*--- Far-field flow state quantities and initialization. ---*/
su2double rhoInf, *VelInf, muLamInf, Intensity, viscRatio, muT_Inf;
Expand All @@ -132,6 +125,22 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh
Solution_Inf[0] = kine_Inf;
Solution_Inf[1] = omega_Inf;

/*--- Constants to use for lower limit of turbulence variable. ---*/
su2double Ck = config->GetKFactor_LowerLimit();
su2double Cw = config->GetOmegaFactor_LowerLimit();

/*--- Initialize lower and upper limits. ---*/
if (sstParsedOptions.dll) {
lowerlimit[0] = Ck * kine_Inf;
lowerlimit[1] = Cw * omega_Inf;
} else {
lowerlimit[0] = 1.0e-10;
lowerlimit[1] = 1.0e-4;
}

upperlimit[0] = 1.0e10;
upperlimit[1] = 1.0e15;

/*--- Eddy viscosity, initialized without stress limiter at the infinity ---*/
muT_Inf = rhoInf*kine_Inf/omega_Inf;

Expand Down
6 changes: 5 additions & 1 deletion config_template.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SOLVER= EULER
% Specify turbulence model (NONE, SA, SST)
KIND_TURB_MODEL= NONE
%
% Specify versions/corrections of the SST model (V2003m, V1994m, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR)
% Specify versions/corrections of the SST model (V2003m, V1994m, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT)
SST_OPTIONS= NONE
%
% Specify versions/corrections of the SA model (NEGATIVE, EDWARDS, WITHFT2, QCR2000, COMPRESSIBILITY, ROTATION, BCM, EXPERIMENTAL)
Expand Down Expand Up @@ -1801,6 +1801,10 @@ TIME_DISCRE_TURB= EULER_IMPLICIT
% Reduction factor of the CFL coefficient in the turbulence problem
CFL_REDUCTION_TURB= 1.0
% Control lower limit constants of the SST model (C*phi_infinity)
LOWER_LIMIT_K_FACTOR= 1e-15
LOWER_LIMIT_OMEGA_FACTOR= 1e-5
% --------------------- HEAT NUMERICAL METHOD DEFINITION ----------------------%
%
% Value of the thermal diffusivity
Expand Down

0 comments on commit 8aede98

Please sign in to comment.