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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2235 - (show annotations) (download) (as text)
Thu Jul 29 08:45:54 2010 UTC (9 years, 11 months ago) by jpye
File MIME type: text/x-python
File size: 1001 byte(s)
we'll satisfy ourselves with a finite difference approximation of helm_resid_deldeldel for the moment, and
move on with the saturation curve problem.
1 import fprops
2
3 D = fprops.helmholtz_data_water;
4
5 from pylab import *
6 hold(1)
7
8 # temperature array
9 #TT = array([217, 230,240,250,260,280,290,300,310,350],'float')
10 TT = array([620],'float')
11
12 # density array
13 rr = logspace(log10(10),log10(1200), 200)
14
15 # legend strings
16 L = []
17
18 subplot(3,1,1)
19 for T in TT:
20 pp = [max(fprops.helmholtz_p(T,r,D),1.) for r in rr]
21 semilogy(rr,pp)
22 axis([10,1200,1.,1e6 * D.p_c])
23 L.append("T = %f K" % T)
24 ylabel('Pressure')
25 #legend(L)
26 axis([min(rr),max(rr),1e6,300e8])
27
28 L = []
29 subplot(3,1,2)
30 for T in TT:
31 pp = [fprops.helmholtz_dpdrho_T(T,r,D) for r in rr]
32 plot(rr,pp)
33 L.append("T = %f K" % T)
34 ylabel(r'$\left. \frac{\partial p}{\partial \rho} \right|_T$')
35 #legend(L)
36 axis([min(rr),max(rr),-1e6,1e6])
37
38 L = []
39 subplot(3,1,3)
40 for T in TT:
41 pp = [fprops.helmholtz_d2pdrho2_T(T,r,D) for r in rr]
42 plot(rr,pp)
43 L.append("T = %f K" % T)
44 ylabel(r'$\left. \frac{\partial^2 p}{\partial \rho^2} \right|_T$')
45 #legend(L)
46 #axis([min(rr),max(rr),-1e6,1e6])
47 xlabel('Density')
48
49 show()
50

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