Skip to content

Commit e3fdfc2

Browse files
authored
Merge branch 'develop' into coupled_thermoelasticity
2 parents 8d3849c + 02be3f6 commit e3fdfc2

80 files changed

Lines changed: 2452 additions & 1284 deletions

File tree

Some content is hidden

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

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- config_set: ReverseMPI
3131
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
3232
- config_set: ForwardMPI
33-
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --warnlevel=3 --werror'
33+
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true -Denable-mlpcpp=true --warnlevel=3 --werror'
3434
- config_set: BaseNoMPI
3535
flags: '-Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true -Denable-tests=true --warnlevel=3 --werror'
3636
- config_set: ReverseNoMPI

Common/include/CConfig.hpp

Lines changed: 16 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,8 @@ class CConfig {
535535
Kind_TimeIntScheme_Heat, /*!< \brief Time integration for the wave equations. */
536536
Kind_TimeStep_Heat, /*!< \brief Time stepping method for the (fvm) heat equation. */
537537
n_Datadriven_files;
538-
ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method; /*!< \brief Method used for datset regression in data-driven fluid models. */
539538

540-
su2double DataDriven_Relaxation_Factor; /*!< \brief Relaxation factor for Newton solvers in data-driven fluid models. */
539+
DataDrivenFluid_ParsedOptions datadriven_ParsedOptions; /*!< \brief Options for data-driven fluid analysis. */
541540

542541
STRUCT_TIME_INT Kind_TimeIntScheme_FEA; /*!< \brief Time integration for the FEA equations. */
543542
STRUCT_SPACE_ITE Kind_SpaceIteScheme_FEA; /*!< \brief Iterative scheme for nonlinear structural analysis. */
@@ -821,8 +820,7 @@ class CConfig {
821820
SurfAdjCoeff_FileName, /*!< \brief Output file with the adjoint variables on the surface. */
822821
SurfSens_FileName, /*!< \brief Output file for the sensitivity on the surface (discrete adjoint). */
823822
VolSens_FileName, /*!< \brief Output file for the sensitivity in the volume (discrete adjoint). */
824-
ObjFunc_Hess_FileName, /*!< \brief Hessian approximation obtained by the Sobolev smoothing solver. */
825-
*DataDriven_Method_FileNames; /*!< \brief Dataset information for data-driven fluid models. */
823+
ObjFunc_Hess_FileName; /*!< \brief Hessian approximation obtained by the Sobolev smoothing solver. */
826824

827825
bool
828826
Wrt_Performance, /*!< \brief Write the performance summary at the end of a calculation. */
@@ -1239,28 +1237,7 @@ class CConfig {
12391237
unsigned short nSpecies_Init; /*!< \brief Number of entries of SPECIES_INIT */
12401238

12411239
/*--- Additional flamelet solver options ---*/
1242-
///TODO: Add python wrapper initialization option
1243-
FLAMELET_INIT_TYPE flame_init_type = FLAMELET_INIT_TYPE::NONE; /*!< \brief Method for solution ignition for flamelet problems. */
1244-
std::array<su2double,8> flame_init; /*!< \brief Flame front initialization parameters. */
1245-
std::array<su2double,6> spark_init; /*!< \brief Spark ignition initialization parameters. */
1246-
su2double* spark_reaction_rates; /*!< \brief Source terms for flamelet spark ignition option. */
1247-
unsigned short nspark; /*!< \brief Number of source terms for spark initialization. */
1248-
bool preferential_diffusion = false; /*!< \brief Preferential diffusion physics for flamelet solver.*/
1249-
1250-
/*--- lookup table ---*/
1251-
unsigned short n_scalars = 0; /*!< \brief Number of transported scalars for flamelet LUT approach. */
1252-
unsigned short n_lookups = 0; /*!< \brief Number of lookup variables, for visualization only. */
1253-
unsigned short n_table_sources = 0; /*!< \brief Number of transported scalar source terms for LUT. */
1254-
unsigned short n_user_scalars = 0; /*!< \brief Number of user defined (auxiliary) scalar transport equations. */
1255-
unsigned short n_user_sources = 0; /*!< \brief Number of source terms for user defined (auxiliary) scalar transport equations. */
1256-
unsigned short n_control_vars = 0; /*!< \brief Number of controlling variables (independent variables) for the LUT. */
1257-
1258-
string* controlling_variable_names;
1259-
string* cv_source_names;
1260-
vector<string> table_scalar_names; /*!< \brief Names of transported scalar variables. */
1261-
string* lookup_names; /*!< \brief Names of passive look-up variables. */
1262-
string* user_scalar_names; /*!< \brief Names of the user defined (auxiliary) transported scalars .*/
1263-
string* user_source_names; /*!< \brief Names of the source terms for the user defined transported scalars. */
1240+
FluidFlamelet_ParsedOptions flamelet_ParsedOptions; /*!< \brief Additional flamelet solver options */
12641241

12651242
/*!
12661243
* \brief Set the default values of config options not set in the config file using another config object.
@@ -2169,106 +2146,6 @@ class CConfig {
21692146
*/
21702147
bool GetSpecies_StrongBC() const { return Species_StrongBC; }
21712148

2172-
/*!
2173-
* \brief Get the flame initialization.
2174-
* (x1,x2,x3) = flame offset/spark center location.
2175-
* (x4,x5,x6) = flame normal, separating unburnt from burnt or
2176-
* spark radius, spark start iteration, spark duration.
2177-
* (x7) = flame thickness, the length from unburnt to burnt conditions.
2178-
* (x8) = flame burnt thickness, the length to stay at burnt conditions.
2179-
* \return Ignition initialization parameters for the flamelet model.
2180-
*/
2181-
const su2double* GetFlameInit() const {
2182-
switch (flame_init_type)
2183-
{
2184-
case FLAMELET_INIT_TYPE::FLAME_FRONT:
2185-
return flame_init.data();
2186-
break;
2187-
case FLAMELET_INIT_TYPE::SPARK:
2188-
return spark_init.data();
2189-
break;
2190-
default:
2191-
return nullptr;
2192-
break;
2193-
}
2194-
}
2195-
2196-
/*!
2197-
* \brief Get species net reaction rates applied during spark ignition.
2198-
*/
2199-
const su2double* GetSpark() const {
2200-
return spark_reaction_rates;
2201-
}
2202-
2203-
/*!
2204-
* \brief Preferential diffusion combustion problem.
2205-
*/
2206-
bool GetPreferentialDiffusion() const { return preferential_diffusion; }
2207-
2208-
/*!
2209-
* \brief Define preferential diffusion combustion problem.
2210-
*/
2211-
inline void SetPreferentialDiffusion(bool input) { preferential_diffusion = input; }
2212-
2213-
/*!
2214-
* \brief Get the number of control variables for flamelet model.
2215-
*/
2216-
unsigned short GetNControlVars() const { return n_control_vars; }
2217-
2218-
/*!
2219-
* \brief Get the number of total transported scalars for flamelet model.
2220-
*/
2221-
unsigned short GetNScalars() const { return n_scalars; }
2222-
2223-
/*!
2224-
* \brief Get the number of user scalars for flamelet model.
2225-
*/
2226-
unsigned short GetNUserScalars() const { return n_user_scalars; }
2227-
2228-
/*!
2229-
* \brief Get the name of a specific controlling variable.
2230-
*/
2231-
const string& GetControllingVariableName(unsigned short i_cv) const {
2232-
return controlling_variable_names[i_cv];
2233-
}
2234-
2235-
/*!
2236-
* \brief Get the name of the source term variable for a specific controlling variable.
2237-
*/
2238-
const string& GetControllingVariableSourceName(unsigned short i_cv) const {
2239-
return cv_source_names[i_cv];
2240-
}
2241-
/*!
2242-
* \brief Get the name of the user scalar.
2243-
*/
2244-
const string& GetUserScalarName(unsigned short i_user_scalar) const {
2245-
static const std::string none = "NONE";
2246-
if (n_user_scalars > 0) return user_scalar_names[i_user_scalar]; else return none;
2247-
}
2248-
2249-
/*!
2250-
* \brief Get the name of the user scalar source term.
2251-
*/
2252-
const string& GetUserSourceName(unsigned short i_user_source) const {
2253-
static const std::string none = "NONE";
2254-
if (n_user_sources > 0) return user_source_names[i_user_source]; else return none;
2255-
}
2256-
2257-
/*!
2258-
* \brief Get the ignition method used for combustion problems.
2259-
*/
2260-
FLAMELET_INIT_TYPE GetFlameletInitType() const { return flame_init_type; }
2261-
2262-
/*!
2263-
* \brief Get the number of transported scalars for combustion.
2264-
*/
2265-
unsigned short GetNLookups() const { return n_lookups; }
2266-
2267-
/*!
2268-
* \brief Get the name of the variable that we want to retrieve from the lookup table.
2269-
*/
2270-
const string& GetLookupName(unsigned short i_lookup) const { return lookup_names[i_lookup]; }
2271-
22722149
/*!
22732150
* \brief Get the Young's modulus of elasticity.
22742151
* \return Value of the Young's modulus of elasticity.
@@ -3970,29 +3847,6 @@ class CConfig {
39703847
*/
39713848
unsigned short GetKind_FluidModel(void) const { return Kind_FluidModel; }
39723849

3973-
/*!
3974-
* \brief Datadriven method for EoS evaluation.
3975-
*/
3976-
ENUM_DATADRIVEN_METHOD GetKind_DataDriven_Method(void) const { return Kind_DataDriven_Method; }
3977-
3978-
/*!
3979-
* \brief Get name of the input file for the data-driven fluid model interpolation method.
3980-
* \return Name of the input file for the interpolation method.
3981-
*/
3982-
const string* GetDataDriven_FileNames(void) const { return DataDriven_Method_FileNames; }
3983-
3984-
/*!
3985-
* \brief Get number of listed look-up table or multi-layer perceptron input files.
3986-
* \return Number of listed data-driven method input files.
3987-
*/
3988-
unsigned short GetNDataDriven_Files(void) const { return n_Datadriven_files; }
3989-
3990-
/*!
3991-
* \brief Get Newton solver relaxation factor for data-driven fluid models.
3992-
* \return Newton solver relaxation factor.
3993-
*/
3994-
su2double GetRelaxation_DataDriven(void) const { return DataDriven_Relaxation_Factor; }
3995-
39963850
/*!
39973851
* \brief Returns the name of the fluid we are using in CoolProp.
39983852
*/
@@ -9939,4 +9793,17 @@ class CConfig {
99399793
*/
99409794
LM_ParsedOptions GetLMParsedOptions() const { return lmParsedOptions; }
99419795

9796+
9797+
/*!
9798+
* \brief Get parsed option data structure for data-driven fluid model.
9799+
* \return option data structure for data-driven fluid model.
9800+
*/
9801+
const DataDrivenFluid_ParsedOptions& GetDataDrivenParsedOptions() const { return datadriven_ParsedOptions; }
9802+
9803+
/*!
9804+
* \brief Get parsed option data structure for the flamelet fluid model.
9805+
* \return option data structure for the flamelet fluid model.
9806+
*/
9807+
const FluidFlamelet_ParsedOptions& GetFlameletParsedOptions() const { return flamelet_ParsedOptions; }
9808+
99429809
};

Common/include/geometry/CGeometry.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ class CGeometry {
243243
/*!< \brief Corrected normals on nodes with shared symmetry markers. */
244244
vector<std::unordered_map<unsigned long, std::array<su2double, MAXNDIM>>> symmetryNormals;
245245

246+
/*!< \brief Bool if boundary-marker is straight(2D)/plane(3D) for each local marker. */
247+
vector<bool> boundIsStraight;
246248
vector<su2double> SurfaceAreaCfgFile; /*!< \brief Total Surface area for all markers. */
247249

248250
/*--- Partitioning-specific variables ---*/
@@ -1005,6 +1007,15 @@ class CGeometry {
10051007
*/
10061008
su2double GetSurfaceArea(const CConfig* config, unsigned short val_marker) const;
10071009

1010+
/*!
1011+
* \brief Check if a boundary is straight(2D) / plane(3D) for EULER_WALL and SYMMETRY_PLANE
1012+
* only and store the information in boundIsStraight. For all other boundary types
1013+
* this will return false and could therfore be wrong. Used ultimately for BC_Slip_Wall.
1014+
* \param[in] config - Definition of the particular problem.
1015+
* \param[in] print_on_screen - Boolean whether to print result on screen.
1016+
*/
1017+
void ComputeSurfStraightness(const CConfig* config, bool print_on_screen);
1018+
10081019
/*!
10091020
* \brief Find and store all vertices on a sharp corner in the geometry.
10101021
* \param[in] config - Definition of the particular problem.

Common/include/geometry/CMultiGridGeometry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class CMultiGridGeometry final : public CGeometry {
123123
void SetRestricted_GridVelocity(const CGeometry* fine_grid) override;
124124

125125
/*!
126-
* \brief Find and store the closest neighbor to a vertex.
126+
* \brief Find and store the closest, most normal, neighbor to a vertex.
127127
* \param[in] config - Definition of the particular problem.
128128
*/
129129
void FindNormal_Neighbor(const CConfig* config) override;

Common/include/geometry/CPhysicalGeometry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ class CPhysicalGeometry final : public CGeometry {
607607
void ComputeMeshQualityStatistics(const CConfig* config) override;
608608

609609
/*!
610-
* \brief Find and store the closest neighbor to a vertex.
610+
* \brief Find and store the closest, most normal, neighbor to a vertex.
611611
* \param[in] config - Definition of the particular problem.
612612
*/
613613
void FindNormal_Neighbor(const CConfig* config) override;

Common/include/geometry/dual_grid/CVertex.hpp

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class CVertex : public CDualGrid {
4545
long PeriodicPoint[5] = {-1}; /*!< \brief Store the periodic point of a boundary (iProcessor, iPoint) */
4646
bool ActDisk_Perimeter = false; /*!< \brief Identify nodes at the perimeter of the actuator disk */
4747
short Rotation_Type; /*!< \brief Type of rotation associated with the vertex (MPI and periodic) */
48-
unsigned long Normal_Neighbor; /*!< \brief Index of the closest neighbor. */
48+
unsigned long Normal_Neighbor; /*!< \brief Index of the closest, most normal, neighbor. */
49+
su2double NearestNeighborDist = 0.0; /*!< \brief Distance to nearest internal neighbor that is not a wall. */
4950
su2double Basis_Function[3] = {0.0}; /*!< \brief Basis function values for interpolation across zones. */
5051

5152
public:
@@ -98,7 +99,7 @@ class CVertex : public CDualGrid {
9899
* \brief Get the normal to a face of the control volume asociated with a vertex.
99100
* \return Dimensional normal vector, the modulus is the area of the face.
100101
*/
101-
inline su2double* GetNormal(void) override { return Normal; }
102+
inline su2double* GetNormal() override { return Normal; }
102103

103104
/*!
104105
* \brief Get the ith component of the normal.
@@ -108,7 +109,7 @@ class CVertex : public CDualGrid {
108109
/*!
109110
* \brief Initialize normal vector.
110111
*/
111-
inline void SetZeroValues(void) override {
112+
inline void SetZeroValues() override {
112113
for (unsigned short iDim = 0; iDim < nDim; iDim++) Normal[iDim] = 0.0;
113114
}
114115

@@ -122,7 +123,7 @@ class CVertex : public CDualGrid {
122123
* \brief Get the value of an auxiliary variable for gradient computation.
123124
* \return Value of the auxiliar variable.
124125
*/
125-
inline su2double GetAuxVar(void) const { return Aux_Var; }
126+
inline su2double GetAuxVar() const { return Aux_Var; }
126127

127128
/*!
128129
* \brief Add the value of an auxiliary variable for gradient computation.
@@ -167,7 +168,7 @@ class CVertex : public CDualGrid {
167168
* \brief Get the value of the coordinate variation due to a surface modification.
168169
* \return Variation of the coordinate.
169170
*/
170-
inline su2double* GetVarCoord(void) { return VarCoord; }
171+
inline su2double* GetVarCoord() { return VarCoord; }
171172

172173
/*!
173174
* \brief Set the value of the cartesian coordinate for the vertex.
@@ -181,7 +182,7 @@ class CVertex : public CDualGrid {
181182
* \brief Get the value of the cartesian coordinate for the vertex.
182183
* \return Value of the cartesian coordinate of the vertex.
183184
*/
184-
inline su2double* GetCoord(void) override { return CartCoord; }
185+
inline su2double* GetCoord() override { return CartCoord; }
185186

186187
/*!
187188
* \brief Get the value of the cartesian coordinate for the vertex.
@@ -200,7 +201,7 @@ class CVertex : public CDualGrid {
200201
* \brief Get the type of rotation associated to the vertex.
201202
* \return Value of the rotation that must be applied to the solution of the vertex
202203
*/
203-
inline short GetRotation_Type(void) const { return Rotation_Type; }
204+
inline short GetRotation_Type() const { return Rotation_Type; }
204205

205206
/*!
206207
* \overload
@@ -250,49 +251,49 @@ class CVertex : public CDualGrid {
250251
* \brief Get the value of the periodic point of a vertex.
251252
* \return Value of the periodic point of a vertex.
252253
*/
253-
inline long GetDonorPoint(void) const { return PeriodicPoint[0]; }
254+
inline long GetDonorPoint() const { return PeriodicPoint[0]; }
254255

255256
/*!
256257
* \brief Get the value of the periodic point of a vertex.
257258
* \return Value of the periodic point of a vertex.
258259
*/
259-
inline long GetDonorMarker(void) const { return PeriodicPoint[4]; }
260+
inline long GetDonorMarker() const { return PeriodicPoint[4]; }
260261

261262
/*!
262263
* \brief Get the value of the periodic point of a vertex.
263264
* \return Value of the periodic point of a vertex.
264265
*/
265-
inline long GetDonorVertex(void) const { return PeriodicPoint[3]; }
266+
inline long GetDonorVertex() const { return PeriodicPoint[3]; }
266267

267268
/*!
268269
* \brief Get the value of the periodic point of a vertex.
269270
* \return Value of the periodic point of a vertex.
270271
*/
271-
inline long GetDonorGlobalIndex(void) const { return PeriodicPoint[2]; }
272+
inline long GetDonorGlobalIndex() const { return PeriodicPoint[2]; }
272273

273274
/*!
274275
* \brief Get the value of the periodic point of a vertex.
275276
* \return Value of the periodic point of a vertex.
276277
*/
277-
inline long GetGlobalDonorPoint(void) const { return PeriodicPoint[2]; }
278+
inline long GetGlobalDonorPoint() const { return PeriodicPoint[2]; }
278279

279280
/*!
280281
* \brief Get the value of the periodic point of a vertex.
281282
* \return Value of the periodic point of a vertex.
282283
*/
283-
inline long GetDonorProcessor(void) const { return PeriodicPoint[1]; }
284+
inline long GetDonorProcessor() const { return PeriodicPoint[1]; }
284285

285286
/*!
286287
* \brief Get the value of the periodic point of a vertex, and its somain
287288
* \return Value of the periodic point of a vertex, and the domain.
288289
*/
289-
inline long* GetPeriodicPointDomain(void) { return PeriodicPoint; }
290+
inline long* GetPeriodicPointDomain() { return PeriodicPoint; }
290291

291292
/*!
292293
* \brief Get the value of the periodic point of a vertex, and its somain
293294
* \return Value of the periodic point of a vertex, and the domain.
294295
*/
295-
inline bool GetActDisk_Perimeter(void) const { return ActDisk_Perimeter; }
296+
inline bool GetActDisk_Perimeter() const { return ActDisk_Perimeter; }
296297

297298
/*!
298299
* \brief Set the finite element basis functions needed for interpolation.
@@ -318,5 +319,15 @@ class CVertex : public CDualGrid {
318319
* \brief Get the value of the closest neighbor.
319320
* \return Index of the closest neighbor.
320321
*/
321-
inline unsigned long GetNormal_Neighbor(void) const { return Normal_Neighbor; }
322+
inline unsigned long GetNormal_Neighbor() const { return Normal_Neighbor; }
323+
324+
/*!
325+
* \brief Set the distance of the nearest internal neighbor that is not a wall.
326+
*/
327+
inline void SetNearestNeighborDistance(const su2double& val) { NearestNeighborDist = val; }
328+
329+
/*!
330+
* \brief Get the distance to the nearest internal neighbor that is not a wall.
331+
*/
332+
inline const su2double& GetNearestNeighborDistance() const { return NearestNeighborDist; }
322333
};

0 commit comments

Comments
 (0)