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

ck2yaml in v3 can't convert the same files as v2 #1845

Open
JacksonBurns opened this issue Jan 29, 2025 · 2 comments
Open

ck2yaml in v3 can't convert the same files as v2 #1845

JacksonBurns opened this issue Jan 29, 2025 · 2 comments

Comments

@JacksonBurns
Copy link

Problem description

ck2yaml in Cantera 2.6.0 is able to convert my chemkin files, but 3.1.0 cannot

Steps to reproduce

The chem-gas.inp and chem-surface.inp files are attached to this issue:

demo.zip

and are also here: https://github.com/ReactionMechanismGenerator/RMG-Py/tree/a041fdeca81bf1ac6c56c3889a1c448707f55514/test/rmgpy/test_data/chemkin/chemkin_py/surface

I made two conda environments with cantera 2.6.0 (conda create --name cantera2 "python==3.9.*" "conda-forge::cantera<3") and 3.1.0 (conda create --name cantera3 "python==3.9.*" "conda-forge::cantera>2") and then run the following commands:

  • conda run --name cantera2 ck2yaml --input chem-gas.inp --surface chem-surface.inp
  • conda run --name cantera3 ck2yaml --input chem-gas.inp --surface chem-surface.inp

Behavior

v2 works:

$ conda run --name cantera2 ck2yaml --input chem-gas.inp --surface chem-surface.inp 
Wrote YAML mechanism file to 'chem-gas.yaml'.
Mechanism contains 6 species and 4 reactions.
Validating mechanism...
PASSED

but v3 says this:

conda run --name cantera3 ck2yaml --input chem-gas.inp --surface chem-surface.inp 
*******************************************************************************
Error while reading SITE section in chem-surface.inp starting on line 9:
"""
SITE   SDEN/2.4830E-09/ ! mol/cm^2
"""
SITE section defined with no site density
*******************************************************************************
Unable to convert mechanism due to errors. Please check
https://cantera.org/stable/userguide/ck2yaml-tutorial.html#debugging-common-errors-in-ck-files
for the correct Chemkin syntax.

ERROR conda.cli.main_run:execute(125): `conda run ck2yaml --input chem-gas.inp --surface chem-surface.inp` failed. (See above for error)

System information

  • Cantera version: 2.6.0 and 3.1.0
  • OS: Ubuntu 22.04
  • Python/MATLAB/other software versions: python 3.9.21 in both cases

Attachments

Included in line above.

Additional context

I'm a developer of RMG and this came up when attempting to upgrade from Cantera 2 to 3 in this PR: ReactionMechanismGenerator/RMG-Py#2751

@JacksonBurns
Copy link
Author

cc @sevyharris who was helping me with this as well and may be interested in this

@JacksonBurns
Copy link
Author

Apologies for spam but I forgot to mention -

If I change the offending line from:

SITE   SDEN/2.4830E-09/ ! mol/cm^2
    X
    HX
	OX
	CH4X
    CH2OX2/2/
    CHOX3/3/
END

to

SITE/site0/   SDEN/2.4830E-09/ ! mol/cm^2
    X
    HX
	OX
	CH4X
    CH2OX2/2/
    CHOX3/3/
END

Then both versions work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant