CanteraError thrown by Factory::canonicalize

268 views
Skip to first unread message

Julian Esteban Obando Arbelaez

unread,
Jul 10, 2021, 12:17:10 PM7/10/21
to Cantera Users' Group
Hello everybody, 

I am new using Cantera, my versión is 2.5.1 in Python

I am trying to read an xml file from my folder, but Cantera shows the following error. 

For gri30:
CanteraError: 
***********************************************************************
CanteraError thrown by Factory::canonicalize:
No such type: 'gri30'
***********************************************************************

For sankaran13:
***********************************************************************
CanteraError thrown by Factory::canonicalize:
No such type: 'sankaran13'
***********************************************************************


When I work with gri3.0, I can load the file from the database from Cantera, but sankaran13 and lulawana19 are not in my folder. 

CanteraError: 
***********************************************************************
CanteraError thrown by Application::findInputFile:
Input file sankaran13.yaml not found in directories 


Is there any option to load my own file and not the factory default?

Thanks

Bryan Weber

unread,
Jul 10, 2021, 2:18:29 PM7/10/21
to Cantera Users' Group
Hi,

I'm sorry that you're getting these errors. Can you please attach your script any any input files? It's a little hard to help without that information.

Best,
Bryan

Julian O

unread,
Jul 12, 2021, 9:05:29 PM7/12/21
to Cantera Users' Group
Hi, Bryan 

These lines are only to check the mechanism loading. Then I will use it for flame temperature and laminar flame speed. 

gri30.yaml is in the library of Cantera. 
LU17.xml loads correctly.
LU13.xml tells to call "sankaran13"
LU19.xml tells to call"lulawana19"

My question is: How can I force Cantera to load my own file?

#### CODE
import cantera as ct
MECH_LIST=['gri30.yaml','LU17.xml','LU13.xml','LU19.xml']
for MECH in MECH_LIST:
    gas=ct.Solution(MECH)
    print(MECH, 'has', len(gas.species()), 'species and', len(gas.reaction_equations()),'reactions' )
### END CODE

Thanks
LU17.xml
LU13.xml
mech_check.py
LU19.xml

Bryan Weber

unread,
Jul 12, 2021, 9:09:46 PM7/12/21
to Cantera Users' Group
Hi Julian,

The problem is that Cantera does not know about the "LULUWANA19" and "SANKARAN13" kinetics models. In Cantera, a Kinetics model provides a means to convert reaction rate parameters, concentrations, and activities into species production rates. So you need to provide classes (in C++) that implement these two kinetics models if you want to use these XML files.

If you can explain some more about your application or where you got these XML files, I'd be happy to help further.

Best,
Bryan 

Julian O

unread,
Jul 12, 2021, 9:48:26 PM7/12/21
to Cantera Users' Group

Hi Bryan, 

First, for my application, I would like to use different kinetics models to make a comparison for laminar flame speed prediction. 

In order to take into account, why LU17.xml file work correctly and the others could not (LU13 and LU19)? I guess that the error is due to factory load permissions. For Example, try to load this GRI3.0.xml file and Cantera will tell you that exists a factory default gri30.yaml

On the other hand, Gri3.0  files for mech, thermo and transport data were  obtained from:


LU13, LU17, and LU19  files for mech, thermo and transport were  obtained from:  


All of these then were converted into Catera to a .xml file. 

Thanks 
GRI3.0.xml

Bryan Weber

unread,
Jul 13, 2021, 2:23:51 PM7/13/21
to Cantera Users' Group
Hi Julian,

The key is this XML tag: <kinetics model="GasKinetics"/> (that's from LU17.xml) and <kinetics model="SANKARAN13"/> (that's from LU13.xml). The first one tells Cantera to use the "GasKinetics" model, which it knows how to do. The other tells Cantera to use the SANKARAN13 model, which is not implemented. The kinetics tag does not have to do with the name of the file, or the name of the mechanism. It only has to do with how Cantera computes the species production rates, so you must leave it as a name that Cantera understands.

If you are manually editing that tag, you don't need to do that. If that's the output from Cantera after converting from the Chemkin input files, can you please specify exactly which files from Prof. Lu's page that you downloaded? Also, can you please convert them to YAML (using ck2yaml) and see if the same problem occurs?

Thanks!
Bryan

Julian O

unread,
Jul 13, 2021, 9:50:31 PM7/13/21
to Cantera Users' Group
Hi Bryan again, sincerely thank you for all your help.

I have repeated the procedure for GRI3.0 for the conversión, as you indicate to me using ck2yaml and it is working now for GRI3.0. 

Now, for LU13 (https://www.cerfacs.fr/cantera/docs/mechanisms/methane-air/ARC/CANTERA/LU13.cti) and LU19 (https://www.cerfacs.fr/cantera/docs/mechanisms/methane-air/ARC/CANTERA/LU19_GRI30.cti),  I made a mistake, I have gotten the files from CERFACS-CANTERA and, in effect, They use different "kinetics model"  keywords as you mentioned for example "sankaran13" (image attached and URL: http://www.cerfacs.fr/cantera/docs/short_notes/list-hard-coded.pdf). 

Finally, from the original files of the author Dr. Tiafeng Lu are: 
* chem.inp
* ckwyp.f
* therm.dat
* tran.dat

And I am having problems loading it, so I don't know how to call the reactions file (ckwyp.f), due to Dr. Tiafeng Lu indicates how to incorporate the reactions file in Chemkin.

If you wish, I can open another request because I found the solution to the problem of this subject (CanteraError thrown by Factory::canonicalize). 

Sorry for the inconvenience, and thank you very much again. 

Bryan Weber

unread,
Jul 14, 2021, 11:19:01 AM7/14/21
to Cantera Users' Group
Hi Julian,

I'm glad that solved your issues there. Unfortunately, Cantera doesn't directly support the method that Prof. Lu uses for the reduced mechanisms, in that the "ckwyp.f" file specifies directly how to compute the reaction rates, usually for certain quasi-equilibrium reactions. There was some previous work on this issue, and we found that the QSSA didn't provide that much speed up on certain problems, see here: https://github.com/Cantera/cantera/pull/437

Best,
Bryan

Julian O

unread,
Jul 15, 2021, 2:20:18 PM7/15/21
to Cantera Users' Group
Thank you very much Bryan for all your help
Reply all
Reply to author
Forward
0 new messages