Update detection of skipped/undeclared species#1027
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1027 +/- ##
==========================================
+ Coverage 72.54% 72.55% +0.01%
==========================================
Files 355 355
Lines 46422 46446 +24
==========================================
+ Hits 33675 33701 +26
+ Misses 12747 12745 -2
Continue to review full report at Codecov.
|
3e1610c to
afbff00
Compare
speth
left a comment
There was a problem hiding this comment.
The failures in the ionized flame tests aren't trivial. It looks like the logic here is causing all third body and falloff reactions containing "M" as the third body to be left out. The ch4_ion input file should create a phase with 110 reactions, but it only contains 96 with the changes in this PR.
I'm a little surprised that these are the only tests that catches this problem.
As far as the implementation here, I wonder if it would make sense to move more of this checking into the Reaction classes, rather than having different implementations of this decision tree in Kinetics::addReaction and getReactions. It could almost be part of Reaction::validate, with the wrinkle that validate doesn't currently take the Kinetics object as an argument.
Huh?! ... I remember checking on the number of reactions earlier also, but must have overlooked something here. It's pretty surprising that none of the other CI tests failed, and I had issues with Regarding the implementation: I retained the old philosophy where |
|
Given that the only place where But I think we could avoid having to add three new functions to the |
This is pretty much my point, and I see your point of not wanting to add more methods to |
You could do the validation in
I'm 👍 on |
Fair point. For the new structure, I started to differentiate between validation of rate parameters and reaction equations, which would make that part easier, as each can be tied to calling specific functions with known behavior. From my perspective, it would still be worthwhile to run the check immediately (i.e. prior to
Unfortunately overloads will be necessary until CTI/XML support is removed as I do not anticipate porting the old loaders to the new reaction framework. |
1ceb1d1 to
a40c034
Compare
|
@speth ... I fixed the logic, and moved the tests as discussed (I also moved the |
|
For the case of Interestingly, the same reaction is also added when creating a phase from |
|
@speth ... thanks for catching this: my earlier fix of the logic glitch broke something that had worked before ... turns out that the logic needs to work differently for reactions with specified collision partners. It should all be good now - I also switched the unit tests to |
Also, fix logic to retain reactions with undeclared third body species.
Calling the check from within 'Reaction::checkSpecies' ensures that the reaction balance is always checked. Previously, this check was skipped for 'getReactions'. For consistency, the check itself is moved from 'Kinetics::checkReactionBalance' to 'Reaction::checkBalance'.
Changes proposed in this pull request
Reaction::validateWhileIonBurnerFlamedoes act up, this is not the first time. I have skipped those tests for the time being.If applicable, fill in the issue number this pull request is fixing
Fixes #1024
E.g. if
skip-undeclared-third-bodies=false, the error is formatted asChecklist
scons build&scons test) and unit tests address code coverage