Skip to content

Commit ab234b2

Browse files
authored
Merge branch 'develop' into update_authors
2 parents 18b592b + 1d63dcd commit ab234b2

40 files changed

Lines changed: 690 additions & 849 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ TestData
7979
# Ignore output files if tests are run locally
8080
*.vtk
8181
*.vtu
82+
*.vtm
83+
*.pvsm
8284
*.ref
85+
*.plt
86+
*.szplt
8387

8488
Mercurial
8589
.hg*

Common/include/option_structure.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,8 +2156,6 @@ enum MPI_QUANTITIES {
21562156
SOLUTION_OLD = 1, /*!< \brief Conservative solution old communication. */
21572157
SOLUTION_GRADIENT = 2, /*!< \brief Conservative solution gradient communication. */
21582158
SOLUTION_LIMITER = 3, /*!< \brief Conservative solution limiter communication. */
2159-
SOLUTION_PRED = 5, /*!< \brief Solution predicted communication. */
2160-
SOLUTION_PRED_OLD = 6, /*!< \brief Solution predicted old communication. */
21612159
SOLUTION_GEOMETRY = 7, /*!< \brief Geometry solution communication. */
21622160
PRIMITIVE_GRADIENT = 8, /*!< \brief Primitive gradient communication. */
21632161
PRIMITIVE_LIMITER = 9, /*!< \brief Primitive limiter communication. */
@@ -2177,7 +2175,6 @@ enum MPI_QUANTITIES {
21772175
SOLUTION_MATRIXTRANS = 23, /*!< \brief Matrix transposed solution communication. */
21782176
NEIGHBORS = 24, /*!< \brief Neighbor point count communication (for JST). */
21792177
SOLUTION_FEA = 25, /*!< \brief FEA solution communication. */
2180-
SOLUTION_FEA_OLD = 26, /*!< \brief FEA solution old communication. */
21812178
MESH_DISPLACEMENTS = 27, /*!< \brief Mesh displacements at the interface. */
21822179
SOLUTION_TIME_N = 28, /*!< \brief Solution at time n. */
21832180
SOLUTION_TIME_N1 = 29, /*!< \brief Solution at time n-1. */

Common/include/toolboxes/geometry_toolbox.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ inline void Distance(Int nDim, const T* a, const T* b, T* d) {
5050
for(Int i = 0; i < nDim; i++) d[i] = a[i] - b[i];
5151
}
5252

53+
/*! \brief Reflect a at b: c = 2*b - a
54+
*/
55+
template<class T, typename Int>
56+
inline void PointPointReflect(Int nDim, const T* a, const T* b, T* d){
57+
for(Int i = 0; i < nDim; i++) d[i] = 2 * b[i] - a[i];
58+
}
59+
5360
/*! \return a.b */
5461
template<class T, typename Int>
5562
inline T DotProduct(Int nDim, const T* a, const T* b) {

Common/src/CConfig.cpp

Lines changed: 6 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) {
@@ -7638,6 +7635,7 @@ CConfig::~CConfig(void) {
76387635
delete[] MG_CorrecSmooth;
76397636
delete[] PlaneTag;
76407637
delete[] CFL;
7638+
delete[] CFL_AdaptParam;
76417639

76427640
/*--- String markers ---*/
76437641

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/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,10 @@ void CFVMFlowSolverBase<V, FlowRegime>::BC_Fluid_Interface(CGeometry* geometry,
15161516
/*--- Set the normal vector and the coordinates ---*/
15171517

15181518
visc_numerics->SetNormal(Normal);
1519-
visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(Point_Normal));
1519+
su2double Coord_Reflected[MAXNDIM];
1520+
GeometryToolbox::PointPointReflect(nDim, geometry->nodes->GetCoord(Point_Normal),
1521+
geometry->nodes->GetCoord(iPoint), Coord_Reflected);
1522+
visc_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), Coord_Reflected);
15201523

15211524
/*--- Primitive variables, and gradient ---*/
15221525

SU2_CFD/include/variables/CAdjEulerVariable.hpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,32 @@ class CAdjEulerVariable : public CVariable {
102102
for (unsigned long iVar = 0; iVar < nVar; iVar++) IntBoundary_Jump(iPoint,iVar) = val_IntBoundary_Jump[iVar];
103103
}
104104

105+
/*!
106+
* \brief Set the velocity vector from the old solution.
107+
* \param[in] val_velocity - Pointer to the velocity.
108+
*/
109+
inline void SetVelocity_Old(unsigned long iPoint, const su2double *val_velocity) final {
110+
for (unsigned long iDim = 0; iDim < nDim; iDim++)
111+
Solution_Old(iPoint,iDim+1) = val_velocity[iDim]*Solution(iPoint,0);
112+
}
113+
114+
/*!
115+
* \brief Set the momentum part of the truncation error to zero.
116+
* \param[in] iPoint - Point index.
117+
*/
118+
inline void SetVel_ResTruncError_Zero(unsigned long iPoint) final {
119+
for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,iDim+1) = 0.0;
120+
}
121+
122+
/*!
123+
* \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases.
124+
* \param[in] iPoint - Point index.
125+
* \param[in] val_vector - Pointer to the vector.
126+
*/
127+
inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final {
128+
for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = GetDensity(iPoint) * val_vector[iDim];
129+
}
130+
105131
/*!
106132
* \brief Get the value of the force projection vector.
107133
* \return Pointer to the force projection vector.

SU2_CFD/include/variables/CEulerVariable.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,14 @@ class CEulerVariable : public CVariable {
428428
Solution_Old(iPoint,iDim+1) = val_velocity[iDim]*Solution(iPoint,0);
429429
}
430430

431+
/*!
432+
* \brief Set the momentum part of the truncation error to zero.
433+
* \param[in] iPoint - Point index.
434+
*/
435+
inline void SetVel_ResTruncError_Zero(unsigned long iPoint) final {
436+
for (unsigned long iDim = 0; iDim < nDim; iDim++) Res_TruncError(iPoint,iDim+1) = 0.0;
437+
}
438+
431439
/*!
432440
* \brief Set the harmonic balance source term.
433441
* \param[in] iVar - Index of the variable.
@@ -487,4 +495,13 @@ class CEulerVariable : public CVariable {
487495
inline su2double GetStrainMag(unsigned long iPoint) const final { return StrainMag(iPoint); }
488496
inline su2activevector& GetStrainMag() { return StrainMag; }
489497

498+
/*!
499+
* \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases.
500+
* \param[in] iPoint - Point index.
501+
* \param[in] val_vector - Pointer to the vector.
502+
*/
503+
inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final {
504+
for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = GetDensity(iPoint) * val_vector[iDim];
505+
}
506+
490507
};

0 commit comments

Comments
 (0)