Skip to content

Commit

Permalink
add allow_max_rate_violation attribute to exempt reactions from the m…
Browse files Browse the repository at this point in the history
…ax rate requirements
  • Loading branch information
mjohnson541 committed Jun 11, 2018
1 parent 09aa3cb commit ab2430a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions rmgpy/reaction.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ cdef class Reaction:
cdef public bint elementary_high_p
cdef public str comment
cdef public dict k_effective_cache
cdef public bint allow_max_rate_violation

cpdef bint isIsomerization(self)

Expand Down
2 changes: 2 additions & 0 deletions rmgpy/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def __init__(self,
pairs=None,
allow_pdep_route=False,
elementary_high_p=False,
allow_max_rate_violation=False,
comment='',
):
self.index = index
Expand All @@ -122,6 +123,7 @@ def __init__(self,
self.elementary_high_p = elementary_high_p
self.comment = comment
self.k_effective_cache = {}
self.allow_max_rate_violation = allow_max_rate_violation

def __repr__(self):
"""
Expand Down
8 changes: 4 additions & 4 deletions testing/databaseTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,14 @@ def kinetics_checkLibraryRatesAreReasonable(self, library):
if k < 0:
boo = True
logging.error('library reaction {0} from library {1}, had a negative rate at 1000 K, 1 bar'.format(rxn,library.label))
if len(rxn.reactants) == 1:
if len(rxn.reactants) == 1 and rxn.allow_max_rate_violation==False:
if k > (kB*T)/h:
boo = True
logging.error('library reaction {0} from library {1}, exceeds the TST limit at 1000 K, 1 bar'.format(rxn,library.label))
elif len(rxn.reactants) == 2:
logging.error('library reaction {0} from library {1}, exceeds the TST limit at 1000 K, 1 bar and did not have allow_max_rate_violation=True'.format(rxn,library.label))
elif len(rxn.reactants) == 2 and rxn.allow_max_rate_violation==False:
if k > Na*np.pi*Hrad_diam**2*np.sqrt(8*kB*T/(np.pi*mHrad/2)):
boo = True
logging.error('library reaction {0} from library {1}, exceeds the collision limit at 1000 K, 1 bar'.format(rxn,library.label))
logging.error('library reaction {0} from library {1}, exceeds the collision limit at 1000 K, 1 bar and did not have allow_max_rate_violation=True'.format(rxn,library.label))
if boo:
raise ValueError('library {0} has unreasonable rates'.format(library.label))

Expand Down

0 comments on commit ab2430a

Please sign in to comment.