Converting San Diego mechanism to YAML

549 views
Skip to first unread message

Michael M

unread,
Apr 20, 2021, 8:39:58 AM4/20/21
to Cantera Users' Group
Hi all,

Im new to Cantera and i use Cantera v2.5.1 and Python v3.9.
Converting the San Diego mechanism (https://web.eng.ucsd.edu/mae/groups/combustion/mechanism.html) to a YAML i got a few error messages.
There are some unexpected species, what to do with them? I want to simulate flame speed for a adiabatic hydrogen flame. In line 222 I didn't find anything conspicuous.

C:\Users\micha>python -m cantera.ck2yaml --input=sandiego20161214_mechCK.txt --thermo=sandiego20160815_therm.txt --transport=sandiego20160815_trans.txt
Skipping unexpected species "JP10" while reading thermodynamics entry.
Skipping unexpected species "CHO" while reading thermodynamics entry.
Skipping unexpected species "C5H8" while reading thermodynamics entry.

ERROR: Unable to parse 'sandiego20160815_therm.txt' near line 222:

Traceback (most recent call last):
  File "C:\Users\micha\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\micha\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\micha\AppData\Local\Programs\Python\Python39\lib\site-packages\cantera\ck2yaml.py", line 2226, in <module>
    main(sys.argv[1:])
  File "C:\Users\micha\AppData\Local\Programs\Python\Python39\lib\site-packages\cantera\ck2yaml.py", line 2187, in main
    parser, surfaces = Parser.convert_mech(input_file, thermo_file,
  File "C:\Users\micha\AppData\Local\Programs\Python\Python39\lib\site-packages\cantera\ck2yaml.py", line 2037, in convert_mech
    parser.load_chemkin_file(thermo_file,
  File "C:\Users\micha\AppData\Local\Programs\Python\Python39\lib\site-packages\cantera\ck2yaml.py", line 1675, in load_chemkin_file
    self.warn('Found additional thermo entry for species {0}. '
  File "C:\Users\micha\AppData\Local\Programs\Python\Python39\lib\site-packages\cantera\ck2yaml.py", line 781, in warn
    raise InputError(message)
__main__.InputError: Found additional thermo entry for species C3H5. If --permissive was given, the first entry is used.
Please check https://cantera.org/tutorials/ck2yaml-tutorial.html#debugging-common-errors-in-ck-files
for the correct Chemkin syntax.

Any help is welcome!

Kind regards
Michael

sandiego20160815_therm.txt
sandiego20161214_mechCK.txt
sandiego20160815_trans.txt

Bryan Weber

unread,
Apr 20, 2021, 10:17:58 AM4/20/21
to Cantera Users' Group
Hi Michael,

The actual error message is shown in the last two lines of the traceback. In this case, there are two definitions of the thermo entry for C3H5, and Cantera isn't sure which to use. This is really common for models in the CK format, especially when the authors copy-paste multiple sources of thermo data together. You can use the "--permissive" flag on the command line to use the first entry in the file. Unfortunately, there's no general way to tell which entry is "correct". You can inspect the file and see if one seems newer, or aligns with other sources of data, but that's not an automated decision that can be made. For what it's worth, the default in CHEMKIN is to take the first entry when duplicates are found.

For more information about reading Python tracebacks, check out this article: https://realpython.com/python-traceback/

Best,
Bryan

Michael M

unread,
Apr 25, 2021, 7:48:20 AM4/25/21
to Cantera Users' Group
Thank you very much, Bryan!
Reply all
Reply to author
Forward
0 new messages