RMG-Py icon indicating copy to clipboard operation
RMG-Py copied to clipboard

Output Cantera YAML files directly.

Open rwest opened this issue 4 years ago • 6 comments

Motivation or Problem

Currently RMG can only output mechanisms in CHEMKIN format. We then translate them into Cantera's CTI format using the ck2cti script.

  1. Cantera is no longer supporting CTI format, but has switched to a YAML format. (Official release of Cantera 2.5 was last week)
  2. New features coming soon to Cantera (like Blowers Masel kinetics) are not available in CHEMKIN syntax.
  3. Electrochemistry, already in Cantera, uses the YAML format and cannot be translated from CHEMKIN syntax.
  4. The RMS code also reads YAML format (I hope the same flavor of YAML as Cantera?)

Desired Solution

I propose RMG should be able to output Cantera- and RMS-compatible YAML mechanisms directly, rather than only outputting CHEMKIN format.

Potential Alternatives

Invent new pseudo-CHEMKIN syntax for a CHEMKIN code that doesn't exist, and hack Cantera's chemkin-to-yaml script to interpret it into Cantera YAML format, so RMG continues to only output CHEMKIN(ish) mechanisms and use the translator.

Additional Context

Add any other context or screenshots about the feature request here.

rwest avatar Feb 16 '21 19:02 rwest

So RMG already outputs the .rms format without generating Chemkin first. Unfortunately since the Cantera format didn't exist when I made the RMS format it isn't the same format, but I'm planning to shift over to it since it makes it easier to read reactions. I haven't seen the final Cantera yaml format, but I suspect it's pretty similar to the RMS format, with some differences in key names and top level dictionary organization. The yml.py file (that has the .rms output functions) is probably a solid copy paste basis for starting to make a writer for Cantera yaml.

mjohnson541 avatar Feb 16 '21 19:02 mjohnson541

As this is being done, it would be very helpful if the mechanism manipulation tools, e.g. mergemodels.py, were also updated to support manipulation of Cantera YAML files

Is anyone currently working on this issue?

mefuller avatar Oct 07 '21 09:10 mefuller

I don't know of anyone currently working on this Cantera-yaml output.

rwest avatar Oct 08 '21 13:10 rwest

So RMG already outputs the .rms format without generating Chemkin first. Unfortunately since the Cantera format didn't exist when I made the RMS format it isn't the same format, but I'm planning to shift over to it since it makes it easier to read reactions. I haven't seen the final Cantera yaml format, but I suspect it's pretty similar to the RMS format, with some differences in key names and top level dictionary organization. The yml.py file (that has the .rms output functions) is probably a solid copy paste basis for starting to make a writer for Cantera yaml.

@mjohnson541 can I help you push this along? I'm happy to work on this, but I don't want to step on your toes. Getting RMG to handle Cantera YAML natively and also to work on building an import tool for YAML to database entries are pretty integral to some long-term plans of mine. The Cantera YAML info is at https://cantera.org/tutorials/yaml/yaml-format.html

mefuller avatar Oct 24 '21 16:10 mefuller

I'm not working on it right now so feel free to go ahead. The functions here: https://github.com/ReactionMechanismGenerator/RMG-Py/blob/main/rmgpy/yml.py for generating the .rms yaml are probably a pretty good copy-paste starting point for writing the same for the cantera yaml format.

mjohnson541 avatar Oct 24 '21 16:10 mjohnson541

@mefuller, I'm also working on a project where this functionality would be very useful to have. Let me know if you need a reviewer for your PR

sevyharris avatar Nov 04 '21 17:11 sevyharris

This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.

github-actions[bot] avatar Jun 21 '23 22:06 github-actions[bot]