Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
594fc94
Added option for using physics-informed neural network
EvertBunschoten Jul 17, 2024
6509e67
Added physics-informed approach to data-driven fluid model
EvertBunschoten Jul 17, 2024
e05fe40
Added PINN option
EvertBunschoten Jul 17, 2024
cd5f4a6
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Jul 23, 2024
71c16c1
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Aug 19, 2024
54972f2
Added ideal gas approximation when compressiblity factor gets suffici…
EvertBunschoten Nov 12, 2024
0f73683
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Nov 12, 2024
296f49e
Added options for initial density and static energy for the data-driv…
EvertBunschoten Jan 6, 2025
cc2e6a6
Added heat capacity to output for data-driven fluid simulations
EvertBunschoten Jan 6, 2025
4a0c526
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Jan 6, 2025
a6152c4
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Feb 3, 2025
00db9bd
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Feb 14, 2025
c219500
Added pressure ramp function for Riemann boundary condition
EvertBunschoten Feb 14, 2025
83e2759
Put the computation of the burnt progress variable inside the scope o…
EvertBunschoten Feb 14, 2025
6220215
Added computation of specific heat at constant pressure and at consta…
EvertBunschoten Feb 14, 2025
e80b992
Adapted data-driven fluid model test case to be compatible with physi…
EvertBunschoten Feb 14, 2025
8419fa5
Updated MLPCpp submodule
EvertBunschoten Feb 14, 2025
5325a32
fixed trailing white spaces
EvertBunschoten Feb 14, 2025
f985434
Fixed warning for unused variable in MLPCpp
EvertBunschoten Feb 14, 2025
ecf47bf
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Feb 17, 2025
d8f0912
Changed input variables to Newton solvers to be pass-by-reference
EvertBunschoten Feb 17, 2025
5aebea8
Pass-by-reference for Newton solvers
EvertBunschoten Feb 17, 2025
a0075ba
Removed HEAT_CAPACITY from volume outputs for data-driven fluid solution
EvertBunschoten Feb 17, 2025
be78f43
Changed conductivity model such that the test case can also be ran wi…
EvertBunschoten Feb 17, 2025
88cd9e9
Set test case branch for regression tests
EvertBunschoten Feb 17, 2025
e927a02
Settings for restart in parallel regression
EvertBunschoten Feb 17, 2025
6a0be5a
Added PINN test case for data-driven fluid model
EvertBunschoten Feb 17, 2025
8b1dfee
Migrated options for data-driven fluid model and flamelet fluid model…
EvertBunschoten Feb 27, 2025
e134e0f
Const correctness for Newton solvers
EvertBunschoten Feb 27, 2025
615b7ea
Retrieve config options from options struct instead of config accesso…
EvertBunschoten Feb 27, 2025
f6d28ab
Retrieve options from flamelet solver options struct rather than conf…
EvertBunschoten Feb 27, 2025
a913d5f
Retrieve options from data-driven fluid and flamelet solver options s…
EvertBunschoten Feb 27, 2025
4b6aee0
Retrieve options for data-driven fluid simulations and flamelet simul…
EvertBunschoten Feb 27, 2025
f14361e
Added unit tests for fluid model consistency
EvertBunschoten Feb 27, 2025
101eeff
Added derived variables to PreaccOut
EvertBunschoten Feb 27, 2025
0ee4c38
Changes from develop
EvertBunschoten Feb 28, 2025
b883770
Fixed segmentation fault for test cases
EvertBunschoten Feb 28, 2025
53c5e69
clang format
EvertBunschoten Feb 28, 2025
60e6d5e
Fixed initialization of flame and spark parameters
EvertBunschoten Feb 28, 2025
a645b12
Removed initialization of flame and spark parameters
EvertBunschoten Feb 28, 2025
4da2234
Updated options from develop
EvertBunschoten Feb 28, 2025
6924ec7
include array package
EvertBunschoten Feb 28, 2025
cc31e6b
Removed pressure ramp options
EvertBunschoten Feb 28, 2025
3e65866
Reverted changes from PR#2419 and pass fluid flamelet and data-driven…
EvertBunschoten Mar 3, 2025
6f3ff33
Removed commented out code
EvertBunschoten Mar 3, 2025
670f008
Reverted changes from merging with PR#2419
EvertBunschoten Mar 3, 2025
5a60063
Reverted pressure ramp option
EvertBunschoten Mar 3, 2025
06cd023
Added tutorials branch to regression
EvertBunschoten Mar 5, 2025
993f22f
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Mar 5, 2025
a9ceb0c
Updated regression test values according to changes to RANS solver
EvertBunschoten Mar 5, 2025
4129132
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Mar 13, 2025
880b1a3
Const correctness for Newton-solvers
EvertBunschoten Mar 13, 2025
e497514
Added AD unit tests for fluid model classes.
EvertBunschoten Mar 18, 2025
d6756aa
Added MLPCpp for AD unit tests
EvertBunschoten Mar 18, 2025
e22af0e
Check if MLPCpp is enabled before configuring AD unit tests
EvertBunschoten Mar 18, 2025
51bf45c
Set correct path for MLP file in fluid model AD unit test
EvertBunschoten Mar 18, 2025
605a357
clang format
EvertBunschoten Mar 18, 2025
b1a011a
Merge branch 'develop' into feature_PINN
EvertBunschoten Mar 19, 2025
1667212
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Mar 24, 2025
017b309
CodeFactor suggestions
EvertBunschoten Mar 24, 2025
d83d714
CodeFactor suggestions
EvertBunschoten Mar 24, 2025
48430be
Merge branch 'develop' into feature_PINN
EvertBunschoten Mar 25, 2025
3fdc949
CodeFactor spaces warnings
EvertBunschoten Mar 25, 2025
dd91b99
Merge branch 'develop' of https://github.com/su2code/SU2 into feature…
EvertBunschoten Mar 26, 2025
1a0e3fb
Added regression test for NICFD PINN tutorial
EvertBunschoten Mar 26, 2025
ac83187
Added PINN options to config template and removed out-of-date comments
EvertBunschoten Mar 26, 2025
d355770
Merge branch 'feature_PINN' of https://github.com/su2code/SU2 into fe…
EvertBunschoten Mar 26, 2025
088d8a6
Whitespaces
EvertBunschoten Mar 26, 2025
1a9faff
Updated regression test values for NICFD test case
EvertBunschoten Mar 26, 2025
91da295
set tutorials branch and testcases branch to develop
EvertBunschoten Mar 26, 2025
fdb0e38
Fixed preaccumulation of SetTDState rhoe function
EvertBunschoten Mar 27, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- config_set: ReverseMPI
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
- config_set: ForwardMPI
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --warnlevel=3 --werror'
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true -Denable-mlpcpp=true --warnlevel=3 --werror'
- config_set: BaseNoMPI
flags: '-Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true -Denable-tests=true --warnlevel=3 --werror'
- config_set: ReverseNoMPI
Expand Down
165 changes: 16 additions & 149 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,8 @@ class CConfig {
Kind_TimeIntScheme_Heat, /*!< \brief Time integration for the wave equations. */
Kind_TimeStep_Heat, /*!< \brief Time stepping method for the (fvm) heat equation. */
n_Datadriven_files;
ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method; /*!< \brief Method used for datset regression in data-driven fluid models. */

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

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

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

/*--- Additional flamelet solver options ---*/
///TODO: Add python wrapper initialization option
FLAMELET_INIT_TYPE flame_init_type = FLAMELET_INIT_TYPE::NONE; /*!< \brief Method for solution ignition for flamelet problems. */
std::array<su2double,8> flame_init; /*!< \brief Flame front initialization parameters. */
std::array<su2double,6> spark_init; /*!< \brief Spark ignition initialization parameters. */
su2double* spark_reaction_rates; /*!< \brief Source terms for flamelet spark ignition option. */
unsigned short nspark; /*!< \brief Number of source terms for spark initialization. */
bool preferential_diffusion = false; /*!< \brief Preferential diffusion physics for flamelet solver.*/

/*--- lookup table ---*/
unsigned short n_scalars = 0; /*!< \brief Number of transported scalars for flamelet LUT approach. */
unsigned short n_lookups = 0; /*!< \brief Number of lookup variables, for visualization only. */
unsigned short n_table_sources = 0; /*!< \brief Number of transported scalar source terms for LUT. */
unsigned short n_user_scalars = 0; /*!< \brief Number of user defined (auxiliary) scalar transport equations. */
unsigned short n_user_sources = 0; /*!< \brief Number of source terms for user defined (auxiliary) scalar transport equations. */
unsigned short n_control_vars = 0; /*!< \brief Number of controlling variables (independent variables) for the LUT. */

string* controlling_variable_names;
string* cv_source_names;
vector<string> table_scalar_names; /*!< \brief Names of transported scalar variables. */
string* lookup_names; /*!< \brief Names of passive look-up variables. */
string* user_scalar_names; /*!< \brief Names of the user defined (auxiliary) transported scalars .*/
string* user_source_names; /*!< \brief Names of the source terms for the user defined transported scalars. */
FluidFlamelet_ParsedOptions flamelet_ParsedOptions; /*!< \brief Additional flamelet solver options */

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

/*!
* \brief Get the flame initialization.
* (x1,x2,x3) = flame offset/spark center location.
* (x4,x5,x6) = flame normal, separating unburnt from burnt or
* spark radius, spark start iteration, spark duration.
* (x7) = flame thickness, the length from unburnt to burnt conditions.
* (x8) = flame burnt thickness, the length to stay at burnt conditions.
* \return Ignition initialization parameters for the flamelet model.
*/
const su2double* GetFlameInit() const {
switch (flame_init_type)
{
case FLAMELET_INIT_TYPE::FLAME_FRONT:
return flame_init.data();
break;
case FLAMELET_INIT_TYPE::SPARK:
return spark_init.data();
break;
default:
return nullptr;
break;
}
}

/*!
* \brief Get species net reaction rates applied during spark ignition.
*/
const su2double* GetSpark() const {
return spark_reaction_rates;
}

/*!
* \brief Preferential diffusion combustion problem.
*/
bool GetPreferentialDiffusion() const { return preferential_diffusion; }

/*!
* \brief Define preferential diffusion combustion problem.
*/
inline void SetPreferentialDiffusion(bool input) { preferential_diffusion = input; }

/*!
* \brief Get the number of control variables for flamelet model.
*/
unsigned short GetNControlVars() const { return n_control_vars; }

/*!
* \brief Get the number of total transported scalars for flamelet model.
*/
unsigned short GetNScalars() const { return n_scalars; }

/*!
* \brief Get the number of user scalars for flamelet model.
*/
unsigned short GetNUserScalars() const { return n_user_scalars; }

/*!
* \brief Get the name of a specific controlling variable.
*/
const string& GetControllingVariableName(unsigned short i_cv) const {
return controlling_variable_names[i_cv];
}

/*!
* \brief Get the name of the source term variable for a specific controlling variable.
*/
const string& GetControllingVariableSourceName(unsigned short i_cv) const {
return cv_source_names[i_cv];
}
/*!
* \brief Get the name of the user scalar.
*/
const string& GetUserScalarName(unsigned short i_user_scalar) const {
static const std::string none = "NONE";
if (n_user_scalars > 0) return user_scalar_names[i_user_scalar]; else return none;
}

/*!
* \brief Get the name of the user scalar source term.
*/
const string& GetUserSourceName(unsigned short i_user_source) const {
static const std::string none = "NONE";
if (n_user_sources > 0) return user_source_names[i_user_source]; else return none;
}

/*!
* \brief Get the ignition method used for combustion problems.
*/
FLAMELET_INIT_TYPE GetFlameletInitType() const { return flame_init_type; }

/*!
* \brief Get the number of transported scalars for combustion.
*/
unsigned short GetNLookups() const { return n_lookups; }

/*!
* \brief Get the name of the variable that we want to retrieve from the lookup table.
*/
const string& GetLookupName(unsigned short i_lookup) const { return lookup_names[i_lookup]; }

/*!
* \brief Get the Young's modulus of elasticity.
* \return Value of the Young's modulus of elasticity.
Expand Down Expand Up @@ -3970,29 +3847,6 @@ class CConfig {
*/
unsigned short GetKind_FluidModel(void) const { return Kind_FluidModel; }

/*!
* \brief Datadriven method for EoS evaluation.
*/
ENUM_DATADRIVEN_METHOD GetKind_DataDriven_Method(void) const { return Kind_DataDriven_Method; }

/*!
* \brief Get name of the input file for the data-driven fluid model interpolation method.
* \return Name of the input file for the interpolation method.
*/
const string* GetDataDriven_FileNames(void) const { return DataDriven_Method_FileNames; }

/*!
* \brief Get number of listed look-up table or multi-layer perceptron input files.
* \return Number of listed data-driven method input files.
*/
unsigned short GetNDataDriven_Files(void) const { return n_Datadriven_files; }

/*!
* \brief Get Newton solver relaxation factor for data-driven fluid models.
* \return Newton solver relaxation factor.
*/
su2double GetRelaxation_DataDriven(void) const { return DataDriven_Relaxation_Factor; }

/*!
* \brief Returns the name of the fluid we are using in CoolProp.
*/
Expand Down Expand Up @@ -9939,4 +9793,17 @@ class CConfig {
*/
LM_ParsedOptions GetLMParsedOptions() const { return lmParsedOptions; }


/*!
* \brief Get parsed option data structure for data-driven fluid model.
* \return option data structure for data-driven fluid model.
*/
const DataDrivenFluid_ParsedOptions& GetDataDrivenParsedOptions() const { return datadriven_ParsedOptions; }

/*!
* \brief Get parsed option data structure for the flamelet fluid model.
* \return option data structure for the flamelet fluid model.
*/
const FluidFlamelet_ParsedOptions& GetFlameletParsedOptions() const { return flamelet_ParsedOptions; }

};
57 changes: 57 additions & 0 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <array>
#include <map>
#include <cstdlib>
#include <algorithm>
Expand Down Expand Up @@ -1324,6 +1325,20 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh
return LMParsedOptions;
}

/*!
* \brief Structure containing parsed options for data-driven fluid model.
*/
struct DataDrivenFluid_ParsedOptions {
su2double rho_init_custom = -1; /*!< \brief Optional initial guess for density in inverse look-up operations. */
su2double e_init_custom = -1; /*!< \brief Optional initial guess for static energy in inverse look-up operations.*/
su2double Newton_relaxation = 1.0; /*!< \brief Relaxation factor for Newton solvers in data-driven fluid models. */
bool use_PINN = false; /*!< \brief Use physics-informed method for data-driven fluid modeling. */
ENUM_DATADRIVEN_METHOD interp_algorithm_type = ENUM_DATADRIVEN_METHOD::MLP; /*!< \brief Interpolation algorithm used for data-driven fluid model. */
unsigned short n_filenames = 1; /*!< \brief Number of datasets. */
std::string *datadriven_filenames; /*!< \brief Dataset information for data-driven fluid models. */
};


/*!
* \brief types of species transport models
*/
Expand Down Expand Up @@ -1391,6 +1406,34 @@ static const MapType<std::string, FLAMELET_INIT_TYPE> Flamelet_Init_Map = {
MakePair("SPARK", FLAMELET_INIT_TYPE::SPARK)
};

/*!
* \brief Structure containing parsed options for flamelet fluid model.
*/
struct FluidFlamelet_ParsedOptions {
///TODO: Add python wrapper initialization option
FLAMELET_INIT_TYPE ignition_method = FLAMELET_INIT_TYPE::NONE; /*!< \brief Method for solution ignition for flamelet problems. */
unsigned short n_scalars = 0; /*!< \brief Number of transported scalars for flamelet LUT approach. */
unsigned short n_lookups = 0; /*!< \brief Number of lookup variables, for visualization only. */
unsigned short n_table_sources = 0; /*!< \brief Number of transported scalar source terms for LUT. */
unsigned short n_user_scalars = 0; /*!< \brief Number of user defined (auxiliary) scalar transport equations. */
unsigned short n_user_sources = 0; /*!< \brief Number of source terms for user defined (auxiliary) scalar transport equations. */
unsigned short n_control_vars = 0; /*!< \brief Number of controlling variables (independent variables) for the LUT. */

std::string *controlling_variable_names; /*!< \brief Names of the independent, transported scalars. */
std::string* cv_source_names; /*!< \brief Names of the source terms of the independent, transported scalars. */
std::string* lookup_names; /*!< \brief Names of the passive look-up terms. */
std::string* user_scalar_names; /*!< \brief Names of the passive transported scalars. */
std::string* user_source_names; /*!< \brief Names of the source terms of the passive transported scalars. */

std::array<su2double,8> flame_init{{0,0,0, /* flame offset (x,y,z) */
1,0,0, /* flame normal (nx, ny, nz) */
5e-3,1}}; /*!< \brief Flame front initialization parameters. */
std::array<su2double,6> spark_init{{0,0,0,0,0,0}}; /*!< \brief Spark ignition initialization parameters. */
su2double* spark_reaction_rates; /*!< \brief Source terms for flamelet spark ignition option. */
unsigned short nspark; /*!< \brief Number of source terms for spark initialization. */
bool preferential_diffusion = false; /*!< \brief Preferential diffusion physics for flamelet solver.*/
};

/*!
* \brief Types of subgrid scale models
*/
Expand Down Expand Up @@ -1886,6 +1929,20 @@ enum TURBO_MARKER_TYPE{
OUTFLOW = 2 /*!< \brief flag for outflow marker for compute turboperformance. */
};

enum class RAMP_TYPE{
GRID, /*!< \brief flag for rotational/translational ramps */
BOUNDARY /*!< \brief flag for pressure/mass flow ramps*/
};

/*!
* \brief Coefficients of the ramp specified in the config, ordered by index in the config
*/
enum RAMP_COEFF{
INITIAL_VALUE = 0, /*!< \brief intial value of the ramp */
UPDATE_FREQ = 1, /*<! \brief update frequency of the ramp */
FINAL_ITER = 2 /*<! \brief final iteration of the ramp */
};

/*!
* \brief Types inlet boundary treatments
*/
Expand Down
Loading