TQSETC
Fortran |
TQSETC(STAVAR, INDEXP, INDEXC, VAL, NUMCON, IWSG, IWSE) |
|
---|---|---|
C-interface |
tq_setc(TC_STRING condition,TC_INT indexp,TC_INT indexc,TC_FLOAT val,TC_INT* numcon,TC_INT* iwsg,TC_INT* iwse); |
|
Full name: |
Set Condition. |
|
Purpose: |
To set conditions for an equilibrium calculation. |
|
Comments: |
In STAVAR the mnemonic of the state variable must be given, see Possible State Variables to Set Conditions in TQSETC. In some cases just the mnemonic is needed, like for temperature or pressure, but in many cases a phase index or a component index must be used to specify the condition. If both a phase index and a constituent index is supplied the condition is set for the specified constituent in the specified phase. The application program must set exactly the same number of conditions as degrees of freedom in the defined system. The degrees of freedom are equal to the number of system components plus two (usually temperature and pressure). Setting a phase FIXED using TQCSP decrease the degrees of freedom in the system by 1. Resetting the phase ENTERED using TQCSP restores one degree of freedom. Possible combinations of STAVAR and indices are listed in Possible State Variables to Set Conditions in TQSETC. Here it is shown that the same value of STAVAR may be used with or without an index. In the case there should not be an index, the value of INDEXP or INDEXC must be negative. Some combination of conditions may be thermodynamically impossible. The TQ-Interface provides relevant help for such cases. |
|
Arguments |
||
Name |
Type |
Value set on call or returned |
STAVAR |
Character*8 |
Set as a state variable |
INDEXP |
Integer |
Set as a phase index (if needed). |
INDEXC |
Integer |
Set as a component or constituent index (if needed). |
VAL |
Double precision |
Set to the value. |
NUMCON |
Integer |
Returned as an identification of the condition. |
IWSG |
Integer array |
Workspace |
IWSE |
Integer array |
Workspace |

Set the temperature to 800 Celsius
CALL TQSSU('Temperature','C',IWSG,IWSE)
CALL TQSETC('T',-1,-1,800.0D0,NCOND,IWSG,IWSE)
Set the incoming amount of a liquid phase constituent named Al2O3 to 1.5 moles
CALL TQGPI(INDEXP,'LIQUID',IWSG,IWSE)
CALL TQGPCI(INDEXP,INDEXC,'AL2O3',IWSG,IWSE)
CALL TQSETC('IN',INDEXP,INDEXC,1.5D0,NCOND,IWSG,IWSE)
Set the mass percent of the system component Cr to 13%.
CALL TQGSCI(INDEX,'cr',IWSG,IWSE)
CALL TQSETC('W%',-1,INDEX,13.0D0,NCOND,IWSG,IWSE)
Set the total amount of system to 1.0 mole components
CALL TQSETC('N',-1,-1,1.0D0,NCOND,IWSG,IWSE)
Set the mole fraction of H2O in GAS to 5 mol percent
CALL TQGPI(INDEXP,'GAS',IWSG,IWSE)
CALL TQGPCI(INDEXP,INDEXC,'H2O1',IWSG,IWSE)
CALL TQSETC('X',INDEXP,INDEXC,0.05D0,NCOND,IWSG,IWSE)

Note the following conventions to distinguish between the programming languages.
- Routines starting with TQXXX, for example, TQGDAT, are in the Fortran interface
- Routines starting with tq_xxxx, for example tq_gdat, are in the C-interface.
- In Fortran, all routines are subroutines and do not return any values except where explicitly declared as functions.
- All the C procedures are declared as void and do not return any values except where explicitly otherwise declared.
An example of how to read the subroutine definitions.