1 |
import sys |
2 |
from fprops import * |
3 |
|
4 |
D = fprops_fluid("toluene"); |
5 |
|
6 |
T = 300; |
7 |
x = 0.5; |
8 |
|
9 |
res, rho = fprops_solve_Tx(T,x, D); |
10 |
|
11 |
if res: |
12 |
print "failed to solve state, exiting." |
13 |
sys.exit(1); |
14 |
|
15 |
print "solved state" |
16 |
|
17 |
print "T = %f, x = %f" % (T,x) |
18 |
|
19 |
h = helmholtz_h(T,rho,D); |
20 |
u = helmholtz_u(T,rho,D); |
21 |
s = helmholtz_s(T,rho,D); |
22 |
|
23 |
print "--> rho = %f, h = %f, s = %f, u = %f" % (rho,h,u,s) |
24 |
|
25 |
print "\nchecking reverse solve:" |
26 |
|
27 |
res, psat, rhof, rhog = fprops_sat_T(T,D) |
28 |
|
29 |
x1 = (1./rho - 1./rhof) / (1./rhog - 1./rhof); |
30 |
|
31 |
print "--> x = %f" % x1 |
32 |
|
33 |
sys.exit(0) |
34 |
|