29 use utilities
, only: file_open
34 REAL :: reading2,reading3,sumfeed
35 CHARACTER (LEN=4) :: uoutp, uinp
36 CHARACTER (LEN=1) :: uoutt, uint
37 CHARACTER (LEN=50) :: filename
38 CHARACTER (LEN=30) :: reading1
42 CALL file_open(filename,30)
75 sumfeed = sumfeed + xif(i)
83 Else If (ncomp == 3)
Then 87 write(*,*)
'Solubility Code: This code is only for systems with 2 or 3 components!' 94 IF ( sumfeed /= 0.0 .AND. sumfeed /= 1.0 )
THEN 95 xif(1:ncomp) = xif(1:ncomp)/sumfeed
100 IF (uint ==
'C' )
THEN 105 IF ( uinp ==
'bar' )
THEN 107 ELSE IF ( uinp ==
'mbar' )
THEN 109 ELSE IF ( uinp ==
'MPa' )
THEN 111 ELSE IF ( uinp ==
'kPa' )
THEN 117 IF ( uoutt ==
'C' )
THEN 122 IF ( uoutp ==
'bar' )
THEN 124 ELSE IF ( uoutp ==
'mbar' )
THEN 126 ELSE IF ( uoutp ==
'MPa' )
THEN 128 ELSE IF ( uoutp ==
'kPa' )
THEN 140 WRITE (40,*)
' T P rho_1 rho_2 h_LV' 141 ELSE IF (ncomp == 2)
THEN 144 ELSE IF (ncomp == 3)
THEN 145 WRITE (40,*)
' x1_ph1 x2_ph1 x3_ph1 x1_ph2 x2_ph2 x3_ph2 T P rho1 rho2' 148 END SUBROUTINE read_input
161 use utilities
, only: si_dens
166 CHARACTER (LEN=4) :: t_ind
167 CHARACTER (LEN=4) :: p_ind
168 CHARACTER (LEN=4) :: char_ncomp
169 REAL :: density(np),w(np,nc)
172 CALL si_dens ( density, w )
174 IF ( u_in_p == 1.e5 )
THEN 176 ELSE IF ( u_in_p == 1.e2 )
THEN 178 ELSE IF ( u_in_p == 1.e6 )
THEN 180 ELSE IF ( u_in_p == 1.e3 )
THEN 185 IF ( u_in_t == 273.15 )
THEN 191 WRITE(*,*)
'--------------------------------------------------' 192 WRITE (char_ncomp,
'(I3)') ncomp
193 WRITE(*,
'(t2,a,f7.2,2a,f9.4,a)')
' T =',t-u_out_t,t_ind &
194 ,
' P =',p/u_out_p,p_ind
195 WRITE(*,
'(t15,4(a12,1x),10x,a)') (compna(i),i=1,ncomp)
196 WRITE(*,
'(2x,a,'//char_ncomp//
'(g13.6,1x))')
'PHASE I w', (w(1,i),i=1,ncomp)
197 WRITE(*,
'(2x,a,'//char_ncomp//
'(g13.6,1x))')
'PHASE II w', (w(2,i),i=1,ncomp)
198 WRITE(*,
'(2x,a,'//char_ncomp//
'(g13.6,1x))')
'PHASE I x', (exp(lnx(1,i)),i=1,ncomp)
199 WRITE(*,
'(2x,a,'//char_ncomp//
'(g13.6,1x))')
'PHASE II x', (exp(lnx(2,i)),i=1,ncomp)
200 WRITE(*,
'(2x,a,2(g13.6,1x))')
'DENSITY ', density(1),density(2)
205 IF ( ncomp == 1 )
THEN 206 WRITE (40,
'(9(2x,f18.8))') t-u_out_t, p/u_out_p, &
207 density(1), density(2),h_lv,cpres(1),cpres(2), &
208 speed_of_sound(1),speed_of_sound(2)
213 ELSE IF ( ncomp == 2 )
THEN 214 WRITE (40,
'(12(2x,G15.8))') 1.0-xi(1,1),1.0-xi(2,1), &
215 w(1,1),w(2,1),t-u_out_t, p/u_out_p, density(1),density(2) &
216 ,enthal(1),enthal(2),cpres(1),cpres(2)
217 ELSE IF ( ncomp == 3 )
THEN 218 WRITE (40,
'(10(2x,f15.8))') xi(1,1),xi(1,2),xi(1,3),xi(2,1),xi(2,2), &
219 xi(2,3),t-u_out_t, p/u_out_p, density(1),density(2)
222 END SUBROUTINE output
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...