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 calc_st2_i(self): st2_i = Stream() st2_i.fluid = self.st2_o.fluid st2_i.flow_rate = self.st2_o.flow_rate st2_i.pressure = self.st2_o.pressure + self.pressure_drop( self.st2_o, self.st2_pip) h = self.st2_o.h + (self.st1_i.h - self.st1_o.h) * self.st1_i.flow_rate[0] \ / self.st2_o.flow_rate[0] * self.eta h_l = PropsSI('H', 'P', st2_i.pressure, 'Q', 0, st2_i.fluid) h_g = PropsSI('H', 'P', st2_i.pressure, 'Q', 1, st2_i.fluid) if h_l <= h <= h_g: st2_i.x = PropsSI('Q', 'P', st2_i.pressure, 'H', h, st2_i.fluid) else: st2_i.T = PropsSI('T', 'P', st2_i.pressure, 'H', h, self.st2_i.fluid) self.st2_i = st2_i
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
from Stream import Stream import numpy as np from CoolProp.CoolProp import PropsSI as ps 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 = []