/[ascend]/trunk/models/johnpye/fprops/python/solve_Tx.py
ViewVC logotype

Contents of /trunk/models/johnpye/fprops/python/solve_Tx.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2468 - (show annotations) (download) (as text)
Fri May 27 06:35:20 2011 UTC (11 years, 1 month ago) by jpye
File MIME type: text/x-python
File size: 540 byte(s)
Fix for current function names
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

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22