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

Sticking species not detected correctly when ‘solid’ species are involved #1210

Closed
ischoegl opened this issue Feb 28, 2022 · 2 comments · Fixed by #1181
Closed

Sticking species not detected correctly when ‘solid’ species are involved #1210

ischoegl opened this issue Feb 28, 2022 · 2 comments · Fixed by #1181
Labels
Input Input parsing and conversion (for example, ck2yaml)

Comments

@ischoegl
Copy link
Member

ischoegl commented Feb 28, 2022

Problem description

Steps to reproduce

Convert haca2.cti (CTI file pulled verbatim from Cantera 2.5.1)

Open interface as:

In [1]: import cantera as ct
   ...: 
   ...: phase = ct.Interface("haca2.yaml", "soot_interface")
---------------------------------------------------------------------------
CanteraError                              Traceback (most recent call last)
Input In [2], in <module>
      1 import cantera as ct
----> 3 phase = ct.Interface("haca2.yaml", "soot_interface")

File /work/GitHub/cantera/interfaces/cython/cantera/base.pyx:63, in cantera._cantera._SolutionBase.__cinit__()

File /work/GitHub/cantera/interfaces/cython/cantera/base.pyx:120, in cantera._cantera._SolutionBase._cinit()

File /work/GitHub/cantera/interfaces/cython/cantera/base.pyx:207, in cantera._cantera._SolutionBase._init_yaml()

CanteraError: 
*******************************************************************************
CanteraError thrown by addReactions:

*******************************************************************************
InputFileError thrown by InterfaceKinetics::buildSurfaceArrhenius:
Error on line 89 of ./haca2.yaml:
Multiple non-interface species ('CB-CB3' and 'OH')
found in sticking reaction: 'CB-CB3 + Csoot-H + OH => CO + Csoot-* + H2'.
Sticking species must be explicitly specified.
|  Line |
|    84 |   rate-constant: {A: 2.0e+13, b: 0.0, Ea: 0.0}
|    85 | - equation: Csoot-* + C2H2 => Csoot-H + H + 2 CB-CB3  # Reaction 6
|    86 |   rate-constant: {A: 8.0e+07, b: 1.56, Ea: 3.8}
|    87 | - equation: Csoot-* + O2 + 2 CB-CB3 => Csoot-* + 2 CO  # Reaction 7
|    88 |   rate-constant: {A: 2.2e+12, b: 0.0, Ea: 7.5}
>    89 > - equation: OH + Csoot-H + CB-CB3 => Csoot-* + CO + H2  # Reaction 8
            ^
|    90 |   sticking-coefficient: {A: 0.13, b: 0.0, Ea: 0.0}
*******************************************************************************
*******************************************************************************

Behavior

presumably the original CTI input file is valid (it has been part of the test suite), so it is not entirely clear what is going on … it looks like an issue with the logic in the validation of the sticking species that somehow has evaded detection: it probably should only consider gas phases?

System information

  • Cantera version: 2.6.0a4
  • OS: any
  • Python/MATLAB/other software versions: Python 3.10 (conda)

Additional context

Issue was found when working on #1205

Resolution is contingent on #1181, and can be incorporated into #1205 [Edit: the unit test using haca2 bypasses the (newly introduced) validation step, so this issue doesn't need to be resolved for #1205]

As a reference, the sticking species is (presumably manually) added in the current ‘official’ YAML file https://github.com/Cantera/cantera/blob/main/test_problems/surfSolverTest/haca2.yaml

Possible Solutions

  1. Add detection and specification of sticking species to cti2yaml
  2. Only consider species that are in the gas phase in InterfaceKinetics::buildSurfaceArrhenius

I believe (2) is both more robust and easier to implement.

@ischoegl ischoegl added the Input Input parsing and conversion (for example, ck2yaml) label Feb 28, 2022
@ischoegl ischoegl changed the title Adjacent phases not always detected correctly when using cti2yaml Sticking species not detected correctly when using cti2yaml Feb 28, 2022
@ischoegl ischoegl changed the title Sticking species not detected correctly when using cti2yaml Sticking species not detected correctly when ‘solid’ species are involved Feb 28, 2022
ischoegl added a commit to ischoegl/cantera that referenced this issue Mar 5, 2022
ischoegl added a commit to ischoegl/cantera that referenced this issue Mar 5, 2022
@speth
Copy link
Member

speth commented Mar 6, 2022

The way this is handled for CTI input files is that ctml_writer does this determination if which species is in the ideal gas phase and makes the sticking species explicit in the XML file. The change in #1181 essentially mirrors this behavior, in that it will only allow sticking species from a phase that reports that it is a gas phase. However, we have a few other phase models which could in principle have sticking species, such as the Redlich-Kwong and Peng-Robinson models. Right now, these both return unspecified as the phase of matter, and so wouldn't be detected as having possible sticking species with this patch. A somewhat more permissive logic for this would be:

  • If there is only one non-surface phase reactant, it is the sticking species
  • If there are multiple non-surface phase reactants, but only one is in a phase identifying itself as a "gas", that is the sticking species
  • Otherwise, the sticking species must be identified explicitly

ischoegl added a commit to ischoegl/cantera that referenced this issue Mar 7, 2022
@ischoegl
Copy link
Member Author

ischoegl commented Mar 7, 2022

@speth ... I updated the check in #1181 per your suggestions.

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

Successfully merging a pull request may close this issue.

2 participants