libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel

@author: F. Ramognino <federico.ramognino@polimi.it> Last update: 01/02/2024

Defines classes to handel reaction of mixtures involving multiple simple reactions

Content of the package:
ReactionModel (module)

Base class

Stoichiometry (module)

Combustion with infinitely fast combustion through balancing of stoichiometry

Equilibrium (module)

Computation of combustion products based on equilibrium

Inhert (module)

Non-reacting mixture

DissociationModel (module)

Defines classes to handel dissociation of specie in a mixture. Used in the Stoichiometry reaction model to impose dissociation of molecules.

Submodules

Classes

ReactionModel

Defines classes to handel reaction of mixtures involving multiple simple reactions

Stoichiometry

Reaction model of fuel combustion with infinitely fast chemistry

Equilibrium

Reaction model based on computation of chemical equilibrium which CANTERA.

Inhert

Inhert mixture (no reactions)

Package Contents

class libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None)[source]

Bases: libICEpost.src.base.BaseClass.BaseClass

Defines classes to handel reaction of mixtures involving multiple simple reactions

reactants

The mixture of the reactants

Type:

Mixture

products

The mixture of products of the reaction

Type:

Mixture

reactions

Database of oxidation reactions. Reference to database.chemistry.reactions[ReactionType]

Type:

_Database

_ReactionType: str

The type for reactions to lookup for in the database

_reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture

The mixture of reactants

_products: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture

The mixture of products

_state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState | None

The last thermodynamic state used to update the reaction model

property reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture

The mixture of reactants

property products

The mixture of products

property reactions

The database with the avaliabe reactions

property ReactionType

Name of the reactions used

property state

The last thermodynamic state used to update the reaction model

_reactions
update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) bool[source]

Method to update the reactants data based on the mixture composition (interface).

Parameters:
  • reactants (Mixture, optional) – Mixture of reactants if to be changed. Defaults to None.

  • state (ThermoState, optional) – Thermodynamic state to update the reaction model.

Returns:

if something changed

Return type:

bool

abstractmethod _update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) bool[source]

Method to update the reactants based on the mixture composition (implementation).

Parameters:
  • reactants (Mixture, optional) – Mixture of reactants if to be changed. Defaults to None.

  • state (ThermoState) – Thermodynamic state to update the reaction model.

Returns:

if something changed

Return type:

bool

class libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.Stoichiometry(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture, *, oxidizer: libICEpost.src.thermophysicalModels.specie.specie.Molecule.Molecule = database.chemistry.specie.Molecules.O2, dissociationModels: Iterable[libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.DissociationModel.DissociationModel.DissociationModel] = None)[source]

Bases: libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel.ReactionModel

Reaction model of fuel combustion with infinitely fast chemistry

TODO: Extend to handle a generic reaction set, where there might be more then one oxidizer

Molecule The oxidiser

reactants

(Mixture) The mixture of the reactants

products

(Mixture) The mixture of products of the reaction

reactions

(_Database) Database of oxidation reactions. Reference to database.chemistry.reactions

_ReactionType: str = 'StoichiometricReaction'

The type for reactions to lookup for in the database

_productsPreDissociation: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture

The combustion products before applying the dissociation models

dissociationModels: list[libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.DissociationModel.DissociationModel.DissociationModel]

A list of the dissociation models to apply

property fuel

The sub-mixture of reactants with the fuels

property oxidizer

The oxidizer

classmethod fromDictionary(dictionary)[source]

Construct from dictionary.

Parameters:

dictionary (dict) –

The dictionary from which constructing, containing: reactants (Mixture): the mixture of reactants oxidiser (Molecule): the oxidizer dissociationModels (dict[str:dict]): Construction dictionaries for dissociation models in the form: {

<DissociationModelType>: construction dictionary for the specific model …

}

_oxidizer
_updateFuels()[source]

Update list of fuels

_update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) bool[source]

Method to update the products.

Parameters:
  • reactants (Mixture, optional) – Update mixture of reactants. Defaults to None.

  • state (ThermoState, optional) – Thermodynamic state to update the reaction model. (NOT USED)

Returns:

if something changed

Return type:

bool

class libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.Equilibrium(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture, mechanism: str, *, method: Literal['average', 'adiabatiFlame', 'burntGas'], state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState)[source]

Bases: libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel.ReactionModel

Reaction model based on computation of chemical equilibrium which CANTERA.

oxidiser

The oxidiser

Type:

Molecule

reactants

The mixture of the reactants

Type:

Mixture

products

The mixture of products of the reaction

Type:

Mixture

specie

The molecules to consider in the equilibrium

Type:

list[Molecule]

mechanism

The path where the mechanism in yaml is stored

Type:

str

_ReactionType: str = None

The type for reactions to lookup for in the database

_reactor: cantera.composite.Solution

The ractor used to compute equilibrium in CANTERA

_mechamism: str

The path of the mechanism

classmethod fromDictionary(dictionary: dict)[source]

Constructs from dictionary

Parameters:

dictionary (dict) – The dictionary from which constructing: reactants (Mixture): the mixture of reactants mechanism (str): The path where is stored the chemical mechanism to use (yaml)

property mechanism: str

The path where the mechanism is stored.

property method

The method used to compute the equilibrium.

_mechanism
_method
_update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState) bool[source]

Method to update the products.

Parameters:
  • reactants (Mixture, optional) – Update mixture of reactants. Defaults to None.

  • state (ThermoState) – Thermodynamic state to update the reaction model.

Returns:

wether the system was updated

Return type:

bool

class libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.Inhert(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture)[source]

Bases: libICEpost.src.thermophysicalModels.specie.reactions.ReactionModel.ReactionModel.ReactionModel

Inhert mixture (no reactions)

(Mixture) The mixture of the reactants

products

(Mixture) The mixture of products of the reaction

_ReactionType: str = None

The type for reactions to lookup for in the database

classmethod fromDictionary(dictionary)[source]

Constuct from dictionary.

Parameters:

dictionary (dict) – The dictionary from which constructing, containing: reactants (Mixture): the mixture of reactants

_products

The mixture of products

_update(reactants: libICEpost.src.thermophysicalModels.specie.specie.Mixture.Mixture = None, *, state: libICEpost.src.thermophysicalModels.thermoModels.ThermoState.ThermoState = None) bool[source]

Method to update the products.

Parameters:
  • reactants (Mixture, optional) – Update mixture of reactants. Defaults to None.

  • state (ThermoState, optional) – Thermodynamic state to update the reaction model. (NOT USED)

Returns:

if something changed

Return type:

bool