Two aspects related to system data have to be considered when programming ChemApp:
In ChemApp, phases, phase constituents, and system components in a thermodynamic data-file are automatically numbered sequentially (see also Chapter 1.5). Phases are numbered in the order gas, condensed mixtures, and finally stoichiometric condensed phases. Phase constituents are numbered starting from one for each phase.
Internally, ChemApp handles phases, phase constituents, and system components using these index numbers, not their names. For this purpose, ChemApp provides a number of subroutines which let you determine the index number associated with a name, and vice versa. Most routines in this group fall into this category.
The total number of components and phases in the system, or constituents in a phase can be obtained by calling TQNOSC, TQNOP, and TQNOPC, respectively. The index number of each system component, phase, and phase constituent can be found by calling TQINSC, TQINP, and TQINPC, and these numbers can be converted back to corresponding names using TQGNSC, TQGNP, and TQGNPC, respectively.
TQSTSC retrieves the stoichiometry of a system component, while TQSTPC does the same for a phase constituent. TQMODL gets the model name of a phase, and TQPCIS checks whether a phase constituent is permitted to be used as an incoming species. TQCSC is used to define a new set of system components.
ChemApp provides four subroutines that retrieve information about sublattices and sublattice constiuents of phases that are modelled according to the sublattice formalism. TQINLC gets the index number of a specified sublattice constituent name, whereas TQGNLC does the opposite, it gets the name for a specified sublattice constituent from its index number. TQNOSL retrieves the number of sublattices for a specified phase, and TQNOLC the number of sublattice constituents for a specified sublattice.
The ChemApp subroutines for obtaining index numbers and other system data are presented in Table 8.
Table 8: ChemApp subroutines for identifying system data
Subroutine | Function |
TQINSC | Gets the index number for a system component |
TQGNSC | Gets the name for a system component |
TQNOSC | Gets the number of system components |
TQSTSC | Gets the stoichiometry of a system component |
TQCSC | Changes the system components |
TQINP | Gets the index number for a phase |
TQGNP | Gets the name for a phase |
TQMODL | Gets the model name for a phase |
TQNOP | Gets the number of phases |
TQINPC | Gets the index number for a phase constituent |
TQGNPC | Gets the name for a phase constituent |
TQPCIS | Checks if a phase constituent is permitted as incoming species |
TQNOPC | Gets the number of phase constituents |
TQSTPC | Gets the stoichiometry of a phase constituent |
TQINLC | Gets the index number for a sublattice constituent |
TQGNLC | Gets the name for a sublattice constituent |
TQNOSL | Gets the number of sublattices |
TQNOLC | Gets the number of sublattice constituents |
ChemApp Programmer's Manual, Edition 3.6 | © GTT-Technologies, 2003 |