CanteraError

987 views
Skip to first unread message

Amonios Abdelmassih

unread,
Sep 11, 2023, 11:21:19 AM9/11/23
to Cantera Users' Group
Hello everyone, 

I have the version 3.0.0 of Cantera but I have this error (attached) when I run a code with a cti file :

CanteraError thrown by newSolution : 
The CTI and XML formats are no longer supported.

My question is : how do you convert a cti file to an yaml file ? I tried to use the cti2yaml function but I don't understand how it works.
Another question : how can you downgrade a cantera version (from 3.0.0 to 2.6.0 for example) ?

Thank you in advance, 
Amonios
CanteraError.png

Ray Speth

unread,
Sep 11, 2023, 12:19:10 PM9/11/23
to Cantera Users' Group
Hi,

Did you find the documentation for cti2yaml on the Cantera website (https://cantera.org/tutorials/legacy2yaml.html)? What happened when you tried to run it? If there was an error, what was it?

Regards,
Ray

p.s. Please don't post screenshots of text. Copy and paste the actual text into your message so the contents are searchable and accessible to users who may be using assistive devices.

Amonios Abdelmassih

unread,
Sep 11, 2023, 4:18:57 PM9/11/23
to canter...@googlegroups.com
Hi, 

Sorry for the screenshots. The problem is solved ! I just realized that it doesn't work because I used the function cti2yaml directly in the script, but I did this in the anaconda prompt and it worked ! Thank you for your help,

Regards, 
Amonios 

--
You received this message because you are subscribed to a topic in the Google Groups "Cantera Users' Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cantera-users/hqHxQEyW2jc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cantera-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/8deaf86a-ae97-483a-948a-59290addec2fn%40googlegroups.com.

AsadAli Kalyan

unread,
Sep 23, 2023, 2:46:33 PM9/23/23
to Cantera Users' Group
Hello Cantera users,

I'm new to Cantera, so perhaps I'm making a rooky mistake.  I'm attempting to convert a .cti file to a .yaml using the cti2yaml converter utility. 

I used the following code, based on the documentation on the Cantera website:
cti2yaml [CERFACS_2step_propane.cti] [CERFACS_2step_propane.yaml]

And, got the following error:
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-18-46387767fd5b> in <cell line: 1>() ----> 1 cti2yaml [CERFACS_2step_propane.cti] [CERFACS_2step_propane.yaml] NameError: name 'cti2yaml' is not defined

I also attempted the following variation:
python -m cti2yaml [CERFACS_2step_propane.cti] [CERFACS_2step_propane.yaml]

And got the following error:
File "<ipython-input-19-fbb4d1d64eb3>", line 1 python -m cti2yaml [CERFACS_2step_propane.cti] [CERFACS_2step_propane.yaml] ^ SyntaxError: invalid syntax

For additional context, I'm running using Colab, and installed Cantera using pip.

Thanking you in advance for your help. 
-Asad

Andrius Ambrutis

unread,
Sep 23, 2023, 9:06:30 PM9/23/23
to Cantera Users' Group
In cmd in path:
python -m cantera.cti2yaml Mevel2017.cti

Result:
Wrote YAML mechanism file to 'Mevel2017.yaml'.
Mechanism contains 14 species and 1 reactions.
Validating mechanism...
PASSED
This is how I wrote for hydrogen mechanism.

AsadAli Kalyan

unread,
Sep 25, 2023, 9:18:39 AM9/25/23
to Cantera Users' Group
Thank you.  Here's the script that worked in jupyter  notebooks:

! cti2yaml CERFACS_2step_propane.cti


Results:
Wrote YAML mechanism file to 'CERFACS_2step_propane.yaml'. Mechanism contains 6 species and 1 reactions. Validating mechanism... PASSED
The cti2yaml file must also be in the same directory as the input files.
Screenshot 2023-09-25 003040.png

Ingmar Schoegl

unread,
Sep 25, 2023, 10:23:13 AM9/25/23
to Cantera Users' Group
Happy to hear that you were able to convert the mechanism.

Regarding the comment that "The cti2yaml file must also be in the same directory as the input files." this isn't true. As long as you have Cantera properly installed in your environment (in case you use a virtual environment, it needs to be activated as well), the converter scripts should work in any location.

-is-

Reply all
Reply to author
Forward
0 new messages