def test_network_network_consistency_outlets(): nw = network(['water', 'air']) source = basics.source('source') splitter = nodes.splitter('splitter') a = connection(source, 'out1', splitter, 'in1') nw.add_conns(a) nw.check_network()
def test_consistency_outlets(self): source = basics.source('source') splitter = nodes.splitter('splitter') a = connection(source, 'out1', splitter, 'in1') self.nw.add_conns(a) with raises(TESPyNetworkError): self.nw.check_network()
def setup_network_individual_offdesign(self): """ Set up network for individual offdesign tests. """ self.nw = network(['H2O'], T_unit='C', p_unit='bar', v_unit='m3 / s') so = basics.source('source') sp = nodes.splitter('splitter', num_out=2) self.pump1 = turbomachinery.pump('pump 1') self.sc1 = heat_exchangers.solar_collector('collector field 1') v1 = piping.valve('valve1') self.pump2 = turbomachinery.pump('pump 2') self.sc2 = heat_exchangers.solar_collector('collector field 2') v2 = piping.valve('valve2') me = nodes.merge('merge', num_in=2) si = basics.sink('sink') self.pump1.set_attr(eta_s=0.8, design=['eta_s'], offdesign=['eta_s_char']) self.pump2.set_attr(eta_s=0.8, design=['eta_s'], offdesign=['eta_s_char']) self.sc1.set_attr(pr=0.95, lkf_lin=3.33, lkf_quad=0.011, A=1252, E=700, Tamb=20, eta_opt=0.92, design=['pr'], offdesign=['zeta']) self.sc2.set_attr(pr=0.95, lkf_lin=3.5, lkf_quad=0.011, A=700, E=800, Tamb=20, eta_opt=0.92, design=['pr'], offdesign=['zeta']) fl = {'H2O': 1} inlet = connection(so, 'out1', sp, 'in1', T=50, p=3, fluid=fl) outlet = connection(me, 'out1', si, 'in1', p=3) self.sp_p1 = connection(sp, 'out1', self.pump1, 'in1') self.p1_sc1 = connection(self.pump1, 'out1', self.sc1, 'in1') self.sc1_v1 = connection(self.sc1, 'out1', v1, 'in1', p=3.1, T=90) v1_me = connection(v1, 'out1', me, 'in1') self.sp_p2 = connection(sp, 'out2', self.pump2, 'in1') self.p2_sc2 = connection(self.pump2, 'out1', self.sc2, 'in1') self.sc2_v2 = connection(self.sc2, 'out1', v2, 'in1', p=3.1, m=0.1) v2_me = connection(v2, 'out1', me, 'in2') self.nw.add_conns(inlet, outlet, self.sp_p1, self.p1_sc1, self.sc1_v1, v1_me, self.sp_p2, self.p2_sc2, self.sc2_v2, v2_me)
g_turb = turbine('gas turbine') CH4 = source('fuel source') air = source('ambient air') # waste heat recovery suph = heat_exchanger('superheater') evap = heat_exchanger('evaporator') drum = drum('drum') eco = heat_exchanger('economizer') ch = sink('chimney') # steam turbine part turb_hp = turbine('steam turbine high pressure') cond_dh = condenser('district heating condenser') mp_split = splitter('mp split') turb_lp = turbine('steam turbine low pressure') cond = condenser('condenser') merge = merge('merge') pump1 = pump('feed water pump 1') pump2 = pump('feed water pump 2') ls_out = sink('ls sink') ls_in = source('ls source') mp_valve = valve('mp valve') # district heating dh_in = source('district heating backflow') dh_out = sink('district heating feedflow') # cooling water cw_in = source('cooling water backflow')