1 / 14

Installing Cantera 1.7, Python 2.5, and Python SDToolbox for Windows

Installing Cantera 1.7, Python 2.5, and Python SDToolbox for Windows. J. Ziegler, S. Browne, and J. E. Shepherd Caltech Revised August, 2007. System Requirements. A PC running MS Windows XP with SP2 Python 2.5

chars
Download Presentation

Installing Cantera 1.7, Python 2.5, and Python SDToolbox for Windows

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Installing Cantera 1.7, Python 2.5, and Python SDToolbox for Windows J. Ziegler, S. Browne, and J. E. Shepherd Caltech Revised August, 2007

  2. System Requirements • A PC running MS Windows XP with SP2 • Python 2.5 • Download the Windows installer from http://www.python.org/ftp/python/2.5/python-2.5.msi and run it • Cantera uses Python to process input files • numarray site-package for Python • Download the Windows installer (“Old numarray”) from http://sourceforge.net/projects/numpy/numarray-1.5.2.win32-py2.5.exe and run it • scipy for python 2.5 (windows) • http://www.scipy.org/Download • numpy for python 2.5 (windows) (needed by scipy) • http://numpy.scipy.org/ • (optional download) • matplotlib for python 2.5 (windows) http://matplotlib.sourceforge.net/

  3. Cantera 1.7 Installation • Download the Cantera installer • get Cantera1.7.0.msi and run it. http://sourceforge.net/projects/cantera/ • This will create a folder that looks like the one shown here • Run Cantera-1.7.0.win32-py2.5.exe • This creates the interface between Cantera and Python

  4. Add New Environment Variables Cantera 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

  5. Add New Environment Variables • New (user) Environment Variable • PYTHON_CMD • C:\Python25\python.exe • Note: Check your paths • Environment Variables are Case Sensitive • Some installation locations may be different depending on the user’s choices.

  6. Cantera Thermo/Reaction Data • Download High Temperature (up to 6000 K) cti Files http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/cti.html • Put Thermo/Reaction Data Files (.cti) in one of two places • C:\Program Files\Common Files\Cantera\data NOTE: There is a link ('data‘) to this directory in your Cantera base directory. • Your current working directory • .cti Format Files – Thermo/Reaction Input Files for Cantera • Contain • Description of the Mixture • Thermodynamic Data • Reaction Mechanism (optional) • Transport Data (optional) • Files included with Cantera Distribution • Limited to Low Temperatures (< 3000 K) • Includes GRI3.0 and files used in demos. • Creating New/Converting CHEMKIN Style Files Documented at http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/cti.html

  7. Fix the Mixmaster 1.7 Bug • Mixmaster is a GUI written in Python that can be used to carry out equilibrium computations, evaluate thermodynamic properties and post-process reaction rate files. • The Cantera 1.7 Distribution Mixmaster has a bug • To Fix: Replace C:\Python25\Lib\site-packages\MixMaster\ThermoFrame.py with http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/ThermoFrame.py

  8. Testing Cantera/Python Interface • Make sure to restart your computer for the environment variables to take effect. 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) • Results • Correct – the comments of the tutorial print in the Python Shell window • If NOT – Python or Cantera install is incorrect.

  9. Run Python Step 1 Step 2

  10. Download SDToolbox • Toolbox http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windos/Windows_Python/SDToolbox.zip • Demo Scripts http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/Windows/Windows_Python/scriptsdemos.zip • Copy SDToolbox.zip and scripts-demos.zip into its own working directory (e.g. Desktop\cantera.shock\SDToolbox.zip and Desktop\cantera.shock\scripts-demos.zip) • Unzip the files (right click, extract all)

  11. Installing The SDToolbox • Go to C:\Python25\Lib\site-packages and create a directory named SDToolbox • Copy the unzipped SDToolbox files from above into this newly created SDToolbox directory. • There should appear; __init__.py, CV.py, PostShock.py & Thermo.py….etc • Go up 1 directory to C:\Python25\Lib\site-packages. Use any plaintext editor to create the file SDToolbox.pth (not .txt!) Type inside this file the single line "SDToolbox" (without the quotes). Note: Using Wordpad or Notepad works for this if you save the file as the all files type (you can also modify the file extension manually after creating the file) • Go up 1 directory to C:\Python\Lib. Go to the file site.py, right click and "Edit with IDLE". In the site.py window, go to Menu->Run->Run Module. • This should initialize the SDToolbox path into Python as shown in the Python Shell output window.

  12. Test with SD Toolbox Demo Scripts • Go to the demo scripts directory that you unzipped the demo files into (Desktop\cantera.shock\demos in our example) • Test the demos by "Edit with IDLE" & Run Module. • Troubleshooting Note : Cantera files are scattered into 3 places: ..\Cantera, ..\Python25\Lib\site-packages\Cantera (Mixmaster & SDToolbox too), and Program Files\Common Files\Cantera\data (where the mechanisms are put)

  13. Tips and hints • Version Compatibility –Python, Cantera, and packages must be Compatible • numarray –Be sure to install numarray NOT numpy or Numeric • Python Version –Make sure you have Python 2.5 and numarray 2.5 • Environment Variables • Case Sensitivity – Make sure that all paths specified truly exist. • USER Environment Variables (NOT SYSTEM Environment Variables) • Cantera 1.7.0 – TWO New Variables – Check that PYTHON_CMD exists and is properly defined – This is DIFFERENT than the method used for Cantera 1.6

  14. Tips and hints – External Documentation 5. Cantera Documentation • Cantera Web Site (Currently No Windows Documentation) http://www.cantera.org/ref/index.html • SourceForge Web Site in particular Cantera17-vcf17.pdf http://downloads.sourceforge.net/cantera/ (NOTE: Page/Slide 9 of Cantera17-vcf17.pdf NOT Necessary for basic user) • Shock & Detonation Toolbox Site http://www.galcit.caltech.edu/EDL/public/sdt/SD_Toolbox/ 6. Yahoo Cantera User Forum http://groups.yahoo.com/group/cantera/

More Related