-
-
Notifications
You must be signed in to change notification settings - Fork 346
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 third body concentrations for non-ideal gases #968
Conversation
Codecov Report
@@ Coverage Diff @@
## main #968 +/- ##
==========================================
+ Coverage 70.66% 72.40% +1.74%
==========================================
Files 361 364 +3
Lines 44522 46435 +1913
==========================================
+ Hits 31460 33620 +2160
+ Misses 13062 12815 -247
Continue to review full report at Codecov.
|
This fix looks straightforward and correct, but I have a question about whether it is necessary. I'll post my thoughts over on the thread for #967 though. |
5c2051c
to
d5328bd
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.
Hi @speth this looks good. Just one question below, to make sure that we are intentionally also changing the falloff reaction formulation to use the physical concentrations, rather than the previously-used activity concentrations.
Reading through the comments, it appears that there is a consensus that concentrations of third body collision partners should use physical concentrations as implemented in this PR. However, there is a second point that was raised in #967, which pertains to reactions that explicitly state the colliding species, which would be treated in an inconsistent manner, i.e.
As an alternative to @speth and @decaluwe's suggestion (i.e. rewrite YAML), the detection of those reactions without modification of YAML input would be relatively straight-forward (stoich coefficient equal to one on both sides). As long as this behavior is clearly documented on the science pages, I believe an 'auto-detection' mechanism as is done elsewhere may be the simplest solution. One way forward would be to merge the current PR but leave the issue open, as there is some overlap with other ongoing work (#995). If a consensus can be found, I'd be happy to add a fix there. |
Thanks, @ischoegl . One comment, one question:
|
@decaluwe thanks ... absolutely true about |
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'm adding my approval here (with the caveat that this does not completely resolve #967).
From the discussion on Cantera#967, the calcuation of [M] should be based on the physical concentrations of the 3rd body colliders, not their "activity concentrations".
d5328bd
to
b5582e8
Compare
I just pushed a revised commit message so this won't automatically close #967. GitHub's notation that I "dismissed decaluwe’s stale review" sounds way too judgemental 🤣 . |
😤😤😤 My reviews are as fresh as they get, GitHub! 🤣 Okay, so the remaining issue, @ischoegl is the auto-detction issue for where the third body collider is explicitly listed, is that correct? |
@decaluwe ... correct. Would create a short PR so that won’t get buried in 3.5k lines in #995, although it neatly fits with the work there 😉 ... science docs are another remaining issue. Edit: as an alternative, I could create a new PR building on @speths's commits here, which will avoid leaving code in flux (although it presumably only affects real gas calculations). Presumably pushing here would work, but I haven't done that before. |
@speth ... looks like pushing to this PR may be simpler than expected. Any objections if I add something here? |
Pushing to PR branches is indeed pretty straightforward. If you have an implementation for this idea ready, please go ahead and push it here. |
I pushed a draft for detection of three-body reactions (which mostly works). Fixing the few failing tests is simple, but I wanted to get some second opinions first:
|
On the second point, would it make sense to just skip this for reactions where there are non-integer stoichiometries? I think that since they are not elementary reactions, all of the careful considerations here about what the third body means have likely gone out the window. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2fd0c3f
to
6d3beb1
Compare
This is quite odd. All tests pass locally on my machine (on the non-rebased branch) - could there be interactions with #984? The only thing I can think of is the detection of units as some species are handled as third bodies rather than regular species. Before the merge, my test runs were consistent with the CI checks. PS: looking through the code, I believe it’s due to the new [Edit: PPS: @speth ... I verified that there has been a functional clash with #984 (I rebased on a separate branch - ischoegl:fix-967-detect-thirdbodies). I am very hesitant to rebase here as it's not my PR, but a fix would require changing code that is not available on this branch (yet).] |
Yes, I'd be happy to take a look. |
This comment has been minimized.
This comment has been minimized.
6d3beb1
to
b5582e8
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.
As the detection of third-bodies ended up to be more comprehensive than this original PR while not depending on the proposed change, I decided to propose it as a separate PR (#1015).
Changes proposed in this pull request
If applicable, fill in the issue number this pull request is fixing
Partial fix for #967
Checklist
scons build
&scons test
) and unit tests address code coverage