示例#1
0
def runThermoEstimator(inputFile):
    """
    Estimate thermo for a list of species using RMG and the settings chosen inside a thermo input file.
    """
    
    rmg = RMG()
    rmg.loadThermoInput(inputFile)
    
    # initialize and load the database as well as any QM settings
    rmg.loadDatabase()
    if rmg.quantumMechanics:
        rmg.quantumMechanics.initialize()
    
    # Generate the thermo for all the species and write them to chemkin format as well as
    # ThermoLibrary format with values for H, S, and Cp's.
    output = open(os.path.join(rmg.outputDirectory, 'output.txt'),'wb')
    library = ThermoLibrary(name='Thermo Estimation Library')
    for species in rmg.initialSpecies:
        species.generateThermoData(rmg.database, quantumMechanics=rmg.reactionModel.quantumMechanics)

        library.loadEntry(
            index = len(library.entries) + 1,
            label = species.label,
            molecule = species.molecule[0].toAdjacencyList(),
            thermo = species.thermo.toThermoData(),
            shortDesc = species.thermo.comment,
        )
        output.write(writeThermoEntry(species))
        output.write('\n')
    
    output.close()
    library.save(os.path.join(rmg.outputDirectory,'ThermoLibrary.py'))
示例#2
0
def runThermoEstimator(inputFile):
    """
    Estimate thermo for a list of species using RMG and the settings chosen inside a thermo input file.
    """

    rmg = RMG()
    rmg.loadThermoInput(inputFile)

    # initialize and load the database as well as any QM settings
    rmg.loadDatabase()
    if rmg.quantumMechanics:
        rmg.quantumMechanics.initialize()

    # Generate the thermo for all the species and write them to chemkin format as well as
    # ThermoLibrary format with values for H, S, and Cp's.
    output = open(os.path.join(rmg.outputDirectory, 'output.txt'), 'wb')
    library = ThermoLibrary(name='Thermo Estimation Library')
    for species in rmg.initialSpecies:
        species.generateThermoData(
            rmg.database, quantumMechanics=rmg.reactionModel.quantumMechanics)

        library.loadEntry(
            index=len(library.entries) + 1,
            label=species.label,
            molecule=species.molecule[0].toAdjacencyList(),
            thermo=species.thermo.toThermoData(),
            shortDesc=species.thermo.comment,
        )
        output.write(writeThermoEntry(species))
        output.write('\n')

    output.close()
    library.save(os.path.join(rmg.outputDirectory, 'ThermoLibrary.py'))