(c) 2002–2017 by A. Miyoshi
All rights reserved.
– Knowledge-basing Utilities for Complex Reaction Systems –


Manual of chemgen

  The chemgen is a component of the KUCRS and processes a list of reactions in macro representation and generate a Chemkin format reaction input.   It is a basic tool to generate a reaction mechanism with rule-based rate constants, correctly and efficiently.   It can be used separately from the KUCRS, or may be used to modify or supplement the mechanism generated by the KUCRS.


chemgen bname_chg.inp bname_thg.dat > bname_chg.log


bname_chg.inp * reaction list in macro representation
bname_thg.dat * thermodynamic data
KUCRS_LIB\bas_rxns.inp (base mechanism)
KUCRS_LIB\bas_thrm.dat (base thermodata)
KUCRS_LIB\elm_tbl.dat * element data
KUCRS_LIB\rxn_macr.dat * macro definitions
KUCRS_LIB\ = Directory pointed by an environment variable KUCRS_LIB. (current directory if not defined)


bname_chg.log diagnostic output of chemgen
bname_chm.inp reaction mechanism in Chemkin format
bname_rxn.inp do. (reactions block)
bname_spc.inp do. (elements/species block)
bname_thm.dat do. (thermo block)

Downloading & Executing a Sample (Windows)

  A chemgen executable (on Windows) and sample input files for separate use from KUCRS can be downloaded from below.
  1. Click the link above and save the chemgen20081222.zip.   The location is assumed to be C:\ in the following instructions.
  2. Extract the chemgen20081222.zip.  The following files should be generated in the folder chemgen.
  3. Open the Command Prompt, change directory to where the chemgen files have been extracted, and type as follows.
    C:\chemgen> chemgen sample_chg.inp sample_thg.dat > sample_chg.log
  4. The following files should be newly formed.
  5. In this sample, a Chemkin-format mechanism file, sample_chm.inp, is generated by processing the reaction list in macro representation described in sample_chg.inp.  The macro's are defined in rxn_macr.dat.  All the input and output files are text-format files, and can be viewed and edited by a text editor such as the Notepad or the WordPad.  See the instructions below for the format of the input files etc.

Input Files

Element data (required)

  • Not necessary to be edited unless (a) new element(s) is needed to be added.  Its file name is fixed (elm_tbl.dat) and it should reside in the current directory. [#1]

Macro definitions (required)

  • Place in the current directory [#1] with the specified file name: rxn_macr.dat.  Below is the sample definitions.
    ! sample macro definitions
    ! ----- H-abstraction by OH
     Habs/by-OH/Prim      8.83E+06    1.80     855.  ! per one CH3 group
     Habs/by-OH/Tert      5.73E+10    0.51      63.  ! per one CH group
    ! ----- decomposition of hydrocarbons
     Rv/Dcmp/C-Me         1.00E+13    0.         0.
  • A macro is defined in the following format.
      macro_name   A   n   Ea
    macro_name is the name of the macro. A, n, and Ea are the parameters of the modified Arrhenius expression,
    k = AT n exp(−Ea / RT).
    The unit system for the rate parameters is the default of Chemkin, that is, cm3-mol-s-cal system.
  • From an explanation mark (!) to the line end is a comment.
  • A macro with a name beginning with Rv/ is treated so that the given pameters, A, n, and Ea, are for its reverse reaction.  For example, the last macro in the above example defines the rate constant for the reverse of the methyl radical elimination reaction from a hydrocarbon to be 1×1013.  In general for a reaction such as a decomposition reaction, it is convenient to give a rate constant for the reverse reaction.

Reaction list (required)

  • The file name must be in the form of bname_chg.inp, that is, must end with "_chg.inp".  The part bname is used to determine the name of the output files.  When invoking chemgen, the file name should be specified as the first argument of the command line.  Below is the content of the sample file.
    # sample chemgen input
    ! isobutane reactions with OH
     iC4H10 OH = iC4H9 H2O $ Habs/by-OH/Prim 0 3 Y
     iC4H10 OH = tC4H9 H2O $ Habs/by-OH/Tert 0 1 Y
    ! decomposition of isobutane
     iC4H10 = CH3 iC3H7    $ Rv/Dcmp/C-Me    0 3 Y
  • One reaction should be described in one line in the following format.
      reactant1 ...  =  product1 ...  $  macro_name  ΔEa  mult_A  flag_rev
    The reaction equation is written left to the $, and the reactants delimited with white spaces are listed left to the = and products to the right.
  • The ΔEa may be set other than zero (0) when an adjustment to the macro-defined activation energy is needed.
  • The mult_A may be used to modify the preexponential factor by setting it other than one (1).  In the example here, it is used to triple the rate constant for the H-abstraction reaction from the primary carbon and that for the CH3 elimination reaction since the isobutane has three equivalent methyl groups.
  • The last parameter flag_rev is a flag to indicate whether to consider the reverse reaction or not.  Set Y to include, and N to omit the reverse reaction.
  • Both of the lines beginning with ! and # are comment lines, though that beginning with ! is transferred to the Chemkin input as it is as a comment line, while that with # is not copied.

Thermodynamic data (required)

  • It may have any file name but should be specified as the second argument to the command line when invoking chemgen.  A part of the sample is shown below.  The format is the same as that for Chemkin thermodata.
       300.000  1500.000  5000.000                                                  
    iC4H10            thgen C   4H  10          G   300.000  5000.000 1389.00      1
     1.25733188E+01 2.18921034E-02-7.52507819E-06 1.17199470E-09-6.81406454E-14    2
    -2.31695053E+04-4.68052242E+01-1.01548278E+00 5.04801838E-02-3.00674447E-05    3
     9.16431647E-09-1.15528714E-12-1.80491562E+04 2.74371619E+01                   4
    iC4H9             thgen C   4H   9          G   300.000  5000.000 1389.00      1
     1.21596150E+01 1.97412861E-02-6.79323159E-06 1.05880234E-09-6.15918443E-14    2
     1.89478674E+03-4.06305807E+01-2.60119556E-01 4.59801603E-02-2.76540140E-05    3
     8.55997651E-09-1.10410554E-12 6.56626481E+03 2.71901259E+01                   4
  • The thermodynamic data may be generated by using THERM etc.  Thermodata for all of the reactants and products in the reaction list must be in this file or in the optional file bas_thrm.dat (see below).

Optional input

  • When a file named bas_rxns.inp or bas_thrm.dat (the file name is fixed for either) is found in the current directory [#1], chemgen copies its content into the last of the reaction list or the thermodata, respectively.  For example, base machanism for the H2-O2 system may be described in these files in order to include them always in the mechanism.  In the KUCRS system, the species up to C2 and their reactions are registered as a base mechanism.

Output Files

Chemkin input

  • The output file name is bname_chm.inp, where bname is a base name generated by eliminating "_chg.inp" from the tail of the reaction list file name.  Below is a part of the Chemkin input file generated by processing the example input.
     H C O
     iC4H10 iC4H9 tC4H9 OH H2O CH3 iC3H7
    thermo all
       300.000  1000.000  5000.000
    iC4H10            thgen C   4H  10          G   300.000  5000.000 1389.00      1
     1.25733188E+01 2.18921034E-02-7.52507819E-06 1.17199470E-09-6.81406454E-14    2
    -2.31695053E+04-4.68052242E+01-1.01548278E+00 5.04801838E-02-3.00674447E-05    3
     9.16431647E-09-1.15528714E-12-1.80491562E+04 2.74371619E+01                   4
    reactions      cal/mole  moles
    ! isobutane reactions with OH
     iC4H10+OH=iC4H9+H2O                              2.649e+07   1.800     855.0
                                               rev /  2.188e+04   2.313   18689.0 /
     iC4H10+OH=tC4H9+H2O                              5.730e+10   0.510      63.0
                                               rev /  4.536e+06   1.518   22283.5 /
    ! decomposition of isobutane
     iC4H10=CH3+iC3H7                                 4.480e+25  -2.321   89803.0
                                               rev /  3.000e+13   0.000       0.0 /
  • In the species block, all the species found in the thermodynamic data file specified as the second command-line argument when invoking chemgen and the bas_thrm.dat are listed.  The elements block is generated automatically from the thermodynamic data for all the sepcies.  When you need the diluent gases such as N2 or Ar, register it in the bas_thrm.dat.  Then it is automatically described in both elements and species blocks.
  • Look how the reactions block is generated by macro substitutions and reverse rate calculations.  For the last reaction described by a macro biginning with Rv/, see that the rate parameters specified in the macro definition are used for the reverse reaction.


  • The output file name is bname_chg.log, which is determined by replacing the extension of the reaction list file name by .log.  Part of the log file generated when the sample files are processed is shown below.
    15 elements loaded from [elm_tbl.dat]
    3 rate macros loaded from [rxn_macr.dat]
    7 thermodata loaded from [sample_thg.dat]
     reaction                                             delH      delS
                                                      kcal/mol cal/K/mol
     iC4H10+OH=iC4H9+H2O                               -18.288     6.818
    ---------- rate calculations ----------
     rev /  2.188e+04   2.313   18689.0 /
      T/K        kf         kr         Kc 
      300  1.816e+11  2.798e-04  6.490e+14
      400  4.362e+11  1.434e+00  3.041e+11
      500  8.082e+11  2.650e+02  3.049e+09
      600  1.295e+12  9.207e+03  1.407e+08
      800  2.601e+12  8.867e+05  2.933e+06
     1000  4.327e+12  1.547e+07  2.797e+05
     1500  1.036e+13  9.080e+08  1.141e+04
     2000  1.869e+13  8.533e+09  2.190e+03
     2500  2.915e+13  3.690e+10  7.899e+02
     3000  4.165e+13  1.059e+11  3.934e+02
     3500  5.611e+13  2.372e+11  2.365e+02
     4000  7.246e+13  4.517e+11  1.604e+02
     5000  1.106e+14  1.200e+12  9.219e+01
    Copying sample_spc.inp + sample_thm.dat + sample_rxn.inp -> sample_chm.inp - succeeded.
  • The first section includes the diagnostic messages whether the input files (including the optional ones) are read correctly or not.
  • The lines after the one containing "reaction ... delH delS" list the ΔH (enthalpy change), ΔS (entropy change) of the reaction at 298 K, the rate constants for forward and reverse reaction, and the equilibrium constants from 300 K to 5000 K.


  • The files named as bname_spc.inp, bname_thm.dat, and bname_rxn.inp are the temporary files for generation of Chemkin input, and not needed in usual circumstances.

[#1] May be placed in another directory by setting the environment variable KUCRS_LIB.  For examble in setenv.bat in KUCRS it is set as: set KUCRS_LIB=C:\KUCRS\libdata