Skip to content

Commit 1ccc0b4

Browse files
committed
Some stylistic changes.
1 parent ba33dee commit 1ccc0b4

8 files changed

Lines changed: 35 additions & 53 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@ class CConfig {
992992
array<su2double, N_POLY_COEFFS> mu_polycoeffs{{0.0}}; /*!< \brief Array for viscosity polynomial coefficients. */
993993
array<su2double, N_POLY_COEFFS> kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */
994994
bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */
995-
su2double *Body_Force_Vector; /*!< \brief Values of the prescribed body force vector. */
996995

997996
unsigned short Kind_Streamwise_Periodic; /*!< \brief Flag to know if a body force is included in the formulation, used for periodic BC as inlet & outlet. */
998997
bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or oterwise outlet source term. */
@@ -3091,14 +3090,6 @@ class CConfig {
30913090
* has the marker <i>val_marker</i>.
30923091
*/
30933092
string GetMarker_Outlet_TagBound(unsigned short val_marker) const { return Marker_Outlet[val_marker]; }
3094-
3095-
/*!
3096-
* \brief Get the index of the periodic surface defined in the geometry file.
3097-
* \param[in] val_marker - Value of the marker in which we are interested.
3098-
* \return Value of the index that is in the geometry file for the surface that
3099-
* has the marker <i>val_marker</i>.
3100-
*/
3101-
string GetMarker_Periodic_TagBound(unsigned short val_marker);
31023093

31033094
/*!
31043095
* \brief Get the index of the surface defined in the geometry file.
@@ -6191,8 +6182,7 @@ class CConfig {
61916182
const su2double *GetPeriodicTranslation(string val_marker) const;
61926183

61936184
/*!
6194-
* \brief Get the translation vector for a periodic transformation. In streamwise periodic flow we currently only
6195-
* allow for one periodic boundary (pair) and there always acces val_index=0.
6185+
* \brief Get the translation vector for a periodic transformation.
61966186
* \param[in] val_index - Index corresponding to the periodic transformation.
61976187
* \return The translation vector.
61986188
*/

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class CPhysicalGeometry final : public CGeometry {
107107
vector<int> GlobalMarkerStorageDispl;
108108
vector<su2double> GlobalRoughness_Height;
109109

110-
su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure computation only. Size nDim.*/
110+
su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure/temperature computation only. Size nDim.*/
111111

112112
public:
113113
/*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/
@@ -471,7 +471,7 @@ class CPhysicalGeometry final : public CGeometry {
471471
* \brief For streamwise periodicity, find a unique reference node on the designated inlet.
472472
* \param[in] config - Definition of the particular problem.
473473
*/
474-
void FindUniqueNode_PeriodicBound(CConfig *config) override;
474+
void FindUniqueNode_PeriodicBound(CConfig *config) final;
475475

476476
/*!
477477
* \brief Set boundary vertex structure of the control volume.

Common/src/CConfig.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4598,8 +4598,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
45984598
SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION);
45994599
if (DiscreteAdjoint && Kind_Streamwise_Periodic == MASSFLOW)
46004600
SU2_MPI::Error("Discrete Adjoint currently not validated for prescribed MASSFLOW.", CURRENT_FUNCTION);
4601-
if (Ref_Inc_NonDim != DIMENSIONAL && false)
4602-
SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\"", CURRENT_FUNCTION);
4601+
if (Ref_Inc_NonDim != DIMENSIONAL)
4602+
SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\", the nondimensionalization with source terms doesn;t work in general.", CURRENT_FUNCTION);
46034603
if (Axisymmetric)
46044604
SU2_MPI::Error("Streamwise Periodicity terms does not not have axisymmetric corrections.", CURRENT_FUNCTION);
46054605
} else {

Common/src/geometry/CPhysicalGeometry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7522,7 +7522,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) {
75227522
/*--- config container. ---*/
75237523
/*-------------------------------------------------------------------------------------------*/
75247524

7525-
for (int iRank = 0; iRank < size; iRank++) { // loop over all vertices on that marker and fi
7525+
for (int iRank = 0; iRank < size; iRank++) {
75267526

75277527
/*--- Get the norm of the current Point. ---*/
75287528
auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[iRank*nDim]);

SU2_CFD/include/numerics/CNumerics.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,15 @@ class CNumerics {
16041604
*/
16051605
virtual inline void SetGamma(su2double val_Gamma_i, su2double val_Gamma_j) { }
16061606

1607-
virtual inline void SetStreamwise_Periodic_Values(const su2double massflow, const su2double integratedHeat, const su2double inletTemp) { }
1607+
/*!
1608+
* \brief Set massflow, heatflow & inlet temperature for streamwise periodic flow.
1609+
* \param[in] massflow - massflow through periodic marker [kg/s].
1610+
* \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W].
1611+
* \param[in] inletTemp - massflow averaged periodic inlet temperature [K].
1612+
*/
1613+
virtual inline void SetStreamwise_Periodic_Values(const su2double massflow,
1614+
const su2double integratedHeat,
1615+
const su2double inletTemp) { }
16081616
};
16091617

16101618
/*!

SU2_CFD/include/numerics/flow/flow_sources.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ class CSourceBase_Flow : public CNumerics {
6060
~CSourceBase_Flow() override;
6161

6262
/*!
63-
* \brief Constructor of the class.
64-
* \param[in] val_nDim - Number of dimensions of the problem.
65-
* \param[in] val_nVar - Number of variables of the problem.
66-
* \param[in] config - Definition of the particular problem.
63+
* \brief Set massflow, heatflow & inlet temperature for streamwise periodic flow.
64+
* \param[in] massflow - massflow through periodic marker [kg/s].
65+
* \param[in] integratedHeat - integrated heatflow over heatflux boundaries [W].
66+
* \param[in] inletTemp - massflow averaged periodic inlet temperature [K].
6767
*/
6868
void SetStreamwise_Periodic_Values(const su2double massflow, const su2double integratedHeat, const su2double inletTemp) {
6969
Streamwise_Periodic_MassFlow = massflow;

SU2_CFD/src/numerics/flow/flow_sources.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,8 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_
692692

693693
CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const CConfig *config) {
694694

695-
const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); /*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */
695+
/*!< \brief Value of prescribed pressure drop which results in an artificial body force vector. */
696+
const su2double delta_p = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref();
696697

697698
for (unsigned short iVar = 0; iVar < nVar; iVar++) residual[iVar] = 0.0;
698699

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,28 +1272,26 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont
12721272

12731273

12741274
if (streamwise_periodic) {
1275-
numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature);
1275+
numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow,
1276+
Streamwise_Periodic_InletTemperature);
12761277

12771278
/*--- Loop over all points ---*/
12781279
SU2_OMP_FOR_STAT(omp_chunk_size)
12791280
for (iPoint = 0; iPoint < nPointDomain; iPoint++) {
12801281

12811282
/*--- Load the primitve variables ---*/
1282-
numerics->SetPrimitive(nodes->GetPrimitive(iPoint),
1283-
NULL);
1283+
numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr);
12841284

12851285
/*--- Set incompressible density ---*/
1286-
numerics->SetDensity(nodes->GetDensity(iPoint),
1287-
0.0);
1286+
numerics->SetDensity(nodes->GetDensity(iPoint), 0.0);
12881287

12891288
/*--- Load the volume of the dual mesh cell ---*/
12901289
numerics->SetVolume(geometry->nodes->GetVolume(iPoint));
12911290

12921291
/*--- If viscous, we need gradients for extra terms. ---*/
12931292
if (viscous) {
12941293
/*--- Gradient of the primitive variables ---*/
1295-
numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint),
1296-
NULL);
1294+
numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), nullptr);
12971295
}
12981296

12991297
/*--- Compute the streamwise periodic source residual and add to the total ---*/
@@ -1307,13 +1305,14 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont
13071305

13081306
if(!streamwise_periodic_temperature && energy) {
13091307
CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM];
1310-
second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow, Streamwise_Periodic_InletTemperature);
1308+
second_numerics->SetStreamwise_Periodic_Values(Streamwise_Periodic_MassFlow, Streamwise_Periodic_IntegratedHeatFlow,
1309+
Streamwise_Periodic_InletTemperature);
13111310

13121311
for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
13131312

13141313
/*--- Only "inlet"/donor periodic marker ---*/
13151314
if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY &&
1316-
config->GetMarker_All_PerBound(iMarker) == 1) { // here it doesnt matter whether 1 or 2
1315+
config->GetMarker_All_PerBound(iMarker) == 1) {
13171316

13181317
for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {
13191318

@@ -1322,13 +1321,13 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont
13221321
if (geometry->nodes->GetDomain(iPoint)) {
13231322

13241323
/*--- Load the primitive variables ---*/
1325-
second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), NULL);
1324+
second_numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nullptr);
13261325

13271326
/*--- Set the specific heat ---*/
13281327
second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0);
13291328

13301329
/*--- Set the Point coordinates ---*/
1331-
second_numerics->SetCoord(geometry->nodes->GetCoord(iPoint),NULL);
1330+
second_numerics->SetCoord(geometry->nodes->GetCoord(iPoint), nullptr);
13321331

13331332
/*--- Set the area normal ---*/
13341333
second_numerics->SetNormal(geometry->vertex[iMarker][iVertex]->GetNormal());
@@ -2938,9 +2937,6 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge
29382937
Streamwise_Periodic_InletTemperature = Temperature_Global;
29392938
Streamwise_Periodic_MassFlow = MassFlow_Global;
29402939

2941-
if (rank == MASTER_NODE && false) { cout << "MassFlow_Global: " << fabs(MassFlow_Global) * config->GetDensity_Ref() * config->GetVelocity_Ref() << endl; }
2942-
if (rank == MASTER_NODE && false) { cout << "Average_Density_Global: " << Average_Density_Global << endl; }
2943-
29442940
if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) {
29452941
/*------------------------------------------------------------------------------------------------*/
29462942
/*--- 2. Update the Pressure Drop [Pa] for the Momentum source term if Massflow is prescribed. ---*/
@@ -2956,7 +2952,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge
29562952

29572953
/*--- Compute update to Delta p based on massflow-difference ---*/
29582954
ddP = 0.5 / ( Average_Density_Global * pow(Area_Global, 2)) * (pow(TargetMassFlow, 2) - pow(MassFlow_Global, 2));
2959-
2955+
29602956
/*--- Store updated pressure difference ---*/
29612957
Pressure_Drop_new = Pressure_Drop + damping_factor*ddP;
29622958
/*--- During restarts, this routine GetStreamwise_Periodic_Properties can get called multiple times
@@ -2973,21 +2969,9 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge
29732969
if((nZone==1 && InnerIter > 0) ||
29742970
(nZone>1 && OuterIter > 0))
29752971
config->SetStreamwise_Periodic_PressureDrop(Pressure_Drop_new);
2976-
2977-
/*--- Output the new value of Delta P and ddp ---*/
2978-
if ((rank == MASTER_NODE) && (iMesh == MESH_0) && false) { //TK:: Move whole computation up in front of output
2979-
2980-
cout.precision(5);
2981-
cout.setf(ios::fixed, ios::floatfield);
2982-
2983-
cout << "Delta Delta P: " << ddP * config->GetPressure_Ref() << endl;
2984-
cout << "New Delta P: " << Pressure_Drop_new * config->GetPressure_Ref() << endl;
2985-
2986-
cout.unsetf(ios_base::floatfield);
2987-
2988-
} // output
2972+
29892973
} // if massflow
2990-
2974+
29912975
if (config->GetEnergy_Equation()) {
29922976
/*---------------------------------------------------------------------------------------------*/
29932977
/*--- 3. Compute the integrated Heatflow [W] for the energy equation source term, heatflux ---*/
@@ -3031,8 +3015,7 @@ void CIncEulerSolver::GetStreamwise_Periodic_Properties(const CGeometry *ge
30313015
SU2_MPI::Allreduce(&HeatFlow_Local, &HeatFlow_Global, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm());
30323016

30333017
/*--- Set the Integrated Heatflux ---*/
3034-
if (iMesh == MESH_0)
3035-
Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global;
3018+
Streamwise_Periodic_IntegratedHeatFlow = HeatFlow_Global;
30363019
} // if energy
30373020
}
30383021

0 commit comments

Comments
 (0)