Detect unspecified thirdbody collision partners#1015
Conversation
5b2142b to
8b84969
Compare
Per discussion in Cantera#967, species-specific third-body reactions should use molar concentrations for collision partner concentrations instead of activity concentrations to be consistent with three-body reactions with generic collision partners.
A reaction is identified as a three-body reaction if the following criteria are satisfied: * reaction type must not be specified * exactly one species has to occur on both reactant and product side * all stoichiometric coefficients have integer values * one side has to have exactly 3 participating species
* test-clib: species-specific three-body reaction are reformatted
* test-cxx/test-f90: reformatted species-specific three-body reactions;
change of spurious net reaction rates, which should be zero
* test-f77-ctlib: change of spurious net production rate for AR (gri30)
8b84969 to
33f05f8
Compare
speth
left a comment
There was a problem hiding this comment.
This looks pretty good to me, @ischoegl. All of my comments are on fairly minor items. Beyond the in-line comments, there are just a couple of other things:
- Can you add a test for a reaction created via XML, given that you implemented this logic for both YAML and CTI/XML derived reactions?
- Have you thought about how these reactions should be serialized? Right now, they are converted to
three-bodyreactions with thedefault-efficiencyandefficienciesfields set as one might expect. I guess the question is whether or not that extra information should be deleted.
Lastly, I just wanted to note that I like that this ends up moving the third body to the end of the reactant / product strings for these reactions.
|
@speth ... thanks for your review. Hadn't thought about serialization as this is still a brand-new addition, but your point is well taken. I had to change duplicate checks but will look at this again.
Likewise. Have to admit that this was an unintended 'feature', and would probably have fought to keep the new behavior (as it is both more instructive and easier to implement). PS: Regarding XML tests, those are implicitly included by |
|
@speth (and @bryanwweber) ... I think this should take care of the review comments. I did not feel the need to implement XML unit tests, as those are (implicitly) covered by I did, however, implement a shortened serialization output, which I had not thought about. |
Also, address review comments
Three-body reactions with explictly declared collision partners do not need to declare additional fields, i.e. 'type', 'default-efficiency', and 'efficiencies'.
188a1a0 to
f61f85c
Compare
|
Thanks @speth! |
Changes proposed in this pull request
This PR is the second half of a fix for #967 (with the first half being taken care of by #968). I decided to post this as a dedicated PR instead of attaching the commits to #968, as review policies weren't clear, and this addition doesn't depend on the solution proposed in #968.
I believe the question on how to treat concentration has been settled in discussions in #967 and #968, but a process to convert reactions that explicitly specify a collision partner was still missing (per @decaluwe's suggestion). As an alternative to explicitly relabeling all affected reactions, it is possible to leave the existing syntax
and use simple rules to identify this reaction as a
three-bodyreaction in a pre-processing step (similar to what is already done for the detection of electrochemical reactions). I.e.O2would be detected as the collision partner, and treated as if one would manually specifySpecifically, I am suggesting the following four rules for converting an
elementaryto athree-bodyreaction:typemust not be specifiedIf applicable, fill in the issue number this pull request is fixing
Fixes #967 (as long as #968 is merged also)
Checklist
scons build&scons test) and unit tests address code coverage