def Isolines_plot_tests(): from matplotlib import pyplot from CoolProp.Plots import Ts, drawIsoLines ax = Ts(fluid_ref) ax.set_xlim([-0.5, 1.5]) ax.set_ylim([300, 530]) quality = drawIsoLines(Ref, 'Ts', 'Q', [0.3, 0.5, 0.7, 0.8], axis=ax) isobars = drawIsoLines(Ref, 'Ts', 'P', [100, 2000], num=5, axis=ax) isochores = drawIsoLines(Ref, 'Ts', 'D', [2, 600], num=7, axis=ax) pyplot.show()
def Ts_plot_tests(): from CoolProp.Plots import Ts Ts(fluid_ref, show=True) from matplotlib import pyplot fig = pyplot.figure(2) ax = fig.gca() Ts(fluid_ref, show=True, axis=ax) Ts(fluid_ref, show=True, Tmin=200, Tmax=300)
def Isolines_plot_tests(): from matplotlib import pyplot from CoolProp.Plots import Ts, drawIsoLines ax = Ts(fluid_ref) #ax.set_xlim([-0.5, 1.5]) #ax.set_ylim([300, 530]) quality = drawIsoLines(fluid_ref, 'Ts', 'Q', [0.3, 0.5, 0.7, 0.8], axis=ax) isobars = drawIsoLines(fluid_ref, 'Ts', 'P', [100, 2000], num=5, axis=ax) isochores = drawIsoLines(fluid_ref, 'Ts', 'D', [2, 600], num=7, axis=ax) pyplot.close()
fig = pylab.figure(figsize=(8, 4)) ax = fig.add_axes((0, 0, 0.5, 1.0)) ax.fill(np.r_[0, 3, 3, 0, 0], np.r_[0, 0, 1, 1, 0], 'lightblue') ax.fill(np.r_[0, 3, 3, 0, 0], np.r_[1, 1, 2, 2, 1], 'pink') ax.plot([2.3, 2.3], [1, 2], 'k--') ax.plot([2.3, 2.3], [0, 1], 'k') ax.text(1.15, 0.5, 'Two-Phase', ha='center', va='center') ax.text(1.15, 1, '1', bbox=dict(facecolor='w'), ha='center', va='center') ax.text(2.65, 0.5, 'Superheat', ha='center', va='center') ax.text(2.65, 1, '2', bbox=dict(facecolor='w'), ha='center', va='center') ax.text(1.5, 1.5, 'Single-Phase', ha='center', va='center') ax.axis('equal') ax.axis('off') ax2 = fig.add_axes((0.6, 0.2, 0.35, 0.7)) Ts('R134a', axis=ax2) p = PropsSI('P', 'T', 280, 'Q', 0.0, 'R134a') T = np.r_[np.linspace(279.95, 279.99, 2), np.linspace(280.1, 300, 50)] s = PropsSI('S', 'T', T, 'P', p, 'R134a') / 1000.0 ax2.plot(s, T) ax2.plot([s[0], s[-1]], [280, 305], 'r') ax2.set_xlim(0.9, 1.9) ax2.set_ylim(230, 360) fig.suptitle( r"No internal pinching for $\dot Q_{max,\varepsilon=1}$ - single-phase fluid is hotter" ) pylab.show()
from CoolProp.Plots import Ph,Ts Ref='R290' fig=matplotlib.pyplot.figure(figsize=(4,3)) ax=fig.add_axes((0.15,0.15,0.8,0.8)) Ph(Ref,Tmin=273.15-30,hbounds=[0,600],axis=ax) COP=TwoStage('Propane',10000,273.15-5,273.15+43.3,5,7,0.7,0.3,15+273.15,3,prints = True) matplotlib.pyplot.show() Ref='R290' fig=matplotlib.pyplot.figure(figsize=(4,3)) ax=fig.add_axes((0.15,0.15,0.8,0.8)) Ph(Ref,Tmin=273.15-30,hbounds=[0,600],axis=ax) COP=SimpleCycle(Ref,273.15-5,273.15+45,5,7,0.7,Ts_Ph='Ph') matplotlib.pyplot.show() Ref='R410A' fig=matplotlib.pyplot.figure(figsize=(4,3)) ax=fig.add_axes((0.15,0.15,0.8,0.8)) Ts(Ref,Tmin=273.15-100,sbounds=[0,600],axis=ax) COP=SimpleCycle(Ref,273.15-5,273.15+45,5,7,0.7,Ts_Ph='Ts') matplotlib.pyplot.show() ## for x in numpy.linspace(0,1): ## Ref='REFPROP-MIX:R152A[%g]&R32[%g]' %(x,1-x) ## COP=SimpleCycle(273.15+8,273.15+44,5,7,0.7,skipPlot=True,Ts_Ph='Ph') ## matplotlib.pyplot.show()