This section describes each command as it would be entered directly on the command line or in a batch script. The commands are illustrated for the psr__gas sample project, which is included in the Ansys Chemkin installation. However, we also assume that the user has already "created" the PSR input file for this sample using the Create Input Files button in the User Interface, with a filename psr__gas.inp. Note there are two underscores between "psr" and "gas".
Note: For all of the Ansys Chemkin program executables, all input and output files can be specified using command-line arguments (for example, "-i " precedes an input file name). A complete list of the command-line argument options is given in Command Line Argument Options.
The following instructions will walk you through executing individual programs in the Ansys Chemkin
suite. However, if you use the User Interface first, you can get a head start on the command
line execution by looking at and adapting the RUNJOB_*.<ext> files
created by the User Interface. In Windows, running the default sample, gas__psr, will create the
RUNJOB_CKPreProcess.BAT file when you run the Pre-Processor. You can run
this file yourself on the command line by double-clicking on it or from the DOS shell by
typing @ RUNJOB_CKPreProcess.BAT
. If your DOS shell closes when the script
finishes, change the last line in the script from
exit %errorlevel%
to
exit /B %errorlevel%
where the /B
flag tells DOS this is a batch script exit, not a DOS shell exit.
On the Linux platforms, you can invoke the shell scripts by typing
./RUNJOB_CKPreProcess.sh
while in the directory containing the RUNJOB
scripts. These scripts demonstrate both how to establish the Ansys Chemkin runtime environment and
how to invoke the various Chemkin executables.
Similarly, the Run Model command in the User Interface creates RUNJOB_CKRunProcessor.BAT, which can be examined as an example of how to invoke the CKReactorGenericPSR executable. These script files also show how to create the Ansys Chemkin runtime environment, which is required to be defined prior to running any of the Chemkin executables.
For a more granular, step-by-step approach and more details, please follow the steps in the following procedure.
Change directories to the gas sample subdirectory:
For Windows/PC:
cd <home>\samples\psr\gas
For Linux:
cd <home>/samples/psr/gas
Run the Gas-phase Kinetics Pre-processor component:
For Windows/PC:
%REACTION_DIR%\chemkinpro.win64\bin\chem -i chem.inp -o chem.out -d %REACTION_DIR%\chemkinpro.win64\data\therm.dat
For Linux:
${REACTION_DIR}/chemkinpro.linuxx8664/bin/chem -i chem.inp -o chem.out -d ${REACTION_DIR}/chemkinpro.linuxx8664/data/therm.dat
Here, the command-line argument "-i " precedes the name of the gas-phase chemistry input file, while the command-line argument "-o " precedes the diagnostic output file name. The location of the thermodynamics database file is given by "-d ". In addition to the chem.out file, the Gas-phase Kinetics Pre-Processor creates an output file named chem.asc. In this example, the Linking File will be created by default in the local directory. The Linking File is required by other Ansys Chemkin Pre-processors and by the program executable. You should always check for errors by reviewing the contents of chem.out, before proceeding.
Note: For programs that require transport data (not required by PSR) or surface kinetics (optional input for PSR), you will also need to run the Transport and Surface Kinetics Pre-processors. These additional pre-processors must be run after the Gas-phase Kinetics Pre-processor and before the program executable.
Copy the Ansys Chemkin solution template file into the local working directory.
For Windows/PC:
copy %REACTION_DIR%\chemkinpro.win64\data\chemkindata.dtd .
Linux:
cp ${REACTION_DIR}/chemkinpro.linuxx8664/data/chemkindata.dtd .
Run the program executable, in this case the CKReactorGenericPSR executable:
For Windows/PC:
%CHEMKIN_BIN%\CKReactorGenericPSR -i psr__gas.inp -o psr__gas.out
Linux:
${CHEMKIN_BIN}/CKReactorGenericPSR -i psr__gas.inp -o psr__gas.out
In addition to the psr__gas.out file, the PSR program creates an XML Solution File called XMLdata.zip. This file is required by the Ansys Chemkin Post-Processor or the command-line GetSolution utility. You should always check for errors by reviewing the contents of psr__gas.out, before proceeding to post processing.