Skip to content

Commit 9efe761

Browse files
authored
Merge pull request #1476 from su2code/solver_index_cleanup
Using the primitive variable index classes in more places (+ minor chores)
2 parents 0f226fe + fb59ee7 commit 9efe761

29 files changed

+155
-269
lines changed

Common/include/CConfig.hpp

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,7 @@ class CConfig {
146146
su2double dCMx_dCL; /*!< \brief Fixed Cl mode derivate. */
147147
su2double dCMy_dCL; /*!< \brief Fixed Cl mode derivate. */
148148
su2double dCMz_dCL; /*!< \brief Fixed Cl mode derivate. */
149-
su2double dCD_dCMy; /*!< \brief Fixed Cl mode derivate. */
150149
su2double CL_Target; /*!< \brief Fixed Cl mode Target Cl. */
151-
su2double CM_Target; /*!< \brief Fixed Cl mode Target CM. */
152-
su2double *HTP_Min_XCoord,
153-
*HTP_Min_YCoord; /*!< \brief Identification of the HTP. */
154150
TIME_MARCHING TimeMarching; /*!< \brief Steady or unsteady (time stepping or dual time stepping) computation. */
155151
unsigned short Dynamic_Analysis; /*!< \brief Static or dynamic structural analysis. */
156152
unsigned short nStartUpIter; /*!< \brief Start up iterations using the fine grid. */
@@ -640,11 +636,9 @@ class CConfig {
640636
iH, AoS, AoA_Offset,
641637
AoS_Offset, AoA_Sens; /*!< \brief Angle of sideSlip (just external flow). */
642638
bool Fixed_CL_Mode; /*!< \brief Activate fixed CL mode (external flow only). */
643-
bool Fixed_CM_Mode; /*!< \brief Activate fixed CL mode (external flow only). */
644639
bool Eval_dOF_dCX; /*!< \brief Activate fixed CL mode (external flow only). */
645640
bool Discard_InFiles; /*!< \brief Discard angle of attack in solution and geometry files. */
646641
su2double Target_CL; /*!< \brief Specify a target CL instead of AoA (external flow only). */
647-
su2double Target_CM; /*!< \brief Specify a target CM instead of AoA (external flow only). */
648642
su2double Total_CM; /*!< \brief Specify a Total CM instead of AoA (external flow only). */
649643
su2double Total_CD; /*!< \brief Specify a target CD instead of AoA (external flow only). */
650644
su2double dCL_dAlpha; /*!< \brief value of dCl/dAlpha. */
@@ -660,7 +654,6 @@ class CConfig {
660654
bool Update_AoA; /*!< \brief Boolean flag for whether to update the AoA for fixed lift mode on a given iteration. */
661655
unsigned long Update_AoA_Iter_Limit; /*!< \brief Limit on number of iterations between AoA updates for fixed lift mode. */
662656
bool Finite_Difference_Mode; /*!< \brief Flag to run the finite difference mode in fixed Cl mode. */
663-
bool Update_HTPIncidence; /*!< \brief Boolean flag for whether to update the AoA for fixed lift mode on a given iteration. */
664657
su2double ChargeCoeff; /*!< \brief Charge coefficient (just for poisson problems). */
665658
unsigned short Cauchy_Func_Flow, /*!< \brief Function where to apply the convergence criteria in the flow problem. */
666659
Cauchy_Func_AdjFlow, /*!< \brief Function where to apply the convergence criteria in the adjoint problem. */
@@ -1069,7 +1062,6 @@ class CConfig {
10691062
rampOutPres_coeff[3], /*!< \brief ramp outlet pressure coefficients for the COption class. */
10701063
jst_adj_coeff[2], /*!< \brief artificial dissipation (adjoint) array for the COption class. */
10711064
ad_coeff_heat[2], /*!< \brief artificial dissipation (heat) array for the COption class. */
1072-
obj_coeff[5], /*!< \brief objective array for the COption class. */
10731065
mesh_box_length[3], /*!< \brief mesh box length for the COption class. */
10741066
mesh_box_offset[3], /*!< \brief mesh box offset for the COption class. */
10751067
geo_loc[2], /*!< \brief SU2_GEO section locations array for the COption class. */
@@ -1151,7 +1143,7 @@ class CConfig {
11511143
POD_KIND POD_Basis_Gen; /*!< \brief Type of POD basis generation (static or incremental). */
11521144
unsigned short maxBasisDim, /*!< \brief Maximum number of POD basis dimensions. */
11531145
rom_save_freq; /*!< \brief Frequency of unsteady time steps to save. */
1154-
1146+
11551147
/* other NEMO configure options*/
11561148
unsigned short nSpecies, /*!< \brief No of species present in flow */
11571149
iWall_Catalytic,
@@ -1554,12 +1546,6 @@ class CConfig {
15541546
*/
15551547
bool GetCFL_Adapt(void) const { return CFL_Adapt; }
15561548

1557-
/*!
1558-
* \brief Get the values of the CFL adapation.
1559-
* \return Value of CFL adapation
1560-
*/
1561-
su2double GetHTP_Axis(unsigned short val_index) const { return htp_axis[val_index]; }
1562-
15631549
/*!
15641550
* \brief Get the value of the limits for the sections.
15651551
* \return Value of the limits for the sections.
@@ -5191,15 +5177,6 @@ class CConfig {
51915177
*/
51925178
void SetWeight_ObjFunc(unsigned short val_obj, su2double val) { Weight_ObjFunc[val_obj] = val; }
51935179

5194-
/*!
5195-
* \author H. Kline
5196-
* \brief Get the coefficients of the objective defined by the chain rule with primitive variables.
5197-
* \note This objective is only applicable to gradient calculations. Objective value must be
5198-
* calculated using the area averaged outlet values of density, velocity, and pressure.
5199-
* Gradients are w.r.t density, velocity[3], and pressure. when 2D gradient w.r.t. 3rd component of velocity set to 0.
5200-
*/
5201-
su2double GetCoeff_ObjChainRule(unsigned short iVar) const { return obj_coeff[iVar]; }
5202-
52035180
/*!
52045181
* \brief Get the kind of sensitivity smoothing technique.
52055182
* \return Kind of sensitivity smoothing technique.
@@ -6253,18 +6230,6 @@ class CConfig {
62536230
*/
62546231
su2double GetFixAzimuthalLine(void) const { return FixAzimuthalLine; }
62556232

6256-
/*!
6257-
* \brief Value of the weight of the CD, CL, CM optimization.
6258-
* \return Value of the weight of the CD, CL, CM optimization.
6259-
*/
6260-
su2double GetdCD_dCMy(void) const { return dCD_dCMy; }
6261-
6262-
/*!
6263-
* \brief Value of the weight of the CD, CL, CM optimization.
6264-
* \return Value of the weight of the CD, CL, CM optimization.
6265-
*/
6266-
su2double GetCM_Target(void) const { return CM_Target; }
6267-
62686233
/*!
62696234
* \brief Value of the weight of the CD, CL, CM optimization.
62706235
* \return Value of the weight of the CD, CL, CM optimization.
@@ -6325,12 +6290,6 @@ class CConfig {
63256290
*/
63266291
void SetdCM_diH(su2double val_dcm_dhi) { dCM_diH = val_dcm_dhi; }
63276292

6328-
/*!
6329-
* \brief Value of the weight of the CD, CL, CM optimization.
6330-
* \return Value of the weight of the CD, CL, CM optimization.
6331-
*/
6332-
void SetdCD_dCMy(su2double val_dcd_dcmy) { dCD_dCMy = val_dcd_dcmy; }
6333-
63346293
/*!
63356294
* \brief Value of the weight of the CD, CL, CM optimization.
63366295
* \return Value of the weight of the CD, CL, CM optimization.
@@ -8347,12 +8306,6 @@ class CConfig {
83478306
*/
83488307
bool GetFixed_CL_Mode(void) const { return Fixed_CL_Mode; }
83498308

8350-
/*!
8351-
* \brief Get information about whether to use fixed CL mode.
8352-
* \return <code>TRUE</code> if fixed CL mode is active; otherwise <code>FALSE</code>.
8353-
*/
8354-
bool GetFixed_CM_Mode(void) const { return Fixed_CM_Mode; }
8355-
83568309
/*!
83578310
* \brief Get information about whether to use fixed CL mode.
83588311
* \return <code>TRUE</code> if fixed CL mode is active; otherwise <code>FALSE</code>.
@@ -9500,25 +9453,25 @@ class CConfig {
95009453
* \return True if specified in config file.
95019454
*/
95029455
bool GetSave_libROM(void) const {return libROM; }
9503-
9456+
95049457
/*!
95059458
* \brief Get the name of the file for libROM to save.
95069459
* \return Filename prefix for libROM to save to (default: "su2").
95079460
*/
95089461
string GetlibROMbase_FileName(void) const { return libROMbase_FileName; }
9509-
9462+
95109463
/*!
95119464
* \brief Static or incremental toggle for POD basis generation type.
95129465
* \return Type of POD generation type
95139466
*/
95149467
POD_KIND GetKind_PODBasis(void) const { return POD_Basis_Gen; }
9515-
9468+
95169469
/*!
95179470
* \brief Get maximum number of POD basis dimensions (default: 100).
95189471
* \return Maximum number of POD basis vectors.
95199472
*/
95209473
unsigned short GetMax_BasisDim(void) const { return maxBasisDim; }
9521-
9474+
95229475
/*!
95239476
* \brief Get frequency of unsteady time steps to save (default: 1).
95249477
* \return Save frequency for unsteady time steps.

Common/include/option_structure.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,17 +716,13 @@ enum ENUM_GRIDMOVEMENT {
716716
NO_MOVEMENT = 0, /*!< \brief Simulation on a static mesh. */
717717
RIGID_MOTION = 2, /*!< \brief Simulation with rigid mesh motion (plunging/pitching/rotation). */
718718
ROTATING_FRAME = 8, /*!< \brief Simulation in a rotating frame. */
719-
ELASTICITY = 9, /*!< \brief Linear Elasticity. */
720719
STEADY_TRANSLATION = 11, /*!< \brief Simulation in a steadily translating frame. */
721720
GUST = 12, /*!< \brief Simulation on a static mesh with a gust. */
722-
MOVING_HTP = 13, /*!< \brief Simulation with moving HTP (rotation). */
723721
};
724722
static const MapType<std::string, ENUM_GRIDMOVEMENT> GridMovement_Map = {
725723
MakePair("NONE", NO_MOVEMENT)
726724
MakePair("RIGID_MOTION", RIGID_MOTION)
727725
MakePair("ROTATING_FRAME", ROTATING_FRAME)
728-
MakePair("ELASTICITY", ELASTICITY)
729-
MakePair("MOVING_HTP", MOVING_HTP)
730726
MakePair("STEADY_TRANSLATION", STEADY_TRANSLATION)
731727
MakePair("GUST", GUST)
732728
};

Common/src/CConfig.cpp

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,16 +1354,12 @@ void CConfig::SetConfig_Options() {
13541354
addDoubleOption("AOA", AoA, 0.0);
13551355
/* DESCRIPTION: Activate fixed CL mode (specify a CL instead of AoA). */
13561356
addBoolOption("FIXED_CL_MODE", Fixed_CL_Mode, false);
1357-
/* DESCRIPTION: Activate fixed CM mode (specify a CM instead of iH). */
1358-
addBoolOption("FIXED_CM_MODE", Fixed_CM_Mode, false);
13591357
/* DESCRIPTION: Evaluate the dOF_dCL or dOF_dCMy during run time. */
13601358
addBoolOption("EVAL_DOF_DCX", Eval_dOF_dCX, false);
13611359
/* DESCRIPTION: DIscard the angle of attack in the solution and the increment in the geometry files. */
13621360
addBoolOption("DISCARD_INFILES", Discard_InFiles, false);
13631361
/* DESCRIPTION: Specify a fixed coefficient of lift instead of AoA (only for compressible flows) */
13641362
addDoubleOption("TARGET_CL", Target_CL, 0.0);
1365-
/* DESCRIPTION: Specify a fixed coefficient of lift instead of AoA (only for compressible flows) */
1366-
addDoubleOption("TARGET_CM", Target_CM, 0.0);
13671363
/* DESCRIPTION: Damping factor for fixed CL mode. */
13681364
addDoubleOption("DCL_DALPHA", dCL_dAlpha, 0.2);
13691365
/* DESCRIPTION: Damping factor for fixed CL mode. */
@@ -1785,8 +1781,6 @@ void CConfig::SetConfig_Options() {
17851781
/*!\par CONFIG_CATEGORY: Convergence\ingroup Config*/
17861782
/*--- Options related to convergence ---*/
17871783

1788-
// This option is deprecated. After a grace period until 7.2.0 the usage warning should become an error.
1789-
addStringOption("CONV_CRITERIA", ConvCriteria, "this option is deprecated");
17901784
/*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 \ingroup Config*/
17911785
addDoubleOption("CONV_RESIDUAL_MINVAL", MinLogResidual, -14.0);
17921786
/*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup Config*/
@@ -1944,16 +1938,6 @@ void CConfig::SetConfig_Options() {
19441938
/* DESCRIPTION: parameter for the definition of a complex objective function */
19451939
addDoubleOption("DCMZ_DCL_VALUE", dCMz_dCL, 0.0);
19461940

1947-
/* DESCRIPTION: parameter for the definition of a complex objective function */
1948-
addDoubleOption("DCD_DCMY_VALUE", dCD_dCMy, 0.0);
1949-
1950-
obj_coeff[0]=0.0; obj_coeff[1]=0.0; obj_coeff[2]=0.0; obj_coeff[3]=0.0; obj_coeff[4]=0.0;
1951-
/*!\brief OBJ_CHAIN_RULE_COEFF
1952-
* \n DESCRIPTION: Coefficients defining the objective function gradient using the chain rule
1953-
* with area-averaged outlet primitive variables. This is used with the genereralized outflow
1954-
* objective. \ingroup Config */
1955-
addDoubleArrayOption("OBJ_CHAIN_RULE_COEFF", 5, obj_coeff);
1956-
19571941
geo_loc[0] = 0.0; geo_loc[1] = 1.0;
19581942
/* DESCRIPTION: Definition of the airfoil section */
19591943
addDoubleArrayOption("GEO_BOUNDS", 2, geo_loc);
@@ -2966,19 +2950,18 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
29662950
newString.append("UNST_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n");
29672951
else if (!option_name.compare("DYN_RESTART_ITER"))
29682952
newString.append("DYN_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n");
2969-
// This option is deprecated. After a grace period until 7.2.0 the usage warning should become an error.
2970-
/*else if (!option_name.compare("CONV_CRITERIA"))
2971-
newString.append(string("CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n") +
2972-
string("RESIDUAL for any RMS_* BGS_* value. CAUCHY for coefficients like DRAG etc.\n\n"));*/
2973-
if (!option_name.compare("THERMAL_DIFFUSIVITY"))
2953+
else if (!option_name.compare("CONV_CRITERIA"))
2954+
newString.append("CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n"
2955+
"RESIDUAL for any RMS_* BGS_* value. CAUCHY for coefficients like DRAG etc.\n\n");
2956+
else if (!option_name.compare("THERMAL_DIFFUSIVITY"))
29742957
newString.append("THERMAL_DIFFUSIVITY is deprecated. See the INC_ENERGY_EQUATION options instead.\n\n");
2975-
if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID"))
2958+
else if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID"))
29762959
newString.append("THERMAL_DIFFUSIVITY_SOLID is deprecated. Set THERMAL_CONDUCTIVITY_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n");
2977-
if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY"))
2960+
else if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY"))
29782961
newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use THERMAL_CONDUCTIVITY_CONSTANT instead.\n\n");
2979-
if (!option_name.compare("SOLID_DENSITY"))
2962+
else if (!option_name.compare("SOLID_DENSITY"))
29802963
newString.append("SOLID_DENSITY is deprecated. Use MATERIAL_DENSITY instead.\n\n");
2981-
if (!option_name.compare("SOLID_TEMPERATURE_INIT"))
2964+
else if (!option_name.compare("SOLID_TEMPERATURE_INIT"))
29822965
newString.append("SOLID_TEMPERATURE_INIT is deprecated. Use FREESTREAM_TEMPERATURE instead.\n\n");
29832966
else {
29842967
/*--- Find the most likely candidate for the unrecognized option, based on the length
@@ -3378,12 +3361,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
33783361
}
33793362
}
33803363

3381-
/*--- Fixed CM mode requires a static movement of the grid ---*/
3382-
3383-
if (Fixed_CM_Mode) {
3384-
Kind_GridMovement = MOVING_HTP;
3385-
}
3386-
33873364
/*--- Initialize the AoA and Sideslip variables for the incompressible
33883365
solver. This is typically unused (often internal flows). Also fixed CL
33893366
mode for incompressible flows is not implemented ---*/
@@ -4534,7 +4511,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
45344511
the AoA with each iteration to false ---*/
45354512

45364513
if (Fixed_CL_Mode) Update_AoA = false;
4537-
if (Fixed_CM_Mode) Update_HTPIncidence = false;
45384514

45394515
if (DirectDiff != NO_DERIVATIVE) {
45404516
#ifndef CODI_FORWARD_TYPE
@@ -4603,11 +4579,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
46034579

46044580
if (!ContinuousAdjoint & !DiscreteAdjoint) {
46054581
if (Fixed_CL_Mode) nInnerIter += Iter_dCL_dAlpha;
4606-
4607-
if (Fixed_CM_Mode) {
4608-
nInnerIter += Iter_dCL_dAlpha;
4609-
MinLogResidual = -24;
4610-
}
46114582
}
46124583

46134584
/* --- Set Finite Difference mode to false by default --- */
@@ -5233,11 +5204,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
52335204

52345205
} // species transport checks
52355206

5236-
// This option is deprecated. After a grace period until 7.2.0 the usage warning should become an error.
5237-
if(OptionIsSet("CONV_CRITERIA") && rank == MASTER_NODE) {
5238-
cout << "\n\nWARNING: CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n"
5239-
"That is, RESIDUAL for any RMS_* BGS_* value, and CAUCHY for coefficients such as DRAG etc.\n" << endl;
5240-
}
52415207
}
52425208

52435209
void CConfig::SetMarkers(SU2_COMPONENT val_software) {
@@ -5892,10 +5858,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
58925858
if (Fixed_CL_Mode) {
58935859
cout << "Fixed CL mode, target value: " << Target_CL << "." << endl;
58945860
}
5895-
if (Fixed_CM_Mode) {
5896-
cout << "Fixed CM mode, target value: " << Target_CM << "." << endl;
5897-
cout << "HTP rotation axis (X,Z): ("<< htp_axis[0] <<", "<< htp_axis[1] <<")."<< endl;
5898-
}
58995861
}
59005862

59015863
if (EquivArea) {
@@ -5909,7 +5871,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
59095871
switch (Kind_GridMovement) {
59105872
case NO_MOVEMENT: cout << "no direct movement." << endl; break;
59115873
case RIGID_MOTION: cout << "rigid mesh motion." << endl; break;
5912-
case MOVING_HTP: cout << "HTP moving." << endl; break;
59135874
case ROTATING_FRAME: cout << "rotating reference frame." << endl; break;
59145875
case EXTERNAL: cout << "externally prescribed motion." << endl; break;
59155876
}
@@ -6254,7 +6215,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
62546215
switch (Kind_ObjFunc[0]) {
62556216
case DRAG_COEFFICIENT: cout << "CD objective function";
62566217
if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCD/dCL = " << dCD_dCL << "." << endl; }
6257-
else if (Fixed_CM_Mode) { cout << " using fixed CMy mode, dCD/dCMy = " << dCD_dCMy << "." << endl; }
62586218
else { cout << "." << endl; }
62596219
break;
62606220
case LIFT_COEFFICIENT: cout << "CL objective function." << endl; break;

Common/src/geometry/CGeometry.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,8 +2544,7 @@ void CGeometry::ComputeSurf_Straightness(CConfig *config,
25442544
other GridMovements are rigid. ---*/
25452545
if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE ||
25462546
config->GetMarker_All_KindBC(iMarker) == EULER_WALL) &&
2547-
config->GetMarker_Moving_Bool(Local_TagBound) == false &&
2548-
config->GetKind_GridMovement() != ELASTICITY) {
2547+
!config->GetMarker_Moving_Bool(Local_TagBound)) {
25492548

25502549
/*--- Loop over all global markers, and find the local-global pair via
25512550
matching unique string tags. ---*/

0 commit comments

Comments
 (0)