Download Cantera C++ User`s Guide - Aerospace Research & Engineering
Transcript
All of the following are valid ways to call the IdealGasMix constructor:
// CTML file with one phase specification
IdealGasMix g1("silane.xml");
// CTML file with multiple phases
IdealGasMix g1("silane.xml/vapor");
// self-contained CK file
IdealGasMix g1("silane.inp");
// CK file with an external database
IdealGasMix g1("silane.inp", "therm.dat");
A utility program ck2ctml is included in the distribution that converts files in this format into CTML. For example
ck2ctml -i chem.inp -t therm.dat -o mech.xml
converts Chemkin input file ‘chem.inp’ into CTML file ‘mech.xml’, using file ‘therm.dat’ to resolve undefined species
in the input file.
Specifying a CK-format input file in the call to IdealGasMix automatically calls ck2ctml also to generate an
equivalent CTML file. For example, if the input file is specified as ‘chem.inp’, then the call to IdealGasMix will
create a file ‘chem.xml’. This file can optionally be used later instead of ‘chem.inp’. One advantages of doing so is
that it allows viewing/editing the file graphically. Also, CTML files are self-contained, with all thermodynamic data
for each species.
ck2ctml.exe for Windows PCs may be downloaded from
http://blue.caltech.edu/cantera_dist/tools/ck2ctml.exe
3.2.1
The Search Path
Whenever a file name is specified, Cantera first searches the local directory for a file with the specified name. If one is
not found, then Cantera data directories are searched, including directory ‘CANTERA_ROOT/data/inputs’, where the
input files used in the examples are located.
If you want to use your own input files in application programs in different directories, you can put the files into
‘CANTERA_ROOT/data/inputs’, instead of copying the input file to every directory where you want to use it.
Alternatively, additional directories can be added to the Cantera search path. This is done by calling function
addDirectory:
addDirectory("/usr/local/inputs");
The format of the directory string depends on the operating system. On a PC running Windows, the call to
addDirectory might look like this:
addDirectory("c:\\inputs");
Note that two backslashes are required to produce a literal ’
’ in the string.
18
Chapter 3. Phases of Matter