Air Source Heat Pump #401
-
Hello TesPy community. I am trying to model an air source heat pump water heater but I am having trouble making the right connections in the network. from tespy.networks import Network
from tespy.connections import Connection
from tespy.components import (CycleCloser, Compressor, Valve, HeatExchangerSimple, Source, Sink, HeatExchanger)
import pandas as pd
import numpy as np
# create a network object with R134a as fluid
fluid_list = ['R134a', 'air']
my_plant = Network(fluids=fluid_list)
# set the unitsystem for temperatures to °C and for pressure to bar
my_plant.set_attr(T_unit='C', p_unit='bar', h_unit='kJ / kg')
# create components
cc1 = CycleCloser('cycle closer 1')
cc2 = CycleCloser('cycle closer 2')
co = HeatExchangerSimple('condenser')
ev = HeatExchanger('evaporator')
va = Valve('expansion valve')
cp = Compressor('compressor')
ahx = HeatExchanger('air source heat exchanger')
# create connections
c1 = Connection(cc1, 'out1', ev, 'in1', label='1')
c2 = Connection(ev, 'out1', cp, 'in1', label='2')
c3 = Connection(cp, 'out1', co, 'in1', label='3')
c4 = Connection(co, 'out1', va, 'in1', label='4')
c5 = Connection(va, 'out1', cc1, 'in1', label='5')
c6 = Connection(ahx, 'out1', ev, 'in2', label='6')
c7 = Connection(ev, 'out2', cc2, 'in1', label='7')
#c8 = Connection(cc2, 'out1', va, 'in2', label='7')
# add connections to the network
my_plant.add_conns(c1, c2, c3, c4, c5, c6, c7)
# specify fluid properties and initial state
c2.set_attr(fluid={'R134a': 1, 'air': 0}, T=20, p=5, m=0.5)
c4.set_attr(fluid={'R134a': 1, 'air': 0}, T=80)
c6.set_attr(fluid={'R134a': 0, 'air': 1}, T=11)
# specify air-side heat exchanger parameters
ahx.set_attr(pr1=1, pr2=1, kA_char=1000)
# specify component parameters
co.set_attr(pr=0.98, Q=-4e6)
ev.set_attr(pr1=0.98, pr2 = 0.98)
cp.set_attr(eta_s=0.85)
# solve the network
my_plant.solve(mode='design')
my_plant.print_results()
# plot results
import matplotlib.pyplot as plt
# make text reasonably sized
plt.rc('font', **{'size': 18})
# plot COP vs heat demand
Q_array = np.linspace(0, 5e6, 50)
COP = []
for Q in Q_array:
co.set_attr(Q=-Q)
my_plant.solve('design')
COP.append(abs(co.Q.val) / cp.P.val) I'm sure this has quite a few errors starting with a missing outgoing connection from the cycle closer 2. Any help associated with modeling an air source heat pump is helpful! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Dear @AditiBIlanthodi, can you give a little bit more context of what you are exactly trying to do, e.g. a process flowsheet and a description of what you want to investigate? It is easier to help with more context. Thank you! |
Beta Was this translation helpful? Give feedback.
@AditiBIlanthodi: You can just change the fluid in your model, i.e. "air" instead of "water".
Then, should the heat demand be provided by the heat pump in every timestep as is? Or should it be optimized in a sense, that a setup with storage, heat pump (maybe other heat sources) and the demand, the provision of the demand should be at minimal cost in over a specific period of time? Specifically this was done (will be actually) in this workshop: https://fwitte.github.io/oemof-workshop-osmses-2023/. We have written quite an extensive documentation to show how things work.