-
Notifications
You must be signed in to change notification settings - Fork 23
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
possible bug in default third-body efficiency #26
Comments
@michael-a-hansen thanks for the report. Looking at the two mechanisms, I think I see the issue. On line 1031 (and 991 for that matter) we check for a default efficiency of 0, and if so treat the first non-zero efficiency as a single species third-body efficiency (i.e., with an efficiency of 1, and all other species with and efficiency of 0). Of course, we have a species "C" with efficiency = 2 I think the most robust way to handle this case would be to treat this third-body, would be as a "mixture" and then go set the third body efficiencies of the rest of the species in the mechanism to zero -- this would also fix the case (which we obviously haven't encountered yet) that the default efficiency was not 0 or 1, or if you set the default efficiency to 0 and then had 2+ species with specified efficiencies. I'm not sure this specification is "correct" strictly speaking -- in chemkin wouldn't you be forced to go in and manually specify the third-body efficiency? None the less, if Cantera supports this sort of specification we probably should as well. When I get a chance today, I'll test this out (by setting the "C" efficiency to 1) to see if that fixes the problem |
@michael-a-hansen I think the latest commits (in pull request currently, will merge shortly) should fix this, my updated test script:
and output:
Can you give it a shot when you get a chance? |
Fix for #26 and other minor updates
I think there's a bug in how pyJac handles three-body and falloff reactions when the default third-body efficiency is not 1. In verifying a Jacobian code I'm working on, I've tested against pyJac on 3-body, Lindemann, and Troe reactions, with the N-th species as a reactant or not, and with the N-th species as a special third-body or not. In this test matrix there are persistent diffs between pyJac and cantera/my-code (which do not diff) in the source term (RHS) calculation only when the default third-body efficiency is not zero. Due to this, I don't think it's an N-th species thing.
The most serious impact would be the RHS. Here's code to show pyJac vs Cantera. Attached are two toy mechanisms with only one reaction (reversible, three-body, N-th is not a reactant, N-th is not a special TB). Swap out the
mech
variable in the code to see the difference.I couldn't upload an XML to github, so they're in txt format, but just change the extension and it should work fine. The code expects each pyJac-cython binary file to be put in a folder named like the mechanism.
rev_3body_noN_noN_nonUnity.txt
rev_3body_noN_noN_unity.txt
The text was updated successfully, but these errors were encountered: