我按照网站http://www.cantera.org/docs/sphinx/html/matlab/code-docs/utilities.html上的Matlab界面用户指南将CHEMKIN输入文件转换为Cantera格式,步骤为
adddir('the directory of chem.inp,therm.dat and tran.dat')
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);
这个问题有解决方案吗?任何回复将不胜感激!
答案 0 :(得分:0)
Adddir不是内置的matlab函数,你应该使用addpath代替。
所以它变成了:
addpath('the directory of chem.inp,therm.dat and tran.dat')
f = ck2cti('chem.inp', 'therm.dat', 'tran.dat')
还要检查您的文件&#39; chem.inp&#39;存在并放在正确的文件夹中。