diff --git a/.gitignore b/.gitignore index 1809c47..95c4514 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .vscode/ *.nbconvert.ipynb reactors/reaction_paths.* +input/*.yaml diff --git a/input/ck2yaml_demo.ipynb b/input/ck2yaml_demo.ipynb index 5902867..d864334 100644 --- a/input/ck2yaml_demo.ipynb +++ b/input/ck2yaml_demo.ipynb @@ -8,7 +8,7 @@ "\n", "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). \n", "\n", - "The YAML files produced with this notebook are close re-recreations of Cantera input files; `_demo` is added to differentiate from the original YAML files:\n", + "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:\n", "\n", "**GRI-Mech 3.0 derived:**\n", " * `gri30_demo.yaml`\n", @@ -34,44 +34,44 @@ "name": "stdout", "output_type": "stream", "text": [ - "\r\n", - "ck2yaml.py: Convert Chemkin-format mechanisms to Cantera YAML input files\r\n", - "\r\n", - "Usage:\r\n", - " ck2yaml [--input=]\r\n", - " [--thermo=]\r\n", - " [--transport=]\r\n", - " [--surface=]\r\n", - " [--name=]\r\n", - " [--extra=]\r\n", - " [--output=]\r\n", - " [--permissive]\r\n", - " [--quiet]\r\n", - " [--no-validate]\r\n", - " [-d | --debug]\r\n", - "\r\n", - "Example:\r\n", - " ck2yaml --input=chem.inp --thermo=therm.dat --transport=tran.dat\r\n", - "\r\n", - "If the output file name is not given, an output file with the same name as the\r\n", - "input file, with the extension changed to '.yaml'.\r\n", - "\r\n", - "An input file containing only species definitions (which can be referenced from\r\n", - "phase definitions in other input files) can be created by specifying only a\r\n", - "thermo file.\r\n", - "\r\n", - "For the case of a surface mechanism, the gas phase input file should be\r\n", - "specified as 'input' and the surface phase input file should be specified as\r\n", - "'surface'.\r\n", - "\r\n", - "The '--permissive' option allows certain recoverable parsing errors (e.g.\r\n", - "duplicate transport data) to be ignored. The '--name=' option\r\n", - "is used to override default phase names (i.e. 'gas').\r\n", - "\r\n", - "The '--extra=' option takes a YAML file as input. This option can be\r\n", - "used to add to the file description, or to define custom fields that are\r\n", - "included in the YAML output.\r\n", - "\r\n" + "\n", + "ck2yaml.py: Convert Chemkin-format mechanisms to Cantera YAML input files\n", + "\n", + "Usage:\n", + " ck2yaml [--input=]\n", + " [--thermo=]\n", + " [--transport=]\n", + " [--surface=]\n", + " [--name=]\n", + " [--extra=]\n", + " [--output=]\n", + " [--permissive]\n", + " [--quiet]\n", + " [--no-validate]\n", + " [-d | --debug]\n", + "\n", + "Example:\n", + " ck2yaml --input=chem.inp --thermo=therm.dat --transport=tran.dat\n", + "\n", + "If the output file name is not given, an output file with the same name as the\n", + "input file, with the extension changed to '.yaml'.\n", + "\n", + "An input file containing only species definitions (which can be referenced from\n", + "phase definitions in other input files) can be created by specifying only a\n", + "thermo file.\n", + "\n", + "For the case of a surface mechanism, the gas phase input file should be\n", + "specified as 'input' and the surface phase input file should be specified as\n", + "'surface'.\n", + "\n", + "The '--permissive' option allows certain recoverable parsing errors (e.g.\n", + "duplicate transport data) to be ignored. The '--name=' option\n", + "is used to override default phase names (i.e. 'gas').\n", + "\n", + "The '--extra=' option takes a YAML file as input. This option can be\n", + "used to add to the file description, or to define custom fields that are\n", + "included in the YAML output.\n", + "\n" ] } ], @@ -91,9 +91,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 1.1 Input file `gri30.yaml`\n", - "\n", - "> **Notes:** `gri30.inp` uses the final version of GRI30.mech (slightly different from Cantera 2.4, and updated for 2.5), other CHEMKIN input is identical to files distributed with Cantera 2.4 (see `data` folder); output does not contain phases marked as `deprecated` in 2.5." + "### 1.1 Input file `gri30.yaml`" ] }, { @@ -121,9 +119,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 1.2 Input file `h2o2.yaml`\n", - "\n", - "> **Notes:** CHEMKIN input is identical to files distributed with Cantera 2.4 (see `data` folder)." + "### 1.2 Input file `h2o2.yaml`" ] }, { @@ -135,10 +131,10 @@ "name": "stdout", "output_type": "stream", "text": [ - "Wrote YAML mechanism file to 'h2o2_demo.yaml'.\r\n", - "Mechanism contains 9 species and 28 reactions.\r\n", - "Validating mechanism...\r\n", - "PASSED\r\n" + "Wrote YAML mechanism file to 'h2o2_demo.yaml'.\n", + "Mechanism contains 9 species and 28 reactions.\n", + "Validating mechanism...\n", + "PASSED\n" ] } ], @@ -154,7 +150,7 @@ "source": [ "### 1.3 Input file `air.yaml`\n", "\n", - "> **Notes:** CHEMKIN input is identical to files distributed with Cantera 2.4 (see `data` folder); the default composition is not set. The `--quiet` option suppresses warnings about unexpected/unused species in thermo data)." + "**Notes:** The `--quiet` option suppresses warnings about unexpected/unused species in thermo data." ] }, { @@ -174,7 +170,7 @@ "source": [ "### 1.4 Input file `argon.yaml`\n", "\n", - "> **Notes:** CHEMKIN input is identical to files distributed with Cantera 2.4 (see `data` folder); YAML output does not contain the `deprecated` field added in Cantera 2.5. The `--quiet` option suppresses warnings about unexpected/unused species in thermo data)." + "**Notes:** The `--quiet` option suppresses warnings about unexpected/unused species in thermo data." ] }, { @@ -199,9 +195,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 2.1 Input file `nasa.yaml`\n", - "\n", - "> **Notes:** CHEMKIN input is identical to `data/thermo/nasathermo.dat` distributed with Cantera 2.4, except for moving the `THERMO` block to ensure correct parsing of the file description." + "### 2.1 Input file `nasa.yaml`" ] }, { @@ -233,9 +227,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 2.2 Input file `airNASA9.yaml`\n", - "\n", - "> **Notes:** CHEMKIN input is identical to `data/thermo/airDataNASA9.dat` distributed with Cantera 2.4." + "### 2.2 Input file `airNASA9.yaml`" ] }, { @@ -247,30 +239,22 @@ "name": "stdout", "output_type": "stream", "text": [ - "Wrote YAML mechanism file to 'airNASA9_demo.yaml'.\r\n", - "Mechanism contains 11 species and 0 reactions.\r\n", - "Validating mechanism...\r\n", - "PASSED\r\n" + "Wrote YAML mechanism file to 'airNASA9_demo.yaml'.\n", + "Mechanism contains 11 species and 0 reactions.\n", + "Validating mechanism...\n", + "PASSED\n" ] } ], "source": [ "# options for airNASA9.yaml\n", - "! ck2yaml --input=chemkin/airNASA9.inp --thermo=chemkin/airDataNASA9.dat \\\n", - "--output=airNASA9_demo.yaml --name=airNASA9" + "! ck2yaml --input=chemkin/airNASA9.inp --thermo=chemkin/airDataNASA9.dat --output=airNASA9_demo.yaml --name=airNASA9" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -284,9 +268,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.9.10" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }