Chemical Kinetics#
Caution
The MATLAB toolbox is an experimental part of the Cantera API and may be changed without notice. It includes breaking changes from the legacy MATLAB API. While almost all features of the legacy MATLAB API are implemented, the toolbox does not include all functionality available for the C++ and Python interfaces.
Kinetics Managers#
Kinetics#
- class ct.Kinetics#
Bases:
handleKinetics Class.
Instance of class
ct.Kineticsassociated with act.Solutionobject. The constructor is called whenever a newct.Solutionis instantiated and cannot be used directly.Class
ct.Kineticsrepresents kinetics managers, which manage reaction mechanisms. The reaction mechanism attributes are specified in a YAML file.Instances of class
ct.Kineticsare responsible for evaluating reaction rates of progress, species production rates, and other quantities pertaining to a reaction mechanism.- Parameters:
id – Integer ID of the solution holding the
ct.Kineticsobject.
- Property Summary
- creationRates#
Creation rates for each species [kmol/m³/s for bulk phases]
- deltaEnthalpy#
Enthalpy of reaction [J/kmol]
- deltaEntropy#
Entropy of reaction [J/kmol/K]
- deltaGibbs#
Gibbs free energy of reaction [J/kmol]
- deltaStandardEnthalpy#
Standard state enthalpy of reaction [J/kmol]
- deltaStandardEntropy#
Standard state entropy of reaction [J/kmol/K]
- deltaStandardGibbs#
Standard state Gibbs free energy of reaction [J/kmol]
- destructionRates#
Destruction rates for each species [kmol/m³/s for bulk phases]
- equilibriumConstants#
Equilibrium constants in concentration units for all reactions, calculated from the standard Gibbs free energy of reaction.
- forwardRateConstants#
Forward reaction rate constants for all reactions.
- forwardRatesOfProgress#
Forward rates of progress for all reactions [kmol/m³/s for bulk phases]
- kinID#
ID of the Kinetics object.
- nPhases#
Number of phases.
- nReactions#
Number of reactions.
- nTotalSpecies#
The total number of species.
- netProdRates#
Net chemical production rates for all species [kmol/m³/s for bulk phases]
- netRatesOfProgress#
Net rates of progress for all reactions [kmol/m³/s for bulk phases]
- reactionEquations#
All reaction equations within the Kinetics object.
- reverseRateConstants#
Reverse reaction rate constants for all reactions.
- reverseRatesOfProgress#
Reverse rates of progress for all reactions [kmol/m³/s for bulk phases]
- Method Summary
- advanceCoverages(dt)#
Advance the surface coverages forward in time.
>> kin.advanceCoverages(dt)
- Parameters:
dt – Time interval by which the coverages should be advanced.
- isReversible(i)#
An array of flags indicating reversibility of a reaction.
>> n = kin.isReversible(i)
- Parameters:
i – Integer reaction number.
- Returns:
True if reaction number i is reversible. false if irreversible.
- kineticsSpeciesIndex(name)#
Get the species index of a species of a phase in the Kinetics class.
>> n = kin.kineticsSpeciesIndex(name)
- Parameters:
name – String name or integer index of the species.
- Returns:
Index of the species.
- multiplier(irxn)#
Get the multiplier for reaction rate of progress.
>> n = kin.multiplier(irxn)
- Parameters:
irxn – Integer reaction number for which the multiplier is desired.
- Returns:
Multiplier of the rate of progress of reaction irxn.
- netStoichCoeffs(species, rxns)#
Net stoichiometric coefficients.
>> n = kin.netStoichCoeffs(species, rxns)
- Parameters:
species – Species indices or names for which net stoichiometric coefficients should be retrieved. Optional argument; if specified,
rxnsmust be specified as well.rxns – Reaction indices for which net stoichiometric coefficients should be retrieved. Optional argument; if specified,
speciesmust be specified as well.
- Returns:
Returns a sparse matrix of all net stoichiometric coefficients if there are more than 1 species or reactions, otherwise returns an integer. The matrix elements
nu(k, i)is the stoichiometric coefficient of species k as a product in reaction i. Ifspeciesandrxnsare specified, the matrix will contain only entries for the specified species and reactions. For example,kin.netStoichCoeffs(3, [1, 3, 5, 7])returns a sparse matrix containing only the coefficients for species 3 in reactions 1, 3, 5, and 7.
- phaseIndex(phase)#
The index of a specific phase.
>> n = kin.phaseIndex(phase)
- Parameters:
phase – String name of the phase.
- Returns:
Index of the phase.
- productStoichCoeffs(species, rxns)#
Product stoichiometric coefficients.
>> n = kin.productStoichCoeffs(species, rxns)
- Parameters:
species – Species indices or names for which product stoichiometric coefficients should be retrieved. Optional argument; if specified,
rxnsmust be specified as well.rxns – Reaction indices for which product stoichiometric coefficients should be retrieved. Optional argument; if specified,
speciesmust be specified as well.
- Returns:
Returns a sparse matrix of all product stoichiometric coefficients if there are more than 1 species or reactions, otherwise returns an integer. The matrix elements
nu(k, i)is the stoichiometric coefficient of species k as a product in reaction i. Ifspeciesandrxnsare specified, the matrix will contain only entries for the specified species and reactions. For example,kin.productStoichCoeffs(3, [1, 3, 5, 7])returns a sparse matrix containing only the coefficients for species 3 in reactions 1, 3, 5, and 7.
- reactantStoichCoeffs(species, rxns)#
Reactant stoichiometric coefficients.
>> n = kin.reactantStoichCoeffs(species, rxns)
- Parameters:
species – Species indices or names for which reactant stoichiometric coefficients should be retrieved. Optional argument; if specified,
rxnsmust be specified as well.rxns – Reaction indices for which reactant stoichiometric coefficients should be retrieved. Optional argument; if specified,
speciesmust be specified as well.
- Returns:
Returns a sparse matrix of all reactant stoichiometric coefficients if there are more than 1 species or reactions, otherwise returns an integer. The matrix elements
nu(k, i)is the stoichiometric coefficient of species k as a reactant in reaction i. Ifspeciesandrxnsare specified, the matrix will contain only entries for the specified species and reactions. For example,kin.reactantStoichCoeffs(3, [1, 3, 5, 7])returns a sparse matrix containing only the coefficients for species 3 in reactions 1, 3, 5, and 7.
- reactionEquation(irxn)#
Reaction equation of a reaction.
>> rxn = kin.reactionEquation(irxn)
- Parameters:
irxn – Integer index of the reaction.
- Returns:
String reaction equation.
- setMultiplier(irxn, v)#
Set the multiplier for the reaction rate of progress.
>> kin.setMultiplier(irxn, v)
- Parameters:
irxn – Integer vector reaction numbers for which the multiplier should be set. Optional.
v – Value by which the reaction rate of progress should be multiplied.