Ejemplo n.º 1
0
 def test_condenser(self):
     """
     Test component properties of condenser.
     """
     tesin = cmp.sink('TES in')
     tesout = cmp.source('TES out')
     hsin = cmp.sink('Cond in')
     hsout = cmp.source('Cond out')
     he = cmp.condenser('condenser')
     tes_he = con.connection(tesout, 'out1', he, 'in2')
     he_tes = con.connection(he, 'out2', tesin, 'in1')
     hs_he = con.connection(hsout, 'out1', he, 'in1')
     he_hs = con.connection(he, 'out1', hsin, 'in1')
     self.nw.add_conns(tes_he, he_tes, hs_he, he_hs)
     # design specification
     he.set_attr(pr1=0.98, pr2=0.98, ttd_u=5, design=['pr2', 'ttd_u', 'ttd_l'], offdesign=['zeta2', 'kA'])
     hs_he.set_attr(T=100, p0=0.5, fluid={'N2': 0, 'O2': 0, 'Ar': 0, 'INCOMP::DowQ': 0, 'H2O': 1, 'NH3': 0, 'CO2': 0, 'CH4': 0})
     tes_he.set_attr(T=30, p=5, fluid={'N2': 0, 'O2': 0, 'Ar': 0, 'INCOMP::DowQ': 0, 'H2O': 1, 'NH3': 0, 'CO2': 0, 'CH4': 0})
     he_tes.set_attr(T=40)
     he.set_attr(Q=-80e3)
     self.nw.solve('design')
     # check heat flow
     Q = hs_he.m.val_SI * (he_hs.h.val_SI - hs_he.h.val_SI)
     self.nw.save('tmp')
     ttd_u = hlp.T_mix_ph([0, hs_he.p.val_SI, hlp.h_mix_pQ(hs_he.to_flow(), 1), hs_he.fluid.val]) - he_tes.T.val_SI
     p = hs_he.p.val_SI
     eq_(round(ttd_u, 1), round(he.ttd_u.val, 1), 'Value of terminal temperature difference must be ' + str(he.ttd_u.val) + ', is ' + str(ttd_u) + '.')
     # check lower terminal temperature difference
     he.set_attr(ttd_l=20, ttd_u=np.nan)
     self.nw.solve('design')
     eq_(round(he_hs.T.val - tes_he.T.val, 1), round(he.ttd_l.val, 1), 'Value of terminal temperature difference must be ' + str(he.ttd_l.val) + ', is ' + str(he_hs.T.val - tes_he.T.val) + '.')
     # check kA value
     self.nw.solve('offdesign', design_path='tmp')
     eq_(round(p, 1), round(hs_he.p.val_SI, 1), 'Value of condensing pressure be ' + str(p) + ', is ' + str(hs_he.p.val_SI) + '.')
     shutil.rmtree('./tmp', ignore_errors=True)
Ejemplo n.º 2
0
# %% components

# sources & sinks

c_in = cmp.source('coolant in')
cb = cmp.source('consumer back flow')
cf = cmp.sink('consumer feed flow')
amb_in = cmp.source('source ambient')
amb_out = cmp.sink('sink ambient')

cp1 = cmp.sink('compressor 1')

# consumer system

cd = cmp.condenser('condenser')
rp = cmp.pump('recirculation pump')
cons = cmp.heat_exchanger_simple('consumer')

# evaporator system

ves = cmp.vessel('vessel')
dr = cmp.drum('drum')
ev = cmp.heat_exchanger('evaporator')
su = cmp.heat_exchanger('superheater')
pu = cmp.pump('pump evaporator')

# %% connections

# consumer system
Ejemplo n.º 3
0
# %% network

fluids = ['water']

nw = nwk.network(fluids=fluids, p_unit='bar', T_unit='C', h_unit='kJ / kg')

# %% components

# turbine part
valve_turb = cmp.valve(label='valve_turb')
turbine_hp = cmp.turbine(label='turbine_hp')
split = cmp.splitter(label='splitter1')
turbine_lp = cmp.turbine(label='turbine_lp')

# condenser and preheater
condenser = cmp.condenser(label='condenser')
preheater = cmp.condenser(label='preheater')
valve_pre = cmp.valve(label='valve_pre')
valve = cmp.valve(label='valve1')
merge = cmp.merge(label='merge1')

# feed water
pump = cmp.pump(label='pump')
steam_generator = cmp.heat_exchanger_simple(label='steam generator')

# sources and sinks
source = cmp.source(label='source')
sink = cmp.sink(label='sink')

# for cooling water
source_cw = cmp.source(label='source_cw')
Ejemplo n.º 4
0
c_c = cmp.combustion_chamber('combustion')
g_turb = cmp.turbine('gas turbine')

CH4 = cmp.source('fuel source')
air = cmp.source('ambient air')

# waste heat recovery
suph = cmp.heat_exchanger('superheater')
evap = cmp.heat_exchanger('evaporator')
drum = cmp.drum('drum')
eco = cmp.heat_exchanger('economizer')
ch = cmp.sink('chimney')

# steam turbine part
turb_hp = cmp.turbine('steam turbine high pressure')
cond_dh = cmp.condenser('district heating condenser')
mp_split = cmp.splitter('mp split')
turb_lp = cmp.turbine('steam turbine low pressure')
cond = cmp.condenser('condenser')
merge = cmp.merge('merge')
pump1 = cmp.pump('feed water pump 1')
pump2 = cmp.pump('feed water pump 2')
ls_out = cmp.sink('ls sink')
ls_in = cmp.source('ls source')
mp_valve = cmp.valve('mp valve')

# district heating
dh_in = cmp.source('district heating backflow')
dh_out = cmp.sink('district heating feedflow')

# cooling water