def calc_st1_o(self): st1_o = Stream() st1_o.fluid = self.st1_i.fluid st1_o.flow_rate = self.st1_i.flow_rate st1_o.pressure = self.st1_i.pressure - self.pressure_drop( self.st1_i, self.st1_pip) h = self.st1_i.h - (self.st2_i.h - self.st2_o.h) * self.st2_i.flow_rate[0] \ / st1_o.flow_rate[0] / self.eta h_l = PropsSI('H', 'P', st1_o.pressure, 'Q', 0, st1_o.fluid) h_g = PropsSI('H', 'P', st1_o.pressure, 'Q', 1, st1_o.fluid) if h_l <= h <= h_g: st1_o.quality = PropsSI('Q', 'P', st1_o.pressure, 'H', h, st1_o.fluid) else: st1_o.T = PropsSI('T', 'P', st1_o.pressure, 'H', h, st1_o.fluid) self.st1_o = st1_o
def get_st2(self, st1, pressure2): st2 = Stream() st2.fluid = st1.fluid st2.flow_rate = st1.flow_rate st2.pressure = pressure2 s_ideal = st1.s h2_ideal = PropsSI('H', 'S', s_ideal, 'P', st2.pressure, st2.fluid) eta = self.calculate_eta(st1.pressure, st2.pressure) h2 = st1.h - eta * (st1.h - h2_ideal) # Check whether it is saturated h2_l = PropsSI('H', 'P', st2.pressure, 'Q', 0, st2.fluid) h2_g = PropsSI('H', 'P', st2.pressure, 'Q', 1, st2.fluid) if h2_l <= h2 <= h2_g: st2.quality = PropsSI('Q', 'P', st2.pressure, 'H', h2, st2.fluid) else: st2.temperature = PropsSI('T', 'P', st2.pressure, 'H', h2, st2.fluid) return st2
import matplotlib.pyplot as plt T_i = 500 # 初温,˚C p_c = 4000 # 排气压力,Pa mass_flow_rate = 61.3 # 主汽流量,kg/s st_i = Stream() st_i.temperature_celcius = T_i st_i.flow_rate = mass_flow_rate st_o = Stream() st_o.pressure = p_c st_c = Stream() st_c.pressure = p_c st_c.quality = 0 number = 40 # number组数据,压力从p0增加到p1 p0 = 10e6 p1 = 80e6 p = np.linspace(p0, p1, number) T0 = 400 T1 = 850 Delta_T = 50 T = range(T0, T1, Delta_T) for j in T: st_i.temperature_celcius = j efficiency_ideal = [] for i in range(number): st_i.pressure = p[i] st_o.quality = ps('Q', 'P', st_o.pressure, 'S', st_i.s, 'water')