TQSSIC
Fortran |
TQSSIC(STAVAR, VALUE, IWSG, IWSE) |
|
---|---|---|
C-interface |
tq_ssic(TC_STRING stavar,TC_FLOAT value,TC_INT* iwsg,TC_INT* iwse); |
|
Full name: |
Set Stream Invariant State Variable. |
|
Purpose: |
To specify the invariant state variable for calculating the reaction of all streams. |
|
Comments: |
The state variables that could be used are G, H, S, and V with a suffix D, which means difference between initial and final states of the reaction. |
|
Arguments |
||
Name |
Type |
Value set on call or returned |
STAVAR |
Character*8 |
Set as the mnemonic of a state variable. |
VALUE |
Double precision |
Set to change in value of STAVAR. |
IWSG |
Integer array |
Workspace |
IWSE |
Integer array |
Workspace |

Calculation of adiabatic temperature for knallgas.
DIMENSION TPA(2)
C...set input temperature and pressure
TEMP=298.15D0
PRES=1.0D5
C...create the stream
CALL TQCSTM('knallgas',TEMP,PRES,IWSG,IWSE)
C...set amount of H2 and O2 in the stream
CALL TQGPCI(1,INDEXC,'H2',IWSG,IWSE)
CALL TQSSC('knallgas',1,INDEXC,2.0D0,NUMIN,IWSG,IWSE)
CALL TQGPCI(1,INDEXC,'O2',IWSG,IWSE)
CALL TQSSC('knallgas',1,INDEXC,1.0D0,NUMIN,IWSG,IWSE)
C...set the global temperature and pressure for the reaction
CALL TQSETC('T',-1,-1,500.0D+0,NUMC,IWSG,IWSE)
CALL TQSETC('P',-1,-1,PRES,NUMC,IWSG,IWSE)
C...get the enthalpy of reaction
CALL TQCE(' ',-1,-1,0.0D+0,IWSG,IWSE)
CALL TQGETV1('HD',-1,-1,ENT,IWSG,IWSE)
WRITE(*,*)'Calculated enthalpy of reaction are '
&, ENT, ' at 500 K. '
C...set that the enthalpy shall be constant in the calculation
CALL TQSSIC('HD',0.0D0,IWSG,IWSE)
C...calculate
CALL TQCE('T',-1,-1,1.0D+0,IWSG,IWSE)
C...get temperature
CALL TQGETV1('T',-1,-1,TEMP,IWSG,IWSE)
WRITE(*,*)'Calculated temperature ',TEMP

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.