Skip to content
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

Undeclared duplicate reaction error for generic third body reaction matching the form of another reaction #1193

Closed
corykinney opened this issue Feb 10, 2022 · 11 comments
Labels
Input Input parsing and conversion (for example, ck2yaml)

Comments

@corykinney
Copy link
Contributor

Problem description

Sorry for the title wording, but essentially I've come across a valid CHEMKIN mechanism that includes the following two reactions:

H2+M<=>H+H+M

and

H+O2+H=H2+O2

Cantera views these as duplicate reactions because the former is a generalization of the latter, where O2 is substituted for M. I'm not sure how CHEMKIN handles these, but perhaps the more specific reaction is preferred over the general third body reaction when such a reaction is defined.

Steps to reproduce

  1. Download CHEMKIN version of NUIGMech1.1 from NUI Galway mechanism download site
  2. Run ck2yaml with --permissive for duplicate thermo and transport definitions
  3. The converted mechanism is saved, but during validation the following error occurs:
FAILED
Undeclared duplicate reaction H2 + M <=> H + H + M
found on lines 3314 and 3327 of the kinetics input file.

System information

  • Cantera version: 2.6.0a3 (commit 2b72e88)
  • OS: Windows 10
  • Python version: 3.8

Attachments

GitHub doesn't support uploading .yaml files, so here is the .txt file of the converted mechanism that I'm using:

NUIGMech1.1.txt

@ischoegl
Copy link
Member

@corykinney ... as of Cantera 2.6, these reactions are indeed treated as duplicates (which is imho the correct behavior). The change was introduced in #1015.

@ischoegl ischoegl added the Input Input parsing and conversion (for example, ck2yaml) label Feb 10, 2022
@corykinney
Copy link
Contributor Author

@ischoegl ... I was unsure of whether this was a bug or not and didn't realize this was intentionally added recently! What was the behavior prior to this change?

I suppose to resolve this one of the conflicting reactions would have to be removed from the input mechanism, correct? What would be the best practice to ensure that the mechanism behaves in Cantera the same way it would behave in CHEMKIN?

@mefuller
Copy link
Contributor

@corykinney add "duplicate" declaration to both reactions and set the collider efficiency to zero for O2 in the "+M" reaction if not already provided.

If there is a non-zero efficiency, then the original intention seems ambiguous to me.

@corykinney
Copy link
Contributor Author

corykinney commented Feb 10, 2022

@corykinney add "duplicate" declaration to both reactions and set the collider efficiency to zero for O2 in the "+M" reaction if not already provided.

If there is a non-zero efficiency, then the original intention seems ambiguous to me.

@mefuller The original reaction is:

H2+M<=>H+H+M                                      +4.57700000E+019 -1.40000000E+000 +1.04400000E+005
HE / +0.8300 / CO / +1.9000 / CH4 / +2.0000 / H2 / +2.5000 / C2H6 / +3.0000 / CO2 / +3.8000 / H2O / +12.0000 /

I'm not familiar with modifying CHEMKIN files, so just to verify, I'm assuming the modified version would be:

DUPLICATE
H2+M<=>H+H+M                                      +4.57700000E+019 -1.40000000E+000 +1.04400000E+005
HE / +0.8300 / CO / +1.9000 / CH4 / +2.0000 / H2 / +2.5000 / C2H6 / +3.0000 / CO2 / +3.8000 / H2O / +12.0000 / O2 / +0.0000 /

Is that correct?

Also @ischoegl should we close this since I was mistaken and it's not an actual bug?

EDIT: It seems that marking it with DUPLICATE the way I did above caused a parsing error, but not marking it as duplicate and setting the collider efficiency to zero on the third body reaction worked

@bryanwweber
Copy link
Member

bryanwweber commented Feb 10, 2022

@corykinney If I recall the CHEMKIN syntax, the DUPLICATE declaration has to go after the reaction, possibly after the efficiencies as well. And both reactions have to be labeled as DUPLICATE.

@corykinney
Copy link
Contributor Author

@bryanwweber the conversion/validation ended up passing after I added the collider efficiency of zero, even without the DUPLICATE flag. In that case, do I need to add the flag still, or should it be fine since it passed validation?

@bryanwweber
Copy link
Member

@corykinney No, if the collider efficiency is set to zero you don't need DUPLICATE (and in fact adding it will probably be an error). In that case the reactions are no longer duplicates, since the rate of the one with the collider efficiency is now zero. However, it may be a different reaction rate than what was intended by the mechanism authors.

If you can, you may want to print out the rate of these two reactions from CHEMKIN as a function of temperature and pressure and see how that compares to the various valid Cantera options.

@ischoegl
Copy link
Member

@corykinney ... I don't think that this is a bug, and I agree with @mefuller's advice. One alternative would be to take the YAML output (ignoring the validation failure) and add the duplicate declaration there.

@ischoegl
Copy link
Member

PS: fwiw, there is some ongoing discussion on handling of duplicate reactions, see Cantera/enhancements#132 ... so feel free to comment there.

@linteli
Copy link

linteli commented Oct 22, 2024

Have you solved this problem? I have the same problem and I would like to ask you for your solution.

@speth
Copy link
Member

speth commented Oct 23, 2024

The handling of reactions like this was changed in #1736: The default behavior is now to warn about such reactions (rather than raising an exception). A new explicit-third-body-duplicates field in the YAML phase entry can be used to modify this behavior. This change will be part of the upcoming Cantera 3.1 release, and is already present in the development/pre-release version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Input Input parsing and conversion (for example, ck2yaml)
Projects
None yet
Development

No branches or pull requests

6 participants