initial import

This commit is contained in:
Dave Goodwin 2003-11-17 13:52:20 +00:00
parent bc7f8dd581
commit 108094c8c2
3 changed files with 165 additions and 1 deletions

18
tools/man/mixmaster.1 Normal file
View file

@ -0,0 +1,18 @@
.TH "ck2cti" 1 "16 Nov 2003" "ck2cti" \" -*- nroff -*-
.ad l
.nh
.SH NAME
mixmaster \- graphical tool for analysis of chemically-reacting mixtures.
.SH SYNOPSIS
.br
mixmaster
.SH DESCRIPTION
.I mixmaster
is a graphical application written in Python that can be used to postprocess
simulations carried out with Cantera, or to explore the properties of mixtures
and reaction mechanisms.

View file

@ -1,8 +1,34 @@
/**
* @file ck2cti.cpp
*
* Program to convert CK-format reaction mechanism files to Cantera input format.
* Program to convert Chemkin-II-format reaction mechanism files to
* Cantera input format. The resulting Cantera input file contains a
* definition of one ideal_gas entry that represents an ideal gas
* mixture corresponding to the Chemkin-II reaction mechanism. The
* file also contains Cantera-format definitions for each species and
* each reaction in the input reaction mechanism file.
*
* Usage: ck2cti -i input -t thermo -tr transport -id idtag
*
* The Cantera-format text is written to the standard output.
*
* @param input Chemkin-II reaction mechanism file to be converted. Required.
*
* @param thermo Thermodynamic property database. If the THERMO section of the
* input file is missing or does not have entries for one or more species,
* this file will be searched for the required thermo data. This file may
* be another reaction mechanism file containing a THERMO section, or
* a Chemkin-II-compatible thermodynamic database file.
*
* @param transport Transport property database. If this file name is supplied,
* transport property parameters will be taken from this file and
* included in the output Cantera-format file. If this parameter is omitted,
* no transport property parameters will be included in the output.
*
* @param id idtag. The ideal_gas entry in the Cantera-format output
* has name \i idtag. If this parameter is omitted, it will be set to the
* input file name without the extension. Since only one phase definition
* is present in the ck2cti output, this parameter is not required.
*/
#ifdef WIN32
#pragma warning(disable:4786)

View file

@ -0,0 +1,120 @@
import sys, os, string
prefix = '@prefix@'
pycmd = '@PYTHON_CMD@' # sys.argv[2]
localinst = @local_inst@
icyg = prefix.find('/cygdrive/')
if icyg == 0:
prefix = prefix[10]+':'+prefix[11:]
bindir = '@ct_bindir@'
libdir = '@ct_libdir@'
hdrdir = '@ct_incdir@'
demodir = '@ct_demodir@'
datadir = '@ct_datadir@'
ctdir = '@ct_dir@'
f = open(ctdir+'/setup_cantera','w')
f.write('#!/bin/sh\n')
f.write('LD_LIBRARY_PATH='+libdir+':$LD_LIBRARY_PATH\nexport LD_LIBRARY_PATH\n')
f.write('PATH='+bindir+':$PATH\nexport PATH\n')
f.write('PYTHON_CMD='+pycmd+'\nexport PYTHON_CMD\n')
if pycmd <> 'python':
f.write('alias ctpython='+pycmd+'\n')
ctloc = '-'
warn = ''
warn2 = ''
if localinst:
try:
v = sys.version_info
ctloc = prefix+'/lib/python'+`v[0]`+'.'+`v[1]`+'/site-packages'
try:
import Cantera
ctpath = Cantera.__path__[0]
if ctpath <> ctloc:
warn = """
######################################################################
Warning: the Cantera Python package is already installed at
"""+ctpath+""". The newly-installed package at
"""+ctloc+"""/Cantera
cannot be accessed until the existing one is removed.
######################################################################
"""
except:
pass
sys.path.append(ctloc)
f.write('PYTHONPATH='+ctloc+':$PYTHONPATH\nexport PYTHONPATH\n')
except:
print 'error'
f.close()
# write the script to run MixMaster
f = open(bindir+'/mixmaster','w')
f.write('#!/bin/sh\n'+pycmd+"""w -c 'from MixMaster import MixMaster; MixMaster()'
""")
f.close()
try:
import Cantera
ctpath = Cantera.__path__[0]
except:
ctpath = "-"
fm = open(prefix+"/cantera/ctpath.m","w")
fm.write("""path(path,'"""+prefix+"""/matlab/toolbox/cantera/cantera')\n""")
fm.write("""path(path,'"""+prefix+"""/matlab/toolbox/cantera/cantera/1D')\n""")
fm.close()
print """
Cantera has been successfully installed.
File locations:
applications """+bindir+"""
library files """+libdir+"""
C++ headers """+hdrdir+"""
demos """+demodir+"""
data files """+datadir+"""
Matlab toolbox """+prefix+"""/matlab/toolbox/cantera/cantera
Matlab demos """+prefix+"""/matlab/toolbox/cantera/cantera-demos
Matlab tutorials """+prefix+"""/matlab/toolbox/cantera/cantera-tutorials
An m-file to set the correct matlab path for Cantera
is at """+prefix+"""/cantera/ctpath.m"""
if ctpath <> "-":
print """
Python package """+ctpath
if warn <> '':
print warn
else:
print """
######################################################################
Warning: the Cantera Python package is not installed. If you
intentionally skipped it, ignore this message. Otherwise, type
'make python' and/or 'make python-install' and look for error messages.
Note that you must first install the 'Numeric' package before installing
the Cantera package.
######################################################################
"""
print """
setup script """+prefix+"""/cantera/setup_cantera
The setup script configures the environment for Cantera. It is
recommended that you run this script by typing
source """+prefix+"""/cantera/setup_cantera
before using Cantera, or else
include its contents in your shell login script.
"""