필터 지우기
필터 지우기

How can I run Cantera functions on .cti files in MATLAB?

조회 수: 37 (최근 30일)
David
David 2021년 8월 27일
답변: David 2021년 8월 27일
I am mostly asking this question so I can answer it for the next person who has this problem, though I still don't really understand what is going on. After installing Cantera, Python, and Cantera's MATLAB toolbox, the Cantera test functions that involve .yaml files seem to work, but as soon as I try to run any function on a .cti file MATLAB hangs for a very long time (and force quit doesn't seem to work). The functions that have this problem include Solution(), ThermoPhase(), and ctmethods().

채택된 답변

David
David 2021년 8월 27일
Cantera 2.5 and Python 3.7 seem like they are supposed to be compatible with .cti files, but starting in Cantera 2.5 .cti files are obsolete. The best solution I found is to convert .cti files to .yaml files, the new recommended chemistry file format. At least on my system, all of these functions perform well on .yaml files. You can test this with the files that come with the Cantera installation (Program Files/Cantera/data for the standard installation).
To complicate things further, Cantera's MATLAB toolbox does not include the cti2yaml function (or apparently the ck2yaml function). My solution was to find the Python function cti2yaml.py (installed with Cantera) and use Python to create the desired .yaml file. Now all those MATLAB functions run quickly on the .yaml file with no hangs. For converting Chemkin files, the MATLAB toolbox has ck2cti.m, then the process above can convert cti to yaml.
This is mostly a Cantera problem, but it seems unique to running Cantera in MATLAB.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by