Reading Chemkin files¶
- rmgpy.chemkin.load_chemkin_file(path, dictionary_path=None, transport_path=None, read_comments=True, thermo_path=None, use_chemkin_names=False, check_duplicates=True, generate_resonance_structures=True)¶
Load a Chemkin input file located at path on disk to path, returning lists of the species and reactions in the Chemkin file. The ‘thermo_path’ point to a separate thermo file, or, if ‘None’ is specified, the function will look for the thermo database within the chemkin mechanism file. If generate_resonance_structures is True (default if omitted) then resonance isomers for each species are generated.
- rmgpy.chemkin.load_species_dictionary(path, generate_resonance_structures=True)¶
Load an RMG dictionary - containing species identifiers and the associated adjacency lists - from the file located at path on disk. Returns a dict mapping the species identifiers to the loaded species. If generate_resonance_structures is True (default if omitted) then resonance isomers for each species are generated.
- rmgpy.chemkin.load_transport_file(path, species_dict)¶
Load a Chemkin transport properties file located at path and store the properties on the species in species_dict.
- rmgpy.chemkin.read_kinetics_entry(entry, species_dict, Aunits, Eunits)¶
Read a kinetics entry for a single reaction as loaded from a Chemkin file. The associated mapping of labels to species species_dict should also be provided. Returns a
Reactionobject with the reaction and its associated kinetics.
- rmgpy.chemkin.read_reaction_comments(reaction, comments, read=True)¶
Parse the comments associated with a given reaction. If the comments come from RMG (Py or Java), parse them and extract the useful information. Return the reaction object based on the information parsed from these comments. If read if False, the reaction is returned as an “Unclassified” LibraryReaction.
- rmgpy.chemkin.read_reactions_block(f, species_dict, read_comments=True)¶
Read a reactions block from a Chemkin file stream.
This function can also read the
pdepreactions.txtfiles from RMG-Java kinetics libraries, which have a similar syntax.
- rmgpy.chemkin.read_thermo_entry(entry, Tmin=0, Tint=0, Tmax=0)¶
Read a thermodynamics entry for one species in a Chemkin file. Returns the label of the species and the thermodynamics model as a
Format specification at http://www2.galcit.caltech.edu/EDL/public/formats/chemkin.html
Remove a comment from a line of a Chemkin file or species dictionary file.
Returns the line and the comment. If the comment is encoded with latin-1, it is converted to utf-8.