Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
112 changes: 103 additions & 9 deletions Common/DataDrivenConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Config_NICFD(Config):
"""
Define Config_NICFD class or load existing configuration. If `load_file` is set, the settings from an existing
is loaded. If no file name is provided, a new `Config_NICFD` class is created.

:param load_file: path to file of configuration to be loaded.
:type load_file: str
"""
Expand Down Expand Up @@ -746,7 +746,7 @@ class Config_FGM(Config):
"""
Define Config_FGM class or load existing configuration. If `load_file` is set, the settings from an existing
is loaded. If no file name is provided, a new `Config_FGM` class is created.

:param load_file: path to file of configuration to be loaded.
:type load_file: str
"""
Expand All @@ -771,13 +771,17 @@ class Config_FGM(Config):
__T_unb_lower:float = DefaultSettings_FGM.T_min # Lower bound of unburnt reactants temperature.
__T_unb_upper:float = DefaultSettings_FGM.T_max # Upper bound of unburnt reactants temperature.
__Np_T_unb:int = DefaultSettings_FGM.Np_temp # Number of unburnt temperature samples between bounds.
__Np_mdot:int = DefaultSettings_FGM.Np_mdot # Number of mass flux divisions for burner-stabilized flamelets.
__Np_mdot_extra:int = 20 # Number of interpolation steps for extra interpolated burner-stabilized flamelets.
__initial_grid_length:float = DefaultSettings_FGM.initial_grid_length # Initial flamelet domain length in metres.

__mix_status_lower:float = DefaultSettings_FGM.eq_ratio_min # Lower bound of premixed status
__mix_status_upper:float = DefaultSettings_FGM.eq_ratio_max # Upper bound of premixed status
__Np_mix_unb:int = DefaultSettings_FGM.Np_eq # Number of mixture samples between bounds.

__generate_freeflames:bool = DefaultSettings_FGM.include_freeflames # Generate adiabatic flamelets
__generate_burnerflames:bool = DefaultSettings_FGM.include_burnerflames # Generate burner-stabilized flamelets
__generate_extra_interpolated_burnerflames:bool = True # Generate extra interpolated burner-stabilized flamelets
__generate_equilibrium:bool = DefaultSettings_FGM.include_equilibrium # Generate chemical equilibrium data
__generate_counterflames:bool = DefaultSettings_FGM.include_counterflames # Generate counter-flow diffusion flamelets.

Expand Down Expand Up @@ -1037,7 +1041,7 @@ def ComputeMixFracConstants(self):
def GetMixtureFractionCoefficients(self):
"""
Get the species mass fraction coefficients for computation of the mixture fraction according to Bilger's definition.

:return: array of coefficients for mixture fraction computation.
:rtype: array[float]

Expand All @@ -1047,7 +1051,7 @@ def GetMixtureFractionCoefficients(self):
def GetMixtureFractionConstant(self):
"""
Get the mixture fraction offset value according to Bilger's definition.

:return: mixture fraction offset value.
:rtype: float
"""
Expand Down Expand Up @@ -1126,14 +1130,14 @@ def GetMixtureSpecies(self):
def SetFuelDefinition(self, fuel_species:list[str], fuel_weights:list[float]):
"""
Define fuel species and weights. By default the fuel is set to pure methane.

:param fuel_species: List containing fuel species names.
:type fuel_species: list[str]
:param fuel_weights: List containing fuel molar fractions
:type fuel_weights: list[float]
:raise: Exception: If no reactants are provided.
:raise: Exception: If the number of species and weights are unequal.

"""
if len(fuel_species) == 0:
raise Exception("Fuel definition should contain at least one species name.")
Expand Down Expand Up @@ -1234,7 +1238,7 @@ def SetMixtureBounds(self, mix_lower:float=DefaultSettings_FGM.eq_ratio_min, mix

"""

if (mix_lower >= mix_upper):
if (mix_lower > mix_upper):
raise Exception("Lower mixture status should be lower than upper mixture status.")
else:
if mix_lower < 0.0:
Expand Down Expand Up @@ -1308,7 +1312,7 @@ def SetUnbTempBounds(self, T_unb_lower:float=DefaultSettings_FGM.T_min, T_unb_up
def GetUnbTempBounds(self):
"""
Get the reactant temperature bounds for flamelet generation.

:return: lower and upper reactant temperature.
:rtype: list[float]

Expand Down Expand Up @@ -1340,6 +1344,76 @@ def GetNpTemp(self):
"""
return self.__Np_T_unb

def SetNpMdot(self, Np_mdot:int=DefaultSettings_FGM.Np_mdot):
"""
Set number of mass flux divisions for burner-stabilized flamelets.

:param Np_mdot: Number of mass flux steps.
:type Np_mdot: int

"""
if Np_mdot <= 0:
raise Exception("Number of mass flux samples should be higher than zero.")
self.__Np_mdot = Np_mdot
return

def GetNpMdot(self):
"""
Get the number of mass flux divisions for burner-stabilized flamelets.

:return: Number of mass flux steps.
:rtype: int

"""
return self.__Np_mdot

def SetNpMdotExtra(self, Np_Mdot_Extra:int=20):
"""
Set number of interpolation steps for extra interpolated burner-stabilized flamelets.

:param Np_Mdot_Extra: Number of interpolated steps between the lowest-mdot burner flame and equilibrium.
:type Np_Mdot_Extra: int
:raises Exception: If the number of steps is lower than one.

"""
if Np_Mdot_Extra <= 0:
raise Exception("Number of extra interpolated mdot flamelets should be higher than one.")
self.__Np_mdot_extra = Np_Mdot_Extra
return

def GetNpMdotExtra(self):
"""
Get the number of interpolation steps for extra interpolated burner-stabilized flamelets.

:return: Number of interpolated steps.
:rtype: int

"""
return self.__Np_mdot_extra

def SetInitialGridLength(self, length:float=DefaultSettings_FGM.initial_grid_length):
"""
Set the initial flamelet domain length.

:param length: Domain length in metres.
:type length: float

"""
if length <= 0:
raise Exception("Initial grid length must be greater than zero.")
self.__initial_grid_length = length
return

def GetInitialGridLength(self):
"""
Get the initial flamelet domain length.

:return: Domain length in metres.
:rtype: float

"""
return self.__initial_grid_length

def DefineMixtureStatus(self, run_as_mixture_fraction:bool=DefaultSettings_FGM.run_mixture_fraction):
"""
Define the reactant mixture status as mixture fraction or equivalence ratio.
Expand Down Expand Up @@ -1406,6 +1480,17 @@ def RunCounterFlames(self, input:bool=DefaultSettings_FGM.include_counterflames)
self.__generate_counterflames = input
return

def RunExtraInterpolatedBurnerFlames(self, input:bool=True):
"""
Include extra interpolated burner-stabilized flame data in the manifold.

:param input: enable generation of extra interpolated burner-stabilized flamelet data.
:type input: bool

"""
self.__generate_extra_interpolated_burnerflames = input
return

def GenerateFreeFlames(self):
"""
Whether the manifold data contains adiabatic free-flame data.
Expand Down Expand Up @@ -1442,6 +1527,15 @@ def GenerateCounterFlames(self):
"""
return self.__generate_counterflames

def GenerateExtraInterpolatedBurnerFlames(self):
"""
Whether the manifold data contains extra interpolated burner-stabilized flame data.

:return: extra interpolated burner-stabilized flamelets are generated.
:rtype: bool
"""
return self.__generate_extra_interpolated_burnerflames

def TranslateToMatlab(self, input:bool):
"""
Save a copy of flamelet data as MATLAB TableMaster format.
Expand Down Expand Up @@ -1786,7 +1880,7 @@ def ComputeBetaTerms(self, variables:list[str], flamelet_data:np.ndarray):
"""
Compute the differential diffusion scalars for a flamelet.


:param variables: list of variable names in the flamelet data.
:type variables: list[str]
:param flamelet_data: flamelet data array.
Expand Down
5 changes: 4 additions & 1 deletion Common/Properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,14 @@ class DefaultSettings_FGM(DefaultProperties):
T_max:float = 800.0
Np_temp:int = 30

T_threshold:float = 600.0
T_threshold:float = 250.0

eq_ratio_min:float = 0.2
eq_ratio_max:float = 20.0
Np_eq:int = 30
Np_mdot:int = 25

initial_grid_length:float = 0.2

reaction_mechanism:str = 'gri30.yaml'
transport_model:str = 'multicomponent'
Expand Down
Loading
Loading