summaryrefslogtreecommitdiff
path: root/Dragon/src/INFPSA.f
blob: ca76de4dcbce02566259ececa813a3440b7c6c2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
*DECK INFPSA
      SUBROUTINE INFPSA(IPRINT,TEMPK,PURWGT,PRES)
*
*-----------------------------------------------------------------------
*
*Purpose:
* Compute pressure at saturation for a mixture of light and heavy water.
*
*Copyright:
* Copyright (C) 2016 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
*Author(s): C. Kieffer and G. Marleau
*
*Parameters: input
* IPRINT  print parameter.
* TEMPK   temperature (kelvin).
* PURWGT  D2O purity (in wgt%).
*
*Parameters: output
* PRES    pressure (Pa).
*
*-----------------------------------------------------------------------
*
      IMPLICIT NONE
*----
*  SUBROUTINE ARGUMENTS
*----
      INTEGER  IPRINT
      REAL     TEMPK,PURWGT,PRES
*----
*  LOCAL VARIABLES
*----
      INTEGER  IOUT
      CHARACTER NAMSBR*6
      PARAMETER (IOUT=6,NAMSBR='INFPSA')
      REAL      PD2O,PH2O,WGTD2O,WGTH2O,WGID2O,WGIH2O
      IF(IPRINT .GE. 10) THEN
        WRITE(IOUT,6000) NAMSBR
      ENDIF
*----
*  For heavy water, T limited to 90.5 C < T < 358.5 C
*----
      WGTD2O = 0.01 * PURWGT
      WGTH2O = 1.00 - WGTD2O
      IF(PURWGT .LT. 1.0) THEN
        CALL THMSAP(PH2O,TEMPK)
        WGIH2O=WGTH2O/PH2O
      ELSE
        PH2O=0.0
        WGIH2O=0.0
      ENDIF
      IF(PURWGT .GT. 0.0) THEN
        CALL THMHSP(PD2O,TEMPK)
        IF(PD2O .GT. 0.0) THEN
          WGID2O=WGTD2O/PD2O
        ELSE
          WGID2O=WGTD2O/PH2O
        ENDIF
      ELSE
        WGID2O=0.0
      ENDIF
      PRES = 1.0 /( WGIH2O +WGID2O ) + 0.01
*----
*  Processing finished, return
*----
      IF(IPRINT .GE. -10) THEN
        WRITE(IOUT,*) 'Saturation pressure (Pa)', PRES
        WRITE(IOUT,6001) NAMSBR
      ENDIF
      RETURN
*----
*  Output formats
*----
 6000 FORMAT('(* Output from --',A6,'-- follows ')
 6001 FORMAT('   Output from --',A6,'-- completed *)')
      END