Skip to content

Commit f74d7a6

Browse files
committed
Boundary conditions for SST for rough walls
1 parent 8f0e9b9 commit f74d7a6

File tree

5 files changed

+113
-17
lines changed

5 files changed

+113
-17
lines changed

Common/include/CConfig.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,11 @@ class CConfig {
749749
SST_OPTIONS *SST_Options; /*!< \brief List of modifications/corrections/versions of SST turbulence model.*/
750750
SA_OPTIONS *SA_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
751751
LM_OPTIONS *LM_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
752+
ROUGHSST_OPTIONS *ROUGHSST_Options; /*!< \brief List of modifications/corrections/versions of rough-wall boundary conditions for SST turbulence model.*/
752753
unsigned short nSST_Options; /*!< \brief Number of SST options specified. */
753754
unsigned short nSA_Options; /*!< \brief Number of SA options specified. */
754755
unsigned short nLM_Options; /*!< \brief Number of SA options specified. */
756+
unsigned short nROUGHSST_Options; /*!< \brief Number of rough-wall boundary conditions for SST turbulence model options specified. */
755757
WALL_FUNCTIONS *Kind_WallFunctions; /*!< \brief The kind of wall function to use for the corresponding markers. */
756758
unsigned short **IntInfo_WallFunctions; /*!< \brief Additional integer information for the wall function markers. */
757759
su2double **DoubleInfo_WallFunctions; /*!< \brief Additional double information for the wall function markers. */
@@ -1200,6 +1202,7 @@ class CConfig {
12001202
SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */
12011203
SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */
12021204
LM_ParsedOptions lmParsedOptions; /*!< \brief Additional parameters for the LM transition model. */
1205+
ROUGH_SST_ParsedOptions roughsstParsedOptions; /*!< \brief Additional parameters for the boundary conditions for rough walls for the SST turbulence model. */
12031206
su2double uq_delta_b; /*!< \brief Parameter used to perturb eigenvalues of Reynolds Stress Matrix */
12041207
unsigned short eig_val_comp; /*!< \brief Parameter used to determine type of eigenvalue perturbation */
12051208
su2double uq_urlx; /*!< \brief Under-relaxation factor */
@@ -9938,6 +9941,11 @@ class CConfig {
99389941
*/
99399942
LM_ParsedOptions GetLMParsedOptions() const { return lmParsedOptions; }
99409943

9944+
/*!
9945+
* \brief Get parsed rough-wall boundary conditions for SST option data structure.
9946+
* \return Rough-wall SST option data structure.
9947+
*/
9948+
ROUGH_SST_ParsedOptions GetROUGHSSTParsedOptions() const { return roughsstParsedOptions; }
99419949

99429950
/*!
99439951
* \brief Get parsed option data structure for data-driven fluid model.

Common/include/option_structure.hpp

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,59 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
11011101
return SSTParsedOptions;
11021102
}
11031103

1104+
/*!
1105+
* \brief SST rough-wall boundary conditions Options
1106+
*/
1107+
enum class ROUGHSST_OPTIONS {
1108+
NONE, /*!< \brief No option / default. */
1109+
WILCOX1998, /*!< \brief Wilcox 1998 boundary conditions for rough walls / default. */
1110+
WILCOX2006, /*!< \brief Wilcox 2006 boundary conditions for rough walls. */
1111+
LIMITER_KNOPP, /*!< \brief Knopp eddy viscosity limiter. */
1112+
LIMITER_AUPOIX, /*!< \brief Aupoix eddy viscosity limiter. */
1113+
};
1114+
static const MapType<std::string, ROUGHSST_OPTIONS> ROUGHSST_Options_Map = {
1115+
MakePair("NONE", ROUGHSST_OPTIONS::NONE)
1116+
MakePair("WILCOX1998", ROUGHSST_OPTIONS::WILCOX1998)
1117+
MakePair("WILCOX2006", ROUGHSST_OPTIONS::WILCOX2006)
1118+
MakePair("LIMITER_KNOPP", ROUGHSST_OPTIONS::LIMITER_KNOPP)
1119+
MakePair("LIMITER_AUPOIX", ROUGHSST_OPTIONS::LIMITER_AUPOIX)
1120+
};
1121+
1122+
/*!
1123+
* \brief Structure containing parsed SST rough-wall boundary conditions options.
1124+
*/
1125+
struct ROUGH_SST_ParsedOptions {
1126+
ROUGHSST_OPTIONS version = ROUGHSST_OPTIONS::NONE; /*!< \brief KWBC base model. */
1127+
bool wilcox1998 = false; /*!< \brief Use Wilcox boundary conditions for rough walls (1998). */
1128+
bool wilcox2006 = false; /*!< \brief Use Wilcox boundary conditions for rough walls (2006). */
1129+
bool limiter_knopp = false; /*!< \brief Use Knopp eddy viscosity limiter. */
1130+
bool limiter_aupoix = false; /*!< \brief Use Aupoix eddy viscosity limiter. */
1131+
};
1132+
1133+
/*!
1134+
* \brief Function to parse SST rough-wall boundary conditions options.
1135+
* \param[in] ROUGHSST_Options - Selected SST rough-wall boundary conditions option from config.
1136+
* \param[in] nROUGHSST_Options - Number of options selected.
1137+
* \param[in] rank - MPI rank.
1138+
* \return Struct with SA options.
1139+
*/
1140+
inline ROUGH_SST_ParsedOptions ParseROUGHSSTOptions(const ROUGHSST_OPTIONS *ROUGHSST_Options, unsigned short nROUGHSST_Options, int rank) {
1141+
ROUGH_SST_ParsedOptions ROUGHSSTParsedOptions;
1142+
1143+
auto IsPresent = [&](ROUGHSST_OPTIONS option) {
1144+
const auto roughsst_options_end = ROUGHSST_Options + nROUGHSST_Options;
1145+
return std::find(ROUGHSST_Options, roughsst_options_end, option) != roughsst_options_end;
1146+
};
1147+
1148+
ROUGHSSTParsedOptions.wilcox2006 = IsPresent(ROUGHSST_OPTIONS::WILCOX2006);
1149+
ROUGHSSTParsedOptions.limiter_knopp = IsPresent(ROUGHSST_OPTIONS::LIMITER_KNOPP);
1150+
ROUGHSSTParsedOptions.limiter_aupoix = IsPresent(ROUGHSST_OPTIONS::LIMITER_AUPOIX);
1151+
1152+
1153+
return ROUGHSSTParsedOptions;
1154+
}
1155+
1156+
11041157
/*!
11051158
* \brief SA Options
11061159
*/

Common/src/CConfig.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,9 @@ void CConfig::SetConfig_Options() {
11291129
addEnumListOption("SST_OPTIONS", nSST_Options, SST_Options, SST_Options_Map);
11301130
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
11311131
addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map);
1132-
1132+
1133+
/*!\brief ROUGHSST_OPTIONS \n DESCRIPTION: Specify type of boundary condition for rough walls for SST turbulence model. \n Options: see \link ROUGHSST_Options_Map \endlink \n DEFAULT: wilcox1998 \ingroup Config*/
1134+
addEnumListOption("ROUGHSST_OPTIONS", nROUGHSST_Options, ROUGHSST_Options, ROUGHSST_Options_Map);
11331135
/*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/
11341136
addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE);
11351137
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
@@ -3555,6 +3557,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
35553557
/*--- Postprocess SST_OPTIONS into structure. ---*/
35563558
if (Kind_Turb_Model == TURB_MODEL::SST) {
35573559
sstParsedOptions = ParseSSTOptions(SST_Options, nSST_Options, rank);
3560+
roughsstParsedOptions = ParseROUGHSSTOptions(ROUGHSST_Options, nROUGHSST_Options, rank);
35583561
} else if (Kind_Turb_Model == TURB_MODEL::SA) {
35593562
saParsedOptions = ParseSAOptions(SA_Options, nSA_Options, rank);
35603563
}

SU2_CFD/include/solvers/CTurbSSTSolver.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class CTurbSSTSolver final : public CTurbSolver {
3939
private:
4040
su2double constants[11] = {0.0}; /*!< \brief Constants for the model. */
4141
SST_ParsedOptions sstParsedOptions;
42+
ROUGH_SST_ParsedOptions roughsstParsedOptions;
4243

4344
/*!
4445
* \brief Compute nu tilde from the wall functions.

SU2_CFD/src/solvers/CTurbSSTSolver.cpp

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont
426426
/*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/
427427
if (geometry->nodes->GetDomain(iPoint)) {
428428

429+
/*--- distance to closest neighbor ---*/
430+
su2double wall_dist = geometry->vertex[val_marker][iVertex]->GetNearestNeighborDistance();
431+
429432
if (rough_wall) {
430433

431434
/*--- Set wall values ---*/
@@ -441,33 +444,61 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont
441444
su2double kPlus = FrictionVel*Roughness_Height*density/laminar_viscosity;
442445

443446
su2double S_R= 0.0;
447+
448+
su2double solution[2];
449+
/*--- Modify the omega and k to account for a rough wall. ---*/
450+
444451
/*--- Reference 1 original Wilcox (1998) ---*/
445-
/*if (kPlus <= 25)
452+
if (roughsstParsedOptions.wilcox1998) {
453+
if (kPlus <= 25)
446454
S_R = (50/(kPlus+EPS))*(50/(kPlus+EPS));
447455
else
448-
S_R = 100/(kPlus+EPS);*/
449-
456+
S_R = 100/(kPlus+EPS);
457+
458+
solution[0] = 0.0;
459+
solution[1] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
460+
}
461+
else if (roughsstParsedOptions.wilcox2006) {
450462
/*--- Reference 2 from D.C. Wilcox Turbulence Modeling for CFD (2006) ---*/
451-
if (kPlus <= 5)
452-
S_R = (200/(kPlus+EPS))*(200/(kPlus+EPS));
453-
else
454-
S_R = 100/(kPlus+EPS) + ((200/(kPlus+EPS))*(200/(kPlus+EPS)) - 100/(kPlus+EPS))*exp(5-kPlus);
455-
456-
/*--- Modify the omega to account for a rough wall. ---*/
457-
su2double solution[2];
458-
solution[0] = 0.0;
459-
solution[1] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
463+
if (kPlus <= 5)
464+
S_R = (200/(kPlus+EPS))*(200/(kPlus+EPS));
465+
else
466+
S_R = 100/(kPlus+EPS) + ((200/(kPlus+EPS))*(200/(kPlus+EPS)) - 100/(kPlus+EPS))*exp(5-kPlus);
467+
468+
solution[0] = 0.0;
469+
solution[1] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
470+
}
471+
/*--- Knopp eddy viscosity limiter ---*/
472+
else if (roughsstParsedOptions.limiter_knopp) {
473+
474+
su2double d0 = 0.03*Roughness_Height*min(1.0, pow((kPlus + EPS )/30.0, 2.0/3.0))*min(1.0, pow((kPlus + EPS)/45.0, 0.25))*min(1.0, pow((kPlus + EPS) /60, 0.25));
475+
solution[0] = (FrictionVel*FrictionVel / sqrt(constants[6]))*min(1.0, kPlus / 90.0);
476+
477+
const su2double kappa = config->GetwallModel_Kappa();
478+
su2double beta_1 = constants[4];
479+
solution[1] = min( FrictionVel/(sqrt(constants[6])*d0*kappa), 60.0*laminar_viscosity/(density*beta_1*pow(wall_dist,2)));
480+
}
481+
/*--- Aupoix eddy viscosity limiter ---*/
482+
else if (roughsstParsedOptions.limiter_aupoix) {
483+
484+
su2double k0Plus = ( 1.0 /sqrt( constants[6])) * tanh(((log((kPlus +EPS ) / 30.0) / log(10.0)) + 1.0 - 1.0*tanh( (kPlus + EPS) / 125.0))*tanh((kPlus + EPS) / 125.0));
485+
su2double kwallPlus = max(0.0, k0Plus);
486+
su2double kwall = kwallPlus*FrictionVel*FrictionVel;
487+
488+
su2double omegawallPlus = (300.0 / pow(kPlus + EPS, 2.0)) * pow(tanh(15.0 / (4.0*kPlus)), -1.0) + (191.0 / (kPlus + EPS))*(1.0 - exp(-kPlus / 250.0));
489+
490+
solution[0] = kwall;
491+
solution[1] = omegawallPlus*FrictionVel*FrictionVel*density/laminar_viscosity;
492+
493+
}
460494

461495
/*--- Set the solution values and zero the residual ---*/
462496
nodes->SetSolution_Old(iPoint,solution);
463497
nodes->SetSolution(iPoint,solution);
464498
LinSysRes.SetBlock_Zero(iPoint);
465-
499+
466500
} else { // smooth wall
467501

468-
/*--- distance to closest neighbor ---*/
469-
su2double wall_dist = geometry->vertex[val_marker][iVertex]->GetNearestNeighborDistance();
470-
471502
/*--- Set wall values ---*/
472503
su2double density = solver_container[FLOW_SOL]->GetNodes()->GetDensity(iPoint);
473504
su2double laminar_viscosity = solver_container[FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint);

0 commit comments

Comments
 (0)