diff --git a/rmgpy/rmg/model.py b/rmgpy/rmg/model.py index b4134f60a0..045a6d7bf0 100644 --- a/rmgpy/rmg/model.py +++ b/rmgpy/rmg/model.py @@ -864,9 +864,9 @@ def process_new_reactions(self, new_reactions, new_species, pdep_network=None, g # Since PDepReactions are created as irreversible, not doing so # would cause you to miss the reverse reactions! self.add_reaction_to_unimolecular_networks(rxn, new_species=new_species, network=pdep_network) - if isinstance(rxn, LibraryReaction): - # If reaction came from a reaction library, omit it from the core and edge so that it does - # not get double-counted with the pdep network + if isinstance(rxn, LibraryReaction) and not rxn.kinetics.is_pressure_dependent(): + # If the reaction came from a library, and it does not have PDep kinetics, + # omit it from the core and edge so that it does not get double-counted with the pdep network if rxn in self.core.reactions: self.core.reactions.remove(rxn) if rxn in self.edge.reactions: diff --git a/rmgpy/rmg/pdep.py b/rmgpy/rmg/pdep.py index 79d1157868..dd180a569c 100644 --- a/rmgpy/rmg/pdep.py +++ b/rmgpy/rmg/pdep.py @@ -898,7 +898,7 @@ def update(self, reaction_model, pdep_settings): reactants=configurations[j], products=configurations[i], network=self, - kinetics=None + kinetics=None, ) net_reaction = reaction_model.make_new_pdep_reaction(net_reaction) self.net_reactions.append(net_reaction) @@ -911,10 +911,10 @@ def update(self, reaction_model, pdep_settings): for rxn in reaction_model.core.reactions: if isinstance(rxn, LibraryReaction) \ and rxn.is_isomorphic(net_reaction, either_direction=True) \ - and not rxn.allow_pdep_route and not rxn.elementary_high_p: - logging.info('Network reaction {0} matched an existing core reaction {1}' - ' from the {2} library, and was not added to the model'.format( - str(net_reaction), str(rxn), rxn.library)) + and not rxn.allow_pdep_route \ + and (rxn.kinetics.is_pressure_dependent() or not rxn.elementary_high_p): + logging.info(f'Network reaction {net_reaction} matched an existing core reaction {rxn} ' + f'from the {rxn.library} library, and was not added to the model') break else: reaction_model.add_reaction_to_core(net_reaction) @@ -923,10 +923,10 @@ def update(self, reaction_model, pdep_settings): for rxn in reaction_model.edge.reactions: if isinstance(rxn, LibraryReaction) \ and rxn.is_isomorphic(net_reaction, either_direction=True) \ - and not rxn.allow_pdep_route and not rxn.elementary_high_p: - logging.info('Network reaction {0} matched an existing edge reaction {1}' - ' from the {2} library, and was not added to the model'.format( - str(net_reaction), str(rxn), rxn.library)) + and not rxn.allow_pdep_route \ + and (rxn.kinetics.is_pressure_dependent() or not rxn.elementary_high_p): + logging.info(f'Network reaction {net_reaction} matched an existing edge reaction {rxn} ' + f'from the {rxn.library} library, and was not added to the model') break else: reaction_model.add_reaction_to_edge(net_reaction)