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

Contents of /trunk/models/johnpye/fprops/regenerator_plot.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2674 - (show annotations) (download) (as text)
Thu Jan 24 02:27:41 2013 UTC (9 years, 5 months ago) by jpye
File MIME type: text/x-python
File size: 1366 byte(s)
Brayton cycle models working OK know with new FPROPS.
1 # -*- coding: utf8 -*-
2 import extpy, sys
3 from solverreporter import *
4 from __builtin__ import *
5
6 import sys, os, os.path
7 sys.path.append(os.path.expanduser("~/ascend/models/johnpye/fprops/python"))
8 import fprops
9
10 try:
11 from pylab import *
12 except:
13 pass
14
15 def plot_TH(SS,style='b-',Href = 0):
16 xx = []
17 yy = []
18 for S in SS:
19 yy.append(float(S.T) - 273.15)
20 xx.append(((float(S.h)*float(S.mdot)) - Href)/1.e6)
21 plot(xx,yy,style)
22
23 def regenerator_plot_fprops(self):
24 """Plot T-H diagram of regenerator"""
25 import loading; loading.load_matplotlib(throw=True)
26 ioff(); figure(); hold(1)
27 FH = fprops.fluid(str(self.hxd.component_hot.getSymbolValue()),str(self.hxd.type_hot.getSymbolValue()))
28 FC = fprops.fluid(str(self.hxd.component.getSymbolValue()),str(self.hxd.type.getSymbolValue()))
29
30 extpy.getbrowser().reporter.reportNote("Hot fluid is %s, cold fluid is %s" % (FH.name, FC.name))
31
32 plot_TH(pconsth(self.inlet_hot, self.outlet_hot, 50),'r-',
33 Href = (float(self.outlet_hot.h)*float(self.outlet_hot.mdot))\
34 )
35
36 plot_TH(pconsth(self.inlet, self.outlet, 50),'b-',
37 Href = (float(self.inlet.h)*float(self.inlet.mdot))\
38 )
39
40 title(unicode(r"%s-%s heat exchanger" % (FH.name, FC.name)))
41 ylabel(unicode(r"T / [��C]"))
42 xlabel("H / [MW]")
43
44 extpy.getbrowser().reporter.reportNote("Plotting completed")
45 ion()
46 show()
47
48 extpy.registermethod(regenerator_plot_fprops)
49

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