Custom filter criteria per reaction family#1577
Conversation
2015b68 to
84413cf
Compare
b72dc72 to
5cf31b0
Compare
Codecov Report
@@ Coverage Diff @@
## master #1577 +/- ##
=========================================
- Coverage 44.24% 44.2% -0.04%
=========================================
Files 83 83
Lines 21551 21627 +76
Branches 5648 5668 +20
=========================================
+ Hits 9535 9561 +26
- Misses 10958 11010 +52
+ Partials 1058 1056 -2
Continue to review full report at Codecov.
|
b649749 to
c131602
Compare
04e3f8d to
054faeb
Compare
1d37c15 to
0461ca4
Compare
f326ccd to
9105935
Compare
c184e87 to
f336ff1
Compare
229fcf1 to
e75dd51
Compare
3804be0 to
1da5304
Compare
8b1f75f to
d125ce2
Compare
amarkpayne
left a comment
There was a problem hiding this comment.
Quick comments to help fix your codacy issues
6143b5d to
04398f9
Compare
|
I skimmed through the reaction generation code again, and I'm fairly sure that it's safe to not copy species before reacting. I added a unit test to confirm that a couple notable Species and Molecule attributes are not affected by the reaction generation process. Let me know if you think there are other attributes we should check. Based on that, I removed species copying from To summarize the runtime differences:
Two of the changes I added make custom filter criteria more efficient, while two are unrelated and could also be applied on master. That means that for this particular example, custom filtering still hurts performance. I think that additional profiling would be a good idea, probably with longer jobs. |
|
Thanks for helping, I really appreciate it. My untested suspicion is that some of the Numpy vectorization operations we have added, especially in the .pyx files might not be as fast as the for loops that were there before. |
I agree with @ajocher . Specifically, I think my recommendations here were bad and should be reverted back to for loops |
41e71f1 to
3587fdb
Compare
…e if many species are added to the input file.
0fe372e to
e034790
Compare
|
This PR is attempting to merge into If there are commits on this branch that should be merged into |
Motivation or Problem
By filtering reactions we add a pre-filtering step before the step of reacting species together (slow), which prevents species from reacting together when the reactions are expected to be negligible throughout the simulation. Currently, unimolecularThreshold, bimolecularThreshold, and trimolecularThreshold are binary arrays storing flags for whether a species or a pair of species are above a reaction threshold. For a unimolecular rate, this threshold is set to True if the unimolecular rate of reaction 𝑘 reaction k for a species A



.


at any given time 𝑡 t in the reaction system, where
For a bimolecular reaction occuring between species A and B, this threshold is set to True if the bimolecular rate
where 𝑘𝑡ℎ𝑟𝑒𝑠ℎ𝑜𝑙𝑑=filterThreshold is set by the user in the input file and its default value is
Similarly, for a trimolecular reaction, the following expression is used:
where
The threshold values can be refined for each reaction family to speed reaction generation up.
Description of Changes
In this pull request we will refine the threshold values for uni-/bi- and trimolecular reactions by evaluating an Arrhenius fit for each reaction family at the user defined reactor temperature. The Arrhenius fits were obtained by extracting the highest reaction rates from all training reactions of one family for a discrete set of temperatures. The ipython notebook is RMG-Py/ipython/kinetics_training_analysis.ipynb.
Testing
Tested superminimal and minimal example with reaction filtering turned on. The latter one also with pdep.
Reviewer Tips
This pull request shouldn't dramatically change the core model of your own test case, but speed reaction generation up.
Modified Travis to simultaneously update RMG-Py and RMG-database. When merging, the code reviewer should remove the temporary commit on RMG-Py.