def calc_st2_o(self): st2_o = Stream() st2_o.fluid = self.st2_i.fluid st2_o.flow_rate = self.st2_i.flow_rate st2_o.pressure = self.st2_i.pressure - self.pressure_drop( self.st2_i, self.st2_pip) h = self.st2_i.h - (self.st1_i.h - self.st1_o.h) * self.st1_i.flow_rate[0] \ / st2_o.flow_rate[0] / self.eta h_l = PropsSI('H', 'P', st2_o.pressure, 'Q', 0, st2_o.fluid) h_g = PropsSI('H', 'P', st2_o.pressure, 'Q', 1, st2_o.fluid) if h_l <= h <= h_g: st2_o.x = PropsSI('Q', 'P', st2_o.pressure, 'H', h, st2_o.fluid) else: st2_o.temperature = PropsSI('T', 'P', st2_o.pressure, 'H', h, st2_o.fluid) self.st2_o = st2_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
]) def get_A(self): # Known inlet and outlet fluids to calculate the aperture area self.st_o.fluid = self.st_i.fluid self.st_o.flow_rate = self.st_i.flow_rate # Assume no pressure loss self.st_o.pressure = self.st_i.pressure self.st_o.pressure = self.st_i.pressure guess = np.array([500, 300, 19]) # options = optimset('Display','iter') x = fsolve(self.CalcDishCollector3, guess) self.A = x[2] if __name__ == '__main__': dc = DishCollector() st_i = Stream() st_i.fluid = Const.FLUID[2] st_i.temperature = Const.convert_temperature(150, 'C', 'K') st_i.pressure = 4e5 st_i.flow_rate[0] = 0.07 dc.st_i = st_i st_o = Stream() st_o.fluid = Const.FLUID[2] # st_o.temperature = Const.convert_temperature(239.26, 'C', 'K') st_o.pressure = 4e5 dc.st_o = st_o dc.amb.irradiance = 700 dc.get_T_o()