Skip to content

Commit 16a7e47

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into feature_Sobolev_smoothing_solver
2 parents f738172 + f23b907 commit 16a7e47

61 files changed

Lines changed: 908 additions & 987 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@
1818
[submodule "externals/opdi"]
1919
path = externals/opdi
2020
url = https://github.com/SciCompKL/OpDiLib
21+
[submodule "externals/mel"]
22+
path = externals/mel
23+
url = https://github.com/pcarruscag/MEL.git

Common/include/CConfig.hpp

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class CConfig {
8080
su2double EA_ScaleFactor; /*!< \brief Equivalent Area scaling factor */
8181
su2double AdjointLimit; /*!< \brief Adjoint variable limit */
8282
string* ConvField; /*!< \brief Field used for convergence check.*/
83-
string ConvCriteria; // This option is deprecated. After a grace period until 7.2.0 the usage warning should become an error.
8483

8584
string* WndConvField; /*!< \brief Function where to apply the windowed convergence criteria for the time average of the unsteady (single zone) flow problem. */
8685
unsigned short nConvField; /*!< \brief Number of fields used to monitor convergence.*/
@@ -146,11 +145,7 @@ class CConfig {
146145
su2double dCMx_dCL; /*!< \brief Fixed Cl mode derivate. */
147146
su2double dCMy_dCL; /*!< \brief Fixed Cl mode derivate. */
148147
su2double dCMz_dCL; /*!< \brief Fixed Cl mode derivate. */
149-
su2double dCD_dCMy; /*!< \brief Fixed Cl mode derivate. */
150148
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. */
154149
TIME_MARCHING TimeMarching; /*!< \brief Steady or unsteady (time stepping or dual time stepping) computation. */
155150
unsigned short Dynamic_Analysis; /*!< \brief Static or dynamic structural analysis. */
156151
unsigned short nStartUpIter; /*!< \brief Start up iterations using the fine grid. */
@@ -454,7 +449,7 @@ class CConfig {
454449
unsigned long Grad_Linear_Solver_Iter; /*!< \brief Max iterations of the linear solver for the gradient smoothing. */
455450

456451
bool ReorientElements; /*!< \brief Flag for enabling element reorientation. */
457-
bool AddIndNeighbor; /*!< \brief Include indirect neighbor in the agglomeration process. */
452+
string CustomObjFunc; /*!< \brief User-defined objective function. */
458453
unsigned short nDV, /*!< \brief Number of design variables. */
459454
nObj, nObjW; /*! \brief Number of objective functions. */
460455
unsigned short* nDV_Value; /*!< \brief Number of values for each design variable (might be different than 1 if we allow arbitrary movement). */
@@ -654,11 +649,9 @@ class CConfig {
654649
iH, AoS, AoA_Offset,
655650
AoS_Offset, AoA_Sens; /*!< \brief Angle of sideSlip (just external flow). */
656651
bool Fixed_CL_Mode; /*!< \brief Activate fixed CL mode (external flow only). */
657-
bool Fixed_CM_Mode; /*!< \brief Activate fixed CL mode (external flow only). */
658652
bool Eval_dOF_dCX; /*!< \brief Activate fixed CL mode (external flow only). */
659653
bool Discard_InFiles; /*!< \brief Discard angle of attack in solution and geometry files. */
660654
su2double Target_CL; /*!< \brief Specify a target CL instead of AoA (external flow only). */
661-
su2double Target_CM; /*!< \brief Specify a target CM instead of AoA (external flow only). */
662655
su2double Total_CM; /*!< \brief Specify a Total CM instead of AoA (external flow only). */
663656
su2double Total_CD; /*!< \brief Specify a target CD instead of AoA (external flow only). */
664657
su2double dCL_dAlpha; /*!< \brief value of dCl/dAlpha. */
@@ -674,7 +667,6 @@ class CConfig {
674667
bool Update_AoA; /*!< \brief Boolean flag for whether to update the AoA for fixed lift mode on a given iteration. */
675668
unsigned long Update_AoA_Iter_Limit; /*!< \brief Limit on number of iterations between AoA updates for fixed lift mode. */
676669
bool Finite_Difference_Mode; /*!< \brief Flag to run the finite difference mode in fixed Cl mode. */
677-
bool Update_HTPIncidence; /*!< \brief Boolean flag for whether to update the AoA for fixed lift mode on a given iteration. */
678670
su2double ChargeCoeff; /*!< \brief Charge coefficient (just for poisson problems). */
679671
unsigned short Cauchy_Func_Flow, /*!< \brief Function where to apply the convergence criteria in the flow problem. */
680672
Cauchy_Func_AdjFlow, /*!< \brief Function where to apply the convergence criteria in the adjoint problem. */
@@ -1088,7 +1080,6 @@ class CConfig {
10881080
rampOutPres_coeff[3], /*!< \brief ramp outlet pressure coefficients for the COption class. */
10891081
jst_adj_coeff[2], /*!< \brief artificial dissipation (adjoint) array for the COption class. */
10901082
ad_coeff_heat[2], /*!< \brief artificial dissipation (heat) array for the COption class. */
1091-
obj_coeff[5], /*!< \brief objective array for the COption class. */
10921083
mesh_box_length[3], /*!< \brief mesh box length for the COption class. */
10931084
mesh_box_offset[3], /*!< \brief mesh box offset for the COption class. */
10941085
geo_loc[2], /*!< \brief SU2_GEO section locations array for the COption class. */
@@ -1170,7 +1161,7 @@ class CConfig {
11701161
POD_KIND POD_Basis_Gen; /*!< \brief Type of POD basis generation (static or incremental). */
11711162
unsigned short maxBasisDim, /*!< \brief Maximum number of POD basis dimensions. */
11721163
rom_save_freq; /*!< \brief Frequency of unsteady time steps to save. */
1173-
1164+
11741165
/* other NEMO configure options*/
11751166
unsigned short nSpecies, /*!< \brief No of species present in flow */
11761167
iWall_Catalytic,
@@ -1573,12 +1564,6 @@ class CConfig {
15731564
*/
15741565
bool GetCFL_Adapt(void) const { return CFL_Adapt; }
15751566

1576-
/*!
1577-
* \brief Get the values of the CFL adapation.
1578-
* \return Value of CFL adapation
1579-
*/
1580-
su2double GetHTP_Axis(unsigned short val_index) const { return htp_axis[val_index]; }
1581-
15821567
/*!
15831568
* \brief Get the value of the limits for the sections.
15841569
* \return Value of the limits for the sections.
@@ -5231,13 +5216,9 @@ class CConfig {
52315216
void SetWeight_ObjFunc(unsigned short val_obj, su2double val) { Weight_ObjFunc[val_obj] = val; }
52325217

52335218
/*!
5234-
* \author H. Kline
5235-
* \brief Get the coefficients of the objective defined by the chain rule with primitive variables.
5236-
* \note This objective is only applicable to gradient calculations. Objective value must be
5237-
* calculated using the area averaged outlet values of density, velocity, and pressure.
5238-
* Gradients are w.r.t density, velocity[3], and pressure. when 2D gradient w.r.t. 3rd component of velocity set to 0.
5219+
* \brief Get the user expression for the custom objective function.
52395220
*/
5240-
su2double GetCoeff_ObjChainRule(unsigned short iVar) const { return obj_coeff[iVar]; }
5221+
const string& GetCustomObjFunc() const { return CustomObjFunc; }
52415222

52425223
/*!
52435224
* \brief Get the kind of sensitivity smoothing technique.
@@ -5531,12 +5512,6 @@ class CConfig {
55315512
*/
55325513
string GetObjFunc_Extension(string val_filename) const;
55335514

5534-
/*!
5535-
* \brief Get the criteria for structural residual (relative/absolute).
5536-
* \return Relative/Absolute criteria for structural convergence.
5537-
*/
5538-
unsigned short GetResidual_Criteria_FEM(void) const { return Res_FEM_CRIT; }
5539-
55405515
/*!
55415516
* \brief Get functional that is going to be used to evaluate the residual flow convergence.
55425517
* \return Functional that is going to be used to evaluate the residual flow convergence.
@@ -6298,18 +6273,6 @@ class CConfig {
62986273
*/
62996274
su2double GetFixAzimuthalLine(void) const { return FixAzimuthalLine; }
63006275

6301-
/*!
6302-
* \brief Value of the weight of the CD, CL, CM optimization.
6303-
* \return Value of the weight of the CD, CL, CM optimization.
6304-
*/
6305-
su2double GetdCD_dCMy(void) const { return dCD_dCMy; }
6306-
6307-
/*!
6308-
* \brief Value of the weight of the CD, CL, CM optimization.
6309-
* \return Value of the weight of the CD, CL, CM optimization.
6310-
*/
6311-
su2double GetCM_Target(void) const { return CM_Target; }
6312-
63136276
/*!
63146277
* \brief Value of the weight of the CD, CL, CM optimization.
63156278
* \return Value of the weight of the CD, CL, CM optimization.
@@ -6370,12 +6333,6 @@ class CConfig {
63706333
*/
63716334
void SetdCM_diH(su2double val_dcm_dhi) { dCM_diH = val_dcm_dhi; }
63726335

6373-
/*!
6374-
* \brief Value of the weight of the CD, CL, CM optimization.
6375-
* \return Value of the weight of the CD, CL, CM optimization.
6376-
*/
6377-
void SetdCD_dCMy(su2double val_dcd_dcmy) { dCD_dCMy = val_dcd_dcmy; }
6378-
63796336
/*!
63806337
* \brief Value of the weight of the CD, CL, CM optimization.
63816338
* \return Value of the weight of the CD, CL, CM optimization.
@@ -8398,12 +8355,6 @@ class CConfig {
83988355
*/
83998356
bool GetFixed_CL_Mode(void) const { return Fixed_CL_Mode; }
84008357

8401-
/*!
8402-
* \brief Get information about whether to use fixed CL mode.
8403-
* \return <code>TRUE</code> if fixed CL mode is active; otherwise <code>FALSE</code>.
8404-
*/
8405-
bool GetFixed_CM_Mode(void) const { return Fixed_CM_Mode; }
8406-
84078358
/*!
84088359
* \brief Get information about whether to use fixed CL mode.
84098360
* \return <code>TRUE</code> if fixed CL mode is active; otherwise <code>FALSE</code>.
@@ -9551,25 +9502,25 @@ class CConfig {
95519502
* \return True if specified in config file.
95529503
*/
95539504
bool GetSave_libROM(void) const {return libROM; }
9554-
9505+
95559506
/*!
95569507
* \brief Get the name of the file for libROM to save.
95579508
* \return Filename prefix for libROM to save to (default: "su2").
95589509
*/
95599510
string GetlibROMbase_FileName(void) const { return libROMbase_FileName; }
9560-
9511+
95619512
/*!
95629513
* \brief Static or incremental toggle for POD basis generation type.
95639514
* \return Type of POD generation type
95649515
*/
95659516
POD_KIND GetKind_PODBasis(void) const { return POD_Basis_Gen; }
9566-
9517+
95679518
/*!
95689519
* \brief Get maximum number of POD basis dimensions (default: 100).
95699520
* \return Maximum number of POD basis vectors.
95709521
*/
95719522
unsigned short GetMax_BasisDim(void) const { return maxBasisDim; }
9572-
9523+
95739524
/*!
95749525
* \brief Get frequency of unsteady time steps to save (default: 1).
95759526
* \return Save frequency for unsteady time steps.

Common/include/option_structure.hpp

Lines changed: 12 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -721,17 +721,13 @@ enum ENUM_GRIDMOVEMENT {
721721
NO_MOVEMENT = 0, /*!< \brief Simulation on a static mesh. */
722722
RIGID_MOTION = 2, /*!< \brief Simulation with rigid mesh motion (plunging/pitching/rotation). */
723723
ROTATING_FRAME = 8, /*!< \brief Simulation in a rotating frame. */
724-
ELASTICITY = 9, /*!< \brief Linear Elasticity. */
725724
STEADY_TRANSLATION = 11, /*!< \brief Simulation in a steadily translating frame. */
726725
GUST = 12, /*!< \brief Simulation on a static mesh with a gust. */
727-
MOVING_HTP = 13, /*!< \brief Simulation with moving HTP (rotation). */
728726
};
729727
static const MapType<std::string, ENUM_GRIDMOVEMENT> GridMovement_Map = {
730728
MakePair("NONE", NO_MOVEMENT)
731729
MakePair("RIGID_MOTION", RIGID_MOTION)
732730
MakePair("ROTATING_FRAME", ROTATING_FRAME)
733-
MakePair("ELASTICITY", ELASTICITY)
734-
MakePair("MOVING_HTP", MOVING_HTP)
735731
MakePair("STEADY_TRANSLATION", STEADY_TRANSLATION)
736732
MakePair("GUST", GUST)
737733
};
@@ -1573,17 +1569,8 @@ enum ENUM_OBJECTIVE {
15731569
SURFACE_SPECIES_0 = 58, /*!< \brief Surface Avg. Species_0 objective function definition. */
15741570
SURFACE_SPECIES_VARIANCE = 59,/*!< \brief Species Variance objective function definition. */
15751571
CUSTOM_OBJFUNC = 31, /*!< \brief Custom objective function definition. */
1576-
TOTAL_PRESSURE_LOSS = 39,
1577-
KINETIC_ENERGY_LOSS = 40,
1578-
TOTAL_EFFICIENCY = 41,
1579-
TOTAL_STATIC_EFFICIENCY = 42,
1580-
EULERIAN_WORK = 43,
1581-
TOTAL_ENTHALPY_IN = 44,
1582-
FLOW_ANGLE_IN = 45,
15831572
FLOW_ANGLE_OUT = 46,
15841573
MASS_FLOW_IN = 47,
1585-
MASS_FLOW_OUT = 48,
1586-
PRESSURE_RATIO = 49,
15871574
ENTROPY_GENERATION = 50,
15881575
REFERENCE_GEOMETRY = 60, /*!< \brief Norm of displacements with respect to target geometry. */
15891576
REFERENCE_NODE = 61, /*!< \brief Objective function defined as the difference of a particular node respect to a reference position. */
@@ -1627,18 +1614,9 @@ static const MapType<std::string, ENUM_OBJECTIVE> Objective_Map = {
16271614
MakePair("SURFACE_SPECIES_0", SURFACE_SPECIES_0)
16281615
MakePair("SURFACE_SPECIES_VARIANCE", SURFACE_SPECIES_VARIANCE)
16291616
MakePair("CUSTOM_OBJFUNC", CUSTOM_OBJFUNC)
1630-
MakePair("TOTAL_EFFICIENCY", TOTAL_EFFICIENCY)
1631-
MakePair("TOTAL_STATIC_EFFICIENCY", TOTAL_STATIC_EFFICIENCY)
1632-
MakePair("TOTAL_PRESSURE_LOSS", TOTAL_PRESSURE_LOSS)
1633-
MakePair("EULERIAN_WORK", EULERIAN_WORK)
1634-
MakePair("TOTAL_ENTHALPY_IN", TOTAL_ENTHALPY_IN)
1635-
MakePair("FLOW_ANGLE_IN", FLOW_ANGLE_IN)
16361617
MakePair("FLOW_ANGLE_OUT", FLOW_ANGLE_OUT)
16371618
MakePair("MASS_FLOW_IN", MASS_FLOW_IN)
1638-
MakePair("MASS_FLOW_OUT", MASS_FLOW_OUT)
1639-
MakePair("PRESSURE_RATIO", PRESSURE_RATIO)
16401619
MakePair("ENTROPY_GENERATION", ENTROPY_GENERATION)
1641-
MakePair("KINETIC_ENERGY_LOSS", KINETIC_ENERGY_LOSS)
16421620
MakePair("REFERENCE_GEOMETRY", REFERENCE_GEOMETRY)
16431621
MakePair("REFERENCE_NODE", REFERENCE_NODE)
16441622
MakePair("VOLUME_FRACTION", VOLUME_FRACTION)
@@ -1647,46 +1625,6 @@ static const MapType<std::string, ENUM_OBJECTIVE> Objective_Map = {
16471625
MakePair("STRESS_PENALTY", STRESS_PENALTY)
16481626
};
16491627

1650-
/*!
1651-
* \brief Types of residual criteria equations
1652-
*/
1653-
enum ENUM_RESIDUAL {
1654-
RHO_RESIDUAL = 1, /*!< \brief Rho equation residual criteria equation. */
1655-
RHO_ENERGY_RESIDUAL = 2 /*!< \brief RhoE equation residual criteria equation. */
1656-
};
1657-
static const MapType<std::string, ENUM_RESIDUAL> Residual_Map = {
1658-
MakePair("RHO", RHO_RESIDUAL)
1659-
MakePair("RHO_ENERGY", RHO_ENERGY_RESIDUAL)
1660-
};
1661-
1662-
/*!
1663-
* \brief Types of residual criteria for structural problems
1664-
*/
1665-
enum ENUM_RESFEM {
1666-
RESFEM_RELATIVE = 1, /*!< \brief Relative criteria: Res/Res0. */
1667-
RESFEM_ABSOLUTE = 2 /*!< \brief Absolute criteria: abs(Res). */
1668-
};
1669-
static const MapType<std::string, ENUM_RESFEM> ResFem_Map = {
1670-
MakePair("RELATIVE", RESFEM_RELATIVE)
1671-
MakePair("ABSOLUTE", RESFEM_ABSOLUTE)
1672-
};
1673-
1674-
/*!
1675-
* \brief Types of sensitivities to compute
1676-
*/
1677-
enum ENUM_SENS {
1678-
SENS_GEOMETRY = 1, /*!< \brief Geometrical sensitivity. */
1679-
SENS_MACH = 2, /*!< \brief Mach number sensitivity. */
1680-
SENS_AOA = 3, /*!< \brief Angle of attack sensitivity. */
1681-
SENS_AOS = 4 /*!< \brief Angle of Sideslip sensitivity. */
1682-
};
1683-
static const MapType<std::string, ENUM_SENS> Sens_Map = {
1684-
MakePair("SENS_GEOMETRY", SENS_GEOMETRY)
1685-
MakePair("SENS_MACH", SENS_MACH)
1686-
MakePair("SENS_AOA", SENS_AOA)
1687-
MakePair("SENS_AOS", SENS_AOS)
1688-
};
1689-
16901628
/*!
16911629
* \brief Types of input file formats
16921630
*/
@@ -1833,32 +1771,6 @@ static const MapType<std::string, MG_CYCLE> MG_Cycle_Map = {
18331771
MakePair("FULLMG_CYCLE", FULLMG_CYCLE)
18341772
};
18351773

1836-
/*!
1837-
* \brief Type of solution output variables
1838-
*/
1839-
enum ENUM_OUTPUT_VARS {
1840-
DENSITY = 1, /*!< \brief Density. */
1841-
VEL_X = 2, /*!< \brief X-component of velocity. */
1842-
VEL_Y = 3, /*!< \brief Y-component of velocity. */
1843-
VEL_Z = 4, /*!< \brief Z-component of velocity. */
1844-
PRESSURE = 5, /*!< \brief Static pressure. */
1845-
MACH = 6, /*!< \brief Mach number. */
1846-
TEMPERATURE = 7, /*!< \brief Temperature. */
1847-
LAM_VISC = 8, /*!< \brief Laminar viscosity. */
1848-
EDDY_VISC = 9 /*!< \brief Eddy viscosity. */
1849-
};
1850-
static const MapType<std::string, ENUM_OUTPUT_VARS> Output_Vars_Map = {
1851-
MakePair("DENSITY", DENSITY)
1852-
MakePair("VEL_X", VEL_X)
1853-
MakePair("VEL_Y", VEL_Y)
1854-
MakePair("VEL_Z", VEL_Z)
1855-
MakePair("PRESSURE", PRESSURE)
1856-
MakePair("MACH", MACH)
1857-
MakePair("TEMPERATURE", TEMPERATURE)
1858-
MakePair("LAM_VISC", LAM_VISC)
1859-
MakePair("EDDY_VISC", EDDY_VISC)
1860-
};
1861-
18621774
/*!
18631775
* \brief Types of design parameterizations
18641776
*/
@@ -2387,35 +2299,35 @@ class COptionBase {
23872299
private:
23882300
std::vector<std::string> value;
23892301
public:
2390-
COptionBase() {};
2391-
virtual ~COptionBase() = 0;
2302+
virtual ~COptionBase() = default;
2303+
2304+
const std::vector<std::string>& GetValue() const {return value;}
23922305

2393-
virtual std::string SetValue(std::vector<std::string> value){this->value = value; return "";}
2394-
std::vector<std::string> GetValue() {return value;}
2306+
virtual std::string SetValue(const std::vector<std::string>& val) {
2307+
value = val;
2308+
return "";
2309+
}
23952310
virtual void SetDefault() = 0;
23962311

2397-
std::string optionCheckMultipleValues(std::vector<std::string> & option_value, std::string type_id, std::string option_name) {
2312+
std::string optionCheckMultipleValues(const std::vector<std::string>& option_value,
2313+
std::string type_id, const std::string& option_name) {
23982314
if (option_value.size() != 1) {
2399-
std::string newString;
2400-
newString.append(option_name);
2315+
std::string newString(option_name);
24012316
newString.append(": multiple values for type ");
24022317
newString.append(type_id);
24032318
return newString;
24042319
}
24052320
return "";
24062321
}
24072322

2408-
std::string badValue(std::vector<std::string> & option_value, std::string type_id, std::string option_name) {
2409-
std::string newString;
2410-
newString.append(option_name);
2323+
std::string badValue(std::string type_id, const std::string& option_name) {
2324+
std::string newString(option_name);
24112325
newString.append(": improper option value for type ");
24122326
newString.append(type_id);
24132327
return newString;
24142328
}
24152329
};
24162330

2417-
inline COptionBase::~COptionBase() {}
2418-
24192331
#ifdef ENABLE_MAPS
24202332
#include "option_structure.inl"
24212333
#endif

0 commit comments

Comments
 (0)