def cycle_plot_brayton_split_regen(self):
	"""Plot T-s diagran for regenerative gas turbine"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()		
	hold(1)
	D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
	sat_curve(D)
	
	# plot gas turbine cycle
	boiler_curve = pconst(self.BO.inlet, self.BO.outlet,100)
	condenser_curve = pconst(self.CO.inlet,self.CO.outlet,100)
	SS = [self.PU2.inlet, self.PU2.outlet, self.HEL.inlet, self.HEL.outlet, self.HEH.inlet, self.HEH.outlet] + boiler_curve + [self.TU.inlet, self.TU.outlet,self.HEH.inlet_hot, self.HEH.outlet_hot, self.HEL.inlet_hot, self.HEL.outlet_hot, self.CO.inlet, self.CO.outlet, self.PU2.inlet]
	plot_Ts(SS)
	hold(1)

	title(unicode(r"Split Regenerative Brayton cycle"))
	ylabel(unicode(r"T / [°C]"))
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
	savefig(os.path.expanduser("~/Desktop/brayton__split_regen.eps"))
def cycle_plot_brayton_split_rachel(self):
	"""Plot T-s diagram for a split Brayton cycle"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()
	hold(1)
	D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
	sat_curve(D)

	boiler_curve = pconst(self.BO.inlet, self.BO.outlet,100)
	condenser_curve = pconst(self.CO.inlet,self.CO.outlet,100)
	heh_hot_curve = pconst (self.HEH.inlet_hot, self.HEH.outlet_hot,100)
	hel_hot_curve = pconst (self.HEL.inlet_hot, self.HEL.outlet_hot,100)
	hel_curve = pconst(self.HEL.inlet, self.HEL.outlet,100)
	heh_curve = pconst(self.HEH.inlet, self,HEH.outlet,100)
	SS = boiler_curve + [self.TU.inlet, self.TU.outlet] + heh_hot_curve + hel_hot_curve + condenser_curve + [self.PU2.inlet, self.PU2.outlet]+ hel_curve + heh_curve
	plot_Ts(SS)

	title(unicode(r"Brayton cycle with %s" % D.name))
	ylabel(unicode(r"T / [°C]"))
	aa = axis(); axis([aa[0],aa[1],-100,600])
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
	savefig(os.path.expanduser("~/Desktop/brayton.eps"))
def cycle_plot_brayton_reheat_regen(self):
    """Plot T-s diagram for reheat-regenerative gas turbine"""
    import loading
    loading.load_matplotlib(throw=True)
    ioff()
    figure()
    """hold(1)
	D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
	sat_curve(D)"""

    # plot gas turbine cycle
    boiler1_curve = pconst(self.BO1.inlet, self.BO1.outlet, 100)
    boiler2_curve = pconst(self.BO2.inlet, self.BO2.outlet, 100)
    condenser_curve = pconst(self.CO.inlet, self.CO.outlet, 1000)
    SS = [self.PU.inlet, self.PU.outlet] + boiler1_curve + [
        self.TU1.inlet, self.TU1.outlet
    ] + boiler2_curve + [
        self.TU2.inlet, self.TU2.outlet, self.CO.inlet, self.CO.outlet,
        self.PU.inlet
    ]
    plot_Ts(SS)
    hold(1)

    title(unicode(r"Reheat Regenerative Brayton cycle"))
    ylabel(unicode(r"T / [°C]"))
    xlabel("s / [kJ/kg/K]")

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
示例#4
0
def fourbarplot(self):
	"""Plot the geometry of the four-bar linkage"""
	# following is an unfortunate necessity in the current system architecture:

	import loading
	loading.load_matplotlib(throw=True)

	browser = extpy.getbrowser()
	browser.do_solve()	

	ioff()
	figure()
	gca().set_aspect('equal', adjustable='datalim')
	hold(True)

	for alpha in range(10,74,4):
		self.alpha.setRealValueWithUnits(alpha,"deg")
		try:
			browser.sim.solve(browser.solver,SimpleSolverReporter(browser))
		except:
			browser.reporter.reportError('Failed to solve for alpha = %d' % alpha)
			continue
	
		x = [float(x) for x in [self.x_A, self.x_B, self.x_C, self.x_D]]
		y = [float(y) for y in [self.y_A, self.y_B, self.y_C, self.y_D]]

		plot(x,y,"y-")
		plot(x[0:2],y[0:2],"ro")
		plot(x[2:4],y[2:4],"bo")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
def cycle_plot_brayton_split_regen(self):
    """Plot T-s diagran for regenerative gas turbine"""
    import loading
    loading.load_matplotlib(throw=True)
    ioff()
    figure()
    hold(1)
    D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
    sat_curve(D)

    # plot gas turbine cycle
    boiler_curve = pconst(self.BO.inlet, self.BO.outlet, 100)
    condenser_curve = pconst(self.CO.inlet, self.CO.outlet, 100)
    SS = [
        self.PU2.inlet, self.PU2.outlet, self.HEL.inlet, self.HEL.outlet,
        self.HEH.inlet, self.HEH.outlet
    ] + boiler_curve + [
        self.TU.inlet, self.TU.outlet, self.HEH.inlet_hot, self.HEH.outlet_hot,
        self.HEL.inlet_hot, self.HEL.outlet_hot, self.CO.inlet, self.CO.outlet,
        self.PU2.inlet
    ]
    plot_Ts(SS)
    hold(1)

    title(unicode(r"Split Regenerative Brayton cycle"))
    ylabel(unicode(r"T / [°C]"))
    xlabel("s / [kJ/kg/K]")

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
    savefig(os.path.expanduser("~/Desktop/brayton__split_regen.eps"))
示例#6
0
def fourbarplot(self):
    """Plot the geometry of the four-bar linkage"""
    # following is an unfortunate necessity in the current system architecture:

    import loading
    loading.load_matplotlib(throw=True)

    browser = extpy.getbrowser()
    browser.do_solve()

    ioff()
    figure()
    gca().set_aspect('equal', adjustable='datalim')
    hold(True)

    for alpha in range(10, 74, 4):
        self.alpha.setRealValueWithUnits(alpha, "deg")
        try:
            browser.sim.solve(browser.solver, SimpleSolverReporter(browser))
        except:
            browser.reporter.reportError('Failed to solve for alpha = %d' %
                                         alpha)
            continue

        x = [float(x) for x in [self.x_A, self.x_B, self.x_C, self.x_D]]
        y = [float(y) for y in [self.y_A, self.y_B, self.y_C, self.y_D]]

        plot(x, y, "y-")
        plot(x[0:2], y[0:2], "ro")
        plot(x[2:4], y[2:4], "bo")

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
def cycle_plot_brayton_split_rachel(self):
    """Plot T-s diagram for a split Brayton cycle"""
    import loading
    loading.load_matplotlib(throw=True)
    ioff()
    figure()
    hold(1)
    D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
    sat_curve(D)

    boiler_curve = pconst(self.BO.inlet, self.BO.outlet, 100)
    condenser_curve = pconst(self.CO.inlet, self.CO.outlet, 100)
    heh_hot_curve = pconst(self.HEH.inlet_hot, self.HEH.outlet_hot, 100)
    hel_hot_curve = pconst(self.HEL.inlet_hot, self.HEL.outlet_hot, 100)
    hel_curve = pconst(self.HEL.inlet, self.HEL.outlet, 100)
    heh_curve = pconst(self.HEH.inlet, self, HEH.outlet, 100)
    SS = boiler_curve + [
        self.TU.inlet, self.TU.outlet
    ] + heh_hot_curve + hel_hot_curve + condenser_curve + [
        self.PU2.inlet, self.PU2.outlet
    ] + hel_curve + heh_curve
    plot_Ts(SS)

    title(unicode(r"Brayton cycle with %s" % D.name))
    ylabel(unicode(r"T / [°C]"))
    aa = axis()
    axis([aa[0], aa[1], -100, 600])
    xlabel("s / [kJ/kg/K]")

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
    savefig(os.path.expanduser("~/Desktop/brayton.eps"))
示例#8
0
def heater_closed_plot(self):
	"""Plot T-H diagram of heat transfer in a heater_closed model"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()
	hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()))
	HE = self.HE

	extpy.getbrowser().reporter.reportNote("Fluid is %s" % D.name)	

	plot_TH(pconsth(HE.inlet_heat, HE.outlet_heat, 50),'r-',
		Href = (float(HE.outlet_heat.h)*float(HE.outlet_heat.mdot))\
	)

	plot_TH(pconsth(HE.inlet, HE.outlet, 50),'b-',
		Href = (float(HE.inlet.h)*float(HE.inlet.mdot))\
	)

	title(unicode(r"Closed feedwater heater with %s" % D.name))
	ylabel(unicode(r"T / [°C]"))
	xlabel("H / [MW]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#9
0
def cycle_plot_rankine_reheat(self):
	"""Plot T-s diagram for a reheat Rankine cycle"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()
	hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()))
	sat_curve(D)

	boiler1_curve = pconst(self.BO1.inlet, self.BO1.outlet,100)
	boiler2_curve = pconst(self.BO2.inlet, self.BO2.outlet,50)
	condenser_curve = pconst(self.CO.inlet,self.CO.outlet,100)
	SS = [self.PU.outlet, self.BO1.inlet] + \
		boiler1_curve + [self.TU1.inlet, self.TU1.outlet] + \
		boiler2_curve + [self.TU2.inlet, self.TU2.outlet] + \
		condenser_curve + [self.CO.outlet, self.PU.outlet]
	plot_Ts(SS)

	plot_Ts(
		[self.PU.inlet, self.BO1.inlet, self.TU1.inlet, self.BO2.inlet
			,self.TU2.inlet, self.CO.inlet]
		,'bo'
	)

	title(unicode(r"Reheat Rankine cycle with %s" % D.name))
	ylabel(unicode(r"T / [°C]"))
	aa = axis(); axis([aa[0],aa[1],-100,600])
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#10
0
def cycle_plot_brayton_reheat_regen(self):
	"""Plot T-s diagram for reheat-regenerative gas turbine"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()		
	"""hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()))
	sat_curve(D)"""
	
	# plot gas turbine cycle
	boiler1_curve = pconst(self.BO1.inlet, self.BO1.outlet,100)
	boiler2_curve = pconst(self.BO2.inlet, self.BO2.outlet,100)
	condenser_curve = pconst(self.CO.inlet,self.CO.outlet,1000)
	SS = [self.PU.inlet, self.PU.outlet] + boiler1_curve + [self.TU1.inlet, self.TU1.outlet] + boiler2_curve + [self.TU2.inlet, self.TU2.outlet, self.CO.inlet, self.CO.outlet, self.PU.inlet]
	plot_Ts(SS)
	hold(1)

	title(unicode(r"Reheat Regenerative Brayton cycle"))
	ylabel(unicode(r"T / [°C]"))
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#11
0
def air_stream_heat_exchanger_plot(self):
	"""Plot T-H diagram of heat transfer in a heater_closed model"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()
	hold(1)
	D = fprops.fluid(str(self.cd_cold.component.getSymbolValue()))

	n = self.n.getIntValue()
	extpy.getbrowser().reporter.reportNote("Fluid is %s" % D.name)	

	# hot side is the air, calculated in the model
	plot_TH( [self.H[i] for i in range(1+int(n))],'r-',\
		Href = (float(self.outlet.h)*float(self.outlet.mdot))\
	)

	plot_TH(pconsth(self.inlet_cold, self.outlet_cold, 50),'b-',
		Href = (float(self.inlet_cold.h)*float(self.inlet_cold.mdot))\
	)

	title(unicode(r"Combined-cycle air-%s heat exchanger" % D.name))
	ylabel(unicode(r"T / [°C]"))
	xlabel("H / [MW]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#12
0
def regenerator_plot_fprops(self):
    """Plot T-H diagram of regenerator"""
    import loading
    loading.load_matplotlib(throw=True)
    ioff()
    figure()
    hold(1)
    FH = fprops.fluid(str(self.hxd.component_hot.getSymbolValue()),
                      str(self.hxd.type_hot.getSymbolValue()))
    FC = fprops.fluid(str(self.hxd.component.getSymbolValue()),
                      str(self.hxd.type.getSymbolValue()))

    extpy.getbrowser().reporter.reportNote(
        "Hot fluid is %s, cold fluid is %s" % (FH.name, FC.name))

    plot_TH(pconsth(self.inlet_hot, self.outlet_hot, 50),'r-',
     Href = (float(self.outlet_hot.h)*float(self.outlet_hot.mdot))\
    )

    plot_TH(pconsth(self.inlet, self.outlet, 50),'b-',
     Href = (float(self.inlet.h)*float(self.inlet.mdot))\
    )

    title(unicode(r"%s-%s heat exchanger" % (FH.name, FC.name)))
    ylabel(unicode(r"T / [°C]"))
    xlabel("H / [MW]")

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
示例#13
0
def cycle_plot_ccgt(self):
	"""Plot T-s diagram for combined-cycle gas turbine"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()

	D = fprops.fluid(str(self.cd_rankine.component.getSymbolValue()))

	# plot gas turbine cycle
	SS = [self.GC.inlet, self.GC.outlet, self.GT.inlet, self.GT.outlet, self.HE.inlet, self.HE.outlet, self.GC.inlet]
	plot_Ts(SS,'g-')
	plot_Ts(SS,'go')
	hold(1)
	
	sat_curve(D)

	boiler_curve = pconst(self.HE.inlet_cold,self.HE.outlet_cold,100)
	condenser_curve = pconst(self.CO.inlet,self.CO.outlet,100)
	SS2 = [self.PU.outlet, self.HE.inlet_cold] + boiler_curve + [self.HE.outlet_cold, self.TU.inlet, self.TU.outlet, self.CO.inlet] + condenser_curve + [self.CO.outlet, self.PU.inlet, self.PU.outlet]
	plot_Ts(SS2)
	plot_Ts([self.PU.outlet, self.HE.inlet_cold,self.HE.outlet_cold, self.TU.inlet, self.TU.outlet, self.CO.inlet,self.CO.outlet, self.PU.inlet, self.PU.outlet],'bo')

	title(unicode(r"Combined cycle with air and %s" % D.name))
	ylabel(unicode(r"T / [°C]"))
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#14
0
def cycle_plot_brayton_reheat_regen_intercool(self):
    """Plot T-s diagram for reheat-regenerative gas turbine"""
    import loading
    loading.load_matplotlib(throw=True)
    ioff()
    figure()
    hold(1)
    D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
    sat_curve(D)

    # add some dots for the points in the cycle
    seq = "CO1.inlet DI2.inlet CO2.inlet RE.inlet BU1.inlet TU1.inlet BU2.inlet TU2.inlet RE.inlet_hot DI1.inlet".split(
        " ")
    lalign = "TU2.inlet RE.inlet_hot BU2.inlet DI1.inlet DI2.inlet CO1.inlet".split(
        " ")
    SS1 = []
    SS1a = []
    for s in seq:
        print "looking at '%s'" % s
        p = reduce(getattr, s.split("."), self)
        SS1.append(p)
        SS1a.append((p, s))
    plot_Ts(SS1, 'bo')

    print "ANNOTATIONS"
    for s in SS1a:
        align = "right"
        if s[1] in lalign:
            align = "left"
        annotate(s[1] + "  ",
                 xy=(float(s[0].s) / 1.e3, float(s[0].T) - 273.15),
                 horizontalalignment=align)

    # plot the cycle with smooth curves
    BU1_curve = pconst(self.BU1.inlet, self.BU1.outlet, 30)
    BU2_curve = pconst(self.BU2.inlet, self.BU2.outlet, 20)
    DI1_curve = pconst(self.DI1.inlet, self.DI1.outlet, 20)
    DI2_curve = pconst(self.DI2.inlet, self.DI2.outlet, 20)
    REH_curve = pconst(self.RE.inlet_hot, self.RE.outlet_hot, 50)
    REL_curve = pconst(self.RE.inlet, self.RE.outlet, 50)

    SS2 = [self.CO1.inlet, self.CO1.outlet] + DI2_curve + [
        self.CO2.inlet, self.CO2.outlet
    ] + REL_curve + BU1_curve + [self.TU1.inlet, self.TU1.outlet
                                 ] + BU2_curve + [
                                     self.TU2.inlet, self.TU2.outlet
                                 ] + REH_curve + DI1_curve + [self.CO1.inlet]
    plot_Ts(SS2)

    title(unicode(r"Reheat Regenerative Brayton cycle with Intercooling"))
    ylabel(unicode(r"T / [°C]"))
    xlabel("s / [kJ/kg/K]")

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
示例#15
0
def cycle_plot_brayton_reheat_regen_intercool(self):
	"""Plot T-s diagram for reheat-regenerative gas turbine"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()		
	hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()),str(self.cd.type.getSymbolValue()))
	sat_curve(D)
	
	# add some dots for the points in the cycle
	seq = "CO1.inlet DI2.inlet CO2.inlet RE.inlet BU1.inlet BU2.inlet TU1.inlet BU2.inlet TU2.inlet RE.inlet_hot DI1.inlet".split(" ")
	lalign = "TU2.inlet RE.inlet_hot DI1.inlet DI2.inlet CO1.inlet".split(" ")
	SS1 = []; SS1a = []
	for s in seq:
		print "looking at '%s'"%s
		p = reduce(getattr,s.split("."),self)
		SS1.append(p)
		SS1a.append((p,s))
	plot_Ts(SS1,'go')

	print "ANNOTATIONS"
	for s in SS1a:
		align = "right"
		if s[1] in lalign:
			align = "left"
		annotate(s[1]+"  ", xy =(float(s[0].s)/1.e3,float(s[0].T) - 273.15)
			,horizontalalignment=align
		)

	# plot the cycle with smooth curves
	BU1_curve = pconst(self.BU1.inlet, self.BU1.outlet,30)
	BU2_curve = pconst(self.BU2.inlet, self.BU2.outlet,20)
	DI1_curve = pconst(self.DI1.inlet,self.DI1.outlet,20)
	DI2_curve = pconst(self.DI2.inlet,self.DI2.outlet,20)
	REH_curve = pconst(self.RE.inlet_hot,self.RE.outlet_hot,50)
	REL_curve = pconst(self.RE.inlet,self.RE.outlet,50)

	SS2 = [self.CO1.inlet, self.CO1.outlet] + DI2_curve + [self.CO2.inlet, self.CO2.outlet] + REL_curve + BU1_curve + [self.TU1.inlet, self.TU1.outlet] + BU2_curve + [self.TU2.inlet, self.TU2.outlet] + REH_curve + DI1_curve + [self.CO1.inlet]
	plot_Ts(SS2,'g-')

	SS3 = [self.RE.inlet, self.RE.outlet_hot]
	plot_Ts(SS3,'g--')

	SS4 = [self.RE.outlet, self.RE.inlet_hot]
	plot_Ts(SS4,'g--')

	title(unicode(r"Reheat Regenerative Brayton cycle with Intercooling"))
	ylabel(unicode(r"T / [°C]"))
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#16
0
def cycle_plot_brayton_split(self):
	"""Plot T-s diagran for split-regeneration gas turbine"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()		
	hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()),str(self.cd.type.getSymbolValue()))
	sat_curve(D)
	
	# add some dots for the points in the cycle
#	seq = "CO2.inlet HEL.inlet HEL.outlet HEH.inlet BO.inlet TU.inlet HEH.inlet_hot HEL.inlet_hot CO1.inlet CO1.outlet".split(" ")
	seq = "CO2.inlet HEL.inlet HEH.inlet BO.inlet TU.inlet HEH.inlet_hot HEH.outlet_hot CO1.inlet".split(" ")
	lalign = "CO1.inlet HEH.outlet_hot ".split(" ")
	SS1 = []; SS1a = []
	for s in seq:
		print "looking at '%s'"%s
		p = reduce(getattr,s.split("."),self)
		SS1.append(p)
		SS1a.append((p,s))
	plot_Ts(SS1,'go')

	print "ANNOTATIONS"
	for s in SS1a:
		align = "right"
		if s[1] in lalign:
			align = "left"
		annotate(s[1]+"  ", xy =(float(s[0].s)/1.e3,float(s[0].T) - 273.15)
			,horizontalalignment=align
		)

	SS2 = pconst(self.DI.inlet, self.DI.outlet, 50) + [self.CO2.inlet,self.CO2.outlet] + pconst(self.HEL.inlet,self.HEH.outlet,50) + pconst(self.BO.inlet,self.BO.outlet,50) + [self.TU.inlet, self.TU.outlet] + pconst(self.HEH.inlet_hot,self.HEL.outlet_hot,50) + [self.CO1.inlet,self.CO1.outlet]
	plot_Ts(SS2,'g-')

	SS3 = [self.HEL.inlet, self.HEL.outlet_hot]
	plot_Ts(SS3,'g--')
	SS4 = [self.HEL.outlet, self.HEL.inlet_hot]
	plot_Ts(SS4,'g--')

	SS5 = [self.HEH.inlet, self.HEH.outlet_hot]
	plot_Ts(SS5,'g--')
	SS6 = [self.HEH.outlet, self.HEH.inlet_hot]
	plot_Ts(SS6,'g--')


	title(unicode(r"Split Regenerative Brayton cycle"))
	ylabel(unicode(r"T / [°C]"))
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
	savefig(os.path.expanduser("~/Desktop/brayton__split_regen.eps"))
示例#17
0
def cycle_plot_rankine_regen2(self):
	"""Plot T-s diagram for a regenerative Rankine cycle (bleed steam regen)"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()
	hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()),str(self.cd.type.getSymbolValue()))
	sat_curve(D)

	boiler_curve = pconst(self.BO.inlet, self.BO.outlet,100)
	condenser_curve = pconst(self.CO.inlet,self.CO.outlet,100)

	SS = [self.PU1.inlet, self.PU1.outlet] + \
			pconst(self.HE.inlet, self.HE.outlet, 100) + \
			[self.PU2.inlet, self.PU2.outlet] + \
			boiler_curve + \
			[self.TU1.inlet, self.TU1.outlet, self.TU2.outlet] + \
			condenser_curve + [self.PU1.inlet]

	plot_Ts(SS)
	plot_Ts(
		[self.PU1.inlet, self.PU1.outlet, self.HE.inlet, self.HE.outlet, 
			self.PU2.inlet, self.PU2.outlet, self.TU1.inlet, self.TU1.outlet, 
			self.TU2.outlet, self.PU1.inlet]
		,'bo'
	)

	# line for the heat exchanger
	plot_Ts(pconst(self.HE.inlet_heat, self.HE.outlet,100),'b-')

	title(unicode(r"Regenerative Rankine cycle with %s" % D.name))
	ylabel(unicode(r"T / [°C]"))
	aa = axis(); axis([aa[0],aa[1],-100,600])
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
	savefig(os.path.expanduser("~/Desktop/regen2.eps"))
示例#18
0
def cycle_plot_rankine_regen2(self):
    """Plot T-s diagram for a regenerative Rankine cycle (bleed steam regen)"""
    import loading
    loading.load_matplotlib(throw=True)
    ioff()
    figure()
    hold(1)
    D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
    sat_curve(D)

    boiler_curve = pconst(self.BO.inlet, self.BO.outlet, 100)
    condenser_curve = pconst(self.CO.inlet, self.CO.outlet, 100)

    SS = [self.PU1.inlet, self.PU1.outlet] + \
      pconst(self.HE.inlet, self.HE.outlet, 100) + \
      [self.PU2.inlet, self.PU2.outlet] + \
      boiler_curve + \
      [self.TU1.inlet, self.TU1.outlet, self.TU2.outlet] + \
      condenser_curve + [self.PU1.inlet]

    plot_Ts(SS)
    plot_Ts([
        self.PU1.inlet, self.PU1.outlet, self.HE.inlet, self.HE.outlet,
        self.PU2.inlet, self.PU2.outlet, self.TU1.inlet, self.TU1.outlet,
        self.TU2.outlet, self.PU1.inlet
    ], 'bo')

    # line for the heat exchanger
    plot_Ts(pconst(self.HE.inlet_heat, self.HE.outlet, 100), 'b-')

    title(unicode(r"Regenerative Rankine cycle with %s" % D.name))
    ylabel(unicode(r"T / [°C]"))
    aa = axis()
    axis([aa[0], aa[1], -100, 600])
    xlabel("s / [kJ/kg/K]")

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
    savefig(os.path.expanduser("~/Desktop/regen2.eps"))
示例#19
0
def regenerator_plot_fprops(self):
	"""Plot T-H diagram of regenerator"""
	import loading; loading.load_matplotlib(throw=True)
	ioff();	figure(); hold(1)
	D = fprops.fprops_fluid(str(self.cd.component.getSymbolValue()))
	extpy.getbrowser().reporter.reportNote("Fluid is %s" % D.name)	

	plot_TH(pconsth(self.inlet_hot, self.outlet_hot, 50),'r-',
		Href = (float(self.outlet_hot.h)*float(self.outlet_hot.mdot))\
	)

	plot_TH(pconsth(self.inlet, self.outlet, 50),'b-',
		Href = (float(self.inlet.h)*float(self.inlet.mdot))\
	)

	title(unicode(r"%s heat exchanger" % D.name))
	ylabel(unicode(r"T / [°C]"))
	xlabel("H / [MW]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#20
0
def cycle_plot_brayton_regen(self):
	"""Plot T-s diagran for regenerative gas turbine"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()		

	D = fprops.fluid(str(self.cd.component.getSymbolValue()))
	sat_curve(D)

	# plot gas turbine cycle
	regen_cold_curve = pconst(self.RE.inlet, self.RE.outlet, 50)
	burner_curve = pconst(self.BO.inlet, self.BO.outlet,50)
	regen_hot_curve = pconst(self.RE.inlet_hot, self.RE.outlet_hot, 50)
	diss_curve = pconst(self.CO.inlet, self.CO.outlet,50)

	SS = [self.PU.inlet, self.PU.outlet, self.RE.inlet] + regen_cold_curve + [self.RE.outlet, self.BO.inlet] + burner_curve + [self.BO.outlet, self.TU.inlet, self.TU.outlet,self.RE.inlet_hot] + regen_hot_curve + [self.RE.outlet_hot, self.CO.inlet] + diss_curve + [self.CO.outlet,self.PU.inlet]

	plot_Ts(SS,'g-')

	SS2 = [self.PU.inlet, self.PU.outlet, self.RE.inlet, self.RE.outlet, self.BO.inlet, self.BO.outlet, self.TU.inlet, self.TU.outlet,self.RE.inlet_hot, self.RE.outlet_hot, self.CO.inlet, self.CO.outlet,self.PU.inlet]
	plot_Ts(SS2,'go')

	SS3 = [self.RE.inlet, self.RE.outlet_hot]
	plot_Ts(SS3,'g--')

	SS4 = [self.RE.outlet, self.RE.inlet_hot]
	plot_Ts(SS4,'g--')

	hold(1)

	title(unicode(r"Regenerative Brayton cycle"))
	ylabel(unicode(r"T / [°C]"))
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#21
0
def leastsq_plot(self):
    """Plot a least-squares fit, no added intermediate points though."""
    import loading
    loading.load_matplotlib(throw=True)

    ioff()
    figure()

    n = self.n.getIntValue()

    x = []
    y = []
    ye = []
    for i in range(n):
        x.append(float(self.x[i + 1]))
        y.append(float(self.y[i + 1]))
        ye.append(float(self.f[i + 1].y))
    plot(x, y, 'bo')
    plot(x, ye, 'b-')

    extpy.getbrowser().reporter.reportNote("Plotting completed")
    ion()
    show()
示例#22
0
def leastsq_plot(self):
	"""Plot a least-squares fit, no added intermediate points though."""
	import loading
	loading.load_matplotlib(throw=True)
	
	ioff()
	figure()

	n = self.n.getIntValue()

	x = []
	y = []
	ye = []
	for i in range(n):
		x.append(float(self.x[i+1]))
		y.append(float(self.y[i+1]))
		ye.append(float(self.f[i+1].y))
	plot(x,y,'bo')
	plot(x,ye,'b-')

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#23
0
def cycle_plot_brayton_regen(self):
	"""Plot T-s diagran for regenerative gas turbine"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()
	hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()),str(self.cd.type.getSymbolValue()))
	sat_curve(D)	

	# plot gas turbine cycle
	SS = [self.PU.inlet, self.PU.outlet, self.RE.inlet, self.RE.outlet, self.BO.inlet,self.BO.outlet, self.TU.inlet, self.TU.outlet,self.RE.inlet_hot, self.RE.outlet_hot, self.CO.inlet, self.CO.outlet,self.PU.inlet]
	plot_Ts(SS,'g-')
	plot_Ts(SS,'go')
	hold(1)

	title(unicode(r"Regenerative Brayton cycle"))
	ylabel(unicode(r"T / [°C]"))
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
	savefig(os.path.expanduser("~/Desktop/brayton_regen.eps"))
示例#24
0
def cycle_plot_rankine_regen1(self):
	"""Plot T-s diagram for a regenerative Rankine cycle"""
	import loading
	loading.load_matplotlib(throw=True)
	ioff()
	figure()
	hold(1)
	D = fprops.fluid(str(self.cd.component.getSymbolValue()))
	sat_curve(D)

	boiler_curve = pconst(self.BO.inlet, self.BO.outlet,100)
	condenser_curve = pconst(self.CO.inlet,self.CO.outlet,100)
	he_hot = pconst(self.HE.inlet_heat, self.HE.outlet_heat,100)
	he_cold = pconst(self.HE.inlet, self.HE.outlet,100)

	SS = [self.PU.outlet] + he_cold + [self.BO.inlet] + boiler_curve + [self.TU.inlet, self.TU.outlet] + he_hot + condenser_curve + [self.PU.inlet, self.PU.outlet]

	plot_Ts(SS)
	plot_Ts(
		[self.PU.outlet,self.BO.inlet,self.TU.inlet, self.TU.outlet
		 	,self.HE.outlet_heat, self.PU.inlet, self.PU.outlet]
		,'bo'
	)

	# dotted lines for the heat exchanger
	plot_Ts([self.HE.inlet_heat, self.HE.outlet],'b:')
	plot_Ts([self.HE.outlet_heat, self.HE.inlet],'b:')

	title(unicode(r"Regenerative Rankine cycle with %s" % D.name))
	ylabel(unicode(r"T / [°C]"))
	aa = axis(); axis([aa[0],aa[1],-100,600])
	xlabel("s / [kJ/kg/K]")

	extpy.getbrowser().reporter.reportNote("Plotting completed")
	ion()
	show()
示例#25
0
	def __init__(self,im):
		self.im = im # IncidenceMatrix object
		self.lastcol = None;
		self.lastrow = None;

		loading.load_matplotlib(throw=True)
示例#26
0
    def __init__(self, im):
        self.im = im  # IncidenceMatrix object
        self.lastcol = None
        self.lastrow = None

        loading.load_matplotlib(throw=True)
	def run(self):
		import loading
		loading.load_matplotlib(throw=True)
		self.getIntegrator().solve()
 def run(self):
     import loading
     loading.load_matplotlib(throw=True)
     self.getIntegrator().solve()