Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ class CConfig {
Sens_Remove_Sharp, /*!< \brief Flag for removing or not the sharp edges from the sensitivity computation. */
Hold_GridFixed, /*!< \brief Flag hold fixed some part of the mesh during the deformation. */
Axisymmetric, /*!< \brief Flag for axisymmetric calculations */
Integrated_HeatFlux, /*!< \brief Flag for heat flux BC whether it deals with integrated values.*/
Buffet_Monitoring; /*!< \brief Flag for computing the buffet sensor.*/
Integrated_HeatFlux; /*!< \brief Flag for heat flux BC whether it deals with integrated values.*/
su2double Buffet_k; /*!< \brief Sharpness coefficient for buffet sensor.*/
su2double Buffet_lambda; /*!< \brief Offset parameter for buffet sensor.*/
su2double Damp_Engine_Inflow; /*!< \brief Damping factor for the engine inlet. */
Expand Down Expand Up @@ -5034,11 +5033,6 @@ class CConfig {
*/
unsigned short GetKind_ObjFunc(unsigned short val_obj = 0) const { return Kind_ObjFunc[val_obj]; }

/*!
* \brief Similar to GetKind_ObjFunc but returns the corresponding string.
*/
string GetName_ObjFunc(unsigned short val_obj = 0) const;

/*!
* \author H. Kline
* \brief Get the weight of objective function. There are several options: Drag coefficient,
Expand Down Expand Up @@ -5867,12 +5861,6 @@ class CConfig {
*/
unsigned short GetDesign_Variable(unsigned short val_dv) const { return Design_Variable[val_dv]; }

/*!
* \brief Provides the buffet monitoring information.
* \return Buffet monitoring information, if <code>TRUE</code> then the code will compute the buffet sensor.
*/
bool GetBuffet_Monitoring(void) const { return Buffet_Monitoring; }

/*!
* \brief Get the buffet sensor sharpness coefficient.
* \return Sharpness coefficient for buffet sensor.
Expand Down
4 changes: 2 additions & 2 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ enum ENUM_OBJECTIVE {
INVERSE_DESIGN_HEATFLUX = 6, /*!< \brief Heat flux objective function definition (inverse design). */
TOTAL_HEATFLUX = 7, /*!< \brief Total heat flux. */
MAXIMUM_HEATFLUX = 8, /*!< \brief Maximum heat flux. */
TOTAL_AVG_TEMPERATURE = 70, /*!< \brief Total averaged temperature. */
AVG_TEMPERATURE = 70, /*!< \brief Total averaged temperature. */
MOMENT_X_COEFFICIENT = 9, /*!< \brief Pitching moment objective function definition. */
MOMENT_Y_COEFFICIENT = 10, /*!< \brief Rolling moment objective function definition. */
MOMENT_Z_COEFFICIENT = 11, /*!< \brief Yawing objective function definition. */
Expand Down Expand Up @@ -1545,7 +1545,7 @@ static const MapType<string, ENUM_OBJECTIVE> Objective_Map = {
MakePair("TORQUE", TORQUE_COEFFICIENT)
MakePair("TOTAL_HEATFLUX", TOTAL_HEATFLUX)
MakePair("MAXIMUM_HEATFLUX", MAXIMUM_HEATFLUX)
MakePair("TOTAL_AVG_TEMPERATURE", TOTAL_AVG_TEMPERATURE)
MakePair("AVG_TEMPERATURE", AVG_TEMPERATURE)
MakePair("FIGURE_OF_MERIT", FIGURE_OF_MERIT)
MakePair("BUFFET", BUFFET_SENSOR)
MakePair("SURFACE_TOTAL_PRESSURE", SURFACE_TOTAL_PRESSURE)
Expand Down
17 changes: 2 additions & 15 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1594,8 +1594,6 @@ void CConfig::SetConfig_Options() {
/* DESCRIPTION: Evaluate a problem with engines */
addBoolOption("ENGINE", Engine, false);

/* DESCRIPTION: Compute buffet sensor */
addBoolOption("BUFFET_MONITORING", Buffet_Monitoring, false);
Comment on lines -1597 to -1598
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was cheap enough to compute by default.

/* DESCRIPTION: Sharpness coefficient for the buffet sensor */
addDoubleOption("BUFFET_K", Buffet_k, 10.0);
/* DESCRIPTION: Offset parameter for the buffet sensor */
Expand Down Expand Up @@ -3502,10 +3500,6 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
SU2_MPI::Error("Harmonic Balance not yet implemented for the incompressible solver.", CURRENT_FUNCTION);
}

if ((Kind_Solver != NAVIER_STOKES && Kind_Solver != RANS) && (Buffet_Monitoring == true)){
SU2_MPI::Error("Buffet monitoring incompatible with solvers other than NAVIER_STOKES and RANS", CURRENT_FUNCTION);
}

/*--- Check for Fluid model consistency ---*/

if (standard_air) {
Expand Down Expand Up @@ -7996,9 +7990,9 @@ string CConfig::GetObjFunc_Extension(string val_filename) const {
case TORQUE_COEFFICIENT: AdjExt = "_cq"; break;
case TOTAL_HEATFLUX: AdjExt = "_totheat"; break;
case MAXIMUM_HEATFLUX: AdjExt = "_maxheat"; break;
case TOTAL_AVG_TEMPERATURE: AdjExt = "_avtp"; break;
case AVG_TEMPERATURE: AdjExt = "_avtp"; break;
case FIGURE_OF_MERIT: AdjExt = "_merit"; break;
case BUFFET_SENSOR: AdjExt = "_buffet"; break;
case BUFFET_SENSOR: AdjExt = "_buffet"; break;
case SURFACE_TOTAL_PRESSURE: AdjExt = "_pt"; break;
case SURFACE_STATIC_PRESSURE: AdjExt = "_pe"; break;
case SURFACE_MASSFLOW: AdjExt = "_mfr"; break;
Expand Down Expand Up @@ -9305,13 +9299,6 @@ short CConfig::FindInterfaceMarker(unsigned short iInterface) const {
return -1;
}

string CConfig::GetName_ObjFunc(unsigned short val_obj) const {
for (auto item : Objective_Map)
if (item.second == static_cast<ENUM_OBJECTIVE>(Kind_ObjFunc[val_obj]))
return item.first;
return string();
}

void CConfig::Tick(double *val_start_time) {

#ifdef PROFILE
Expand Down
7 changes: 6 additions & 1 deletion Common/src/grid_movement/CVolumetricMovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc
nNonconvexElements++;
}
}
} else {
} else if (false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the section you refer to in #1171

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep


/*--- 3D elements ---*/
unsigned short iNode, iFace, nFaceNodes;
Expand All @@ -371,6 +371,8 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc

face_point_i = geometry->elem[iElem]->GetNode(geometry->elem[iElem]->GetFaces(iFace, iNode));

/// TODO: Faces may have up to 4 nodes, not all posibilities are covered

if (iNode == 0) {
face_point_j = geometry->elem[iElem]->GetNode(geometry->elem[iElem]->GetFaces(iFace, nFaceNodes-1));
face_point_k = geometry->elem[iElem]->GetNode(geometry->elem[iElem]->GetFaces(iFace, iNode+1));
Expand All @@ -391,6 +393,9 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc
/*--- Calculate cross product of edge vectors and its length---*/
su2double crossProduct[3];
GeometryToolbox::CrossProduct(edgeVector_i, edgeVector_j, crossProduct);

/// TODO: This logic is incorrect, the norm will never be less than 0

crossProductLength = GeometryToolbox::Norm(nDim, crossProduct);

/*--- Check if length is minimum or maximum ---*/
Expand Down
13 changes: 5 additions & 8 deletions SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
*/
class CAvgGrad_NEMO : public CNEMONumerics {
private:
unsigned short iDim, iVar; /*!< \brief Iterators in dimension an variable. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you get those as compiler warnings for unused variables? If yes, did you just use gcc with -Wall -Wextra or did you use any specific tool?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using clang with --warnlevel=2

su2double *Mean_PrimVar, /*!< \brief Mean primitive variables. */
unsigned short iVar; /*!< \brief Iterators in dimension an variable. */
su2double *Mean_PrimVar, /*!< \brief Mean primitive variables. */
*Mean_U,
**Mean_GU,
*Mean_dTdU,
Expand All @@ -54,9 +54,8 @@ class CAvgGrad_NEMO : public CNEMONumerics {
Mean_Eddy_Viscosity, /*!< \brief Mean value of the eddy viscosity. */
Mean_Thermal_Conductivity, /*!< \brief Mean value of the thermal conductivity. */
Mean_Thermal_Conductivity_ve, /*!< \brief Mean value of the vib-el. thermal conductivity. */
*ProjFlux, /*!< \brief Projection of the viscous fluxes. */
dist_ij; /*!< \brief Length of the edge and face. */

public:

/*!
Expand Down Expand Up @@ -109,13 +108,11 @@ class CAvgGradCorrected_NEMO : public CNEMONumerics {
Mean_Eddy_Viscosity, /*!< \brief Mean value of the eddy viscosity. */
Mean_Thermal_Conductivity, /*!< \brief Mean value of the thermal conductivity. */
Mean_Thermal_Conductivity_ve, /*!< \brief Mean value of the vib-el. thermal conductivity. */

*ProjFlux, /*!< \brief Projection of the viscous fluxes. */
dist_ij; /*!< \brief Length of the edge and face. */
bool implicit; /*!< \brief Implicit calculus. */

su2double* Flux = nullptr; /*!< \brief The flux / residual across the edge. */

public:

/*!
Expand All @@ -142,5 +139,5 @@ class CAvgGradCorrected_NEMO : public CNEMONumerics {
* \param[in] config - Definition of the particular problem.
*/
ResidualType<> ComputeResidual(const CConfig* config) final;

};
14 changes: 0 additions & 14 deletions SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class CDiscAdjFEASolver final : public CSolver {
su2double *Solution_Vel = nullptr, /*!< \brief Velocity componenent of the solution. */
*Solution_Accel = nullptr; /*!< \brief Acceleration componenent of the solution. */

su2double ObjFunc_Value = 0.0; /*!< \brief Value of the objective function. */
su2double *normalLoads = nullptr; /*!< \brief Values of the normal loads for each marker iMarker_nL. */

unsigned short nMPROP = 0; /*!< \brief Number of material properties */
Expand Down Expand Up @@ -160,12 +159,6 @@ class CDiscAdjFEASolver final : public CSolver {
*/
void ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config) override;

/*!
* \brief Register the objective function as output.
* \param[in] geometry - The geometrical definition of the problem.
*/
void RegisterObj_Func(CConfig *config) override;

/*!
* \brief Set the surface sensitivity.
* \param[in] geometry - Geometrical definition of the problem.
Expand All @@ -180,13 +173,6 @@ class CDiscAdjFEASolver final : public CSolver {
*/
void SetSensitivity(CGeometry *geometry, CConfig *config, CSolver*) override;

/*!
* \brief Set the objective function.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
*/
void SetAdj_ObjFunc(CGeometry *geometry, CConfig* config) override;

/*!
* \brief Provide the total Young's modulus sensitivity
* \return Value of the total Young's modulus sensitivity
Expand Down
1 change: 0 additions & 1 deletion SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
*/
class CDiscAdjMeshSolver final : public CSolver {
private:
unsigned short KindDirect_Solver = 0;
CSolver *direct_solver = nullptr;

CDiscAdjMeshBoundVariable* nodes = nullptr; /*!< \brief Variables of the discrete adjoint mesh solver. */
Expand Down
14 changes: 0 additions & 14 deletions SU2_CFD/include/solvers/CDiscAdjSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class CDiscAdjSolver final : public CSolver {
su2double Total_Sens_BPress; /*!< \brief Total sensitivity to outlet pressure. */
su2double Total_Sens_Density; /*!< \brief Total sensitivity to initial density (incompressible). */
su2double Total_Sens_ModVel; /*!< \brief Total sensitivity to inlet velocity (incompressible). */
su2double ObjFunc_Value; /*!< \brief Value of the objective function. */
su2double Mach, Alpha, Beta, Pressure, Temperature, BPressure, ModVel;
su2double TemperatureRad, Total_Sens_Temp_Rad;

Expand Down Expand Up @@ -140,12 +139,6 @@ class CDiscAdjSolver final : public CSolver {
*/
void ExtractAdjoint_Geometry(CGeometry *geometry, CConfig *config) override;

/*!
* \brief Register the objective function as output.
* \param[in] geometry - The geometrical definition of the problem.
*/
void RegisterObj_Func(CConfig *config) override;

/*!
* \brief Set the surface sensitivity.
* \param[in] geometry - Geometrical definition of the problem.
Expand All @@ -160,13 +153,6 @@ class CDiscAdjSolver final : public CSolver {
*/
void SetSensitivity(CGeometry *geometry, CConfig *config, CSolver*) override;

/*!
* \brief Set the objective function.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
*/
void SetAdj_ObjFunc(CGeometry *geometry, CConfig* config) override;

/*!
* \brief Provide the total shape sensitivity coefficient.
* \return Value of the geometrical sensitivity coefficient
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/solvers/CEulerSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class CEulerSolver : public CFVMFlowSolverBase<CEulerVariable, COMPRESSIBLE> {
* \brief Compute weighted-sum "combo" objective output
* \param[in] config - Definition of the particular problem.
*/
void Evaluate_ObjFunc(CConfig *config) override;
void Evaluate_ObjFunc(const CConfig *config) override;

/*!
* \brief Impose the far-field boundary condition using characteristics.
Expand Down
Loading