Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Kinetics] Fix issue 717, Add check for sticking coefficient more than 1 #1038
[Kinetics] Fix issue 717, Add check for sticking coefficient more than 1 #1038
Changes from all commits
9c0a06b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there a way to use
cantera/include/cantera/kinetics/Kinetics.h
Lines 392 to 407 in 4570f3e
here? I have recently used
bulk.getPartialMolarEnthalpies(m_grt.data()); getReactionDelta(m_grt.data(), dH.data());
(this used just one phase, with
dH
being a vector with the length of the number of reactions); I believe this may extend to multiple phases as long as the partial molar enthalpies are in the correct order. You mainly need to pick out the correct reaction index (while this calculates things for all reactions, it does not require lookup; it's a tradeoff, but as it is called during validation speed may not be as critical).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 review, I think I have addressed all the comments except this one. I would rather not change this part if it is not going to significantly speed things up
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.
@12Chao … no problem. I’ll leave the final approval to @speth. From my perspective, what you have here may be redundant code that could be avoided, as the same may be achieved with 5 lines of code within your validation functions. Another option would be to make this a local function within
Reaction.cpp
, as it is not being used elsewhere and I do not think that it is a good fit forKinetics
.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.
I thought that the reason for adding the
deltaEnthalpy
function was because you need to be able to evaluate it for a reaction that isn't already part of theKinetics
object. Correct?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.
@speth … valid point: in this case
getReactionDelta
does not apply. It still doesn’t quite fit withKinetics
and I believe it would be better to have it as a helper function withinReaction
. But it’s not a major sticking point for me.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.
I agree, it does feel like an awkward addition to the Kinetics class. Given that it relies almost entirely on public member functions of
Kinetics
(and the one exception, the use ofm_start
, can be fixed), I can see it more naturally being a member of theReaction
class.