首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将化学输入文件转换为cantera格式

将化学输入文件转换为cantera格式
EN

Stack Overflow用户
提问于 2016-05-24 09:03:43
回答 1查看 1.1K关注 0票数 0

我遵循Matlab用户指南网站http://www.cantera.org/docs/sphinx/html/matlab/code-docs/utilities.html将CHEMKIN输入文件转换为Cantera格式,步骤如下

  1. adddir('the directory of chem.inp,therm.dat and tran.dat')
  2. f = ck2cti('chem.inp', 'therm.dat', 'tran.dat')

但是发生了一个错误。

代码语言:javascript
复制
************************************************
                Cantera Error!
************************************************


Procedure: ck2cti
Error:   Error converting input file "chem.inp" to CTI.
Python command was: 'C:\Python34\python.exe'
The exit code was: 7
-------------- start of converter log --------------
Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
  File "C:\Python34\lib\site-packages\cantera\ck2cti.py", line 1899, in convertMech
    raise IOError('Missing input file: {0!r}'.format(inputFile))
OSError: Missing input file: 'chem.inp'
--------------- end of converter log ---------------

error ck2cti (line 47)
iok = ctmethods(0, 1, infile, thermo, transport, idtag, 0, 0);

这个问题有解决办法吗?如有任何答复将不胜感激!

EN

回答 1

Stack Overflow用户

发布于 2016-05-24 09:32:00

Adddir不是内置的matlab函数,您应该使用加法路径 .

因此,它变成:

代码语言:javascript
复制
addpath('the directory of chem.inp,therm.dat and tran.dat')
f = ck2cti('chem.inp', 'therm.dat', 'tran.dat')

还请检查您的文件“chem.inp”是否存在并放置在正确的文件夹中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37408919

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档