openstudio-standards 0.3.0 → 0.3.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/data/geometry/ASHRAESuperMarket.json +29 -38
  3. data/data/standards/OpenStudio_Standards-deer-ALL-comstock(space_types).xlsx +0 -0
  4. data/data/standards/metadata_units_OpenStudio_Standards-deer-ALL-comstockspace_types.csv +172 -0
  5. data/data/standards/test_performance_expected_dd_results.csv +12 -12
  6. data/lib/openstudio-standards/btap/analysis.rb +389 -389
  7. data/lib/openstudio-standards/btap/bridging.rb +2099 -0
  8. data/lib/openstudio-standards/btap/btap.model.rb +717 -717
  9. data/lib/openstudio-standards/btap/btap.rb +33 -30
  10. data/lib/openstudio-standards/btap/economics.rb +1163 -1163
  11. data/lib/openstudio-standards/btap/envelope.rb +4 -4
  12. data/lib/openstudio-standards/btap/equest.rb +2524 -2524
  13. data/lib/openstudio-standards/btap/fileio.rb +9 -0
  14. data/lib/openstudio-standards/btap/measures.rb +1515 -1515
  15. data/lib/openstudio-standards/btap/mpc.rb +554 -554
  16. data/lib/openstudio-standards/btap/reporting.rb +287 -287
  17. data/lib/openstudio-standards/btap/simmanager.rb +759 -759
  18. data/lib/openstudio-standards/btap/spaceloads.rb +439 -439
  19. data/lib/openstudio-standards/btap/spacetypes.rb +113 -113
  20. data/lib/openstudio-standards/btap/utilities.rb +134 -134
  21. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVAC.rb +8 -83
  22. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingWater.rb +3 -99
  23. data/lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb +81 -75
  24. data/lib/openstudio-standards/hvac_sizing/Siz.Model.rb +7 -306
  25. data/lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb +70 -98
  26. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.Model.rb +41 -14
  27. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Model.rb +40 -14
  28. data/lib/openstudio-standards/prototypes/common/buildings/Prototype.SuperMarket.rb +1 -23
  29. data/lib/openstudio-standards/prototypes/common/objects/Prototype.ServiceWaterHeating.rb +93 -4
  30. data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +13 -0
  31. data/lib/openstudio-standards/prototypes/common/objects/Prototype.refrigeration.rb +5 -4
  32. data/lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb +24 -4
  33. data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +18 -2
  34. data/lib/openstudio-standards/standards/Standards.BoilerHotWater.rb +18 -0
  35. data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +13 -10
  36. data/lib/openstudio-standards/standards/Standards.CoilDX.rb +5 -3
  37. data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +11 -8
  38. data/lib/openstudio-standards/standards/Standards.Construction.rb +1 -1
  39. data/lib/openstudio-standards/standards/Standards.Model.rb +68 -52
  40. data/lib/openstudio-standards/standards/Standards.PlantLoop.rb +2 -2
  41. data/lib/openstudio-standards/standards/Standards.Space.rb +16 -18
  42. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.ref_cases.json +510 -0
  43. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_compressors.json +18 -0
  44. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_walkins.json +410 -0
  45. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.spc_typ.json +2 -2
  46. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.ref_cases.json +510 -0
  47. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_compressors.json +18 -0
  48. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_walkins.json +410 -0
  49. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.spc_typ.json +2 -2
  50. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.ref_cases.json +510 -0
  51. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_compressors.json +18 -0
  52. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_walkins.json +410 -0
  53. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.spc_typ.json +2 -2
  54. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.ref_cases.json +510 -0
  55. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_compressors.json +18 -0
  56. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_walkins.json +410 -0
  57. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.spc_typ.json +2 -2
  58. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.spc_typ.json +2 -2
  59. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.spc_typ.json +2 -2
  60. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.AirLoopHVAC.rb +9 -0
  61. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.Model.rb +2 -0
  62. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.rb +4 -3
  63. data/lib/openstudio-standards/standards/deer/deer_1985/comstock_deer_1985/data/comstock_deer_1985.spc_typ.json +405 -405
  64. data/lib/openstudio-standards/standards/deer/deer_1996/comstock_deer_1996/data/comstock_deer_1996.spc_typ.json +405 -405
  65. data/lib/openstudio-standards/standards/deer/deer_2003/comstock_deer_2003/data/comstock_deer_2003.spc_typ.json +405 -405
  66. data/lib/openstudio-standards/standards/deer/deer_2003/deer_2003.ThermalZone.rb +21 -0
  67. data/lib/openstudio-standards/standards/deer/deer_2007/comstock_deer_2007/data/comstock_deer_2007.spc_typ.json +405 -405
  68. data/lib/openstudio-standards/standards/deer/deer_2007/deer_2007.ThermalZone.rb +21 -0
  69. data/lib/openstudio-standards/standards/deer/deer_2011/comstock_deer_2011/data/comstock_deer_2011.spc_typ.json +405 -405
  70. data/lib/openstudio-standards/standards/deer/deer_2011/deer_2011.ThermalZone.rb +21 -0
  71. data/lib/openstudio-standards/standards/deer/deer_2014/comstock_deer_2014/data/comstock_deer_2014.spc_typ.json +405 -405
  72. data/lib/openstudio-standards/standards/deer/deer_2014/deer_2014.ThermalZone.rb +21 -0
  73. data/lib/openstudio-standards/standards/deer/deer_2015/comstock_deer_2015/data/comstock_deer_2015.spc_typ.json +405 -405
  74. data/lib/openstudio-standards/standards/deer/deer_2015/deer_2015.ThermalZone.rb +21 -0
  75. data/lib/openstudio-standards/standards/deer/deer_2017/comstock_deer_2017/data/comstock_deer_2017.spc_typ.json +405 -405
  76. data/lib/openstudio-standards/standards/deer/deer_2017/deer_2017.ThermalZone.rb +21 -0
  77. data/lib/openstudio-standards/standards/deer/deer_2020/comstock_deer_2020/data/comstock_deer_2020.spc_typ.json +405 -405
  78. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.AirLoopHVAC.rb +8 -0
  79. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.ThermalZone.rb +21 -0
  80. data/lib/openstudio-standards/standards/deer/deer_2025/comstock_deer_2025/data/comstock_deer_2025.spc_typ.json +405 -405
  81. data/lib/openstudio-standards/standards/deer/deer_2030/comstock_deer_2030/data/comstock_deer_2030.spc_typ.json +405 -405
  82. data/lib/openstudio-standards/standards/deer/deer_2035/comstock_deer_2035/data/comstock_deer_2035.spc_typ.json +405 -405
  83. data/lib/openstudio-standards/standards/deer/deer_2040/comstock_deer_2040/data/comstock_deer_2040.spc_typ.json +405 -405
  84. data/lib/openstudio-standards/standards/deer/deer_2045/comstock_deer_2045/data/comstock_deer_2045.spc_typ.json +405 -405
  85. data/lib/openstudio-standards/standards/deer/deer_2050/comstock_deer_2050/data/comstock_deer_2050.spc_typ.json +405 -405
  86. data/lib/openstudio-standards/standards/deer/deer_2055/comstock_deer_2055/data/comstock_deer_2055.spc_typ.json +405 -405
  87. data/lib/openstudio-standards/standards/deer/deer_2060/comstock_deer_2060/data/comstock_deer_2060.spc_typ.json +405 -405
  88. data/lib/openstudio-standards/standards/deer/deer_2065/comstock_deer_2065/data/comstock_deer_2065.spc_typ.json +405 -405
  89. data/lib/openstudio-standards/standards/deer/deer_2070/comstock_deer_2070/data/comstock_deer_2070.spc_typ.json +405 -405
  90. data/lib/openstudio-standards/standards/deer/deer_2075/comstock_deer_2075/data/comstock_deer_2075.spc_typ.json +405 -405
  91. data/lib/openstudio-standards/standards/deer/deer_pre_1975/comstock_deer_pre_1975/data/comstock_deer_pre_1975.spc_typ.json +405 -405
  92. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/btap_pre1980.rb +1 -1
  93. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_3_and_8_single_speed.rb +3 -1
  94. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_4.rb +3 -1
  95. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_6.rb +2 -2
  96. data/lib/openstudio-standards/standards/necb/ECMS/data/curves.json +233 -0
  97. data/lib/openstudio-standards/standards/necb/ECMS/data/unitary_acs.json +180 -0
  98. data/lib/openstudio-standards/standards/necb/ECMS/ecms.rb +6 -1
  99. data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +807 -258
  100. data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +102 -66
  101. data/lib/openstudio-standards/standards/necb/NECB2011/data/fuel_type_sets.json +85 -8
  102. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/HighriseApartment.osm +2483 -992
  103. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LowriseApartment.osm +4 -336
  104. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/MidriseApartment.osm +228 -231
  105. data/lib/openstudio-standards/standards/necb/NECB2011/data/heat_pumps_heating.json +12 -18
  106. data/lib/openstudio-standards/standards/necb/NECB2011/data/space_type_unit_definitions.txt +76 -0
  107. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_multi_speed.rb +6 -1
  108. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_single_speed.rb +111 -24
  109. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_2_and_5.rb +1 -0
  110. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_multi_speed.rb +3 -1
  111. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_single_speed.rb +64 -16
  112. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_4.rb +61 -17
  113. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_6.rb +128 -0
  114. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +252 -23
  115. data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +316 -20
  116. data/lib/openstudio-standards/standards/necb/NECB2011/qaqc/necb_qaqc.rb +1 -1
  117. data/lib/openstudio-standards/standards/necb/NECB2011/service_water_heating.rb +3 -5
  118. data/lib/openstudio-standards/standards/necb/NECB2011/system_fuels.rb +38 -0
  119. data/lib/openstudio-standards/standards/necb/NECB2015/data/heat_pumps_heating.json +16 -24
  120. data/lib/openstudio-standards/standards/necb/NECB2015/hvac_systems.rb +48 -25
  121. data/lib/openstudio-standards/standards/necb/NECB2020/building_envelope.rb +3 -3
  122. data/lib/openstudio-standards/standards/necb/NECB2020/data/chillers.json +36 -19
  123. data/lib/openstudio-standards/standards/necb/NECB2020/data/furnaces.json +19 -4
  124. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps.json +20 -40
  125. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps_heating.json +74 -36
  126. data/lib/openstudio-standards/standards/necb/NECB2020/necb_2020.rb +0 -2
  127. data/lib/openstudio-standards/standards/necb/NECB2020/service_water_heating.rb +123 -56
  128. data/lib/openstudio-standards/standards/necb/common/btap_data.rb +124 -2
  129. data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +15 -2
  130. data/lib/openstudio-standards/standards/necb/common/necb_reference_runs.csv +1 -1
  131. data/lib/openstudio-standards/utilities/simulation.rb +1 -1
  132. data/lib/openstudio-standards/version.rb +1 -1
  133. data/lib/openstudio-standards/weather/Weather.stat_file.rb +33 -1
  134. data/lib/openstudio-standards.rb +1 -0
  135. metadata +14 -121
  136. data/data/standards/OpenStudio_Standards-ashrae_90_1.xlsx +0 -0
  137. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.ddy +0 -2342
  138. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw +0 -8768
  139. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.stat +0 -700
  140. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.ddy +0 -2342
  141. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw +0 -8768
  142. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.stat +0 -700
  143. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.ddy +0 -2342
  144. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw +0 -8768
  145. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.stat +0 -700
  146. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.ddy +0 -276
  147. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw +0 -8768
  148. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.stat +0 -611
  149. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.ddy +0 -276
  150. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.epw +0 -8768
  151. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.stat +0 -610
  152. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.ddy +0 -2342
  153. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw +0 -8768
  154. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.stat +0 -700
  155. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.ddy +0 -2342
  156. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw +0 -8768
  157. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.stat +0 -700
  158. data/lib/openstudio-standards/hvac_sizing/Siz.AirConditionerVariableRefrigerantFlow.rb +0 -81
  159. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatCoolVAVChngByp.rb +0 -27
  160. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAir.rb +0 -69
  161. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.rb +0 -178
  162. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitarySystem.rb +0 -27
  163. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolCooledBeam.rb +0 -27
  164. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolFourPipeInduction.rb +0 -27
  165. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolReheat.rb +0 -27
  166. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctParallelPIUReheat.rb +0 -67
  167. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctSeriesPIUReheat.rb +0 -27
  168. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctUncontrolled.rb +0 -30
  169. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolNoReheat.rb +0 -27
  170. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolReheat.rb +0 -27
  171. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVNoReheat.rb +0 -68
  172. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVReheat.rb +0 -68
  173. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerHotWater.rb +0 -42
  174. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerSteam.rb +0 -27
  175. data/lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb +0 -58
  176. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXMultiSpeed.rb +0 -171
  177. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXSingleSpeed.rb +0 -56
  178. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXTwoSpeed.rb +0 -89
  179. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXVariableRefrigerantFlow.rb +0 -50
  180. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingWaterToAirHeatPumpEquationFit.rb +0 -69
  181. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXMultiSpeed.rb +0 -120
  182. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXSingleSpeed.rb +0 -56
  183. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXVariableRefrigerantFlow.rb +0 -41
  184. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDesuperheater.rb +0 -27
  185. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingElectric.rb +0 -30
  186. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGas.rb +0 -30
  187. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGasMultiStage.rb +0 -68
  188. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWater.rb +0 -61
  189. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWaterToAirHeatPumpEquationFit.rb +0 -57
  190. data/lib/openstudio-standards/hvac_sizing/Siz.CoilWaterHeatingDesuperheater.rb +0 -27
  191. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerOutdoorAir.rb +0 -59
  192. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerWaterCoil.rb +0 -49
  193. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerSingleSpeed.rb +0 -90
  194. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerTwoSpeed.rb +0 -83
  195. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerVariableSpeed.rb +0 -57
  196. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictCooling.rb +0 -27
  197. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictHeating.rb +0 -27
  198. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerDirectResearchSpecial.rb +0 -27
  199. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerIndirectResearchSpecial.rb +0 -27
  200. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeFluidCoolerSingleSpeed.rb +0 -27
  201. data/lib/openstudio-standards/hvac_sizing/Siz.FanConstantVolume.rb +0 -29
  202. data/lib/openstudio-standards/hvac_sizing/Siz.FanOnOff.rb +0 -27
  203. data/lib/openstudio-standards/hvac_sizing/Siz.FanVariableVolume.rb +0 -29
  204. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsConstantSpeed.rb +0 -55
  205. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsVariableSpeed.rb +0 -55
  206. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerAirToAirSensibleAndLatent.rb +0 -38
  207. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerFluidToFluid.rb +0 -27
  208. data/lib/openstudio-standards/hvac_sizing/Siz.HumidifierSteamElectric.rb +0 -27
  209. data/lib/openstudio-standards/hvac_sizing/Siz.PlantLoop.rb +0 -42
  210. data/lib/openstudio-standards/hvac_sizing/Siz.PumpConstantSpeed.rb +0 -59
  211. data/lib/openstudio-standards/hvac_sizing/Siz.PumpVariableSpeed.rb +0 -59
  212. data/lib/openstudio-standards/hvac_sizing/Siz.SizingSystem.rb +0 -48
  213. data/lib/openstudio-standards/hvac_sizing/Siz.WaterHeaterMixed.rb +0 -16
  214. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveElectric.rb +0 -27
  215. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveWater.rb +0 -27
  216. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACFourPipeFanCoil.rb +0 -27
  217. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACHighTemperatureRadiant.rb +0 -27
  218. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACIdealLoadsAirSystem.rb +0 -27
  219. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantConstFlow.rb +0 -27
  220. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantVarFlow.rb +0 -27
  221. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTemperatureRadiantElectric.rb +0 -27
  222. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalAirConditioner.rb +0 -88
  223. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalHeatPump.rb +0 -88
  224. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACTerminalUnitVariableRefrigerantFlow.rb +0 -104
  225. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACUnitHeater.rb +0 -27
  226. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACWaterToAirHeatPump.rb +0 -27
@@ -1,717 +1,717 @@
1
- require "#{File.dirname(__FILE__)}/btap"
2
-
3
-
4
- class OpenStudio::Model::Construction
5
- #This method will search through the layers and find the layer with the
6
- #lowest conductance and set that as the insulation layer. Note: Concrete walls
7
- #or slabs with no insulation layer but with a carper will see the carpet as the
8
- #insulation layer.
9
- #@author Phylroy A. Lopez <plopez@nrcan.gc.ca>
10
- #@return OpenStudio::Model::Material insulation_material_layer
11
- def self.find_and_set_insulaton_layer()
12
- insulation_material_layer = nil
13
- #return if there is already a defined insulation layer.
14
- return self.insulation unless self.insulation.empty?
15
- #set minimum conductance to 100.0
16
- min_conductance = 100.0
17
- #loop through Layers
18
- self.layers.each do |layer|
19
- #try casting the layer to an OpaqueMaterial.
20
- material = nil
21
- material = layer.to_OpaqueMaterial.get unless layer.to_OpaqueMaterial.empty?
22
- material = layer.to_FenestrationMaterial.get unless layer.to_FenestrationMaterial.empty?
23
- #check if the cast was successful, then find the insulation layer.
24
- unless nil == material
25
- if BTAP::Resources::Envelope::Materials::get_conductance(material) < min_conductance
26
- #Keep track of the highest thermal resistance value.
27
- min_conductance = BTAP::Resources::Envelope::Materials::get_conductance(material)
28
- insulation_material_layer = material
29
- unless material.to_OpaqueMaterial.empty?
30
- self.setInsulation(material)
31
- end
32
- end
33
- end
34
- end
35
- if self.insulation.empty? and self.isOpaque
36
- raise ("construction #{self.name.get.to_s} insulation layer could not be set!. This occurs when a insulation layer is duplicated in the construction.")
37
- end
38
- return insulation_material_layer
39
- end
40
-
41
-
42
-
43
-
44
- #This method will create a new construction based on self and a new conductance value.
45
- #It will check to see if a similar construction has already been created by this method
46
- #if so it will return the existing construction. If you wish to keep some of the properties, enter the
47
- #string "default" instead of a numerical value.
48
- #@author Phylroy A. Lopez <plopez@nrcan.gc.ca>
49
- #@param model [OpenStudio::Model::Model]
50
- #@param construction <String>
51
- #@param conductance [Fixnum]
52
- #@return [<String]OpenStudio::Model::getConstructionByName] new_construction
53
- def customize(model,
54
- construction,
55
- conductance,
56
- solarTransmittanceatNormalIncidence = nil,
57
- visibleTransmittance = nil
58
- )
59
-
60
- if self.isOpaque
61
-
62
- minimum_resistance = 0
63
- name_prefix = "#{construction.handle()} U- #{conductance}"
64
-
65
- #Check to see if we already made one like this.
66
- existing_construction = OpenStudio::Model::getConstructionByName(self.model,name_prefix)
67
- if not existing_construction.empty?
68
- # if so, return existing construction
69
- return existing_construction.get
70
- end
71
-
72
- #create a copy
73
- new_construction = self.deep_copy(self.model,construction)
74
-
75
- #Change Construction name in clone
76
- new_construction.setName( name_prefix)
77
-
78
- if conductance.kind_of?(Float)
79
- #re-find insulation layer
80
- find_and_set_insulaton_layer(self.model,new_construction)
81
-
82
- #Determine how low the resistance can be set. Subtract existing insulation
83
- #Values from the total resistance to see how low we can go.
84
- minimum_resistance = (1 / new_construction.thermalConductance.to_f) - (1.0 / new_construction.insulation.get.thermalConductance.to_f)
85
-
86
- #Check if the requested resistance is smaller than the minimum
87
- # resistance. If so, use the minimum resistance instead.
88
- if minimum_resistance > ( 1 / conductance )
89
- #tell user why we are defaulting and set the conductance of the
90
- # construction.
91
- raise ("could not set conductance of construction #{new_construction.name.to_s} to because existing layers make this impossible. Change the construction to allow for this conductance to be set." + (conductance).to_s + "setting to closest value possible value:" + (1.0 / minimum_resistance).to_s )
92
- # new_construction.setConductance((1.0/minimum_resistance))
93
- else
94
- unless new_construction.setConductance(conductance)
95
- raise("could not set conductance of construction #{new_construction.name.to_s}")
96
- end
97
- end
98
- end
99
- return new_construction
100
- elsif self.isFenestration()
101
-
102
- #get equivilant values for tsol, tvis, and conductances.
103
- solarTransmittanceatNormalIncidence = self.get_shgc(model, construction) if solarTransmittanceatNormalIncidence == nil
104
- visibleTransmittance = self.get_tvis(model,construction) if visibleTransmittance == nil
105
- conductance = self.get_conductance(construction) if conductance == nil
106
- frontSideSolarReflectanceatNormalIncidence = 1.0 - solarTransmittanceatNormalIncidence
107
- backSideSolarReflectanceatNormalIncidence = 1.0 - solarTransmittanceatNormalIncidence
108
- frontSideVisibleReflectanceatNormalIncidence = 0.081000
109
- backSideVisibleReflectanceatNormalIncidence = 0.081000
110
- infraredTransmittanceatNormalIncidence = 0.0
111
- frontSideInfraredHemisphericalEmissivity = 0.84
112
- backSideInfraredHemisphericalEmissivity = 0.84
113
- #store part of fenestation in array bins.
114
- glazing_array = Array.new()
115
- shading_material_array = Array.new()
116
- gas_array = Array.new()
117
- construction.layers.each do |material|
118
- glazing_array << material unless material.to_Glazing.empty?
119
- shading_material_array << material unless material.to_ShadingMaterial.empty?
120
- gas_array << material unless material.to_GasLayer.empty?
121
- end
122
-
123
- #set value of fictious glazing based on the fenestrations front and back if available
124
- unless glazing_array.first.to_StandardGlazing.empty?
125
- frontSideSolarReflectanceatNormalIncidence = glazing_array.first.to_StandardGlazing.get.frontSideSolarReflectanceatNormalIncidence
126
- frontSideVisibleReflectanceatNormalIncidence = glazing_array.first.to_StandardGlazing.get.frontSideVisibleReflectanceatNormalIncidence
127
- frontSideInfraredHemisphericalEmissivity = glazing_array.first.to_StandardGlazing.get.frontSideInfraredHemisphericalEmissivity
128
- end
129
-
130
- unless glazing_array.last.to_StandardGlazing.empty?
131
- backSideSolarReflectanceatNormalIncidence = glazing_array.last.to_StandardGlazing.get.backSideSolarReflectanceatNormalIncidence
132
- backSideVisibleReflectanceatNormalIncidence = glazing_array.last.to_StandardGlazing.get.backSideVisibleReflectanceatNormalIncidence
133
- backSideInfraredHemisphericalEmissivity = glazing_array.last.to_StandardGlazing.get.backSideInfraredHemisphericalEmissivity
134
- end
135
- #create fictious glazing.
136
- #assume a thickness of 0.10m
137
- thickness = 0.10
138
- #calculate conductivity
139
- conductivity = conductance * thickness
140
- data_name_suffix = " cond=#{("%.3f" % conductivity).to_s} tvis=#{("%.3f" % visibleTransmittance).to_s} tsol=#{("%.3f" % solarTransmittanceatNormalIncidence).to_s}"
141
- cons_name = "Customized Fenestration:" + data_name_suffix
142
- glazing_name = "Customized Fenestration::" + data_name_suffix
143
- #Search to prevent the massive duplication that may ensue.
144
- return model.getConstructionByName(cons_name).get unless model.getConstructionByName(cons_name).empty?
145
-
146
- #fix for Simple glazing
147
- conductivity = conductance
148
- glazing = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(
149
- construction.model,#model
150
- glazing_name, #name
151
- 0.60, #SHGC
152
- conductivity, #u-factor
153
- thickness, #Thickness
154
- 0.21 #vis trans
155
- )
156
-
157
- new_materials_array = Array.new()
158
- new_materials_array << glazing
159
- new_materials_array.concat(shading_material_array) unless shading_material_array.empty?
160
- return self.create_construction(construction.model, cons_name, new_materials_array)
161
- end
162
- end
163
-
164
-
165
-
166
- end
167
-
168
-
169
-
170
- # open the class to add methods to size all HVAC equipment
171
- class OpenStudio::Model::Model
172
-
173
- def perform_load_elimination_analysis(folder = Dir.pwd)
174
- #remove hvac and only use ideal loads.
175
- model = self.clone(true).to_Model
176
- BTAP::Resources::HVAC::clear_all_hvac_from_model(model)
177
- model.getThermalZones.sort.each {|zone| zone.setUseIdealAirLoads(true)}
178
- conductance = 0.200
179
- models = Array.new()
180
- #Add baseline
181
- models << {:name => 'baseline', :model => model}
182
- #Add copies of model with elimination of a characteristic.
183
- models << {:name => 'elim_ext_wall', :model => model.clone(true).to_Model}
184
- =begin
185
- models << {:name => 'elim_ext_roof', :model => model.clone(true).to_Model.set_all_ext_roof_conductances_to(conductance)}
186
- models << {:name => 'elim_ground_floor', :model => model.clone(true).to_Model.set_all_ground_floor_conductances_to(conductance)}
187
- models << {:name => 'elim_ground_wall', :model => model.clone(true).to_Model.set_all_ground_wall_conductances_to(conductance)}
188
- models << {:name => 'elim_win_doors', :model => model.clone(true).to_Model.set_all_ext_windows_and_door_conductances_to(conductance)}
189
- models << {:name => 'elim_skylights', :model => model.clone(true).to_Model.set_all_ext_skylight_conductances_to(conductance)}
190
- models << {:name => 'elim_people', :model => model.clone(true).to_Model.eliminate_all_people_loads}
191
- models << {:name => 'elim_lighting', :model => model.clone(true).to_Model.eliminate_all_lighting_loads}
192
- models << {:name => 'elim_plug_loads', :model => model.clone(true).to_Model.eliminate_all_electric_loads}
193
- models << {:name => 'elim_outdoor_air', :model => model.clone(true).to_Model.eliminate_all_design_specification_outdoor_air}
194
- models << {:name => 'elim_infiltration', :model => model.clone(true).to_Model.eliminate_all_space_infiltration_design_flow_rates}
195
- models << {:name => 'elim_all_loads', :model => model.clone(true).to_Model.eliminate_all_loads}
196
- =end
197
-
198
- #Get a handle for the baseline.
199
- baseline = models.find {|model| model[:name] == 'baseline' }
200
- #Create a result hash.
201
- result = Hash.new()
202
- models.each do |model|
203
- #run each model in its own folder.
204
- success = model_run_simulation_and_log_errors(model[:model], "#{folder}/#{model[:name]}")
205
-
206
- #Run the qa-qc method to get all the results.
207
-
208
- qa_qc = BTAP::perform_qaqc(model[:model])
209
- #Store total energy in the hash
210
- model[:total_end_uses_gj_per_m2] = qa_qc[:end_uses_eui][:total_end_uses_gj_per_m2]
211
- #This assumes that the baseline is always the first in the hash.
212
- unless model[:name] = 'baseline'
213
- result[model[:name]] = model[:total_end_uses_gj_per_m2] / baseline[:total_end_uses_gj_per_m2]
214
- end
215
- end
216
- return result
217
- end
218
-
219
-
220
- # Set global changes
221
- def set_all_ext_wall_conductances_to(conductance)
222
- #Set conductances to needed values in construction set if possible.
223
- self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
224
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
225
- self,
226
- "Sensitivity Def Cnst Set #{index}",
227
- default_construction_set,
228
- 1/conductance,
229
- nil,
230
- nil,
231
- nil,
232
- nil,
233
- nil,
234
- nil,
235
- nil,
236
- nil,
237
- nil,
238
- nil,
239
- nil,
240
- nil,
241
- nil,
242
- nil,
243
- nil,
244
- nil,
245
- nil,
246
- nil,
247
- nil,
248
- nil,
249
- nil,
250
- nil,
251
- nil,
252
- nil,
253
- nil
254
- )
255
- end
256
- #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
257
- self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
258
- #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
259
- BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
260
- return self
261
- end
262
-
263
- def set_all_ext_roof_conductances_to(conductance)
264
- #Set conductances to needed values in construction set if possible.
265
- self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
266
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
267
- self,
268
- "Sensitivity Def Cnst Set #{index}",
269
- default_construction_set,
270
- nil,
271
- nil,
272
- 1/conductance,
273
- nil,
274
- nil,
275
- nil,
276
- nil,
277
- nil,
278
- nil,
279
- nil,
280
- nil,
281
- nil,
282
- nil,
283
- nil,
284
- nil,
285
- nil,
286
- nil,
287
- nil,
288
- nil,
289
- nil,
290
- nil,
291
- nil,
292
- nil,
293
- nil,
294
- nil,
295
- nil
296
- )
297
- end
298
- #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
299
- self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
300
- #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
301
- BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
302
- return self
303
- end
304
-
305
- def set_all_ground_wall_conductances_to(conductance)
306
- #Set conductances to needed values in construction set if possible.
307
- self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
308
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
309
- self,
310
- "Sensitivity Def Cnst Set #{index}",
311
- default_construction_set,
312
- nil,
313
- nil,
314
- nil,
315
- 1/conductance,
316
- nil,
317
- nil,
318
- nil,
319
- nil,
320
- nil,
321
- nil,
322
- nil,
323
- nil,
324
- nil,
325
- nil,
326
- nil,
327
- nil,
328
- nil,
329
- nil,
330
- nil,
331
- nil,
332
- nil,
333
- nil,
334
- nil,
335
- nil,
336
- nil,
337
- nil
338
- )
339
- end
340
- #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
341
- self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
342
- #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
343
- BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
344
- return self
345
- end
346
-
347
- def set_all_ground_floor_conductances_to(conductance)
348
- #Set conductances to needed values in construction set if possible.
349
- self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
350
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
351
- self,
352
- "Sensitivity Def Cnst Set #{index}",
353
- default_construction_set,
354
- nil,
355
- nil,
356
- nil,
357
- nil,
358
- 1/conductance,
359
- nil,
360
- nil,
361
- nil,
362
- nil,
363
- nil,
364
- nil,
365
- nil,
366
- nil,
367
- nil,
368
- nil,
369
- nil,
370
- nil,
371
- nil,
372
- nil,
373
- nil,
374
- nil,
375
- nil,
376
- nil,
377
- nil,
378
- nil,
379
- nil
380
- )
381
- end
382
- #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
383
- self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
384
- #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
385
- BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
386
- return self
387
- end
388
-
389
- def set_all_ext_windows_and_door_conductances_to(conductance)
390
- #Set conductances to needed values in construction set if possible.
391
- self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
392
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
393
- self,
394
- "Sensitivity Def Cnst Set #{index}",
395
- default_construction_set,
396
- nil,
397
- nil,
398
- nil,
399
- nil,
400
- nil,
401
- nil,
402
- 1/conductance,
403
- nil,
404
- nil,
405
- 1/conductance,
406
- nil,
407
- nil,
408
- 1/conductance,
409
- 1/conductance,
410
- nil,
411
- nil,
412
- 1/conductance,
413
- nil,
414
- nil,
415
- nil,
416
- nil,
417
- nil,
418
- nil,
419
- nil,
420
- nil,
421
- nil
422
- )
423
- end
424
- #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
425
- self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
426
- #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
427
- BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
428
- return self
429
- end
430
-
431
- def set_all_ext_skylight_conductances_to(conductance)
432
- #Set conductances to needed values in construction set if possible.
433
- self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
434
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
435
- self,
436
- "Sensitivity Def Cnst Set #{index}",
437
- default_construction_set,
438
- nil,
439
- nil,
440
- nil,
441
- nil,
442
- nil,
443
- nil,
444
- nil,
445
- nil,
446
- nil,
447
- nil,
448
- nil,
449
- nil,
450
- nil,
451
- nil,
452
- nil,
453
- nil,
454
- nil,
455
- 1/conductance,
456
- nil,
457
- nil,
458
- nil,
459
- nil,
460
- nil,
461
- nil,
462
- nil,
463
- nil
464
- )
465
- end
466
- #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
467
- self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
468
- #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
469
- BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
470
- return self
471
- end
472
-
473
- #This method will set the infiltration magnitude.
474
- #@author phylroy.lopez@nrcan.gc.ca
475
- #@param self [OpenStudio::model::Model] A model object
476
- #@param setDesignFlowRate [Float]
477
- #@param setFlowperSpaceFloorArea [Float]
478
- #@param setFlowperExteriorSurfaceArea [Float]
479
- #@param setAirChangesperHour [Float]
480
- #@return [String] table
481
- def set_all_inflitration_rates(setDesignFlowRate,
482
- setFlowperSpaceFloorArea,
483
- setFlowperExteriorSurfaceArea,
484
- setAirChangesperHour)
485
-
486
- table = "name,infiltration_method,infiltration_design_flow_rate,infiltration_flow_per_space,infiltration_flow_per_exterior_area,infiltration_air_changes_per_hour\n"
487
- self.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load|
488
- infiltration_load.setAirChangesperHour(setAirChangesperHour) unless setAirChangesperHour.nil?
489
- infiltration_load.setDesignFlowRate(setDesignFlowRate) unless setDesignFlowRate.nil?
490
- infiltration_load.setFlowperSpaceFloorArea(setFlowperSpaceFloorArea) unless setFlowperSpaceFloorArea.nil?
491
- infiltration_load.setFlowperExteriorSurfaceArea(setFlowperExteriorSurfaceArea) unless setFlowperExteriorSurfaceArea.nil?
492
- table << infiltration_load.name.get.to_s << ","
493
- table << infiltration_load.designFlowRateCalculationMethod << ","
494
- infiltration_load.airChangesperHour.empty? ? ach = "NA" : ach = infiltration_load.airChangesperHour.get
495
- infiltration_load.designFlowRate.empty? ? dfr = "NA" : dfr = infiltration_load.designFlowRate.get
496
- infiltration_load.flowperSpaceFloorArea.empty? ? fsfa = "NA" : fsfa = infiltration_load.flowperSpaceFloorArea.get
497
- infiltration_load.flowperExteriorSurfaceArea.empty? ? fesa = "NA" : fesa = infiltration_load.flowperExteriorSurfaceArea.get
498
- table << "#{ach},#{dfr},#{fsfa},#{fesa}\n"
499
- end
500
- return table
501
- end
502
-
503
- #Scale Global Changes
504
- def scale_all_people_loads(factor)
505
- self.getPeoples.sort.each do |item|
506
- item.setMultiplier(item.multiplier * factor)
507
- end
508
- end
509
-
510
- #This method will scale people loads schedule.
511
- #@author phylroy.lopez@nrcan.gc.ca
512
- #@param model [OpenStudio::model::Model] A model object
513
- #@param a_coef [Float]
514
- #@param b_coef [Float]
515
- #@param c_coef [Float]
516
- #@param time_shift [Float]
517
- #@param time_sign [Float]
518
- def scale_people_loads_schedule(a_coef,
519
- b_coef,
520
- c_coef,
521
- time_shift = nil,
522
- time_sign = nil)
523
- model.getPeoples.sort.each do |item|
524
- #Do an in-place modification of the schedule.
525
- BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign)
526
- end
527
- end
528
-
529
- #This method will scale lighting loads.
530
- #@author phylroy.lopez@nrcan.gc.ca
531
- #@param model [OpenStudio::model::Model] A model object
532
- #@param factor [Float]
533
- def scale_lighting_loads(factor)
534
- self.getLightss.sort.each do |item|
535
- item.setMultiplier(item.multiplier * factor)
536
- end
537
- end
538
-
539
- #This method will scale lighting loads schedule.
540
- #@author phylroy.lopez@nrcan.gc.ca
541
- #@param model [OpenStudio::model::Model] A model object
542
- #@param a_coef [Float]
543
- #@param b_coef [Float]
544
- #@param c_coef [Float]
545
- #@param time_shift [Float]
546
- #@param time_sign [Float]
547
- def scale_lighting_loads_schedule(a_coef,
548
- b_coef,
549
- c_coef,
550
- time_shift = nil,
551
- time_sign = nil)
552
- model.getLightss.sort.each do |item|
553
- #Do an in-place modification of the schedule.
554
- BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign)
555
- end
556
- end
557
-
558
- #This method will scale electrical loads.
559
- #@author phylroy.lopez@nrcan.gc.ca
560
- #@param model [OpenStudio::model::Model] A model object
561
- #@param factor [Float]
562
- def scale_electrical_loads(model, factor)
563
- self.getElectricEquipments.sort.each do |item|
564
- item.setMultiplier(item.multiplier * factor)
565
- end
566
- end
567
-
568
- #This method will scale electrical loads schedule.
569
- #@author phylroy.lopez@nrcan.gc.ca
570
- #@param model [OpenStudio::model::Model] A model object
571
- #@param a_coef [Float]
572
- #@param b_coef [Float]
573
- #@param c_coef [Float]
574
- #@param time_shift [Float]
575
- #@param time_sign [Float]
576
- def scale_electrical_loads_schedule(a_coef,
577
- b_coef,
578
- c_coef,
579
- time_shift = nil,
580
- time_sign = nil)
581
- self.getElectricEquipments.sort.each do |item|
582
- BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign)
583
- end
584
- end
585
-
586
- #This method will scale Outdoor Air loads.
587
- #@author phylroy.lopez@nrcan.gc.ca
588
- #@param model [OpenStudio::model::Model] A model object
589
- #@param factor [Float]
590
- def scale_oa_loads(factor)
591
- self.getDesignSpecificationOutdoorAirs.sort.each do |oa_def|
592
- oa_def.setOutdoorAirFlowperPerson(oa_def.outdoorAirFlowperPerson * factor) unless oa_def.isOutdoorAirFlowperPersonDefaulted
593
- oa_def.setOutdoorAirFlowperFloorArea(oa_def.outdoorAirFlowperFloorArea * factor) unless oa_def.isOutdoorAirFlowperFloorAreaDefaulted
594
- oa_def.setOutdoorAirFlowRate(oa_def.outdoorAirFlowRate * factor) unless oa_def.isOutdoorAirFlowRateDefaulted
595
- oa_def.setOutdoorAirFlowAirChangesperHour(oa_def.outdoorAirFlowAirChangesperHour * factor) unless oa_def.isOutdoorAirFlowAirChangesperHourDefaulted
596
- end
597
- end
598
-
599
- #This method will scale infiltration loads.
600
- #@author phylroy.lopez@nrcan.gc.ca
601
- #@param model [OpenStudio::model::Model] A model object
602
- #@param factor [Float]
603
- def scale_inflitration_loads(factor)
604
- self.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load|
605
- infiltration_load.setDesignFlowRate(infiltration_load.designFlowRate.get * factor) unless infiltration_load.designFlowRate.empty?
606
- infiltration_load.setFlowperSpaceFloorArea(infiltration_load.flowperSpaceFloorArea.get * factor) unless infiltration_load.flowperSpaceFloorArea.empty?
607
- infiltration_load.setFlowperExteriorSurfaceArea(infiltration_load.flowperExteriorSurfaceArea.get * factor) unless infiltration_load.flowperExteriorSurfaceArea.empty?
608
- infiltration_load.setAirChangesperHour(infiltration_load.airChangesperHour.get * factor) unless infiltration_load.airChangesperHour.empty?
609
- end
610
- end
611
-
612
- # Elimination Methods
613
- #This method removes people loads from the model.
614
- #@author phylroy.lopez@nrcan.gc.ca
615
- #@param model [OpenStudio::model::Model] A model object
616
- def eliminate_all_people_loads()
617
- self.getPeoples.sort.each {|people| people.remove}
618
- self.getPeopleDefinitions.sort.each {|people| people.remove}
619
- return self
620
- end
621
-
622
- #This method removes light loads from model.
623
- #@author phylroy.lopez@nrcan.gc.ca
624
- #@param model [OpenStudio::model::Model] A model object
625
- def eliminate_all_lighting_loads()
626
- self.getLightss.sort.each {|item| item.remove}
627
- self.getLightsDefinitions.sort.each {|item| item.remove}
628
- return self
629
- end
630
-
631
- #This method removes elec loads from model.
632
- #@author phylroy.lopez@nrcan.gc.ca
633
- #@param model [OpenStudio::model::Model] A model object
634
- def eliminate_all_electric_loads()
635
- self.getElectricEquipments.sort.each {|item| item.remove}
636
- self.getElectricEquipmentDefinitions.sort.each {|item| item.remove}
637
- return self
638
- end
639
-
640
- #This method removes all design specification OA from model.
641
- #@author phylroy.lopez@nrcan.gc.ca
642
- #@param model [OpenStudio::model::Model] A model object
643
- def eliminate_all_design_specification_outdoor_air()
644
- self.getDesignSpecificationOutdoorAirs.sort.each {|item| item.remove}
645
- return self
646
- end
647
-
648
- #This method removes infiltration from model..
649
- #@author phylroy.lopez@nrcan.gc.ca
650
- #@param model [OpenStudio::model::Model] A model object
651
- def eliminate_all_space_infiltration_design_flow_rates()
652
- self.getSpaceInfiltrationDesignFlowRates.sort.each {|item| item.remove}
653
- return self
654
- end
655
-
656
- #This method removes all space loads from model.
657
- #@author phylroy.lopez@nrcan.gc.ca
658
- #@param model [OpenStudio::model::Model] A model object
659
- def eliminate_all_loads()
660
- conductance = 0.200
661
-
662
- #self.set_all_ext_wall_conductances_to(conductance)
663
- #self.set_all_ext_roof_conductances_to(conductance)
664
- #self.set_all_ground_floor_conductances_to(conductance)
665
- #self.set_all_ground_wall_conductances_to(conductance)
666
- #self.set_all_ext_windows_and_door_conductances_to(conductance)
667
- #self.set_all_ext_skylight_conductances_to(conductance)
668
- self.eliminate_all_people_loads
669
- self.eliminate_all_lighting_loads
670
- self.eliminate_all_electric_loads
671
- self.eliminate_all_design_specification_outdoor_air
672
- self.eliminate_all_space_infiltration_design_flow_rates
673
- self.eliminate_all_space_infiltration_design_flow_rates
674
- return self
675
- end
676
-
677
- end
678
-
679
- # open the class to add methods to size all HVAC equipment
680
-
681
- class OpenStudio::Model::Space
682
- def get_average_height()
683
- roof_datum = 0
684
- total_roof_area = 0
685
- floor_datum = 0
686
- total_floor_area = 0
687
- average_height = 0
688
- #create a model to create a planar object.. Hopefully garbage collection deals with this right.
689
- temp_model = OpenStudio::Model::Model.new()
690
- self.surfaces.each do |surface|
691
- projected_vertices = Array.new()
692
- if surface.surfaceType == "Floor"
693
- average_surface_height = 0
694
- surface.vertices.each do |point3d|
695
- average_surface_height += point3d.z / surface.vertices.size
696
- projected_vertices << OpenStudio::Point3d.new(point3d.x, point3d.y, 0)
697
- end
698
- projected_surface_area = OpenStudio::Model::Surface.new(projected_vertices ,temp_model).grossArea
699
- total_roof_area += projected_surface_area
700
- floor_datum += average_surface_height * projected_surface_area
701
- elsif surface.surfaceType == "RoofCeiling"
702
- average_surface_height = 0
703
- surface.vertices.each do |point3d|
704
- average_surface_height += point3d.z / surface.vertices.size
705
- projected_vertices << OpenStudio::Point3d.new(point3d.x, point3d.y, 0)
706
- end
707
- projected_surface_area = OpenStudio::Model::Surface.new(projected_vertices ,temp_model).grossArea
708
- total_roof_area += projected_surface_area
709
- roof_datum += average_surface_height * projected_surface_area
710
- end
711
- end
712
- if total_floor_area > 0 and total_roof_area > 0
713
- average_height = roof_datum / total_roof_area - floor_datum / total_floor_area
714
- end
715
- return average_height
716
- end
717
- end
1
+ # require "#{File.dirname(__FILE__)}/btap"
2
+ #
3
+ #
4
+ # class OpenStudio::Model::Construction
5
+ # #This method will search through the layers and find the layer with the
6
+ # #lowest conductance and set that as the insulation layer. Note: Concrete walls
7
+ # #or slabs with no insulation layer but with a carper will see the carpet as the
8
+ # #insulation layer.
9
+ # #@author Phylroy A. Lopez <plopez@nrcan.gc.ca>
10
+ # #@return OpenStudio::Model::Material insulation_material_layer
11
+ # def self.find_and_set_insulaton_layer()
12
+ # insulation_material_layer = nil
13
+ # #return if there is already a defined insulation layer.
14
+ # return self.insulation unless self.insulation.empty?
15
+ # #set minimum conductance to 100.0
16
+ # min_conductance = 100.0
17
+ # #loop through Layers
18
+ # self.layers.each do |layer|
19
+ # #try casting the layer to an OpaqueMaterial.
20
+ # material = nil
21
+ # material = layer.to_OpaqueMaterial.get unless layer.to_OpaqueMaterial.empty?
22
+ # material = layer.to_FenestrationMaterial.get unless layer.to_FenestrationMaterial.empty?
23
+ # #check if the cast was successful, then find the insulation layer.
24
+ # unless nil == material
25
+ # if BTAP::Resources::Envelope::Materials::get_conductance(material) < min_conductance
26
+ # #Keep track of the highest thermal resistance value.
27
+ # min_conductance = BTAP::Resources::Envelope::Materials::get_conductance(material)
28
+ # insulation_material_layer = material
29
+ # unless material.to_OpaqueMaterial.empty?
30
+ # self.setInsulation(material)
31
+ # end
32
+ # end
33
+ # end
34
+ # end
35
+ # if self.insulation.empty? and self.isOpaque
36
+ # raise ("construction #{self.name.get.to_s} insulation layer could not be set!. This occurs when a insulation layer is duplicated in the construction.")
37
+ # end
38
+ # return insulation_material_layer
39
+ # end
40
+ #
41
+ #
42
+ #
43
+ #
44
+ # #This method will create a new construction based on self and a new conductance value.
45
+ # #It will check to see if a similar construction has already been created by this method
46
+ # #if so it will return the existing construction. If you wish to keep some of the properties, enter the
47
+ # #string "default" instead of a numerical value.
48
+ # #@author Phylroy A. Lopez <plopez@nrcan.gc.ca>
49
+ # #@param model [OpenStudio::Model::Model]
50
+ # #@param construction <String>
51
+ # #@param conductance [Fixnum]
52
+ # #@return [<String]OpenStudio::Model::getConstructionByName] new_construction
53
+ # def customize(model,
54
+ # construction,
55
+ # conductance,
56
+ # solarTransmittanceatNormalIncidence = nil,
57
+ # visibleTransmittance = nil
58
+ # )
59
+ #
60
+ # if self.isOpaque
61
+ #
62
+ # minimum_resistance = 0
63
+ # name_prefix = "#{construction.handle()} U- #{conductance}"
64
+ #
65
+ # #Check to see if we already made one like this.
66
+ # existing_construction = OpenStudio::Model::getConstructionByName(self.model,name_prefix)
67
+ # if not existing_construction.empty?
68
+ # # if so, return existing construction
69
+ # return existing_construction.get
70
+ # end
71
+ #
72
+ # #create a copy
73
+ # new_construction = self.deep_copy(self.model,construction)
74
+ #
75
+ # #Change Construction name in clone
76
+ # new_construction.setName( name_prefix)
77
+ #
78
+ # if conductance.kind_of?(Float)
79
+ # #re-find insulation layer
80
+ # find_and_set_insulaton_layer(self.model,new_construction)
81
+ #
82
+ # #Determine how low the resistance can be set. Subtract existing insulation
83
+ # #Values from the total resistance to see how low we can go.
84
+ # minimum_resistance = (1 / new_construction.thermalConductance.to_f) - (1.0 / new_construction.insulation.get.thermalConductance.to_f)
85
+ #
86
+ # #Check if the requested resistance is smaller than the minimum
87
+ # # resistance. If so, use the minimum resistance instead.
88
+ # if minimum_resistance > ( 1 / conductance )
89
+ # #tell user why we are defaulting and set the conductance of the
90
+ # # construction.
91
+ # raise ("could not set conductance of construction #{new_construction.name.to_s} to because existing layers make this impossible. Change the construction to allow for this conductance to be set." + (conductance).to_s + "setting to closest value possible value:" + (1.0 / minimum_resistance).to_s )
92
+ # # new_construction.setConductance((1.0/minimum_resistance))
93
+ # else
94
+ # unless new_construction.setConductance(conductance)
95
+ # raise("could not set conductance of construction #{new_construction.name.to_s}")
96
+ # end
97
+ # end
98
+ # end
99
+ # return new_construction
100
+ # elsif self.isFenestration()
101
+ #
102
+ # #get equivilant values for tsol, tvis, and conductances.
103
+ # solarTransmittanceatNormalIncidence = self.get_shgc(model, construction) if solarTransmittanceatNormalIncidence == nil
104
+ # visibleTransmittance = self.get_tvis(model,construction) if visibleTransmittance == nil
105
+ # conductance = self.get_conductance(construction) if conductance == nil
106
+ # frontSideSolarReflectanceatNormalIncidence = 1.0 - solarTransmittanceatNormalIncidence
107
+ # backSideSolarReflectanceatNormalIncidence = 1.0 - solarTransmittanceatNormalIncidence
108
+ # frontSideVisibleReflectanceatNormalIncidence = 0.081000
109
+ # backSideVisibleReflectanceatNormalIncidence = 0.081000
110
+ # infraredTransmittanceatNormalIncidence = 0.0
111
+ # frontSideInfraredHemisphericalEmissivity = 0.84
112
+ # backSideInfraredHemisphericalEmissivity = 0.84
113
+ # #store part of fenestation in array bins.
114
+ # glazing_array = Array.new()
115
+ # shading_material_array = Array.new()
116
+ # gas_array = Array.new()
117
+ # construction.layers.each do |material|
118
+ # glazing_array << material unless material.to_Glazing.empty?
119
+ # shading_material_array << material unless material.to_ShadingMaterial.empty?
120
+ # gas_array << material unless material.to_GasLayer.empty?
121
+ # end
122
+ #
123
+ # #set value of fictious glazing based on the fenestrations front and back if available
124
+ # unless glazing_array.first.to_StandardGlazing.empty?
125
+ # frontSideSolarReflectanceatNormalIncidence = glazing_array.first.to_StandardGlazing.get.frontSideSolarReflectanceatNormalIncidence
126
+ # frontSideVisibleReflectanceatNormalIncidence = glazing_array.first.to_StandardGlazing.get.frontSideVisibleReflectanceatNormalIncidence
127
+ # frontSideInfraredHemisphericalEmissivity = glazing_array.first.to_StandardGlazing.get.frontSideInfraredHemisphericalEmissivity
128
+ # end
129
+ #
130
+ # unless glazing_array.last.to_StandardGlazing.empty?
131
+ # backSideSolarReflectanceatNormalIncidence = glazing_array.last.to_StandardGlazing.get.backSideSolarReflectanceatNormalIncidence
132
+ # backSideVisibleReflectanceatNormalIncidence = glazing_array.last.to_StandardGlazing.get.backSideVisibleReflectanceatNormalIncidence
133
+ # backSideInfraredHemisphericalEmissivity = glazing_array.last.to_StandardGlazing.get.backSideInfraredHemisphericalEmissivity
134
+ # end
135
+ # #create fictious glazing.
136
+ # #assume a thickness of 0.10m
137
+ # thickness = 0.10
138
+ # #calculate conductivity
139
+ # conductivity = conductance * thickness
140
+ # data_name_suffix = " cond=#{("%.3f" % conductivity).to_s} tvis=#{("%.3f" % visibleTransmittance).to_s} tsol=#{("%.3f" % solarTransmittanceatNormalIncidence).to_s}"
141
+ # cons_name = "Customized Fenestration:" + data_name_suffix
142
+ # glazing_name = "Customized Fenestration::" + data_name_suffix
143
+ # #Search to prevent the massive duplication that may ensue.
144
+ # return model.getConstructionByName(cons_name).get unless model.getConstructionByName(cons_name).empty?
145
+ #
146
+ # #fix for Simple glazing
147
+ # conductivity = conductance
148
+ # glazing = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(
149
+ # construction.model,#model
150
+ # glazing_name, #name
151
+ # 0.60, #SHGC
152
+ # conductivity, #u-factor
153
+ # thickness, #Thickness
154
+ # 0.21 #vis trans
155
+ # )
156
+ #
157
+ # new_materials_array = Array.new()
158
+ # new_materials_array << glazing
159
+ # new_materials_array.concat(shading_material_array) unless shading_material_array.empty?
160
+ # return self.create_construction(construction.model, cons_name, new_materials_array)
161
+ # end
162
+ # end
163
+ #
164
+ #
165
+ #
166
+ # end
167
+ #
168
+ #
169
+ #
170
+ # # open the class to add methods to size all HVAC equipment
171
+ # class OpenStudio::Model::Model
172
+ #
173
+ # def perform_load_elimination_analysis(folder = Dir.pwd)
174
+ # #remove hvac and only use ideal loads.
175
+ # model = self.clone(true).to_Model
176
+ # BTAP::Resources::HVAC::clear_all_hvac_from_model(model)
177
+ # model.getThermalZones.sort.each {|zone| zone.setUseIdealAirLoads(true)}
178
+ # conductance = 0.200
179
+ # models = Array.new()
180
+ # #Add baseline
181
+ # models << {:name => 'baseline', :model => model}
182
+ # #Add copies of model with elimination of a characteristic.
183
+ # models << {:name => 'elim_ext_wall', :model => model.clone(true).to_Model}
184
+ # =begin
185
+ # models << {:name => 'elim_ext_roof', :model => model.clone(true).to_Model.set_all_ext_roof_conductances_to(conductance)}
186
+ # models << {:name => 'elim_ground_floor', :model => model.clone(true).to_Model.set_all_ground_floor_conductances_to(conductance)}
187
+ # models << {:name => 'elim_ground_wall', :model => model.clone(true).to_Model.set_all_ground_wall_conductances_to(conductance)}
188
+ # models << {:name => 'elim_win_doors', :model => model.clone(true).to_Model.set_all_ext_windows_and_door_conductances_to(conductance)}
189
+ # models << {:name => 'elim_skylights', :model => model.clone(true).to_Model.set_all_ext_skylight_conductances_to(conductance)}
190
+ # models << {:name => 'elim_people', :model => model.clone(true).to_Model.eliminate_all_people_loads}
191
+ # models << {:name => 'elim_lighting', :model => model.clone(true).to_Model.eliminate_all_lighting_loads}
192
+ # models << {:name => 'elim_plug_loads', :model => model.clone(true).to_Model.eliminate_all_electric_loads}
193
+ # models << {:name => 'elim_outdoor_air', :model => model.clone(true).to_Model.eliminate_all_design_specification_outdoor_air}
194
+ # models << {:name => 'elim_infiltration', :model => model.clone(true).to_Model.eliminate_all_space_infiltration_design_flow_rates}
195
+ # models << {:name => 'elim_all_loads', :model => model.clone(true).to_Model.eliminate_all_loads}
196
+ # =end
197
+ #
198
+ # #Get a handle for the baseline.
199
+ # baseline = models.find {|model| model[:name] == 'baseline' }
200
+ # #Create a result hash.
201
+ # result = Hash.new()
202
+ # models.each do |model|
203
+ # #run each model in its own folder.
204
+ # success = model_run_simulation_and_log_errors(model[:model], "#{folder}/#{model[:name]}")
205
+ #
206
+ # #Run the qa-qc method to get all the results.
207
+ #
208
+ # qa_qc = BTAP::perform_qaqc(model[:model])
209
+ # #Store total energy in the hash
210
+ # model[:total_end_uses_gj_per_m2] = qa_qc[:end_uses_eui][:total_end_uses_gj_per_m2]
211
+ # #This assumes that the baseline is always the first in the hash.
212
+ # unless model[:name] = 'baseline'
213
+ # result[model[:name]] = model[:total_end_uses_gj_per_m2] / baseline[:total_end_uses_gj_per_m2]
214
+ # end
215
+ # end
216
+ # return result
217
+ # end
218
+ #
219
+ #
220
+ # # Set global changes
221
+ # def set_all_ext_wall_conductances_to(conductance)
222
+ # #Set conductances to needed values in construction set if possible.
223
+ # self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
224
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
225
+ # self,
226
+ # "Sensitivity Def Cnst Set #{index}",
227
+ # default_construction_set,
228
+ # 1/conductance,
229
+ # nil,
230
+ # nil,
231
+ # nil,
232
+ # nil,
233
+ # nil,
234
+ # nil,
235
+ # nil,
236
+ # nil,
237
+ # nil,
238
+ # nil,
239
+ # nil,
240
+ # nil,
241
+ # nil,
242
+ # nil,
243
+ # nil,
244
+ # nil,
245
+ # nil,
246
+ # nil,
247
+ # nil,
248
+ # nil,
249
+ # nil,
250
+ # nil,
251
+ # nil,
252
+ # nil,
253
+ # nil
254
+ # )
255
+ # end
256
+ # #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
257
+ # self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
258
+ # #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
259
+ # BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
260
+ # return self
261
+ # end
262
+ #
263
+ # def set_all_ext_roof_conductances_to(conductance)
264
+ # #Set conductances to needed values in construction set if possible.
265
+ # self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
266
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
267
+ # self,
268
+ # "Sensitivity Def Cnst Set #{index}",
269
+ # default_construction_set,
270
+ # nil,
271
+ # nil,
272
+ # 1/conductance,
273
+ # nil,
274
+ # nil,
275
+ # nil,
276
+ # nil,
277
+ # nil,
278
+ # nil,
279
+ # nil,
280
+ # nil,
281
+ # nil,
282
+ # nil,
283
+ # nil,
284
+ # nil,
285
+ # nil,
286
+ # nil,
287
+ # nil,
288
+ # nil,
289
+ # nil,
290
+ # nil,
291
+ # nil,
292
+ # nil,
293
+ # nil,
294
+ # nil,
295
+ # nil
296
+ # )
297
+ # end
298
+ # #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
299
+ # self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
300
+ # #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
301
+ # BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
302
+ # return self
303
+ # end
304
+ #
305
+ # def set_all_ground_wall_conductances_to(conductance)
306
+ # #Set conductances to needed values in construction set if possible.
307
+ # self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
308
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
309
+ # self,
310
+ # "Sensitivity Def Cnst Set #{index}",
311
+ # default_construction_set,
312
+ # nil,
313
+ # nil,
314
+ # nil,
315
+ # 1/conductance,
316
+ # nil,
317
+ # nil,
318
+ # nil,
319
+ # nil,
320
+ # nil,
321
+ # nil,
322
+ # nil,
323
+ # nil,
324
+ # nil,
325
+ # nil,
326
+ # nil,
327
+ # nil,
328
+ # nil,
329
+ # nil,
330
+ # nil,
331
+ # nil,
332
+ # nil,
333
+ # nil,
334
+ # nil,
335
+ # nil,
336
+ # nil,
337
+ # nil
338
+ # )
339
+ # end
340
+ # #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
341
+ # self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
342
+ # #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
343
+ # BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
344
+ # return self
345
+ # end
346
+ #
347
+ # def set_all_ground_floor_conductances_to(conductance)
348
+ # #Set conductances to needed values in construction set if possible.
349
+ # self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
350
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
351
+ # self,
352
+ # "Sensitivity Def Cnst Set #{index}",
353
+ # default_construction_set,
354
+ # nil,
355
+ # nil,
356
+ # nil,
357
+ # nil,
358
+ # 1/conductance,
359
+ # nil,
360
+ # nil,
361
+ # nil,
362
+ # nil,
363
+ # nil,
364
+ # nil,
365
+ # nil,
366
+ # nil,
367
+ # nil,
368
+ # nil,
369
+ # nil,
370
+ # nil,
371
+ # nil,
372
+ # nil,
373
+ # nil,
374
+ # nil,
375
+ # nil,
376
+ # nil,
377
+ # nil,
378
+ # nil,
379
+ # nil
380
+ # )
381
+ # end
382
+ # #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
383
+ # self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
384
+ # #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
385
+ # BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
386
+ # return self
387
+ # end
388
+ #
389
+ # def set_all_ext_windows_and_door_conductances_to(conductance)
390
+ # #Set conductances to needed values in construction set if possible.
391
+ # self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
392
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
393
+ # self,
394
+ # "Sensitivity Def Cnst Set #{index}",
395
+ # default_construction_set,
396
+ # nil,
397
+ # nil,
398
+ # nil,
399
+ # nil,
400
+ # nil,
401
+ # nil,
402
+ # 1/conductance,
403
+ # nil,
404
+ # nil,
405
+ # 1/conductance,
406
+ # nil,
407
+ # nil,
408
+ # 1/conductance,
409
+ # 1/conductance,
410
+ # nil,
411
+ # nil,
412
+ # 1/conductance,
413
+ # nil,
414
+ # nil,
415
+ # nil,
416
+ # nil,
417
+ # nil,
418
+ # nil,
419
+ # nil,
420
+ # nil,
421
+ # nil
422
+ # )
423
+ # end
424
+ # #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
425
+ # self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
426
+ # #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
427
+ # BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
428
+ # return self
429
+ # end
430
+ #
431
+ # def set_all_ext_skylight_conductances_to(conductance)
432
+ # #Set conductances to needed values in construction set if possible.
433
+ # self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index|
434
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
435
+ # self,
436
+ # "Sensitivity Def Cnst Set #{index}",
437
+ # default_construction_set,
438
+ # nil,
439
+ # nil,
440
+ # nil,
441
+ # nil,
442
+ # nil,
443
+ # nil,
444
+ # nil,
445
+ # nil,
446
+ # nil,
447
+ # nil,
448
+ # nil,
449
+ # nil,
450
+ # nil,
451
+ # nil,
452
+ # nil,
453
+ # nil,
454
+ # nil,
455
+ # 1/conductance,
456
+ # nil,
457
+ # nil,
458
+ # nil,
459
+ # nil,
460
+ # nil,
461
+ # nil,
462
+ # nil,
463
+ # nil
464
+ # )
465
+ # end
466
+ # #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type.
467
+ # self.getPlanarSurfaces.sort.each {|item| item.resetConstruction}
468
+ # #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces
469
+ # BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil)
470
+ # return self
471
+ # end
472
+ #
473
+ # #This method will set the infiltration magnitude.
474
+ # #@author phylroy.lopez@nrcan.gc.ca
475
+ # #@param self [OpenStudio::model::Model] A model object
476
+ # #@param setDesignFlowRate [Float]
477
+ # #@param setFlowperSpaceFloorArea [Float]
478
+ # #@param setFlowperExteriorSurfaceArea [Float]
479
+ # #@param setAirChangesperHour [Float]
480
+ # #@return [String] table
481
+ # def set_all_inflitration_rates(setDesignFlowRate,
482
+ # setFlowperSpaceFloorArea,
483
+ # setFlowperExteriorSurfaceArea,
484
+ # setAirChangesperHour)
485
+ #
486
+ # table = "name,infiltration_method,infiltration_design_flow_rate,infiltration_flow_per_space,infiltration_flow_per_exterior_area,infiltration_air_changes_per_hour\n"
487
+ # self.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load|
488
+ # infiltration_load.setAirChangesperHour(setAirChangesperHour) unless setAirChangesperHour.nil?
489
+ # infiltration_load.setDesignFlowRate(setDesignFlowRate) unless setDesignFlowRate.nil?
490
+ # infiltration_load.setFlowperSpaceFloorArea(setFlowperSpaceFloorArea) unless setFlowperSpaceFloorArea.nil?
491
+ # infiltration_load.setFlowperExteriorSurfaceArea(setFlowperExteriorSurfaceArea) unless setFlowperExteriorSurfaceArea.nil?
492
+ # table << infiltration_load.name.get.to_s << ","
493
+ # table << infiltration_load.designFlowRateCalculationMethod << ","
494
+ # infiltration_load.airChangesperHour.empty? ? ach = "NA" : ach = infiltration_load.airChangesperHour.get
495
+ # infiltration_load.designFlowRate.empty? ? dfr = "NA" : dfr = infiltration_load.designFlowRate.get
496
+ # infiltration_load.flowperSpaceFloorArea.empty? ? fsfa = "NA" : fsfa = infiltration_load.flowperSpaceFloorArea.get
497
+ # infiltration_load.flowperExteriorSurfaceArea.empty? ? fesa = "NA" : fesa = infiltration_load.flowperExteriorSurfaceArea.get
498
+ # table << "#{ach},#{dfr},#{fsfa},#{fesa}\n"
499
+ # end
500
+ # return table
501
+ # end
502
+ #
503
+ # #Scale Global Changes
504
+ # def scale_all_people_loads(factor)
505
+ # self.getPeoples.sort.each do |item|
506
+ # item.setMultiplier(item.multiplier * factor)
507
+ # end
508
+ # end
509
+ #
510
+ # #This method will scale people loads schedule.
511
+ # #@author phylroy.lopez@nrcan.gc.ca
512
+ # #@param model [OpenStudio::model::Model] A model object
513
+ # #@param a_coef [Float]
514
+ # #@param b_coef [Float]
515
+ # #@param c_coef [Float]
516
+ # #@param time_shift [Float]
517
+ # #@param time_sign [Float]
518
+ # def scale_people_loads_schedule(a_coef,
519
+ # b_coef,
520
+ # c_coef,
521
+ # time_shift = nil,
522
+ # time_sign = nil)
523
+ # model.getPeoples.sort.each do |item|
524
+ # #Do an in-place modification of the schedule.
525
+ # BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign)
526
+ # end
527
+ # end
528
+ #
529
+ # #This method will scale lighting loads.
530
+ # #@author phylroy.lopez@nrcan.gc.ca
531
+ # #@param model [OpenStudio::model::Model] A model object
532
+ # #@param factor [Float]
533
+ # def scale_lighting_loads(factor)
534
+ # self.getLightss.sort.each do |item|
535
+ # item.setMultiplier(item.multiplier * factor)
536
+ # end
537
+ # end
538
+ #
539
+ # #This method will scale lighting loads schedule.
540
+ # #@author phylroy.lopez@nrcan.gc.ca
541
+ # #@param model [OpenStudio::model::Model] A model object
542
+ # #@param a_coef [Float]
543
+ # #@param b_coef [Float]
544
+ # #@param c_coef [Float]
545
+ # #@param time_shift [Float]
546
+ # #@param time_sign [Float]
547
+ # def scale_lighting_loads_schedule(a_coef,
548
+ # b_coef,
549
+ # c_coef,
550
+ # time_shift = nil,
551
+ # time_sign = nil)
552
+ # model.getLightss.sort.each do |item|
553
+ # #Do an in-place modification of the schedule.
554
+ # BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign)
555
+ # end
556
+ # end
557
+ #
558
+ # #This method will scale electrical loads.
559
+ # #@author phylroy.lopez@nrcan.gc.ca
560
+ # #@param model [OpenStudio::model::Model] A model object
561
+ # #@param factor [Float]
562
+ # def scale_electrical_loads(model, factor)
563
+ # self.getElectricEquipments.sort.each do |item|
564
+ # item.setMultiplier(item.multiplier * factor)
565
+ # end
566
+ # end
567
+ #
568
+ # #This method will scale electrical loads schedule.
569
+ # #@author phylroy.lopez@nrcan.gc.ca
570
+ # #@param model [OpenStudio::model::Model] A model object
571
+ # #@param a_coef [Float]
572
+ # #@param b_coef [Float]
573
+ # #@param c_coef [Float]
574
+ # #@param time_shift [Float]
575
+ # #@param time_sign [Float]
576
+ # def scale_electrical_loads_schedule(a_coef,
577
+ # b_coef,
578
+ # c_coef,
579
+ # time_shift = nil,
580
+ # time_sign = nil)
581
+ # self.getElectricEquipments.sort.each do |item|
582
+ # BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign)
583
+ # end
584
+ # end
585
+ #
586
+ # #This method will scale Outdoor Air loads.
587
+ # #@author phylroy.lopez@nrcan.gc.ca
588
+ # #@param model [OpenStudio::model::Model] A model object
589
+ # #@param factor [Float]
590
+ # def scale_oa_loads(factor)
591
+ # self.getDesignSpecificationOutdoorAirs.sort.each do |oa_def|
592
+ # oa_def.setOutdoorAirFlowperPerson(oa_def.outdoorAirFlowperPerson * factor) unless oa_def.isOutdoorAirFlowperPersonDefaulted
593
+ # oa_def.setOutdoorAirFlowperFloorArea(oa_def.outdoorAirFlowperFloorArea * factor) unless oa_def.isOutdoorAirFlowperFloorAreaDefaulted
594
+ # oa_def.setOutdoorAirFlowRate(oa_def.outdoorAirFlowRate * factor) unless oa_def.isOutdoorAirFlowRateDefaulted
595
+ # oa_def.setOutdoorAirFlowAirChangesperHour(oa_def.outdoorAirFlowAirChangesperHour * factor) unless oa_def.isOutdoorAirFlowAirChangesperHourDefaulted
596
+ # end
597
+ # end
598
+ #
599
+ # #This method will scale infiltration loads.
600
+ # #@author phylroy.lopez@nrcan.gc.ca
601
+ # #@param model [OpenStudio::model::Model] A model object
602
+ # #@param factor [Float]
603
+ # def scale_inflitration_loads(factor)
604
+ # self.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load|
605
+ # infiltration_load.setDesignFlowRate(infiltration_load.designFlowRate.get * factor) unless infiltration_load.designFlowRate.empty?
606
+ # infiltration_load.setFlowperSpaceFloorArea(infiltration_load.flowperSpaceFloorArea.get * factor) unless infiltration_load.flowperSpaceFloorArea.empty?
607
+ # infiltration_load.setFlowperExteriorSurfaceArea(infiltration_load.flowperExteriorSurfaceArea.get * factor) unless infiltration_load.flowperExteriorSurfaceArea.empty?
608
+ # infiltration_load.setAirChangesperHour(infiltration_load.airChangesperHour.get * factor) unless infiltration_load.airChangesperHour.empty?
609
+ # end
610
+ # end
611
+ #
612
+ # # Elimination Methods
613
+ # #This method removes people loads from the model.
614
+ # #@author phylroy.lopez@nrcan.gc.ca
615
+ # #@param model [OpenStudio::model::Model] A model object
616
+ # def eliminate_all_people_loads()
617
+ # self.getPeoples.sort.each {|people| people.remove}
618
+ # self.getPeopleDefinitions.sort.each {|people| people.remove}
619
+ # return self
620
+ # end
621
+ #
622
+ # #This method removes light loads from model.
623
+ # #@author phylroy.lopez@nrcan.gc.ca
624
+ # #@param model [OpenStudio::model::Model] A model object
625
+ # def eliminate_all_lighting_loads()
626
+ # self.getLightss.sort.each {|item| item.remove}
627
+ # self.getLightsDefinitions.sort.each {|item| item.remove}
628
+ # return self
629
+ # end
630
+ #
631
+ # #This method removes elec loads from model.
632
+ # #@author phylroy.lopez@nrcan.gc.ca
633
+ # #@param model [OpenStudio::model::Model] A model object
634
+ # def eliminate_all_electric_loads()
635
+ # self.getElectricEquipments.sort.each {|item| item.remove}
636
+ # self.getElectricEquipmentDefinitions.sort.each {|item| item.remove}
637
+ # return self
638
+ # end
639
+ #
640
+ # #This method removes all design specification OA from model.
641
+ # #@author phylroy.lopez@nrcan.gc.ca
642
+ # #@param model [OpenStudio::model::Model] A model object
643
+ # def eliminate_all_design_specification_outdoor_air()
644
+ # self.getDesignSpecificationOutdoorAirs.sort.each {|item| item.remove}
645
+ # return self
646
+ # end
647
+ #
648
+ # #This method removes infiltration from model..
649
+ # #@author phylroy.lopez@nrcan.gc.ca
650
+ # #@param model [OpenStudio::model::Model] A model object
651
+ # def eliminate_all_space_infiltration_design_flow_rates()
652
+ # self.getSpaceInfiltrationDesignFlowRates.sort.each {|item| item.remove}
653
+ # return self
654
+ # end
655
+ #
656
+ # #This method removes all space loads from model.
657
+ # #@author phylroy.lopez@nrcan.gc.ca
658
+ # #@param model [OpenStudio::model::Model] A model object
659
+ # def eliminate_all_loads()
660
+ # conductance = 0.200
661
+ #
662
+ # #self.set_all_ext_wall_conductances_to(conductance)
663
+ # #self.set_all_ext_roof_conductances_to(conductance)
664
+ # #self.set_all_ground_floor_conductances_to(conductance)
665
+ # #self.set_all_ground_wall_conductances_to(conductance)
666
+ # #self.set_all_ext_windows_and_door_conductances_to(conductance)
667
+ # #self.set_all_ext_skylight_conductances_to(conductance)
668
+ # self.eliminate_all_people_loads
669
+ # self.eliminate_all_lighting_loads
670
+ # self.eliminate_all_electric_loads
671
+ # self.eliminate_all_design_specification_outdoor_air
672
+ # self.eliminate_all_space_infiltration_design_flow_rates
673
+ # self.eliminate_all_space_infiltration_design_flow_rates
674
+ # return self
675
+ # end
676
+ #
677
+ # end
678
+ #
679
+ # # open the class to add methods to size all HVAC equipment
680
+ #
681
+ # class OpenStudio::Model::Space
682
+ # def get_average_height()
683
+ # roof_datum = 0
684
+ # total_roof_area = 0
685
+ # floor_datum = 0
686
+ # total_floor_area = 0
687
+ # average_height = 0
688
+ # #create a model to create a planar object.. Hopefully garbage collection deals with this right.
689
+ # temp_model = OpenStudio::Model::Model.new()
690
+ # self.surfaces.each do |surface|
691
+ # projected_vertices = Array.new()
692
+ # if surface.surfaceType == "Floor"
693
+ # average_surface_height = 0
694
+ # surface.vertices.each do |point3d|
695
+ # average_surface_height += point3d.z / surface.vertices.size
696
+ # projected_vertices << OpenStudio::Point3d.new(point3d.x, point3d.y, 0)
697
+ # end
698
+ # projected_surface_area = OpenStudio::Model::Surface.new(projected_vertices ,temp_model).grossArea
699
+ # total_roof_area += projected_surface_area
700
+ # floor_datum += average_surface_height * projected_surface_area
701
+ # elsif surface.surfaceType == "RoofCeiling"
702
+ # average_surface_height = 0
703
+ # surface.vertices.each do |point3d|
704
+ # average_surface_height += point3d.z / surface.vertices.size
705
+ # projected_vertices << OpenStudio::Point3d.new(point3d.x, point3d.y, 0)
706
+ # end
707
+ # projected_surface_area = OpenStudio::Model::Surface.new(projected_vertices ,temp_model).grossArea
708
+ # total_roof_area += projected_surface_area
709
+ # roof_datum += average_surface_height * projected_surface_area
710
+ # end
711
+ # end
712
+ # if total_floor_area > 0 and total_roof_area > 0
713
+ # average_height = roof_datum / total_roof_area - floor_datum / total_floor_area
714
+ # end
715
+ # return average_height
716
+ # end
717
+ # end