How to add new reaction mechanism yaml files

37 views
Skip to first unread message

Débora Ginara Madeira de Almeida

unread,
May 24, 2024, 3:01:41 PMMay 24
to Cantera Users' Group
Hello, I want to simulate H2/CH4 combustion in cantera, and wanted to add some new reaction mechanism files. However, I cannot find the data file for this. I have searched all over but cannot find it. I have a Mac and am using cantera through anaconda. Does someone have the same situation and can tell me where to find the "data" file for cantera?
Thank you

Dominic Gallegos

unread,
May 24, 2024, 4:10:22 PMMay 24
to Cantera Users' Group
I assume you already have the mechanism files and are just looking for the directory to place them to make them accessible to Cantera? You can import reaction files through the usual means of ct.Solution(path) where path is just the relative path to the .yaml file instead. If you would like to keep them in you Cantera data directory, the path can by found by running the following:

import cantera as ct
print(ct.__file__)

That should point to the __init__.py file for Cantera which will be in the same directory as the data file. I am not sure what would happen to additional files in that directory if you were to update Cantera.

Débora Ginara Madeira de Almeida

unread,
May 27, 2024, 12:43:11 PMMay 27
to Cantera Users' Group
Thank you so much, I had tried inputing the path name but it gave an error so I assumed it didn't work due to the file location, but turns out the problem is with the yaml file I tried using. 
However, now I have another problem: when trying to convert a cti file to yaml in terminal (cti2yaml SanDiego.cti) , I get this error: Input file 'SanDiego.cti' does not exist.
I have even tried to cd into the directory where the cti file is but the function still cannot find it, I don't understand what is wrong.
Reply all
Reply to author
Forward
0 new messages