Skip to content

Commit ced7ed2

Browse files
author
rois1995
committed
Merge branch 'feature_LM2015_model' of https://github.com/su2code/SU2 into feature_LM2015_model
2 parents df81b0b + b5b8f41 commit ced7ed2

File tree

341 files changed

+886
-35278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

341 files changed

+886
-35278
lines changed

Common/include/CConfig.hpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ class CConfig {
194194
nMarker_Inlet, /*!< \brief Number of inlet flow markers. */
195195
nMarker_Inlet_Species, /*!< \brief Number of inlet species markers. */
196196
nSpecies_per_Inlet, /*!< \brief Number of species defined per inlet markers. */
197+
nMarker_Inlet_Turb, /*!< \brief Number of inlet turbulent markers. */
198+
nTurb_Properties, /*!< \brief Number of turbulent properties per inlet markers. */
197199
nMarker_Riemann, /*!< \brief Number of Riemann flow markers. */
198200
nMarker_Giles, /*!< \brief Number of Giles flow markers. */
199201
nRelaxFactor_Giles, /*!< \brief Number of relaxation factors for Giles markers. */
@@ -244,6 +246,7 @@ class CConfig {
244246
*Marker_ActDiskOutlet, /*!< \brief Actuator disk outlet markers. */
245247
*Marker_Inlet, /*!< \brief Inlet flow markers. */
246248
*Marker_Inlet_Species, /*!< \brief Inlet species markers. */
249+
*Marker_Inlet_Turb, /*!< \brief Inlet turbulent markers. */
247250
*Marker_Riemann, /*!< \brief Riemann markers. */
248251
*Marker_Giles, /*!< \brief Giles markers. */
249252
*Marker_Shroud, /*!< \brief Shroud markers. */
@@ -283,6 +286,7 @@ class CConfig {
283286
su2double **Inlet_Velocity; /*!< \brief Specified flow velocity vectors for supersonic inlet boundaries. */
284287
su2double **Inlet_MassFrac; /*!< \brief Specified Mass fraction vectors for supersonic inlet boundaries (NEMO solver). */
285288
su2double **Inlet_SpeciesVal; /*!< \brief Specified species vector for inlet boundaries. */
289+
su2double **Inlet_TurbVal; /*!< \brief Specified turbulent intensity and viscosity ratio for inlet boundaries. */
286290
su2double *EngineInflow_Target; /*!< \brief Specified fan face targets for nacelle boundaries. */
287291
su2double *Inflow_Mach; /*!< \brief Specified fan face mach for nacelle boundaries. */
288292
su2double *Inflow_Pressure; /*!< \brief Specified fan face pressure for nacelle boundaries. */
@@ -852,6 +856,7 @@ class CConfig {
852856
array<su2double, N_POLY_COEFFS> CpPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for specific heat Cp. */
853857
array<su2double, N_POLY_COEFFS> MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */
854858
array<su2double, N_POLY_COEFFS> KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */
859+
su2double TurbIntensityAndViscRatioFreeStream[2]; /*!< \brief Freestream turbulent intensity and viscosity ratio for turbulence and transition models. */
855860
su2double Energy_FreeStream, /*!< \brief Free-stream total energy of the fluid. */
856861
ModVel_FreeStream, /*!< \brief Magnitude of the free-stream velocity of the fluid. */
857862
ModVel_FreeStreamND, /*!< \brief Non-dimensional magnitude of the free-stream velocity of the fluid. */
@@ -860,8 +865,6 @@ class CConfig {
860865
Tke_FreeStream, /*!< \brief Total turbulent kinetic energy of the fluid. */
861866
Intermittency_FreeStream, /*!< \brief Freestream intermittency (for sagt transition model) of the fluid. */
862867
ReThetaT_FreeStream, /*!< \brief Freestream Transition Momentum Thickness Reynolds Number (for LM transition model) of the fluid. */
863-
TurbulenceIntensity_FreeStream, /*!< \brief Freestream turbulent intensity (for sagt transition model) of the fluid. */
864-
Turb2LamViscRatio_FreeStream, /*!< \brief Ratio of turbulent to laminar viscosity. */
865868
NuFactor_FreeStream, /*!< \brief Ratio of turbulent to laminar viscosity. */
866869
NuFactor_Engine, /*!< \brief Ratio of turbulent to laminar viscosity at the engine. */
867870
SecondaryFlow_ActDisk, /*!< \brief Ratio of turbulent to laminar viscosity at the actuator disk. */
@@ -1312,6 +1315,9 @@ class CConfig {
13121315
void addInletSpeciesOption(const string name, unsigned short & nMarker_Inlet_Species, string * & Marker_Inlet_Species,
13131316
su2double** & inlet_species_val, unsigned short & nSpecies_per_Inlet);
13141317

1318+
void addInletTurbOption(const string name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb,
1319+
su2double** & Turb_Properties, unsigned short & nTurb_Properties);
1320+
13151321
template <class Tenum>
13161322
void addRiemannOption(const string name, unsigned short & nMarker_Riemann, string * & Marker_Riemann, unsigned short* & option_field, const map<string, Tenum> & enum_map,
13171323
su2double* & var1, su2double* & var2, su2double** & FlowDir);
@@ -1949,7 +1955,7 @@ class CConfig {
19491955
* \brief Get the value of the non-dimensionalized freestream turbulence intensity.
19501956
* \return Non-dimensionalized freestream intensity.
19511957
*/
1952-
su2double GetTurbulenceIntensity_FreeStream(void) const { return TurbulenceIntensity_FreeStream; }
1958+
su2double GetTurbulenceIntensity_FreeStream(void) const { return TurbIntensityAndViscRatioFreeStream[0]; }
19531959

19541960
/*!
19551961
* \brief Get the value of the non-dimensionalized freestream turbulence intensity.
@@ -1985,7 +1991,7 @@ class CConfig {
19851991
* \brief Get the value of the turbulent to laminar viscosity ratio.
19861992
* \return Ratio of turbulent to laminar viscosity ratio.
19871993
*/
1988-
su2double GetTurb2LamViscRatio_FreeStream(void) const { return Turb2LamViscRatio_FreeStream;}
1994+
su2double GetTurb2LamViscRatio_FreeStream(void) const { return TurbIntensityAndViscRatioFreeStream[1]; }
19891995

19901996
/*!
19911997
* \brief Get the value of the Reynolds length.
@@ -6687,6 +6693,13 @@ class CConfig {
66876693
*/
66886694
const su2double* GetInlet_SpeciesVal(string val_index) const;
66896695

6696+
/*!
6697+
* \brief Get the turbulent properties values at an inlet boundary
6698+
* \param[in] val_index - Index corresponding to the inlet boundary.
6699+
* \return The inlet turbulent values.
6700+
*/
6701+
const su2double* GetInlet_TurbVal(string val_index) const;
6702+
66906703
/*!
66916704
* \brief Get the total pressure at an nacelle boundary.
66926705
* \param[in] val_index - Index corresponding to the inlet boundary.

Common/src/CConfig.cpp

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,15 @@ void CConfig::addInletSpeciesOption(const string name, unsigned short & nMarker_
493493
option_map.insert(pair<string, COptionBase *>(name, val));
494494
}
495495

496+
void CConfig::addInletTurbOption(const string name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb,
497+
su2double**& Turb_Properties_val, unsigned short& nTurb_Properties) {
498+
assert(option_map.find(name) == option_map.end());
499+
all_options.insert(pair<string, bool>(name, true));
500+
COptionBase* val = new COptionStringValuesList<su2double*>(name, nMarker_Inlet_Turb, Marker_Inlet_Turb,
501+
Turb_Properties_val, nTurb_Properties);
502+
option_map.insert(pair<string, COptionBase*>(name, val));
503+
}
504+
496505
template <class Tenum>
497506
void CConfig::addRiemannOption(const string name, unsigned short & nMarker_Riemann, string * & Marker_Riemann, unsigned short* & option_field, const map<string, Tenum> & enum_map,
498507
su2double* & var1, su2double* & var2, su2double** & FlowDir) {
@@ -839,7 +848,7 @@ void CConfig::SetPointersNull(void) {
839848

840849
Marker_Euler = nullptr; Marker_FarField = nullptr; Marker_Custom = nullptr;
841850
Marker_SymWall = nullptr; Marker_PerBound = nullptr;
842-
Marker_PerDonor = nullptr; Marker_NearFieldBound = nullptr;
851+
Marker_PerDonor = nullptr; Marker_NearFieldBound = nullptr; Marker_Inlet_Turb = nullptr;
843852
Marker_Deform_Mesh = nullptr; Marker_Deform_Mesh_Sym_Plane= nullptr; Marker_Fluid_Load = nullptr;
844853
Marker_Inlet = nullptr; Marker_Outlet = nullptr; Marker_Inlet_Species = nullptr;
845854
Marker_Supersonic_Inlet = nullptr; Marker_Supersonic_Outlet = nullptr; Marker_Smoluchowski_Maxwell= nullptr;
@@ -866,7 +875,7 @@ void CConfig::SetPointersNull(void) {
866875
Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr;
867876
Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr;
868877
Inlet_Velocity = nullptr;
869-
Outlet_Pressure = nullptr; Inlet_SpeciesVal = nullptr;
878+
Outlet_Pressure = nullptr; Inlet_SpeciesVal = nullptr; Inlet_TurbVal = nullptr;
870879

871880
/*--- Engine Boundary Condition settings ---*/
872881

@@ -1358,7 +1367,7 @@ void CConfig::SetConfig_Options() {
13581367
/* DESCRIPTION: */
13591368
addDoubleOption("FREESTREAM_INTERMITTENCY", Intermittency_FreeStream, 1.0);
13601369
/* DESCRIPTION: */
1361-
addDoubleOption("FREESTREAM_TURBULENCEINTENSITY", TurbulenceIntensity_FreeStream, 0.05);
1370+
addDoubleOption("FREESTREAM_TURBULENCEINTENSITY", TurbIntensityAndViscRatioFreeStream[0], 0.05);
13621371
/* DESCRIPTION: */
13631372
addDoubleOption("FREESTREAM_NU_FACTOR", NuFactor_FreeStream, 3.0);
13641373
/* DESCRIPTION: */
@@ -1368,7 +1377,7 @@ void CConfig::SetConfig_Options() {
13681377
/* DESCRIPTION: */
13691378
addDoubleOption("INITIAL_BCTHRUST", Initial_BCThrust, 4000.0);
13701379
/* DESCRIPTION: */
1371-
addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", Turb2LamViscRatio_FreeStream, 10.0);
1380+
addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0);
13721381
/* DESCRIPTION: Side-slip angle (degrees, only for compressible flows) */
13731382
addDoubleOption("SIDESLIP_ANGLE", AoS, 0.0);
13741383
/*!\brief AOA \n DESCRIPTION: Angle of attack (degrees, only for compressible flows) \ingroup Config*/
@@ -1513,7 +1522,10 @@ void CConfig::SetConfig_Options() {
15131522
/*!\brief MARKER_INLET_SPECIES \n DESCRIPTION: Inlet Species boundary marker(s) with the following format
15141523
Inlet Species: (inlet_marker, Species1, Species2, ..., SpeciesN-1, inlet_marker2, Species1, Species2, ...) */
15151524
addInletSpeciesOption("MARKER_INLET_SPECIES",nMarker_Inlet_Species, Marker_Inlet_Species, Inlet_SpeciesVal, nSpecies_per_Inlet);
1516-
1525+
/*!\brief MARKER_INLET_TURBULENT \n DESCRIPTION: Inlet Turbulence boundary marker(s) with the following format
1526+
Inlet Turbulent: (inlet_marker, TurbulentIntensity1, ViscosityRatio1, inlet_marker2, TurbulentIntensity2,
1527+
ViscosityRatio2, ...) */
1528+
addInletTurbOption("MARKER_INLET_TURBULENT", nMarker_Inlet_Turb, Marker_Inlet_Turb, Inlet_TurbVal, nTurb_Properties);
15171529
/*!\brief MARKER_RIEMANN \n DESCRIPTION: Riemann boundary marker(s) with the following formats, a unit vector.
15181530
* \n OPTIONS: See \link Riemann_Map \endlink. The variables indicated by the option and the flow direction unit vector must be specified. \ingroup Config*/
15191531
addRiemannOption("MARKER_RIEMANN", nMarker_Riemann, Marker_Riemann, Kind_Data_Riemann, Riemann_Map, Riemann_Var1, Riemann_Var2, Riemann_FlowDir);
@@ -4782,7 +4794,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
47824794
SU2_TYPE::SetDerivative(Reynolds, 1.0);
47834795
break;
47844796
case D_TURB2LAM:
4785-
SU2_TYPE::SetDerivative(Turb2LamViscRatio_FreeStream, 1.0);
4797+
SU2_TYPE::SetDerivative(TurbIntensityAndViscRatioFreeStream[1], 1.0);
47864798
break;
47874799
default:
47884800
/*--- All other cases are handled in the specific solver ---*/
@@ -5354,6 +5366,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
53545366
case TURB_FAMILY::KW:
53555367
nTurbVar = 2; break;
53565368
}
5369+
/*--- Check whether the number of entries of the MARKER_INLET_TURBULENT equals the number of turbulent properties
5370+
used for the respective turbulent model. nTurb_Properties must be equal to 1 or 2 depending on whether SA or
5371+
SST model are used.--- */
5372+
if (Marker_Inlet_Turb != nullptr && Kind_Turb_Model == TURB_MODEL::SST && nTurb_Properties != 2)
5373+
SU2_MPI::Error(
5374+
"The use of MARKER_INLET_TURBULENT requires the number of entries when SST Model is used \n"
5375+
"to be equal to 2 : Turbulent intensity and ratio turbulent to laminar viscosity",
5376+
CURRENT_FUNCTION);
53575377

53585378
/*--- Checks for additional species transport. ---*/
53595379
if (Kind_Species_Model == SPECIES_MODEL::SPECIES_TRANSPORT) {
@@ -8841,6 +8861,14 @@ const su2double* CConfig::GetInlet_SpeciesVal(string val_marker) const {
88418861
return Inlet_SpeciesVal[iMarker_Inlet_Species];
88428862
}
88438863

8864+
const su2double* CConfig::GetInlet_TurbVal(string val_marker) const {
8865+
/*--- If Turbulent Inlet is not provided for the marker, return free stream values. ---*/
8866+
for (auto iMarker = 0u; iMarker < nMarker_Inlet_Turb; iMarker++) {
8867+
if (Marker_Inlet_Turb[iMarker] == val_marker) return Inlet_TurbVal[iMarker];
8868+
}
8869+
return TurbIntensityAndViscRatioFreeStream;
8870+
}
8871+
88448872
su2double CConfig::GetOutlet_Pressure(string val_marker) const {
88458873
unsigned short iMarker_Outlet;
88468874
for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++)

SU2_CFD/src/solvers/CTurbSSTSolver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,9 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C
618618
Density_Inlet = FluidModel->GetDensity();
619619
}
620620
const su2double Laminar_Viscosity_Inlet = FluidModel->GetLaminarViscosity();
621-
const su2double Intensity = config->GetTurbulenceIntensity_FreeStream();
622-
const su2double viscRatio = config->GetTurb2LamViscRatio_FreeStream();
621+
const su2double* Turb_Properties = config->GetInlet_TurbVal(config->GetMarker_All_TagBound(val_marker));
622+
const su2double Intensity = Turb_Properties[0];
623+
const su2double viscRatio = Turb_Properties[1];
623624
const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet);
624625

625626
Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2));

0 commit comments

Comments
 (0)