3.2. Gas-phase Kinetics Sample Program (CONP)

CONP is an example of a FORTRAN or C++ program directly accessing the Gas-phase Kinetics Subroutine Library. Before coding such an executable for Gas-phase Kinetics, the user must (1) define a system of governing equations, (2) define a reaction mechanism, and (3) choose a solution method. In this sample problem we will solve the equations describing constant pressure combustion for a hydrogen-air reaction mechanism.

The governing energy and mass conservation equations are:

(3–1)

(3–2)

where T is temperature and Y k are the mass fractions of the K species involved. The independent variable t is time. Other variables are , mass density; , mean specific heat at constant pressure; , the specific enthalpies of the species; , the molar production rates of the species; and , the molecular weights of the species.

The governing system of ordinary differential equations and accompanying initial conditions form an initial value problem. The equations will be solved using VODE.[1] We find this solver to be reliable for the solution of a wide range of stiff initial-value problems. The source code for the solver is provided in the Chemkin subdirectory source_public\vode.f (PC), source_public/vode.f (UNIX), which is extensively commented as to its implementation.

The FORTRAN implementation for the solution of the sample problem is provided in the Ansys Chemkin subdirectory samples<release_number>\sample_apps_f77\conp (PC), samples<release_number>/sample_apps_f77/conp (UNIX), and a C++ implementation in samples<release_number>\sample_apps_cpp\conp (PC), samples<release_number>/sample_apps_cpp/conp (UNIX). After initializing Gas-phase Kinetics, the program reads the initial nonzero moles from input. It then repeatedly calls subroutine VODE to obtain the solution at uniform print intervals. The governing equation formulation is found in SUBROUTINE FUN, which is called by VODE.


Note:  When using this example, you must (i) ensure FLEXLM_ARCH is set (see Recompiling and Linking a User Subroutine ) and (ii) edit the .inc makefile so that the CKROOT variable is set to the location of your Ansys Chemkin installation (see Compile and Link ).


The sections below present Gas-phase Kinetics Pre-processor input and output for the sample problem, and the input and output for the CONP execution.



[1] P. N. Brown, G. D. Byrne, and A. C. Hindmarsh, SIAM J. Sci. Stat. Comput. 10 :1038 (1989).