APPENDIX D
EQUILIBRIUM PROGRAM SUBROUTINE VARIABLES
Main Variables
VARIABLE
DESCRIPTION
DAT
Temporary storage for information on coefficient cards. Used to read cards and to write on tape 4.
DATA
Variables read from code cards to determine what data follows.
END
Code word denoting the last coefficient card has been read.
I, J, K, IT
Do loop indices.
INSERT
Code word indicating a card contains species to be included in problem.
LANK
Check to determine if OMIT or INSERT card contains one or two species.
MIT
Code word indicating card contains species to be omitted.
NCD
Counter used to insure that the thermo cards are in order.
NMLT
Code word proceeding case number, RSIZE, TRI, pressure, and temperature values, and TEM declaration.
REAC
Code word proceeding reactant cards.
STOP
Code word indicating the last input card has been read.
THRM
Code word proceeding coefficient cards.
REACT Variables
VARIABLE
DESCRIPTION
ATOM
Atomic weight of elements.
DATA
Summation of molecular weight of each element on reactant cards.
IATOM
Atomic symbol of elements.
I, J, KK
Do loop indices.


65
VARIABLE
DESCRIPTION
JJ
Number of elements being considered on a reactant card.
LANK
Used to test if the last reactant card has been read.
N
Number of reactant cards being considered.
NJ
Counter for number of elements on reactant card.
RM
Summation of total molecular weight of all the elements on a reactant card.
WP
Summation of total molecular weight of all the elements being considered.
SEARCH Variables
VARIABLE
DESCRIPTION
B
Stoichiometric coefficient of ith element read from the coefficient card.
DATE
Reference date read from coefficient card.
END
Code word to determine if last coefficient card has been read.
GAS
Code word to check if species is a gas (If PHAZ = G, IUSE = 0).
I, J, K, L
Do loop indices.
IX
Counter for condensed species.
I2B
Counter for number of species being considered which cannot be stored.
I5
Counter for printout of species being considered.
JJ
Counter for the number of elements to be put into temporary storage.
LMT
Alphameric storage for the name of elements to be put into temporary storage in SYSTM and PLUS problems.
MAXNS
Maximum number of species allowed to be considered in the present system.
MS
Counter for the location of species being put into temporary storage.


66
VARIABLE
DESCRIPTION
MT
Alphameric symbol of the element read from coefficient card.
NAM
Alphameric symbol of species name read from the coefficient card.
NM
Number of species put into temporary storage.
PHAZ
Phase of species read from the coefficient card.
TDATE
Reference date of species put into temporary storage.
TEST
Logical variable used to test if species is to be put into temporary storage.
TOOBIG
Alphameric symbol of species which cannot be stored.
TSUB
Alphameric symbol of species put into temporary storage.
T1
First T read from coefficient card.
T2
Second T read from coefficient card.
EQLBRM Variables
VARIABLE
DESCRIPTION
AA
Formula D1
AMBDA
AMBDA1
Control factors used to restrict size of the corrections to ln nj, (j = 1,....,m), nj (j = m + 1,.....,N), and ln n.
Formula D2
CONVG
Logical variable used to test if convergence has been obtained.
DELG
Formula D3
DELN
Δln nj for gases and nm+1 for condensed species.
E
Base(2.71828182845904) of natural system of logarithms.


67
VARIABLE
DESCRIPTION
ENL
ln n((i+1) = ln n (i) + λ(i) (Δln n)(i).
I,IL,J,K,L
Do loop indices.
INC
Counter for location of condensed species.
ISING
Logical variable to indicate if an attempt to reassign mole fraction values of gaseous species to 1 x 10-6 after occurrence of singular matrix has been made.
ITN
Variable to control number of iterations allowed (ITN = 35).
ITNUMB
Counts number of iterations completed.
ITST
Stores number of rows set up in matrix solution.
I35
Logical variable to allow one restart if convergence not achieved after 35 iterations.
JDELG
Location of condensed species being inserted into system.
JJ
Locates species that occurs before and after the species being considered to determine if they are different phases of the species. Also acts as a do loop index.
JKL
Determines if condensed species with minimum negative delta G value has been zeroed the first time.
KJ
Stores location of condensed species with minimum negative delta G value the first time through the condensed species section.
KK
Locates position of condensed species being considered in matrix.
LKJ
Determines if there is only one condensed specie with a negative delta G value.
MISS
Logical variable that determines if specie with lowest free energy or specie with second lowest free energy should be inserted into the system.
NCOND
Counts number of condensed species present in current system.
SINGC
Logical variable to test if attempt to remove condensed species with same elements as last condensed specie added before occurrence of singular matrix was made.


68
VARIABLE
DESCRIPTION
SINGC2
Logical variable to test if third attempt has been made to correct singular matrix problem by resetting initial estimates.
SIZE
Controls size of output values of gaseous species (SIZE = 18.420681 if no value for RSIZE is read).
SIZEG
Stores lowest negative free energy value of condensed specie with minimum delta G value.
SMALNO
Reassigns value of 1 x 10-6 to gaseous specie mole fraction the first time a singular matrix occurs if the mole fraction is not equal to zero.
SMNOL
Reassigns value of -13.815511 to gaseous specie ln nj value the first time a singular matrix occurs if the mole fraction is not equal to zero.
SUM
Stores Δln n in obtaining corrections to estimates section.
Stores Δln nj or maximum Δnm+1 in calculating control factor.
Σmj=1nj in applying corrections to estimates section.
Stores | ln n | in convergence test section.
Stores ΣLi=1 πiaij in condensed species section.
SUM1
| (-ln(nj/n) - 9.2103404) / (Δln nj - Δln n)| , (j= 1,.....,n)
TN
Counter for print out of number of iterations needed to achieve convergence.
CPHS Variables
VARIABLE
DESCRIPTION
F
Gj = μj / RT) + ((Vj(P - 1)) / RT)
Gibbs free energy of condensed specie.
I, L
Do loop indices to locate phase of condensed specie with maximum Gj value.
J
Do loop increment to locate specie being considered.
K
Determines which set of coefficients is to be used from the coefficient cards.


69
VARIABLE
DESCRIPTION
KK
Stores the value of K.
TLN
ln T, log temperature being considered.
MATRIX Variables
VARIABLE
DESCRIPTION
F
njμj / RT, Gibbs free energy for gaseous species.
I, K, J
Do loop indicies.
IQ2
Number of columns in matrix.
KK
Number of condensed species being considered in the present matrix.
KMAT
Stores number of columns in matrix.
TERM
Σmj=1 aij nj , Sums mole fraction times stoichiometric coefficients of gaseous species.
FCOEFF Variables
VARIABLE
DESCRIPTION OR FORMULA SYMBOL
SOURCE*
AA
a
E
ARG
(n2 / 4 + m3 / 27)
E
ASUR
H2O coefficients for T < 1000o C.
H
A2B
A2 / B
E
BB
b
E
BP
B * P
E
BPZ
1 + BP / Z
E
BSUR
N2O coefficients for T > 1000o
H
COSPHI
±SQRT((n2 / 4) / (m3 / 27))
E


70


VARIABLE
DESCRIPTION OR FORMULA SYMBOL
SOURCE*
C1
exp(-3.8402*T1/8 + 0.5410) for H2
S
C2
exp(-0.1263*T1/2 - 15.980) for H2
S
C3
300 * exp(-0.11901*T - 5.941) for H2
S
F
Used to change the size of M or N.
E
FAC
2* SQRT(m/3)
E
GAMMA
Z - 1 - ln(Z-BP) - A2/B(ln(1 + BP/Z))
C1P - C2P2+C3[exp(-P/300) - 1 ]
PV
E
S
H
I, J, K
Do loop indicies.
II
i
H
JJ
j
H
NAMES
Alphameric symbol of built in gas species
NI
9 - j in equation 1a, and 8 - j in equation 1b.
H
NNAMES
Do loop limit, equals number of gas species in NAMES array.
PC
Stores Pc values in DATA statement.
E
PCC
Pc of species being considered.
E
PHI
φ
E
QQ
q
E
RH
Maximum (R1, R2, R3)
E
RR
r = -(A2/B[BP]2)
E
R1
2 * SQRT(-m/3)*[cos(φ/3 + 120]
E
R2
R1 + 2*SQRT(-m/3) * [cos(φ + 120)]
E
R3
R2 + 2*(SQRT(-m/3) * [cos(φ + 240)]
E
TANPHI
Temporary storage of solution of φ.
E
TC
Stores Tc values in DATA Statement
E
TCC
Tc
E


71


VARIABLE
DESCRIPTION OR FORMULA SYMBOL
SOURCE*
TCC
Tc
E
TCT
Assigned T in degrees centigrade
H
TH
1/3
E
XM
m = q - 1/3
E
XMM
M = [(-n/2) + SQRT(n2/4 + m3/27)]1/3
E
XN
n = (9/3 + r - 2/27)
E
XNN
N = [(-n/2) - SQRT(n2/4 + m3/27)]1/3
E
XN2
-n/2
E
XP
ln n/P
H
XT
T(0.01)
H
XX
SQRT(n2/4 + m3/27)
E
Z
Xk + 1/3 if ARG < 0
M + N + 1/3 if ARG > 0
E
ZBP
Z - BP
E
*
E = Edminister(1968).
H = Hollowar et al. (1971).
E = Shaw and Wones(1964).
GAUSS Variables
VARIABLE
DESCRIPTION
BIGNO
Stores value of 1 x 1038 to be used for locating the maximum coefficient in each row of the matrix.
COEFX
Stores maximum coefficient in each row.
I
Stores location of row with smallest maximum coefficient.
IUSE1
Number of columns in matrix
J, NN
Do loop indicies.
K
Counter used to locate the elements of the matrix.


72


VARIABLE
DESCRIPTION
SUM
Temporary storage for coefficients used in search for maximum coefficients, and summation of matrix elements multiplied by π.
TEMP
Temporary storage for smallest maximum coefficient in locating the row with the smallest maximum coefficient section.
Z
Temporary storage for SUM and elements of the matrix when interchanging the equations.
OUT1 Variables
VARIABLE
DESCRIPTION
FB
Contains one blank word used for zeroing part of format statement.
FMT
Contains format for pressure, temperature and mole fraction output.
FMT10
Contains I10 field specification for T output.
FMT9
Contains the numeral 9 for number of variables to be printed out per line.
FP
Contains P heading.
FT
Contains T heading
F5
Contains the numeral 5 for the number of decimal places in the mole fraction output.
HEAD
Contains format for reactant output.
I, JJ, K, N
Do loop indicies.
IB
Contains one blank word to check for the number of elements on the reactant card.
J
Locates YN and YX value to be used in reactant output. Also used as a do loop index.
NV
Stores T value for output.
TRA
Controls the size of mole fraction output.
V
Stores mole fraction for output.


73


VARIABLE
DESCRIPTION
YN
Controls number of reactants to be printed.
YX
Contains number of spaces between last reactant and base value in output.
VARFMT Variables
VARIABLE
DESCRIPTION
F0, F1, F2, F3, F4
Controls the number of decimal places in the pressure output.
I
Do loop index.
K
Locates position in P format for field specification alteration.
THERMP Variables
VARIABLE
DESCRIPTION
I, J
Do loop indicies.
IP
Locates P being considered.
IRAT
Counts the number of mixture values to be considered in a ternary system.
IT
Locates T being considered.
MOLEWT Variables
VARIABLE
DESCRIPTION
AA
Stores increment value of reactant mole fraction.
BB
Stores base value of reactant mole fraction.
I
Do loop index.
LL
Used to determine what reactants are to be added or removed.
NEW
Used to determine if the first reactant in a ternary system is to be removed.
TIM
Multiplier of TRI value in PLUS or SYSTM problems.
TO
Stores final value of reactant mole fraction.


74


INIT Variables
VARIABLE
DESCRIPTION
J
Do loop index.
XI
Stores 1/(NS-NC), used to obtain initial estimates of number of Kg-moles of each gaseous species/Kg of mixture.
XLN
Stores ln XI.


75



This site built and hosted for free by FreeWebs.com. Click here to get your own free website.