5.10: TQGDPC

TOCGroup 5TQGETRTQSTXPGroup 1A-ZGroup 5

GET-THERMODYNAMIC-DATA-OF-PHASE-CONSTITUENT

Use TQGDPC to get thermodynamic data for a phase constituent.

Synopsis

FORTRAN: CALL TQGDPC(OPTION,INDEXP,INDEXC,VAL,NOERR)

C: tqgdpc(option,indexp,indexc,&val,&noerr);

Pascal: tqgdpc(option,indexp,indexc,val,noerr);

Basic: Call tqgdpc(option,indexp,indexc,val,noerr)


Name Type Value set on call or returned
OPTION CHARACTER Set to a string as shown in Table 20
INDEXP INTEGER Set to the index number for a phase
INDEXC INTEGER Set to the index number for a constituent
VAL DOUBLE PRECISION Returns the value of the thermodynamic quantity
NOERR INTEGER Returns an error number

OPTION is character input identifying the thermodynamic quantity (see Table 20). VAL (for a single constituent, selected using INDEXP and INDEXC) is returned dimensionless and is calculated for the default temperature, or for the last temperature set using TQSETC or TQSTEC, or calculated using TQCE/TQMAP.

See also

TQINPC, TQNOPC, TQGNPC, TQSTPC, TQPCIS

Examples

FORTRAN:View plain source code



C Calculate thermodynamic quantities
PROGRAM CAF20 IMPLICIT NONE
INTEGER NOERR, NUMCON, ISIO2 DOUBLE PRECISION VALUE, R, T
C Initialise ChemApp CALL TQINI(NOERR)
C Open data-file for reading CALL TQOPNA('cosi.dat', 10, NOERR)
C Read data-file CALL TQRFIL(NOERR)
C Close data-file CALL TQCLOS(10, NOERR)
50 FORMAT(1X,A,G12.5,A)
C Defining the gas constant in J/mol.K R=8.31451
C Get thermochemical function values for SiO2(quartz) at 500 K T = 500.D0 CALL TQSETC('T ', 0, 0, T, NUMCON, NOERR) CALL TQINP('SiO2(quartz)', ISIO2, NOERR)
C Note that when retrieving CP, H, S, or G, the values are returned C dimensionless, which means they might have to be multiplied by C R*T. Since the default amount unit is mol, results are returned for 1 C mol. Note also that care has to be taken if a temperature unit C different from Kelvin has been used. CALL TQGDPC('CP ', ISIO2, 0, VALUE, NOERR) WRITE(*,FMT=50) 'CP of SiO2(quartz) at 500 K: ', * VALUE*R*T, ' J/mol.K'
CALL TQGDPC('H ', ISIO2, 0, VALUE, NOERR) WRITE(*,FMT=50) 'H of SiO2(quartz) at 500 K: ', * VALUE*R*T, ' J/mol'

Output:
 CP of SiO2(quartz) at 500 K:   59.498     J/mol.K
 H of SiO2(quartz) at 500 K: -0.90000E+06 J/mol

C The option 'T' serves a special purpose: If used, it returns the end C temperature of the current interval of the CP or G function for the C selected phase or phase constituent. Looking at the data-file cosi.dat C (see Appendix H.1), one sees from the entry for SiO2(quartz) C that for a temperature of 500 K, the temperature range of the G C function in question extends to 848 K. CALL TQGDPC('T ', ISIO2, 0, VALUE, NOERR) WRITE(*,FMT='(A)') ' For SiO2(quartz) and T = 500 K, the present' WRITE(*,FMT=50) 'temperature interval ends at: ', VALUE, ' K'

Output:
 For SiO2(quartz) and T = 500 K, the present
 temperature interval ends at:   848.00     K

C Setting a different temperature for which a different G function C interval applies T = 1000.D0 CALL TQSETC('T ', 0, 0, T, NUMCON, NOERR) CALL TQGDPC('T ', ISIO2, 0, VALUE, NOERR) WRITE(*,FMT='(A)') ' For SiO2(quartz) and T = 1000 K, the present' WRITE(*,FMT=50) 'temperature interval ends at: ', VALUE, ' K'

Output:
 For SiO2(quartz) and T = 1000 K, the present
 temperature interval ends at:   1744.2     K

C The option 'T' of TQGDPC is especially useful when the thermodynamic C values are calculated as a function of temperature, and the ranges of C the CP or G functions need to be known explicitly in order to locate C transition temperatures between different modifications and determine C the associated changes in the thermodynamic values.
END




C:View plain source code




/* Program cac20 */ /* Calculate thermodynamic quantities */
#include "cacint.h"
int main() { LI noerr, numcon, iSiO2; DB value, R, T;
/* Initialise ChemApp */ tqini(&noerr);
/* Open data-file for reading */ tqopna("cosi.dat",10,&noerr);
/* Read data-file */ tqrfil(&noerr);
/* Close data-file */ tqclos(10,&noerr);
/* Defining the gas constant in J/mol.K */ R = 8.31451;
/* Get thermochemical function values for SiO2(quartz) at 500 K */ T = 500.0; tqsetc("T", 0, 0, T, &numcon, &noerr); tqinp("SiO2(quartz)", &iSiO2, &noerr);
/* Note that when retrieving CP, H, S, or G, the values are returned dimensionless, which means they might have to be multiplied with R*T. Since the default amount unit is mol, results are returned for 1 mol. Note also that care has to be taken if a temperature unit different from Kelvin has been used. */ tqgdpc("CP", iSiO2, 0, &value, &noerr); printf("CP of SiO2(quartz) at 500 K: %g J/mol.K\n", value*R*T);
tqgdpc("H", iSiO2, 0, &value, &noerr); printf("H of SiO2(quartz) at 500 K: %g J/mol\n", value*R*T);

Output:
CP of SiO2(quartz) at 500 K: 59.498 J/mol.K
H of SiO2(quartz) at 500 K: -899999 J/mol

/* The option "T" serves a special purpose: If used, it returns the end temperature of the current interval of the CP or G function for the selected phase or phase constituent. Looking at the data-file cosi.dat (see Appendix H.1), one sees from the entry for SiO2(quartz) that for a temperature of 500 K, the temperature range of the G function in question extends to 848 K. */ tqgdpc("T", iSiO2, 0, &value, &noerr); printf("For SiO2(quartz) and T = 500 K, the present\n" "temperature interval ends at: %g K\n", value);

Output:
For SiO2(quartz) and T = 500 K, the present
temperature interval ends at: 848 K

/* Setting a different temperature for which a different G function interval applies */ T = 1000.0; tqsetc("T", 0, 0, T, &numcon, &noerr); tqgdpc("T", iSiO2, 0, &value, &noerr); printf("For SiO2(quartz) and T = 1000 K, the present\n" "temperature interval ends at: %g K\n", value);

Output:
For SiO2(quartz) and T = 1000 K, the present
temperature interval ends at: 1744.25 K

/* The option "T" of tqgdpc is especially useful when the thermodynamic values are calculated as a function of temperature, and the ranges of the CP or G functions need to be known explicitly in order to locate transition temperatures between different modifications and determine the associated changes in the thermodynamic values. */
return 0;
}


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