Chemical Kinetics¶

Kinetics¶

class Kinetics(r, ph, neighbor1, neighbor2, neighbor3, neighbor4)

Kinetics class constructor.

Class Kinetics represents kinetics managers, which are classes that manage reaction mechanisms. The reaction mechanism attributes are specified in a CTML file. Instances of class Kinetics() are responsible for evaluating reaction rates of progress, species production rates, and other quantities pertaining to a reaction mechanism.

Parameters: r – If r is an instance of class Kinetics(), a copy of the instance is returned. In this case, r should be the only argument. Otherwise, r must be an instance of class XML_Node(). ph – If r is an instance of XML_Node(), ph is an instance of class ThermoPhase(). Otherwise, optional. neighbor1 – Instance of class ThermoPhase() or Solution() representing a neighboring phase. neighbor2 – Instance of class ThermoPhase() or Solution() representing a neighboring phase. neighbor3 – Instance of class ThermoPhase() or Solution() representing a neighboring phase. neighbor4 – Instance of class ThermoPhase() or Solution() representing a neighboring phase. Instance of class Kinetics()

Advance the surface coverages forward in time.

The bulk phase concentrations are held fixed during this operation.

Parameters: k – Instance of class Interface() with an associated Kinetics() object. dt – Time interval by which the coverages should be advanced
creationRates(a)

Get the chemical creation rates.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which creation rates are desired. Returns a column vector of the creation rates of all species. If the output is not assigned to a variable, a bar graph is produced. Units: kmol/m**3-s
destructionRates(a)

Get the chemical destruction rates.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which destruction rates are desired. Returns a column vector of the destruction rates of all species. If the output is not assigned to a variable, a bar graph is produced. Units: kmol/m**3-s
destruction_rates(a)

Get the chemical destruction rates.

This function is deprecated in favor of the function destructionRates()

equil_Kc(a)

Get the equilibrium constants for all reactions

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which equilibrium constants are desired. Returns a column vector of the equilibrium constants for all reactions. The vector has an entry for every reaction, whether reversible or not, but non-zero values occur only for the reversible reactions. If the output is not assigned to a variable, a bar graph is produced instead.
fwdRateConstants(a)

Get the forward reaction rate constants.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which forward rate constants are desired. Returns a column vector of the forward rate constants of all of the reactions.
isReversible(a, i)

Get an array of flags indicating reversibility of a reaction.

A reversible reaction is one that runs in both the forward direction (reactants -> products) and in the reverse direction (products -> reactants). The reverse rate for reversible reactions can computed from thermochemistry, so that the reaction satisfies detailed balance, and the net rate of progress is zero in states of chemical equilibrium. The reverse rate can also be specified directly by a rate expression. An irreversible reaction is one whose reverse reaction rate is zero.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the reversible flags are desired. i – Integer reaction number 1 if reaction number i is reversible, and 0 if it is irreversible.
multiplier(a, irxn)

Get the multiplier for reaction rate of progress.

The multiplier multiplies the reaction rate of progress. It may be used to implement sensitivity analysis, or to selectively disable reactions. For reversible reactions, it multiplies both the forward and reverse rates. By default, the multiplier value is 1.0, but it may be set to any other value by calling method setMultiplier().

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the multipliers are desired. irxn – Integer reaction number for which the multiplier is desired. Multiplier of the rate of progress of reaction number irxn
nReactions(a)

Get the number of reactions.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the number of reactions is desired. Integer number of reactions
nTotalSpecies(a)

Get the total number of species.

The total number of species, summed over all participating phases.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the number of species is desired. Integer total number of species
netProdRates(a)

Get the net chemical production rates for all species.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which net production rates are desired. Returns a column vector of the net production (creation - destruction) rates of all species. If the output is not assigned to a variable, a bar plot is produced.
reactionEqn(a, irxn)

Get the reaction equation of a reaction.

If only the first argument is given, the reaction equations of all of the reactions are returned in a cell array. Otherwise, irxn must be an integer or vector of integers.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the reaction equations are desired. irxn – Optional. Integer or vector of integer reaction numbers. String or cell array of strings of the reaction equations.
revRateConstants(a)

Get the reverse reaction rate constants.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which reverse rate constants are desired. Returns a column vector of the reverse rate constants of all of the reactions.
rop(a)

Get the forward and reverse rates of progress.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which forward and reverse rates of progress are desired. Returns an I x 2 array of reaction rates of progress, where I is the number of reactions. The first column contains the forward rates of progress, and the second column the reverse rates. If this function is called with no output argument, a bar graph is produced.
rop_f(a)

Forward rates of progress for all reactions.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which forward rates of progress are desired. Returns a column vector of the forward rates of progress for all reactions. If this function is called with no output argument, a bar graph is produced.
rop_net(a)

Net rates of progress for all reactions.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the net rates of progress are desired. Returns a column vector of the net rates of progress for all reactions. If this function is called with no output argument, a bar graph is produced.
rop_r(a)

Get the reverse rates of progress for all reactions.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which reverse rates of progress are desired. Returns a column vector of the reverse rates of progress for all reactions. If this function is called with no output argument, a bar graph is produced.
setMultiplier(a, irxn, v)

Set the multiplier for the reaction rate of progress.

The multiplier multiplies the reaction rate of progress. It may be used to implement sensitivity analysis, or to selectively disable reactions. For reversible reactions, it multiplies both the forward and reverse rates. By default, the multiplier value is 1.0, but the current value may be checked by calling method multiplier().

If only two arguments are given, it is assumed that the second is the desired multiplication factor for all of the reactions.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the multipliers should be set. irxn – Integer or vector of integers. Reaction number(s) for which the multiplier should be set. Optional. v – Value by which the reaction rate of progress should be multiplied
stoich_net(a, species, rxns)

Get the net stoichiometric coefficients.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the net stoichiometric coefficients are desired. species – Species indices for which net stoichiometric coefficients should be retrieved. Optional argument; if specified, rxns must be specified as well. rxns – Reaction indices for which net stoichiometric coefficients should be retrieved. Optional argument; if specified, species must be specified as well. Returns a sparse matrix of all net stoichiometric coefficients. The matrix element nu(k,i) is the stoichiometric coefficient of species k as a net in reaction i. If species and rxns are specified, the matrix will contain only entries for the specified species and reactions. For example, stoich_p(a,3,[1 3 5 7]) returns a sparse matrix containing only the coefficients for species 3 in reactions 1, 3, 5, and 7.
stoich_p(a, species, rxns)

Get the product stoichiometric coefficients.

Parameters: a – Instance of class Kinetics() (or another object deriving from Kinetics) for which the product stoichiometric coefficients are desired. species – Species indices for which product stoichiometric coefficients should be retrieved. Optional argument; if specified, rxns must be specified as well. rxns – Reaction indices for which product stoichiometric coefficients should be retrieved. Optional argument; if specified, species must be specified as well. Returns a sparse matrix of all product stoichiometric coefficients. The matrix element nu(k,i) is the stoichiometric coefficient of species k as a product in reaction i. If species and rxns are specified, the matrix will contain only entries for the specified species and reactions. For example, stoich_p(a,3,[1 3 5 7]) returns a sparse matrix containing only the coefficients for species 3 in reactions 1, 3, 5, and 7.
stoich_r(a, species, rxns)

Get the reactant stoichiometric coefficients.

Evaluates the source term $$\dot{\omega}_k M_k /\rho$$