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

Diff of /trunk/models/johnpye/fprops/cycle_plot.py

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

revision 2691 by jpye, Wed Jan 16 05:57:03 2013 UTC revision 2692 by jpye, Tue Mar 5 04:45:27 2013 UTC
# Line 111  def cycle_plot_rankine(self): Line 111  def cycle_plot_rankine(self):
111      extpy.getbrowser().reporter.reportNote("Plotting completed")      extpy.getbrowser().reporter.reportNote("Plotting completed")
112      ion()      ion()
113      show()      show()
114      savefig(os.path.expanduser("~/Desktop/rankine.eps"))      #savefig(os.path.expanduser("~/Desktop/rankine.eps"))
115    
116    def cycle_plot_rankine_reheat(self):
117        """Plot T-s diagram for a reheat Rankine cycle"""
118        import loading
119        loading.load_matplotlib(throw=True)
120        ioff()
121        figure()
122        hold(1)
123        D = fprops.fluid(str(self.cd.component.getSymbolValue()))
124        sat_curve(D)
125    
126        boiler1_curve = pconst(self.BO1.inlet, self.BO1.outlet,100)
127        boiler2_curve = pconst(self.BO2.inlet, self.BO2.outlet,50)
128        condenser_curve = pconst(self.CO.inlet,self.CO.outlet,100)
129        SS = [self.PU.outlet, self.BO1.inlet] + \
130            boiler1_curve + [self.TU1.inlet, self.TU1.outlet] + \
131            boiler2_curve + [self.TU2.inlet, self.TU2.outlet] + \
132            condenser_curve + [self.CO.outlet, self.PU.outlet]
133        plot_Ts(SS)
134    
135        plot_Ts(
136            [self.PU.inlet, self.BO1.inlet, self.TU1.inlet, self.BO2.inlet
137                ,self.TU2.inlet, self.CO.inlet]
138            ,'bo'
139        )
140    
141        title(unicode(r"Reheat Rankine cycle with %s" % D.name))
142        ylabel(unicode(r"T / [°C]"))
143        aa = axis(); axis([aa[0],aa[1],-100,600])
144        xlabel("s / [kJ/kg/K]")
145    
146        extpy.getbrowser().reporter.reportNote("Plotting completed")
147        ion()
148        show()
149        #savefig(os.path.expanduser("~/Desktop/rankine-reheat.eps"))
150    
151  def cycle_plot_rankine_regen2(self):  def cycle_plot_rankine_regen2(self):
152      """Plot T-s diagram for a regenerative Rankine cycle (bleed steam regen)"""      """Plot T-s diagram for a regenerative Rankine cycle (bleed steam regen)"""
# Line 120  def cycle_plot_rankine_regen2(self): Line 155  def cycle_plot_rankine_regen2(self):
155      ioff()      ioff()
156      figure()      figure()
157      hold(1)      hold(1)
158      D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))      D = fprops.fluid(str(self.cd.component.getSymbolValue()))
159      sat_curve(D)      sat_curve(D)
160    
161      boiler_curve = pconst(self.BO.inlet, self.BO.outlet,100)      boiler_curve = pconst(self.BO.inlet, self.BO.outlet,100)
# Line 142  def cycle_plot_rankine_regen2(self): Line 177  def cycle_plot_rankine_regen2(self):
177      )      )
178    
179      # line for the heat exchanger      # line for the heat exchanger
180      plot_Ts(pconst(self.HE.inlet_heat, self.HE.outlet,100),'b-')      plot_Ts(pconst(self.HE.inlet_heat, self.HE.outlet,100),'b:')
181    
182      title(unicode(r"Regenerative Rankine cycle with %s" % D.name))      title(unicode(r"Regenerative Rankine cycle with %s" % D.name))
183      ylabel(unicode(r"T / [°C]"))      ylabel(unicode(r"T / [°C]"))
# Line 152  def cycle_plot_rankine_regen2(self): Line 187  def cycle_plot_rankine_regen2(self):
187      extpy.getbrowser().reporter.reportNote("Plotting completed")      extpy.getbrowser().reporter.reportNote("Plotting completed")
188      ion()      ion()
189      show()      show()
190      savefig(os.path.expanduser("~/Desktop/regen2.eps"))      #savefig(os.path.expanduser("~/Desktop/regen2.eps"))
191    
192    
193    
# Line 192  def cycle_plot_rankine_regen1(self): Line 227  def cycle_plot_rankine_regen1(self):
227      extpy.getbrowser().reporter.reportNote("Plotting completed")      extpy.getbrowser().reporter.reportNote("Plotting completed")
228      ion()      ion()
229      show()      show()
230      savefig(os.path.expanduser("~/Desktop/regen1.eps"))      #savefig(os.path.expanduser("~/Desktop/regen1.eps"))
231    
232    
233  #--- heat exchange (T,H) plot ---  #--- heat exchange (T,H) plot ---
# Line 224  def heater_closed_plot(self): Line 259  def heater_closed_plot(self):
259      extpy.getbrowser().reporter.reportNote("Plotting completed")      extpy.getbrowser().reporter.reportNote("Plotting completed")
260      ion()      ion()
261      show()      show()
262      savefig(os.path.expanduser("~/Desktop/heater_closed.eps"))      #savefig(os.path.expanduser("~/Desktop/heater_closed.eps"))
263    
264  #--- the big one: a combined-cycle GT ---  #--- the big one: a combined-cycle GT ---
265    
# Line 258  def cycle_plot_ccgt(self): Line 293  def cycle_plot_ccgt(self):
293      extpy.getbrowser().reporter.reportNote("Plotting completed")      extpy.getbrowser().reporter.reportNote("Plotting completed")
294      ion()      ion()
295      show()      show()
296      savefig(os.path.expanduser("~/Desktop/ccgt.eps"))      #savefig(os.path.expanduser("~/Desktop/ccgt.eps"))
297      savefig(os.path.expanduser("~/Desktop/ccgt.png"))      #savefig(os.path.expanduser("~/Desktop/ccgt.png"))
298    
299    
300  #--- simple gas turbine models ---  #--- simple gas turbine models ---
# Line 285  def cycle_plot_brayton_regen(self): Line 320  def cycle_plot_brayton_regen(self):
320      extpy.getbrowser().reporter.reportNote("Plotting completed")      extpy.getbrowser().reporter.reportNote("Plotting completed")
321      ion()      ion()
322      show()      show()
323      savefig(os.path.expanduser("~/Desktop/brayton_regen.eps"))      #savefig(os.path.expanduser("~/Desktop/brayton_regen.eps"))
324    
325  #--- air-to-stream heat exchanger plot ---  #--- air-to-stream heat exchanger plot ---
326    
# Line 317  def air_stream_heat_exchanger_plot(self) Line 352  def air_stream_heat_exchanger_plot(self)
352      extpy.getbrowser().reporter.reportNote("Plotting completed")      extpy.getbrowser().reporter.reportNote("Plotting completed")
353      ion()      ion()
354      show()      show()
355      savefig(os.path.expanduser("~/Desktop/air_stream_heatex.eps"))      #savefig(os.path.expanduser("~/Desktop/air_stream_heatex.eps"))
356    
357    
358  extpy.registermethod(cycle_plot_rankine)  extpy.registermethod(cycle_plot_rankine)
359    extpy.registermethod(cycle_plot_rankine_reheat)
360  extpy.registermethod(cycle_plot_rankine_regen1)  extpy.registermethod(cycle_plot_rankine_regen1)
361  extpy.registermethod(cycle_plot_rankine_regen2)  extpy.registermethod(cycle_plot_rankine_regen2)
362  extpy.registermethod(cycle_plot_brayton_regen)  extpy.registermethod(cycle_plot_brayton_regen)

Legend:
Removed from v.2691  
changed lines
  Added in v.2692

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