Cantera/CTI Files/Reactions
From charlesreid1
Contents
- 1 Reaction Specification
- 2 Gas Reactions
- 3 Surface Reactions
- 4 Flags
Reaction Specification
Processing of reactions in CTI files occurs in the file ctml_writer.py
, located in cantera/interfaces/python/ctml_writer.py
. This class is defined around line 968 or so.
The file uses special notation for things that the CTI interpreter knows how to understand. For example, the reaction direction can be specified using different symbols:
forward reactions are specified using =>
, reverse reactions are specified using <=
, and reversible reactions are specified using <=>
, like this:
A + B => C G <= E + F W + X <=> Y + Z
Gas Reactions
An example gas reaction CTI file is located at cantera/data/inputs/h2o2.cti
.
In general, the gas phase reaction rate can be modeled as:
where is the stoichiometric coefficient for species i in reaction j, is the molar concentration of species i, and is the order of reaction j with respect to species i.
Arrhenius Gas Kinetics
The standard way to model reaction kinetics in the gas phase is to use Arrhenius kinetics. This models the reaction rate constant as:
where the Arrhenius reaction parameters are:
- - Arrhenius parameter pre-exponential factor
- - Arrhenius parameter, degree of temperature influence on kinetic rate constant
- - Arrhenius parameter, activation energy of reaction
These quantities can be specified in a CTI file as follows:
reaction( "A + B => C + D", [A, b, E] )
and the units of each are:
- - specified in units of
- - dimensionless
- - specified in units of
Arrhenius Gas Kinetics Example
Example:
Specify the reaction
which has the following parameter values:
Result:
reaction( "H + O2 <=> O + OH", [3.54700E+15, -0.406, 16599])
Arrhenius Gas Kinetics Code
More information on what blocks of code process this stuff from the CTI file.
Three-Body Gas Reactions
A three body gas reaction is... I don't know.
three_body_reaction( "H2 + M <=> H + H + M", [4.57700E+19, -1.4, 104380], efficiencies = " AR:0 CO:1.9 CO2:3.8 H2:2.5 H2O:12 HE:0 ")
Three Body Gas Reactions Example
It would help if I could figure out what this reaction type is, before putting together an example.
Three Body Gas Reactions Code
When Cantera processes a CTI file, it determines what kind of kinetics object to use. If the kinetics is for a gas phase, the object is a GasKinetics object. The GasKinetics object has a GasKinetics::addReaction()
method, which is run for each reaction in the CTI file:
void GasKinetics::
addReaction(ReactionData& r)
{
switch (r.reactionType) {
case ELEMENTARY_RXN:
addElementaryReaction(r);
break;
case THREE_BODY_RXN:
addThreeBodyReaction(r);
break;
case FALLOFF_RXN:
addFalloffReaction(r);
break;
case PLOG_RXN:
addPlogReaction(r);
break;
case CHEBYSHEV_RXN:
addChebyshevReaction(r);
break;
default:
throw CanteraError("GasKinetics::addReaction", "Invalid reaction type specified");
}
The three body reaction computation is set up in GasKinetics::addThreeBodyReaction
:
void GasKinetics::
addThreeBodyReaction(ReactionData& r)
{
// install rate coeff calculator
size_t iloc = m_rates.install(reactionNumber(), r);
// add constant term to rate coeff value vector
m_rfn.push_back(r.rateCoeffParameters[0]);
// forward rxn order equals number of reactants + 1
m_fwdOrder.push_back(r.reactants.size() + 1);
m_3b_concm.install(reactionNumber(), r.thirdBodyEfficiencies,
r.default_3b_eff);
registerReaction(reactionNumber(), THREE_BODY_RXN, iloc);
}
Falloff Gas Reactions
falloff_reaction( "H + O2 (+ M) <=> HO2 (+ M)", kf = [1.47500E+12, 0.6, 0], kf0 = [6.36600E+20, -1.72, 524.8], falloff = Troe(A = 0.8, T3 = 1e-30, T1 = 1e+30), efficiencies = " CO:1.9 CO2:3.8 H2:2 H2O:11 O2:0.78 ")
Falloff Gas Reaction Example
Falloff Gas Reaction Code
Other Gas Reaction Options
Duplicate is the only option I see:
reaction( "HO2 + HO2 <=> H2O2 + O2", [1.30000E+11, 0, -1629.3], options = ["duplicate"])
Surface Reactions
Any surface reaction can be specified in the cti file using the surface_reaction
function. The usage depends on the surface reaction form.
There are a variety of forms of surface reactions, each with a different specification method.
An example surface reaction CTI file is located at cantera/data/inputs/ptcombust.cti
.
Arrhenius Surface Kinetics
The plain/default way, which uses Arrhenius kinetics:
surface_reaction( "A(s) => B(s) + C", [A, b, E])
where:
- A(s), B(s), C - species whose properties are defined in the species section (see above)
- A - Arrhenius parameter, pre-exponential factor (specified in units of...)
- b - Arrhenius parameter, degree of temperature influence on kinetic rate constant
- E - Arrhenius parameter, activation energy of reaction
The Arrhenius expression is:
Arrhenius Surface Kinetics Example
A catalytic reaction where H2O (adsorbed onto a platinum surface) desorbs would look like this:
surface_reaction( "H2O(S) => H2O + PT(S)", [1.00000E+13, 0, 40300])
Arrhenius Surface Kinetics Code
Not sure where this is dealt with in the Cantera code.
Surface Reactions with Coverage-Dependent Rates
Still working through this coverage dependency.
This uses some kind of expression containing a, m, and e.
surface_reaction( "A(s) => B(s) + C", Arrhenius(A, b, E, coverage=['A(s)', surface_a, surface_m, surface_e])
Attempting to uncover how this is dealt with:
importKinetics::getCoverageDependence() rdata.cov vector contains coverage-related parameters/information rdata.cov.push_back(species_index) rdata.cov.push_back(a) rdata.cov.push_back(m) rdata.cov.push_back(e)
and then
InterfaceKinetics::addElementaryReaction if r.cov.size > 3: this rxn is dependent on coverage register rxn
Surface Reactions with Sticking Equations
No idea how this works.
surface_reaction( "A + B(s) => C + D(s)", stick(1.00000E+00, 0, 0))
Sticking Surface Reactions Example
surface_reaction( "OH + PT(S) => OH(S)", stick(1.00000E+00, 0, 0))
Sticking Surface Reactions Code
To do
Surface Reactions with Falloff
No idea.
Surface Reactions with Falloff Example
To do
Surface Reactions with Falloff Code
To do
Other Surface Reaction Options
surface_reaction( "O2 + 2 PT(S) => 2 O(S)", Arrhenius(1.80000E+21, -0.5, 0), options = 'duplicate')
Flags
Cantera all pages on the wiki related to the Cantera combustion microkinetics and thermodynamics (a.k.a. "thermochemistry") software.
Cantera · Cantera Outline · Category:Cantera
Outline of Cantera topics: Cantera Outline · Cantera Outline/Brief Understanding Cantera's Structure: Cantera Structure Cantera from Matlab: Using_Cantera#Matlab Cantera from Python: Using_Cantera#Python Cantera from C++: Using_Cantera#C++ Cantera + Fipy (PDE Solver): Fipy and Cantera/Diffusion 1D Cantera Gas Objects: Cantera/Gases Cantera 1D Domains, Stacks: Cantera_One-D_Domains · Cantera_Stacks Cantera Gas Mixing: Cantera_Gas_Mixing
Topics in Combustion: Diffusion: Cantera/Diffusion · Cantera/Diffusion Coefficients Sensitivity Analysis: Cantera/Sensitivity Analysis Analysis of the Jacobian Matrix in Cantera: Jacobian_in_Cantera Chemical Equilibrium: Chemical_Equilibrium Kinetic Mechanisms: Cantera/Kinetic_Mechanisms Reactor Equations: Cantera/Reactor_Equations Differential vs. Integral Reactors: Cantera/Integral_and_Differential_Reactors Effect of Dilution on Adiabatic Flame Temperature: Cantera/Adiabatic_Flame_Temperature_Dilution
Topics in Catalysis: Cantera for Catalysis: Cantera_for_Catalysis Steps for Modeling 0D Multiphase Reactor: Cantera_Multiphase_Zero-D Reaction Rate Source Terms: Cantera/Reaction_Rate_Source_Terms Surface coverage: Cantera/Surface_Coverage Surface reactions: Cantera/Surface_Reactions
Cantera Input Files: Chemkin file format: Chemkin CTI files: Cantera/CTI_Files · Cantera/CTI_Files/Phases · Cantera/CTI_Files/Species · Cantera/CTI_Files/Reactions
Hacking Cantera: Pantera (monkey patches and convenience functions for Cantera): Pantera Extending Cantera's C API: Cantera/Extending_C_API Extending Cantera with Python Classes: Cantera/Adding Python Class Debugging Cantera: Cantera/Debugging_Cantera Debugging Cantera from Python: Cantera/Debugging_Cantera_from_Python Gas Mixing Functions: Cantera_Gas_Mixing Residence Time Reactor (new Cantera class): Cantera/ResidenceTimeReactor
Resources: Cantera Resources: Cantera Resources Cantera Lecture Notes: Cantera_Lecture
Category:Cantera · Category:Combustion Category:C++ · Category:Python Flags · Template:CanteraFlag · e |
Installing Cantera notes on the wiki related to installing the Cantera thermochemistry software library.
Cantera Installation: Mac OS X 10.5 (Leopard): Installing_Cantera#Leopard Mac OS X 10.6 (Snow Leopard): Installing_Cantera#Snow_Leopard · Cantera2 Config Mac OS X 10.7 (Lion): Installing_Cantera#Lion Mac OS X 10.8 (Mountain Lion): Installing_Cantera#Mountain_Lion Ubuntu 12.04 (Precise Pangolin): Installing_Cantera#Ubuntu Windows XP: Installing_Cantera#Windows_XP Windows 7: Installing_Cantera#Windows_7
Cantera Preconfig: In old versions of Cantera, a preconfig file was used to specify library locations and options. Mac OS X 10.5 (Leopard) preconfig: Cantera_Preconfig/Leopard_Preconfig Mac OS X 10.6 (Snow Leopard) preconfig: Cantera_Preconfig/Snow_Leopard_Preconfig Mac OS X 10.8 (Mountain Lion) preconfig: Cantera_Config/MountainLion_SconsConfig Ubuntu 12.04 (Precise Pangolin) preconfig: Cantera_Config/Ubuntu1204_SconsConfig Flags · Template:InstallingCanteraFlag · e |