ck2yaml_demo.ipynb (Source)
Conversion of CHEMKIN Data¶
This notebook illustrates the conversion of CHEMKIN input files to Cantera YAML input files. The conversion utility ck2yaml
is run as a shell command (using the exclamation mark !
magic shortcut).
The YAML files produced with this notebook are close re-recreations of input files that are already included with Cantera; _demo
is added to differentiate from the original YAML files:
GRI-Mech 3.0 derived:
gri30_demo.yaml
h2o2_demo.yaml
air_demo.yaml
argon_demo.yaml
NASA derived:
airNASA9_demo.yaml
nasa_demo.yaml
All CHEMKIN input files are stored in the chemkin
subfolder; the --extra
flag is used to update file descriptions to match YAML files from Cantera 2.5.
Requires: cantera >= 2.5.0
# display ck2yaml help text
! ck2yaml --help
1. YAML files based on GRI-Mech 3.0¶
1.1 Input file gri30.yaml
¶
! ck2yaml --input=chemkin/gri30.inp --thermo=chemkin/gri30_thermo.dat --transport=chemkin/gri30_tran.dat \
--extra=chemkin/gri30_extra.yaml --output=gri30_demo.yaml --name=gri30
1.2 Input file h2o2.yaml
¶
# options for h2o2.yaml
! ck2yaml --input=chemkin/h2o2.inp --transport=chemkin/gri30_tran.dat \
--extra=chemkin/h2o2_extra.yaml --output=h2o2_demo.yaml --name=ohmech
1.3 Input file air.yaml
¶
Notes: The --quiet
option suppresses warnings about unexpected/unused species in thermo data.
# options for air.yaml
! ck2yaml --input=chemkin/air.inp --thermo=chemkin/gri30_thermo.dat --transport=chemkin/gri30_tran.dat \
--extra=chemkin/air_extra.yaml --output=air_demo.yaml --name=air --quiet
1.4 Input file argon.yaml
¶
Notes: The --quiet
option suppresses warnings about unexpected/unused species in thermo data.
# options for argon.yaml
! ck2yaml --input=chemkin/argon.inp --thermo=chemkin/gri30_thermo.dat --transport=chemkin/gri30_tran.dat \
--extra=chemkin/argon_extra.yaml --output=argon_demo.yaml --quiet
2. YAML files based on NASA Thermodynamic databases¶
2.1 Input file nasa.yaml
¶
# options for nasa.yaml (the --permissive suppresses an error due to duplicate thermo entries)
! ck2yaml --thermo=chemkin/nasathermo.dat --output=nasa_demo.yaml --permissive
2.2 Input file airNASA9.yaml
¶
# options for airNASA9.yaml
! ck2yaml --input=chemkin/airNASA9.inp --thermo=chemkin/airDataNASA9.dat --output=airNASA9_demo.yaml --name=airNASA9