Skip to content

Commit 5efe817

Browse files
authored
Adding new roughness boundary conditions for SST (#2573)
* Boundary conditions for SST for rough walls * Fix formatting * Fix issues about rough SST BCs formulations * Add SST Limiter Output * Revert SST Limiter Output changes * Switch to regression branch * Fix rough BCs options issues * Added rough flatplate test cases * Fixed values regression test rough flat plate * Fix regression test roughness * Cleaned regression tests for rough flat plate and moved to parallel regression * [skip ci] * Apply suggestions from code review * Apply suggestions from code review * [skip ci] --------- Co-authored-by: Pedro Gomes <[email protected]>
2 parents db6e087 + b3bb7b5 commit 5efe817

File tree

10 files changed

+457
-19
lines changed

10 files changed

+457
-19
lines changed

Common/include/CConfig.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ class CConfig {
763763
SST_OPTIONS *SST_Options; /*!< \brief List of modifications/corrections/versions of SST turbulence model.*/
764764
SA_OPTIONS *SA_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
765765
LM_OPTIONS *LM_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
766+
ROUGHSST_MODEL Kind_RoughSST_Model; /*!< \brief List of modifications/corrections/versions of rough-wall boundary conditions for SST turbulence model.*/
766767
unsigned short nSST_Options; /*!< \brief Number of SST options specified. */
767768
unsigned short nSA_Options; /*!< \brief Number of SA options specified. */
768769
unsigned short nLM_Options; /*!< \brief Number of SA options specified. */
@@ -1226,6 +1227,7 @@ class CConfig {
12261227
SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */
12271228
SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */
12281229
LM_ParsedOptions lmParsedOptions; /*!< \brief Additional parameters for the LM transition model. */
1230+
ROUGH_SST_ParsedOptions roughsstParsedOptions; /*!< \brief Additional parameters for the boundary conditions for rough walls for the SST turbulence model. */
12291231
su2double uq_delta_b; /*!< \brief Parameter used to perturb eigenvalues of Reynolds Stress Matrix */
12301232
unsigned short eig_val_comp; /*!< \brief Parameter used to determine type of eigenvalue perturbation */
12311233
su2double uq_urlx; /*!< \brief Under-relaxation factor */
@@ -10173,6 +10175,11 @@ class CConfig {
1017310175
*/
1017410176
LM_ParsedOptions GetLMParsedOptions() const { return lmParsedOptions; }
1017510177

10178+
/*!
10179+
* \brief Get parsed rough-wall boundary conditions for SST option data structure.
10180+
* \return Rough-wall SST option data structure.
10181+
*/
10182+
ROUGH_SST_ParsedOptions GetROUGHSSTParsedOptions() const { return roughsstParsedOptions; }
1017610183

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

Common/include/option_structure.hpp

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,58 @@ 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_MODEL {
1108+
NONE, /*!< \brief No option / default no surface roughness applied. */
1109+
WILCOX1998, /*!< \brief Wilcox 1998 boundary conditions for rough walls. */
1110+
WILCOX2006, /*!< \brief Wilcox 2006 boundary conditions for rough walls / default version if roughness is applied. */
1111+
LIMITER_KNOPP, /*!< \brief Knopp eddy viscosity limiter. */
1112+
LIMITER_AUPOIX, /*!< \brief Aupoix eddy viscosity limiter. */
1113+
};
1114+
static const MapType<std::string, ROUGHSST_MODEL> RoughSST_Model_Map = {
1115+
MakePair("NONE", ROUGHSST_MODEL::NONE)
1116+
MakePair("WILCOX1998", ROUGHSST_MODEL::WILCOX1998)
1117+
MakePair("WILCOX2006", ROUGHSST_MODEL::WILCOX2006)
1118+
MakePair("LIMITER_KNOPP", ROUGHSST_MODEL::LIMITER_KNOPP)
1119+
MakePair("LIMITER_AUPOIX", ROUGHSST_MODEL::LIMITER_AUPOIX)
1120+
};
1121+
1122+
/*!
1123+
* \brief Structure containing parsed SST rough-wall boundary conditions options.
1124+
*/
1125+
struct ROUGH_SST_ParsedOptions {
1126+
ROUGHSST_MODEL version = ROUGHSST_MODEL::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 SST options.
1139+
*/
1140+
inline ROUGH_SST_ParsedOptions ParseROUGHSSTOptions(ROUGHSST_MODEL sstbcs_option) {
1141+
ROUGH_SST_ParsedOptions opts;
1142+
opts.version = sstbcs_option;
1143+
1144+
switch(sstbcs_option) {
1145+
case ROUGHSST_MODEL::WILCOX1998: opts.wilcox1998 = true; break;
1146+
case ROUGHSST_MODEL::WILCOX2006: opts.wilcox2006 = true; break;
1147+
case ROUGHSST_MODEL::LIMITER_KNOPP: opts.limiter_knopp = true; break;
1148+
case ROUGHSST_MODEL::LIMITER_AUPOIX: opts.limiter_aupoix = true; break;
1149+
default: break;
1150+
}
1151+
1152+
return opts;
1153+
}
1154+
1155+
11041156
/*!
11051157
* \brief SA Options
11061158
*/

Common/src/CConfig.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,8 @@ void CConfig::SetConfig_Options() {
11401140
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
11411141
addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map);
11421142

1143+
/*!\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*/
1144+
addEnumOption("KIND_ROUGHSST_MODEL", Kind_RoughSST_Model, RoughSST_Model_Map, ROUGHSST_MODEL::NONE);
11431145
/*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/
11441146
addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE);
11451147
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
@@ -3598,6 +3600,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
35983600
/*--- Postprocess SST_OPTIONS into structure. ---*/
35993601
if (Kind_Turb_Model == TURB_MODEL::SST) {
36003602
sstParsedOptions = ParseSSTOptions(SST_Options, nSST_Options, rank);
3603+
roughsstParsedOptions = ParseROUGHSSTOptions(Kind_RoughSST_Model);
36013604
} else if (Kind_Turb_Model == TURB_MODEL::SA) {
36023605
saParsedOptions = ParseSAOptions(SA_Options, nSA_Options, rank);
36033606
}

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: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,12 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont
425425

426426
/*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/
427427
if (geometry->nodes->GetDomain(iPoint)) {
428+
const auto options = config->GetROUGHSSTParsedOptions();
428429

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

433+
if (rough_wall) {
431434
/*--- Set wall values ---*/
432435
su2double density = solver_container[FLOW_SOL]->GetNodes()->GetDensity(iPoint);
433436
su2double laminar_viscosity = solver_container[FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint);
@@ -441,33 +444,54 @@ 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+
su2double solution[2] = {};
448+
/*--- Modify the omega and k to account for a rough wall. ---*/
449+
444450
/*--- Reference 1 original Wilcox (1998) ---*/
445-
/*if (kPlus <= 25)
451+
if (options.wilcox1998) {
452+
if (kPlus <= 25)
446453
S_R = (50/(kPlus+EPS))*(50/(kPlus+EPS));
447454
else
448-
S_R = 100/(kPlus+EPS);*/
449-
455+
S_R = 100/(kPlus+EPS);
456+
457+
solution[0] = 0.0;
458+
solution[1] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
459+
}
460+
else if (options.wilcox2006) {
450461
/*--- 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);
460-
462+
if (kPlus <= 5)
463+
S_R = pow(200/(kPlus+EPS),2);
464+
else
465+
S_R = 100/(kPlus+EPS) + (pow(200/(kPlus+EPS),2) - 100/(kPlus+EPS))*exp(5-kPlus);
466+
467+
solution[0] = 0.0;
468+
solution[1] = FrictionVel*FrictionVel*S_R/(laminar_viscosity/density);
469+
}
470+
/*--- Knopp eddy viscosity limiter ---*/
471+
else if (options.limiter_knopp) {
472+
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));
473+
solution[0] = (FrictionVel*FrictionVel / sqrt(constants[6]))*min(1.0, kPlus / 90.0);
474+
475+
const su2double kappa = config->GetwallModel_Kappa();
476+
su2double beta_1 = constants[4];
477+
solution[1] = min( FrictionVel/(sqrt(constants[6])*d0*kappa), 60.0*laminar_viscosity/(density*beta_1*pow(wall_dist,2)));
478+
}
479+
/*--- Aupoix eddy viscosity limiter ---*/
480+
else if (options.limiter_aupoix) {
481+
su2double k0Plus = ( 1.0 /sqrt( constants[6])) * tanh((log10((kPlus +EPS ) / 30.0) + 1.0 - 1.0*tanh( (kPlus + EPS) / 125.0))*tanh((kPlus + EPS) / 125.0));
482+
su2double kwallPlus = max(0.0, k0Plus);
483+
su2double kwall = kwallPlus*FrictionVel*FrictionVel;
484+
485+
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));
486+
487+
solution[0] = kwall;
488+
solution[1] = omegawallPlus*FrictionVel*FrictionVel*density/laminar_viscosity;
489+
}
461490
/*--- Set the solution values and zero the residual ---*/
462491
nodes->SetSolution_Old(iPoint,solution);
463492
nodes->SetSolution(iPoint,solution);
464493
LinSysRes.SetBlock_Zero(iPoint);
465-
466494
} else { // smooth wall
467-
468-
/*--- distance to closest neighbor ---*/
469-
su2double wall_dist = geometry->vertex[val_marker][iVertex]->GetNearestNeighborDistance();
470-
471495
/*--- Set wall values ---*/
472496
su2double density = solver_container[FLOW_SOL]->GetNodes()->GetDensity(iPoint);
473497
su2double laminar_viscosity = solver_container[FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint);

TestCases/parallel_regression.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,22 @@ def main():
408408
turb_flatplate_CC_Sarkar.test_vals = [-1.195053, 2.089306, 1.529063, 5.164703, -3.700917, 8.162921]
409409
test_list.append(turb_flatplate_CC_Sarkar)
410410

411+
# FLAT PLATE, ROUGHNESS BC KNOPP SST
412+
turb_flatplate_sst_roughBCKnopp = TestCase('turb_sst_flatplate_roughBCKnopp')
413+
turb_flatplate_sst_roughBCKnopp.cfg_dir = "rans/flatplate/roughness/bc_knopp"
414+
turb_flatplate_sst_roughBCKnopp.cfg_file = "turb_SST_flatplate_roughBCKnopp.cfg"
415+
turb_flatplate_sst_roughBCKnopp.test_iter = 10
416+
turb_flatplate_sst_roughBCKnopp.test_vals = [-5.058634, -2.460850, -2.847064, 0.447200, -2.595042, 1.497149, -0.188079, 0.004571]
417+
test_list.append(turb_flatplate_sst_roughBCKnopp)
418+
419+
# FLAT PLATE, ROUGHNESS BC AUPOIX SST
420+
turb_flatplate_sst_roughBCAupoix = TestCase('turb_sst_flatplate_roughBCAupoix')
421+
turb_flatplate_sst_roughBCAupoix.cfg_dir = "rans/flatplate/roughness/bc_aupoix"
422+
turb_flatplate_sst_roughBCAupoix.cfg_file = "turb_SST_flatplate_roughBCAupoix.cfg"
423+
turb_flatplate_sst_roughBCAupoix.test_iter = 10
424+
turb_flatplate_sst_roughBCAupoix.test_vals = [-5.278097, -2.297701, -2.883899, 0.228298, -1.375945, 3.209449, -0.188736, 0.007201]
425+
test_list.append(turb_flatplate_sst_roughBCAupoix)
426+
411427
# ONERA M6 Wing
412428
turb_oneram6 = TestCase('turb_oneram6')
413429
turb_oneram6.cfg_dir = "rans/oneram6"
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
% %
3+
% SU2 configuration file %
4+
% Case description: Turbulent flow over rough flat plate with zero pressure gradient %
5+
% Author: Thomas D. Economon %
6+
% Institution: Stanford University %
7+
% Date: 2011.11.10 %
8+
% File Version 8.3.0 "Harrier" %
9+
% %
10+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11+
12+
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
13+
%
14+
SOLVER= RANS
15+
KIND_TURB_MODEL= SST
16+
WALL_ROUGHNESS = (wall, 400e-6)
17+
KIND_ROUGHSST_MODEL = LIMITER_AUPOIX
18+
MATH_PROBLEM= DIRECT
19+
RESTART_SOL= YES
20+
READ_BINARY_RESTART= YES
21+
22+
% ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------%
23+
MACH_NUMBER= 0.2
24+
AOA= 0.0
25+
SIDESLIP_ANGLE= 0.0
26+
FREESTREAM_TEMPERATURE= 300.0
27+
REYNOLDS_NUMBER= 5000000.0
28+
REYNOLDS_LENGTH= 1.0
29+
30+
% ---------------------- REFERENCE VALUE DEFINITION ---------------------------%
31+
%
32+
REF_ORIGIN_MOMENT_X = 0.25
33+
REF_ORIGIN_MOMENT_Y = 0.00
34+
REF_ORIGIN_MOMENT_Z = 0.00
35+
REF_LENGTH= 1.0
36+
REF_AREA= 2.0
37+
38+
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
39+
%
40+
MARKER_HEATFLUX= ( wall, 0.0 )
41+
MARKER_INLET= ( inlet, 302.4, 118309.784, 1.0, 0.0, 0.0 )
42+
MARKER_OUTLET= ( outlet, 115056.0, farfield, 115056.0 )
43+
MARKER_SYM= ( symmetry )
44+
MARKER_PLOTTING= ( wall )
45+
MARKER_MONITORING= ( wall )
46+
47+
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
48+
%
49+
NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES
50+
CFL_NUMBER= 100.0
51+
CFL_ADAPT= YES
52+
CFL_ADAPT_PARAM= ( 0.1, 2.0, 100.0, 1e5 )
53+
RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 )
54+
ITER= 99999
55+
56+
% ----------------------- SLOPE LIMITER DEFINITION ----------------------------%
57+
%
58+
VENKAT_LIMITER_COEFF= 0.1
59+
ADJ_SHARP_LIMITER_COEFF= 3.0
60+
REF_SHARP_EDGES= 3.0
61+
SENS_REMOVE_SHARP= NO
62+
63+
% -------------------------- MULTIGRID PARAMETERS -----------------------------%
64+
%
65+
MGLEVEL= 0
66+
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
67+
%
68+
CONV_NUM_METHOD_FLOW= ROE
69+
%
70+
MUSCL_FLOW= YES
71+
SLOPE_LIMITER_FLOW= NONE
72+
JST_SENSOR_COEFF= ( 0.5, 0.02 )
73+
TIME_DISCRE_FLOW= EULER_IMPLICIT
74+
75+
% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------%
76+
%
77+
78+
CONV_NUM_METHOD_TURB= SCALAR_UPWIND
79+
MUSCL_TURB= NO
80+
SLOPE_LIMITER_TURB= VENKATAKRISHNAN
81+
TIME_DISCRE_TURB= EULER_IMPLICIT
82+
83+
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
84+
%
85+
CONV_FIELD= RMS_DENSITY
86+
CONV_RESIDUAL_MINVAL= -14
87+
CONV_STARTITER= 10
88+
CONV_CAUCHY_ELEMS= 100
89+
CONV_CAUCHY_EPS= 1E-6
90+
%
91+
92+
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
93+
%
94+
MESH_FILENAME= mesh_flatplate_turb_137x97
95+
MESH_FORMAT= SU2
96+
MESH_OUT_FILENAME= mesh_out
97+
SOLUTION_FILENAME= restart_flow
98+
SOLUTION_ADJ_FILENAME= restart_adj
99+
TABULAR_FORMAT= CSV
100+
CONV_FILENAME= history
101+
RESTART_FILENAME= restart_flow
102+
RESTART_ADJ_FILENAME= restart_adj
103+
VOLUME_FILENAME= flow
104+
VOLUME_ADJ_FILENAME= adjoint
105+
GRAD_OBJFUNC_FILENAME= of_grad.dat
106+
SURFACE_FILENAME= surface_flow
107+
SURFACE_ADJ_FILENAME= surface_adjoint
108+
OUTPUT_WRT_FREQ= 1000
109+
SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_RES, LIFT, DRAG)

0 commit comments

Comments
 (0)