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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2468 - (hide annotations) (download) (as text)
Fri May 27 06:35:20 2011 UTC (13 years, 1 month ago) by jpye
File MIME type: text/x-python
File size: 540 byte(s)
Fix for current function names
1 jpye 2468 import sys
2     from fprops import *
3 jpye 2467
4 jpye 2468 D = fprops_fluid("toluene");
5 jpye 2467
6     T = 300;
7     x = 0.5;
8    
9 jpye 2468 res, rho = fprops_solve_Tx(T,x, D);
10 jpye 2467
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 jpye 2468 h = helmholtz_h(T,rho,D);
20     u = helmholtz_u(T,rho,D);
21     s = helmholtz_s(T,rho,D);
22 jpye 2467
23     print "--> rho = %f, h = %f, s = %f, u = %f" % (rho,h,u,s)
24    
25     print "\nchecking reverse solve:"
26    
27 jpye 2468 res, psat, rhof, rhog = fprops_sat_T(T,D)
28 jpye 2467
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