Skip to content

Commit

Permalink
Update hplib.py
Browse files Browse the repository at this point in the history
raise an error when trying to simulate cooling with a heat pump that is not capable of the feature
  • Loading branch information
ttjaden committed Nov 10, 2021
1 parent 1533d71 commit 895baf1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def simulate(self, t_in_primary: float, t_in_secondary: float, t_amb: float, mod
Returns
-------
df : pd.DataFrame
result : dict
with the following columns
T_in = Input temperature :math:`T` at primary side of the heat pump. [°C]
T_out = Output temperature :math:`T` at secondary side of the heat pump. [°C]
Expand All @@ -530,6 +530,9 @@ def simulate(self, t_in_primary: float, t_in_secondary: float, t_amb: float, mod
m_dot = Mass flow at secondary side of the heat pump. [kg/s]
"""

if mode==2 and self.group_id > 1:
raise ValueError('Cooling is only possible with heat pumps of group id = 1.')

t_in = t_in_primary # info value for dataframe
if mode==1:
t_out = t_in_secondary + self.delta_t #Inlet temperature is supposed to be heated up by 5 K
Expand Down

0 comments on commit 895baf1

Please sign in to comment.