Skip to content

Commit 3fc71fa

Browse files
committed
more red lines?
1 parent b81b6e7 commit 3fc71fa

13 files changed

Lines changed: 254 additions & 467 deletions

SU2_CFD/include/output/CFlowCompOutput.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ class CVariable;
3838
*/
3939
class CFlowCompOutput final: public CFlowOutput {
4040
private:
41-
4241
TURB_MODEL turb_model; //!< Kind of turbulence model
4342

4443
public:
45-
4644
/*!
4745
* \brief Constructor of the class
4846
* \param[in] config - Definition of the particular problem.
@@ -55,18 +53,6 @@ class CFlowCompOutput final: public CFlowOutput {
5553
*/
5654
void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override;
5755

58-
/*!
59-
* \brief Set the values of the volume output fields for a surface point.
60-
* \param[in] config - Definition of the particular problem.
61-
* \param[in] geometry - Geometrical definition of the problem.
62-
* \param[in] solver - The container holding all solution data.
63-
* \param[in] iPoint - Index of the point.
64-
* \param[in] iMarker - Index of the surface marker.
65-
* \param[in] iVertex - Index of the vertex on the marker.
66-
*/
67-
void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver,
68-
unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override;
69-
7056
/*!
7157
* \brief Set the available volume output fields
7258
* \param[in] config - Definition of the particular problem.

SU2_CFD/include/output/CFlowIncOutput.hpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,44 +38,25 @@ class CVariable;
3838
*/
3939
class CFlowIncOutput final: public CFlowOutput {
4040
private:
41-
4241
TURB_MODEL turb_model; /*!< \brief The kind of turbulence model*/
4342
bool heat; /*!< \brief Boolean indicating whether have a heat problem*/
4443
bool weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/
4544
unsigned short streamwisePeriodic; /*!< \brief Boolean indicating whether it is a streamwise periodic simulation. */
4645
bool streamwisePeriodic_temperature; /*!< \brief Boolean indicating streamwise periodic temperature is used. */
4746

4847
public:
49-
5048
/*!
5149
* \brief Constructor of the class
5250
* \param[in] config - Definition of the particular problem.
5351
*/
5452
CFlowIncOutput(CConfig *config, unsigned short nDim);
5553

56-
/*!
57-
* \brief Destructor of the class.
58-
*/
59-
~CFlowIncOutput(void) override;
60-
6154
/*!
6255
* \brief Load the history output field values
6356
* \param[in] config - Definition of the particular problem.
6457
*/
6558
void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override;
6659

67-
/*!
68-
* \brief Set the values of the volume output fields for a surface point.
69-
* \param[in] config - Definition of the particular problem.
70-
* \param[in] geometry - Geometrical definition of the problem.
71-
* \param[in] solver - The container holding all solution data.
72-
* \param[in] iPoint - Index of the point.
73-
* \param[in] iMarker - Index of the surface marker.
74-
* \param[in] iVertex - Index of the vertex on the marker.
75-
*/
76-
void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver,
77-
unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override;
78-
7960
/*!
8061
* \brief Set the available volume output fields
8162
* \param[in] config - Definition of the particular problem.

SU2_CFD/include/output/CFlowOutput.hpp

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ class CFlowOutput : public CFVMOutput{
4040
*/
4141
CFlowOutput(const CConfig *config, unsigned short nDim, bool femOutput);
4242

43+
/*!
44+
* \brief Set the values of the volume output fields for a surface point.
45+
* \param[in] config - Definition of the particular problem.
46+
* \param[in] geometry - Geometrical definition of the problem.
47+
* \param[in] solver - The container holding all solution data.
48+
* \param[in] iPoint - Index of the point.
49+
* \param[in] iMarker - Index of the surface marker.
50+
* \param[in] iVertex - Index of the vertex on the marker.
51+
*/
52+
void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver,
53+
unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override;
54+
4355
/*!
4456
* \brief Add flow surface output fields
4557
* \param[in] config - Definition of the particular problem.
@@ -60,40 +72,25 @@ class CFlowOutput : public CFVMOutput{
6072
*/
6173
void AddHistoryOutputFields_TurbRMS_RES(const CConfig* config);
6274

63-
/*!
64-
* \brief Set turbulence history field values for the linear solver.
65-
*/
66-
void LoadHistoryData_TurbRMS_RES(const CConfig* config, const CSolver* const* solver);
67-
6875
/*!
6976
* \brief Add turbulence history fields for the linear solver (FVMComp, FVMInc, FVMNEMO).
7077
*/
7178
void AddHistoryOutputFields_TurbMAX_RES(const CConfig* config);
7279

73-
/*!
74-
* \brief Set turbulence history field values for the linear solver.
75-
*/
76-
void LoadHistoryData_TurbMAX_RES(const CConfig* config, const CSolver* const* solver);
77-
7880
/*!
7981
* \brief Add turbulence history fields for the linear solver (FVMComp, FVMInc, FVMNEMO).
8082
*/
8183
void AddHistoryOutputFields_TurbBGS_RES(const CConfig* config);
8284

83-
/*!
84-
* \brief Set turbulence history field values for the linear solver.
85-
*/
86-
void LoadHistoryData_TurbBGS_RES(const CConfig* config, const CSolver* const* solver);
87-
8885
/*!
8986
* \brief Add turbulence history fields for the linear solver (FVMComp, FVMInc, FVMNEMO).
9087
*/
9188
void AddHistoryOutputFields_TurbLinsol(const CConfig* config);
9289

9390
/*!
94-
* \brief Set turbulence history field values for the linear solver.
91+
* \brief Set all turbulence history field values.
9592
*/
96-
void LoadHistoryData_TurbLinsol(const CConfig* config, const CSolver* const* solver);
93+
void LoadHistoryData_Turb(const CConfig* config, const CSolver* const* solver);
9794

9895
/*!
9996
* \brief Add turbulence volume solution fields for a point (FVMComp, FVMInc, FVMNEMO).
@@ -102,45 +99,28 @@ class CFlowOutput : public CFVMOutput{
10299
*/
103100
void SetVolumeOutputFields_TurbSolution(const CConfig* config);
104101

105-
/*!
106-
* \brief Set turbulence volume solution field values for a point.
107-
* \note The order of fields in restart files is fixed. Therefore the split-up.
108-
* \param[in] config - Definition of the particular problem.
109-
* \param[in] solver - The container holding all solution data.
110-
* \param[in] iPoint - Index of the point.
111-
*/
112-
void LoadVolumeData_TurbSolution(const CConfig* config, const CSolver* const* solver, const unsigned long iPoint);
113-
114102
/*!
115103
* \brief Add turbulence volume solution fields for a point (FVMComp, FVMInc, FVMNEMO).
116104
* \note The order of fields in restart files is fixed. Therefore the split-up.
117105
* \param[in] config - Definition of the particular problem.
118106
*/
119107
void SetVolumeOutputFields_TurbResidual(const CConfig* config);
120108

121-
/*!
122-
* \brief Set turbulence volume residual field values for a point.
123-
* \note The order of fields in restart files is fixed. Therefore the split-up.
124-
* \param[in] config - Definition of the particular problem.
125-
* \param[in] solver - The container holding all solution data.
126-
* \param[in] iPoint - Index of the point.
127-
*/
128-
void LoadVolumeData_TurbResidual(const CConfig* config, const CSolver* const* solver, const unsigned long iPoint);
129-
130109
/*!
131110
* \brief Add turbulence volume limiter fields (and more) for a point (FVMComp, FVMInc, FVMNEMO).
132111
* \param[in] config - Definition of the particular problem.
133112
*/
134113
void SetVolumeOutputFields_TurbLimiter(const CConfig* config);
135114

136115
/*!
137-
* \brief Set turbulence volume limiter field values (and more) for a point.
116+
* \brief Set all turbulence volume field values for a point.
138117
* \param[in] config - Definition of the particular problem.
139118
* \param[in] solver - The container holding all solution data.
140119
* \param[in] geometry - Geometrical definition of the problem.
141120
* \param[in] iPoint - Index of the point.
142121
*/
143-
void LoadVolumeData_TurbLimiter(const CConfig* config, const CSolver* const* solver, const CGeometry* geometry, const unsigned long iPoint);
122+
void LoadVolumeData_Turb(const CConfig* config, const CSolver* const* solver, const CGeometry* geometry,
123+
const unsigned long iPoint);
144124

145125
/*!
146126
* \brief Add aerodynamic coefficients as output fields
@@ -266,7 +246,7 @@ class CFlowOutput : public CFVMOutput{
266246
* \param iPoint
267247
* \param node_flow
268248
*/
269-
void LoadTimeAveragedData(unsigned long iPoint, CVariable *node_flow);
249+
void LoadTimeAveragedData(unsigned long iPoint, const CVariable *node_flow);
270250

271251
/*!
272252
* \brief Write additional output for fixed CL mode.

SU2_CFD/include/output/CNEMOCompOutput.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ class CVariable;
3737
*/
3838
class CNEMOCompOutput final: public CFlowOutput {
3939
private:
40-
4140
TURB_MODEL turb_model; /*!< \brief Kind of turbulence model */
4241
unsigned short iSpecies, /*!< \brief Species index */
4342
nSpecies; /*!< \brief Number of species */
4443
public:
45-
4644
/*!
4745
* \brief Constructor of the class
4846
* \param[in] config - Definition of the particular problem.
@@ -55,18 +53,6 @@ class CNEMOCompOutput final: public CFlowOutput {
5553
*/
5654
void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override;
5755

58-
/*!
59-
* \brief Set the values of the volume output fields for a surface point.
60-
* \param[in] config - Definition of the particular problem.
61-
* \param[in] geometry - Geometrical definition of the problem.
62-
* \param[in] solver - The container holding all solution data.
63-
* \param[in] iPoint - Index of the point.
64-
* \param[in] iMarker - Index of the surface marker.
65-
* \param[in] iVertex - Index of the vertex on the marker.
66-
*/
67-
void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver,
68-
unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override;
69-
7056
/*!
7157
* \brief Set the available volume output fields
7258
* \param[in] config - Definition of the particular problem.

SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,95 +1005,8 @@ class CFVMFlowSolverBase : public CSolver {
10051005

10061006
/*!
10071007
* \brief Evaluate the vorticity and strain rate magnitude.
1008-
* \tparam VelocityOffset - Index in the primitive variables where the velocity starts.
10091008
*/
1010-
void ComputeVorticityAndStrainMag(const CConfig& config, unsigned short iMesh,
1011-
const size_t VelocityOffset = 1) {
1012-
1013-
auto& StrainMag = nodes->GetStrainMag();
1014-
1015-
ompMasterAssignBarrier(StrainMag_Max,0.0, Omega_Max,0.0);
1016-
1017-
su2double strainMax = 0.0, omegaMax = 0.0;
1018-
1019-
SU2_OMP_FOR_STAT(omp_chunk_size)
1020-
for (unsigned long iPoint = 0; iPoint < nPoint; ++iPoint) {
1021-
1022-
const auto VelocityGradient = nodes->GetGradient_Primitive(iPoint, VelocityOffset);
1023-
auto Vorticity = nodes->GetVorticity(iPoint);
1024-
1025-
/*--- Vorticity ---*/
1026-
1027-
Vorticity[0] = 0.0;
1028-
Vorticity[1] = 0.0;
1029-
Vorticity[2] = VelocityGradient(1,0)-VelocityGradient(0,1);
1030-
1031-
if (nDim == 3) {
1032-
Vorticity[0] = VelocityGradient(2,1)-VelocityGradient(1,2);
1033-
Vorticity[1] = -(VelocityGradient(2,0)-VelocityGradient(0,2));
1034-
}
1035-
1036-
/*--- Strain Magnitude ---*/
1037-
1038-
AD::StartPreacc();
1039-
AD::SetPreaccIn(VelocityGradient, nDim, nDim);
1040-
1041-
su2double Div = 0.0;
1042-
for (unsigned long iDim = 0; iDim < nDim; iDim++)
1043-
Div += VelocityGradient(iDim, iDim);
1044-
Div /= 3.0;
1045-
1046-
StrainMag(iPoint) = 0.0;
1047-
1048-
/*--- Add diagonal part ---*/
1049-
1050-
for (unsigned long iDim = 0; iDim < nDim; iDim++) {
1051-
StrainMag(iPoint) += pow(VelocityGradient(iDim, iDim) - Div, 2);
1052-
}
1053-
if (nDim == 2) {
1054-
StrainMag(iPoint) += pow(Div, 2);
1055-
}
1056-
1057-
/*--- Add off diagonals ---*/
1058-
1059-
StrainMag(iPoint) += 2.0*pow(0.5*(VelocityGradient(0,1) + VelocityGradient(1,0)), 2);
1060-
1061-
if (nDim == 3) {
1062-
StrainMag(iPoint) += 2.0*pow(0.5*(VelocityGradient(0,2) + VelocityGradient(2,0)), 2);
1063-
StrainMag(iPoint) += 2.0*pow(0.5*(VelocityGradient(1,2) + VelocityGradient(2,1)), 2);
1064-
}
1065-
1066-
StrainMag(iPoint) = sqrt(2.0*StrainMag(iPoint));
1067-
AD::SetPreaccOut(StrainMag(iPoint));
1068-
1069-
/*--- Max is not differentiable, so we not register them for preacc. ---*/
1070-
strainMax = max(strainMax, StrainMag(iPoint));
1071-
omegaMax = max(omegaMax, GeometryToolbox::Norm(3, Vorticity));
1072-
1073-
AD::EndPreacc();
1074-
}
1075-
END_SU2_OMP_FOR
1076-
1077-
if ((iMesh == MESH_0) && (config.GetComm_Level() == COMM_FULL)) {
1078-
SU2_OMP_CRITICAL {
1079-
StrainMag_Max = max(StrainMag_Max, strainMax);
1080-
Omega_Max = max(Omega_Max, omegaMax);
1081-
}
1082-
END_SU2_OMP_CRITICAL
1083-
1084-
SU2_OMP_BARRIER
1085-
SU2_OMP_MASTER {
1086-
su2double MyOmega_Max = Omega_Max;
1087-
su2double MyStrainMag_Max = StrainMag_Max;
1088-
1089-
SU2_MPI::Allreduce(&MyStrainMag_Max, &StrainMag_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm());
1090-
SU2_MPI::Allreduce(&MyOmega_Max, &Omega_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm());
1091-
}
1092-
END_SU2_OMP_MASTER
1093-
SU2_OMP_BARRIER
1094-
}
1095-
1096-
}
1009+
void ComputeVorticityAndStrainMag(const CConfig& config, unsigned short iMesh);
10971010

10981011
/*!
10991012
* \brief Destructor.

0 commit comments

Comments
 (0)