5.12: TQGTLC

TOCGroup 5TQSTXPTQERRGroup 1A-ZGroup 5

GET-CALCULATED-EQUILIBRIUM-SUBLATTICE-SITE-FRACTION

Use TQGTLC to get the calculated equilibrium sublattice site fraction.

Added for ChemApp version 3.3.1

Synopsis

FORTRAN: CALL TQGTLC(INDEXP,INDEXL,INDEXC,VAL,NOERR)

C: tqgtlc(indexp,indexl,indexc,&val,&noerr);

Pascal: tqgtlc(indexp,indexl,indexc,val,noerr);

Basic: Call tqgtlc(indexp,indexl,indexc,val,noerr)


Name Type Value set on call or returned
INDEXP INTEGER Set to the index number for a phase
INDEXL INTEGER Set to the index number for a sublattice
INDEXC INTEGER Set to the index number for a sublattice constituent
VAL DOUBLE PRECISION Returns the value of the calculated sublattice site fraction
NOERR INTEGER Returns an error number

The input variables have to be set to index numbers which identify a sublattice constituent (INDEXC) of a sublattice (INDEXL) of a phase (INDEXP). The output variable VAL contains the calculated sublattice site fraction of the sublattice constituent with respect to the last equilibrium calculation.

All solution phases are considered to be modelled with one or several sublattices. For one-sublattice models, the mole and site fractions are equal.

See also

TQINLC, TQGNLC, TQNOSL, TQNOLC

Examples

FORTRAN:View plain source code



C Retrieving results for sublattice constituents
PROGRAM CAF27 IMPLICIT NONE
INTEGER NOERR, ISLITE, NUMCON, I, INDEXP, INDEXL, * INDEXC, NPHASE, NSL, NSLCON DOUBLE PRECISION VAL, VALS(2), RESULT CHARACTER PNAME*24, MNAME*24, CNAME*24

C Initialise ChemApp CALL TQINI(NOERR)
C Open the thermochemical data-file subl-ex.dat for reading. It contains C an extract of the system Co-Cr-Fe: the phase SIGMA:30, which is C modelled according to the sublattice formalism, and the BCC phase, C described by a Redlich-Kister polynomial. Both phases are each C included twice, to account for miscibility gaps. CALL TQOPNA('subl-ex.dat', 10, NOERR)
C Read data-file CALL TQRFIL(NOERR)
C Close data-file CALL TQCLOS(10, NOERR)
C Set the temperature to 1000 K CALL TQSETC('T ', 0, 0, 1000.D0, NUMCON, NOERR)
C Set the incoming amounts to 0.25 mol Co, 0.25 mol Cr, and 0.5 mol Fe CALL TQINSC('Co ', INDEXC, NOERR) CALL TQSETC('IA ', 0, INDEXC, 0.25D0, NUMCON, NOERR)
CALL TQINSC('Cr ', INDEXC, NOERR) CALL TQSETC('IA ', 0, INDEXC, 0.25D0, NUMCON, NOERR)
CALL TQINSC('Fe ', INDEXC, NOERR) CALL TQSETC('IA ', 0, INDEXC, 0.50D0, NUMCON, NOERR)

C Calculate the equilibrium CALL TQCEL(' ', 0, 0, VALS, NOERR)

Output:
 
 T = 1000.00 K
 P = 1.00000E+00 bar 
 V = 0.00000E+00 dm3

STREAM CONSTITUENTS AMOUNT/mol Co 2.5000E-01 Cr 2.5000E-01 Fe 5.0000E-01
EQUIL AMOUNT MOLE FRACTION ACTIVITY PHASE: BCC#1 mol Co 2.0130E-01 2.5280E-01 1.4418E-01 Cr 1.4767E-01 1.8544E-01 4.3552E-01 Fe 4.4733E-01 5.6176E-01 5.6476E-01 TOTAL: 7.9630E-01 1.0000E+00 1.0000E+00 PHASE: BCC#2 mol MOLE FRACTION ACTIVITY Co 0.0000E+00 2.5280E-01 1.4418E-01 Cr 0.0000E+00 1.8544E-01 4.3552E-01 Fe 0.0000E+00 5.6176E-01 5.6476E-01 TOTAL: 0.0000E+00 1.0000E+00 1.0000E+00 PHASE: SIGMA:30#1 mol MOLE FRACTION ACTIVITY Co:Cr:Co 1.2071E-02 5.9260E-02 1.1301E-01 Co:Cr:Cr 7.6446E-02 3.7528E-01 8.0896E-01 Co:Cr:Fe 2.1966E-02 1.0784E-01 2.7700E-01 Fe:Cr:Co 1.0185E-02 5.0000E-02 6.0745E-01 Fe:Cr:Cr 6.4500E-02 3.1664E-01 5.0651E-01 Fe:Cr:Fe 1.8534E-02 9.0985E-02 4.2173E-01 TOTAL: 2.0370E-01 1.0000E+00 1.0000E+00 PHASE: SIGMA:30#2 mol MOLE FRACTION ACTIVITY Co:Cr:Co 0.0000E+00 5.9260E-02 1.1301E-01 Co:Cr:Cr 0.0000E+00 3.7528E-01 8.0896E-01 Co:Cr:Fe 0.0000E+00 1.0784E-01 2.7700E-01 Fe:Cr:Co 0.0000E+00 5.0000E-02 6.0745E-01 Fe:Cr:Cr 0.0000E+00 3.1664E-01 5.0651E-01 Fe:Cr:Fe 0.0000E+00 9.0985E-02 4.2173E-01 TOTAL: 0.0000E+00 1.0000E+00 1.0000E+00 ******************************************************************** Cp_EQUIL H_EQUIL S_EQUIL G_EQUIL V_EQUIL J.K-1 J J.K-1 J dm3 ******************************************************************** 1.89312E+00 -2.13200E+02 7.05477E+00 -7.26797E+03 0.00000E+00
Mole fraction of sublattice constituents in SIGMA:30#1: Co 5.4238E-01 Stoichiometry = 3.3333E-01 Fe 4.5762E-01 --------------------------------------------------------------- Cr 1.0000E+00 Stoichiometry = 1.3333E-01 --------------------------------------------------------------- Co 1.0926E-01 Stoichiometry = 5.3333E-01 Cr 6.9192E-01 Fe 1.9882E-01
Mole fraction of system components: SIGMA:30#1 Co 2.3906E-01 Cr 5.0236E-01 Fe 2.5858E-01

C As can be seen in the output above, the standard ChemSage result table C obtained with TQCEL contains a section with details on the stable C sublattice phases. The following code shows how to retrieve similar C information with ChemApp.
C Loop over all phases, and if a phase is stable and a sublattice phase, C print information about the sublattices CALL TQNOP(NPHASE, NOERR) DO INDEXP=1, NPHASE
C Check if the phase is stable, otherwise we don't need to consider it CALL TQGETR('A ', INDEXP, 0, VAL, NOERR) IF (VAL .GT. 0.D0) THEN
C Get the name and model of the phase CALL TQGNP(INDEXP, PNAME, NOERR) CALL TQMODL(INDEXP, MNAME, NOERR)
C If the model name of the phase starts with 'SUB' we have a sublattice C phase IF (INDEX(MNAME,'SUB') .GT. 0) then
C Print a header similar to the one in the ChemSage output table WRITE(*,*) 'Mole fraction of the sublattice ' // * 'constituents in ', PNAME
C Get the number of sublattices CALL TQNOSL(INDEXP, NSL, NOERR)
C Loop over all sublattices DO INDEXL=1, NSL
write(*,*) 'Sublattice ',INDEXL,' :' C Get the number of sublattice constituents CALL TQNOLC(INDEXP, INDEXL, NSLCON, NOERR)
DO INDEXC=1, NSLCON C Get the name of each sublattice constituent... CALL TQGNLC(INDEXP, INDEXL, INDEXC, CNAME, NOERR)
C ... and its mole fraction in the sublattice CALL TQGTLC(INDEXP, INDEXL, INDEXC, VAL, NOERR)
WRITE(*,*) CNAME, VAL
ENDDO ENDDO ENDIF ENDIF ENDDO

Output:
 Mole fraction of the sublattice constituents in SIGMA:30#1              
 Sublattice  1 :
 Co                        0.542377368
 Fe                        0.457622632
 Sublattice  2 :
 Cr                        1.
 Sublattice  3 :
 Co                        0.109259364
 Cr                        0.691919882
 Fe                        0.198820755

END











C:View plain source code




/* Program cac27 */ /* Retrieving results for sublattice constituents */
#include "cacint.h"
int main() {
LI noerr, islite, numcon, i, indexp, indexl, indexc, nphase, nsl, nslcon; DB val, vals[2], result; char pname[TQSTRLEN], mname[TQSTRLEN], cname[TQSTRLEN];
/* Initialise ChemApp */ tqini(&noerr);
/* Open the thermochemical data-file subl-ex.dat for reading. It contains an extract of the system Co-Cr-Fe: the phase SIGMA:30, which is modelled according to the sublattice formalism, and the BCC phase, described by a Redlich-Kister polynomial. Both phases are each included twice, to account for miscibility gaps. */ tqopna("subl-ex.dat",10,&noerr);
/* Read data-file */ tqrfil(&noerr);
/* Close data-file */ tqclos(10, &noerr);

/* Set the temperature to 1000 K */ tqsetc("T", 0, 0, 1000.0, &numcon, &noerr);
/* Set the incoming amounts to 0.25 mol Co, 0.25 mol Cr, and 0.5 mol Fe */ tqinsc("Co", &indexc, &noerr); tqsetc("ia", 0, indexc, 0.25, &numcon, &noerr);
tqinsc("Cr", &indexc, &noerr); tqsetc("ia", 0, indexc, 0.25, &numcon, &noerr);
tqinsc("Fe", &indexc, &noerr); tqsetc("ia", 0, indexc, 0.50, &numcon, &noerr);
/* Calculate the equilibrium */ tqcel(" ", 0, 0, vals, &noerr);

Output:
 
 T = 1000.00 K
 P = 1.00000E+00 bar 
 V = 0.00000E+00 dm3

STREAM CONSTITUENTS AMOUNT/mol Co 2.5000E-01 Cr 2.5000E-01 Fe 5.0000E-01
EQUIL AMOUNT MOLE FRACTION ACTIVITY PHASE: BCC#1 mol Co 2.0130E-01 2.5280E-01 1.4418E-01 Cr 1.4767E-01 1.8544E-01 4.3552E-01 Fe 4.4733E-01 5.6176E-01 5.6476E-01 TOTAL: 7.9630E-01 1.0000E+00 1.0000E+00 PHASE: BCC#2 mol MOLE FRACTION ACTIVITY Co 0.0000E+00 2.5280E-01 1.4418E-01 Cr 0.0000E+00 1.8544E-01 4.3552E-01 Fe 0.0000E+00 5.6176E-01 5.6476E-01 TOTAL: 0.0000E+00 1.0000E+00 1.0000E+00 PHASE: SIGMA:30#1 mol MOLE FRACTION ACTIVITY Co:Cr:Co 1.2071E-02 5.9260E-02 1.1301E-01 Co:Cr:Cr 7.6446E-02 3.7528E-01 8.0896E-01 Co:Cr:Fe 2.1966E-02 1.0784E-01 2.7700E-01 Fe:Cr:Co 1.0185E-02 5.0000E-02 6.0745E-01 Fe:Cr:Cr 6.4500E-02 3.1664E-01 5.0651E-01 Fe:Cr:Fe 1.8534E-02 9.0985E-02 4.2173E-01 TOTAL: 2.0370E-01 1.0000E+00 1.0000E+00 PHASE: SIGMA:30#2 mol MOLE FRACTION ACTIVITY Co:Cr:Co 0.0000E+00 5.9260E-02 1.1301E-01 Co:Cr:Cr 0.0000E+00 3.7528E-01 8.0896E-01 Co:Cr:Fe 0.0000E+00 1.0784E-01 2.7700E-01 Fe:Cr:Co 0.0000E+00 5.0000E-02 6.0745E-01 Fe:Cr:Cr 0.0000E+00 3.1664E-01 5.0651E-01 Fe:Cr:Fe 0.0000E+00 9.0985E-02 4.2173E-01 TOTAL: 0.0000E+00 1.0000E+00 1.0000E+00 ******************************************************************** Cp_EQUIL H_EQUIL S_EQUIL G_EQUIL V_EQUIL J.K-1 J J.K-1 J dm3 ******************************************************************** 1.89312E+00 -2.13200E+02 7.05477E+00 -7.26797E+03 0.00000E+00
Mole fraction of sublattice constituents in SIGMA:30#1: Co 5.4238E-01 Stoichiometry = 3.3333E-01 Fe 4.5762E-01 --------------------------------------------------------------- Cr 1.0000E+00 Stoichiometry = 1.3333E-01 --------------------------------------------------------------- Co 1.0926E-01 Stoichiometry = 5.3333E-01 Cr 6.9192E-01 Fe 1.9882E-01
Mole fraction of system components: SIGMA:30#1 Co 2.3906E-01 Cr 5.0236E-01 Fe 2.5858E-01

/* As can be seen in the output above, the standard ChemSage result table obtained with TQCEL contains a section with details on the stable sublattice phases. The following code shows how to retrieve similar information with ChemApp. */
/* Loop over all phases, and if a phase is stable and a sublattice phase, print information about the sublattices */ tqnop(&nphase, &noerr); for (indexp = 1; indexp<=nphase; indexp++) {
/* Check if the phase is stable, otherwise we don't need to consider it */ tqgetr("a", indexp, 0, &val, &noerr); if (val > 0) {
/* Get the name and model of the phase */ tqgnp(indexp, pname, &noerr); tqmodl(indexp, mname, &noerr);
/* If the model name of the phase starts with 'SUB' we have a sublattice phase */ if (strncmp(mname, "SUB", 3) == 0) {
/* Print a header similar to the one in the ChemSage output table */ printf("Mole fraction of the sublattice constituents in %s\n", pname);
/* Get the number of sublattices */ tqnosl(indexp, &nsl, &noerr);
/* Loop over all sublattices */ for (indexl=1; indexl<=nsl; indexl++) {
printf("Sublattice %li\n", indexl); /* Get the number of sublattice constituents */ tqnolc(indexp, indexl, &nslcon, &noerr);
for (indexc=1; indexc<=nslcon; indexc++) { /* Get the name of each sublattice constituent... */ tqgnlc(indexp, indexl, indexc, cname, &noerr);
/* ... and its mole fraction in the sublattice */ tqgtlc(indexp, indexl, indexc, &val, &noerr);
printf("%-25s %f\n", cname, val); } } } } }

Output:
Mole fraction of the sublattice constituents in SIGMA:30#1
Sublattice 1
Co                        0.542377
Fe                        0.457623
Sublattice 2
Cr                        1.000000
Sublattice 3
Co                        0.109259
Cr                        0.691920
Fe                        0.198821

return 0;
}


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