Chapter 4: Subroutines for Defining Equilibrium Calculations

This section describes the subroutines available for defining the initial conditions for an equilibrium calculation. These are summarised in Table 12. Global equilibrium conditions are set using the subroutines TQSETC or TQSTEC (see Tables 13 and 14). The latter must be applied when using streams, which should preferably be defined when an extensive property of a reaction is wanted as a result, or when incoming amounts of the same constituent are to be entered more than once.

TQREMC is used to remove equilibrium conditions when using global conditions. All remaining subroutines in this group are used for managing streams. They set up a stream (TQSTTP), set its constituent amounts (TQSTCA), and delete a stream (TQSTRM).

Table 12: ChemApp subroutines for defining calculations

Subroutine Function
TQSETC Sets an equilibrium condition
TQREMC Removes an equilibrium condition
TQSTTP Sets name, temperature, and pressure for a stream
TQSTCA Sets constituent amounts for a stream
TQSTEC Sets an equilibrium condition with input conditions defined by streams
TQSTRM Removes a stream

Table 13: Possible state variables for setting conditions in the subroutines TQSETC and TQSTEC

Option Variable Comment
P Total pressure Last entered (pressure or volume) takes precedence. Default value is 1 bar.
VT Total volume Last entered (pressure or volume) takes precedence. Note that the use of this option to perform calculations at constant volume is discouraged, see Appendix B.3 for details.
T Temperature Default value is 1000 K.
A Amount of phase VAL >=0 defines a formation target calculation; VAL <0 a precipitation target calculation for a mixture phase. In a formation target calculation, the target variable is varied until unit activity and zero amount of the target phase is achieved. A precipitation target is defined as one where the target phase is the only one formed at equilibrium, and the second most stable phase has unit activity.
IA Incoming amount For any number of constituents or components.
MU Chemical potential Valid only for phase constituents.
AC Relative activity -
Heat capacity
Gibbs energy
Valid for the entire system or for a phase. Extensive properties are either calculated for the equilibrium phases and are then dependent on the reference state chosen in the data-file, or for the chemical reaction when streams are defined, in which case they are relative to the state defined by the stream conditions.

Table 14: Definition of the indices INDEXP (for phases) and INDEX (for components or constituents) in the subroutines TQSETC and TQSTEC. Index numbers are obtained by the appropriate subroutine calls (see TQINSC, TQINP, TQINPC). Indices may be chosen arbitrarily when pressure, volume, or temperature is set. When a number <= 0 is required, this may be chosen freely.

INDEXP INDEX Component, phase, or constituent for which value is entered
>0 >0 Constituent INDEX of phase INDEXP (INDEX=1 or 0 for stoichiometric condensed phases)
>0 <=0 Phase INDEXP
<=0 >0 System component INDEX
0 0 Entire system

ChemApp Programmer's Manual, Edition 3.6© GTT-Technologies, 2003