Skip to content

Commit c2a25dc

Browse files
committed
Merge branch 'develop' into feature_axi_turbsst
2 parents 8a31347 + 1d63dcd commit c2a25dc

18 files changed

Lines changed: 324 additions & 470 deletions

Common/src/CConfig.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7236,21 +7236,18 @@ unsigned short CConfig::GetMarker_ZoneInterface(string val_marker) const {
72367236
return Marker_CfgFile_ZoneInterface[iMarker_CfgFile];
72377237
}
72387238

7239-
bool CConfig::GetSolid_Wall(unsigned short iMarker) const {
7239+
bool CConfig::GetViscous_Wall(unsigned short iMarker) const {
72407240

72417241
return (Marker_All_KindBC[iMarker] == HEAT_FLUX ||
72427242
Marker_All_KindBC[iMarker] == ISOTHERMAL ||
72437243
Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL ||
7244-
Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE ||
7245-
Marker_All_KindBC[iMarker] == EULER_WALL);
7244+
Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE);
72467245
}
72477246

7248-
bool CConfig::GetViscous_Wall(unsigned short iMarker) const {
7247+
bool CConfig::GetSolid_Wall(unsigned short iMarker) const {
72497248

7250-
return (Marker_All_KindBC[iMarker] == HEAT_FLUX ||
7251-
Marker_All_KindBC[iMarker] == ISOTHERMAL ||
7252-
Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL ||
7253-
Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE);
7249+
return GetViscous_Wall(iMarker) ||
7250+
Marker_All_KindBC[iMarker] == EULER_WALL;
72547251
}
72557252

72567253
void CConfig::SetSurface_Movement(unsigned short iMarker, unsigned short kind_movement) {

Common/src/geometry/CPhysicalGeometry.cpp

Lines changed: 33 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4557,8 +4557,8 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
45574557
TotalMinCoordZ = 1E10, TotalMaxCoordX = -1E10, TotalMaxCoordY = -1E10, TotalMaxCoordZ = -1E10;
45584558
su2double TotalPositiveXArea = 0.0, TotalPositiveYArea = 0.0, TotalPositiveZArea = 0.0, TotalWettedArea = 0.0, AxiFactor;
45594559

4560-
bool axisymmetric = config->GetAxisymmetric();
4561-
bool fea = ((config->GetKind_Solver() == FEM_ELASTICITY) || (config->GetKind_Solver() == DISC_ADJ_FEM));
4560+
const bool axisymmetric = config->GetAxisymmetric();
4561+
const bool fea = config->GetStructuralProblem();
45624562

45634563
PositiveXArea = 0.0;
45644564
PositiveYArea = 0.0;
@@ -4569,12 +4569,8 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
45694569
Boundary = config->GetMarker_All_KindBC(iMarker);
45704570
Monitoring = config->GetMarker_All_Monitoring(iMarker);
45714571

4572-
if ((((Boundary == EULER_WALL) ||
4573-
(Boundary == HEAT_FLUX) ||
4574-
(Boundary == ISOTHERMAL) ||
4575-
(Boundary == LOAD_BOUNDARY) ||
4576-
(Boundary == DISPLACEMENT_BOUNDARY)) && (Monitoring == YES))
4577-
|| (fea))
4572+
if (((config->GetSolid_Wall(iMarker) || Boundary == LOAD_BOUNDARY ||
4573+
Boundary == DISPLACEMENT_BOUNDARY) && Monitoring == YES) || fea) {
45784574

45794575
for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) {
45804576
iPoint = vertex[iMarker][iVertex]->GetNode();
@@ -4588,8 +4584,7 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
45884584
if (axisymmetric) AxiFactor = 2.0*PI_NUMBER*nodes->GetCoord(iPoint, 1);
45894585
else AxiFactor = 1.0;
45904586

4591-
if (nDim == 2) WettedArea = AxiFactor * GeometryToolbox::Norm(nDim, Normal);
4592-
if (nDim == 3) WettedArea = GeometryToolbox::Norm(nDim, Normal);
4587+
WettedArea += AxiFactor * GeometryToolbox::Norm(nDim, Normal);
45934588

45944589
if (Normal[0] < 0) PositiveXArea -= Normal[0];
45954590
if (Normal[1] < 0) PositiveYArea -= Normal[1];
@@ -4605,10 +4600,9 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
46054600
if (CoordZ < MinCoordZ) MinCoordZ = CoordZ;
46064601
if (CoordZ > MaxCoordZ) MaxCoordZ = CoordZ;
46074602
}
4608-
46094603
}
46104604
}
4611-
4605+
}
46124606
}
46134607

46144608
SU2_MPI::Allreduce(&PositiveXArea, &TotalPositiveXArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm());
@@ -4627,80 +4621,54 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) {
46274621

46284622
/*--- Set a reference area if no value is provided ---*/
46294623

4624+
const string L = (config->GetSystemMeasurements() == SI)? " m" : " ft";
4625+
const string A = (config->GetSystemMeasurements() == SI)? " m^2" : " ft^2";
4626+
const bool D3 = (nDim == 3);
4627+
46304628
if (config->GetRefArea() == 0.0) {
46314629

4632-
if (nDim == 3) config->SetRefArea(TotalPositiveZArea);
4630+
if (D3) config->SetRefArea(TotalPositiveZArea);
46334631
else config->SetRefArea(TotalPositiveYArea);
46344632

46354633
if (rank == MASTER_NODE) {
4636-
if (nDim == 3) {
4637-
cout << "Reference area = "<< TotalPositiveZArea;
4638-
if (config->GetSystemMeasurements() == SI) cout <<" m^2." << endl; else cout <<" ft^2." << endl;
4639-
}
4640-
else {
4641-
cout << "Reference length = "<< TotalPositiveYArea;
4642-
if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl;
4643-
}
4634+
if (D3) cout << "Reference area = "<< TotalPositiveZArea << A << ".\n";
4635+
else cout << "Reference length = "<< TotalPositiveYArea << L << ".\n";
46444636
}
4645-
46464637
}
46474638

46484639
/*--- Set a semi-span value if no value is provided ---*/
46494640

46504641
if (config->GetSemiSpan() == 0.0) {
46514642

4652-
if (nDim == 3) config->SetSemiSpan(fabs(TotalMaxCoordY));
4643+
if (D3) config->SetSemiSpan(fabs(TotalMaxCoordY));
46534644
else config->SetSemiSpan(1.0);
46544645

4655-
if ((nDim == 3) && (rank == MASTER_NODE)) {
4656-
cout << "Semi-span length = "<< TotalMaxCoordY;
4657-
if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl;
4646+
if (D3 && (rank == MASTER_NODE)) {
4647+
cout << "Semi-span length = "<< TotalMaxCoordY << L << ".\n";
46584648
}
4659-
46604649
}
46614650

46624651
if (rank == MASTER_NODE) {
46634652

46644653
if (fea) cout << "Surface area = "<< TotalWettedArea;
46654654
else cout << "Wetted area = "<< TotalWettedArea;
4666-
4667-
if ((nDim == 3) || (axisymmetric)) { if (config->GetSystemMeasurements() == SI) cout <<" m^2." << endl; else cout <<" ft^2." << endl; }
4668-
else { if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl; }
4669-
4670-
cout << "Area projection in the x-plane = "<< TotalPositiveXArea;
4671-
if (nDim == 3) { if (config->GetSystemMeasurements() == SI) cout <<" m^2,"; else cout <<" ft^2,"; }
4672-
else { if (config->GetSystemMeasurements() == SI) cout <<" m,"; else cout <<" ft,"; }
4673-
4674-
cout << " y-plane = "<< TotalPositiveYArea;
4675-
if (nDim == 3) { if (config->GetSystemMeasurements() == SI) cout <<" m^2,"; else cout <<" ft^2,"; }
4676-
else { if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft." << endl; }
4677-
4678-
if (nDim == 3) { cout << " z-plane = "<< TotalPositiveZArea;
4679-
if (config->GetSystemMeasurements() == SI) cout <<" m^2." << endl; else cout <<" ft^2."<< endl; }
4680-
4681-
cout << "Max. coordinate in the x-direction = "<< TotalMaxCoordX;
4682-
if (config->GetSystemMeasurements() == SI) cout <<" m,"; else cout <<" ft,";
4683-
4684-
cout << " y-direction = "<< TotalMaxCoordY;
4685-
if (config->GetSystemMeasurements() == SI) cout <<" m"; else cout <<" ft";
4686-
4687-
if (nDim == 3) {
4688-
cout << ", z-direction = "<< TotalMaxCoordZ;
4689-
if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft."<< endl;
4690-
}
4691-
else cout << "." << endl;
4692-
4693-
cout << "Min. coordinate in the x-direction = "<< TotalMinCoordX;
4694-
if (config->GetSystemMeasurements() == SI) cout <<" m,"; else cout <<" ft";
4695-
4696-
cout << " y-direction = "<< TotalMinCoordY;
4697-
if (config->GetSystemMeasurements() == SI) cout <<" m"; else cout <<" ft";
4698-
4699-
if (nDim == 3) {
4700-
cout << ", z-direction = "<< TotalMinCoordZ;
4701-
if (config->GetSystemMeasurements() == SI) cout <<" m." << endl; else cout <<" ft."<< endl;
4702-
}
4703-
else cout << "." << endl;
4655+
if (D3 || axisymmetric) cout << A << ".\n";
4656+
else cout << L << ".\n";
4657+
4658+
cout << "Area projection in the x-plane = "<< TotalPositiveXArea << (D3? A : L);
4659+
cout << ", y-plane = "<< TotalPositiveYArea << (D3? A : L);
4660+
if (D3) cout << ", z-plane = "<< TotalPositiveZArea << A;
4661+
cout << ".\n";
4662+
4663+
cout << "Max. coordinate in the x-direction = "<< TotalMaxCoordX << L;
4664+
cout << ", y-direction = "<< TotalMaxCoordY << L;
4665+
if (D3) cout << ", z-direction = "<< TotalMaxCoordZ << L;
4666+
cout << ".\n";
4667+
4668+
cout << "Min. coordinate in the x-direction = "<< TotalMinCoordX << L;
4669+
cout << ", y-direction = "<< TotalMinCoordY << L;
4670+
if (D3) cout << ", z-direction = "<< TotalMinCoordZ << L;
4671+
cout << "." << endl;
47044672

47054673
}
47064674

SU2_CFD/include/numerics/turbulent/turb_sources.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CSourceBase_TurbSA : public CNumerics {
5151
su2double cw1;
5252
su2double cr1;
5353

54-
su2double gamma_BC;
54+
su2double Gamma_BC = 0.0;
5555
su2double intermittency;
5656
su2double Production, Destruction, CrossProduction;
5757

@@ -105,7 +105,7 @@ class CSourceBase_TurbSA : public CNumerics {
105105
* \brief Get the intermittency for the BC trans. model.
106106
* \return Value of the intermittency.
107107
*/
108-
inline su2double GetGammaBC(void) const final { return gamma_BC; }
108+
inline su2double GetGammaBC(void) const final { return Gamma_BC; }
109109

110110
/*!
111111
* \brief ______________.

SU2_CFD/src/numerics/turbulent/turb_sources.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
9494
CrossProduction = 0.0;
9595
Jacobian_i[0] = 0.0;
9696

97-
gamma_BC = 0.0;
98-
9997
/*--- Evaluate Omega ---*/
10098

10199
Omega = sqrt(Vorticity_i[0]*Vorticity_i[0] + Vorticity_i[1]*Vorticity_i[1] + Vorticity_i[2]*Vorticity_i[2]);
@@ -153,9 +151,10 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
153151
su2double term1 = sqrt(max(re_theta-re_theta_t,0.)/(chi_1*re_theta_t));
154152
su2double term2 = sqrt(max((nu_t*chi_2)/nu,0.));
155153
su2double term_exponential = (term1 + term2);
156-
su2double gamma_BC = 1.0 - exp(-term_exponential);
157154

158-
Production = gamma_BC*cb1*Shat*TurbVar_i[0]*Volume;
155+
Gamma_BC = 1.0 - exp(-term_exponential);
156+
157+
Production = Gamma_BC*cb1*Shat*TurbVar_i[0]*Volume;
159158
}
160159
else {
161160
Production = cb1*Shat*TurbVar_i[0]*Volume;
@@ -192,7 +191,7 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
192191
else dShat = (fv2+TurbVar_i[0]*dfv2)*inv_k2_d2;
193192

194193
if (transition) {
195-
Jacobian_i[0] += gamma_BC*cb1*(TurbVar_i[0]*dShat+Shat)*Volume;
194+
Jacobian_i[0] += Gamma_BC*cb1*(TurbVar_i[0]*dShat+Shat)*Volume;
196195
}
197196
else {
198197
Jacobian_i[0] += cb1*(TurbVar_i[0]*dShat+Shat)*Volume;

SU2_CFD/src/output/CFlowCompOutput.cpp

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -370,30 +370,32 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
370370
break;
371371
}
372372

373-
// Limiter values
374-
AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity");
375-
AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity");
376-
if (nDim == 3) {
377-
AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity");
373+
if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) {
374+
AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity");
375+
AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity");
376+
if (nDim == 3) {
377+
AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity");
378+
}
379+
AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure");
380+
AddVolumeOutput("LIMITER_DENSITY", "Limiter_Density", "LIMITER", "Limiter value of the density");
381+
AddVolumeOutput("LIMITER_ENTHALPY", "Limiter_Enthalpy", "LIMITER", "Limiter value of the enthalpy");
378382
}
379-
AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure");
380-
AddVolumeOutput("LIMITER_DENSITY", "Limiter_Density", "LIMITER", "Limiter value of the density");
381-
AddVolumeOutput("LIMITER_ENTHALPY", "Limiter_Enthalpy", "LIMITER", "Limiter value of the enthalpy");
382383

383-
switch(config->GetKind_Turb_Model()){
384-
case SST: case SST_SUST:
385-
AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy");
386-
AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate");
387-
break;
388-
case SA: case SA_COMP: case SA_E:
389-
case SA_E_COMP: case SA_NEG:
390-
AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable");
391-
break;
392-
case NONE:
393-
break;
384+
if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) {
385+
switch(config->GetKind_Turb_Model()){
386+
case SST: case SST_SUST:
387+
AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy");
388+
AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate");
389+
break;
390+
case SA: case SA_COMP: case SA_E:
391+
case SA_E_COMP: case SA_NEG:
392+
AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable");
393+
break;
394+
case NONE:
395+
break;
396+
}
394397
}
395398

396-
397399
// Hybrid RANS-LES
398400
if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){
399401
AddVolumeOutput("DES_LENGTHSCALE", "DES_LengthScale", "DDES", "DES length scale value");
@@ -522,26 +524,30 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv
522524
break;
523525
}
524526

525-
SetVolumeOutputValue("LIMITER_VELOCITY-X", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 1));
526-
SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 2));
527-
if (nDim == 3){
528-
SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3));
527+
if (config->GetKind_SlopeLimit_Flow() != NO_LIMITER && config->GetKind_SlopeLimit_Flow() != VAN_ALBADA_EDGE) {
528+
SetVolumeOutputValue("LIMITER_VELOCITY-X", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 1));
529+
SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 2));
530+
if (nDim == 3){
531+
SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3));
532+
}
533+
SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+1));
534+
SetVolumeOutputValue("LIMITER_DENSITY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+2));
535+
SetVolumeOutputValue("LIMITER_ENTHALPY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+3));
529536
}
530-
SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+1));
531-
SetVolumeOutputValue("LIMITER_DENSITY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+2));
532-
SetVolumeOutputValue("LIMITER_ENTHALPY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+3));
533537

534-
switch(config->GetKind_Turb_Model()){
535-
case SST: case SST_SUST:
536-
SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0));
537-
SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 1));
538-
break;
539-
case SA: case SA_COMP: case SA_E:
540-
case SA_E_COMP: case SA_NEG:
541-
SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter_Primitive(iPoint, 0));
542-
break;
543-
case NONE:
544-
break;
538+
if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) {
539+
switch(config->GetKind_Turb_Model()){
540+
case SST: case SST_SUST:
541+
SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter(iPoint, 0));
542+
SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter(iPoint, 1));
543+
break;
544+
case SA: case SA_COMP: case SA_E:
545+
case SA_E_COMP: case SA_NEG:
546+
SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter(iPoint, 0));
547+
break;
548+
case NONE:
549+
break;
550+
}
545551
}
546552

547553
if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){

0 commit comments

Comments
 (0)