Coverage for teaser/logic/buildingobjects/buildingsystems/buildingahu.py: 93%
70 statements
« prev ^ index » next coverage.py v7.4.4, created at 2025-04-29 16:01 +0000
« prev ^ index » next coverage.py v7.4.4, created at 2025-04-29 16:01 +0000
1# created November 2015
2# by TEASER4 Development Team
4"""This module includes a class for central AHU
5"""
6import pandas as pd
7from itertools import cycle, islice
10class BuildingAHU(object):
11 """BuildingAHU Class
13 This class holds information for a central Air Handling Unit (AHU). This
14 class is very AixLib specific and holds some parameters that are only
15 applicable to AixLib Central AHU model. If you are using other models
16 these values might have no effect.
18 Parameters
19 ----------
21 parent: Building()
22 The parent class of this object, the Building the AHU belongs to.
23 Allows for better control of hierarchical structures.
24 (default: None)
26 Attributes
27 ----------
28 heating : boolean
29 Heating Function of AHU (default = True)
30 cooling : boolean
31 Cooling Function of AHU (default = True)
32 dehumidification : boolean
33 Dehumidification Function of AHU (Cooling and Heating must be enabled)
34 (default = True)
35 humidification : boolean
36 Humidification Function of AHU (Cooling and Heating must be enabled)
37 (default = True)
38 heat_recovery : boolean
39 Is a HeatRecoverySystem physically integrated in the AHU
40 AixLib: 'HRS'
41 (default = True)
42 by_pass_dehumidification : float
43 By-pass factor of cooling coil during dehumidification. Necessary to
44 calculate the real outgoing enthalpy flow of heat exchanger in
45 dehumidification mode taking the surface enthalpy of the cooling
46 coil into account. In AixLib called "BPF_DeHu" (default = 0.2,
47 according to :cite:`Lindeburg.2013`)
48 efficiency_recovery : float
49 efficiency of HRS in the AHU modes if HRS is enabled.
50 AixLib: "efficiencyHRS_enabled" (default = 0.65, according to
51 :cite:`.20012001`)
52 efficiency_recovery_false : float
53 taking a little heat transfer into account although HRS is disabled
54 (in case that a HRS is physically installed in the AHU) in AixLib:
55 "efficiencyHRS_disabled" (default = 0.2, according to
56 :cite:`Mehrfeld.2014`)
57 sample_rate : int
58 sample rate of state machines in AHU model. Default is set to half
59 an hour as typical input is hourly (default = 1800)
60 efficiency_fan_supply : float
61 Efficiency of supply fan (default = 0.7)
62 efficiency_fan_return: float
63 Efficiency of return fan (default = 0.7)
64 pressure_drop_fan_supply: float (default 800)
65 Pressure drop assigned to supply fan in Pascal
66 pressure_drop_fan_return: float (default 800)
67 Pressure drop assigned to return fan in Pascal
68 temperature_profile : [float]
69 timeline of temperatures requirements for AHU simulation
70 min_relative_humidity_profile : [float]
71 timeline of relative humidity requirements for AHU simulation
72 max_relative_humidity_profile : [float]
73 timeline of relative humidity requirements for AHU simulation
74 v_flow_profile : [int]
75 timeline of desired relative v_flow of the AHU simulation (0..1)
77 - **Note:** The AixLib parameter "WithProfile" determines whether the
78 (v_flow_profile combined with "min_ahu and max_ahu") or the
79 (persons_profile combined with "min_ahu and max_ahu")
80 is used for the AHU supply flow calculations.
81 Per default: (v_flow_profile combined with "min_ahu and max_ahu")
83 """
85 def __init__(self, parent=None):
86 """Constructor of BuildingAHU Class
87 """
88 self.parent = parent
90 self.heating = True
91 self.cooling = True
92 self.dehumidification = True
93 self.humidification = True
94 self.heat_recovery = True
95 self.by_pass_dehumidification = 0.2
96 self.efficiency_recovery = 0.65
97 self.efficiency_recovery_false = 0.2
98 self.sample_rate = 1800
99 self.efficiency_fan_supply = 0.7
100 self.efficiency_fan_return = 0.7
101 self.pressure_drop_fan_supply = 800
102 self.pressure_drop_fan_return = 800
104 self._temperature_profile = 7 * [293.15] + 12 * [295.15] + 5 * [293.15]
105 self._min_relative_humidity_profile = 24 * [0.45]
106 self._max_relative_humidity_profile = 24 * [0.65]
107 self._v_flow_profile = 7 * [0.0] + 12 * [1.0] + 5 * [0.0]
109 self.schedules = pd.DataFrame(
110 index=pd.date_range("2019-01-01 00:00:00", periods=8760, freq="h")
111 .to_series()
112 .dt.strftime("%m-%d %H:%M:%S"),
113 data={
114 "temperature_profile": list(
115 islice(cycle(self.temperature_profile), 8760)
116 ),
117 "min_relative_humidity_profile": list(
118 islice(cycle(self.min_relative_humidity_profile), 8760)
119 ),
120 "max_relative_humidity_profile": list(
121 islice(cycle(self.max_relative_humidity_profile), 8760)
122 ),
123 "v_flow_profile": list(islice(cycle(self.v_flow_profile), 8760)),
124 },
125 )
127 @property
128 def parent(self):
129 return self.__parent
131 @parent.setter
132 def parent(self, value):
133 from teaser.logic.buildingobjects.building import Building
134 import inspect
136 if inspect.isclass(Building):
137 self.__parent = value
138 self.__parent.central_ahu = self
140 @property
141 def temperature_profile(self):
142 return self._temperature_profile
144 @temperature_profile.setter
145 def temperature_profile(self, value):
146 if not isinstance(value, list):
147 value = [value]
148 self._temperature_profile = value
149 self.schedules["temperature_profile"] = list(islice(cycle(value), 8760))
151 @property
152 def min_relative_humidity_profile(self):
153 return self._min_relative_humidity_profile
155 @min_relative_humidity_profile.setter
156 def min_relative_humidity_profile(self, value):
157 if not isinstance(value, list):
158 value = [value]
159 self._min_relative_humidity_profile = value
160 self.schedules["min_relative_humidity_profile"] = list(
161 islice(cycle(value), 8760)
162 )
164 @property
165 def max_relative_humidity_profile(self):
166 return self._max_relative_humidity_profile
168 @max_relative_humidity_profile.setter
169 def max_relative_humidity_profile(self, value):
170 if not isinstance(value, list):
171 value = [value]
172 self._max_relative_humidity_profile = value
173 self.schedules["max_relative_humidity_profile"] = list(
174 islice(cycle(value), 8760)
175 )
177 @property
178 def v_flow_profile(self):
179 return self._v_flow_profile
181 @v_flow_profile.setter
182 def v_flow_profile(self, value):
183 if not isinstance(value, list):
184 value = [value]
185 self._v_flow_profile = value
186 self.schedules["v_flow_profile"] = list(islice(cycle(value), 8760))