self.A = A self.n = n self.Ea_old = Ea_old self.Ea_new = Ea_new def setParam(self, A, n, Ea): self.A = A self.n = n self.Ea_old = Ea def setModEa(self, Ea): self.Ea_new = Ea database = Database() species_dict = database.getSpecies( '/home/slakman.b/Code/mech_C8_EF_paper/V3/RMG_Dictionary.txt') reaction_list = [] family_list = ['H_Abstraction', 'intra_H_migration'] with open('/home/slakman.b/Code/mech_C8_EF_paper/V3/chem.inp', 'r') as mech_file: for line in mech_file: if line.strip().startswith('REACTIONS'): break for line in mech_file: if line.strip().startswith('!'): break if 'H_Abstraction' in line or 'intra_H_migration' in line: reaction_list.append(line.strip()) rmg_database = RMGDatabase() rmg_database.load(settings['database.directory'],
""" Given two chemkin files and species dictionaries, will replace rates in the second mechanism with the rate in the first. """ import sys import os from rmgpy import settings from rmgpy.molecule import Molecule from rmgpy.species import Species from rmgpy.reaction import Reaction from rmgpy.data.rmg import RMGDatabase from rmgpy.data.base import Database ######################################################### database = Database() species_dict_V3 = database.getSpecies( '/home/slakman.b/Code/mech/MH_mechs1/prelim_mech_V3/RMG_Dictionary.txt') species_dict_V4 = database.getSpecies( '/home/slakman.b/Code/mech/MH_mechs1/final_mech_V4/RMG_Dictionary.txt') reaction_list_V3 = [] reaction_list_V4 = [] family_list = ['H_Abstraction', 'intra_H_migration'] with open('/home/slakman.b/Code/mech/MH_mechs1/prelim_mech_V3/chem.inp', 'r') as mech_file: for line in mech_file: if line.strip().startswith('REACTIONS'): break for line in mech_file: if line.strip().startswith('!'): break if 'H_Abstraction' in line or 'intra_H_migration' in line: reaction_list_V3.append(line.strip())