【问题标题】:Convert a chemkin input file to cantera format将 chemkin 输入文件转换为 cantera 格式
【发布时间】:2016-05-24 09:03:43
【问题描述】:

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

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

  2. f = ck2cti('chem.inp', 'therm.dat', 'tran.dat')

但是发生了错误。

************************************************
                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);

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

【问题讨论】:

    标签: matlab cantera


    【解决方案1】:

    Adddir 不是 matlab 内置函数,您应该改用addpath

    所以变成了:

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

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

    【讨论】:

    • 感谢您的回复!我试过这个方法:addpath('C:\Python34\lib\site-packages\cantera'), f = ck2cti('chem.inp', 'therm.dat', 'tran.dat')。并且 chem.inp、therm.dat 和 tran.dat 被放置在文件夹 'C:\Python34\lib\site-packages\cantera' 中,但同样发生了同样的错误。我不知道为什么。
    • 所以这可能是您的图书馆的问题。因此,只需尝试将您的文件移动到 matlab 的工作目录中。好像是ck2cti.py打不开你的新路径。
    猜你喜欢
    • 1970-01-01
    • 2019-10-07
    • 2014-04-02
    • 2012-08-31
    • 1970-01-01
    • 1970-01-01
    • 2019-12-16
    • 2021-10-15
    • 2018-11-16
    相关资源
    最近更新 更多