Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fac8197
Two-phase settings
EvertBunschoten Apr 8, 2026
20bf345
Added transport models
EvertBunschoten Apr 8, 2026
0c865e2
Added transport and two-phase methods
EvertBunschoten Apr 8, 2026
fb7d4d9
Include table generators in manifold module
EvertBunschoten Apr 8, 2026
676edcd
Include gmesh in docker container packages
EvertBunschoten Apr 8, 2026
75b2b43
Run regression tests on test image
EvertBunschoten Apr 8, 2026
ea1696e
Added table generators from Riccardo and Guiseppe
EvertBunschoten Apr 8, 2026
254dce2
Include concave hull module
EvertBunschoten Apr 8, 2026
b0133d0
Improved handling of saturation curve points in table
EvertBunschoten Apr 9, 2026
373b4d7
Improved calculation of Cp and Cv in two-phase region
EvertBunschoten Apr 9, 2026
08f49bc
Improved management of phases included in fluid data
EvertBunschoten Apr 13, 2026
9041082
Updated step size for finite-differences
EvertBunschoten Apr 13, 2026
119ff4f
Added test case for two-phase LUT
EvertBunschoten Apr 13, 2026
4421142
Method documentation
EvertBunschoten Apr 14, 2026
83d94b3
Started documentation on tabulation methods
EvertBunschoten Apr 14, 2026
0ddc2d2
Added documentation of tabulation settings
EvertBunschoten Apr 14, 2026
d6e4818
General documentation update
EvertBunschoten Apr 14, 2026
765c081
Update required packages in environment recipe
EvertBunschoten Apr 14, 2026
b92b648
Update link to web page
EvertBunschoten Apr 14, 2026
b02e1fb
Remove redundant todos
EvertBunschoten Apr 14, 2026
2ae02fa
Remove redundant todos
EvertBunschoten Apr 14, 2026
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
12 changes: 6 additions & 6 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2_dataminer_test
uses: docker://ghcr.io/su2code/su2_dataminer_test:v2
with:
entrypoint: /bin/rm
args: -rf src/

- name: Run regression tests
uses: docker://ghcr.io/su2code/su2_dataminer_test
uses: docker://ghcr.io/su2code/su2_dataminer_test:v2
with:
args: -b ${{ github.ref }} -s run_regression.py

- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2_dataminer_test
uses: docker://ghcr.io/su2code/su2_dataminer_test:v2
with:
entrypoint: /bin/rm
args: -rf src/
Expand All @@ -39,18 +39,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Pre Cleanup
uses: docker://ghcr.io/su2code/su2_dataminer_test
uses: docker://ghcr.io/su2code/su2_dataminer_test:v2
with:
entrypoint: /bin/rm
args: -rf src/

- name: MLPCpp integration tests
uses: docker://ghcr.io/su2code/su2_dataminer_test
uses: docker://ghcr.io/su2code/su2_dataminer_test:v2
with:
args: -b ${{ github.ref }} -s MLPCpp_tests.py -m main

- name: Post Cleanup
uses: docker://ghcr.io/su2code/su2_dataminer_test
uses: docker://ghcr.io/su2code/su2_dataminer_test:v2
with:
entrypoint: /bin/rm
args: -rf src/
198 changes: 186 additions & 12 deletions Common/DataDrivenConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ class Config_NICFD(Config):
# Fluid definition settings
__fluid_names:list[str] = ["MM"] # List of fluid names used for data generation.
__fluid_string:str="MM" # Fluid string for defining the abstract state in CoolProp

__calc_transport_properties:bool = False
__viscosity_model:str = DefaultSettings_NICFD.viscosity_model
__conductivity_model:str = DefaultSettings_NICFD.conductivity_model

# Phases to include in fluid data.
__gasphase:bool = True
__twophase:bool = False
__liquidphase:bool = False
__supercritical:bool = True

__EOS_type:str=DefaultSettings_NICFD.EOS_type # Equation of state used by CoolProp
__fluid_mole_fractions:list[float] = [1.0] # Mole fractions for components in fluid mixture.
__use_PT:bool = DefaultSettings_NICFD.use_PT_grid # Use a pressure-temperature based grid for fluid training data.
Expand All @@ -78,7 +89,7 @@ class Config_NICFD(Config):
_state_vars:list[str] = ["s", "T","p","c2"] # State variable names for which the physics-informed MLP is trained.

# Table Generation Settings

__Table_discretization:str = DefaultSettings_NICFD.tabulation_method
__Table_base_cell_size:float = None # Table base cell size per table level.
__Table_ref_cell_size:float = None # Refined cell size per table level.
__Table_ref_radius:float = None # Refinement radius within which refined cell size is applied.
Expand Down Expand Up @@ -151,6 +162,15 @@ def PrintBanner(self):
print("Density range: %.2f kg/m3 -> %.2f kg/m3 (%i steps)" % (self.__Rho_lower, self.__Rho_upper, self.__Np_P))
print("")
print("State variables considered during physics-informed learning: "+", ".join((v for v in self._state_vars)))

if self.__twophase:
print("Including two-phase fluid data.")
if self.__calc_transport_properties:
print("Including transport properties in fluid data.")
if self.__twophase:
print("Two-phase conductivity model: %s" % self.__conductivity_model)
print("Two-phase viscosity model: %s" % self.__viscosity_model)

return


Expand Down Expand Up @@ -208,6 +228,137 @@ def SetEquationOfState(self, EOS_type_in:str=DefaultSettings_NICFD.EOS_type):
self.__EOS_type=EOS_type_in.upper()
return

def IncludeTransportProperties(self, calc_transport_properties:bool=False):
"""Include transport properties in fluid data calculation

:param calc_transport_properties: evaluate transport properties, defaults to False
:type calc_transport_properties: bool, optional
"""
self.__calc_transport_properties = calc_transport_properties
return

def CalcTransportProperties(self):
"""Whether transport properties are included in the fluid data set.

:return: calculation of transport properties.
:rtype: bool
"""
return self.__calc_transport_properties

def SetConductivityModel(self, conductivity_model:str=DefaultSettings_NICFD.conductivity_model):
"""Specify the two-phase conductivity model.

:param conductivity_model: two-phase conductivity model option, defaults to "volume"
:type conductivity_model: str, optional
:raises Exception: if the specified option is not supported.
"""
if conductivity_model not in DefaultSettings_NICFD.conductivity_models:
raise Exception("Two-phase conductivity model should be one of the following: " + ",".join(c for c in DefaultSettings_NICFD.conductivity_models))
self.__conductivity_model = conductivity_model
if not self.TwoPhase():
self.EnableTwophase(True)
print("Two-phase conductivity model specified, including two-phase fluid data.")
return

def GetConductivityModel(self):
"""Get two-phase conductivity model.

:return: two-phase conductivity model option
:rtype: str
"""
return self.__conductivity_model

def SetViscosityModel(self, viscosity_model:str=DefaultSettings_NICFD.viscosity_model):
"""Specify the two-phase viscosity model.

:param viscosity_model: two-phase viscosity model option, defaults to "mcadams"
:type viscosity_model: str, optional
:raises Exception: if the specified option is not supported.
"""
if viscosity_model not in DefaultSettings_NICFD.viscosity_models:
raise Exception("Two-phase viscosity model should be one of the following: " + ",".join(c for c in DefaultSettings_NICFD.viscosity_models))
self.__viscosity_model = viscosity_model
if not self.TwoPhase():
self.EnableTwophase(True)
print("Two-phase viscosity model specified, including two-phase fluid data.")
return

def GetViscosityModel(self):
"""Get two-phase viscosity model.

:return: two-phase viscosity model option
:rtype: str
"""
return self.__viscosity_model

def EnableGasPhase(self, gas_phase:bool=True):
"""Include thermophysical state data from the fluid in gas phase

:param gas_phase: include gas phase data, defaults to True
:type gas_phase: bool, optional
"""
self.__gasphase = gas_phase
return

def GasPhase(self):
"""Whether thermophysical state data from the fluid in the gaseous phase are included.

:return: inclusion of gas phase data.
:rtype: bool
"""
return self.__gasphase

def EnableSuperCritical(self, supercritical:bool=True):
"""Include thermophysical state data of the fluid in supercritial, and of the supercritical gas and liquid phase if specified.

:param supercritical: include supercritical phase data, defaults to True
:type supercritical: bool, optional
"""
self.__supercritical = supercritical
return

def EnableTwophase(self, two_phase:bool=False):
"""Include two-phase thermophysical data of the fluid.

:param two_phase: include two-phase data in fluid data, defaults to False
:type two_phase: bool, optional
"""
self.__twophase = two_phase
return

def EnableLiquidPhase(self, liquid_phase:bool=False):
"""Include thermodynamic state data from fluid in the liquid phase.

:param liquid_phase: include liquid-phase data, defaults to False
:type liquid_phase: bool, optional
"""
self.__liquidphase = liquid_phase
return

def TwoPhase(self):
"""Whether thermophysical state data from the fluid in the two-phase are included.

:return: inclusion of two-phase data.
:rtype: bool
"""
return self.__twophase

def LiquidPhase(self):
"""Whether thermophysical state data from the fluid in the liquid phase are included.

:return: inclusion of liquid phase data.
:rtype: bool
"""
return self.__liquidphase

def SuperCritical(self):
"""Whether thermophysical state data from the fluid in the supercritical phases are included.

:return: inclusion of supercritical phase data.
:rtype: bool
"""
return self.__supercritical

def GetEquationOfState(self):
"""Retrieve the equation of state backend used by CoolProp for fluid data calculations.

Expand Down Expand Up @@ -262,9 +413,9 @@ def UseAutoRange(self, use_auto_range:bool=True):
return

def GetAutoRange(self):
"""Whether fluid data ranges are automatically determined by CoolProp
"""The span of the thermodynamic state space is determined automatically.

:return: boolean if range is automatically determined
:return: whether automatic ranging is used.
:rtype: bool
"""
return self.__use_auto_range
Expand Down Expand Up @@ -358,9 +509,9 @@ def GetNpEnergy(self):
def SetDensityBounds(self, Rho_lower:float=DefaultSettings_NICFD.Rho_min, Rho_upper:float=DefaultSettings_NICFD.Rho_max):
"""Define the density bounds of the density-energy based fluid data grid.

:param Rho_lower: lower limit density value in kg/m3, defaults to DefaultSettings_NICFD.Rho_min
:param Rho_lower: lower limit density value, defaults to DefaultSettings_NICFD.Rho_min
:type Rho_lower: float, optional
:param Rho_upper: upper limit for density in kg/m3, defaults to DefaultSettings_NICFD.Rho_max
:param Rho_upper: upper limit for density, defaults to DefaultSettings_NICFD.Rho_max
:type Rho_upper: float, optional
:raises Exception: if lower value for density exceeds upper value.
"""
Expand Down Expand Up @@ -489,6 +640,26 @@ def GetNpPressure(self):
"""
return self.__Np_P

def SetTableDiscretization(self, table_method:str=DefaultSettings_NICFD.tabulation_method):
"""Specify how thermodynamic state space is discretized for look-up table.

:param table_method: discretization method, defaults to "cartesian"
:type table_method: str, optional
:raises Exception: if method is not supported
"""
if table_method not in DefaultSettings_NICFD.tabulation_options:
raise Exception("Table discretization method should be one of the following: %s" % ",".join(t for t in DefaultSettings_NICFD.tabulation_options))
self.__Table_discretization = table_method
return

def GetTableDiscretization(self):
"""Get thermodynamic state space discretization method.

:return: table discretization method.
:rtype: str
"""
return self.__Table_discretization

def SetTableCellSize(self, base_cell_size:float, refined_cell_size:float=None):
"""Define the base and optional refined 2D table cell sizes.

Expand Down Expand Up @@ -1019,10 +1190,11 @@ def SetReactionMechanism(self, mechanism_input:str=DefaultSettings_FGM.reaction_
return

def GetReactionMechanism(self):
"""Get the reaction mechanism used for flamelet generation.

"""
Get the reaction mechanism used for flamelet generation.
:return: reaction mechanism name.
:rtype: str

"""
return self.__reaction_mechanism

Expand Down Expand Up @@ -1079,10 +1251,11 @@ def SetMixtureBounds(self, mix_lower:float=DefaultSettings_FGM.eq_ratio_min, mix
return

def GetMixtureBounds(self):
"""Get the mixture status bounds.

"""
Get the mixture status bounds.
:return: List containing lower and upper mixture status values.
:rtype: list[float]

"""
return [self.__mix_status_lower, self.__mix_status_upper]

Expand All @@ -1102,7 +1275,8 @@ def SetNpMix(self, input:int=DefaultSettings_FGM.Np_eq):
return

def GetNpMix(self):
"""Get the number of divisions between the lean and rich mixture status for flamelet generation.
"""
Get the number of divisions between the lean and rich mixture status for flamelet generation.

:return: number of divisions between rich and lean.
:rtype: int
Expand Down Expand Up @@ -1381,8 +1555,8 @@ def SetPassiveSpecies(self, passive_species:list[str]=[]):
"""
Set the passive transported species for which source terms should be saved in the manifold.

:param passive_species: list of species names.
:type passive_species: list[str]
:param __passive_species: list of species names.
:type __passive_species: list[str]
"""
self.__passive_species = passive_species
return
Expand Down
16 changes: 15 additions & 1 deletion Common/Properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class EntropicVars(Enum):
dsdp_rho=auto()
dsdrho_p=auto()
cp=auto()
cv=auto()
Enthalpy=auto()
Conductivity=auto()
ViscosityDyn=auto()
VaporQuality=auto()
N_STATE_VARS=auto()

class FGMVars(Enum):
Expand Down Expand Up @@ -137,6 +142,11 @@ class DefaultSettings_NICFD(DefaultProperties):

fluid_name:str = "Air"
EOS_type:str = "HEOS"
conductivity_models:list[str] = ["volume", "mass"]
viscosity_models:list[str] = ["mcadams", "cicchitti", "dukler"]
conductivity_model:str = "volume"
viscosity_model:str = "mcadams"

use_PT_grid:bool = False

controlling_variables:list[str] = [EntropicVars.Density.name, \
Expand All @@ -152,6 +162,9 @@ class DefaultSettings_NICFD(DefaultProperties):
config_type:str = "EntropicAI"
supported_state_vars:list[str] = ["s","T","p","c2","dTdrho_e","dTde_rho","dpdrho_e","dpde_rho"]
supported_backends:list[str] = ["HEOS","PR", "SRK", "IF97","REFPROP"]

tabulation_options:list[str] = ["cartesian","adaptive"]
tabulation_method:str="cartesian"

class DefaultSettings_FGM(DefaultProperties):
config_name:str = "config_FGM"
Expand Down Expand Up @@ -213,4 +226,5 @@ class DefaultSettings_FGM(DefaultProperties):
"exponential" : tf.keras.activations.exponential,\
"gelu" : tf.keras.activations.gelu,\
"sigmoid" : tf.keras.activations.sigmoid,\
"swish" : tf.keras.activations.swish}
"swish" : tf.keras.activations.swish}

Loading