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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2467 by jpye, Fri May 27 06:33:38 2011 UTC revision 2468 by jpye, Fri May 27 06:35:20 2011 UTC
# Line 1  Line 1 
1  import fprops,sys  import sys
2    from fprops import *
3    
4  D = fprops.fluid("toluene");  D = fprops_fluid("toluene");
5    
6  T = 300;  T = 300;
7  x = 0.5;  x = 0.5;
8    
9  res, rho = fprops.solve_Tx(T,x, D);  res, rho = fprops_solve_Tx(T,x, D);
10    
11  if res:  if res:
12      print "failed to solve state, exiting."      print "failed to solve state, exiting."
# Line 15  print "solved state" Line 16  print "solved state"
16    
17  print "T = %f, x = %f" % (T,x)  print "T = %f, x = %f" % (T,x)
18    
19  h = fprops.helmholtz_h(T,rho,D);  h = helmholtz_h(T,rho,D);
20  u = fprops.helmholtz_u(T,rho,D);  u = helmholtz_u(T,rho,D);
21  s = fprops.helmholtz_s(T,rho,D);  s = helmholtz_s(T,rho,D);
22    
23  print "--> rho = %f, h = %f, s = %f, u = %f" % (rho,h,u,s)  print "--> rho = %f, h = %f, s = %f, u = %f" % (rho,h,u,s)
24    
25  print "\nchecking reverse solve:"  print "\nchecking reverse solve:"
26    
27  res, psat, rhof, rhog = fprops.sat_T(T,D)  res, psat, rhof, rhog = fprops_sat_T(T,D)
28    
29  x1 = (1./rho - 1./rhof) / (1./rhog - 1./rhof);  x1 = (1./rho - 1./rhof) / (1./rhog - 1./rhof);
30    

Legend:
Removed from v.2467  
changed lines
  Added in v.2468

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