-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHeatPump.py
More file actions
144 lines (119 loc) · 5.82 KB
/
HeatPump.py
File metadata and controls
144 lines (119 loc) · 5.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# 7/19/17 BHN: Updated to ColdClimateAir=SourceHeatPumpSpecificationListing 7.14.17
class HeatPump :
"""Data and methods for calculation of heat pump parameters"""
def __init__(self, Manufacturer, Brand, ModelName, AHRICertNumber, OutdoorUnit,IndoorUnits,AHRIType,HSPFregIV,SEER,EER_95,CoolingCapacity, EnergyStar, DuctedDuctless,Zones,DuctlessIndoorType) :
self.Manufacturer=Manufacturer
self.Brand=Brand
self.ModelName=ModelName
self.AHRICertNumber=AHRICertNumber
self.OutdoorUnit=OutdoorUnit
self.IndoorUnits=IndoorUnits
self.AHRIType=AHRIType
self.HSPFregIV=HSPFregIV
self.SEER=SEER
self.EER_95=EER_95
self.CoolingCapacity = CoolingCapacity
self.EnergyStar=EnergyStar
self.DuctedDuctless=DuctedDuctless
self.Zones=Zones
self.DuctlessIndoorType = DuctlessIndoorType
self.tData = []
self.CAPMin = []
self.CAPRated = []
self.CAPMax = []
self.COPMin = []
self.COPRated = []
self.COPMax = []
def parametrize(self):
# COP/Q = c*T^2 + b*T + c : The constant part of the polynomial fit of the heat pump data
a_Max = []
a_Min = []
b_Max = []
b_Min = [] # (1 To HP_MAX, 1 To HP_FIT) As Single
c_Max = [] # (1 To HP_MAX, 1 To HP_FIT) As Single
c_Min = [] # (1 To HP_MAX, 1 To HP_FIT) As Single
T_Min = [] # The min operating temperature of heat pumps
# not used?
# Q_Abs_Max = [] # Absolute Maximum possible capacity
# Q_Abs_Min = [] # Absolute Maximum possible capacity as given in the datasheet (not temperature dependant !)
# electric_Abs_E_Max = [] # (1 To HP_MAX, 1 To HP_FIT) As Single
# electric_Abs_E_Min = [] # (1 To HP_MAX, 1 To HP_FIT) As Single
# parametrizations of capacity and coefficient of performance
c_Min.append([0.0,0.0])
bMinCAP = (CAPMin[0]-CAPMin[2])/(47-5)
bMinCOP = (COPMin[0]-COPMin[2])/(47-5)
b_Min.append([bMinCOP,bMinCAP])
aMinCAP = CAPMin[2] - 5.*bMinCAP
aMinCOP = COPMin[2] - 5.*bMinCOP
a_Min.append([aMinCOP,aMinCAP])
c_Max.append([0.0,0.0])
bMaxCAP = (CAPMax[0]-CAPMax[2])/(47-5)
bMaxCOP = (COPMax[0]-COPMax[2])/(47-5)
b_Max.append([bMaxCOP,bMaxCAP])
aMaxCAP = CAPMax[2] - 5.*bMaxCAP
aMaxCOP = COPMax[2] - 5.*bMaxCOP
a_Max.append([aMaxCOP,aMaxCAP])
def MaxCapacity(self,temp):
if temp>self.tData[0]:
# warmer than the 47 deg point
capacity_Max = self.CAPMax[0]
elif temp <= self.tData[-1]:
# colder than the coldest point specified
# question as to how heat pump will perform here - assume it doesn't function at that temperature
capacity_Max = self.CAPMax[-1]
else:
for i in range(len(self.tData)-1):
if temp > self.tData[i+1] and temp<= self.tData[i] :
# linear interpolation between the nearest reported points
frac = (temp-self.tData[i])/float(self.tData[i+1] - self.tData[i])
capacity_Max = self.CAPMax[i] + frac * (self.CAPMax[i+1] - self.CAPMax[i])
break
return capacity_Max
def MinCapacity(self,temp):
if temp>self.tData[0]:
# warmer than the 47 deg point
capacity_Min = self.CAPMin[0]
elif temp <= self.tData[-1]:
# colder than the coldest point specified
# question as to how heat pump will perform here - assume it doesn't function at that temperature
capacity_Min = self.CAPMin[-1]
else:
for i in range(len(self.tData)-1):
if temp > self.tData[i+1] and temp<= self.tData[i] :
# linear interpolation between the nearest reported points
frac = (temp-self.tData[i])/float(self.tData[i+1] - self.tData[i])
capacity_Min = self.CAPMin[i] + frac * (self.CAPMin[i+1] - self.CAPMin[i])
break
return capacity_Min
def COPatMinCapacity(self,temp):
if temp>self.tData[0]:
# warmer than the 47 deg point
COP_Min = self.COPMin[0]
elif temp <= self.tData[-1]:
# colder than the coldest point specified
# question as to how heat pump will perform here - assume it doesn't function at that temperature
COP_Min = self.COPMin[-1]
else:
for i in range(len(self.tData)-1):
if temp > self.tData[i+1] and temp<= self.tData[i] :
# linear interpolation between the nearest reported points
frac = (temp-self.tData[i])/float(self.tData[i+1] - self.tData[i])
COP_Min = self.COPMin[i] + frac * (self.COPMin[i+1] - self.COPMin[i])
break
return COP_Min
def COPatMaxCapacity(self,temp):
if temp>self.tData[0]:
# warmer than the 47 deg point
COP_Max = self.COPMax[0]
elif temp <= self.tData[-1]:
# colder than the coldest point specified
# question as to how heat pump will perform here - assume it doesn't function at that temperature
COP_Max = self.COPMax[-1]
else:
for i in range(len(self.tData)-1):
if temp > self.tData[i+1] and temp<= self.tData[i] :
# linear interpolation between the nearest reported points
frac = (temp-self.tData[i])/float(self.tData[i+1] - self.tData[i])
COP_Max = self.COPMax[i] + frac * (self.COPMax[i+1] - self.COPMax[i])
break
return COP_Max