-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rethink handling of duplicate reactions #132
Comments
Thanks for opening this issue, I think this is interesting. FWIW, I am also referencing Cantera/cantera#704 and Cantera/cantera#1019. |
Linking user group discussion and Cantera/cantera#1193 - as an example, prior to Cantera 2.6, the following duplicate reactions worked (as the second version was not detected as a third-body reaction). Starting in Cantera 2.6, the reactions require a
|
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
@ischoegl Would it be possible to have |
@cory-kinney … the way things are implemented, |
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
…ubstituted for 'yml' Attach the YAMLWriter listener Work on the yaml writing for cantera Renaming yml_test to cantera This is for writing Cantera yaml files updated set_cantera_kinetics in falloff.py spelled "high" wrong in set_cantera_kinetics added write_cantera_inputs to falloff.pyx for Troe reactions Fixing Lindemann and Troe deleted write_cantera_inputs, restructured using to_cantera > set_cantera_kinetics > to_cantera_kinetics for Lindemann and Troe reactions added efficiencies restructured cantera.py, now includes MultiArrhenius reactions added Chebyshev restructured and added in RMG equations added in Surface Arrhenius added sticking coefficient :) use_chemkin_identifier=True when making Cantera objects This uses the correct species names Dump yaml in the order of the dict, not alphabetical remove quotes from species names Handle duplicate reactions For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 ) added the beginnings of the catalysis edits still need to edit 'state' and fix 'vector<double>' error fixed for catalysis. Separates gas and surface reactions in the "reactions" section. Now just need to fix the bug with the C.Pt(22) stuff. Stay strong, shortie wip changes for stickingcoeffcient issue fixed "sites" v. "size" problem, yaml_writer now works for catalysis and gas phase. Time for pull request? Removing comments Trying cantera 2.5+ from conda-forge in environment.yml I suspected that the unit tests are failing because the new code can't work with cantera 2.3 from the RMG channel Trying Cantera 2.5+ from cantera channel in environment.yml Added in doc strings to methods. Removed unused imports Removed unused import from reaction.py renamed cantera.py to cantera_.py. Edited import statement in main.py to reflect this name change. Edited reaction.py so depreciated Cantera term is not used. Edited reactionTest.py so that test_falloff is successful for third body reactions Edited high_rate, low_rate in set_cantera_kinetics() for Lindemann reactions. Can now extract the high & low rate from the Cantera Lindemann object, which is necessary for reactionTest.py to pass successfully. restructed set_cantera_kinetics() and to_cantera_kinetics() for Lindemann reactions in falloff.pyx. Added Lindemann reaction checks in falloff.pyx Minor stylish change in falloff.py/ troe to cantera cleaning up falloff.pyx after rebase conflicts
…ubstituted for 'yml' Attach the YAMLWriter listener Work on the yaml writing for cantera Renaming yml_test to cantera This is for writing Cantera yaml files updated set_cantera_kinetics in falloff.py spelled "high" wrong in set_cantera_kinetics added write_cantera_inputs to falloff.pyx for Troe reactions Fixing Lindemann and Troe deleted write_cantera_inputs, restructured using to_cantera > set_cantera_kinetics > to_cantera_kinetics for Lindemann and Troe reactions added efficiencies restructured cantera.py, now includes MultiArrhenius reactions added Chebyshev restructured and added in RMG equations added in Surface Arrhenius added sticking coefficient :) use_chemkin_identifier=True when making Cantera objects This uses the correct species names Dump yaml in the order of the dict, not alphabetical remove quotes from species names Handle duplicate reactions For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 ) added the beginnings of the catalysis edits still need to edit 'state' and fix 'vector<double>' error fixed for catalysis. Separates gas and surface reactions in the "reactions" section. Now just need to fix the bug with the C.Pt(22) stuff. Stay strong, shortie wip changes for stickingcoeffcient issue fixed "sites" v. "size" problem, yaml_writer now works for catalysis and gas phase. Time for pull request? Removing comments Trying cantera 2.5+ from conda-forge in environment.yml I suspected that the unit tests are failing because the new code can't work with cantera 2.3 from the RMG channel Trying Cantera 2.5+ from cantera channel in environment.yml Added in doc strings to methods. Removed unused imports Removed unused import from reaction.py renamed cantera.py to cantera_.py. Edited import statement in main.py to reflect this name change. Edited reaction.py so depreciated Cantera term is not used. Edited reactionTest.py so that test_falloff is successful for third body reactions Edited high_rate, low_rate in set_cantera_kinetics() for Lindemann reactions. Can now extract the high & low rate from the Cantera Lindemann object, which is necessary for reactionTest.py to pass successfully. restructed set_cantera_kinetics() and to_cantera_kinetics() for Lindemann reactions in falloff.pyx. Added Lindemann reaction checks in falloff.pyx Minor stylish change in falloff.py/ troe to cantera cleaning up falloff.pyx after rebase conflicts
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
…ubstituted for 'yml' Attach the YAMLWriter listener Work on the yaml writing for cantera Renaming yml_test to cantera This is for writing Cantera yaml files updated set_cantera_kinetics in falloff.py spelled "high" wrong in set_cantera_kinetics added write_cantera_inputs to falloff.pyx for Troe reactions Fixing Lindemann and Troe deleted write_cantera_inputs, restructured using to_cantera > set_cantera_kinetics > to_cantera_kinetics for Lindemann and Troe reactions added efficiencies restructured cantera.py, now includes MultiArrhenius reactions added Chebyshev restructured and added in RMG equations added in Surface Arrhenius added sticking coefficient :) use_chemkin_identifier=True when making Cantera objects This uses the correct species names Dump yaml in the order of the dict, not alphabetical remove quotes from species names Handle duplicate reactions For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 ) added the beginnings of the catalysis edits still need to edit 'state' and fix 'vector<double>' error fixed for catalysis. Separates gas and surface reactions in the "reactions" section. Now just need to fix the bug with the C.Pt(22) stuff. Stay strong, shortie wip changes for stickingcoeffcient issue fixed "sites" v. "size" problem, yaml_writer now works for catalysis and gas phase. Time for pull request? Removing comments Trying cantera 2.5+ from conda-forge in environment.yml I suspected that the unit tests are failing because the new code can't work with cantera 2.3 from the RMG channel Trying Cantera 2.5+ from cantera channel in environment.yml Added in doc strings to methods. Removed unused imports Removed unused import from reaction.py renamed cantera.py to cantera_.py. Edited import statement in main.py to reflect this name change. Edited reaction.py so depreciated Cantera term is not used. Edited reactionTest.py so that test_falloff is successful for third body reactions Edited high_rate, low_rate in set_cantera_kinetics() for Lindemann reactions. Can now extract the high & low rate from the Cantera Lindemann object, which is necessary for reactionTest.py to pass successfully. restructed set_cantera_kinetics() and to_cantera_kinetics() for Lindemann reactions in falloff.pyx. Added Lindemann reaction checks in falloff.pyx Minor stylish change in falloff.py/ troe to cantera cleaning up falloff.pyx after rebase conflicts
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
…ubstituted for 'yml' Attach the YAMLWriter listener Work on the yaml writing for cantera Renaming yml_test to cantera This is for writing Cantera yaml files updated set_cantera_kinetics in falloff.py spelled "high" wrong in set_cantera_kinetics added write_cantera_inputs to falloff.pyx for Troe reactions Fixing Lindemann and Troe deleted write_cantera_inputs, restructured using to_cantera > set_cantera_kinetics > to_cantera_kinetics for Lindemann and Troe reactions added efficiencies restructured cantera.py, now includes MultiArrhenius reactions added Chebyshev restructured and added in RMG equations added in Surface Arrhenius added sticking coefficient :) use_chemkin_identifier=True when making Cantera objects This uses the correct species names Dump yaml in the order of the dict, not alphabetical remove quotes from species names Handle duplicate reactions For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 ) added the beginnings of the catalysis edits still need to edit 'state' and fix 'vector<double>' error fixed for catalysis. Separates gas and surface reactions in the "reactions" section. Now just need to fix the bug with the C.Pt(22) stuff. Stay strong, shortie wip changes for stickingcoeffcient issue fixed "sites" v. "size" problem, yaml_writer now works for catalysis and gas phase. Time for pull request? Removing comments Trying cantera 2.5+ from conda-forge in environment.yml I suspected that the unit tests are failing because the new code can't work with cantera 2.3 from the RMG channel Trying Cantera 2.5+ from cantera channel in environment.yml Added in doc strings to methods. Removed unused imports Removed unused import from reaction.py renamed cantera.py to cantera_.py. Edited import statement in main.py to reflect this name change. Edited reaction.py so depreciated Cantera term is not used. Edited reactionTest.py so that test_falloff is successful for third body reactions Edited high_rate, low_rate in set_cantera_kinetics() for Lindemann reactions. Can now extract the high & low rate from the Cantera Lindemann object, which is necessary for reactionTest.py to pass successfully. restructed set_cantera_kinetics() and to_cantera_kinetics() for Lindemann reactions in falloff.pyx. Added Lindemann reaction checks in falloff.pyx Minor stylish change in falloff.py/ troe to cantera cleaning up falloff.pyx after rebase conflicts
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
…ubstituted for 'yml' Attach the YAMLWriter listener Work on the yaml writing for cantera Renaming yml_test to cantera This is for writing Cantera yaml files updated set_cantera_kinetics in falloff.py spelled "high" wrong in set_cantera_kinetics added write_cantera_inputs to falloff.pyx for Troe reactions Fixing Lindemann and Troe deleted write_cantera_inputs, restructured using to_cantera > set_cantera_kinetics > to_cantera_kinetics for Lindemann and Troe reactions added efficiencies restructured cantera.py, now includes MultiArrhenius reactions added Chebyshev restructured and added in RMG equations added in Surface Arrhenius added sticking coefficient :) use_chemkin_identifier=True when making Cantera objects This uses the correct species names Dump yaml in the order of the dict, not alphabetical remove quotes from species names Handle duplicate reactions For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 ) added the beginnings of the catalysis edits still need to edit 'state' and fix 'vector<double>' error fixed for catalysis. Separates gas and surface reactions in the "reactions" section. Now just need to fix the bug with the C.Pt(22) stuff. Stay strong, shortie wip changes for stickingcoeffcient issue fixed "sites" v. "size" problem, yaml_writer now works for catalysis and gas phase. Time for pull request? Removing comments Trying cantera 2.5+ from conda-forge in environment.yml I suspected that the unit tests are failing because the new code can't work with cantera 2.3 from the RMG channel Trying Cantera 2.5+ from cantera channel in environment.yml Added in doc strings to methods. Removed unused imports Removed unused import from reaction.py renamed cantera.py to cantera_.py. Edited import statement in main.py to reflect this name change. Edited reaction.py so depreciated Cantera term is not used. Edited reactionTest.py so that test_falloff is successful for third body reactions Edited high_rate, low_rate in set_cantera_kinetics() for Lindemann reactions. Can now extract the high & low rate from the Cantera Lindemann object, which is necessary for reactionTest.py to pass successfully. restructed set_cantera_kinetics() and to_cantera_kinetics() for Lindemann reactions in falloff.pyx. Added Lindemann reaction checks in falloff.pyx Minor stylish change in falloff.py/ troe to cantera cleaning up falloff.pyx after rebase conflicts
For MultiArrhenius and MultiPDepArrhenius kinetics we need to make more than one reaction in the list of reactions for Cantera yaml. (at least until this is implemented: Cantera/enhancements#132 )
Abstract
The current mechanism for handling "duplicate" reactions is mostly an attempt to replicate the corresponding syntax from the Chemkin format. However, I think there are some unwritten rules to this that we shouldn't necessarily try to replicate, and we have potentially better ways of handling reactions where the rate is a combination of different rates.
Motivation
Requiring reactions to be labeled as duplicates is an attempt to catch certain kinds of errors when assembling reaction mechanisms from multiple sources. However, it has a number of limitations.
Possible Solutions
I think there are a couple of things that can be done, with different levels of difficulty.
Treat reactions as potential duplicates regardless of the reaction "type". I guess for cases like third-body reactions, this requires deciding whether a reaction like
A+B=C+D
andA+B+M=C+D+M
are considered as duplicates. If we change our definition of duplicate, I think we would want to updateck2yaml
to provide a way of automatically setting relevant reactions as duplicates if the would not have satisfied Chemkin's duplicate reaction definition, and provide a way of automatically updating mechanisms to correspond to these rules.Provide a way of actually writing "duplicate" reactions as a single reaction with multiple rates. I think this should be somewhat easier with the improved infrastructure for handling reaction rates that's been introduced by Refactor Reaction Rate Evaluators #87. As a simple example,
could instead be written as:
For example, the following set of reactions from GRI 3.0:
might instead be written as (very roughly):
While this is obviously quite a bit more complicated to implement, I think it would have benefits for end users, where groups of reactions like these are really perceived as a single reaction and the need to split them into multiple reactions is an artificial result of how some modeling tools require the rates to be parameterized. Reactions with explicit reverse rates also fall into this category, where Cantera splits them up even though they really should be considered as a single reaction. Of course, the same need for automatically converting reactions to this style would exist as with (1).
The text was updated successfully, but these errors were encountered: