Cantera

Table Of Contents

Previous topic

Reactions

Next topic

Example: Hydrogen Combustion

This Page

Warning

This documentation is for an old version of Cantera. You can find docs for newer versions here.

CTI Class Reference

Basic Classes & Functions

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'
class 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 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 and stoichiometric_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 ctml_writer.ideal_gas(name='', elements='', species='', note='', reactions='none', kinetics='GasKinetics', transport='None', initial_state=None, options=[])

Bases: 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'.
class ctml_writer.stoichiometric_solid(name='', elements='', species='', note='', density=None, transport='None', initial_state=None, options=[])

Bases: 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 ctml_writer.stoichiometric_liquid(name='', elements='', species='', note='', density=-1.0, transport='None', initial_state=None, options=[])

Bases: 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 ctml_writer.metal(name='', elements='', species='', note='', density=-1.0, transport='None', initial_state=None, options=[])

Bases: ctml_writer.phase

A metal.

class ctml_writer.semiconductor(name='', elements='', species='', note='', density=-1.0, bandgap=96485336.4595687, effectiveMass_e=9.10938291e-31, effectiveMass_h=9.10938291e-31, transport='None', initial_state=None, options=[])

Bases: ctml_writer.phase

A semiconductor.

class ctml_writer.incompressible_solid(name='', elements='', species='', note='', density=None, transport='None', initial_state=None, options=[])

Bases: ctml_writer.phase

An incompressible solid.

class ctml_writer.lattice(name='', elements='', species='', note='', reactions='none', transport='None', initial_state=None, options=, []site_density=None, vacancy_species='')

Bases: ctml_writer.phase

class ctml_writer.lattice_solid(name='', elements='', species='', note='', lattices=, []transport='None', initial_state=None, options=[])

Bases: ctml_writer.phase

A solid crystal consisting of one or more sublattices.

class ctml_writer.liquid_vapor(name='', elements='', species='', note='', substance_flag=0, initial_state=None, options=[])

Bases: 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 purefluids.py for the usage of this entry type.

class ctml_writer.redlich_kwong(name='', elements='', species='', note='', substance_flag=7, initial_state=None, Tcrit=1.0, Pcrit=1.0, options=[])

Bases: 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 purefluids.py for the usage of this entry type.

class ctml_writer.ideal_interface(name='', elements='', species='', note='', reactions='none', site_density=0.0, phases=, []kinetics='Interface', transport='None', initial_state=None, options=[])

Bases: 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.
class ctml_writer.edge(name='', elements='', species='', note='', reactions='none', site_density=0.0, phases=, []kinetics='Edge', transport='None', initial_state=None, options=[])

Bases: ctml_writer.phase

A 1D boundary between two surface phases.

Elements and Species

class 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 ctml_writer.species(name='missing name!', atoms='', note='', thermo=None, transport=None, charge=-999, size=1.0)

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.

Thermodynamic Properties

class ctml_writer.Mu0_table(Trange=(0.0, 0.0), h298=0.0, mu0=None, p0=-1.0)

Bases: ctml_writer.thermo

Properties are computed by specifying a table of standard chemical potentials vs. T.

class ctml_writer.NASA(Trange=(0.0, 0.0), coeffs=, []p0=-1.0)

Bases: 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 – Array 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 ctml_writer.NASA9(Trange=(0.0, 0.0), coeffs=, []p0=-1.0)

Bases: ctml_writer.thermo

NASA9 polynomial parameterization for a single temperature region.

class ctml_writer.Shomate(Trange=(0.0, 0.0), coeffs=, []p0=-1.0)

Bases: 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 ctml_writer.Adsorbate(Trange=(0.0, 0.0), binding_energy=0.0, frequencies=, []p0=-1.0)

Bases: ctml_writer.thermo

Adsorbed species characterized by a binding energy and a set of vibrational frequencies.

class ctml_writer.const_cp(t0=298.15, cp0=0.0, h0=0.0, s0=0.0, tmax=5000.0, tmin=100.0)

Bases: 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 ctml_writer.gas_transport(geom='nonlin', diam=0.0, well_depth=0.0, dipole=0.0, polar=0.0, rot_relax=0.0)

Bases: ctml_writer.transport

Species-specific Transport coefficients for ideal gas transport models.

Parameters:
  • geom – A string specifying the molecular geometry. One of atom, linear, or nonlin. 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

Reactions

class 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.
  • rate_coeff – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, n,E] in the modified Arrhenius function \(A T^n 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.
  • options – Processing options, as described in Special Processing Options.
unit_factor()

Conversion factor from given rate constant units to the MKS (+kmol) used internally by Cantera, taking into account the reaction order.

class ctml_writer.Arrhenius(A=0.0, n=0.0, E=0.0, coverage=, []rate_type='')

Bases: 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.
  • n – The temperature exponent. Dimensionless. Default: 0.0.
  • E – Activation energy. Default: 0.0.
class ctml_writer.three_body_reaction(equation='', kf=None, efficiencies='', id='', options=[])

Bases: 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.
  • rate_coeff – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A,n,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 Special Processing Options.
class ctml_writer.falloff_reaction(equation, kf0, kf, efficiencies='', falloff=None, id='', options=[])

Bases: ctml_writer.pdep_reaction

A gas-phase falloff reaction.

Parameters:
  • equation – A string specifying the chemical equation.
  • rate_coeff_inf – 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, n,E] in the modified Arrhenius function.
  • rate_coeff_0 – 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, n,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 Special Processing Options.
class ctml_writer.chemically_activated_reaction(equation, kLow, kHigh, efficiencies='', falloff=None, id='', options=[])

Bases: 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, n,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, n,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 Special Processing Options.
class ctml_writer.pdep_arrhenius(equation='', *args, **kwargs)

Bases: 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.
class ctml_writer.chebyshev_reaction(equation='', Tmin=300.0, Tmax=2500.0, Pmin=(0.001, 'atm'), Pmax=(100.0, 'atm'), coeffs=, [[]]**kwargs)

Bases: 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.
class ctml_writer.surface_reaction(equation='', kf=None, id='', order='', options=[])

Bases: ctml_writer.reaction

A heterogeneous chemical reaction with pressure-independent rate coefficient and mass-action kinetics.

Parameters:
  • equation – A string specifying the chemical equation.
  • rate_coeff – The rate coefficient for the forward direction. If a sequence of three numbers is given, these will be interpreted as [A, n,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, n,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 Special Processing Options.
class ctml_writer.edge_reaction(equation='', kf=None, id='', order='', beta=0.0, options=[])

Bases: ctml_writer.reaction

Falloff Parameterizations

class 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.

class ctml_writer.SRI(A=0.0, B=0.0, C=0.0, D=-999.9, E=-999.9)

Bases: object

The SRI falloff function.

Parameters: A, B, C, D, E. These must be entered as pure numbers without attached dimensions.

class ctml_writer.Lindemann

Bases: object

The Lindemann falloff function.

This falloff function takes no parameters.