1 installing cantera 1.6 for windows s. browne and j.e. shepherd caltech january 2007

15
1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

Upload: reynard-lang

Post on 18-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

1

Installing Cantera 1.6 for Windows

S. Browne and J.E. ShepherdCaltech January 2007

Page 2: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

2

System RequirementsA PC running MS Windows 2000, or Windows XPPython 2.4

Download the Windows installer from http://www.python.org and run it

Cantera uses Python to process input files, so it is required even if you will use Cantera from Matlab or another environment

numarray site-package for Python Only needed if you plan to use Cantera from Python Adds fast array operations to Python Download the Windows installer from http://sourceforge.net/projects/numpy

and run it The installer file is named numarray-1.5.2.win32-py2.4.exe and is located

under File Releases > Old Numarray > 1.5.2

Optional Matlab 6.5 or higher MS Visual C++ 6.0 Compaq Visual Fortran Graphviz (Needed to use reaction networks in MixMaster) –

http://graphviz.org/

Page 3: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

3

Cantera 1.6 Installation

Download the Cantera installer

get Cantera160.msi and run it.

http://sourceforge.net/projects/cantera

This will create a folder that looks like the one shown here

Run Cantera-1.6.0.win32-py2.4.exe

This creates the interface between Cantera and Python

Page 4: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

4

Add the Python Interpreter to the PathCantera needs to know where to find the Python interpreter, since it uses

Python to process ‘.cti’ input files

To edit the system search path, select “System” on the Control Panel to pull

up this dialogue box

Press the ‘Environment Variables’ button

Page 5: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

5

Edit the PATH environment variable

• Add C:\PYTHON24 to the PATH (user) environment variable

• Use a semicolon between paths

Note: Check your paths • Environment Variables are Case Sensitive• Some installation locations may be different depending on the user’s choices.

Page 6: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

6

Put the Cantera Toolbox on theMatlab path

Add ‘Cantera’ folder to the Matlab pathUse the “Add with Subfolders” option.More details on next slide

Page 7: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

7

Setting the Path in Matlabchoose ‘Set Path…’ on the File menu

• Cantera Toolbox• Cantera Demos• Cantera Tutorials

NOTE: There will be many more directories than those shown in this screen-shot (to the right), but only those shown are necessary – Others may be removed.

Page 8: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

8

Cantera Thermo/Reaction Data

.cti Format Files – Thermo/Reaction Input Files for CanteraContain

Description of the Mixture Thermodynamic Data Reaction Mechanism (optional) Transport Data (optional)

Files included with Cantera Distribution Limited to Low Temperatures (< 3000 K) For Methane and Oxygen.

High Temperature (up to 6000 K) Files Available at http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/cti.html

Creating New/Converting CHEMKIN Style Files Documented athttp://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/cti.html

Save all Thermo/Reaction Data Files (.cti or .xml) inC:\Program Files\Common Files\Cantera\data

NOTE: There is a link ('data‘) to this directory in your Cantera base directory.

Page 9: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

9

Using MixMasterThere is an error in the distribution of Cantera 1.6.0 – a shortcut to MixMaster does not appear

It is convenient to add a shortcutto this application which is located at

NOTE: in order to use MixMaster,install graphviz and numarray

C:/Python24/Lib/site-packages/MixMaster/main.py

Page 10: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

10

Matlab Cantera 1.6 Toolbox Bug

The Cantera 1.6 Matlab Toolbox has a bug as well To Fix: Replace Cantera\MATLAB\toolbox\cantera\@ThermoPhase\gibbs_RT.m

with http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/gibbs_RT.m

Page 11: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

11

Testing Installation

Make sure to restart your computer for the environment variables to take effect.Two Options to Test Installation1. Open Matlab and try starting the first tutorial ‘tut1.m’ 2. Go to:http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/cantera_test.html

and follow instructionsNotes You must ‘set the current directory’ or ‘add the path’ of

any m-file that you want to execute If you added the Cantera directory with the "Add with

Subfolders" option (Slide 7) – the demos and tutorials will be in the Matlab path

If you have difficulties – READ ON

Page 12: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

12

Tips and hints1. Version Compatibility – Check that Matlab and

Cantera Versions are Compatible (i.e. Use Cantera 1.6 with Matlab 6.5 or Matlab 7.1)

2. numarray – Be sure to install numarray NOT numpy or Numeric

3. Python Version – Make sure you have Python 2.4 and numarray 1.5.2 (numarray-1.5.2.win32-py2.4.exe)

4. Environment Variablesa) Case Sensitivity – Make sure that all paths specified truly

exist.b) USER Environment Variables NOT SYSTEM Environment

Variablesc) Cantera 1.6.0 – Modified PATH Variable

– Check that the directory of Python Interpreter is in the USER PATH Variable– Different for Cantera 1.7.0

Page 13: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

13

Tips and hints5. Test Cantera/Python Interface

Run tut1.py (python tutorial file) Located in Cantera\tutorials\Python

To Run: Right click on ‘tut1.py’ and left click on ‘Edit with Idle’

In the tut1.py window enter "F5" (shortcut for Run > RunModule)

ResultsCorrect – the comments of the tutorial print in the Python Shell windowIf NOT – Python or Cantera install is incorrect. This must be fixed before even trying Matlab.

Page 14: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

14

Tips and hints6. Persistent Matlab Trouble

Check Matlab Path – Be sure that BOTH Cantera Toolbox & Program you are Running are in the Matlab Path

Check Slide 7 – Does Your Path Match the Blue Box? You should see Cantera Cantera\MATLAB Cantera\MATLAB\toolbox Cantera\MATLAB\toolbox\cantera Cantera\MATLAB\toolbox\cantera\1D Cantera\demos\MATLAB Cantera\tutorials\MATLAB

at the top of the path list if you did this properly

7. Data Directory – Are the .cti or .xml files in the data directory (Slide 8)

Page 15: 1 Installing Cantera 1.6 for Windows S. Browne and J.E. Shepherd Caltech January 2007

15

Tips and hints – External Documentation

8. Cantera Documentation Cantera Web Site (Currently No Windows

Documentation)http://www.cantera.org/ref/index.html

Shock & Detonation Toolbox Sitehttp://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/

9. Yahoo Cantera User Forum http://groups.yahoo.com/group/cantera/