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,371 @@
1
+ """Module for producing summaries of results from baseline simulations."""
2
+ from .pci import comparison_from_sql
3
+
4
+
5
+ def appendix_g_summary(
6
+ proposed_sql, baseline_sqls, climate_zone, building_type='NonResidential',
7
+ electricity_cost=0.12, natural_gas_cost=0.06,
8
+ district_cooling_cost=0.04, district_heating_cost=0.08):
9
+ """Get a dictionary with a summary of ASHRAE-90.1 Appendix G performance.
10
+
11
+ Args:
12
+ proposed_sql: The path of the SQL result file that has been generated from an
13
+ energy simulation of a proposed building.
14
+ baseline_sqls: The path of the SQL result file that has been generated from an
15
+ energy simulation of a baseline building. This can also be a list of SQL
16
+ result files (eg. for several simulations of different orientations)
17
+ in which case the baseline performance will be computed as the average
18
+ across all files. Lastly, it can be a directory or list of directories
19
+ containing results, in which case, the average performance will be
20
+ calculated form all files ending in .sql.
21
+ climate_zone: Text indicating the ASHRAE climate zone. This can be a single
22
+ integer (in which case it is interpreted as A) or it can include the
23
+ A, B, or C qualifier (eg. 3C).
24
+ building_type: Text for the building type that the Model represents. This is
25
+ used to determine the baseline window-to-wall ratio and HVAC system. If
26
+ the type is not recognized or is "Unknown", it will be assumed that the
27
+ building is a generic NonResidential. The following have specified
28
+ meaning per the standard.
29
+
30
+ * NonResidential
31
+ * Residential
32
+ * MidriseApartment
33
+ * HighriseApartment
34
+ * LargeOffice
35
+ * MediumOffice
36
+ * SmallOffice
37
+ * Retail
38
+ * StripMall
39
+ * PrimarySchool
40
+ * SecondarySchool
41
+ * SmallHotel
42
+ * LargeHotel
43
+ * Hospital
44
+ * Outpatient
45
+ * Warehouse
46
+ * SuperMarket
47
+ * FullServiceRestaurant
48
+ * QuickServiceRestaurant
49
+ * Laboratory
50
+ * Courthouse
51
+
52
+ electricity_cost: A number for the cost per each kWh of electricity. This
53
+ can be in any currency as long as it is coordinated with the costs of
54
+ other inputs to this method. (Default: 0.12 for the average 2020
55
+ cost of electricity in the US in $/kWh).
56
+ natural_gas_cost: A number for the cost per each kWh of natural gas. This
57
+ can be in any currency as long as it is coordinated with the
58
+ other inputs to this method. (Default: 0.06 for the average 2020
59
+ cost of natural gas in the US in $/kWh).
60
+ district_cooling_cost: A number for the cost per each kWh of district cooling
61
+ energy. This can be in any currency as long as it is coordinated with the
62
+ other inputs to this method. (Default: 0.04 assuming average 2020 US
63
+ cost of electricity in $/kWh with a COP 3.5 chiller).
64
+ district_heating_cost: A number for the cost per each kWh of district heating
65
+ energy. This can be in any currency as long as it is coordinated with the
66
+ other inputs to this method. (Default: 0.08 assuming average 2020 US
67
+ cost of natural gas in $/kWh with an efficiency of 0.75 with all burner
68
+ and distribution losses).
69
+
70
+ Returns:
71
+ A dictionary with several keys.
72
+
73
+ - proposed_eui -- A number for the proposed end use intensity. Specifically,
74
+ this is the sum of all electricity, fuel, district heating/cooling,
75
+ etc. divided by the gross floor area (including both conditioned
76
+ and unconditioned spaces). Units are kWh/m2.
77
+
78
+ - proposed_energy -- A number for the total energy use of the proposed
79
+ building in kWh.
80
+
81
+ - proposed_cost -- A number for the total annual energy cost of the
82
+ proposed building.
83
+
84
+ - baseline_eui -- A number for the baseline end use intensity. Specifically,
85
+ this is the sum of all electricity, fuel, district heating/cooling,
86
+ etc. divided by the gross floor area (including both conditioned
87
+ and unconditioned spaces). Units are kWh/m2.
88
+
89
+ - baseline_energy -- A number for the total energy use of the baseline
90
+ building in kWh.
91
+
92
+ - baseline_cost -- A number for the total annual energy cost of the
93
+ baseline building.
94
+
95
+ - pci_t_2016 -- A fractional number for the target PCI for ASHRAE 90.1-2016.
96
+
97
+ - pci_t_2019 -- A fractional number for the target PCI for ASHRAE 90.1-2019.
98
+
99
+ - pci_t_2022 -- A fractional number for the target PCI for ASHRAE 90.1-2022.
100
+
101
+ - pci -- A fractional number for the PCI of the proposed building.
102
+
103
+ - pci_improvement_2016 -- A number less than 100 for the percentage better
104
+ that the proposed building is over the target PCI for ASHRAE 90.1-2016.
105
+ Negative numbers indicate a proposed building that is worse than
106
+ the 2016 target PCI.
107
+
108
+ - pci_improvement_2019 -- A number less than 100 for the percentage better
109
+ that the proposed building is over the target PCI for ASHRAE 90.1-2019.
110
+ Negative numbers indicate a proposed building that is worse than
111
+ the 2019 target PCI.
112
+
113
+ - pci_improvement_2022 -- A number less than 100 for the percentage better
114
+ that the proposed building is over the target PCI for ASHRAE 90.1-2022.
115
+ Negative numbers indicate a proposed building that is worse than
116
+ the 2022 target PCI.
117
+ """
118
+ # get the comparison report
119
+ result_dict = comparison_from_sql(
120
+ proposed_sql, baseline_sqls, climate_zone, building_type,
121
+ electricity_cost, natural_gas_cost,
122
+ district_cooling_cost, district_heating_cost)
123
+ # remove all of the attributes that are not a part of Appendix G
124
+ result_dict.pop('proposed_carbon')
125
+ result_dict.pop('baseline_carbon')
126
+ result_dict.pop('carbon_t_2016')
127
+ result_dict.pop('carbon_t_2019')
128
+ result_dict.pop('carbon_t_2022')
129
+ result_dict.pop('pci_carbon')
130
+ result_dict.pop('carbon_improvement_2016')
131
+ result_dict.pop('carbon_improvement_2019')
132
+ result_dict.pop('carbon_improvement_2022')
133
+ return result_dict
134
+
135
+
136
+ def leed_v4_summary(
137
+ proposed_sql, baseline_sqls, climate_zone, building_type='NonResidential',
138
+ electricity_cost=0.12, natural_gas_cost=0.06, district_cooling_cost=0.04,
139
+ district_heating_cost=0.08, electricity_emissions=400):
140
+ """Get a dictionary with a summary of LEED v4 (and 4.1) performance.
141
+
142
+ Args:
143
+ proposed_sql: The path of the SQL result file that has been generated from an
144
+ energy simulation of a proposed building.
145
+ baseline_sqls: The path of the SQL result file that has been generated from an
146
+ energy simulation of a baseline building. This can also be a list of SQL
147
+ result files (eg. for several simulations of different orientations)
148
+ in which case the baseline performance will be computed as the average
149
+ across all files. Lastly, it can be a directory or list of directories
150
+ containing results, in which case, the average performance will be
151
+ calculated form all files ending in .sql.
152
+ climate_zone: Text indicating the ASHRAE climate zone. This can be a single
153
+ integer (in which case it is interpreted as A) or it can include the
154
+ A, B, or C qualifier (eg. 3C).
155
+ building_type: Text for the building type that the Model represents. This is
156
+ used to determine the baseline window-to-wall ratio and HVAC system. If
157
+ the type is not recognized or is "Unknown", it will be assumed that the
158
+ building is a generic NonResidential. The following have specified
159
+ meaning per the standard.
160
+
161
+ * NonResidential
162
+ * Residential
163
+ * MidriseApartment
164
+ * HighriseApartment
165
+ * LargeOffice
166
+ * MediumOffice
167
+ * SmallOffice
168
+ * Retail
169
+ * StripMall
170
+ * PrimarySchool
171
+ * SecondarySchool
172
+ * SmallHotel
173
+ * LargeHotel
174
+ * Hospital
175
+ * Outpatient
176
+ * Warehouse
177
+ * SuperMarket
178
+ * FullServiceRestaurant
179
+ * QuickServiceRestaurant
180
+ * Laboratory
181
+ * Courthouse
182
+
183
+ electricity_cost: A number for the cost per each kWh of electricity. This
184
+ can be in any currency as long as it is coordinated with the costs of
185
+ other inputs to this method. (Default: 0.12 for the average 2020
186
+ cost of electricity in the US in $/kWh).
187
+ natural_gas_cost: A number for the cost per each kWh of natural gas. This
188
+ can be in any currency as long as it is coordinated with the
189
+ other inputs to this method. (Default: 0.06 for the average 2020
190
+ cost of natural gas in the US in $/kWh).
191
+ district_cooling_cost: A number for the cost per each kWh of district cooling
192
+ energy. This can be in any currency as long as it is coordinated with the
193
+ other inputs to this method. (Default: 0.04 assuming average 2020 US
194
+ cost of electricity in $/kWh with a COP 3.5 chiller).
195
+ district_heating_cost: A number for the cost per each kWh of district heating
196
+ energy. This can be in any currency as long as it is coordinated with the
197
+ other inputs to this method. (Default: 0.08 assuming average 2020 US
198
+ cost of natural gas in $/kWh with an efficiency of 0.75 with all burner
199
+ and distribution losses).
200
+ electricity_emissions: A number for the electric grid carbon emissions
201
+ in kg CO2 per MWh. For locations in the USA, this can be obtained from
202
+ he honeybee_energy.result.emissions future_electricity_emissions method.
203
+ For locations outside of the USA where specific data is unavailable,
204
+ the following rules of thumb may be used as a guide. (Default: 400).
205
+
206
+ * 800 kg/MWh - for an inefficient coal or oil-dominated grid
207
+ * 400 kg/MWh - for the US (energy mixed) grid around 2020
208
+ * 100-200 kg/MWh - for grids with majority renewable/nuclear composition
209
+ * 0-100 kg/MWh - for grids with renewables and storage
210
+
211
+ Returns:
212
+ A dictionary with several keys.
213
+
214
+ - proposed_eui -- A number for the proposed end use intensity. Specifically,
215
+ this is the sum of all electricity, fuel, district heating/cooling,
216
+ etc. divided by the gross floor area (including both conditioned
217
+ and unconditioned spaces). Units are kWh/m2.
218
+
219
+ - proposed_cost -- A number for the total annual energy cost of the
220
+ proposed building.
221
+
222
+ - proposed_carbon -- A number for the total annual operational carbon
223
+ emissions of the proposed building in kg of C02.
224
+
225
+ - baseline_eui -- A number for the baseline end use intensity. Specifically,
226
+ this is the sum of all electricity, fuel, district heating/cooling,
227
+ etc. divided by the gross floor area (including both conditioned
228
+ and unconditioned spaces). Units are kWh/m2.
229
+
230
+ - baseline_cost -- A number for the total annual energy cost of the
231
+ baseline building.
232
+
233
+ - baseline_carbon -- A number for the total annual operational carbon
234
+ emissions of the baseline building in kg of C02.
235
+
236
+ - pci_target -- A fractional number for the target PCI for ASHRAE 90.1-2016.
237
+
238
+ - pci -- A fractional number for the PCI of the proposed building.
239
+
240
+ - pci_improvement -- A number less than 100 for the percentage better
241
+ that the proposed building is over the target PCI for ASHRAE 90.1-2016.
242
+ Negative numbers indicate a proposed building that is worse than
243
+ the 2016 target PCI.
244
+
245
+ - carbon_target -- A fractional number for the target carbon index
246
+ for ASHRAE 90.1-2016.
247
+
248
+ - carbon -- A fractional number for the performance improvement
249
+ of the proposed building in terms of carbon emissions.
250
+
251
+ - carbon_improvement -- A number less than 100 for the percentage better
252
+ that the proposed building is over the target carbon for ASHRAE 90.1-2016.
253
+ Negative numbers indicate a proposed building that is worse than
254
+ the 2016 target.
255
+
256
+ - leed_points -- An integer for the total number of LEED points that
257
+ the proposed building would receive.
258
+ """
259
+ # get the comparison report
260
+ result_dict = comparison_from_sql(
261
+ proposed_sql, baseline_sqls, climate_zone, building_type,
262
+ electricity_cost, natural_gas_cost,
263
+ district_cooling_cost, district_heating_cost, electricity_emissions)
264
+ # remove all of the attributes that are not a part of LEED v4
265
+ result_dict.pop('proposed_energy')
266
+ result_dict.pop('baseline_energy')
267
+ result_dict.pop('pci_t_2019')
268
+ result_dict.pop('pci_t_2022')
269
+ result_dict.pop('pci_improvement_2019')
270
+ result_dict.pop('pci_improvement_2022')
271
+ result_dict.pop('carbon_t_2019')
272
+ result_dict.pop('carbon_t_2022')
273
+ result_dict.pop('carbon_improvement_2019')
274
+ result_dict.pop('carbon_improvement_2022')
275
+ # rename certain keys to make them clearer
276
+ result_dict['pci_target'] = result_dict.pop('pci_t_2016')
277
+ result_dict['pci_improvement'] = result_dict.pop('pci_improvement_2016')
278
+ result_dict['carbon'] = result_dict.pop('pci_carbon')
279
+ result_dict['carbon_target'] = result_dict.pop('carbon_t_2016')
280
+ result_dict['carbon_improvement'] = result_dict.pop('carbon_improvement_2016')
281
+ # compute the LEED points based on the other information
282
+ healthcare = ('Hospital', 'Outpatient')
283
+ schools = ('PrimarySchool', 'SecondarySchool')
284
+ # compute the LEED points for energy cost
285
+ pci_imp = result_dict['pci_improvement']
286
+ cost_leed_pts = 0
287
+ if building_type not in healthcare: # use normal new construction
288
+ if pci_imp >= 45:
289
+ cost_leed_pts = 8 if building_type in schools else 9
290
+ elif pci_imp >= 40:
291
+ cost_leed_pts = 7 if building_type in schools else 8
292
+ elif pci_imp >= 35:
293
+ cost_leed_pts = 7
294
+ elif pci_imp >= 30:
295
+ cost_leed_pts = 6
296
+ elif pci_imp >= 25:
297
+ cost_leed_pts = 5
298
+ elif pci_imp >= 20:
299
+ cost_leed_pts = 4
300
+ elif pci_imp >= 15:
301
+ cost_leed_pts = 3
302
+ elif pci_imp >= 10:
303
+ cost_leed_pts = 2
304
+ elif pci_imp >= 5:
305
+ cost_leed_pts = 1
306
+ else:
307
+ if pci_imp >= 45:
308
+ cost_leed_pts = 10
309
+ elif pci_imp >= 40:
310
+ cost_leed_pts = 9
311
+ elif pci_imp >= 35:
312
+ cost_leed_pts = 8
313
+ elif pci_imp >= 30:
314
+ cost_leed_pts = 7
315
+ elif pci_imp >= 25:
316
+ cost_leed_pts = 6
317
+ elif pci_imp >= 20:
318
+ cost_leed_pts = 5
319
+ elif pci_imp >= 15:
320
+ cost_leed_pts = 4
321
+ elif pci_imp >= 10:
322
+ cost_leed_pts = 3
323
+ elif pci_imp >= 5:
324
+ cost_leed_pts = 2
325
+ elif pci_imp >= 2:
326
+ cost_leed_pts = 1
327
+ # compute the LEED points for carbon emissions
328
+ c_imp = result_dict['carbon_improvement']
329
+ carbon_leed_pts = 0
330
+ if building_type not in healthcare: # use normal new construction
331
+ if c_imp >= 80:
332
+ carbon_leed_pts = 8 if building_type in schools else 9
333
+ elif c_imp >= 65:
334
+ carbon_leed_pts = 7 if building_type in schools else 8
335
+ elif c_imp >= 50:
336
+ carbon_leed_pts = 7
337
+ elif c_imp >= 40:
338
+ carbon_leed_pts = 6
339
+ elif c_imp >= 32:
340
+ carbon_leed_pts = 5
341
+ elif c_imp >= 24:
342
+ carbon_leed_pts = 4
343
+ elif c_imp >= 16:
344
+ carbon_leed_pts = 3
345
+ elif c_imp >= 10:
346
+ carbon_leed_pts = 2
347
+ elif c_imp >= 5:
348
+ carbon_leed_pts = 1
349
+ else:
350
+ if c_imp >= 80:
351
+ carbon_leed_pts = 10
352
+ elif c_imp >= 65:
353
+ carbon_leed_pts = 9
354
+ elif c_imp >= 50:
355
+ carbon_leed_pts = 8
356
+ elif c_imp >= 40:
357
+ carbon_leed_pts = 7
358
+ elif c_imp >= 32:
359
+ carbon_leed_pts = 6
360
+ elif c_imp >= 24:
361
+ carbon_leed_pts = 5
362
+ elif c_imp >= 16:
363
+ carbon_leed_pts = 4
364
+ elif c_imp >= 10:
365
+ carbon_leed_pts = 3
366
+ elif c_imp >= 5:
367
+ carbon_leed_pts = 2
368
+ elif c_imp >= 2:
369
+ carbon_leed_pts = 1
370
+ result_dict['leed_points'] = cost_leed_pts + carbon_leed_pts
371
+ return result_dict
@@ -0,0 +1,128 @@
1
+ """Extra Boundary Condition objects for Energy models.
2
+
3
+ Note to developers:
4
+ See _extend_honeybee to see where these boundary conditions are added to
5
+ honeybee.boundarycondition module.
6
+ """
7
+ from honeybee.boundarycondition import _BoundaryCondition
8
+ from honeybee.typing import float_in_range, float_positive
9
+ from honeybee.altnumber import autocalculate
10
+
11
+
12
+ class Adiabatic(_BoundaryCondition):
13
+ __slots__ = ()
14
+
15
+ @classmethod
16
+ def from_dict(cls, data):
17
+ """Initialize Adiabatic BoundaryCondition from a dictionary.
18
+
19
+ Args:
20
+ data: A dictionary representation of the boundary condition.
21
+ """
22
+ assert data['type'] == 'Adiabatic', 'Expected dictionary for Adiabatic ' \
23
+ 'boundary condition. Got {}.'.format(data['type'])
24
+ return cls()
25
+
26
+
27
+ class OtherSideTemperature(_BoundaryCondition):
28
+ """Custom temperature or heat transfer coefficient on the other side of a surface.
29
+
30
+ Args:
31
+ temperature: A temperature value in Celsius to note the temperature on the
32
+ other side of the object. This input can also be an Autocalculate object
33
+ to signify that the temperature is equal to the outdoor air
34
+ temperature. (Default: autocalculate).
35
+ heat_transfer_coefficient: A value in W/m2-K to indicate the combined
36
+ convective/radiative film coefficient. If equal to 0, then the
37
+ specified temperature above is equal to the exterior surface
38
+ temperature. Otherwise, the temperature above is considered the
39
+ outside air temperature and this coefficient is used to determine the
40
+ difference between this outside air temperature and the exterior surface
41
+ temperature. (Default: 0).
42
+ """
43
+
44
+ __slots__ = ('_temperature', '_heat_transfer_coefficient')
45
+
46
+ def __init__(self, temperature=autocalculate, heat_transfer_coefficient=0):
47
+ """Initialize OtherSideTemperature boundary condition."""
48
+ if temperature == autocalculate:
49
+ self._temperature = autocalculate
50
+ else:
51
+ self._temperature = float_in_range(
52
+ temperature, input_name='other side temperature')
53
+ self._heat_transfer_coefficient = float_positive(
54
+ heat_transfer_coefficient, input_name='other side heat transfer coefficient')
55
+
56
+ @classmethod
57
+ def from_dict(cls, data):
58
+ """Initialize OtherSideTemperature BoundaryCondition from a dictionary.
59
+
60
+ Args:
61
+ data: A dictionary representation of the boundary condition.
62
+ """
63
+ assert data['type'] == 'OtherSideTemperature', 'Expected dictionary for ' \
64
+ 'OtherSideTemperature boundary condition. Got {}.'.format(data['type'])
65
+ temperature = autocalculate if 'temperature' not in data or \
66
+ data['temperature'] == autocalculate.to_dict() else data['temperature']
67
+ htc = 0 if 'heat_transfer_coefficient' not in data \
68
+ else data['heat_transfer_coefficient']
69
+ return cls(temperature, htc)
70
+
71
+ @property
72
+ def temperature(self):
73
+ """Get a value in Celsius for temperature on the other side of the object.
74
+
75
+ Autocalculate signifies that the outdoor air temperature is used.
76
+ """
77
+ return self._temperature
78
+
79
+ @property
80
+ def heat_transfer_coefficient(self):
81
+ """Get a value in W/m2-K for the combined convective/radiative film coefficient.
82
+ """
83
+ return self._heat_transfer_coefficient
84
+
85
+ def to_dict(self):
86
+ """Get the boundary condition as a dictionary."""
87
+ bc_dict = {'type': self.name}
88
+ bc_dict['temperature'] = autocalculate.to_dict() if \
89
+ self.temperature == autocalculate else self.temperature
90
+ bc_dict['heat_transfer_coefficient'] = self.heat_transfer_coefficient
91
+ return bc_dict
92
+
93
+ def to_idf(self, identifier):
94
+ """Get the boundary condition as an IDF string.
95
+
96
+ Args:
97
+ identifier: Text for unique identifier to be given to the boundary condition.
98
+
99
+ .. code-block:: shell
100
+
101
+ SurfaceProperty:OtherSideCoefficients,
102
+ OSCCoef:Zn005:Wall003, !- Name
103
+ 0, !- Combined Convective/Radiative Film Coefficient {W/m2-K}
104
+ 0.000000, !- Constant Temperature {C}
105
+ 1.000000, !- Constant Temperature Coefficient
106
+ 0.000000, !- External Dry-Bulb Temperature Coefficient
107
+ 0.000000, !- Ground Temperature Coefficient
108
+ 0.000000, !- Wind Speed Coefficient
109
+ 0.000000, !- Zone Air Temperature Coefficient
110
+ Zn005Wall003OtherSideTempSched; !- Constant Temperature Schedule Name
111
+ """
112
+ comments = (
113
+ 'name', 'heat transfer coefficient', 'temperature',
114
+ 'temperature factor', 'outdoor temperature factor')
115
+ values = [identifier, self.heat_transfer_coefficient]
116
+ if self.temperature == autocalculate:
117
+ values.extend([0, 0, 1])
118
+ else:
119
+ values.extend([self.temperature, 1, 0])
120
+
121
+ space_count = tuple((25 - len(str(n))) for n in values)
122
+ spaces = tuple(s_c * ' ' if s_c > 0 else ' ' for s_c in space_count)
123
+ body_str = '\n '.join('{},{}!- {}'.format(val, spc, com) for val, spc, com in
124
+ zip(values[:-1], spaces[:-1], comments[:-1]))
125
+ ep_str = 'SurfaceProperty:OtherSideCoefficients,\n {}'.format(body_str)
126
+ end_str = '\n {};{}!- {}'.format(values[-1], spaces[-1], comments[-1]) \
127
+ if comments[-1] != '' else '\n {};'.format(values[-1])
128
+ return ''.join((ep_str, end_str))
@@ -0,0 +1,69 @@
1
+ """honeybee-energy commands which will be added to honeybee command line interface."""
2
+ import click
3
+ import sys
4
+ import logging
5
+ import json
6
+
7
+ from honeybee.cli import main
8
+ from ..config import folders
9
+ from .setconfig import set_config
10
+ from .lib import lib
11
+ from .translate import translate
12
+ from .edit import edit
13
+ from .settings import settings
14
+ from .simulate import simulate
15
+ from .result import result
16
+ from .baseline import baseline
17
+ from .validate import validate
18
+
19
+ _logger = logging.getLogger(__name__)
20
+
21
+
22
+ # command group for all energy extension commands.
23
+ @click.group(help='honeybee energy commands.')
24
+ @click.version_option()
25
+ def energy():
26
+ pass
27
+
28
+
29
+ @energy.command('config')
30
+ @click.option('--output-file', help='Optional file to output the JSON string of '
31
+ 'the config object. By default, it will be printed out to stdout',
32
+ type=click.File('w'), default='-', show_default=True)
33
+ def config(output_file):
34
+ """Get a JSON object with all configuration information"""
35
+ try:
36
+ config_dict = {
37
+ 'openstudio_path': folders.openstudio_path,
38
+ 'openstudio_version': folders.openstudio_version_str,
39
+ 'energyplus_path': folders.energyplus_path,
40
+ 'energyplus_version': folders.energyplus_version_str,
41
+ 'ironbug_path': folders.ironbug_path,
42
+ 'ironbug_version': folders.ironbug_version_str,
43
+ 'lbt_measures_path': folders.lbt_measures_path,
44
+ 'honeybee_openstudio_gem_path': folders.honeybee_openstudio_gem_path,
45
+ 'standards_data_folder': folders.standards_data_folder,
46
+ 'defaults_file': folders.defaults_file,
47
+ 'standards_extension_folders': folders.standards_extension_folders
48
+ }
49
+ output_file.write(json.dumps(config_dict, indent=4))
50
+ except Exception as e:
51
+ _logger.exception('Failed to retrieve configurations.\n{}'.format(e))
52
+ sys.exit(1)
53
+ else:
54
+ sys.exit(0)
55
+
56
+
57
+ # add sub-commands to energy
58
+ energy.add_command(set_config, name='set-config')
59
+ energy.add_command(lib)
60
+ energy.add_command(translate)
61
+ energy.add_command(edit)
62
+ energy.add_command(settings)
63
+ energy.add_command(simulate)
64
+ energy.add_command(result)
65
+ energy.add_command(baseline)
66
+ energy.add_command(validate)
67
+
68
+ # add energy sub-commands to honeybee CLI
69
+ main.add_command(energy)