honeybee-energy 1.116.106__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. honeybee_energy/__init__.py +24 -0
  2. honeybee_energy/__main__.py +4 -0
  3. honeybee_energy/_extend_honeybee.py +145 -0
  4. honeybee_energy/altnumber.py +21 -0
  5. honeybee_energy/baseline/__init__.py +2 -0
  6. honeybee_energy/baseline/create.py +608 -0
  7. honeybee_energy/baseline/data/__init__.py +1 -0
  8. honeybee_energy/baseline/data/constructions.csv +64 -0
  9. honeybee_energy/baseline/data/fen_ratios.csv +15 -0
  10. honeybee_energy/baseline/data/lpd_building.csv +21 -0
  11. honeybee_energy/baseline/data/pci_2016.csv +22 -0
  12. honeybee_energy/baseline/data/pci_2019.csv +22 -0
  13. honeybee_energy/baseline/data/pci_2022.csv +22 -0
  14. honeybee_energy/baseline/data/shw.csv +21 -0
  15. honeybee_energy/baseline/pci.py +512 -0
  16. honeybee_energy/baseline/result.py +371 -0
  17. honeybee_energy/boundarycondition.py +128 -0
  18. honeybee_energy/cli/__init__.py +69 -0
  19. honeybee_energy/cli/baseline.py +475 -0
  20. honeybee_energy/cli/edit.py +327 -0
  21. honeybee_energy/cli/lib.py +1154 -0
  22. honeybee_energy/cli/result.py +810 -0
  23. honeybee_energy/cli/setconfig.py +124 -0
  24. honeybee_energy/cli/settings.py +569 -0
  25. honeybee_energy/cli/simulate.py +380 -0
  26. honeybee_energy/cli/translate.py +1714 -0
  27. honeybee_energy/cli/validate.py +224 -0
  28. honeybee_energy/config.json +11 -0
  29. honeybee_energy/config.py +842 -0
  30. honeybee_energy/construction/__init__.py +1 -0
  31. honeybee_energy/construction/_base.py +374 -0
  32. honeybee_energy/construction/air.py +325 -0
  33. honeybee_energy/construction/dictutil.py +89 -0
  34. honeybee_energy/construction/dynamic.py +607 -0
  35. honeybee_energy/construction/opaque.py +460 -0
  36. honeybee_energy/construction/shade.py +319 -0
  37. honeybee_energy/construction/window.py +1096 -0
  38. honeybee_energy/construction/windowshade.py +847 -0
  39. honeybee_energy/constructionset.py +1655 -0
  40. honeybee_energy/dictutil.py +56 -0
  41. honeybee_energy/generator/__init__.py +5 -0
  42. honeybee_energy/generator/loadcenter.py +204 -0
  43. honeybee_energy/generator/pv.py +535 -0
  44. honeybee_energy/hvac/__init__.py +21 -0
  45. honeybee_energy/hvac/_base.py +124 -0
  46. honeybee_energy/hvac/_template.py +270 -0
  47. honeybee_energy/hvac/allair/__init__.py +22 -0
  48. honeybee_energy/hvac/allair/_base.py +349 -0
  49. honeybee_energy/hvac/allair/furnace.py +168 -0
  50. honeybee_energy/hvac/allair/psz.py +131 -0
  51. honeybee_energy/hvac/allair/ptac.py +163 -0
  52. honeybee_energy/hvac/allair/pvav.py +109 -0
  53. honeybee_energy/hvac/allair/vav.py +128 -0
  54. honeybee_energy/hvac/detailed.py +337 -0
  55. honeybee_energy/hvac/doas/__init__.py +28 -0
  56. honeybee_energy/hvac/doas/_base.py +345 -0
  57. honeybee_energy/hvac/doas/fcu.py +127 -0
  58. honeybee_energy/hvac/doas/radiant.py +329 -0
  59. honeybee_energy/hvac/doas/vrf.py +81 -0
  60. honeybee_energy/hvac/doas/wshp.py +91 -0
  61. honeybee_energy/hvac/heatcool/__init__.py +23 -0
  62. honeybee_energy/hvac/heatcool/_base.py +177 -0
  63. honeybee_energy/hvac/heatcool/baseboard.py +61 -0
  64. honeybee_energy/hvac/heatcool/evapcool.py +72 -0
  65. honeybee_energy/hvac/heatcool/fcu.py +92 -0
  66. honeybee_energy/hvac/heatcool/gasunit.py +53 -0
  67. honeybee_energy/hvac/heatcool/radiant.py +269 -0
  68. honeybee_energy/hvac/heatcool/residential.py +77 -0
  69. honeybee_energy/hvac/heatcool/vrf.py +54 -0
  70. honeybee_energy/hvac/heatcool/windowac.py +70 -0
  71. honeybee_energy/hvac/heatcool/wshp.py +62 -0
  72. honeybee_energy/hvac/idealair.py +699 -0
  73. honeybee_energy/internalmass.py +310 -0
  74. honeybee_energy/lib/__init__.py +1 -0
  75. honeybee_energy/lib/_loadconstructions.py +194 -0
  76. honeybee_energy/lib/_loadconstructionsets.py +117 -0
  77. honeybee_energy/lib/_loadmaterials.py +83 -0
  78. honeybee_energy/lib/_loadprogramtypes.py +125 -0
  79. honeybee_energy/lib/_loadschedules.py +87 -0
  80. honeybee_energy/lib/_loadtypelimits.py +64 -0
  81. honeybee_energy/lib/constructions.py +207 -0
  82. honeybee_energy/lib/constructionsets.py +95 -0
  83. honeybee_energy/lib/materials.py +67 -0
  84. honeybee_energy/lib/programtypes.py +125 -0
  85. honeybee_energy/lib/schedules.py +61 -0
  86. honeybee_energy/lib/scheduletypelimits.py +31 -0
  87. honeybee_energy/load/__init__.py +1 -0
  88. honeybee_energy/load/_base.py +190 -0
  89. honeybee_energy/load/daylight.py +397 -0
  90. honeybee_energy/load/dictutil.py +47 -0
  91. honeybee_energy/load/equipment.py +771 -0
  92. honeybee_energy/load/hotwater.py +543 -0
  93. honeybee_energy/load/infiltration.py +460 -0
  94. honeybee_energy/load/lighting.py +480 -0
  95. honeybee_energy/load/people.py +497 -0
  96. honeybee_energy/load/process.py +472 -0
  97. honeybee_energy/load/setpoint.py +816 -0
  98. honeybee_energy/load/ventilation.py +550 -0
  99. honeybee_energy/material/__init__.py +1 -0
  100. honeybee_energy/material/_base.py +166 -0
  101. honeybee_energy/material/dictutil.py +59 -0
  102. honeybee_energy/material/frame.py +367 -0
  103. honeybee_energy/material/gas.py +1087 -0
  104. honeybee_energy/material/glazing.py +854 -0
  105. honeybee_energy/material/opaque.py +1351 -0
  106. honeybee_energy/material/shade.py +1360 -0
  107. honeybee_energy/measure.py +472 -0
  108. honeybee_energy/programtype.py +723 -0
  109. honeybee_energy/properties/__init__.py +1 -0
  110. honeybee_energy/properties/aperture.py +333 -0
  111. honeybee_energy/properties/door.py +342 -0
  112. honeybee_energy/properties/extension.py +244 -0
  113. honeybee_energy/properties/face.py +274 -0
  114. honeybee_energy/properties/model.py +2640 -0
  115. honeybee_energy/properties/room.py +1747 -0
  116. honeybee_energy/properties/shade.py +314 -0
  117. honeybee_energy/properties/shademesh.py +262 -0
  118. honeybee_energy/reader.py +48 -0
  119. honeybee_energy/result/__init__.py +1 -0
  120. honeybee_energy/result/colorobj.py +648 -0
  121. honeybee_energy/result/emissions.py +290 -0
  122. honeybee_energy/result/err.py +101 -0
  123. honeybee_energy/result/eui.py +100 -0
  124. honeybee_energy/result/generation.py +160 -0
  125. honeybee_energy/result/loadbalance.py +890 -0
  126. honeybee_energy/result/match.py +202 -0
  127. honeybee_energy/result/osw.py +90 -0
  128. honeybee_energy/result/rdd.py +59 -0
  129. honeybee_energy/result/zsz.py +190 -0
  130. honeybee_energy/run.py +1577 -0
  131. honeybee_energy/schedule/__init__.py +1 -0
  132. honeybee_energy/schedule/day.py +626 -0
  133. honeybee_energy/schedule/dictutil.py +59 -0
  134. honeybee_energy/schedule/fixedinterval.py +1012 -0
  135. honeybee_energy/schedule/rule.py +619 -0
  136. honeybee_energy/schedule/ruleset.py +1867 -0
  137. honeybee_energy/schedule/typelimit.py +310 -0
  138. honeybee_energy/shw.py +315 -0
  139. honeybee_energy/simulation/__init__.py +1 -0
  140. honeybee_energy/simulation/control.py +214 -0
  141. honeybee_energy/simulation/daylightsaving.py +185 -0
  142. honeybee_energy/simulation/dictutil.py +51 -0
  143. honeybee_energy/simulation/output.py +646 -0
  144. honeybee_energy/simulation/parameter.py +606 -0
  145. honeybee_energy/simulation/runperiod.py +443 -0
  146. honeybee_energy/simulation/shadowcalculation.py +295 -0
  147. honeybee_energy/simulation/sizing.py +546 -0
  148. honeybee_energy/ventcool/__init__.py +5 -0
  149. honeybee_energy/ventcool/_crack_data.py +91 -0
  150. honeybee_energy/ventcool/afn.py +289 -0
  151. honeybee_energy/ventcool/control.py +269 -0
  152. honeybee_energy/ventcool/crack.py +126 -0
  153. honeybee_energy/ventcool/fan.py +493 -0
  154. honeybee_energy/ventcool/opening.py +365 -0
  155. honeybee_energy/ventcool/simulation.py +314 -0
  156. honeybee_energy/writer.py +1078 -0
  157. honeybee_energy-1.116.106.dist-info/METADATA +113 -0
  158. honeybee_energy-1.116.106.dist-info/RECORD +162 -0
  159. honeybee_energy-1.116.106.dist-info/WHEEL +5 -0
  160. honeybee_energy-1.116.106.dist-info/entry_points.txt +2 -0
  161. honeybee_energy-1.116.106.dist-info/licenses/LICENSE +661 -0
  162. honeybee_energy-1.116.106.dist-info/top_level.txt +1 -0
@@ -0,0 +1,546 @@
1
+ # coding=utf-8
2
+ """Parameters with criteria for sizing the heating and cooling system."""
3
+ from __future__ import division
4
+
5
+ from ..reader import parse_idf_string
6
+ from ..writer import generate_idf_string
7
+
8
+ from honeybee.typing import float_positive, valid_ep_string
9
+
10
+ from ladybug.ddy import DDY
11
+ from ladybug.designday import DesignDay
12
+ from ladybug.location import Location
13
+
14
+
15
+ class SizingParameter(object):
16
+ """Sizing parameters with criteria for sizing the heating and cooling system.
17
+
18
+ Args:
19
+ design_days: An array of Ladybug DesignDay objects that represent the
20
+ criteria for which the HVAC systems will be sized. (Default: None).
21
+ heating_factor: A number that will get multiplied by the peak heating load
22
+ for each zone in the model in order to size the heating system for
23
+ the model. Must be greater than 0. (Default: 1.25).
24
+ cooling_factor: A number that will get multiplied by the peak cooling load
25
+ for each zone in the model in order to size the cooling system for
26
+ the model. Must be greater than 0. (Default: 1.15).
27
+ efficiency_standard: Text to specify the efficiency standard, which will
28
+ automatically set the efficiencies of all HVAC equipment when provided.
29
+ Note that providing a standard here will cause the OpenStudio translation
30
+ process to perform an additional sizing calculation with EnergyPlus,
31
+ which is needed since the default efficiencies of equipment vary depending
32
+ on their size. THIS WILL SIGNIFICANTLY INCREASE TRANSLATION TIME.
33
+ However, it is often worthwhile when the goal is to match the
34
+ HVAC specification with a particular standard. (Default: None).
35
+ Choose from the following.
36
+
37
+ * DOE_Ref_Pre_1980
38
+ * DOE_Ref_1980_2004
39
+ * ASHRAE_2004
40
+ * ASHRAE_2007
41
+ * ASHRAE_2010
42
+ * ASHRAE_2013
43
+ * ASHRAE_2016
44
+ * ASHRAE_2019
45
+
46
+ climate_zone: Text indicating the ASHRAE climate zone to be used with the
47
+ efficiency_standard. When unspecified, the climate zone will be
48
+ inferred from the design days. This input can be a single
49
+ integer (in which case it is interpreted as A) or it can include the
50
+ A, B, or C qualifier (eg. 3C).
51
+ building_type: Text for the building type to be used in the efficiency_standard.
52
+ If the type is not recognized or is None, it will be assumed that the
53
+ building is a generic NonResidential. The following have meaning
54
+ for the standard.
55
+
56
+ * NonResidential
57
+ * Residential
58
+ * MidriseApartment
59
+ * HighriseApartment
60
+ * LargeOffice
61
+ * MediumOffice
62
+ * SmallOffice
63
+ * Retail
64
+ * StripMall
65
+ * PrimarySchool
66
+ * SecondarySchool
67
+ * SmallHotel
68
+ * LargeHotel
69
+ * Hospital
70
+ * Outpatient
71
+ * Warehouse
72
+ * SuperMarket
73
+ * FullServiceRestaurant
74
+ * QuickServiceRestaurant
75
+ * Laboratory
76
+ * Courthouse
77
+
78
+ bypass_efficiency_sizing: A boolean to indicate whether the efficiency
79
+ standard should trigger a sizing run that sets the efficiencies
80
+ of all HVAC equipment in the Model (False) or the standard should
81
+ only be written into the OSM and the sizing run should be
82
+ bypassed (True). Bypassing the sizing run is useful when you only
83
+ want to check that the overall HVAC system architecture is correct
84
+ and you do not want to wait the extra time that it takes to run the
85
+ sizing calculation. (Default: False).
86
+
87
+ Properties:
88
+ * design_days
89
+ * heating_factor
90
+ * cooling_factor
91
+ * efficiency_standard
92
+ * climate_zone
93
+ * building_type
94
+ * bypass_efficiency_sizing
95
+ """
96
+ __slots__ = ('_design_days', '_heating_factor', '_cooling_factor',
97
+ '_efficiency_standard', '_climate_zone', '_building_type',
98
+ '_bypass_efficiency_sizing')
99
+ STANDARDS = ('DOE_Ref_Pre_1980', 'DOE_Ref_1980_2004', 'ASHRAE_2004', 'ASHRAE_2007',
100
+ 'ASHRAE_2010', 'ASHRAE_2013', 'ASHRAE_2016', 'ASHRAE_2019')
101
+ CLIMATE_ZONES = (
102
+ '0A', '1A', '2A', '3A', '4A', '5A', '6A',
103
+ '0B', '1B', '2B', '3B', '4B', '5B', '6B',
104
+ '3C', '4C', '5C', '7', '8'
105
+ )
106
+
107
+ def __init__(self, design_days=None, heating_factor=1.25, cooling_factor=1.15,
108
+ efficiency_standard=None, climate_zone=None, building_type=None,
109
+ bypass_efficiency_sizing=False):
110
+ """Initialize SizingParameter."""
111
+ self.design_days = design_days
112
+ self.heating_factor = heating_factor
113
+ self.cooling_factor = cooling_factor
114
+ self.efficiency_standard = efficiency_standard
115
+ self.climate_zone = climate_zone
116
+ self.building_type = building_type
117
+ self.bypass_efficiency_sizing = bypass_efficiency_sizing
118
+
119
+ @property
120
+ def design_days(self):
121
+ """Get or set an array of Ladybug DesignDay objects for sizing criteria."""
122
+ return tuple(self._design_days)
123
+
124
+ @design_days.setter
125
+ def design_days(self, value):
126
+ if value is not None:
127
+ try:
128
+ if not isinstance(value, list):
129
+ value = list(value)
130
+ except TypeError:
131
+ raise TypeError('Expected list or tuple for SizingParameter '
132
+ 'design_days. Got {}'.format(type(value)))
133
+ for dday in value:
134
+ assert isinstance(dday, DesignDay), 'Expected ladybug DesignDay ' \
135
+ 'for SizingParameter. Got {}.'.format(type(dday))
136
+ self._design_days = value
137
+ else:
138
+ self._design_days = []
139
+
140
+ @property
141
+ def heating_factor(self):
142
+ """Get or set a number that will get multiplied by the peak heating loads."""
143
+ return self._heating_factor
144
+
145
+ @heating_factor.setter
146
+ def heating_factor(self, value):
147
+ self._heating_factor = float_positive(value, 'sizing parameter heating factor')
148
+ assert self._heating_factor != 0, 'SizingParameter heating factor cannot be 0.'
149
+
150
+ @property
151
+ def cooling_factor(self):
152
+ """Get or set a number that will get multiplied by the peak cooling loads."""
153
+ return self._cooling_factor
154
+
155
+ @cooling_factor.setter
156
+ def cooling_factor(self, value):
157
+ self._cooling_factor = float_positive(value, 'sizing parameter cooling factor')
158
+ assert self._cooling_factor != 0, 'SizingParameter cooling factor cannot be 0.'
159
+
160
+ @property
161
+ def efficiency_standard(self):
162
+ """Get or set text for the efficiency standard.
163
+
164
+ When specified, this will automatically set the efficiencies of all HVAC
165
+ equipment. Note that setting this variable will cause the OpenStudio
166
+ translation process to perform an additional sizing calculation with EnergyPlus,
167
+ which is needed since the default efficiencies of equipment vary depending
168
+ on their size. So THIS WILL SIGNIFICANTLY INCREASE TRANSLATION TIME.
169
+ However, it is often worthwhile when the goal is to match the
170
+ HVAC specification with a particular standard. Choose from the following.
171
+
172
+ * DOE_Ref_Pre_1980
173
+ * DOE_Ref_1980_2004
174
+ * ASHRAE_2004
175
+ * ASHRAE_2007
176
+ * ASHRAE_2010
177
+ * ASHRAE_2013
178
+ * ASHRAE_2016
179
+ * ASHRAE_2019
180
+ """
181
+ return self._efficiency_standard
182
+
183
+ @efficiency_standard.setter
184
+ def efficiency_standard(self, value):
185
+ if value:
186
+ clean_input = valid_ep_string(value, 'efficiency_standard').lower()
187
+ for key in self.STANDARDS:
188
+ if key.lower() == clean_input:
189
+ value = key
190
+ break
191
+ else:
192
+ raise ValueError(
193
+ 'Efficiency standard "{}" is not recognized.\nChoose from the '
194
+ 'following:\n{}'.format(value, self.STANDARDS))
195
+ else:
196
+ value = None
197
+ self._efficiency_standard = value
198
+
199
+ @property
200
+ def climate_zone(self):
201
+ """Get or set text for the climate zone associated with the efficiency standard.
202
+
203
+ When unspecified, the climate zone will be inferred from the design days.
204
+ This input can be a single integer (in which case it is interpreted as A)
205
+ or it can include the A, B, or C qualifier (eg. 3C).
206
+ """
207
+ return self._climate_zone
208
+
209
+ @climate_zone.setter
210
+ def climate_zone(self, value):
211
+ if value:
212
+ value = valid_ep_string(value, 'climate_zone').upper()
213
+ if len(value) == 1 and value not in ('7', '8'):
214
+ value = '{}A'.format(value)
215
+ if value not in self.CLIMATE_ZONES:
216
+ raise ValueError(
217
+ 'Efficiency climate zone "{}" is not recognized.\nChoose from the '
218
+ 'following:\n{}'.format(value, self.CLIMATE_ZONES))
219
+ else:
220
+ value = None
221
+ self._climate_zone = value
222
+
223
+ @property
224
+ def building_type(self):
225
+ """Get or set text for the building type associated with the efficiency standard.
226
+
227
+ If the type is not recognized or is None, it will be assumed that the
228
+ building is a generic NonResidential.
229
+ """
230
+ return self._building_type
231
+
232
+ @building_type.setter
233
+ def building_type(self, value):
234
+ if value:
235
+ value = valid_ep_string(value, 'building_type')
236
+ else:
237
+ value = None
238
+ self._building_type = value
239
+
240
+ @property
241
+ def bypass_efficiency_sizing(self):
242
+ """Get or set a boolean for whether efficiency standard triggers a sizing run."""
243
+ return self._bypass_efficiency_sizing
244
+
245
+ @bypass_efficiency_sizing.setter
246
+ def bypass_efficiency_sizing(self, value):
247
+ self._bypass_efficiency_sizing = bool(value)
248
+
249
+ def add_design_day(self, design_day):
250
+ """Add a ladybug DesignDay to this object's design_days.
251
+
252
+ Args:
253
+ design_day: A Ladybug DesignDay object to be added to this object.
254
+ """
255
+ assert isinstance(design_day, DesignDay), 'Expected ladybug DesignDay for' \
256
+ ' SizingParameter. Got {}.'.format(type(design_day))
257
+ self._design_days.append(design_day)
258
+
259
+ def add_from_ddy(self, ddy_file):
260
+ """Add all design days within a .ddy file to this object.
261
+
262
+ Args:
263
+ ddy_file: The full path to a .ddy file on this machine.
264
+ """
265
+ ddy_obj = DDY.from_ddy_file(ddy_file)
266
+ for dday in ddy_obj:
267
+ self._design_days.append(dday)
268
+
269
+ def add_from_ddy_996_004(self, ddy_file):
270
+ """Add the 99.6% and 0.4% design days within a .ddy file to this object.
271
+
272
+ 99.6% means that this percent of the hours of the year have outside heating
273
+ conditions warmer than this design day. 0.4% means that this percent of the
274
+ hours of the year have outside cooling conditions cooler than this design day.
275
+
276
+ Args:
277
+ ddy_file: The full path to a .ddy file on this machine.
278
+ """
279
+ ddy_obj = DDY.from_ddy_file(ddy_file)
280
+ for dday in ddy_obj:
281
+ if '99.6%' in dday.name or '.4%' in dday.name:
282
+ self._design_days.append(dday)
283
+
284
+ def add_from_ddy_990_010(self, ddy_file):
285
+ """Add the 99.0% and 1.0% design days within a .ddy file to this object.
286
+
287
+ 99.0% means that this percent of the hours of the year have outside heating
288
+ conditions warmer than this design day. 1.0% means that this percent of the
289
+ hours of the year have outside cooling conditions cooler than this design day.
290
+
291
+ Args:
292
+ ddy_file: The full path to a .ddy file on this machine.
293
+ """
294
+ ddy_obj = DDY.from_ddy_file(ddy_file)
295
+ for dday in ddy_obj:
296
+ if '99%' in dday.name or '1%' in dday.name:
297
+ self._design_days.append(dday)
298
+
299
+ def add_from_ddy_keyword(self, ddy_file, keyword):
300
+ """Add DesignDays from a .ddy file using a keyword in the DesignDay name.
301
+
302
+ Args:
303
+ ddy_file: The full path to a .ddy file on this machine.
304
+ keyword: String for a keyword, which will be used to select DesignDays
305
+ from the .ddy file to add to this object.
306
+ """
307
+ ddy_obj = DDY.from_ddy_file(ddy_file)
308
+ for dday in ddy_obj:
309
+ if keyword in dday.name:
310
+ self._design_days.append(dday)
311
+
312
+ def remove_design_day(self, design_day_index):
313
+ """Remove a single DesignDay from this object using an index.
314
+
315
+ Args:
316
+ design_day_index: An integer for the index of the DesignDay to remove.
317
+ """
318
+ del self._design_days[design_day_index]
319
+
320
+ def remove_design_day_keyword(self, keyword):
321
+ """Remove DesignDays from this object using a keyword in the DesignDay names.
322
+
323
+ Args:
324
+ keyword: String for a keyword, which will be used to select DesignDays
325
+ for deletion from this object.
326
+ """
327
+ design_days = []
328
+ for dday in self._design_days:
329
+ if keyword not in dday.name:
330
+ design_days.append(dday)
331
+ self._design_days = design_days
332
+
333
+ def remove_all_design_days(self):
334
+ """Remove all DesignDays from this object."""
335
+ self._design_days = []
336
+
337
+ def apply_location(self, location):
338
+ """Apply a Ladybug Location object to all of the DesignDays in this object.
339
+
340
+ This is particularly handy after re-serialization from an IDF since the
341
+ IDF does not store the location information in the DesignDay.
342
+
343
+ Args:
344
+ location: A Ladybug Location object.
345
+ """
346
+ assert isinstance(location, Location), \
347
+ 'Expected Ladybug Location. Got {}.'.format(type(Location))
348
+ for dday in self._design_days:
349
+ dday.location = location
350
+
351
+ @classmethod
352
+ def from_idf(cls, design_days=None, sizing_parameter=None, location=None):
353
+ """Create a SizingParameter object from an EnergyPlus IDF text string.
354
+
355
+ Args:
356
+ design_days: An array of of IDF SizingPeriod:DesignDay strings that
357
+ represent the criteria for which the HVAC systems will be sized.
358
+ If None, no sizing criteria will be included. Default: None.
359
+ sizing_parameter: A text string for an EnergyPlus Sizing:Parameters
360
+ definition. If None, defaults of 1.25 anf 1.15 will be used.
361
+ Default: None.
362
+ location: An optional Ladybug Location object, which gets assigned
363
+ to the DesignDay objects in order to interpret their SkyConditions.
364
+ This object is not used in the export to IDF. If None, the
365
+ intersection of the equator with the prime meridian will be used.
366
+ Default: None.
367
+ """
368
+ # process the input design_days
369
+ des_day_objs = None
370
+ if design_days is not None:
371
+ location = Location() if location is None else location
372
+ des_day_objs = [DesignDay.from_idf(dday, location) for dday in design_days]
373
+
374
+ # process the sizing_parameter
375
+ heating_factor = 1.25
376
+ cooling_factor = 1.15
377
+ if sizing_parameter is not None:
378
+ try:
379
+ ep_strs = parse_idf_string(sizing_parameter, 'Sizing:Parameters,')
380
+ heating_factor = ep_strs[0] if ep_strs[0] != '' else 1.25
381
+ cooling_factor = ep_strs[1] if ep_strs[1] != '' else 1.15
382
+ except IndexError:
383
+ pass # shorter SizingParameters definition
384
+
385
+ return cls(des_day_objs, heating_factor, cooling_factor)
386
+
387
+ @classmethod
388
+ def from_dict(cls, data):
389
+ """Create a SizingParameter object from a dictionary.
390
+
391
+ Args:
392
+ data: A SizingParameter dictionary in following the format.
393
+
394
+ .. code-block:: python
395
+
396
+ {
397
+ "type": "SizingParameter",
398
+ "design_days": [], # Array of Ladybug DesignDay dictionaries
399
+ "heating_factor": 1.25,
400
+ "cooling_factor": 1.15,
401
+ "efficiency_standard": "ASHRAE_2004", # standard for HVAC efficiency
402
+ "climate_zone": "5A", # climate zone for HVAC efficiency
403
+ "building_type": "LargeOffice", # building type for HVAC efficiency
404
+ "bypass_efficiency_sizing": False # bypass the efficiency sizing run
405
+ }
406
+ """
407
+ assert data['type'] == 'SizingParameter', \
408
+ 'Expected SizingParameter dictionary. Got {}.'.format(data['type'])
409
+ design_days = None
410
+ if 'design_days' in data and data['design_days'] is not None:
411
+ design_days = [DesignDay.from_dict(dday) for dday in data['design_days']]
412
+ heating_factor = data['heating_factor'] if 'heating_factor' in data else 1.25
413
+ cooling_factor = data['cooling_factor'] if 'cooling_factor' in data else 1.15
414
+ es = data['efficiency_standard'] if 'efficiency_standard' in data else None
415
+ cz = data['climate_zone'] if 'climate_zone' in data else None
416
+ bt = data['building_type'] if 'building_type' in data else None
417
+ bes = data['bypass_efficiency_sizing'] \
418
+ if 'bypass_efficiency_sizing' in data else False
419
+ return cls(design_days, heating_factor, cooling_factor, es, cz, bt, bes)
420
+
421
+ def to_idf(self):
422
+ """Get an EnergyPlus string representation of the SizingParameters.
423
+
424
+ Returns:
425
+ A tuple with two elements
426
+
427
+ - design_days: An array of of IDF SizingPeriod:DesignDay strings.
428
+
429
+ - sizing_parameter: A text string for an EnergyPlus Sizing:Parameters
430
+ definition.
431
+
432
+ .. code-block:: shell
433
+
434
+ SizingPeriod:DesignDay,
435
+ Jacksonville Ann Htg 99.6% Condns DB, !- Name
436
+ 1, !- Month
437
+ 21, !- Day of Month
438
+ WinterDesignDay, !- Day Type
439
+ 1.3, !- Max Dry-Bulb Temp {C}
440
+ 0.0, !- Daily Dry-Bulb Temp Range {C}
441
+ DefaultMultipliers, !- Dry-Bulb Temp Range Modifier Type
442
+ , !- Dry-Bulb Temp Range Modifier Schedule Name
443
+ Wetbulb, !- Humidity Condition Type
444
+ 1.3, !- Wetbulb/Dewpoint at Max Dry-Bulb {C}
445
+ , !- Humidity Indicating Day Schedule Name
446
+ , !- Humidity Ratio at Max Dry-Bulb {kgWater/kgDryAir}
447
+ , !- Enthalpy at Maximum Dry-Bulb {J/kg}
448
+ , !- Daily Wet-Bulb Temperature Range {deltaC}
449
+ 101252.0, !- Barometric Pressure {Pa}
450
+ 4.3, !- Wind Speed {m/s}
451
+ 320.0, !- Wind Direction {Degrees; N=0, S=180}
452
+ No, !- Rain {Yes/No}
453
+ No, !- Snow on ground {Yes/No}
454
+ No, !- Daylight Savings Time Indicator {Yes/No}
455
+ ASHRAEClearSky, !- Solar Model Indicator
456
+ , !- Beam Solar Day Schedule Name
457
+ , !- Diffuse Solar Day Schedule Name
458
+ , !- ASHRAE Clear Sky Beam Optical Depth (taub)
459
+ , !- ASHRAE Clear Sky Diffuse Optical Depth (taud)
460
+ 0.0; !- Clearness (0.0 to 1.2)
461
+ """
462
+ # process the design_days
463
+ design_days = [dday.to_idf() for dday in self.design_days]
464
+ # process the Sizing:Parameters object
465
+ values = (self.heating_factor, self.cooling_factor)
466
+ comments = ('heating factor', 'cooling factor')
467
+ sizing_parameter = generate_idf_string('Sizing:Parameters', values, comments)
468
+ return design_days, sizing_parameter
469
+
470
+ def to_dict(self):
471
+ """SizingParameter dictionary representation."""
472
+ siz_par = {
473
+ 'type': 'SizingParameter',
474
+ 'heating_factor': self.heating_factor,
475
+ 'cooling_factor': self.cooling_factor
476
+ }
477
+ if self.efficiency_standard is not None:
478
+ siz_par['efficiency_standard'] = self.efficiency_standard
479
+ if self.climate_zone is not None:
480
+ siz_par['climate_zone'] = self.climate_zone
481
+ if self.building_type is not None:
482
+ siz_par['building_type'] = self.building_type
483
+ if len(self._design_days) != 0:
484
+ siz_par['design_days'] = [dday.to_dict(False) for dday in self.design_days]
485
+ if self.bypass_efficiency_sizing:
486
+ siz_par['bypass_efficiency_sizing'] = self.bypass_efficiency_sizing
487
+ return siz_par
488
+
489
+ def to_ddy(self):
490
+ """Get this SizingParameter as a Ladybug DDY object.
491
+
492
+ This can be written to a .ddy file if so desired.
493
+ """
494
+ assert len(self._design_days) != 0, \
495
+ 'There must be at least one design_day to use SizingParameter.to_ddy.'
496
+ return DDY(self._design_days[0].location, self._design_days)
497
+
498
+ def duplicate(self):
499
+ """Get a copy of this object."""
500
+ return self.__copy__()
501
+
502
+ def ToString(self):
503
+ """Overwrite .NET ToString."""
504
+ return self.__repr__()
505
+
506
+ def __copy__(self):
507
+ return SizingParameter(
508
+ [dday.duplicate() for dday in self._design_days],
509
+ self.heating_factor, self.cooling_factor, self.efficiency_standard,
510
+ self.climate_zone, self.building_type, self.bypass_efficiency_sizing)
511
+
512
+ def __key(self):
513
+ """A tuple based on the object properties, useful for hashing."""
514
+ return tuple(hash(dday) for dday in self._design_days) + \
515
+ (self.heating_factor, self.cooling_factor, self.efficiency_standard,
516
+ self.climate_zone, self.building_type, self.bypass_efficiency_sizing)
517
+
518
+ def __hash__(self):
519
+ return hash(self.__key())
520
+
521
+ def __eq__(self, other):
522
+ return isinstance(other, SizingParameter) and self.__key() == other.__key()
523
+
524
+ def __ne__(self, other):
525
+ return not self.__eq__(other)
526
+
527
+ def __len__(self):
528
+ return len(self._design_days)
529
+
530
+ def __getitem__(self, key):
531
+ return self._design_days[key]
532
+
533
+ def __setitem__(self, key, value):
534
+ assert isinstance(value, DesignDay), \
535
+ 'Expected DesignDay type. Got {}'.format(type(value))
536
+ self._design_days[key] = value
537
+
538
+ def __iter__(self):
539
+ return iter(self._design_days)
540
+
541
+ def __contains__(self, item):
542
+ return item in self._design_days
543
+
544
+ def __repr__(self):
545
+ return 'SizingParameter: [{} design days] [heating: {}] [cooling: {}]'.format(
546
+ len(self._design_days), self.heating_factor, self.cooling_factor)
@@ -0,0 +1,5 @@
1
+ """honeybee-energy ventilative cooling definitions.
2
+
3
+ This includes opening windows, turning on fans, and other forms of deliberately
4
+ letting in outdoor air for cooling.
5
+ """
@@ -0,0 +1,91 @@
1
+ # coding':utf-8
2
+ """Crack data dictionary.
3
+
4
+ The flow coefficient and exponent data is referenced here from the DesignBuilder Cracks
5
+ Template, which derives these values to empirically provide typical air changes rates
6
+ for the respective air tightness classifications for a range of building types[1].
7
+
8
+ Note that this crack data is normalized by area and perimeter for face cracks and subface
9
+ edges, respectively. As such, the units for the wall, and roof flow coefficients are
10
+ kg/s/m2 at 1 Pa, and the units for the window, and door coefficients are kg/s/m at 1 Pa.
11
+ In EnergyPlus the face cracks are not normalized by area, but subface edges are
12
+ normalized by perimeter.
13
+
14
+ Note:
15
+ [1] DesignBuilder (6.1.6.008). DesignBuilder Software Ltd, 2000-2020.
16
+ """
17
+
18
+ CRACK_TEMPLATE_DATA = {
19
+
20
+ 'external_excellent_cracks': {
21
+ 'wall_flow_cof': 0.00001,
22
+ 'wall_flow_exp': 0.7,
23
+ 'roof_flow_cof': 0.00001,
24
+ 'roof_flow_exp': 0.7,
25
+ 'floor_flow_cof': 0.0001,
26
+ 'floor_flow_exp': 0.7,
27
+ 'window_flow_cof': 0.00001,
28
+ 'window_flow_exp': 0.7,
29
+ 'door_flow_cof': 0.0002,
30
+ 'door_flow_exp': 0.7
31
+ },
32
+
33
+ 'external_medium_cracks': {
34
+ 'wall_flow_cof': 0.0001,
35
+ 'wall_flow_exp': 0.7,
36
+ 'roof_flow_cof': 0.0001,
37
+ 'roof_flow_exp': 0.7,
38
+ 'floor_flow_cof': 0.0007,
39
+ 'floor_flow_exp': 1,
40
+ 'window_flow_cof': 0.00014,
41
+ 'window_flow_exp': 0.65,
42
+ 'door_flow_cof': 0.0014,
43
+ 'door_flow_exp': 0.65
44
+ },
45
+
46
+ 'external_verypoor_cracks': {
47
+ 'wall_flow_cof': 0.0004,
48
+ 'wall_flow_exp': 0.7,
49
+ 'roof_flow_cof': 0.0002,
50
+ 'roof_flow_exp': 0.7,
51
+ 'floor_flow_cof': 0.002,
52
+ 'floor_flow_exp': 1,
53
+ 'window_flow_cof': 0.003,
54
+ 'window_flow_exp': 0.6,
55
+ 'door_flow_cof': 0.003,
56
+ 'door_flow_exp': 0.66
57
+ },
58
+
59
+ 'internal_excellent_cracks': {
60
+ 'wall_flow_cof': 0.001,
61
+ 'wall_flow_exp': 0.75,
62
+ 'floorceiling_flow_cof': 0.00001,
63
+ 'floorceiling_flow_exp': 0.7,
64
+ 'window_flow_cof': 0.0002,
65
+ 'window_flow_exp': 0.7,
66
+ 'door_flow_cof': 0.02,
67
+ 'door_flow_exp': 0.7
68
+ },
69
+
70
+ 'internal_medium_cracks': {
71
+ 'wall_flow_cof': 0.003,
72
+ 'wall_flow_exp': 0.75,
73
+ 'floorceiling_flow_cof': 0.0009,
74
+ 'floorceiling_flow_exp': 0.7,
75
+ 'window_flow_cof': 0.0014,
76
+ 'window_flow_exp': 0.65,
77
+ 'door_flow_cof': 0.02,
78
+ 'door_flow_exp': 0.6
79
+ },
80
+
81
+ 'internal_verypoor_cracks': {
82
+ 'wall_flow_cof': 0.019,
83
+ 'wall_flow_exp': 0.75,
84
+ 'floorceiling_flow_cof': 0.003,
85
+ 'floorceiling_flow_exp': 0.7,
86
+ 'window_flow_cof': 0.003,
87
+ 'window_flow_exp': 0.6,
88
+ 'door_flow_cof': 0.02,
89
+ 'door_flow_exp': 0.6
90
+ }
91
+ }