soln2ck¶
writes a solution object to a chemkin inp file
currently only works for Elementary, Falloff and ThreeBody Reactions
- pymars.soln2ck.build_arrhenius(rate, reaction_order, reaction_type)¶
Builds Arrhenius coefficient string based on reaction type.
- Parameters:
rate (cantera.ArrheniusRate) – Arrhenius-form reaction rate coefficient
reaction_order (int or float) – Order of reaction (sum of reactant stoichiometric coefficients)
reaction_type (str) – Reaction type string (e.g. ‘Arrhenius’, ‘three-body-Arrhenius’, ‘pressure-dependent-Arrhenius’)
- Returns:
String with Arrhenius coefficients
- Return type:
- 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_functionfalloff_function ({'Troe', 'SRI'}) – Type of falloff function
- Returns:
falloff_string – String of falloff parameters
- Return type:
- 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.ArrheniusRate) – Arrhenius-form reaction rate coefficient
reaction_order (int or float) – Order of reaction (sum of reactant stoichiometric coefficients)
reaction_type (str) – Reaction type string (e.g. ‘falloff-Troe’, ‘falloff-Lindemann’, ‘chemically-activated’)
pressure_limit ({'high', 'low'}) – string designating pressure limit
- Returns:
Arrhenius coefficient string
- Return type:
- 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.namepath (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:
Examples
>>> gas = cantera.Solution('gri30.yaml') >>> 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