Skip to content

Commit ab87ad5

Browse files
committed
merge develop, address PR comments, replace some dynamic allocations, and removed unused functions
1 parent 4e44e39 commit ab87ad5

15 files changed

Lines changed: 141 additions & 192 deletions

File tree

Common/include/linear_algebra/CSysVector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class CSysVector : public VecExpr::CVecExpr<CSysVector<ScalarType>, ScalarType>
101101
/*!
102102
* \brief Default constructor of the class.
103103
*/
104-
CSysVector() = default;
104+
CSysVector() {}
105105

106106
/*!
107107
* \brief Destructor

Common/include/parallelization/vectorization.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Array : public CVecExpr<Array<Scalar_t,N>, Scalar_t> {
7878
static constexpr bool StoreAsRef = true;
7979

8080
private:
81-
alignas(Align) Scalar x_[N];
81+
alignas(Size*sizeof(Scalar)) Scalar x_[N];
8282

8383
public:
8484
#define ARRAY_BOILERPLATE \

Common/src/CConfig.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4381,6 +4381,10 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
43814381
SU2_MPI::Error("BC transition model currently only available in combination with SA turbulence model!", CURRENT_FUNCTION);
43824382
}
43834383

4384+
if (Kind_Trans_Model == LM) {
4385+
SU2_MPI::Error("The LM transition model is under maintenance.", CURRENT_FUNCTION);
4386+
}
4387+
43844388
/*--- Check for constant lift mode. Initialize the update flag for
43854389
the AoA with each iteration to false ---*/
43864390

@@ -5539,6 +5543,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) {
55395543
case SST_SUST: cout << "Menter's SST with sustaining terms" << endl; break;
55405544
}
55415545
if (QCR) cout << "Using Quadratic Constitutive Relation, 2000 version (QCR2000)" << endl;
5546+
if (Kind_Trans_Model == BC) cout << "Using the revised BC transition model (2020)" << endl;
55425547
cout << "Hybrid RANS/LES: ";
55435548
switch (Kind_HybridRANSLES){
55445549
case NO_HYBRIDRANSLES: cout << "No Hybrid RANS/LES" << endl; break;

SU2_CFD/include/solvers/CNEMOEulerSolver.hpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,8 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
9797
* \param[in] iMesh - Index of the mesh in multigrid computations.
9898
* \param[in] Iteration - Value of the current iteration.
9999
*/
100-
void SetTime_Step(CGeometry *geometry,
101-
CSolver **solver_container,
102-
CConfig *config,
103-
unsigned short iMesh,
104-
unsigned long Iteration) final;
100+
void SetTime_Step(CGeometry *geometry, CSolver **solver_container,
101+
CConfig *config, unsigned short iMesh, unsigned long Iteration) final;
105102

106103
/*!
107104
* \brief Set the initial condition for the Euler Equations.
@@ -141,11 +138,8 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
141138
* \param[in] config - Definition of the particular problem.
142139
* \param[in] iMesh - Index of the mesh in multigrid computations.
143140
*/
144-
void Upwind_Residual(CGeometry *geometry,
145-
CSolver **solver_container,
146-
CNumerics **numerics_container,
147-
CConfig *config,
148-
unsigned short iMesh) final;
141+
void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container,
142+
CConfig *config, unsigned short iMesh) final;
149143

150144
/*!
151145
* \brief Recompute the extrapolated quantities, after MUSCL reconstruction,
@@ -168,11 +162,8 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
168162
* \param[in] config - Definition of the particular problem.
169163
* \param[in] iMesh - Index of the mesh in multigrid computations.
170164
*/
171-
void Source_Residual(CGeometry *geometry,
172-
CSolver **solver_container,
173-
CNumerics **numerics_container,
174-
CConfig *config,
175-
unsigned short iMesh) final;
165+
void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container,
166+
CConfig *config, unsigned short iMesh) final;
176167

177168
/*!
178169
* \brief Preprocessing actions common to the Euler and NS solvers.
@@ -214,6 +205,17 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase<CNEMOEulerVariable, COMPRESSI
214205
*/
215206
void SetNondimensionalization(CConfig *config, unsigned short iMesh) final;
216207

208+
/*!
209+
* \brief Set all the conserved variables from the primitive vector..
210+
*/
211+
void RecomputeConservativeVector(su2double *U, const su2double *V);
212+
213+
/*!
214+
* \brief Check for unphysical points.
215+
* \return Boolean value of physical point
216+
*/
217+
bool CheckNonPhys(const su2double *V);
218+
217219
/*!
218220
* \brief Compute the pressure at the infinity.
219221
* \return Value of the pressure at the infinity.

SU2_CFD/include/variables/CNEMOEulerVariable.hpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,24 +349,13 @@ class CNEMOEulerVariable : public CVariable {
349349
*/
350350
bool SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) override;
351351

352-
/*!
352+
/*!
353353
* \brief Set all the primitive and secondary variables from the conserved vector.
354354
*/
355355
bool Cons2PrimVar(su2double *U, su2double *V, su2double *dPdU,
356356
su2double *dTdU, su2double *dTvedU, su2double *val_eves,
357357
su2double *val_Cvves);
358358

359-
/*!
360-
* \brief Set all the conserved variables from the primitive vector..
361-
*/
362-
void Prim2ConsVar(su2double *U, su2double *V);
363-
364-
/*!
365-
* \brief Check for unphysical points.
366-
* \return Boolean value of physical point
367-
*/
368-
bool CheckNonPhys(su2double *V);
369-
370359
/*---------------------------------------*/
371360
/*--- Specific variable routines ---*/
372361
/*---------------------------------------*/

SU2_CFD/include/variables/CVariable.hpp

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,16 +1426,6 @@ class CVariable {
14261426
*/
14271427
inline virtual void SetSecondaryVar(unsigned long iPoint, CFluidModel *FluidModel) {}
14281428

1429-
/*!
1430-
* \brief A virtual member.
1431-
*/
1432-
inline virtual bool Cons2PrimVar(CConfig *config, unsigned long iPoint, su2double *U, su2double *V, su2double *dPdU,
1433-
su2double *dTdU, su2double *dTvedU) { return false; }
1434-
/*!
1435-
* \brief A virtual member.
1436-
*/
1437-
inline virtual void Prim2ConsVar(CConfig *config, unsigned long iPoint, su2double *V, su2double *U) { }
1438-
14391429
/*!
14401430
* \brief A virtual member.
14411431
*/
@@ -1590,45 +1580,6 @@ class CVariable {
15901580
*/
15911581
inline virtual bool SetPressure(unsigned long iPoint, su2double Gamma, su2double turb_ke) { return false; }
15921582

1593-
/*!
1594-
* \brief Calculates vib.-el. energy per mass, \f$e^{vib-el}_s\f$, for input species (not including KE)
1595-
*/
1596-
inline virtual su2double CalcEve(unsigned long iPoint, su2double *V, CConfig *config, unsigned long val_Species) { return 0.0; }
1597-
1598-
/*!
1599-
* \brief Calculates enthalpy per mass, \f$h_s\f$, for input species (not including KE)
1600-
*/
1601-
inline virtual su2double CalcHs(unsigned long iPoint, su2double *V, CConfig *config, unsigned long val_Species) { return 0.0; }
1602-
1603-
/*!
1604-
* \brief Calculates enthalpy per mass, \f$Cv_s\f$, for input species (not including KE)
1605-
*/
1606-
inline virtual su2double CalcCvve(unsigned long iPoint, su2double val_Tve, CConfig *config, unsigned long val_Species) { return 0.0; }
1607-
1608-
/*!
1609-
* \brief A virtual member.
1610-
* \param[in] V
1611-
* \param[in] config - Configuration settings
1612-
* \param[in] dPdU
1613-
*/
1614-
inline virtual void CalcdPdU(unsigned long iPoint, su2double *V, CConfig *config, su2double *dPdU) {}
1615-
1616-
/*!
1617-
* \brief Set partial derivative of temperature w.r.t. density \f$\frac{\partial P}{\partial \rho_s}\f$
1618-
* \param[in] V
1619-
* \param[in] config - Configuration settings
1620-
* \param[in] dTdU
1621-
*/
1622-
inline virtual void CalcdTdU(unsigned long iPoint, su2double *V, CConfig *config, su2double *dTdU) {}
1623-
1624-
/*!
1625-
* \brief Set partial derivative of temperature w.r.t. density \f$\frac{\partial P}{\partial \rho_s}\f$
1626-
* \param[in] V
1627-
* \param[in] config - Configuration settings
1628-
* \param[in] dTdU
1629-
*/
1630-
inline virtual void CalcdTvedU(unsigned long iPoint, su2double *V, CConfig *config, su2double *dTdU) {}
1631-
16321583
/*!
16331584
* \brief A virtual member.
16341585
*/

SU2_CFD/src/numerics/NEMO/convection/msw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) {
176176
ProjVelst_i = onemw*ProjVel_i + w*ProjVel_j;
177177
ProjVelst_j = onemw*ProjVel_j + w*ProjVel_i;
178178

179-
vector<su2double> eves_st_i = fluidmodel->ComputeSpeciesEve(Vst_i[TVE_INDEX]);
180-
vector<su2double> eves_st_j = fluidmodel->ComputeSpeciesEve(Vst_j[TVE_INDEX]);
179+
auto& eves_st_i = fluidmodel->ComputeSpeciesEve(Vst_i[TVE_INDEX]);
180+
auto& eves_st_j = fluidmodel->ComputeSpeciesEve(Vst_j[TVE_INDEX]);
181181

182182
fluidmodel->ComputedPdU(Vst_i, eves_st_i, dPdUst_i);
183183
fluidmodel->ComputedPdU(Vst_j, eves_st_j, dPdUst_j);

SU2_CFD/src/numerics/NEMO/convection/roe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ CNumerics::ResidualType<> CUpwRoe_NEMO::ComputeResidual(const CConfig *config) {
103103
for (iVar = 0; iVar < nPrimVar; iVar++)
104104
RoeV[iVar] = (R*V_j[iVar] + V_i[iVar])/(R+1);
105105

106-
vector<su2double> roe_eves = fluidmodel->ComputeSpeciesEve(RoeV[TVE_INDEX]);
106+
auto& roe_eves = fluidmodel->ComputeSpeciesEve(RoeV[TVE_INDEX]);
107107

108108
/*--- Calculate derivatives of pressure ---*/
109109
fluidmodel->ComputedPdU(RoeV, roe_eves, RoedPdU);

SU2_CFD/src/numerics/turbulent/turb_sources.cpp

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
7676
// AD::SetPreaccIn(TurbVar_Grad_i[0], nDim);
7777
// AD::SetPreaccIn(Volume); AD::SetPreaccIn(dist_i);
7878

79-
// BC Transition Model variables
80-
su2double vmag, rey, re_theta, re_theta_t, re_v;
81-
su2double tu , nu_cr, nu_t, nu_BC, chi_1, chi_2, term1, term2, term_exponential;
82-
8379
// Set the boolean here depending on whether the point is closest to a rough wall or not.
8480
roughwall = (roughness_i > 0.0);
8581

@@ -99,16 +95,6 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
9995
Jacobian_i[0] = 0.0;
10096

10197
gamma_BC = 0.0;
102-
vmag = 0.0;
103-
tu = config->GetTurbulenceIntensity_FreeStream();
104-
rey = config->GetReynolds();
105-
106-
if (nDim==2) {
107-
vmag = sqrt(V_i[1]*V_i[1]+V_i[2]*V_i[2]);
108-
}
109-
else {
110-
vmag = sqrt(V_i[1]*V_i[1]+V_i[2]*V_i[2]+V_i[3]*V_i[3]);
111-
}
11298

11399
/*--- Evaluate Omega ---*/
114100

@@ -151,23 +137,23 @@ CNumerics::ResidualType<> CSourcePieceWise_TurbSA::ComputeResidual(const CConfig
151137

152138
if (transition) {
153139

154-
// BC model constants
155-
chi_1 = 0.002;
156-
chi_2 = 5.0;
140+
/*--- BC model constants (2020 revision). ---*/
141+
const su2double chi_1 = 0.002;
142+
const su2double chi_2 = 50.0;
143+
144+
su2double tu = config->GetTurbulenceIntensity_FreeStream();
157145

158-
nu_t = (TurbVar_i[0]*fv1); //S-A variable
159-
nu_cr = chi_2/rey;
160-
nu_BC = (nu_t)/(vmag*dist_i);
146+
su2double nu_t = (TurbVar_i[0]*fv1); //S-A variable
161147

162-
re_v = ((Density_i*pow(dist_i,2.))/(Laminar_Viscosity_i))*Omega;
163-
re_theta = re_v/2.193;
164-
re_theta_t = (803.73 * pow((tu + 0.6067),-1.027)); //MENTER correlation
148+
su2double re_v = ((Density_i*pow(dist_i,2.))/(Laminar_Viscosity_i))*Omega;
149+
su2double re_theta = re_v/2.193;
150+
su2double re_theta_t = (803.73 * pow((tu + 0.6067),-1.027)); //MENTER correlation
165151
//re_theta_t = 163.0 + exp(6.91-tu); //ABU-GHANNAM & SHAW correlation
166152

167-
term1 = sqrt(max(re_theta-re_theta_t,0.)/(chi_1*re_theta_t));
168-
term2 = sqrt(max(nu_BC-nu_cr,0.)/(nu_cr));
169-
term_exponential = (term1 + term2);
170-
gamma_BC = 1.0 - exp(-term_exponential);
153+
su2double term1 = sqrt(max(re_theta-re_theta_t,0.)/(chi_1*re_theta_t));
154+
su2double term2 = sqrt(max((nu_t*chi_2)/nu,0.));
155+
su2double term_exponential = (term1 + term2);
156+
su2double gamma_BC = 1.0 - exp(-term_exponential);
171157

172158
Production = gamma_BC*cb1*Shat*TurbVar_i[0]*Volume;
173159
}

0 commit comments

Comments
 (0)