SU2 DataMiner Configuration for FGM#

The following functions are used to access the options used specifically for FGM applications in SU2 DataMiner.

Reaction Mechanism and Transport Model#

For Cantera flamelet calculations, a chemical kinetics model and a diffusion model have to be provided. Installation of Cantera comes with several popular chemical kinetics models such as gri30, but custom kinetics files can be used, as long as they are accessible from the current file location. An error will be raised if the provided kinetics file cannot be accessed.

SetReactionMechanism(self, mechanism_input: str = 'gri30.yaml')#

Define reaction mechanism used for flamelet data generation. The default setting is the gri30 mechanism for methane/hydrogen.

Parameters:

mechanism_input (str) – Reaction mechanism name.

Raise:

Exception: If the reaction mechanism could not be loaded from path.

GetReactionMechanism(self)#

Get the reaction mechanism used for flamelet generation.

Returns:

reaction mechanism name.

Return type:

str

1D chemistry simulations in Cantera can be performed with two options for the multi-component diffusion model: “unity-Lewis” or “multicomponent”. When selecting “multicomponent”, species diffusion fluxes are calculated using the Fick diffusion law, so the effects of differential and preferential diffusion are modeled. These effects are relevant in lean, premixed hydrogen flames. For flames where preferential and differential diffusion are less relevant, as is the case for methane-air flames for example, the “unity-Lewis” option is more appropriate. With the option “unity-Lewis”, the diffusion coefficient of all species is equal to the thermal diffusivity.

Preferential diffusion will automatically be enabled within the configuration when selecting the “multicomponent” transport model. For more information on the settings regarding the preferential diffusion model, see this section.

SetTransportModel(self, transport_model: str = 'multicomponent')#

Define the transport model for the 1D flamelet computations: “unity-Lewis” or “multicomponent”.

Parameters:

transport_model (str, optional) – transport model name, defaults to DefaultSettings_FGM.transport_model

GetTransportModel(self)#

Get the transport model for 1D flamelet computations.

Returns:

flamelet transport model name.

Return type:

str

Flamelet Types#

SU2 DataMiner currently supports the generation of adiabatic flamelets (free flames), burner-stabilized flamelets, and chemical equilibrium data. Details on the setup for each type of flamelet simulation can be found on this page. Adiabatic flamelets are one-dimensional detailed chemistry solutions of premixed reactants without strain. More information about adiabatic flame simulations can be found on the this web page. Information on whether adiabatic flamelets are included in the manifold can be accessed through the following options.

RunFreeFlames(self, input: bool = True)#

Include adiabatic free flame data in the manifold.

Parameters:

input (bool) – enable generation of adabatic free flame data.

GenerateFreeFlames(self)#

Whether the manifold data contains adiabatic free-flame data.

Returns:

adiabatic free flamelets are generated.

Return type:

bool

Burner-stabilized flamelets are one-dimensional detailed chemistry solutions of non-adiabatic flat flames. They differ from adiabatic flames by the inflow condition, which is modeled as a porous medium which acts as a heat sink. More information about burner-stabilized flame simulations in Cantera can be found on the Cantera web page. By reducing the flow rate, the total enthalpy is reduced, enabling the generation of thermochemical data over a wide range of enthalpy. This is particularly useful when modeling non-adiabatic flames with FGM simulations or cooling flows over heat exchangers. Information on the inclusion of burner-stabilized flamelets in the manifold can be accessed through the following options.

RunBurnerFlames(self, input: bool = True)#

Include burner-stabilized flame data in the manifold.

Parameters:

input (bool) – enable generation of burner-stabilized flame data.

GenerateBurnerFlames(self)#

Whether the manifold data contains burner-stabilized flame data.

Returns:

burner-stabilized flamelets are generated.

Return type:

bool

The final type of data in the manifold supported by SU2 DataMiner is chemical equilibrium data. Chemical equilibrium data are generated by calculating thermochemical fluid properties of the premixed reactants and equilibrated reaction products for specific mixtures over a range of temperatures and enthalpy. These data are used to calculate the physics-informed penalty terms while training ML-FGM networks and populate the manifold in high-progress variable, low enthalpy regions. The following options provide information on whether chemical equilibrium data are included in the manifold.

RunEquilibrium(self, input: bool = True)#

Include chemical equilibrium (reactants and products) data in the manifold.

Parameters:

input (bool) – enable generation of chemical equilibrium data.

GenerateEquilibrium(self)#

Whether the manifold data contains chemical equilibrium data.

Returns:

chemical equilibrium data are generated.

Return type:

bool

Flamelet Manifold Bounds and Resolution#

Flamelets and chemical equilibrium data are generated within a user-defined range of mixtures and reactant temperatures. The mixture composition of the reactants can be defined through the mixture fraction or the equivalence ratio through the following functions.

DefineMixtureStatus(self, run_as_mixture_fraction: bool = False)#

Define the reactant mixture status as mixture fraction or equivalence ratio.

Parameters:

run_as_mixture_fraction – If set to True, the mixture status is defined as mixture fraction, while False defines it as equivalence ratio.

GetMixtureStatus(self)#

Get the mixture status definition of the current Config_FGM class.

Returns:

mixture status definition (True for mixture fraction, False for equivalence ratio)

Return type:

bool

The limits of the reactant mixture composition within which flamelets are generated can be accessed through the following functions. When the reactant composition is defined through the mixture fraction, the limits should be between 0.0 and 1.0, and they should be positive if the reactant composition is defined through the equivalence ratio.

SetMixtureBounds(self, mix_lower: float = 0.2, mix_upper: float = 20.0)#

Set upper and lower bounds of mixture status for flamelet data manifold.

Parameters:
  • mix_lower (float) – Leanest mixture status value.

  • mix_upper (float) – Richest mixture status value.

Raise:

If lower mixture status value exceeds the upper mixture status value.

GetMixtureBounds(self)#

Get the mixture status bounds.

Returns:

List containing lower and upper mixture status values.

Return type:

list[float]

Flamelet data are generated for a number of reactant mixture compositions linearly spaced between the lower and upper limit. The number of mixture compositions for which flamelet data are generated can be accessed with the following functions.

SetNpMix(self, input: int = 30)#

Set number of divisions between lean and rich mixture status for flamelet generation.

Parameters:

input (int) – Number of divisions between leanest and richest pre-mixed solution.

Raise:

Exception: If the number of divisions is lower than one.

GetNpMix(self)#

Get the number of divisions between the lean and rich mixture status for flamelet generation.

Returns:

number of divisions between rich and lean.

Return type:

int

Similarly to the reactant mixture composition, limits can be imposed on the reactant temperature for which flamelets and chemical equilibrium data are generated. The values should be provided in Kelvins.

SetUnbTempBounds(self, T_unb_lower: float = 300.0, T_unb_upper: float = 800.0)#

Define lower and upper reactant temperature for flamelet data generation.

Parameters:
  • T_unb_lower (float) – Lower reactant temperature in Kelvin.

  • T_unb_upper (float) – Upper reactant temperature in Kelvin.

Raise:

Exception: if lower temperature value exceeds upper temperature value.

GetUnbTempBounds(self)#

Get the reactant temperature bounds for flamelet generation.

Returns:

lower and upper reactant temperature.

Return type:

list[float]

For each reactant mixture composition, a number of flamelet solutions of each type are generated. For each reactant mixture composition, adiabatic flamelets are generated with the reactant temperature varying between the upper and lower limits for the reactant temperature. Burner-stabilized flamelets are generated with the mass flow rate varying between 100% and 1% of an adiabatic flamelet with the same reactant mixture composition and the reactant temperature set to the lower limit. More information on flamelet generation within SU2 DataMiner can be found here.

The number of adiabatic and burner-stabilized flamelets that are generated for each reactant mixture composition can be accessed with the following options.

SetNpTemp(self, Np_Temp: int = 30)#

Set number of divisions for the reactant temperature at each mixture fraction/equivalence ratio.

Parameters:

Np_Temp (int) – Number of divisions for the reactant temperature range.

Rase:

Exception: If the number of divisions is lower than one.

GetNpTemp(self)#

Get the number of divisions for the reactant temperature range.

Returns:

Number of divisions for the reactant temperature range.

Return type:

int

FGM Controlling Variables#

The themophysical and thermochemical state data in the flamelet manifold is projected onto the FGM controlling variables, for which transport equations are solved in SU2, and are defined as inputs to the artificial neural networks or look-up table. The FGM controlling variables can be accessed through the following functions. The progress variable is recognized as ProgressVariable, the total enthalpy as EnthalpyTot, and the mixture fraction as MixtureFraction. The progress variable should always be included in the controlling variables. The mixture fraction \(Z\) is formulated according to the definition by Bilger as

\[Z = \frac{q - q_O}{q_F - q_O}\]

where

\[q = \sum_{i=0}^{N_{\mathrm{s}}} \frac{2\nu_\mathrm{C}^i + \frac{1}{2}\nu_\mathrm{H}^i-\nu_\mathrm{O}^i}{W_{M,i}}Y_i.\]

\(q_O\) and \(q_F\) are evaluated for the pure fuel and oxidizer and \(\nu_\mathrm{C}^i\) ,:math:nu_mathrm{H}^i , and \(\nu_\mathrm{O}^i\) are the elemental components of carbon, hydrogen, and oxygen, respectively in species \(i\).

For the application of modeling non-adiabatic, premixed flames without preferential and differential diffusion, such as in premixed methane-air flames, only including the progress variable and total enthalpy is sufficient. For partially premixed flames or premixed flames with preferential diffusion, the mixture fraction should be included in the list of FGM controlling variables. More information about the preferential diffusion model can be found in the next section.

SetControllingVariables(self, controlling_variables: list[str] = ['ProgressVariable', 'EnthalpyTot', 'MixtureFraction'])#

Define the set of controlling variables for the current manifold.

Parameters:

controlling_variables (list[str], optional) – list with controlling variable names, defaults to DefaultSettings_FGM.controlling_variables

Raises:

Exception – if “ProgressVariable” is not included in the list of controlling variables.

GetControllingVariables(self)#

Retrieve the set of controlling variable names used as inputs for the networks of the data-driven fluid model.

Returns:

list of controlling variable names.

Return type:

list[str]

The progress variable, \(c\), is defined as

\[c= \sum_{i=0}^{N_{\mathrm{s}}}\alpha_i Y_i\]

where \(Y_i\) is the mass fraction of species \(i\), \(N_{\mathrm{s}}\) the number of species in the mixture, and \(\alpha_i\) a coefficient. The species and coefficient values of the progress variable can be accessed through the following functions.

SetProgressVariableDefinition(self, pv_species: list[str] = ['CH4', 'H2', 'O2', 'H2O', 'CO2'], pv_weights: list[float] = [-0.062332, -0.49603, -0.031252, 0.055509, 0.022723])#

Set the progress variable species and mass-fraction weights.

Parameters:
  • pv_species (list[str]) – list of species names defining the progress variable.

  • pv_weights (list[float]) – list of progress variable weights for respective species mass fractions.

Raise:

Exception: if the provided species and weights have unequal length.

GetProgressVariableSpecies(self)#

Get the progress variable species names.

Returns:

list of species names defining the progress variable.

Return type:

list[str]

GetProgressVariableWeights(self)#

Get the progress variable species weights.

Returns:

list of species mass fraction weights defining the progress variable.

Return type:

list[float]

By default, the coefficients of the progress variable are calculated as the weighted reactants and major products according to

\[\alpha_i = \frac{Y_{i, P} - Y_{i, R}}{W_{M,i}},\]

where \(Y_{i, R}\) is the species mass fraction in a stoichiometric mixture of the reactants, \(Y_{i, P}\) the species mass fraction in a stoichiometric mixture of stable reaction products, and \(W_{M,i}\) the molecular weight of the species.

SetDefaultProgressVariable(self)#

Set progress variable to be weighted sum of fuel and oxidizer species (minus N2) and major product at stochiometry. Weights are set as the inverse of specie molecular weight: negative for reactants, positive for product.

SU2 DataMiner also has automated methods for calculating the coefficients of the progress variable, which are documented here.

To set up FGM simulations in SU2, the user needs to write the values of the FGM controlling variables in the SU2 configuration file to define the initial condition and for inflow boundary conditions. The following function calculates the values of the FGM controlling variables for a given equivalence ratio and temperature.

GetUnburntScalars(self, equivalence_ratio: float, temperature: float)#

Compute the reactant progress variable, total enthalpy, and mixture fraction for a given equivalence ratio and temperature.

Parameters:
  • equivalence_ratio (float) – reactants equivalence ratio.

  • temperature (float) – reactants temperature in Kelvin.

Raise:

Warning: If temperature or equivalence ratio exceed flamelet data range.

Returns:

pv_unb: reactants progress variable value.

Return type:

pv_unb: float

Returns:

enth_unb: reactants total enthalpy value.

Return type:

enth_unb: float

Returns:

mixfrac_unb: reactants mixture fraction value.

Return type:

mixfrac_unb: float

Differential Diffusion#

The effects of preferential and differential diffusion affect the burning rate of lean, (partially) premixed flames with a high hydrogen content. In the SU2 FGM solver, the effects of preferential diffusion are modeled according to the model developed by Mukundakumar et. al. According to this model, the effects of preferential diffusion are modeled by modifying the diffusion term in the transport equations of the progress variable, the total enthalpy, and the mixture fraction. The functions listed in this section allow the user to access the preferential diffusion terms.

The preferential diffusion scalars are calculated when preferential diffusion is enabled in the SU2 DataMiner configuration, which can be done with the following functions.

EnablePreferentialDiffusion(self, use_PD: bool = False)#

Include preferential diffusion scalars in flamelet data manifold.

Parameters:

use_PD (bool, optional) – include diffusion scalars, defaults to DefaultSettings_FGM.preferential_diffusion

PreferentialDiffusion(self)#

Inclusion of preferential diffusion in flamelet data manifold.

Returns:

whether preferential diffusion scalars are included (True) or not (False).

Return type:

bool

When preferential diffusion is enabled, the solution of the FGM controlling variables is calculated in SU2 with the following transport equations

\[\frac{\partial (\rho c)}{\partial t} + \nabla \cdot (\rho c \mathbf{u}) - \nabla \cdot \left(D \nabla \beta_c\right) = \dot{\omega}_c\]
\[\frac{\partial (\rho h_\mathrm{t})}{\partial t} + \nabla \cdot (\rho h_\mathrm{t} \mathbf{u}) - \nabla \cdot \left(\beta_{h_\mathrm{t}, 1} \nabla T + D \nabla \beta_{h_\mathrm{t}, 2}\right) = 0\]
\[\frac{\partial (\rho Z)}{\partial t} + \nabla \cdot (\rho Z \mathbf{u}) - \nabla \cdot \left(D \nabla \beta_Z\right) = 0\]

in which the \(\beta-\) terms which appear in the third term on the left hand side are refered to as preferential diffusion scalars. The derivation of these terms can be found in Mukundakumar et. al.

The preferential diffusion model in Mukundakumar et. al was developed under the assumption of constant, non-equal species Lewis numbers. The values of the species Lewis numbers are used to calculate the values of the preferential diffusion scalars. The average species Lewis numbers, \(\overline{\mathrm{Le}_i}\), are calculated in SU2 DataMiner as the average between the reactants and products of a mixture with a user-defined composition and temperature.

\[\overline{\mathrm{Le}_i} = \frac{\mathrm{Le}_{i, R} + \mathrm{Le}_{i, P}}{2}\]

Here, \(\mathrm{Le}_{i, R}\) is the value of the species Lewis number evaluated for a mixture of reactants at a fixed equivalence ratio and temperature and \(\mathrm{Le}_{i, P}\) the species Lewis number for the mixture of stable reaction products calculated at a constant enthalpy and pressure. The mixture and reactant temperature at which the average species Lewis numbers are evaluated can be specified by the user with the following function.

SetAverageLewisNumbers(self, mixture_status: float = None, reactant_temperature: float = None)#

Define the constant specie Lewis numbers for a given mixture status and reactant temperature.

Parameters:
  • mixture_status (float, optional) – equivalence ratio or mixture fraction, defaults to the average of the manifold bounds.

  • reactant_temperature (float, optional) – reactant temperature, defaults to the average of the manifold bounds.

Raises:

Exception – if negative mixture status value or temperature is provided.

The values of the average species Lewis numbers can be retrieved with

GetConstSpecieLewisNumbers(self)#

Retrieve constant species Lewis numbers used to calculate the preferential diffusion scalars.

Returns:

array with species Lewis number values

Return type:

np.ndarray[float]

The values of the preferential diffusion scalars can be calcualted from flamelet data with

ComputeBetaTerms(self, variables: list[str], flamelet_data: ndarray)#

Compute the differential diffusion scalars for a flamelet.

Parameters:
  • variables (list[str]) – list of variable names in the flamelet data.

  • flamelet_data (np.ndarray) – flamelet data array.

Raise:

Exception: if number of variables does not match number of columns in flamelet data.

Returns:

Differential diffusion coefficients

Return type:

float

Passive Variables#

The variables that are read from the flamelet manifold data include

1. Thermodynamic variables: - Temperature \(T\) - Specific heat at constant pressure \(c_p\)

2. Transport variables: - Viscosity \(\mu\) - Thermal conductivity \(k\) - Thermal diffusivity \(D\) - Mean molecular weight \(W_M\)

  1. Progress variable source term \(\dot{\omega}_c\)

4. Preferential diffusion scalars (when preferential diffusion is enabled): - Progress variable \(\beta_c\) - Specific heat \(\beta_{h,1}\) - Enthalpy of formation \(\beta_{h,2}\) - Mixture fraction \(\beta_Z\)

5. Passive variables: - Passive scalars such as the heat release rate - Chemical source terms of species for which transport is calculated by SU2

The chemical source terms of any transported species will be retrieved from the flamelet data when they are defined by the user.

SetPassiveSpecies(self, passive_species: list[str] = [])#

Set the passive transported species for which source terms should be saved in the manifold.

Parameters:

passive_species (list[str]) – list of species names.

GetPassiveSpecies(self)#

Get the list of passive species included in the manifold data.

Returns:

list of passive species names.

Return type:

list[str]

Any additional passive quantities can be included in the manifold through the following functions. By default, the heat release rate \(\dot{Q}\) is included in the list of passive quantities.

SetLookUpVariables(self, lookup_vars: list[str] = [])#

Define passive look-up terms to be included in the manifold.

Parameters:

lookup_vars (list[str]) – list of passive variable names.

GetLookUpVariables(self)#

Get the variable names of the passive look-up variables in the manifold.

Returns:

__lookup_variables: list of passive look-up variables.

Return type:

list[str]

Output Group Management#

SU2 DataMiner supports the training of multi-task neural networks for ML-FGM applications. Here, the thermodynamic variables, transport variables, and other quantities are distributed over the output of several multi-task neural networks, termed groups. The variables in each group are assigned to the nodes in the output layer of a single network. By default, all quantities are evaluated by separate networks (single-task neural networks), but using multi-task neural networks reduces the number of networks required to be trained and evaluated during FGM simulations, reducing computational cost.

The composition of the output groups can be manually adapted and accessed with the following functions

AddOutputGroup(self, variable_names_in: list[str])#

Add an MLP output group of flamelet variables.

Parameters:

variable_names_in (list[str]) – list of output variables to include in the outputs of a single MLP.

Raises:

Exception – if the number of variables is equal to zero.

RemoveOutputGroup(self, i_group: int)#

Remove one of the MLP output groups.

Parameters:

i_group (int) – MLP output group index to remove.

Raises:

Exception – if group index is outside the range of stored groups.

ClearOutputGroups(self)#
DisplayOutputGroups(self)#

Print the MLP output variables grouping arrangement.

GetNMLPOutputGroups(self)#

Get the number of MLP output groups.

Returns:

number of MLP output groups

Return type:

int

GetMLPOutputGroup(self, i_group: int)#

Get the list of variables in a specific MLP group.

Parameters:

i_group (int) – MLP output group index.

Returns:

list of variables for this group.

Return type:

list[str]

SU2 DataMiner also has an automated method which groups the FGM dependent variables based on affinity, which is documentated here.

References#

Richard H.R Hahnloser et al. “Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit”. In: Nature 405 (June 2000), pp. 947-951.

Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. “Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)”. In: (Feb. 2016). URL:http://arxiv.org/abs/1511.07289

Dan Hendrycks and Kevin Gimpel. “Gaussian Error Linear Units (GELUs)”. In:(June 2023). URL: http://arxiv.org/abs/1606.08415.

Nithin Mukundakumar et al. “A new preferential diffusion model applied to FGM simulations of hydrogen flames”. In: Combustion Theory and Modelling 25.7 (2021), pp. 1245-1267. ISSN: 17413559. DOI: 10.1080/13647830.2021.1970232. URL:https://doi.org/10.1080/13647830.2021.1970232.

N. Peters. Turbulent Combustion. 1990, pp. 221-231. ISBN: 9780511612701. DOI:10.1142/9789814293778_0006.