You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.7.11 |Anaconda custom (x86_64)| (default, Dec 6 2015, 18:57:58)
[GCC 4.2.1 (Apple Inc. build 5577)]
Preamble
In [1]: import cantera as ct
In [2]: ct.__version__
Out[2]: '2.3.0'
Expected Behavior
In [3]: ct.Solution('cantera-working.cti')
< some warnings and then...>
Out[3]: <cantera.composite.Solution at 0x109ffbb90>
Actual Behavior
In [4]: ct.Solution('cantera-broken.cti')
< some warnings and then...>
---------------------------------------------------------------------------
CanteraError Traceback (most recent call last)
<ipython-input-12-556309c8f232> in <module>()
----> 1 ct.Solution('cantera-broken.cti')
interfaces/cython/cantera/base.pyx in cantera._cantera._SolutionBase.__cinit__ (interfaces/cython/cantera/_cantera.cpp:7873)()
interfaces/cython/cantera/base.pyx in cantera._cantera._SolutionBase._init_cti_xml (interfaces/cython/cantera/_cantera.cpp:8556)()
CanteraError:
***********************************************************************
CanteraError thrown by parseCompString:
Duplicate key: 'CF2'.
***********************************************************************
The difference between the two .cti files is that the -broken.cti one contains some species with : in their names, such as CH2:CHF and CH2:CF2, generated using ck2cti on the attached chemkin files, and the working one had all the : replaced with # in the chemkin files (also attached) before they were converted to the -working.cti file.
My guess, from just staring at the code, is that the checks and work-arounds for colons occurring around line 91 of that file (stringUtils.cpp) should happen before the duplicate key check on line 83, which is currently using the uncorrected name that is only what appears before the first colon.
But I can't easily test my theory, so am just reporting it here.
The chemkin and cantera input files are in this Archive.zip
The text was updated successfully, but these errors were encountered:
rwest
changed the title
Species names with a colon (:) can cause problems.
Species names with a colon (:) can cause problems in parseCompString
Apr 11, 2018
The check was being done at a stage where the token being checked could be just
a part of a key (if the key contained a colon), where this partial key could
correspond to another valid key.
FixesCantera#525
Cantera version
2.3.0 (via Anaconda)
Operating System
MacOS X
Darwin-16.7.0-x86_64-i386-64bit
Python version
2.7.11 |Anaconda custom (x86_64)| (default, Dec 6 2015, 18:57:58)
[GCC 4.2.1 (Apple Inc. build 5577)]
Preamble
Expected Behavior
Actual Behavior
The difference between the two .cti files is that the
-broken.cti
one contains some species with:
in their names, such asCH2:CHF
andCH2:CF2
, generated using ck2cti on the attached chemkin files, and the working one had all the:
replaced with#
in the chemkin files (also attached) before they were converted to the-working.cti
file.I think the offending line is
https://github.com/Cantera/cantera/blob/master/src/base/stringUtils.cpp#L85
but I wasn't able to figure out on what occasion it was being called to cause this problem.
My guess, from just staring at the code, is that the checks and work-arounds for colons occurring around line 91 of that file (stringUtils.cpp) should happen before the duplicate key check on line 83, which is currently using the uncorrected name that is only what appears before the first colon.
But I can't easily test my theory, so am just reporting it here.
The chemkin and cantera input files are in this Archive.zip
The text was updated successfully, but these errors were encountered: