THE CEQ FORTRAN LIBRARY: Release 1.0, December 2003. Stephen B. Pope CEQ is a Fortran 90 library for the computation of constrained and unconstrained equilibrium compositions of ideal gas mixtures. The algorithm used is described in the report "The computation of constrained and unconstrained equilibrium compositions of ideal gas mixtures using Gibbs function continuation", S.B. Pope (2003), Cornell University Report, FDA 03-02. A copy of this report is provided in the file CEQ_FDA.pdf. The equilibrium composition is calculated either at fixed pressure and temperature, or at fixed pressure and enthalpy. PERMISSIONS All rights reserved. The CEQ software may be used for non-commercial academic and government research. It may not be redistributed. THERMODYNAMIC DATA AND CHEMKIN CEQ is written to be independent of Chemkin: there are no calls to Chemkin routines from within CEQ. The needed thermochemical data is passed to CEQ in two arrays, Ein and thermo. Ein is the element matrix (giving the number of atoms of each element in the different species); and thermo provides, for each species, the thermodynamic data in the standard form of seven polynomial coefficients in two temperature ranges. (More details are provided below.) If CEQ is used in conjunction with Chemkin, then the needed thermochemical data can be readily obtained by calling the subroutine ceq_ck which is provided. Because Chemkin II has several variants, the Chemkin-related code in ceq_ck and demo2 may need to be modified to run with different versions of Chemkin. CONTENTS OF THIS DIRECTORY This tar file ceq.tar contains: this file (README.txt) the source code of CEQ the demonstration programs demo1 and demo2, including input and postprocessing files a Makefile for creating the library ceq.a and for compiling the demos the report CEQ_FDA.pdf files for a more complex test, ceq_test, which is not documented INSTALLATION Download the file ceq.tar and extract in an appropriate directory. This will create the sub-directory CEQ containing all of the CEQ files. The Makefile should be edited to make the appropriate specifications of: the Fortran 90 compiler and its options LAPACK and BLAS libraries CHEMKIN II library (required for demo2 only) Makefiles for a few compilers are provided. Then the targets ceq.a, demo1.exe and demo2.exe can be made. DEMO PROGRAMS The source file demo1.f90 can be studied as an illustration of the use of CEQ. Executing demo1.exe creates the output file demo_out.1 which can be post-processed using the Matlab script demo1.m. In demo1, the necessary thermodynamic data is read from the file demo1.dat. In demo2, the necessary thermodynamic data is obtained via Chemkin II. This illustrates the use of the subroutine ceq_ck. PRECISION All reals are kind(1.d0), i.e., double precision. SUBROUTINES The two primary CEQ subroutines are: ceq_sys_init - initialize the data structure (e.g., denoted by SYS) for a given system (i.e., for a given set of species and constraints, if any). This must be called before any other routine that references SYS. Multiple systems may be initialized, e.g., SYS1, SYS2,... ceq_state - perform a specified equilibrium calculation for system SYS Other user-callable CEQ subroutines are: ceq_ck - obtain the necessary thermochemical data from Chemkin (for use in the call to ceq_sys_init). ceq_param_set - reset numerical parameters used in CEQ for SYS ceq_param_def - reset numerical parameters used in CEQ for SYS to their default values ceq_sys_rm - delete the data structure SYS The module ceq_system.f90 contains: ceq_sys_init, ceq_param_set, ceq_param_def, ceq_sys_rm The module ceq_state_m.f90 contains: ceq_state Refer to the source code of these routines for definitions of their arguments. USEAGE The useage of the CEQ is illustrated in demo1.f90 and demo2.f90. The essential ingredients are as follows. !---------------------------------------------------------- subroutine my_sub use ceq_system ! this CEQ module must be available implicit none type (sys_type), pointer, save :: SYS ! declare SYS ...other declarations and specification of variables.... ! initialize SYS call ceq_sys_init( ns, ne, ncs, ng, Ein, CS, Bg, & thermo_in, lu_op, diag, SYS, iret ) ! equilibrium calculation for SYS ceq_state( SYS, .... ) .... end subroutine my_sub !------------------------------------------------------------