Skip to content

Commit e42820c

Browse files
hwpangsevyharris
authored andcommitted
Move library to edge before adding initial species to core to make sure library reactions get move to core if all reactants and products are in initial species
1 parent 61ec5bb commit e42820c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rmgpy/rmg/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,11 @@ def initialize(self, **kwargs):
644644
spec.get_henry_law_constant_data()
645645
self.reaction_model.add_species_to_edge(spec)
646646

647+
# Reaction libraries: add species and reactions from reaction library to the edge so
648+
# that RMG can find them if their rates are large enough
649+
for library, option in self.reaction_libraries:
650+
self.reaction_model.add_reaction_library_to_edge(library)
651+
647652
# Also always add in a few bath gases (since RMG-Java does)
648653
for label, smiles in [('Ar', '[Ar]'), ('He', '[He]'), ('Ne', '[Ne]'), ('N2', 'N#N')]:
649654
molecule = Molecule().from_smiles(smiles)
@@ -665,11 +670,6 @@ def initialize(self, **kwargs):
665670
for seed_mechanism in self.seed_mechanisms:
666671
self.reaction_model.add_seed_mechanism_to_core(seed_mechanism, react=False)
667672

668-
# Reaction libraries: add species and reactions from reaction library to the edge so
669-
# that RMG can find them if their rates are large enough
670-
for library, option in self.reaction_libraries:
671-
self.reaction_model.add_reaction_library_to_edge(library)
672-
673673
# Perform species constraints and forbidden species checks on input species
674674
for spec in self.initial_species:
675675
if self.database.forbidden_structures.is_molecule_forbidden(spec.molecule[0]):

0 commit comments

Comments
 (0)