-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Reaction rate factories #1061
Reaction rate factories #1061
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1061 +/- ##
==========================================
+ Coverage 72.92% 73.44% +0.51%
==========================================
Files 357 364 +7
Lines 47120 47595 +475
==========================================
+ Hits 34363 34955 +592
+ Misses 12757 12640 -117
Continue to review full report at Codecov.
|
We can avoid the need for the virtual shared_ptr<MultiRateBase> newMultiRate() const {
return make_shared<MultiBulkRate<ArrheniusRate, ArrheniusData>>();
} Then, the replacement else-if tree in |
Also: Make Multi*Rate naming consistent
8446911
to
b5553d5
Compare
@speth ... thanks for the suggestion - this is indeed simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ischoegl, most of this looks good to me. I think the only substantial concern I have is with figuring out the rate constant units in the newRate(AnyMap, Kinetics)
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small style comments, thanks @ischoegl
ebab756
to
7763cd8
Compare
@speth and @bryanwweber - thank you for your reviews ... I addressed / responded to all comments at this point. Regarding the unit controversy, I believe that there are some inconsistencies that go beyond this PR (see new issue #1071) - the constructor in question is useful for the creation of |
Thanks, @bryanwweber! |
ddb6e8b
to
e24e84a
Compare
@speth ... I believe I resolved the issue with units by removing the
|
b689e27
to
f4595d2
Compare
@speth ... the last commit blocks an edge case where a user would specify a unit system that would produce
With this update, I believe that all comments are taken care of. PS: there is an exception though:
which is a bit harder to catch (see |
328be0d
to
f41f20d
Compare
For stand-alone ReactionRate objects, the pre-exponential factor needs to be consistent with default Cantera units (length in 'm' and quantity in 'kmol'). In other words, it must not be specified by explicit units or an incompatible unit system.
f41f20d
to
791eb02
Compare
Not too hard after all. I believe this is done now ...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates to this, @ischoegl. After the extended discussion on #1071, I think most of the complicated issues here have already been worked out without introducing too much new complexity. My remaining comments are mostly places on things that should either simplify the current implementation slightly or make some further generalizations that I suspect we both have in mind easier.
@speth ... thank you for your re-review and the interesting comments. I ended up adopting all your suggested changes.
I honestly was still thinking along the old lines too much here. I certainly realized that the revised |
Setting the units factor to 0 is a simpler solution to detect ReactionRate objects that do not have an associated Reaction defined (yet). Not calling the default constructor for ElementaryReaction3 from the constructor avoids the creation of rate objects that are immediately overwritten.
Removing checks for consistency between (current) Reaction3 objects and ReactionRate objects makes the framework more flexible.
As ReactionRate objects have consistent type names, specializations for ElementaryReaction3::getParameters, PlogReaction3::getParameters and ChebyshevReaction3::getParameters are no longer needed.
80753fe
to
26961c9
Compare
Realized that shifting the emphasis away from I believe this is ready to merge now. Getting rid of some PS: Changing the |
043a1c8
to
799d6d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ischoegl, this looks good to me. I had just one very minor nitpick, commented on below.
Regarding the fate of the Reaction
class, I expect that the only distinction ultimately worth keeping will be between bulk phase reactions and interface/electrochemical reactions. But even then, some of the extra parameters and functionality may fit better within the ReactionRate
classes.
@speth ... thanks for the reviews! I removed the redundant
👍 ... I see it the same way - the YAML |
Changes proposed in this pull request
Create factory constructors in anticipation of refactoring of
Falloff
reactions and corresponding ratesReactionRateBase::newMultiRate
instantiationnewRate
factory constructorReactionRate
interfaceThe Interface now mostly replicates what already exists for
Reaction
objects. Addresses Cantera/enhancements#87.Closes #1071 (associated discussion)
Example
YAML input for
ReactionRate
uses the same information asReaction
. Non-rate specific information is ignored, and rate types are recognized using aliases.For the time being, I am sticking with the usual nomenclature (see #1053)
Checklist
scons build
&scons test
) and unit tests address code coverage