/[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 2632 - (show annotations) (download) (as text)
Wed Aug 8 03:37:15 2012 UTC (8 years ago) by jpye
File MIME type: text/x-python
File size: 1180 byte(s)
missing file for heatex_pinch.
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 D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
28 extpy.getbrowser().reporter.reportNote("Fluid is %s" % D.name)
29
30 plot_TH(pconsth(self.inlet_hot, self.outlet_hot, 50),'r-',
31 Href = (float(self.outlet_hot.h)*float(self.outlet_hot.mdot))\
32 )
33
34 plot_TH(pconsth(self.inlet, self.outlet, 50),'b-',
35 Href = (float(self.inlet.h)*float(self.inlet.mdot))\
36 )
37
38 title(unicode(r"%s heat exchanger" % D.name))
39 ylabel(unicode(r"T / [��C]"))
40 xlabel("H / [MW]")
41
42 extpy.getbrowser().reporter.reportNote("Plotting completed")
43 ion()
44 show()
45
46 extpy.registermethod(regenerator_plot_fprops)
47

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