/[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 2290 - (show annotations) (download) (as text)
Sun Aug 15 10:11:54 2010 UTC (13 years, 10 months ago) by jpye
File MIME type: text/x-python
File size: 768 byte(s)
Trying to catch errors associated with pressure below triple point for CO2.
1 from fprops import *
2 from pylab import *
3 import sys
4
5 D = helmholtz_data_carbondioxide;
6
7 T = 220
8 rho = 600
9
10 print "T = %f, rho = %f" % (T,rho)
11 p = helmholtz_p(T,rho,D)
12 h = helmholtz_h(T,rho,D)
13 #p = 207.544081e5;
14 #h = 2722.928340e3
15 #p = 279.851966e5
16 #h = 1894.424202e3
17 #p = 1e5;
18 #h = 300e3;
19 sys.stderr.write("p = %f bar, h = %f kJ/kg\n" % (p/1e5, h/1e3))
20
21 #sys.stderr.write("p_raw(400,0.9) =", helmholtz_p_raw(400,0.9,D))
22
23 res, T, rho = fprops_solve_ph(p,h,0,D);
24
25 print "res = %d" % res
26
27 print "T = %f" % T
28 print "rho = %f" % rho
29
30 p_eval = helmholtz_p(T,rho,D)
31 h_eval = helmholtz_h(T,rho,D)
32 print "p(T,rho) = %f bar\t (target: %f, err = %e)" % (p_eval/1e5, p/1e5, (p_eval - p))
33 print "h(T,rho) = %f kJ/kg\t (target: %f, err = %e)" % (h_eval/1e3, h/1e3, (h_eval - h))
34

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