4.1.2. Establish the Chemkin Variables

The second step in establishing the Ansys Chemkin environment is to supplement and/or override the variables defined when the DOS window is opened. This is accomplished by calling the following batch file:

CALL "Program Files\ANSYS Inc\V242\reaction\chemkinpro.win64\bin\run_chemkin_env_setup.bat"

Once you have run the above script, if you type SET again, you will see some new and/or changed variable settings. Table 4.2: Chemkin Environment Variables for PC shows settings that are unique to Ansys Chemkin.

Table 4.2: Chemkin Environment Variables for PC

Variable

Description

CHEMKIN_BIN

Points to the location of the bin directory (executables).

PATH

The variable prepended with the CHEMKIN_BIN path so that the executables and shared libraries are found prior to any others. This is critical in cases where duplicate filenames exist; for example, a program called zip.dll may exist in several locations.


Now that you have completed these steps, you have a DOS window where you can execute Ansys Chemkin programs from the command line or from within batch scripts. If you want to create batch files to automate some processing, simply be sure to start each batch script with the single line (the double quotes are required on the file path):

CALL "Program Files\ANSYS Inc\V242\reaction\chemkinpro.win64\bin\run_chemkinpro_env_setup.bat"

You will also be able to successfully run them from Windows Explorer, by double-clicking the batch file.

In the Program Files\ANSYS Inc\V242\reaction\chemkinpro.win64\bin\ directory there are examples of such scripts, because this is how the Ansys Chemkin Interface and Chemkin Visualizer are launched. You can open the run_chemkin.bat and run_chemkinpp.bat files in an editor (as opposed to double-clicking to open) for examples of how the "CALL run_chemkinpro_env_setup.bat" reference is used.

You will also note that these files check for the existence of the CHEMKIN_HOME variable. If it is not defined, it gets defined to point to the default location: %USERPROFILE%\chemkin, where USERPROFILE is a Windows system variable that points to your user-specific home location (the root containing My Documents and similar folders). If you prefer a different default location, define CHEMKIN_HOME in your environment setup to point to a different directory.

There are a few complexities to using batch files within DOS windows. The former batch scripts have some comments to explain these. One critical issue is that the EXIT command will close your DOS window. We recommend that you use EXIT /B to avoid closing the DOS window. However, when the batch script is executed from the graphical user interface, it needs to not have the /B flag because it interferes with obtaining a completion status.


Note:  This means that, if you edit any of the RUNJOB_... batch scripts created by the graphical user interface, you will need to add the /B flag before running them from the DOS shell.