# rmgpy.reaction.Reaction¶

class rmgpy.reaction.Reaction

A chemical reaction. The attributes are:

Attribute Type Description
index int A unique nonnegative integer index
label str A descriptive string label
reactants list The reactant species (as Species objects)
products list The product species (as Species objects)
kinetics KineticsModel The kinetics model to use for the reaction
reversible bool True if the reaction is reversible, False if not
transitionState TransitionState The transition state
duplicate bool True if the reaction is known to be a duplicate, False if not
degeneracy double The reaction path degeneracy for the reaction
pairs list Reactant-product pairings to use in converting reaction flux to species flux
calculateMicrocanonicalRateCoefficient()

Calculate the microcanonical rate coefficient $$k(E)$$ for the reaction reaction at the energies Elist in J/mol. reacDensStates and prodDensStates are the densities of states of the reactant and product configurations for this reaction. If the reaction is irreversible, only the reactant density of states is required; if the reaction is reversible, then both are required. This function will try to use the best method that it can based on the input data available:

• If detailed information has been provided for the transition state (i.e. the molecular degrees of freedom), then RRKM theory will be used.
• If the above is not possible but high-pressure limit kinetics $$k_\infty(T)$$ have been provided, then the inverse Laplace transform method will be used.

The density of states for the product prodDensStates and the temperature of interest T in K can also be provided. For isomerization and association reactions prodDensStates is required; for dissociation reactions it is optional. The temperature is used if provided in the detailed balance expression to determine the reverse kinetics, and in certain cases in the inverse Laplace transform method.

calculateTSTRateCoefficient()

Evaluate the forward rate coefficient for the reaction with corresponding transition state TS at temperature T in K using (canonical) transition state theory. The TST equation is

$k(T) = \kappa(T) \frac{k_\mathrm{B} T}{h} \frac{Q^\ddagger(T)}{Q^\mathrm{A}(T) Q^\mathrm{B}(T)} \exp \left( -\frac{E_0}{k_\mathrm{B} T} \right)$

where $$Q^\ddagger$$ is the partition function of the transition state, $$Q^\mathrm{A}$$ and $$Q^\mathrm{B}$$ are the partition function of the reactants, $$E_0$$ is the ground-state energy difference from the transition state to the reactants, $$T$$ is the absolute temperature, $$k_\mathrm{B}$$ is the Boltzmann constant, and $$h$$ is the Planck constant. $$\kappa(T)$$ is an optional tunneling correction.

canTST()

Return True if the necessary parameters are available for using transition state theory – or the microcanonical equivalent, RRKM theory – to compute the rate coefficient for this reaction, or False otherwise.

copy()

Create a deep copy of the current reaction.

draw()

Generate a pictorial representation of the chemical reaction using the draw module. Use path to specify the file to save the generated image to; the image type is automatically determined by extension. Valid extensions are .png, .svg, .pdf, and .ps; of these, the first is a raster format and the remainder are vector formats.

fixBarrierHeight()

Turns the kinetics into Arrhenius (if they were ArrheniusEP) and ensures the activation energy is at least the endothermicity for endothermic reactions, and is not negative only as a result of using Evans Polanyi with an exothermic reaction. If forcePositive is True, then all reactions are forced to have a non-negative barrier.

fixDiffusionLimitedA()

Decrease the pre-exponential factor (A) by the diffusion factor to account for the diffusion limit at the specified temperature.

generate3dTS()

Generate the 3D structure of the transition state. Called from model.generateKinetics().

self.reactants is a list of reactants self.products is a list of products

generatePairs()

Generate the reactant-product pairs to use for this reaction when performing flux analysis. The exact procedure for doing so depends on the reaction type:

Reaction type Template Resulting pairs
Isomerization A -> C (A,C)
Dissociation A -> C + D (A,C), (A,D)
Association A + B -> C (A,C), (B,C)
Bimolecular A + B -> C + D (A,C), (B,D) or (A,D), (B,C)

There are a number of ways of determining the correct pairing for bimolecular reactions. Here we try a simple similarity analysis by comparing the number of heavy atoms (carbons and oxygens at the moment). This should work most of the time, but a more rigorous algorithm may be needed for some cases.

generateReverseRateCoefficient()

Generate and return a rate coefficient model for the reverse reaction. Currently this only works if the kinetics attribute is one of several (but not necessarily all) kinetics types.

getEnthalpiesOfReaction()

Return the enthalpies of reaction in J/mol evaluated at temperatures Tlist in K.

getEnthalpyOfReaction()

Return the enthalpy of reaction in J/mol evaluated at temperature T in K.

getEntropiesOfReaction()

Return the entropies of reaction in J/mol*K evaluated at temperatures Tlist in K.

getEntropyOfReaction()

Return the entropy of reaction in J/mol*K evaluated at temperature T in K.

getEquilibriumConstant()

Return the equilibrium constant for the reaction at the specified temperature T in K. The type parameter lets you specify the quantities used in the equilibrium constant: Ka for activities, Kc for concentrations (default), or Kp for pressures. Note that this function currently assumes an ideal gas mixture.

getEquilibriumConstants()

Return the equilibrium constants for the reaction at the specified temperatures Tlist in K. The type parameter lets you specify the quantities used in the equilibrium constant: Ka for activities, Kc for concentrations (default), or Kp for pressures. Note that this function currently assumes an ideal gas mixture.

getFreeEnergiesOfReaction()

Return the Gibbs free energies of reaction in J/mol evaluated at temperatures Tlist in K.

getFreeEnergyOfReaction()

Return the Gibbs free energy of reaction in J/mol evaluated at temperature T in K.

getRateCoefficient()

Return the overall rate coefficient for the forward reaction at temperature T in K and pressure P in Pa, including any reaction path degeneracies.

If diffusionLimiter is enabled, the reaction is in the liquid phase and we use a diffusion limitation to correct the rate. If not, then use the intrinsic rate coefficient.

getStoichiometricCoefficient()

Return the stoichiometric coefficient of species spec in the reaction. The stoichiometric coefficient is increased by one for each time spec appears as a product and decreased by one for each time spec appears as a reactant.

getURL()

Get a URL to search for this reaction in the rmg website.

hasTemplate()

Return True if the reaction matches the template of reactants and products, which are both lists of Species objects, or False if not.

isAssociation()

Return True if the reaction represents an association reaction $$\ce{A + B <=> C}$$ or False if not.

isBalanced()

Return True if the reaction has the same number of each atom on each side of the reaction equation, or False if not.

isDissociation()

Return True if the reaction represents a dissociation reaction $$\ce{A <=> B + C}$$ or False if not.

isIsomerization()

Return True if the reaction represents an isomerization reaction $$\ce{A <=> B}$$ or False if not.

isIsomorphic()

Return True if this reaction is the same as the other reaction, or False if they are different. If eitherDirection=False then the directions must match.

isUnimolecular()

Return True if the reaction has a single molecule as either reactant or product (or both) $$\ce{A <=> B + C}$$ or $$\ce{A + B <=> C}$$ or $$\ce{A <=> B}$$, or False if not.

matchesMolecules()

Return True if the given reactants represent the total set of reactants or products for the current reaction, or False if not. The reactants should be Molecule objects.

reverseThisArrheniusRate()

Reverses the given kForward, which must be an Arrhenius type. You must supply the correct units for the reverse rate. The equilibrium constant is evaluated from the current reaction instance (self).

toCantera()

Converts the RMG Reaction object to a Cantera Reaction object with the appropriate reaction class.

toChemkin()

Return the chemkin-formatted string for this reaction.

If kinetics is set to True, the chemkin format kinetics will also be returned (requires the speciesList to figure out third body colliders.) Otherwise, only the reaction string will be returned.