Use Heatpump to cool a bus cabin #493
Unanswered
SimonKretz
asked this question in
Q&A
Replies: 1 comment 4 replies
-
class Heat_Pump_Des():
# Method to design the heat pump
def __init__(self):
# define basic parameters
self.heat_source_T_des = 30.0
self.LFE_des = self.heat_source_T_des -5.0
self.LWC_des = 15
self.heatload_des = 25000.0
# The parameters that will vary for the different heat pump models are d
params_des = {'ref': 'R410a', 'm_air': 1, 'm_water': 0, 'ttd_u': 15}
self.nw = Network(fluids=[params_des['ref'], 'air', 'water'], T_unit='C', p_unit='bar',
h_unit='kJ / kg', m_unit='kg / s')
self.nw.set_attr(iterinfo=False)
# %% components
# sources & sinks
cool_closer = CycleCloser('coolant cycle closer')
cons_closer = CycleCloser('consumer cycle closer')
amb_in = Source('source ambient')
amb_out = Sink('sink ambient')
# ambient air system
apu = Pump('ambient pump')
# consumer system
cd = HeatExchanger('condenser') # Changed to a HeatExchanger in the case of cooling
crp = Pump('condenser recirculation pump')
cons = HeatExchangerSimple('consumer')
# evaporator system
va = Valve('valve')
dr = Drum('drum')
ev = HeatExchanger('evaporator')
erp = Pump('evaporator recirculation pump')
# compressor-system
cp1 = Compressor('compressor 1')
# %% connections
# consumer system
c_in_cd = Connection(cool_closer, 'out1', cd, 'in1')
close_crp = Connection(cons_closer, 'out1', crp, 'in1')
crp_ev = Connection(crp, 'out1', ev, 'in1') # TODO Rename
ev_cons = Connection(ev, 'out1', cons, 'in1') # TODO Rename
cons_close = Connection(cons, 'out1', cons_closer, 'in1')
self.nw.add_conns(c_in_cd, close_crp, crp_ev, ev_cons, cons_close)
# connection condenser - evaporator system
cd_va = Connection(cd, 'out1', va, 'in1')
self.nw.add_conns(cd_va)
# evaporator system
va_dr = Connection(va, 'out1', dr, 'in1')
dr_erp = Connection(dr, 'out1', erp, 'in1')
erp_ev = Connection(erp, 'out1', ev, 'in2')
ev_dr = Connection(ev, 'out2', dr, 'in2')
self.nw.add_conns(va_dr, dr_erp, erp_ev, ev_dr)
amb_in_apu = Connection(amb_in, 'out1', apu, 'in1')
cd_amb_out = Connection(cd, 'out2', amb_out, 'in1') # TODO Rename
self.nw.add_conns(amb_in_apu, cd_amb_out)
dr_cp1 = Connection(dr, 'out2', cp1, 'in1')
apu_cd = Connection(apu, 'out1', cd, 'in2') # TODO Rename
self.nw.add_conns(dr_cp1, apu_cd)
cp1_cc = Connection(cp1, 'out1', cool_closer, 'in1')
self.nw.add_conns(cp1_cc)
# %% component parametrization
# condenser system
cd.set_attr(pr1=0.99, pr2=0.99, ttd_u=params_des['ttd_u'], design=['pr2', 'ttd_u'],
offdesign=['zeta1','zeta2', 'kA_char'])
crp.set_attr(eta_s=0.8, design=['eta_s'], offdesign=['eta_s_char'])
cons.set_attr(pr=0.99, design=['pr'], offdesign=['zeta'])
# evaporator system
kA_char1 = ldc('heat exchanger', 'kA_char1', 'DEFAULT', CharLine)
kA_char2 = ldc('heat exchanger', 'kA_char2', 'EVAPORATING FLUID', CharLine)
ev.set_attr(pr1=0.99, pr2=0.99, ttd_l=5,
kA_char1=kA_char1, kA_char2=kA_char2,
design=['pr1', 'ttd_l'], offdesign=['zeta1', 'kA_char'])
erp.set_attr(eta_s=0.8, design=['eta_s'], offdesign=['eta_s_char'])
apu.set_attr(eta_s=0.8, design=['eta_s'], offdesign=['eta_s_char'])
# compressor system
cp1.set_attr(eta_s=0.8, design=['eta_s'], offdesign=['eta_s_char'])
# %% connection parametrization
# condenser system
c_in_cd.set_attr(p0=30, fluid={params_des['ref']: 1, 'water': 0,
'air': 0}
)
close_crp.set_attr(T=(self.LWC_des-5), p=1.5, fluid={params_des['ref']: 0, 'water': 1, 'air': 0},
offdesign=['m']
)
ev_cons.set_attr(T=self.LWC_des, design=['T'])
# evaporator system cold side
erp_ev.set_attr(m=Ref(va_dr, 1.15, 0))
# evaporator system hot side
# pumping at constant rate in partload
amb_in_apu.set_attr(T=self.heat_source_T_des, p=1,
fluid={params_des['ref']: 0, 'water': params_des['m_water'],
'air': params_des['m_air']
}
)
apu_cd.set_attr(p=1.0001) # check this
dr_cp1.set_attr(h0=400)
cd_amb_out.set_attr(T=self.LFE_des)
# %% key paramter
cons.set_attr(Q=self.heatload_des)
power_bus = Bus("Total power input")
heat_bus = Bus("Total heat production")
power_bus.add_comps(
{"comp": cp1, "base": "bus"},
{"comp": erp, "base": "bus"},
{"comp": apu, "base": "bus"},
{"comp": crp, "base": "bus"}
)
heat_bus.add_comps({"comp": cons})
self.nw.add_busses(power_bus, heat_bus)
# %% Calculation of the design condition
self.nw.solve('design')
# self.nw.print_results()
self.nw.save('heat_pump')
self.P_cons = self.nw.busses["Total power input"].P.val # TODO funktioniert berechnung der benötigten Leistung ?
self.COP = abs(self.heatload_des/self.P_cons)
print('COP ', self.COP)
def step(self, inputs):
self.skip_step = False
heat_source_T = inputs.get('heat_source_T')
if heat_source_T is not None:
self.heat_source_T = heat_source_T
T_amb = inputs.get('T_amb')
if T_amb is not None:
self.T_amb = T_amb
cond_in_T = inputs.get('cond_in_T')
if cond_in_T is not None:
self.cond_in_T = cond_in_T
Q_Demand = inputs.get('Q_Demand')
if Q_Demand is not None:
self.Q_Supplied = Q_Demand
self.nw.get_conn('source ambient:out1_ambient pump:in1').set_attr(T=self.heat_source_T)
self.nw.get_conn('consumer cycle closer:out1_condenser recirculation pump:in1').set_attr(T=self.cond_in_T)
self.LFE = self.heat_source_T - 5
self.nw.get_conn('condenser:out2_sink ambient:in1').set_attr(T=self.LFE)
self.nw.get_comp('consumer').set_attr(Q=-self.Q_Supplied)
try:
self.nw.solve('offdesign', design_path='heat_pump')
self.cond_m = self.nw.get_conn('condenser:out2_consumer:in1').m.val #TODO funktioniert es ? muss verändert werden !
self.cons_T = self.nw.get_conn('condenser:out2_consumer:in1').T.val
self.P_cons = self.nw.busses["Total power input"].P.val # TODO funktioniert berechnung der benötigten Leistung ?
self.COP = abs(self.Q_Supplied/self.P_cons) # TODO funktioniert berechnung des COP mit der Leistung und dem Stromverbrauch
except:
self.step_error()
def step_error(self):
self.skip_step = True
self.P_cons = 0
self.COP = 0
self.Q_Supplied = 0
self.cond_m = 0
self.cons_T = 0
self.Q_evap = 0
if __name__ == '__main__':
heat_pump_1 = Heat_Pump_Des()
t_am = 12.00 # Temperature of the heat source
inputs_air_1 = {'heat_source_T': t_am, 'Q_Demand': 6000, 'cond_in_T': 39.00, 'T_amb': t_am}
heat_pump_1.step(inputs_air_1)
print('P : ', heat_pump_1.P_cons)
print('Q_supplied : ',heat_pump_1.Q_Supplied)
print('COP : ', heat_pump_1.COP)
print('cond_m :', heat_pump_1.cond_m)
print('const_t: ',heat_pump_1.cons_T)
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear community.
I am trying to use a heat pump for the purpose of cooling a bus.
The heat pump should be designed for a maximum cooling capacity of 25.000 W.
I changed the design of https://gitlab.com/mosaik/components/energy/mosaik-heatpump/-/tree/master?ref_type=heads.
I change the condenser from type condenser to type heat exchanger so the heat can be dumped to the ambient.
The temperature of the air dumped to the ambient is 5 °C lower than the ambient temperature.
The evaporator is getting the heat from the consumer, which is a heat source in our case.
Due to the change from condenser type to heat exchanger type, I get the error that I did not provide enough parameters.
Can you please help me to understand what I am missing here?
The sketch as well as the code are added.
Best wishes Simon
heatpump_cooling.zip
Beta Was this translation helpful? Give feedback.
All reactions