soln2ck

writes a solution object to a chemkin inp file

currently only works for Elementary, Falloff and ThreeBody Reactions Cantera development version 2.3.0a2 required

pymars.soln2ck.build_arrhenius(rate, reaction_order, reaction_type)

Builds Arrhenius coefficient string based on reaction type.

Parameters
  • rate (cantera.Arrhenius) – Arrhenius-form reaction rate coefficient

  • reaction_order (int or float) – Order of reaction (sum of reactant stoichiometric coefficients)

  • reaction_type ({cantera.ElementaryReaction, cantera.ThreeBodyReaction, cantera.PlogReaction}) – Type of reaction

Returns

String with Arrhenius coefficients

Return type

str

pymars.soln2ck.build_falloff(parameters, falloff_function)

Creates falloff reaction Troe parameter string

Parameters
  • parameters (numpy.ndarray) – Array of falloff parameters; length varies based on falloff_function

  • falloff_function ({'Troe', 'SRI'}) – Type of falloff function

Returns

falloff_string – String of falloff parameters

Return type

str

pymars.soln2ck.build_falloff_arrhenius(rate, reaction_order, reaction_type, pressure_limit)

Builds Arrhenius coefficient strings for falloff and chemically-activated reactions.

Parameters
  • rate (cantera.Arrhenius) – Arrhenius-form reaction rate coefficient

  • reaction_order (int or float) – Order of reaction (sum of reactant stoichiometric coefficients)

  • reaction_type ({ct.FalloffReaction, ct.ChemicallyActivatedReaction}) – Type of reaction

  • pressure_limit ({'high', 'low'}) – string designating pressure limit

Returns

Arrhenius coefficient string

Return type

str

pymars.soln2ck.write(solution, output_filename='', path='', skip_thermo=False, skip_transport=False)

Writes Cantera solution object to Chemkin-format file.

Parameters
  • solution (cantera.Solution) – Model to be written

  • output_filename (str, optional) – Name of file to be written; if not provided, use solution.name

  • path (str, optional) – Path for writing file.

  • skip_thermo (bool, optional) – Flag to skip writing thermo data in separate file

  • skip_transport (bool, optional) – Flag to skip writing transport data in separate file

Returns

output_file_name – Name of output model file (.inp)

Return type

str

Examples

>>> gas = cantera.Solution('gri30.cti')
>>> soln2ck.write(gas)
reduced_gri30.inp
pymars.soln2ck.write_thermo_data(species_list, filename='generated_thermo.dat')

Writes thermodynamic data to Chemkin-format file.

Parameters
  • species_list (list of cantera.Species) – List of species objects

  • filename (str, optional) – Filename for new Chemkin thermodynamic database file

pymars.soln2ck.write_transport_data(species_list, filename='generated_transport.dat')

Writes transport data to Chemkin-format file.

Parameters
  • species_list (list of cantera.Species) – List of species objects

  • filename (str, optional) – Filename for new Chemkin transport database file