-
-
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
ck2yaml doesn't set third_body when parsing A+B+M reactions #800
Comments
Super not relevant, but congrats on raising Issue #800! 🎉 |
I have run into the same issue today and modified ck2yaml to accommodate such an error by checking if None in [r1.third_body, r2.third_body] inside of check_duplicate_reactions. Previously such a reaction pair was allowed in Cantera, but I believe that this should be considered a duplicate reaction. I can submit a pull request if it's decided that this is the correct solution. |
Hmmm. I'd forgotten about this. Thanks for the suggestion. |
Hi @tsikes I'm not sure I understand your method, can you push the fix to a PR so we can take a look at it? Thanks! |
For this particular case, would it make sense to rename the variable The issue of what should and shouldn't be a duplicate reaction is something that is better discussed as part of an enhancement proposal. Changing the current behavior could be tricky if we want to maintain some form of compatibility with Chemkin, or backward compatibility with what Cantera has allowed in the past. |
I modified my solution to act in the default permissive manner of Cantera. I don't think that my solution is very elegant and @speth has a better answer to this issue. Regardless I created a pull request so that you can see what I've done. #854 It makes sense that changing the current behavior could have some adverse effects on backwards compatibility. Edit: This issue was bugging me so I fixed it properly. I also found another bug, which I fixed as well. #855 |
When parsing these reactions
it seems that ck2yaml will interpret them both as pressure dependent and set
pressure_dependent=True
on both, but will only set thethird_body
attribute toM
in the second reaction (the first reaction will havethird_body=None
).When running through
check_duplicate_reactions
it will then reach the linesand give an
AttributeError: 'NoneType' object has no attribute 'upper'
becauser1.third_body
isNone
.Presumably the fix is for the parsing of the first reaction to set
third_body='M'
??But putting
in the
parse_expression
method means we're setting a variable named "fall-off third body" for something that's technically not a "fall off" reaction. And may have other issues.Or is the answer to change how
check_duplicate_reactions
works?Should
be considered duplicates anyway?
I know that Cantera does not consider these to be duplicates:
System information
Attachments
mechanism.txt
thermo.txt
The text was updated successfully, but these errors were encountered: