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

Annotation of /trunk/models/johnpye/fprops/python/solve_ph.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2301 - (hide annotations) (download) (as text)
Sat Aug 21 13:28:35 2010 UTC (13 years, 10 months ago) by jpye
File MIME type: text/x-python
File size: 770 byte(s)
Regen toluene model working, next water.
1 jpye 2251 from fprops import *
2     from pylab import *
3 jpye 2268 import sys
4 jpye 2251
5 jpye 2297 D = fprops_fluid('carbondioxide');
6 jpye 2251
7 jpye 2290 T = 220
8     rho = 600
9 jpye 2268
10 jpye 2301
11 jpye 2267 print "T = %f, rho = %f" % (T,rho)
12     p = helmholtz_p(T,rho,D)
13     h = helmholtz_h(T,rho,D)
14     #p = 207.544081e5;
15     #h = 2722.928340e3
16 jpye 2260 #p = 279.851966e5
17     #h = 1894.424202e3
18     #p = 1e5;
19     #h = 300e3;
20 jpye 2270 sys.stderr.write("p = %f bar, h = %f kJ/kg\n" % (p/1e5, h/1e3))
21 jpye 2251
22 jpye 2270 #sys.stderr.write("p_raw(400,0.9) =", helmholtz_p_raw(400,0.9,D))
23 jpye 2254
24 jpye 2251 res, T, rho = fprops_solve_ph(p,h,0,D);
25    
26     print "res = %d" % res
27    
28     print "T = %f" % T
29     print "rho = %f" % rho
30    
31 jpye 2257 p_eval = helmholtz_p(T,rho,D)
32     h_eval = helmholtz_h(T,rho,D)
33     print "p(T,rho) = %f bar\t (target: %f, err = %e)" % (p_eval/1e5, p/1e5, (p_eval - p))
34     print "h(T,rho) = %f kJ/kg\t (target: %f, err = %e)" % (h_eval/1e3, h/1e3, (h_eval - h))
35 jpye 2251

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