def CalTurbineEx0(TurbineEx0, Nodes, Task): """ "TURBINE-EX0": {'minID': None, 'moutID': None, 'eta': None, 'wdot': None, "energy": "Wout", "fun": CalTurbineEx0} """ iND = Nodes[TurbineEx0['minID']] oND = Nodes[TurbineEx0['moutID']] if (Task == "State"): # 1 oND if TurbineEx0['eta'] == 1.0: oND['s'] = iND['s'] oND['t'] = ps2t(oND['p'], oND['s']) oND['h'] = ps2h(oND['p'], oND['s']) oND['x'] = ps2x(oND['p'], oND['s']) else: sout_s = iND['s'] hout_s = ps2h(oND['p'], sout_s) oND['h'] = iND['h'] - TurbineEx0['eta'] * (iND['h'] - hout_s) oND['t'] = ph2t(oND['p'], oND['h']) oND['s'] = ph2s(oND['p'], oND['h']) oND['x'] = ph2x(oND['p'], oND['h']) if (Task == "Balance"): # 2 Mass and Energy Balance if iND['fdot'] != None: oND['fdot'] = iND['fdot'] if oND['fdot'] != None: iND['fdot'] = oND['fdot'] TurbineEx0['wdot'] = iND['fdot'] * (iND['h'] - oND['h'])
def CalTurbineEx1(TurbineEx1, Nodes, Task): """ "TURBINE-EX1":{'minID': None, 'moutID': None, 'mexID': None ,'eta': None, 'wdot': None, "energy": "Wout", "fun": CalTurbineEx1}, """ iND = Nodes[TurbineEx1['minID']] oND = Nodes[TurbineEx1['moutID']] eND = Nodes[TurbineEx1['mexID']] if Task == "State": # 1 oND if TurbineEx1['eta'] == 1.0: eND['s'] = iND['s'] eND['t'] = ps2t(eND['p'], eND['s']) eND['h'] = ps2h(eND['p'], eND['s']) eND['x'] = ps2x(eND['p'], eND['s']) oND['s'] = iND['s'] oND['t'] = ps2t(oND['p'], oND['s']) oND['h'] = ps2h(oND['p'], oND['s']) oND['x'] = ps2x(oND['p'], oND['s']) else: isoh = ps2h(eND['p'], iND['s']) eND['h'] = iND['h'] - TurbineEx1['eta'] * (iND['h'] - isoh) eND['t'] = ph2t(eND['p'], eND['h']) eND['s'] = ph2s(eND['p'], eND['h']) eND['x'] = ph2x(eND['p'], eND['h']) isoh = ps2h(oND['p'], eND['s']) oND['h'] = eND['h'] - TurbineEx1['eta'] * (eND['h'] - isoh) oND['t'] = ph2t(oND['p'], oND['h']) oND['s'] = ph2s(oND['p'], oND['h']) oND['x'] = ph2x(oND['p'], oND['h']) if Task == "Balance": # 2 Mass and Energy Balance oND['fdot'] = iND['fdot'] - eND['fdot'] TurbineEx1['wdot'] = eND['fdot'] * (iND['h'] - eND['h']) TurbineEx1['wdot'] += oND['fdot'] * (iND['h'] - oND['h'])
def ps(self): self.t = if97.ps2t(self.p, self.s) self.h = if97.ps2h(self.p, self.s) self.v = if97.ps2v(self.p, self.s) self.x = if97.ps2x(self.p, self.s)
def ps(self): self.t = if97.ps2t(self.p, self.s) self.h = if97.ps2h(self.p, self.s) self.v = if97.ps2v(self.p, self.s) self.x = if97.ps2x(self.p, self.s)