hyuancombustion的个人博客分享 http://blog.sciencenet.cn/u/hyuancombustion

博文

Convert Chemkin mechanism to Cantera format by "ck2cti"

已有 7063 次阅读 2014-10-9 18:54 |系统分类:科研笔记

Cantera is a free and powerful tool in terms of solving chemical kinetics, thermodynamics, and transport processes. Although Cantera is not as fast as Chemkin whose algorithm has been optimized for commercial application, the interface provided by Cantera efficiently couples itself with user developed functions or solvers. However, the chemical mechanisms developed by well-known groups (LLNL, Milano and Nancy) are mostly in Chemkin format which is not readable for Cantera. Before using Cantera, the chemical kinetics has to be changed into Cantera format.


Cantera did release the tutorial "Working with input files" which, however, didn't give many details on how to convert mechanism format. The offical tutorail link is listed below.

http://cantera.github.io/docs/sphinx/html/matlab/input-tutorial.html


Ideally, the function ck2cti converts the kinetic and thermodynamic data of Chemkin into the Cantera format. However, an error message: "invalid literal for float(): 0.0000+03" pops up when trying to convert LLNL's gasoline mechanism. The error is due to the abnormal value format 0.0000+03 which cannot be recognized by the function. To fix this problem, please replace all 0.0000+03 to 0.00 which gives correct input format for the function.


The first type of error is essentially from kinetic file, however, thermodynamic data file also has its own problem. In the thermo file, every species contain four lines information and a number (from 1 to 4) is specified at the end of each line. For some lines, the number disappears, which leads to error 2. Add all those missing number will fix this problem.



After fixing the above problems, the cti file, which is accessible to Cantera, is generated by the function ck2cti. In order to minimize loading time, it is recommended to convert cti to xml file with importPhase command. However, this process leads to the third error, since Cantera doesn't allow zero pre-exponential factor. Cantera believes if the pre-exponential factor of a certain elementary reaction is zero, there is no need to list this elementary reaction because the rate constant is zero. Sometimes it is not possible to delete all elementary reactions with zero rate constants due to the large number involved. Instead of deleting all problematic reactions, change zero pre-exponential factor to a really small number, like o.oooo1E-99, will get rid of this error message. Since the modified number is too small to affect the overall reactivity, it is a rigorous approximation for solving problems.



The convertion was carried out in Matlab 2014a with Cantera 2.1 and Python 2.7.



https://wap.sciencenet.cn/blog-1253082-834328.html

上一篇:The blend of gasoline surrogate mechanism and NO mechanism
收藏 IP: 139.216.226.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-14 17:47

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部