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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2301 - (show annotations) (download) (as text)
Sat Aug 21 13:28:35 2010 UTC (13 years, 9 months ago) by jpye
File MIME type: text/x-python
File size: 770 byte(s)
Regen toluene model working, next water.
1 from fprops import *
2 from pylab import *
3 import sys
4
5 D = fprops_fluid('carbondioxide');
6
7 T = 220
8 rho = 600
9
10
11 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 #p = 279.851966e5
17 #h = 1894.424202e3
18 #p = 1e5;
19 #h = 300e3;
20 sys.stderr.write("p = %f bar, h = %f kJ/kg\n" % (p/1e5, h/1e3))
21
22 #sys.stderr.write("p_raw(400,0.9) =", helmholtz_p_raw(400,0.9,D))
23
24 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 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

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