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
Merge pull request #2800 to add native Cantera YAML writing
See #2800 for details.
Enable in your options block with:
generateCanteraYAML1=True,
generateCanteraYAML2=True,
Or customize with settings like:
generateChemkin={'saveInterval': 1, 'saveEdge': False},
generateRMSYAML={'saveInterval': 5},
generateCanteraYAML1={'saveInterval': 5, 'saveEdge':True},
generateCanteraYAML2={'saveInterval': 5, 'saveEdge':False, 'verboseComments':True},
See provided examples and documentation for more.
Copy file name to clipboardExpand all lines: documentation/source/users/rmg/input.rst
+82-6Lines changed: 82 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1073,13 +1073,17 @@ Miscellaneous options::
1073
1073
units='si',
1074
1074
generateOutputHTML=True,
1075
1075
generatePlots=False,
1076
-
generatePESDiagrams=False,
1076
+
generatePESDiagrams=False,
1077
1077
saveSimulationProfiles=True,
1078
1078
verboseComments=False,
1079
1079
saveEdgeSpecies=True,
1080
1080
keepIrreversible=True,
1081
1081
trimolecularProductReversible=False,
1082
-
saveSeedModulus=-1
1082
+
saveSeedModulus=-1,
1083
+
generateChemkin=True,
1084
+
generateRMSYAML=True,
1085
+
generateCanteraYAML1=False,
1086
+
generateCanteraYAML2=False,
1083
1087
)
1084
1088
1085
1089
The ``name`` field is the name of any generated seed mechanisms
@@ -1090,25 +1094,97 @@ Setting ``saveSeedToDatabase`` to ``True`` tells RMG (if generating a seed) to a
1090
1094
1091
1095
The ``units`` field is set to ``si``. Currently there are no other unit options.
1092
1096
1093
-
Setting ``generateOutputHTML`` to ``True`` will let RMG know that you want to save 2-D images (png files in the local ``species`` folder) of all species in the generated core model. It will save a visualized
1094
-
HTML file for your model containing all the species and reactions. Turning this feature off by setting it to ``False`` may save memory if running large jobs.
1097
+
Setting ``generateOutputHTML`` to ``True`` will let RMG know that you want to save 2-D images (png files in the local ``species`` folder) of all species in the generated core model.
1098
+
It will save a visualized HTML file for your model containing all the species and reactions.
1099
+
Turning this feature off by setting it to ``False`` may save memory if running large jobs.
1100
+
It can be configured using a dictionary of settings in place of the ``True`` statement, as described below.
1095
1101
1096
1102
Setting ``generatePlots`` to ``True`` will generate a number of plots describing the statistics of the RMG job, including the reaction model core and edge size and memory use versus execution time. These will be placed in the output directory in the plot/ folder.
1097
1103
1098
1104
Setting ``generatePESDiagrams`` to ``True`` will generate potential energy surface diagrams for each pressure dependent network in the model. These diagrams will be saved in the ``pdep/`` folder in the output directory. Only applicable if pressure dependence is enabled.
1099
1105
1100
1106
Setting ``saveSimulationProfiles`` to ``True`` will make RMG save csv files of the simulation in .csv files in the ``solver/`` folder. The filename will be ``simulation_1_26.csv`` where the first number corresponds to the reaciton system, and the second number corresponds to the total number of species at the point of the simulation. Therefore, the highest second number will indicate the latest simulation that RMG has complete while enlarging the core model. The information inside the csv file will provide the time, reactor volume in m^3, as well as mole fractions of the individual species.
1101
1107
1102
-
Setting ``verboseComments`` to ``True`` will make RMG generate chemkin files with complete verbose commentary for the kinetic and thermo parameters. This will be helpful in debugging what values are being averaged for the kinetics. Note that this may produce very large files.
1108
+
Setting ``verboseComments`` to ``True`` will make RMG generate chemkin files with complete verbose commentary for the kinetic and thermo parameters. This will be helpful in debugging what values are being averaged for the kinetics. Note that this may produce very large files. This is a global fallback; individual writers can override it (see below).
1103
1109
1104
-
Setting ``saveEdgeSpecies`` to ``True`` will make RMG generate chemkin files of the edge reactions in addition to the core model in files such as ``chem_edge.inp`` and ``chem_edge_annotated.inp`` files located inside the ``chemkin`` folder. These files will be helpful in viewing RMG's estimate for edge reactions and seeing if certain reactions one expects are actually in the edge or not.
1110
+
Setting ``saveEdgeSpecies`` to ``True`` will make RMG generate chemkin files of the edge reactions in addition to the core model in files such as ``chem_edge.inp`` and ``chem_edge_annotated.inp`` files located inside the ``chemkin`` folder. These files will be helpful in viewing RMG's estimate for edge reactions and seeing if certain reactions one expects are actually in the edge or not. This is a global fallback; individual writers can override it (see below).
1105
1111
1106
1112
Setting ``keepIrreversible`` to ``True`` will make RMG import library reactions as is, whether they are reversible or irreversible in the library. Otherwise, if ``False`` (default value), RMG will force all library reactions to be reversible, and will assign the forward rate from the relevant library.
1107
1113
1108
1114
Setting ``trimolecularProductReversible`` to ``False`` will not allow families with three products to react in the reverse direction. Default is ``True``.
1109
1115
1110
1116
Setting ``saveSeedModulus`` to ``-1`` will only save the seed from the last iteration at the end of an RMG job. Alternatively, the seed can be saved every ``n`` iterations by setting ``saveSeedModulus`` to ``n``.
1111
1117
1118
+
Per-writer Output Configuration
1119
+
--------------------------------
1120
+
1121
+
Each of the following options controls a separate output-format writer.
1122
+
Each accepts ``True``, ``False``, or a Python dict with optional keys:
1123
+
1124
+
* ``'saveInterval'`` *(int)* — positive N writes every N iterations (iteration
1125
+
numbering starts at 0); ``-1`` writes only at the very end of the run.
1126
+
Defaults to ``1`` (every iteration) for writers that are on by default.
1127
+
* ``'verboseComments'`` *(bool, optional)* — overrides the global
1128
+
``verboseComments`` flag for this writer only.
1129
+
* ``'saveEdge'`` *(bool, optional)* — overrides the global ``saveEdgeSpecies``
1130
+
flag for this writer only.
1131
+
1132
+
Examples::
1133
+
1134
+
# Chemkin: save only at the end, with verbose comments and edge species
Copy file name to clipboardExpand all lines: documentation/source/users/rmg/output.rst
+95-5Lines changed: 95 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,17 @@
4
4
Analyzing the Output Files
5
5
**************************
6
6
7
-
You will see that a sucessfully executed RMG job will create multiple output files and folders:
7
+
You will see that a sucessfully executed RMG job will create multiple output files and folders:
8
8
``output.html`` (if ``generateOutputHTML=True`` is specified)
9
+
``/cantera_from_ck``
10
+
``/cantera1`` (if ``generateCanteraYAML1=True`` is specified)
11
+
``/cantera2`` (if ``generateCanteraYAML2=True`` is specified)
9
12
``/chemkin``
10
-
``/pdep``
13
+
``/pdep``
11
14
``/plot``
15
+
``/rms``
12
16
``/solver``
13
-
``/species``
17
+
``/species``
14
18
``RMG.log``
15
19
16
20
------------------
@@ -39,6 +43,92 @@ network.
39
43
40
44
------------------
41
45
The Solver Folder
42
-
------------------
43
-
RMG currently includes a solver for isothermal batch reactors. This is in fact a critical part of the model enlargement algorithm. If you have included simulations in your input file, the solutions will be located in ``/solver``. You will probably only be interested in the files with the largest number tags.
46
+
------------------
47
+
RMG currently includes a solver for isothermal batch reactors. This is in fact a critical part of the model enlargement algorithm. If you have included simulations in your input file, the solutions will be located in ``/solver``. You will probably only be interested in the files with the largest number tags.
44
48
Please note that up to and including RMG-Py version 2.3.0 these files showed mole fraction of each species at each step, but they now show amount (number of moles) of each species; you must divide by the sum if you wish to get a mole fraction.
49
+
50
+
------------------------------
51
+
Cantera Output Folders
52
+
------------------------------
53
+
54
+
RMG can write mechanisms in `Cantera <https://cantera.org>`_ YAML format via three distinct
55
+
routes, producing up to three output folders. All three require Cantera to be installed in
56
+
the conda environment (it is included in the standard ``rmg_env``).
57
+
58
+
``/cantera_from_ck``
59
+
^^^^^^^^^^^^^^^^^^^^
60
+
61
+
This folder is always produced when the Chemkin writer is enabled (``generateChemkin=True``, the default).
62
+
After the final RMG iteration, Cantera's own ``ck2yaml`` converter is used to translate the Chemkin-format files in ``/chemkin`` into Cantera YAML.
63
+
This is the most thoroughly tested route and is the recommended output for production use.
64
+
65
+
``/cantera1`` *(beta)*
66
+
^^^^^^^^^^^^^^^^^^^^^^
67
+
68
+
.. note::
69
+
70
+
The ``cantera1`` writer is in **beta**. It uses the Cantera Python API to construct and
71
+
serialise the mechanism YAML, rather than writing the YAML by hand. It has been less
72
+
extensively tested than the ``cantera_from_ck`` route. Please report any discrepancies.
73
+
74
+
This folder is created when ``generateCanteraYAML1=True`` is set in the ``options()`` block
75
+
(disabled by default). The writer runs after every RMG iteration (or on the schedule set by
76
+
``saveInterval``), so the folder accumulates a history of the growing mechanism.
77
+
78
+
Files generated:
79
+
80
+
* ``chem{NNNN}.yaml`` — mechanism snapshot at the iteration when the core contained *NNNN*
81
+
species (e.g. ``chem0042.yaml``)
82
+
* ``chem.yaml`` — copy of the latest snapshot; always reflects the current model state
83
+
* ``chem_annotated.yaml`` — annotated version with SMILES, source, and kinetics comments
84
+
(written when ``verboseComments=True`` for this writer)
0 commit comments