Note: remember to change the file access permission if you have a problem like:
************************************************
Cantera Error!
************************************************
Procedure: ct2ctml
Error: could not convert input file to CTML.
=== repost from http://web.mit.edu/2.62/www/cantera/install.html ===
Installing Cantera for Windows
- Install Python
- Go to python.org.
- 32-bit: Download the most recent "Windows installer" for Python 2.6.
- 64-bit: Download the most recent "Windows X86-64 installer" for Python 2.6.
- Run the installer. The default installation options should be fine.
- Install NumPy
- 32-bit: Go to the NumPy download page.
- 64-bit: Go to the Unofficial Windows Binaries for Python Extension Packages page.
- Download the most recent release of the 1.x series for Python 2.6.
- Run the installer.
- Install Cantera
- 32-bit: Download Cantera-1.8.r444-x86.msi.
- 64-bit: Download Cantera-1.8.r444-amd64.msi.
- Run the installer.
- Be sure to complete the installation of the Cantera Python module as well.
- Configure Matlab (optional)
- Launch Matlab
- Go to File-<Set Path...
- Select Add with Subfolders
- Browse to the folder c:\Program Files\Cantera\MATLAB\toolbox\cantera
- Select Save, then Close.
- Set the environment variable PYTHON_CMD
- This step is not necessary if you are using only the Python module.
- Right-click My Computer, select Properties
- Go to the Advanced tab.
- Select Environment Variables.
- Add a New variable with PYTHON_CMD as the name and the full path to the Python executable (e.g. c:\python26\python.exe) as the value.
- Create the nasa_gas.xml file
- Option 0: At a Python prompt, type:
import Cantera, os
os.chdir('c:/Program Files/cantera/data')
Cantera.Solution('nasa_gas.cti')
- Option 1: At the Matlab prompt, type:
cd 'c:\Program Files\cantera\data'
Solution('nasa_gas.cti')
- This will give an error (Procedure: xml_findByName; Error: name phase not found), but it should produce the file nasa_gas.xml in the current directory.
- This allows you to use any of the species specified in nasa_gas.cti in any of your .cti files.
- Test the installation
- Python:
import Cantera
gas = Cantera.IdealGasMix('gri30.cti')
h2o = Cantera.importPhase('liquidvapor.cti','water')
- Matlab:
gas = IdealGasMix('gri30.cti')
h2o = importPhase('liquidvapor.cti','water')
- Install Sundials (optional)
- This step is necessary only to build and link C/C++ programs that use the Sundials integrators CVODE and IDA.
- 32-bit Download sundials-2.4.0-x86.zip
- 64-bit Download sundials-2.4.0-amd64.zip
- Extract the contents of the ZIP file to the Cantera installation directory, e.g. C:\Program Files\Cantera, merging the contents of the lib and include subdirectories.
沒有留言:
張貼留言