Reading Chemkin files

Main functions

rmgpy.chemkin.loadChemkinFile(path, dictionaryPath=None, transportPath=None, readComments=True, thermoPath=None, useChemkinNames=False)

Load a Chemkin input file located at path on disk to path, returning lists of the species and reactions in the Chemkin file. The ‘thermoPath’ point to a separate thermo file, or, if ‘None’ is specified, the function will look for the thermo database within the chemkin mechanism file

rmgpy.chemkin.loadSpeciesDictionary(path)

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. Resonance isomers for each species are automatically generated.

rmgpy.chemkin.loadTransportFile(path, speciesDict)

Load a Chemkin transport properties file located at path and store the properties on the species in speciesDict.

Helper functions

rmgpy.chemkin.readKineticsEntry(entry, speciesDict, Aunits, Eunits)

Read a kinetics entry for a single reaction as loaded from a Chemkin file. The associated mapping of labels to species speciesDict should also be provided. Returns a Reaction object with the reaction and its associated kinetics.

rmgpy.chemkin.readReactionComments(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.readReactionsBlock(f, speciesDict, readComments=True)

Read a reactions block from a Chemkin file stream.

This function can also read the reactions.txt and pdepreactions.txt files from RMG-Java kinetics libraries, which have a similar syntax.

rmgpy.chemkin.readThermoEntry(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 NASA object.

Format specification at http://www2.galcit.caltech.edu/EDL/public/formats/chemkin.html

rmgpy.chemkin.removeCommentFromLine(line)

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.