CTI Class Reference¶
Basic Classes & Functions¶
- cantera.ctml_writer.units(length='', quantity='', mass='', time='', act_energy='', energy='', pressure='')¶
Set the default units.
- Parameters
length – The default units for length. Default:
'm'
mass – The default units for mass. Default:
'kg'
quantity – The default units to specify number of molecules. Default:
'kmol'
time – The default units for time. Default:
's'
energy – The default units for energies. Default:
'J'
act_energy – The default units for activation energies. Default:
'K'
pressure – The default units for pressure. Default:
'Pa'
- cantera.ctml_writer.validate(species='yes', reactions='yes')¶
Enable or disable validation of species and reactions.
- Parameters
species – Set to
'yes'
(default) or'no'
.reactions – Set to
'yes'
(default) or'no'
. This controls duplicate reaction checks and validation of rate expressions for some reaction types.
- class cantera.ctml_writer.state(temperature=None, pressure=None, mole_fractions=None, mass_fractions=None, density=None, coverages=None, solute_molalities=None)¶
Bases:
object
An embedded entry that specifies the thermodynamic state of a phase or interface.
- Parameters
temperature – The temperature.
pressure – The pressure.
density – The density. Cannot be specified if the phase is incompressible.
mole_fractions – A string specifying the species mole fractions. Unspecified species are set to zero.
mass_fractions – A string specifying the species mass fractions. Unspecified species are set to zero.
coverages – A string specifying the species coverages. Unspecified species are set to zero. Can only be specified for interfaces.
Phases of Matter¶
- class cantera.ctml_writer.phase(name='', dim=3, elements='', species='', note='', reactions='none', initial_state=None, options=[])¶
Bases:
object
Base class for phases of matter.
- Parameters
name – A string to identify the phase. Must be unique among the phase names within the file.
elements – The elements. A string of element symbols.
species – The species. A string or sequence of strings in the format described in Defining the Species.
note – A user-defined comment. Not evaluated by Cantera itself.
reactions – The homogeneous reactions. If omitted, no reactions will be included. A string or sequence of strings in the format described in Declaring the Reactions. This field is not allowed for
stoichiometric_solid
andstoichiometric_liquid
entries.kinetics – The kinetics model. Optional; if omitted, the default model for the phase type will be used.
transport – The transport property model. Optional. If omitted, transport property calculation will be disabled.
initial_state – Initial thermodynamic state, specified with an embedded state entry.
options – Special processing options. Optional.
- class cantera.ctml_writer.ideal_gas(name='', elements='', species='', note='', reactions='none', kinetics='GasKinetics', transport='None', initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.phase
An ideal gas mixture.
The parameters correspond to those of
phase
, with the following modifications:- Parameters
kinetics – The kinetics model. Usually this field is omitted, in which case kinetics model GasKinetics, appropriate for reactions in ideal gas mixtures, is used.
transport – The transport property model. One of the strings
'none'
,'multi'
, or'mix'
. Default:'none'
.
- is_ideal_gas()¶
True if the entry represents an ideal gas.
- class cantera.ctml_writer.stoichiometric_solid(name='', elements='', species='', note='', density=None, transport='None', initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.phase
A solid compound or pure element. Stoichiometric solid phases contain exactly one species, which always has unit activity. The solid is assumed to have constant density. Therefore the rates of reactions involving these phases do not contain any concentration terms for the (one) species in the phase, since the concentration is always the same.
See
phase
for descriptions of the parameters.
- class cantera.ctml_writer.stoichiometric_liquid(name='', elements='', species='', note='', density=- 1.0, transport='None', initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.stoichiometric_solid
An incompressible stoichiometric liquid. Currently, there is no distinction between stoichiometric liquids and solids.
See
phase
for descriptions of the parameters.
- class cantera.ctml_writer.metal(name='', elements='', species='', note='', density=- 1.0, transport='None', initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.phase
A metal.
- Parameters
name – A string to identify the phase. Must be unique among the phase names within the file.
elements – The elements. A string of element symbols.
species – The species. A string or sequence of strings in the format described in Defining the Species.
note – A user-defined comment. Not evaluated by Cantera itself.
reactions – The homogeneous reactions. If omitted, no reactions will be included. A string or sequence of strings in the format described in Declaring the Reactions. This field is not allowed for
stoichiometric_solid
andstoichiometric_liquid
entries.kinetics – The kinetics model. Optional; if omitted, the default model for the phase type will be used.
transport – The transport property model. Optional. If omitted, transport property calculation will be disabled.
initial_state – Initial thermodynamic state, specified with an embedded state entry.
options – Special processing options. Optional.
- conc_dim()¶
Concentration dimensions. Used in computing the units for reaction rate coefficients.
- class cantera.ctml_writer.lattice(name='', elements='', species='', note='', reactions='none', transport='None', initial_state=None, options=[], site_density=None)¶
Bases:
cantera.ctml_writer.phase
- Parameters
name – A string to identify the phase. Must be unique among the phase names within the file.
elements – The elements. A string of element symbols.
species – The species. A string or sequence of strings in the format described in Defining the Species.
note – A user-defined comment. Not evaluated by Cantera itself.
reactions – The homogeneous reactions. If omitted, no reactions will be included. A string or sequence of strings in the format described in Declaring the Reactions. This field is not allowed for
stoichiometric_solid
andstoichiometric_liquid
entries.kinetics – The kinetics model. Optional; if omitted, the default model for the phase type will be used.
transport – The transport property model. Optional. If omitted, transport property calculation will be disabled.
initial_state – Initial thermodynamic state, specified with an embedded state entry.
options – Special processing options. Optional.
- class cantera.ctml_writer.lattice_solid(name='', elements='', species='', note='', lattices=[], transport='None', initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.phase
A solid crystal consisting of one or more sublattices.
- Parameters
name – A string to identify the phase. Must be unique among the phase names within the file.
elements – The elements. A string of element symbols.
species – The species. A string or sequence of strings in the format described in Defining the Species.
note – A user-defined comment. Not evaluated by Cantera itself.
reactions – The homogeneous reactions. If omitted, no reactions will be included. A string or sequence of strings in the format described in Declaring the Reactions. This field is not allowed for
stoichiometric_solid
andstoichiometric_liquid
entries.kinetics – The kinetics model. Optional; if omitted, the default model for the phase type will be used.
transport – The transport property model. Optional. If omitted, transport property calculation will be disabled.
initial_state – Initial thermodynamic state, specified with an embedded state entry.
options – Special processing options. Optional.
- conc_dim()¶
Concentration dimensions. Used in computing the units for reaction rate coefficients.
- class cantera.ctml_writer.liquid_vapor(name='', elements='', species='', note='', substance_flag=0, initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.phase
A fluid with a complete liquid/vapor equation of state. This entry type selects one of a set of predefined fluids with built-in liquid/vapor equations of state. The substance_flag parameter selects the fluid. See liquidvapor.cti and liquidvapor.py for the usage of this entry type.
- Parameters
name – A string to identify the phase. Must be unique among the phase names within the file.
elements – The elements. A string of element symbols.
species – The species. A string or sequence of strings in the format described in Defining the Species.
note – A user-defined comment. Not evaluated by Cantera itself.
reactions – The homogeneous reactions. If omitted, no reactions will be included. A string or sequence of strings in the format described in Declaring the Reactions. This field is not allowed for
stoichiometric_solid
andstoichiometric_liquid
entries.kinetics – The kinetics model. Optional; if omitted, the default model for the phase type will be used.
transport – The transport property model. Optional. If omitted, transport property calculation will be disabled.
initial_state – Initial thermodynamic state, specified with an embedded state entry.
options – Special processing options. Optional.
- conc_dim()¶
Concentration dimensions. Used in computing the units for reaction rate coefficients.
- class cantera.ctml_writer.ideal_interface(name='', elements='', species='', note='', reactions='none', site_density=0.0, phases=[], kinetics='Interface', transport='None', initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.phase
A chemically-reacting ideal surface solution of multiple species.
The parameters correspond to those of
phase
, with the following modifications:- Parameters
reactions – The heterogeneous reactions at this interface. If omitted, no reactions will be included. A string or sequence of strings in the format described in Declaring the Reactions.
site_density – The number of adsorption sites per unit area.
phases – A string listing the bulk phases that participate in reactions at this interface.
- conc_dim()¶
Concentration dimensions. Used in computing the units for reaction rate coefficients.
- class cantera.ctml_writer.edge(name='', elements='', species='', note='', reactions='none', site_density=0.0, phases=[], kinetics='Edge', transport='None', initial_state=None, options=[])¶
Bases:
cantera.ctml_writer.phase
A 1D boundary between two surface phases.
- Parameters
name – A string to identify the phase. Must be unique among the phase names within the file.
elements – The elements. A string of element symbols.
species – The species. A string or sequence of strings in the format described in Defining the Species.
note – A user-defined comment. Not evaluated by Cantera itself.
reactions – The homogeneous reactions. If omitted, no reactions will be included. A string or sequence of strings in the format described in Declaring the Reactions. This field is not allowed for
stoichiometric_solid
andstoichiometric_liquid
entries.kinetics – The kinetics model. Optional; if omitted, the default model for the phase type will be used.
transport – The transport property model. Optional. If omitted, transport property calculation will be disabled.
initial_state – Initial thermodynamic state, specified with an embedded state entry.
options – Special processing options. Optional.
- conc_dim()¶
Concentration dimensions. Used in computing the units for reaction rate coefficients.
Elements and Species¶
- class cantera.ctml_writer.element(symbol='', atomic_mass=0.01, atomic_number=0)¶
Bases:
object
An atomic element or isotope.
- Parameters
symbol – The symbol for the element or isotope.
atomic_mass – The atomic mass in amu.
- class cantera.ctml_writer.species(name='missing name!', atoms='', note='', thermo=None, transport=None, charge=- 999, size=1.0, standardState=None)¶
Bases:
object
A constituent of a phase or interface.
- Parameters
name – The species name (or formula). The name may be arbitrarily long, although usually a relatively short, abbreviated name is most convenient. Required parameter.
atoms – The atomic composition, specified by a string containing space-delimited
<element>:<atoms>
pairs. The number of atoms may be either an integer or a floating-point number.note – A user-defined comment. Not evaluated by Cantera itself.
thermo – The parameterization to use to compute the reference-state thermodynamic properties. This must be one of the entry types described in Thermodynamic Property Models. To specify multiple parameterizations, each for a different temperature range, group them in parentheses.
transport – An entry specifying parameters to compute this species’ contribution to the transport properties. This must be one of the entry types described in Species Transport Coefficients, and must be consistent with the transport model of the phase into which the species is imported. To specify parameters for multiple transport models, group the entries in parentheses.
size – The species “size”. Currently used only for surface species, where it represents the number of sites occupied.
charge – The charge, in multiples of \(|e|\). If not specified, the charge will be calculated from the number of “atoms” of element
E
, which represents an electron.standardState – The species standard state model. Currently used only for IdealSolidSolution and derived classes where it is used to calculate the phase density.
Thermodynamic Properties¶
- class cantera.ctml_writer.Mu0_table(Trange=(0.0, 0.0), h298=0.0, mu0=None, p0=- 1.0)¶
Bases:
cantera.ctml_writer.thermo
Properties are computed by specifying a table of standard chemical potentials vs. T.
- class cantera.ctml_writer.NASA(Trange=(0.0, 0.0), coeffs=[], p0=- 1.0)¶
Bases:
cantera.ctml_writer.thermo
The 7-coefficient NASA polynomial parameterization.
- Parameters
Trange – The temperature range over which the parameterization is valid. This must be entered as a sequence of two temperature values. Required.
coeffs – List of seven coefficients \((a_0, \ldots , a_6)\)
p0 – The reference-state pressure, usually 1 atm or 1 bar. If omitted, the default value is used, which is set by the
standard_pressure
directive.
- class cantera.ctml_writer.NASA9(Trange=(0.0, 0.0), coeffs=[], p0=- 1.0)¶
Bases:
cantera.ctml_writer.thermo
NASA9 polynomial parameterization for a single temperature region.
- Parameters
Trange – The temperature range over which the parameterization is valid. This must be entered as a sequence of two temperature values. Required.
coeffs – List of nine coefficients \((a_0, \ldots , a_8)\)
p0 – The reference-state pressure, usually 1 atm or 1 bar. If omitted, the default value is used, which is set by the
standard_pressure
directive.
- class cantera.ctml_writer.Shomate(Trange=(0.0, 0.0), coeffs=[], p0=- 1.0)¶
Bases:
cantera.ctml_writer.thermo
Shomate polynomial parameterization.
- Parameters
Trange – The temperature range over which the parameterization is valid. This must be entered as a sequence of two temperature values. Required input.
coeffs – Sequence of seven coefficients \((A, \ldots ,G)\)
p0 – The reference-state pressure, usually 1 atm or 1 bar. If omitted, the default value set by the
standard_pressure
directive is used.
- class cantera.ctml_writer.const_cp(t0=298.15, cp0=0.0, h0=0.0, s0=0.0, tmax=5000.0, tmin=100.0)¶
Bases:
cantera.ctml_writer.thermo
Constant specific heat.
- Parameters
t0 – Temperature parameter T0. Default: 298.15 K.
cp0 – Reference-state molar heat capacity (constant). Default: 0.0.
h0 – Reference-state molar enthalpy at temperature T0. Default: 0.0.
s0 – Reference-state molar entropy at temperature T0. Default: 0.0.
Transport Properties¶
- class cantera.ctml_writer.gas_transport(geom, diam=0.0, well_depth=0.0, dipole=0.0, polar=0.0, rot_relax=0.0, acentric_factor=None, disp_coeff=0.0, quad_polar=0.0)¶
Bases:
cantera.ctml_writer.transport
Species-specific Transport coefficients for gas-phase transport models.
- Parameters
geom – A string specifying the molecular geometry. One of
atom
,linear
, ornonlinear
. Required.diam – The Lennard-Jones collision diameter in Angstroms. Required.
well_depth – The Lennard-Jones well depth in Kelvin. Required.
dipole – The permanent dipole moment in Debye. Default: 0.0
polar – The polarizability in A^3. Default: 0.0
rot_relax – The rotational relaxation collision number at 298 K. Dimensionless. Default: 0.0
w_ac – Pitzer’s acentric factor. Dimensionless. Default: 0.0
disp_coeff – The dispersion coefficient in A^5 Default: 0.0
quad_polar – The quadrupole polarizability Default: 0.0
Reactions¶
- class cantera.ctml_writer.reaction(equation='', kf=None, id='', order='', options=[])¶
Bases:
object
A homogeneous chemical reaction with pressure-independent rate coefficient and mass-action kinetics.
- Parameters
equation – A string specifying the chemical equation.
kf – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function \(A T^b exp(-E/\hat{R}T)\).
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
order – Override the default reaction orders implied by the reactant stoichiometric coefficients. Given as a string of key:value pairs, e.g.,
"CH4:0.25 O2:1.5"
.options – Processing options, as described in Options. May be one or more (as a list) of the following:
'skip'
,'duplicate'
,'negative_A'
,`` ‘negative_orders’, ``'nonreactant_orders'
.
- unit_factor()¶
Conversion factor from given rate constant units to the MKS (+kmol) used internally by Cantera, taking into account the reaction order.
- class cantera.ctml_writer.Arrhenius(A=0.0, b=0.0, E=0.0, coverage=[])¶
Bases:
cantera.ctml_writer.rate_expression
- Parameters
A – The pre-exponential coefficient. Required input. If entered without units, the units will be computed considering all factors that affect the units. The resulting units string is written to the CTML file individually for each reaction pre-exponential coefficient.
b – The temperature exponent. Dimensionless. Default: 0.0.
E – Activation energy. Default: 0.0.
coverage – For a single coverage dependency, a list with four elements: the species name followed by the three coverage parameters. For multiple coverage dependencies, a list of lists containing the individual sets of coverage parameters. Only used for surface and edge reactions.
- class cantera.ctml_writer.three_body_reaction(equation='', kf=None, efficiencies='', id='', options=[])¶
Bases:
cantera.ctml_writer.reaction
A three-body reaction.
- Parameters
equation – A string specifying the chemical equation. The reaction can be written in either the association or dissociation directions, and may be reversible or irreversible.
kf – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function.
efficiencies – A string specifying the third-body collision efficiencies. The efficiencies for unspecified species are set to 1.0.
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
options – Processing options, as described in Options.
- class cantera.ctml_writer.falloff_reaction(equation, kf0, kf, efficiencies='', falloff=None, id='', options=[])¶
Bases:
cantera.ctml_writer.pdep_reaction
A gas-phase falloff reaction.
- Parameters
equation – A string specifying the chemical equation.
kf – The rate coefficient for the forward direction in the high-pressure limit. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function.
kf0 – The rate coefficient for the forward direction in the low-pressure limit. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function.
efficiencies – A string specifying the third-body collision efficiencies. The efficiency for unspecified species is set to 1.0.
falloff – An embedded entry specifying a falloff function. If omitted, a unity falloff function (Lindemann form) will be used.
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
options – Processing options, as described in Options.
- class cantera.ctml_writer.chemically_activated_reaction(equation, kLow, kHigh, efficiencies='', falloff=None, id='', options=[])¶
Bases:
cantera.ctml_writer.pdep_reaction
A gas-phase, chemically activated reaction.
- Parameters
equation – A string specifying the chemical equation.
kLow – The rate coefficient for the forward direction in the low-pressure limit. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function.
kHigh – The rate coefficient for the forward direction in the high-pressure limit. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function.
efficiencies – A string specifying the third-body collision efficiencies. The efficiency for unspecified species is set to 1.0.
falloff – An embedded entry specifying a falloff function. If omitted, a unity falloff function (Lindemann form) will be used.
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
options – Processing options, as described in Options.
- class cantera.ctml_writer.pdep_arrhenius(equation='', *args, **kwargs)¶
Bases:
cantera.ctml_writer.reaction
Pressure-dependent rate calculated by interpolating between Arrhenius expressions at different pressures.
- Parameters
equation – A string specifying the chemical equation.
args – Each additional argument is a sequence of four elements specifying the pressure and the Arrhenius parameters at that pressure.
equation – A string specifying the chemical equation.
kf – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function \(A T^b exp(-E/\hat{R}T)\).
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
order – Override the default reaction orders implied by the reactant stoichiometric coefficients. Given as a string of key:value pairs, e.g.,
"CH4:0.25 O2:1.5"
.options – Processing options, as described in Options. May be one or more (as a list) of the following:
'skip'
,'duplicate'
,'negative_A'
,`` ‘negative_orders’, ``'nonreactant_orders'
.
- class cantera.ctml_writer.chebyshev_reaction(equation='', Tmin=300.0, Tmax=2500.0, Pmin=(0.001, 'atm'), Pmax=(100.0, 'atm'), coeffs=[[]], **kwargs)¶
Bases:
cantera.ctml_writer.reaction
Pressure-dependent rate calculated in terms of a bivariate Chebyshev polynomial.
- Parameters
equation – A string specifying the chemical equation.
Tmin – The minimum temperature at which the rate expression is defined
Tmax – the maximum temperature at which the rate expression is defined
Pmin – The minimum pressure at which the rate expression is defined
Pmax – The maximum pressure at which the rate expression is defined
coeffs – A 2D array of the coefficients defining the rate expression. For a polynomial with M points in temperature and N points in pressure, this should be a list of M lists each with N elements.
equation – A string specifying the chemical equation.
kf – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function \(A T^b exp(-E/\hat{R}T)\).
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
order – Override the default reaction orders implied by the reactant stoichiometric coefficients. Given as a string of key:value pairs, e.g.,
"CH4:0.25 O2:1.5"
.options – Processing options, as described in Options. May be one or more (as a list) of the following:
'skip'
,'duplicate'
,'negative_A'
,`` ‘negative_orders’, ``'nonreactant_orders'
.
- class cantera.ctml_writer.surface_reaction(equation='', kf=None, id='', order='', beta=None, options=[], rate_coeff_type='')¶
Bases:
cantera.ctml_writer.reaction
A heterogeneous chemical reaction with pressure-independent rate coefficient and mass-action kinetics.
- Parameters
equation – A string specifying the chemical equation.
kf – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function.
sticking_prob – The reactive sticking probability for the forward direction. This can only be specified if there is only one bulk-phase reactant and it belongs to an ideal gas phase. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function.
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
options – Processing options, as described in Options.
beta – Charge transfer coefficient: A number between 0 and 1 which, for a charge transfer reaction, determines how much of the electric potential difference between two phases is applied to the activation energy of the fwd reaction. The remainder is applied to the reverse reaction.
rate_coeff_type – Form of the rate coefficient given. If none given, assumed that the rate coefficient is the standard kf.
- class cantera.ctml_writer.edge_reaction(equation='', kf=None, id='', order='', beta=None, options=[], rate_coeff_type='')¶
Bases:
cantera.ctml_writer.reaction
- Parameters
equation – A string specifying the chemical equation.
kf – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, b, E] in the modified Arrhenius function \(A T^b exp(-E/\hat{R}T)\).
id – An optional identification string. If omitted, it defaults to a four-digit numeric string beginning with 0001 for the first reaction in the file.
order – Override the default reaction orders implied by the reactant stoichiometric coefficients. Given as a string of key:value pairs, e.g.,
"CH4:0.25 O2:1.5"
.options – Processing options, as described in Options. May be one or more (as a list) of the following:
'skip'
,'duplicate'
,'negative_A'
,`` ‘negative_orders’, ``'nonreactant_orders'
.
- class cantera.ctml_writer.stick(*args, **kwargs)¶
Bases:
cantera.ctml_writer.Arrhenius
A rate expression for a surface reaction given as a sticking probability, parameterized using a modified Arrhenius expression.
- Parameters
motz_wise – ‘True’ if the Motz & Wise correction should be used, ‘False’ if not. If unspecified, use the mechanism default (set using the functions
enable_motz_wise
ordisable_motz_wise
).
Falloff Parameterizations¶
- class cantera.ctml_writer.Troe(A=0.0, T3=0.0, T1=0.0, T2=- 999.9)¶
Bases:
object
The Troe falloff function.
Parameters: A, T3, T1, T2. These must be entered as pure numbers with no attached dimensions.