Skip to content

Commit 44ac01d

Browse files
authored
Merge branch 'develop' into feature_turbo_ramps
2 parents 992fae2 + 7eb74b2 commit 44ac01d

Some content is hidden

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

44 files changed

+1382
-634
lines changed

.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. */
@@ -1246,28 +1244,7 @@ class CConfig {
12461244
unsigned short nSpecies_Init; /*!< \brief Number of entries of SPECIES_INIT */
12471245

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

12721249
/*!
12731250
* \brief Set the default values of config options not set in the config file using another config object.
@@ -2176,106 +2153,6 @@ class CConfig {
21762153
*/
21772154
bool GetSpecies_StrongBC() const { return Species_StrongBC; }
21782155

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

3980-
/*!
3981-
* \brief Datadriven method for EoS evaluation.
3982-
*/
3983-
ENUM_DATADRIVEN_METHOD GetKind_DataDriven_Method(void) const { return Kind_DataDriven_Method; }
3984-
3985-
/*!
3986-
* \brief Get name of the input file for the data-driven fluid model interpolation method.
3987-
* \return Name of the input file for the interpolation method.
3988-
*/
3989-
const string* GetDataDriven_FileNames(void) const { return DataDriven_Method_FileNames; }
3990-
3991-
/*!
3992-
* \brief Get number of listed look-up table or multi-layer perceptron input files.
3993-
* \return Number of listed data-driven method input files.
3994-
*/
3995-
unsigned short GetNDataDriven_Files(void) const { return n_Datadriven_files; }
3996-
3997-
/*!
3998-
* \brief Get Newton solver relaxation factor for data-driven fluid models.
3999-
* \return Newton solver relaxation factor.
4000-
*/
4001-
su2double GetRelaxation_DataDriven(void) const { return DataDriven_Relaxation_Factor; }
4002-
40033857
/*!
40043858
* \brief Returns the name of the fluid we are using in CoolProp.
40053859
*/
@@ -9957,4 +9811,17 @@ class CConfig {
99579811
*/
99589812
LM_ParsedOptions GetLMParsedOptions() const { return lmParsedOptions; }
99599813

9814+
9815+
/*!
9816+
* \brief Get parsed option data structure for data-driven fluid model.
9817+
* \return option data structure for data-driven fluid model.
9818+
*/
9819+
const DataDrivenFluid_ParsedOptions& GetDataDrivenParsedOptions() const { return datadriven_ParsedOptions; }
9820+
9821+
/*!
9822+
* \brief Get parsed option data structure for the flamelet fluid model.
9823+
* \return option data structure for the flamelet fluid model.
9824+
*/
9825+
const FluidFlamelet_ParsedOptions& GetFlameletParsedOptions() const { return flamelet_ParsedOptions; }
9826+
99609827
};

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 ---*/
@@ -1018,6 +1020,15 @@ class CGeometry {
10181020
*/
10191021
su2double GetSurfaceArea(const CConfig* config, unsigned short val_marker) const;
10201022

1023+
/*!
1024+
* \brief Check if a boundary is straight(2D) / plane(3D) for EULER_WALL and SYMMETRY_PLANE
1025+
* only and store the information in boundIsStraight. For all other boundary types
1026+
* this will return false and could therfore be wrong. Used ultimately for BC_Slip_Wall.
1027+
* \param[in] config - Definition of the particular problem.
1028+
* \param[in] print_on_screen - Boolean whether to print result on screen.
1029+
*/
1030+
void ComputeSurfStraightness(const CConfig* config, bool print_on_screen);
1031+
10211032
/*!
10221033
* \brief Find and store all vertices on a sharp corner in the geometry.
10231034
* \param[in] config - Definition of the particular problem.

Common/include/option_structure.hpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <sstream>
3434
#include <string>
3535
#include <vector>
36+
#include <array>
3637
#include <map>
3738
#include <cstdlib>
3839
#include <algorithm>
@@ -1324,6 +1325,20 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh
13241325
return LMParsedOptions;
13251326
}
13261327

1328+
/*!
1329+
* \brief Structure containing parsed options for data-driven fluid model.
1330+
*/
1331+
struct DataDrivenFluid_ParsedOptions {
1332+
su2double rho_init_custom = -1; /*!< \brief Optional initial guess for density in inverse look-up operations. */
1333+
su2double e_init_custom = -1; /*!< \brief Optional initial guess for static energy in inverse look-up operations.*/
1334+
su2double Newton_relaxation = 1.0; /*!< \brief Relaxation factor for Newton solvers in data-driven fluid models. */
1335+
bool use_PINN = false; /*!< \brief Use physics-informed method for data-driven fluid modeling. */
1336+
ENUM_DATADRIVEN_METHOD interp_algorithm_type = ENUM_DATADRIVEN_METHOD::MLP; /*!< \brief Interpolation algorithm used for data-driven fluid model. */
1337+
unsigned short n_filenames = 1; /*!< \brief Number of datasets. */
1338+
std::string *datadriven_filenames; /*!< \brief Dataset information for data-driven fluid models. */
1339+
};
1340+
1341+
13271342
/*!
13281343
* \brief types of species transport models
13291344
*/
@@ -1391,6 +1406,34 @@ static const MapType<std::string, FLAMELET_INIT_TYPE> Flamelet_Init_Map = {
13911406
MakePair("SPARK", FLAMELET_INIT_TYPE::SPARK)
13921407
};
13931408

1409+
/*!
1410+
* \brief Structure containing parsed options for flamelet fluid model.
1411+
*/
1412+
struct FluidFlamelet_ParsedOptions {
1413+
///TODO: Add python wrapper initialization option
1414+
FLAMELET_INIT_TYPE ignition_method = FLAMELET_INIT_TYPE::NONE; /*!< \brief Method for solution ignition for flamelet problems. */
1415+
unsigned short n_scalars = 0; /*!< \brief Number of transported scalars for flamelet LUT approach. */
1416+
unsigned short n_lookups = 0; /*!< \brief Number of lookup variables, for visualization only. */
1417+
unsigned short n_table_sources = 0; /*!< \brief Number of transported scalar source terms for LUT. */
1418+
unsigned short n_user_scalars = 0; /*!< \brief Number of user defined (auxiliary) scalar transport equations. */
1419+
unsigned short n_user_sources = 0; /*!< \brief Number of source terms for user defined (auxiliary) scalar transport equations. */
1420+
unsigned short n_control_vars = 0; /*!< \brief Number of controlling variables (independent variables) for the LUT. */
1421+
1422+
std::string *controlling_variable_names; /*!< \brief Names of the independent, transported scalars. */
1423+
std::string* cv_source_names; /*!< \brief Names of the source terms of the independent, transported scalars. */
1424+
std::string* lookup_names; /*!< \brief Names of the passive look-up terms. */
1425+
std::string* user_scalar_names; /*!< \brief Names of the passive transported scalars. */
1426+
std::string* user_source_names; /*!< \brief Names of the source terms of the passive transported scalars. */
1427+
1428+
std::array<su2double,8> flame_init{{0,0,0, /* flame offset (x,y,z) */
1429+
1,0,0, /* flame normal (nx, ny, nz) */
1430+
5e-3,1}}; /*!< \brief Flame front initialization parameters. */
1431+
std::array<su2double,6> spark_init{{0,0,0,0,0,0}}; /*!< \brief Spark ignition initialization parameters. */
1432+
su2double* spark_reaction_rates; /*!< \brief Source terms for flamelet spark ignition option. */
1433+
unsigned short nspark; /*!< \brief Number of source terms for spark initialization. */
1434+
bool preferential_diffusion = false; /*!< \brief Preferential diffusion physics for flamelet solver.*/
1435+
};
1436+
13941437
/*!
13951438
* \brief Types of subgrid scale models
13961439
*/

0 commit comments

Comments
 (0)