openstudio-standards 0.2.17.rc2 → 0.3.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) 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.Model.exterior_lights.rb +7 -7
  30. data/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb +5 -1
  31. data/lib/openstudio-standards/prototypes/common/objects/Prototype.ServiceWaterHeating.rb +101 -4
  32. data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +16 -1
  33. data/lib/openstudio-standards/prototypes/common/objects/Prototype.refrigeration.rb +5 -4
  34. data/lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb +24 -4
  35. data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +18 -2
  36. data/lib/openstudio-standards/standards/Standards.BoilerHotWater.rb +18 -0
  37. data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +13 -10
  38. data/lib/openstudio-standards/standards/Standards.CoilDX.rb +5 -3
  39. data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +11 -8
  40. data/lib/openstudio-standards/standards/Standards.Construction.rb +1 -1
  41. data/lib/openstudio-standards/standards/Standards.Model.rb +68 -52
  42. data/lib/openstudio-standards/standards/Standards.PlantLoop.rb +2 -2
  43. data/lib/openstudio-standards/standards/Standards.Space.rb +16 -18
  44. data/lib/openstudio-standards/standards/Standards.ThermalZone.rb +1 -1
  45. data/lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb +5 -5
  46. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.ref_cases.json +510 -0
  47. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_compressors.json +18 -0
  48. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_walkins.json +410 -0
  49. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.spc_typ.json +2 -2
  50. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.ref_cases.json +510 -0
  51. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_compressors.json +18 -0
  52. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_walkins.json +410 -0
  53. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.spc_typ.json +2 -2
  54. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.ref_cases.json +510 -0
  55. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_compressors.json +18 -0
  56. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_walkins.json +410 -0
  57. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.spc_typ.json +2 -2
  58. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.ref_cases.json +510 -0
  59. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_compressors.json +18 -0
  60. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_walkins.json +410 -0
  61. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.spc_typ.json +2 -2
  62. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.spc_typ.json +2 -2
  63. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.spc_typ.json +2 -2
  64. data/lib/openstudio-standards/standards/ashrae_90_1/data/ashrae_90_1.entryways.json +13 -2
  65. data/lib/openstudio-standards/standards/ashrae_90_1/data/ashrae_90_1.parking.json +11 -2
  66. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.AirLoopHVAC.rb +9 -0
  67. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.Model.rb +2 -0
  68. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.rb +4 -3
  69. data/lib/openstudio-standards/standards/deer/deer_1985/comstock_deer_1985/data/comstock_deer_1985.spc_typ.json +405 -405
  70. data/lib/openstudio-standards/standards/deer/deer_1996/comstock_deer_1996/data/comstock_deer_1996.spc_typ.json +405 -405
  71. data/lib/openstudio-standards/standards/deer/deer_2003/comstock_deer_2003/data/comstock_deer_2003.spc_typ.json +405 -405
  72. data/lib/openstudio-standards/standards/deer/deer_2003/deer_2003.ThermalZone.rb +21 -0
  73. data/lib/openstudio-standards/standards/deer/deer_2007/comstock_deer_2007/data/comstock_deer_2007.spc_typ.json +405 -405
  74. data/lib/openstudio-standards/standards/deer/deer_2007/deer_2007.ThermalZone.rb +21 -0
  75. data/lib/openstudio-standards/standards/deer/deer_2011/comstock_deer_2011/data/comstock_deer_2011.spc_typ.json +405 -405
  76. data/lib/openstudio-standards/standards/deer/deer_2011/deer_2011.ThermalZone.rb +21 -0
  77. data/lib/openstudio-standards/standards/deer/deer_2014/comstock_deer_2014/data/comstock_deer_2014.spc_typ.json +405 -405
  78. data/lib/openstudio-standards/standards/deer/deer_2014/deer_2014.ThermalZone.rb +21 -0
  79. data/lib/openstudio-standards/standards/deer/deer_2015/comstock_deer_2015/data/comstock_deer_2015.spc_typ.json +405 -405
  80. data/lib/openstudio-standards/standards/deer/deer_2015/deer_2015.ThermalZone.rb +21 -0
  81. data/lib/openstudio-standards/standards/deer/deer_2017/comstock_deer_2017/data/comstock_deer_2017.spc_typ.json +405 -405
  82. data/lib/openstudio-standards/standards/deer/deer_2017/deer_2017.ThermalZone.rb +21 -0
  83. data/lib/openstudio-standards/standards/deer/deer_2020/comstock_deer_2020/data/comstock_deer_2020.spc_typ.json +405 -405
  84. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.AirLoopHVAC.rb +8 -0
  85. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.ThermalZone.rb +21 -0
  86. data/lib/openstudio-standards/standards/deer/deer_2025/comstock_deer_2025/data/comstock_deer_2025.spc_typ.json +405 -405
  87. data/lib/openstudio-standards/standards/deer/deer_2030/comstock_deer_2030/data/comstock_deer_2030.spc_typ.json +405 -405
  88. data/lib/openstudio-standards/standards/deer/deer_2035/comstock_deer_2035/data/comstock_deer_2035.spc_typ.json +405 -405
  89. data/lib/openstudio-standards/standards/deer/deer_2040/comstock_deer_2040/data/comstock_deer_2040.spc_typ.json +405 -405
  90. data/lib/openstudio-standards/standards/deer/deer_2045/comstock_deer_2045/data/comstock_deer_2045.spc_typ.json +405 -405
  91. data/lib/openstudio-standards/standards/deer/deer_2050/comstock_deer_2050/data/comstock_deer_2050.spc_typ.json +405 -405
  92. data/lib/openstudio-standards/standards/deer/deer_2055/comstock_deer_2055/data/comstock_deer_2055.spc_typ.json +405 -405
  93. data/lib/openstudio-standards/standards/deer/deer_2060/comstock_deer_2060/data/comstock_deer_2060.spc_typ.json +405 -405
  94. data/lib/openstudio-standards/standards/deer/deer_2065/comstock_deer_2065/data/comstock_deer_2065.spc_typ.json +405 -405
  95. data/lib/openstudio-standards/standards/deer/deer_2070/comstock_deer_2070/data/comstock_deer_2070.spc_typ.json +405 -405
  96. data/lib/openstudio-standards/standards/deer/deer_2075/comstock_deer_2075/data/comstock_deer_2075.spc_typ.json +405 -405
  97. data/lib/openstudio-standards/standards/deer/deer_pre_1975/comstock_deer_pre_1975/data/comstock_deer_pre_1975.spc_typ.json +405 -405
  98. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/btap_pre1980.rb +1 -1
  99. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_3_and_8_single_speed.rb +3 -1
  100. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_4.rb +3 -1
  101. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_6.rb +2 -2
  102. data/lib/openstudio-standards/standards/necb/ECMS/data/curves.json +233 -0
  103. data/lib/openstudio-standards/standards/necb/ECMS/data/unitary_acs.json +180 -0
  104. data/lib/openstudio-standards/standards/necb/ECMS/ecms.rb +6 -1
  105. data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +807 -258
  106. data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +102 -66
  107. data/lib/openstudio-standards/standards/necb/NECB2011/data/fuel_type_sets.json +85 -8
  108. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/HighriseApartment.osm +2483 -992
  109. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LowriseApartment.osm +4 -336
  110. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/MidriseApartment.osm +228 -231
  111. data/lib/openstudio-standards/standards/necb/NECB2011/data/heat_pumps_heating.json +12 -18
  112. data/lib/openstudio-standards/standards/necb/NECB2011/data/space_type_unit_definitions.txt +76 -0
  113. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_multi_speed.rb +6 -1
  114. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_single_speed.rb +111 -24
  115. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_2_and_5.rb +1 -0
  116. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_multi_speed.rb +3 -1
  117. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_single_speed.rb +64 -16
  118. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_4.rb +61 -17
  119. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_6.rb +128 -0
  120. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +252 -23
  121. data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +316 -20
  122. data/lib/openstudio-standards/standards/necb/NECB2011/qaqc/necb_qaqc.rb +1 -1
  123. data/lib/openstudio-standards/standards/necb/NECB2011/service_water_heating.rb +4 -6
  124. data/lib/openstudio-standards/standards/necb/NECB2011/system_fuels.rb +38 -0
  125. data/lib/openstudio-standards/standards/necb/NECB2015/data/heat_pumps_heating.json +16 -24
  126. data/lib/openstudio-standards/standards/necb/NECB2015/hvac_systems.rb +48 -25
  127. data/lib/openstudio-standards/standards/necb/NECB2020/building_envelope.rb +3 -3
  128. data/lib/openstudio-standards/standards/necb/NECB2020/data/chillers.json +36 -19
  129. data/lib/openstudio-standards/standards/necb/NECB2020/data/furnaces.json +19 -4
  130. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps.json +20 -40
  131. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps_heating.json +74 -36
  132. data/lib/openstudio-standards/standards/necb/NECB2020/necb_2020.rb +0 -2
  133. data/lib/openstudio-standards/standards/necb/NECB2020/service_water_heating.rb +124 -57
  134. data/lib/openstudio-standards/standards/necb/common/btap_data.rb +124 -2
  135. data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +15 -2
  136. data/lib/openstudio-standards/standards/necb/common/necb_reference_runs.csv +1 -1
  137. data/lib/openstudio-standards/utilities/simulation.rb +1 -1
  138. data/lib/openstudio-standards/version.rb +1 -1
  139. data/lib/openstudio-standards/weather/Weather.Model.rb +5 -0
  140. data/lib/openstudio-standards/weather/Weather.stat_file.rb +33 -1
  141. data/lib/openstudio-standards.rb +1 -0
  142. metadata +14 -121
  143. data/data/standards/OpenStudio_Standards-ashrae_90_1.xlsx +0 -0
  144. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.ddy +0 -2342
  145. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw +0 -8768
  146. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.stat +0 -700
  147. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.ddy +0 -2342
  148. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw +0 -8768
  149. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.stat +0 -700
  150. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.ddy +0 -2342
  151. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw +0 -8768
  152. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.stat +0 -700
  153. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.ddy +0 -276
  154. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw +0 -8768
  155. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.stat +0 -611
  156. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.ddy +0 -276
  157. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.epw +0 -8768
  158. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.stat +0 -610
  159. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.ddy +0 -2342
  160. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw +0 -8768
  161. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.stat +0 -700
  162. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.ddy +0 -2342
  163. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw +0 -8768
  164. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.stat +0 -700
  165. data/lib/openstudio-standards/hvac_sizing/Siz.AirConditionerVariableRefrigerantFlow.rb +0 -81
  166. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatCoolVAVChngByp.rb +0 -27
  167. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAir.rb +0 -69
  168. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.rb +0 -178
  169. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitarySystem.rb +0 -27
  170. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolCooledBeam.rb +0 -27
  171. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolFourPipeInduction.rb +0 -27
  172. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolReheat.rb +0 -27
  173. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctParallelPIUReheat.rb +0 -67
  174. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctSeriesPIUReheat.rb +0 -27
  175. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctUncontrolled.rb +0 -30
  176. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolNoReheat.rb +0 -27
  177. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolReheat.rb +0 -27
  178. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVNoReheat.rb +0 -68
  179. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVReheat.rb +0 -68
  180. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerHotWater.rb +0 -42
  181. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerSteam.rb +0 -27
  182. data/lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb +0 -58
  183. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXMultiSpeed.rb +0 -171
  184. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXSingleSpeed.rb +0 -56
  185. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXTwoSpeed.rb +0 -89
  186. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXVariableRefrigerantFlow.rb +0 -50
  187. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingWaterToAirHeatPumpEquationFit.rb +0 -69
  188. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXMultiSpeed.rb +0 -120
  189. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXSingleSpeed.rb +0 -56
  190. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXVariableRefrigerantFlow.rb +0 -41
  191. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDesuperheater.rb +0 -27
  192. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingElectric.rb +0 -30
  193. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGas.rb +0 -30
  194. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGasMultiStage.rb +0 -68
  195. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWater.rb +0 -61
  196. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWaterToAirHeatPumpEquationFit.rb +0 -57
  197. data/lib/openstudio-standards/hvac_sizing/Siz.CoilWaterHeatingDesuperheater.rb +0 -27
  198. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerOutdoorAir.rb +0 -59
  199. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerWaterCoil.rb +0 -49
  200. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerSingleSpeed.rb +0 -90
  201. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerTwoSpeed.rb +0 -83
  202. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerVariableSpeed.rb +0 -57
  203. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictCooling.rb +0 -27
  204. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictHeating.rb +0 -27
  205. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerDirectResearchSpecial.rb +0 -27
  206. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerIndirectResearchSpecial.rb +0 -27
  207. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeFluidCoolerSingleSpeed.rb +0 -27
  208. data/lib/openstudio-standards/hvac_sizing/Siz.FanConstantVolume.rb +0 -29
  209. data/lib/openstudio-standards/hvac_sizing/Siz.FanOnOff.rb +0 -27
  210. data/lib/openstudio-standards/hvac_sizing/Siz.FanVariableVolume.rb +0 -29
  211. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsConstantSpeed.rb +0 -55
  212. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsVariableSpeed.rb +0 -55
  213. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerAirToAirSensibleAndLatent.rb +0 -38
  214. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerFluidToFluid.rb +0 -27
  215. data/lib/openstudio-standards/hvac_sizing/Siz.HumidifierSteamElectric.rb +0 -27
  216. data/lib/openstudio-standards/hvac_sizing/Siz.PlantLoop.rb +0 -42
  217. data/lib/openstudio-standards/hvac_sizing/Siz.PumpConstantSpeed.rb +0 -59
  218. data/lib/openstudio-standards/hvac_sizing/Siz.PumpVariableSpeed.rb +0 -59
  219. data/lib/openstudio-standards/hvac_sizing/Siz.SizingSystem.rb +0 -48
  220. data/lib/openstudio-standards/hvac_sizing/Siz.WaterHeaterMixed.rb +0 -16
  221. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveElectric.rb +0 -27
  222. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveWater.rb +0 -27
  223. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACFourPipeFanCoil.rb +0 -27
  224. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACHighTemperatureRadiant.rb +0 -27
  225. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACIdealLoadsAirSystem.rb +0 -27
  226. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantConstFlow.rb +0 -27
  227. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantVarFlow.rb +0 -27
  228. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTemperatureRadiantElectric.rb +0 -27
  229. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalAirConditioner.rb +0 -88
  230. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalHeatPump.rb +0 -88
  231. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACTerminalUnitVariableRefrigerantFlow.rb +0 -104
  232. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACUnitHeater.rb +0 -27
  233. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACWaterToAirHeatPump.rb +0 -27
@@ -1,1163 +1,1163 @@
1
- # *********************************************************************
2
- # * Copyright (c) 2008-2015, Natural Resources Canada
3
- # * All rights reserved.
4
- # *
5
- # * This library is free software; you can redistribute it and/or
6
- # * modify it under the terms of the GNU Lesser General Public
7
- # * License as published by the Free Software Foundation; either
8
- # * version 2.1 of the License, or (at your option) any later version.
9
- # *
10
- # * This library is distributed in the hope that it will be useful,
11
- # * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- # * Lesser General Public License for more details.
14
- # *
15
- # * You should have received a copy of the GNU Lesser General Public
16
- # * License along with this library; if not, write to the Free Software
17
- # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
- # **********************************************************************/
19
-
20
-
21
- require "#{File.dirname(__FILE__)}/btap"
22
-
23
- module BTAP
24
- module Resources #Resources
25
- # This module contains methods that relate to Materials, Constructions and Construction Sets
26
- module Economics
27
-
28
- #This method removes all costs from model
29
- #@author phylroy.lopez@nrcan.gc.ca
30
- #@param model [OpenStudio::model::Model] A model object
31
- #@param runner [String]
32
- def self.remove_all_costs(model,runner = nil)
33
- #Remove all cost items.
34
- model.getLifeCycleCosts.sort.each { |cost_item| cost_item.remove }
35
- #log change
36
- message = "Removed all cost objects from model"
37
- runner.nil? ? puts(message) : runner.registerInfo(message)
38
- end
39
-
40
- #This method will add the costs.
41
- #@author phylroy.lopez@nrcan.gc.ca
42
- #@param model [OpenStudio::model::Model] A model object
43
- #@param name [String]
44
- #@param cost [Float]
45
- #@param unittype [String]
46
- #return cost_object [OpenStudio::model::Model] A model object
47
- def self.object_cost(model,name,cost,unittype)
48
- unless cost.nil? or cost == 0.0
49
- #add total construction cost if used in place of each construction.
50
- cost_object = OpenStudio::Model::LifeCycleCost.new(model)
51
- cost_object.setName(name)
52
- cost_object.setCost(cost)
53
- cost_object.setCostUnits(unittype)
54
- end
55
- return cost_object
56
- end
57
-
58
- #This method will add the cost per building.
59
- #@author phylroy.lopez@nrcan.gc.ca
60
- #@param model [OpenStudio::model::Model] A model object
61
- #@param name [String]
62
- #@param cost [Float]
63
- #@param runner [Float]
64
- def self.add_cost_per_building(model,name,cost,runner = nil)
65
- #cost per building and building area
66
- unless cost.nil? or cost == 0.0
67
- cost_obj = BTAP::Resources::Economics::object_cost(model.building.get,name,cost,"CostPerEach")
68
- #log change
69
- message = "Added cost of per building named: #{name} with cost/bldg = #{cost} and handle UI =#{cost_obj.handle()}"
70
- runner.nil? ? puts(message) : runner.registerInfo(message)
71
- end
72
- end
73
-
74
- #This method will add the cost per total area.
75
- #@author phylroy.lopez@nrcan.gc.ca
76
- #@param model [OpenStudio::model::Model] A model object
77
- #@param name [String]
78
- #@param cost [Float]
79
- #@param runner [Float]
80
- def self.add_cost_per_total_area(model,name,cost,runner = nil)
81
- #cost per building and building area
82
- unless cost.nil? or cost == 0.0
83
- cost_obj = BTAP::Resources::Economics::object_cost(model.building.get,name,cost,"CostPerArea")
84
- #log change
85
- message = "Added cost of per building total area named: #{name} with cost/area = #{cost} and handle UI =#{cost_obj.handle()}"
86
- runner.nil? ? puts(message) : runner.registerInfo(message)
87
- end
88
- end
89
-
90
- #This method will set the ecm envelope.
91
- #@author phylroy.lopez@nrcan.gc.ca
92
- #@param model [OpenStudio::model::Model] A model object
93
- #@param library_file_path [String]
94
- #@param default_construction_set_name [String]
95
- #@param ext_wall_rsi [Float]
96
- #@param ext_floor_rsi [Float]
97
- #@param ext_roof_rsi [Float]
98
- #@param ground_wall_rsi [Float]
99
- #@param ground_floor_rsi [Float]
100
- #@param ground_roof_rsi [Float]
101
- #@param fixed_window_rsi [Float]
102
- #@param fixed_wind_solar_trans [Float]
103
- #@param fixed_wind_vis_trans [Float]
104
- #@param operable_window_rsi [Float]
105
- #@param operable_wind_solar_trans [Float]
106
- #@param operable_wind_vis_trans [Float]
107
- #@param door_construction_rsi [Float]
108
- #@param glass_door_rsi [Float]
109
- #@param glass_door_solar_trans [Float]
110
- #@param glass_door_vis_trans [Float]
111
- #@param overhead_door_rsi [Float]
112
- #@param skylight_rsi [Float]
113
- #@param skylight_solar_trans [Float]
114
- #@param skylight_vis_trans [Float]
115
- #@param tubular_daylight_dome_rsi [Float]
116
- #@param tubular_daylight_dome_solar_trans [Float]
117
- #@param tubular_daylight_dome_vis_trans [Float]
118
- #@param tubular_daylight_diffuser_rsi [Float]
119
- #@param tubular_daylight_diffuser_solar_trans [Float]
120
- #@param tubular_daylight_diffuser_vis_trans [Float]
121
- #@param ext_wall_cost_m2 [Float]
122
- #@param ext_floor_cost_m2 [Float]
123
- #@param ext_roof_cost_m2 [Float]
124
- #@param ground_wall_cost_m2 [Float]
125
- #@param ground_floor_cost_m2 [Float]
126
- #@param ground_roof_cost_m2 [Float]
127
- #@param fixed_window_cost_m2 [Float]
128
- #@param operable_window_cost_m2 [Float]
129
- #@param door_construction_cost_m2 [Float]
130
- #@param glass_door_cost_m2 [Float]
131
- #@param overhead_door_cost_m2 [Float]
132
- #@param skylight_cost_m2 [Float]
133
- #@param tubular_daylight_dome_cost_m2 [Float]
134
- #@param tubular_daylight_diffuser_cost_m2 [Float]
135
- #@param total_building_construction_set_cost [Float]
136
- #@param runner [Float]
137
- #@return [Boolean]
138
- def ecm_envelope( model,
139
- library_file_path,
140
- default_construction_set_name,
141
- ext_wall_rsi,
142
- ext_floor_rsi,
143
- ext_roof_rsi,
144
- ground_wall_rsi,
145
- ground_floor_rsi,
146
- ground_roof_rsi,
147
- fixed_window_rsi,
148
- fixed_wind_solar_trans,
149
- fixed_wind_vis_trans,
150
- operable_window_rsi,
151
- operable_wind_solar_trans,
152
- operable_wind_vis_trans,
153
- door_construction_rsi,
154
- glass_door_rsi,
155
- glass_door_solar_trans,
156
- glass_door_vis_trans,
157
- overhead_door_rsi,
158
- skylight_rsi,
159
- skylight_solar_trans,
160
- skylight_vis_trans,
161
- tubular_daylight_dome_rsi,
162
- tubular_daylight_dome_solar_trans,
163
- tubular_daylight_dome_vis_trans,
164
- tubular_daylight_diffuser_rsi,
165
- tubular_daylight_diffuser_solar_trans,
166
- tubular_daylight_diffuser_vis_trans,
167
- ext_wall_cost_m2,
168
- ext_floor_cost_m2,
169
- ext_roof_cost_m2,
170
- ground_wall_cost_m2,
171
- ground_floor_cost_m2,
172
- ground_roof_cost_m2,
173
- fixed_window_cost_m2,
174
- operable_window_cost_m2,
175
- door_construction_cost_m2,
176
- glass_door_cost_m2,
177
- overhead_door_cost_m2,
178
- skylight_cost_m2,
179
- tubular_daylight_dome_cost_m2,
180
- tubular_daylight_diffuser_cost_m2,
181
- total_building_construction_set_cost,
182
- runner = nil)
183
-
184
- unless default_construction_set_name.nil? or library_file_path.nil?
185
-
186
- # #Remove all existing constructions from model.
187
- BTAP::Resources::Envelope::remove_all_envelope_information( model )
188
-
189
- # #Load Contruction osm library.
190
- construction_lib = BTAP::FileIO::load_osm("#{library_file_path}")
191
-
192
- #Get construction set.. I/O expensive so doing it here.
193
- vintage_construction_set = construction_lib.getDefaultConstructionSetByName(default_construction_set_name)
194
- if vintage_construction_set.empty?
195
- #log change
196
- message = "Could not load contructions #{default_construction_set_name} from #{library_file_path} "
197
- runner.nil? ? puts(message) : runner.registerError(message)
198
- return false
199
- else
200
- vintage_construction_set = construction_lib.getDefaultConstructionSetByName(default_construction_set_name).get
201
- end
202
-
203
- new_construction_set =vintage_construction_set.clone(model).to_DefaultConstructionSet.get
204
- #Set conductances to needed values in construction set if possible.
205
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
206
- model: model,
207
- name: "#{default_construction_set_name}-modified",
208
- default_surface_construction_set: new_construction_set,
209
- ext_wall_rsi: ext_wall_rsi, ext_floor_rsi: ext_floor_rsi, ext_roof_rsi: ext_roof_rsi,
210
- ground_wall_rsi: ground_wall_rsi, ground_floor_rsi: ground_floor_rsi, ground_roof_rsi: ground_roof_rsi,
211
- fixed_window_rsi: fixed_window_rsi, fixed_wind_solar_trans: fixed_wind_solar_trans, fixed_wind_vis_trans: fixed_wind_vis_trans,
212
- operable_window_rsi: operable_window_rsi, operable_wind_solar_trans: operable_wind_solar_trans, operable_wind_vis_trans: operable_wind_vis_trans,
213
- door_construction_rsi: door_construction_rsi,
214
- glass_door_rsi: glass_door_rsi, glass_door_solar_trans: glass_door_solar_trans, glass_door_vis_trans: glass_door_vis_trans,
215
- overhead_door_rsi: overhead_door_rsi,
216
- skylight_rsi: skylight_rsi, skylight_solar_trans: skylight_solar_trans, skylight_vis_trans: skylight_vis_trans,
217
- tubular_daylight_dome_rsi: tubular_daylight_dome_rsi, tubular_daylight_dome_solar_trans: tubular_daylight_dome_solar_trans, tubular_daylight_dome_vis_trans: tubular_daylight_dome_vis_trans,
218
- tubular_daylight_diffuser_rsi: tubular_daylight_diffuser_rsi, tubular_daylight_diffuser_solar_trans: tubular_daylight_diffuser_solar_trans, tubular_daylight_diffuser_vis_trans: tubular_daylight_diffuser_vis_trans
219
- )
220
-
221
-
222
- #Set as default to model.
223
- model.building.get.setDefaultConstructionSet( new_construction_set )
224
-
225
- #Set cost information.
226
- BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_costs(new_construction_set,
227
- ext_wall_cost_m2,
228
- ext_floor_cost_m2,
229
- ext_roof_cost_m2,
230
- ground_wall_cost_m2,
231
- ground_floor_cost_m2,
232
- ground_roof_cost_m2,
233
- fixed_window_cost_m2,
234
- operable_window_cost_m2,
235
- door_construction_cost_m2,
236
- glass_door_cost_m2,
237
- overhead_door_cost_m2,
238
- skylight_cost_m2,
239
- tubular_daylight_dome_cost_m2,
240
- tubular_daylight_diffuser_cost_m2,
241
- total_building_construction_set_cost
242
- )
243
- #Give adiabatic surfaces a construction. Does not matter what. This is a bug in OpenStudio that leave these surfaces unassigned by the default construction set.
244
- all_adiabatic_surfaces = BTAP::Geometry::Surfaces::filter_by_boundary_condition(model.getSurfaces, "Adiabatic")
245
- unless all_adiabatic_surfaces.empty?
246
- BTAP::Geometry::Surfaces::set_surfaces_construction( all_adiabatic_surfaces, model.building.get.defaultConstructionSet.get.defaultInteriorSurfaceConstructions.get.wallConstruction.get)
247
- end
248
- #log change
249
- message = "Changed Contructions : #{BTAP::Resources::Envelope::ConstructionSets::get_construction_set_info( new_construction_set )}"
250
- runner.nil? ? puts(message) : runner.registerInfo(message)
251
- return true
252
- else
253
- #log change
254
- message = "Could not load contructions #{default_construction_set_name} from #{library_file_path} "
255
- runner.nil? ? puts(message) : runner.registerError(message)
256
- return false
257
- end
258
- end
259
-
260
- #This method will set the ecm infiltration.
261
- #@author phylroy.lopez@nrcan.gc.ca
262
- #@param model [OpenStudio::model::Model] A model object
263
- #@param infiltration_design_flow_rate [Float]
264
- #@param infiltration_flow_per_space [Float]
265
- #@param infiltration_flow_per_exterior_area [Float]
266
- #@param infiltration_air_changes_per_hour [Float]
267
- #@param cost_per_building [Float]
268
- #@param cost_per_exterior_area_m2 [Float]
269
- #@param runner [Float]
270
- #@return [Boolean]
271
- def ecm_infiltration( model,
272
- infiltration_design_flow_rate,
273
- infiltration_flow_per_space,
274
- infiltration_flow_per_exterior_area,
275
- infiltration_air_changes_per_hour,
276
- cost_per_building,
277
- cost_per_exterior_area_m2,
278
- runner = nil
279
- )
280
- default_surface_construction_set = model.building.get.defaultConstructionSet.get
281
- log = BTAP::Resources::SpaceLoads::ScaleLoads::set_inflitration_magnitude(
282
- model,
283
- infiltration_design_flow_rate,
284
- infiltration_flow_per_space,
285
- infiltration_flow_per_exterior_area,
286
- infiltration_air_changes_per_hour
287
- )
288
- #log change
289
- message = log
290
- runner.nil? ? puts(message) : runner.registerinfo(message)
291
- #set costs based on all external surface type constructions.
292
- constructions_and_cost = [
293
- ["infiltration_ext_wall_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.wallConstruction.get],
294
- ["infiltration_ext_floor_cost_m3", cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.floorConstruction.get],
295
- ["infiltration_ext_roof_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.roofCeilingConstruction.get],
296
- ["infiltration_fixed_window_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.fixedWindowConstruction.get],
297
- ["infiltration_operable_window_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.operableWindowConstruction.get],
298
- ["infiltration_door_construction_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.doorConstruction.get],
299
- ["infiltration_glass_door_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.glassDoorConstruction.get],
300
- ["infiltration_overhead_door_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.overheadDoorConstruction.get],
301
- ["infiltration_skylight_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.skylightConstruction.get],
302
- ["infiltration_tubular_daylight_dome_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDomeConstruction.get],
303
- ["infiltration_tubular_daylight_diffuser_cost_m3" ,cost_per_exterior_area_m2 , default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDiffuserConstruction.get]
304
- ]
305
- #Assign cost to each construction.
306
- constructions_and_cost.each do |item|
307
- unless item[1].nil?
308
- item[2].removeLifeCycleCosts()
309
- raise("Could not remove LCC info from construction #{item[2]}") unless item[2].lifeCycleCosts.size == 0
310
- construction_cost_object = OpenStudio::Model::LifeCycleCost.new(item[2])
311
- construction_cost_object.setName(item[0])
312
- construction_cost_object.setCost(item[1])
313
- construction_cost_object.setCostUnits("CostPerArea")
314
- end
315
- end
316
- #create building total construction cost if needed.
317
- building = default_surface_construction_set.model.building.get
318
- BTAP::Resources::Economics::object_cost(building, "Infiltration Cost per building.", cost_per_building, "CostPerEach")
319
- return true
320
- end
321
-
322
- #This method will set the ecm fans.
323
- #@author phylroy.lopez@nrcan.gc.ca
324
- #@param model [OpenStudio::model::Model] A model object
325
- #@return [String] log
326
- def ecm_fans( model )
327
- measure_values =
328
- [
329
- "fan_total_eff",
330
- "fan_motor_eff",
331
- "fan_volume_type"
332
- ]
333
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
334
- self.set_instance_variables(measure_values)
335
- log = ""
336
- unless model.getFanVariableVolumes.empty?
337
- log = "fan_variable_volume_name,fan_total_eff,fan_motor_eff\n"
338
- model.getFanVariableVolumes.sort.each do |fan|
339
- fan.setFanEfficiency( @fan_total_eff ) unless @fan_total_eff.nil?
340
- fan.setMotorEfficiency( @fan_motor_eff ) unless @fan_motor_eff.nil?
341
- log << fan.name.get.to_s << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
342
- end
343
- end
344
-
345
- unless model.getFanConstantVolumes.empty?
346
- log = "fan_constant_volume_name,fan_total_eff,fan_motor_eff\n"
347
- model.getFanConstantVolumes.sort.each do |fan|
348
- fan.setFanEfficiency( @fan_total_eff ) unless @fan_total_eff.nil?
349
- fan.setMotorEfficiency( @fan_motor_eff ) unless @fan_motor_eff.nil?
350
- log << fan.name.get.to_s << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
351
- end
352
-
353
- end
354
-
355
- case @fan_volume_type
356
-
357
- when "VariableVolume"
358
- model.getFanConstantVolumes.sort.each do |fan_const|
359
- #check that this is indeed connected to an airloop.
360
- log << "Found Const Vol Fan #{fan_const.name.get.to_s}"
361
- unless fan_const.loop.empty?
362
- fan_variable = OpenStudio::Model::FanVariableVolume.new(model,fan_const.availabilitySchedule)
363
- #pass information from old fan as much as possible.
364
- fan_variable.setFanEfficiency(fan_const.fanEfficiency)
365
- fan_variable.setPressureRise( fan_const.pressureRise() )
366
- fan_variable.autosizeMaximumFlowRate
367
- fan_variable.setFanPowerMinimumFlowRateInputMethod("FixedFlowRate")
368
- fan_variable.setFanPowerMinimumFlowFraction(0.25)
369
- fan_variable.setMotorInAirstreamFraction( fan_const.motorInAirstreamFraction() )
370
- fan_variable.setFanPowerCoefficient1(0.35071223)
371
- fan_variable.setFanPowerCoefficient2(0.30850535)
372
- fan_variable.setFanPowerCoefficient3(-0.54137364)
373
- fan_variable.setFanPowerCoefficient4(0.87198823)
374
-
375
- #get the airloop.
376
- air_loop = fan_const.loop.get
377
- #add the FanVariableVolume
378
- fan_variable.addToNode(air_loop.supplyOutletNode())
379
- #Remove FanConstantVolume
380
- fan_const.remove()
381
- log << "Replaced by Variable Vol Fan #{fan_variable.name.get.to_s}"
382
- end
383
- end
384
- when "ConstantVolume"
385
- model.getFanVariableVolumes.sort.each do |fan|
386
- #check that this is indeed connected to an airloop.
387
- log << "Found Const Vol Fan #{fan.name.get.to_s}"
388
- unless fan.loop.empty?
389
- new_fan = OpenStudio::Model::FanConstantVolume.new(model,fan.availabilitySchedule)
390
- #pass information from constant speed fan as much as possible.
391
- new_fan.setFanEfficiency(fan.fanEfficiency)
392
- new_fan.setPressureRise( fan.pressureRise() )
393
- new_fan.setMotorEfficiency(fan.motorEfficiency)
394
- new_fan.setMotorInAirstreamFraction( fan.motorInAirstreamFraction() )
395
- new_fan.autosizeMaximumFlowRate
396
- #get the airloop.
397
- air_loop = fan.loop.get
398
- #add the FanVariableVolume
399
- new_fan.addToNode(air_loop.supplyOutletNode())
400
- #Remove FanConstantVolume
401
- fan.remove()
402
- log << "Replaced by Constant Vol Fan #{new_fan.name.get.to_s}"
403
- end
404
- end
405
- when nil
406
- log << "No changes to Fan."
407
- else
408
- raise("fan_volume_type should be ConstantVolume or VariableVolume")
409
- end
410
- return log
411
- end
412
-
413
-
414
- #This method will set the ecm pumps.
415
- #@author phylroy.lopez@nrcan.gc.ca
416
- #@param model [OpenStudio::model::Model] A model object
417
- #@return [String] log
418
- def ecm_pumps( model )
419
- measure_values =
420
- [
421
- "pump_motor_eff",
422
- "pump_control_type",
423
- "pump_speed_type"
424
- ]
425
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
426
- self.set_instance_variables(measure_values)
427
- log = ""
428
- unless model.getPumpVariableSpeeds.empty?
429
- log = "pump_variable_speed_name,@pump_motor_eff\n"
430
- model.getPumpVariableSpeeds.sort.each do |pump|
431
- pump.setMotorEfficiency( @pump_motor_eff.to_f ) unless @pump_motor_eff.nil?
432
- pump.setPumpControlType( @pump_control_type ) unless @pump_control_type.nil?
433
- log << pump.name.get.to_s << ",#{pump.motorEfficiency}\n"
434
- end
435
- end
436
- unless model.getPumpConstantSpeeds.empty?
437
- log << "pump_variable_speed_name,@pump_motor_eff\n"
438
- model.getPumpConstantSpeeds.sort.each do |pump|
439
- pump.setMotorEfficiency( @pump_motor_eff.to_f ) unless @pump_motor_eff.nil?
440
- pump.setPumpControlType( @pump_control_type ) unless @pump_control_type.nil?
441
- log << pump.name.get.to_s << ",#{pump.motorEfficiency}\n"
442
- end
443
- end
444
-
445
- #set pump speed type based on existing pump.
446
- case @pump_speed_type
447
- when "VariableSpeed"
448
- model.getPumpConstantSpeeds.sort.each do |pump_const|
449
- log << "Found Const Vol Fan #{pump_const.name.get.to_s}"
450
- #check that this is indeed connected to an plant loop.
451
- unless pump_const.plantLoop.empty?
452
- pump_variable = OpenStudio::Model::PumpVariableSpeed.new(model)
453
- #pass information from constant speed fan as much as possible.
454
- pump_variable.setRatedFlowRate(pump_const.ratedFlowRate.get)
455
- pump_variable.setRatedPumpHead(pump_const.ratedPumpHead)
456
- pump_variable.setRatedPowerConsumption(pump_const.ratedPowerConsumption.to_f)
457
- pump_variable.setMotorEfficiency(pump_const.motorEfficiency.to_f)
458
- pump_variable.setPumpControlType(pump_const.pumpControlType)
459
- pump_variable.setFractionofMotorInefficienciestoFluidStream(pump_const.fractionofMotorInefficienciestoFluidStream.to_f)
460
- pump_variable.autosizeRatedFlowRate if pump_const.isRatedFlowRateAutosized
461
- pump_variable.autosizeRatedPowerConsumption if pump_const.isRatedPowerConsumptionAutosized
462
-
463
- #get the hot water loop.
464
- hw_loop = pump_const.plantLoop.get
465
- #Remove PumpConstantSpeed
466
- pump_const.remove()
467
- #add
468
- pump_variable.addToNode(hw_loop.supplyInletNode)
469
- log << "Replaced by Variable Vol Pump #{pump_variable.name.get.to_s}"
470
- end
471
- end #end loop PumpConstantSpeeds
472
- when "ConstantSpeed"
473
- model.getPumpVariableSpeeds.sort.each do |pump|
474
- log << "Found Variable Speed Pump #{pump.name.get.to_s}"
475
- #check that this is indeed connected to an plant loop.
476
- unless pump.plantLoop.empty?
477
- new_pump = OpenStudio::Model::PumpVariableSpeed.new(model)
478
- #pass information from constant speed fan as much as possible.
479
-
480
- new_pump.setRatedFlowRate(pump.ratedFlowRate.get)
481
- new_pump.setRatedPumpHead(pump.ratedPumpHead)
482
- new_pump.setRatedPowerConsumption(pump.ratedPowerConsumption.to_f)
483
- new_pump.setMotorEfficiency(pump.motorEfficiency.to_f)
484
- new_pump.setFractionofMotorInefficienciestoFluidStream(pump.fractionofMotorInefficienciestoFluidStream.to_f)
485
- new_pump.setPumpControlType(pump.pumpControlType)
486
- new_pump.autosizeRatedFlowRate if pump.isRatedFlowRateAutosized
487
- new_pump.autosizeRatedPowerConsumption if pump.isRatedPowerConsumptionAutosized
488
- #get the hot water loop.
489
- hw_loop = pump.plantLoop.get
490
- #Remove PumpVariableSpeed
491
- pump.remove()
492
- #add the pump to loop.
493
- new_pump.addToNode(hw_loop.supplyInletNode)
494
-
495
- log << "Replaced by constant speed Pump #{new_pump.name.get.to_s}"
496
- end
497
- end #end loop Pump variable Speeds
498
- when nil
499
- log << "No changes"
500
- else
501
- raise( "pump_speed_type field is not ConstantSpeed or VariableSpeed" )
502
- end
503
-
504
- #Create sample csv file.
505
- CSV.open("#{@script_root_folder_path}/sample_pump_eff_ecm.csv", 'w') { |csv| csv << measure_values.unshift("measure_id") }
506
- return log
507
- end
508
-
509
- #This method will set the ecm cooling COP.
510
- #@author phylroy.lopez@nrcan.gc.ca
511
- #@param model [OpenStudio::model::Model] A model object
512
- def ecm_cooling_cop( model )
513
- log = ""
514
- measure_values =[
515
- "cop"
516
- ]
517
-
518
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
519
- self.set_instance_variables(measure_values)
520
-
521
- unless model.getCoilCoolingDXSingleSpeeds.empty?
522
- log = "coil_cooling_dx_single_speed_name,cop\n"
523
- model.getCoilCoolingDXSingleSpeeds.sort.each do |cooling_coil|
524
- cooling_coil.setRatedCOP( OpenStudio::OptionalDouble.new( @cop ) ) unless @cop.nil?
525
- cop = "NA"
526
- # Prior to 3.5.0, it was an optional double, now it's a double
527
- cop_ = OpenStudio::OptionalDouble.new(cooling_coil.ratedCOP)
528
- cop = cop_.get unless cop_.empty?
529
- log << cooling_coil.name.get.to_s << ",#{cop}\n"
530
-
531
- end
532
- end
533
-
534
- unless model.getCoilCoolingDXTwoSpeeds.empty?
535
- log << "coil_cooling_dx_two_speed_name,cop\n"
536
- model.getCoilCoolingDXTwoSpeeds.sort.each do |cooling_coil|
537
- cooling_coil.setRatedHighSpeedCOP( @cop ) unless @cop.nil?
538
- cooling_coil.setRatedLowSpeedCOP( @cop ) unless @cop.nil?
539
- cop_high = "NA"
540
- # Prior to 3.5.0, it was an optional double, now it's a double
541
- cop_ = OpenStudio::OptionalDouble.new(cooling_coil.ratedHighSpeedCOP)
542
- cop_high = cop_.get unless cop_.empty?
543
- cop_low = "NA"
544
- cop_ = OpenStudio::OptionalDouble.new(cooling_coil.ratedLowSpeedCOP)
545
- cop_low = cop_.get unless cop_.empty?
546
- log << cooling_coil.name.get.to_s << ",#{cop_high},#{cop_low}\n"
547
- end
548
- end
549
- return log
550
- end
551
-
552
- #This method will set the ecm economizers.
553
- #@author phylroy.lopez@nrcan.gc.ca
554
- #@param model [OpenStudio::model::Model] A model object
555
- #@return [String] log
556
- def ecm_economizers( model )
557
-
558
- measure_values =[
559
- "economizer_control_type",
560
- "economizer_control_action_type",
561
- "economizer_maximum_limit_dry_bulb_temperature",
562
- "economizer_maximum_limit_enthalpy",
563
- "economizer_maximum_limit_dewpoint_temperature",
564
- "economizer_minimum_limit_dry_bulb_temperature" ]
565
-
566
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
567
- self.set_instance_variables(measure_values)
568
- log = ""
569
- unless @economizer_control_type.nil?
570
- log << BTAP::Resources::HVAC::enable_economizer(
571
- model,
572
- @economizer_control_type,
573
- @economizer_control_action_type,
574
- @economizer_maximum_limit_dry_bulb_temperature,
575
- @economizer_maximum_limit_enthalpy,
576
- @economizer_maximum_limit_dewpoint_temperature,
577
- @economizer_minimum_limit_dry_bulb_temperature
578
- )
579
-
580
- end
581
- return log
582
- end
583
- #This method will set the ecm sizing.
584
- #@author phylroy.lopez@nrcan.gc.ca
585
- #@param model [OpenStudio::model::Model] A model object
586
- #@return [String] table
587
- def ecm_sizing( model)
588
- measure_values =[
589
- "heating_sizing_factor",
590
- "cooling_sizing_factor",
591
- "zone_heating_sizing_factor",
592
- "zone_cooling_sizing_factor"
593
- ]
594
-
595
- table = "*Sizing Factor Measure*"
596
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
597
- self.set_instance_variables(measure_values)
598
- table = "handle,heating_sizing_factor,cooling_sizing_factor\n"
599
- #Sizing Parameters
600
-
601
- model.getSizingParameters.setHeatingSizingFactor(@heating_sizing_factor) unless @heating_sizing_factor.nil?
602
- model.getSizingParameters.setCoolingSizingFactor(@cooling_sizing_factor) unless @cooling_sizing_factor.nil?
603
-
604
-
605
- #SizingZone
606
- table << "handle,zone_heating_sizing_factor,zone_cooling_sizing_factor\n"
607
- model.getSizingZones.sort.each do |item|
608
- item.setZoneHeatingSizingFactor(@zone_heating_sizing_factor) unless @zone_heating_sizing_factor.nil?
609
- item.setZoneCoolingSizingFactor(@zone_cooling_sizing_factor) unless @zone_cooling_sizing_factor.nil?
610
- table << "#{item.handle},#{item.zoneHeatingSizingFactor.get},#{item.zoneCoolingSizingFactor.get}\n"
611
- end
612
- #Create sample csv file.
613
- CSV.open("#{@script_root_folder_path}/sample_sizing_param_ecm.csv", 'w') { |csv| csv << measure_values.unshift("measure_id") }
614
- return table
615
- end
616
-
617
- #This method will set the ecm domestic hot water.
618
- #@author phylroy.lopez@nrcan.gc.ca
619
- #@param model [OpenStudio::model::Model] A model object
620
- #@return [String] log
621
- def ecm_dhw( model )
622
- log = "shw_setpoint_sched,shw_heater_fuel_type,shw_thermal_eff\n"
623
- measure_values =[
624
- "shw_setpoint_sched_name",
625
- "shw_heater_fuel_type",
626
- "shw_thermal_eff"
627
- ]
628
- log = "*SHW Measures*\n"
629
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
630
- self.set_instance_variables(measure_values)
631
-
632
- #Create Schedule
633
- #schedule = BTAP::Resources::Schedules::create_annual_ruleset_schedule_detailed_json(model, @shw_setpoint_sched) unless @shw_setpoint_sched_name.nil? or @shw_setpoint_sched.nil?
634
-
635
- #iterate through water heaters.
636
- model.getWaterHeaterMixeds.sort.each do |item|
637
- unless @shw_setpoint_sched_name.nil? or @shw_setpoint_sched.nil?
638
- item.setSetpointTemperatureSchedule(schedule)
639
- end
640
- item.setHeaterFuelType(@shw_heater_fuel_type) unless @shw_heater_fuel_type.nil?
641
- item.setHeaterThermalEfficiency(@shw_thermal_eff) unless @shw_thermal_eff.nil?
642
- log << item.name.get.to_s << ",#{item.setpointTemperatureSchedule},#{item.heaterFuelType},#{item.heaterThermalEfficiency}\n"
643
- end
644
- return log
645
- end
646
-
647
- #This method will set the ecm chotwater boilers.
648
- #@author phylroy.lopez@nrcan.gc.ca
649
- #@param model [OpenStudio::model::Model] A model object
650
- #@return [String] table
651
- def ecm_hotwater_boilers( model )
652
- measure_values = [
653
- "hw_boiler_design_water_outlet_temperature",
654
- "hw_boiler_fuel_type",
655
- "hw_boiler_thermal_eff",
656
- "hw_boiler_curve",
657
- "hw_boiler_flow_mode",#
658
- "hw_boiler_eff_curve_temp_eval_var",#
659
- "hw_boiler_reset_highsupplytemp" ,
660
- "hw_boiler_reset_outsidehighsupplytemp" ,
661
- "hw_boiler_reset_lowsupplytemp" ,
662
- "hw_boiler_reset_outsidelowsupplytemp" ,
663
- ]
664
-
665
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
666
- self.set_instance_variables(measure_values)
667
- table = "name,boiler_design_water_outlet_temperature,boiler_fuel_type,boiler_thermal_eff\n"
668
-
669
- model.getPlantLoops.sort.each do |iplantloop|
670
- iplantloop.components.each do |icomponent|
671
- if icomponent.to_BoilerHotWater.is_initialized
672
- boiler = icomponent.to_BoilerHotWater.get
673
-
674
- #set design outlet temp
675
- if model.version < OpenStudio::VersionString.new('3.0.0')
676
- boiler.setDesignWaterOutletTemperature(@hw_boiler_design_water_outlet_temperature) unless @hw_boiler_design_water_outlet_temperature.nil?
677
- end
678
- #set fuel type
679
- boiler.setFuelType(@hw_boiler_fuel_type) unless @hw_boiler_fuel_type.nil?
680
- #set thermal eff
681
- boiler.setNominalThermalEfficiency(@hw_boiler_thermal_eff) unless @hw_boiler_thermal_eff.nil?
682
- #set boiler flow mode
683
- unless @hw_boiler_flow_mode.nil?
684
- ["ConstantFlow","LeavingSetpointModulated","NotModulated"].include?(@hw_boiler_flow_mode) ? boiler.setBoilerFlowMode(@hw_boiler_flow_mode) : raise("Boiler flow mode #{@hw_boiler_flow_mode} invalid.")
685
- end
686
- #set setDesignWaterOutletTemperature
687
- if model.version < OpenStudio::VersionString.new('3.0.0')
688
- boiler.setDesignWaterOutletTemperature(@hotwaterboiler_reset_highsupplytemp) unless @hotwaterboiler_reset_highsupplytemp.nil?
689
- end
690
- #set EfficiencyCurveTemperatureEvaluationVariable
691
- unless @hw_boiler_eff_curve_temp_eval_var.nil?
692
- ["LeavingBoiler","EnteringBoiler"].include?(@hw_boiler_eff_curve_temp_eval_var) ? boiler.setEfficiencyCurveTemperatureEvaluationVariable(@hw_boiler_eff_curve_temp_eval_var) : raise("EfficiencyCurveTemperatureEvaluationVariable #{@hw_boiler_eff_curve_temp_eval_var} invalid.")
693
- end
694
-
695
-
696
- #Set boiler curve
697
- curve = boiler.normalizedBoilerEfficiencyCurve
698
- if not @hw_boiler_curve.nil? and curve.is_initialized and curve.get.to_CurveBiquadratic.is_initialized
699
- case @hw_boiler_curve.downcase
700
- when "atmospheric"
701
- biqcurve = curve.get.to_CurveBiquadratic.get
702
- biqcurve.setCoefficient1Constant(1.057059)
703
- biqcurve.setCoefficient1Constant(1.057059)
704
- biqcurve.setCoefficient2x(-0.0774177)
705
- biqcurve.setCoefficient3xPOW2(0.07875142)
706
- biqcurve.setCoefficient4y(0.0003943856)
707
- biqcurve.setCoefficient5yPOW2(-0.000004074629)
708
- biqcurve.setCoefficient6xTIMESY(-0.002202606)
709
- biqcurve.setMinimumValueofx(0.3)
710
- biqcurve.setMaximumValueofx(1.0)
711
- biqcurve.setMinimumValueofy(40.0)
712
- biqcurve.setMaximumValueofy(90.0)
713
- biqcurve.setMinimumCurveOutput(0.0)
714
- biqcurve.setMaximumCurveOutput(1.1)
715
- biqcurve.setInputUnitTypeforX("Dimensionless")
716
- biqcurve.setInputUnitTypeforY("Temperature")
717
- biqcurve.setOutputUnitType("Dimensionless")
718
- when "condensing"
719
- biqcurve = curve.get.to_CurveBiquadratic.get
720
- biqcurve.setCoefficient1Constant(0.4873)
721
- biqcurve.setCoefficient2x(1.1322)
722
- biqcurve.setCoefficient3xPOW2(-0.6425)
723
- biqcurve.setCoefficient4y(0.0)
724
- biqcurve.setCoefficient5yPOW2(0.0)
725
- biqcurve.setCoefficient6xTIMESY(0.0)
726
- biqcurve.setMinimumValueofx(0.1)
727
- biqcurve.setMaximumValueofx(1.0)
728
- biqcurve.setMinimumValueofy(0.0)
729
- biqcurve.setMaximumValueofy(0.0)
730
- biqcurve.setMinimumCurveOutput(0.0)
731
- biqcurve.setMaximumCurveOutput(1.0)
732
- biqcurve.setInputUnitTypeforX("Dimensionless")
733
- biqcurve.setInputUnitTypeforY("Temperature")
734
- biqcurve.setOutputUnitType("Dimensionless")
735
- else
736
- raise("#{@hotwaterboiler_curve} is not a valid boiler curve name (condensing_boiler_curve,atmospheric_boiler_curve")
737
- end
738
- end
739
-
740
- #boiler reset setpoint manager
741
- unless @hotwaterboiler_reset_lowsupplytemp.nil? and @hotwaterboiler_reset_outsidelowsupplytemp.nil? and @hotwaterboiler_reset_highsupplytemp.nil? and @hotwaterboiler_reset_outsidehighsupplytemp.nil?
742
- #check if setpoint manager is present at supply outlet
743
- #Find any setpoint manager if it exists and outlet node and remove it.
744
- iplantloop.supplyOutletNode.setpointManagers.each {|sm| sm.disconnect}
745
-
746
- #Add new setpoint manager
747
- oar_stpt_manager = OpenStudio::Model::SetpointManagerOutdoorAirReset.new(model)
748
- oar_stpt_manager.addToNode(iplantloop.supplyOutletNode)
749
- oar_stpt_manager.setSetpointatOutdoorHighTemperature(@hw_boiler_reset_lowsupplytemp) unless @hw_boiler_reset_lowsupplytemp.nil?
750
- oar_stpt_manager.setOutdoorHighTemperature(@hotwaterboiler_reset_outsidelowsupplytemp) unless @hw_boiler_reset_outsidelowsupplytemp.nil?
751
- oar_stpt_manager.setSetpointatOutdoorLowTemperature(@hw_boiler_reset_highsupplytemp) unless @hw_boiler_reset_highsupplytemp.nil?
752
- oar_stpt_manager.setOutdoorLowTemperature(@hw_boiler_reset_outsidehighsupplytemp) unless @hw_boiler_reset_outsidehighsupplytemp.nil?
753
- end
754
- table << boiler.name.get.to_s << ","
755
- boiler.designWaterOutletTemperature.empty? ? dowt = "NA" : dowt = boiler.designWaterOutletTemperature.get
756
- table << "#{dowt},#{boiler.fuelType},#{boiler.nominalThermalEfficiency}\n"
757
- end
758
- end
759
- end #end boilers loop
760
- return table
761
- end
762
-
763
- #This method will set the ecm dcv.
764
- #@author phylroy.lopez@nrcan.gc.ca
765
- #@param model [OpenStudio::model::Model] A model object
766
- #@return [String] log
767
- def ecm_dcv( model )
768
- log = ""
769
- measure_values =[
770
- "dcv_enabled"
771
- ]
772
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
773
- self.set_instance_variables(measure_values)
774
- unless @dcv_enabled.nil?
775
- log = BTAP::Resources::HVAC::enable_demand_control_ventilation(model,@dcv_enabled.to_bool)
776
- end
777
- return log
778
- end
779
-
780
- #This method will set the ecm heating and cooling setpoints.
781
- #@author phylroy.lopez@nrcan.gc.ca
782
- #@param model [OpenStudio::model::Model] A model object
783
- #@return [String] log
784
- def ecm_heating_cooling_setpoints(model)
785
-
786
- log = ""
787
- measure_values =[
788
- "library_file",
789
- "heating_schedule_name",
790
- "cooling_schedule_name"
791
- ]
792
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
793
- self.set_instance_variables(measure_values)
794
-
795
- library_file = @library_file
796
- heating_schedule_name = @heating_schedule_name
797
- cooling_schedule_name = @cooling_schedule_name
798
-
799
- unless @heating_schedule_name.nil? and @cooling_schedule_name.nil?
800
- #Load Contruction osm library.
801
- lib = BTAP::FileIO::load_osm("#{@script_root_folder_path}/#{library_file}")
802
-
803
- unless heating_schedule_name.nil?
804
- #Get heating schedule from library and clone it.
805
- heating_schedule = lib.getScheduleRulesetByName(heating_schedule_name)
806
- if heating_schedule.empty?
807
- raise("#{heating_schedule_name} does not exist in #{library_file} library ")
808
- else
809
- heating_schedule = lib.getScheduleRulesetByName(heating_schedule_name).get.clone(model).to_ScheduleRuleset.get
810
- end
811
- end
812
-
813
- unless cooling_schedule_name.nil?
814
- #Get cooling schedule from library and clone it.
815
- cooling_schedule = lib.getScheduleRulesetByName(cooling_schedule_name)
816
- if cooling_schedule.empty?
817
- raise("#{cooling_schedule_name} does not exist in #{library_file} library ")
818
- else
819
- cooling_schedule = lib.getScheduleRulesetByName(cooling_schedule_name).get.clone(model).to_ScheduleRuleset.get
820
- end
821
- end
822
- model.getThermostatSetpointDualSetpoints.sort.each do |dual_setpoint|
823
- unless heating_schedule_name.nil?
824
- raise ("Could not set heating Schedule") unless dual_setpoint.setHeatingSetpointTemperatureSchedule(heating_schedule)
825
- end
826
- unless cooling_schedule_name.nil?
827
- raise ("Could not set cooling Schedule") unless dual_setpoint.setCoolingSetpointTemperatureSchedule(cooling_schedule)
828
- end
829
- end
830
- end
831
- return log
832
- end
833
-
834
- #This method will set the ecm erv.
835
- #@author phylroy.lopez@nrcan.gc.ca
836
- #@param model [OpenStudio::model::Model] A model object
837
- #@return [String] log
838
- def ecm_erv( model )
839
- log = ""
840
- measure_values =[
841
- "erv_enabled",
842
- "erv_autosizeNominalSupplyAirFlowRate",
843
- "erv_NominalSupplyAirFlowRate",
844
- "erv_HeatExchangerType",
845
- "erv_SensibleEffectivenessat100CoolingAirFlow",
846
- "erv_SensibleEffectivenessat75CoolingAirFlow",
847
- "erv_LatentEffectiveness100Cooling",
848
- "erv_LatentEffectiveness75Cooling",
849
- "erv_SensibleEffectiveness100Heating",
850
- "erv_SensibleEffectiveness75Heating",
851
- "erv_LatentEffectiveness100Heating",
852
- "erv_LatentEffectiveness75Heating",
853
- "erv_SupplyAirOutletTemperatureControl",
854
- "erv_setFrostControlType",
855
- "erv_ThresholdTemperature",
856
- "erv_InitialDefrostTimeFraction",
857
- "erv_nominal_electric_power",
858
- "erv_economizer_lockout"
859
- ]
860
-
861
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
862
- self.set_instance_variables(measure_values)
863
-
864
-
865
- unless @erv_enabled.nil? or @erv_enabled.to_bool == false
866
- BTAP::Resources::HVAC::enable_erv(
867
- model,
868
- @erv_autosizeNominalSupplyAirFlowRate,
869
- @erv_NominalSupplyAirFlowRate,
870
- @erv_HeatExchangerType,
871
- @erv_SensibleEffectivenessat100CoolingAirFlow,
872
- @erv_SensibleEffectivenessat75CoolingAirFlow,
873
- @erv_LatentEffectiveness100Cooling,
874
- @erv_LatentEffectiveness75Cooling,
875
- @erv_SensibleEffectiveness100Heating,
876
- @erv_SensibleEffectiveness75Heating,
877
- @erv_LatentEffectiveness100Heating,
878
- @erv_LatentEffectiveness75Heating,
879
- @erv_SupplyAirOutletTemperatureControl.to_bool,
880
- @erv_setFrostControlType,
881
- @erv_ThresholdTemperature,
882
- @erv_InitialDefrostTimeFraction,
883
- @erv_nominal_electric_power,
884
- @erv_economizer_lockout.to_bool
885
- ).each { |erv| log << erv.to_s }
886
-
887
-
888
- #Add setpoint manager to all OA object in airloops.
889
- model.getHeatExchangerAirToAirSensibleAndLatents.sort.each do |erv|
890
-
891
- #needed to get the supply outlet node from the erv to place the setpoint manager.
892
- node = erv.primaryAirOutletModelObject.get.to_Node.get if erv.primaryAirOutletModelObject.is_initialized
893
- new_set_point_manager = OpenStudio::Model::SetpointManagerWarmest.new(model)
894
- raise ("Could not add setpoint manager") unless new_set_point_manager.addToNode(node)
895
- log << "added warmest control to node #{node}"
896
- new_set_point_manager.setMaximumSetpointTemperature(16.0)
897
- new_set_point_manager.setMinimumSetpointTemperature(5.0)
898
- new_set_point_manager.setStrategy("MaximumTemperature")
899
- new_set_point_manager.setControlVariable("Temperature")
900
- end
901
- log << "ERV have been modified.\n"
902
- else
903
- log << "ERV not changed."
904
- end
905
- return log
906
- end
907
-
908
- #This method will set the ecm cexhaust fans.
909
- #@author phylroy.lopez@nrcan.gc.ca
910
- #@param model [OpenStudio::model::Model] A model object
911
- #@return [String] log
912
- def ecm_exhaust_fans( model )
913
- log = ""
914
- #Exhaust ECM
915
- measure_values =[
916
- "exhaust_fans_occ_control_enabled"
917
- ]
918
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
919
- self.set_instance_variables(measure_values)
920
- unless @exhaust_fans_occ_control_enabled.nil? or @exhaust_fans_occ_control_enabled.to_bool == false
921
- fans = BTAP::Resources::Schedules::set_exhaust_fans_availability_to_building_default_occ_schedule(model)
922
- fans.each { |fan| log << fan.to_s}
923
- else
924
- log << "No changes to exhaust fans."
925
- end
926
- return log
927
- end
928
-
929
- #This method will set the ecm lighting.
930
- #@author phylroy.lopez@nrcan.gc.ca
931
- #@param model [OpenStudio::model::Model] A model object
932
- #@return [String] log
933
- def ecm_lighting( model )
934
- log = ""
935
- #Lighting ECM
936
- measure_values =[
937
- "lighting_scaling_factor",
938
- "lighting_fraction_radiant",
939
- "lighting_fraction_visible",
940
- "lighting_return_air_fraction"
941
- ]
942
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
943
- self.set_instance_variables(measure_values)
944
- BTAP::Resources::SpaceLoads::ScaleLoads::scale_lighting_loads(
945
- model,
946
- @lighting_scaling_factor ) unless @lighting_scaling_factor.nil?
947
- #Set lighting variables
948
- model.getLightsDefinitions.sort.each do |lightsdef|
949
- lightsdef.setFractionRadiant(@lighting_fraction_radiant.to_f)
950
- lightsdef.setFractionVisible(@lighting_fraction_visible.to_f)
951
- lightsdef.setReturnAirFraction(@lighting_return_air_fraction.to_f)
952
- end
953
- return log
954
- end
955
-
956
- #This method will set the ecm temperature setback.
957
- #@author phylroy.lopez@nrcan.gc.ca
958
- #@param model [OpenStudio::model::Model] A model object
959
- #@return [String] log
960
- def ecm_plugs( model )
961
- log = ""
962
- #Plug loads ECM
963
- measure_values = [
964
- "elec_equipment_scaling_factor",
965
- "elec_equipment_fraction_radiant",
966
- "elec_equipment_fraction_latent",
967
- "elec_equipment_fraction_lost"
968
- ]
969
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
970
- self.set_instance_variables(measure_values)
971
-
972
- BTAP::Resources::SpaceLoads::ScaleLoads::scale_electrical_loads(
973
- model,
974
- @elec_equipment_scaling_factor) unless @elec_equipment_scaling_factor.nil?
975
-
976
- #Set plug loads variables
977
- model.getElectricEquipmentDefinitions.sort.each do |elec_equip_def|
978
- elec_equip_def.setFractionRadiant(@elec_equipment_fraction_radiant.to_f)
979
- elec_equip_def.setFractionLatent(@elec_equipment_fraction_latent.to_f)
980
- elec_equip_def.setFractionLost(@elec_equipment_fraction_lost.to_f)
981
- end
982
-
983
- CSV.open("#{@script_root_folder_path}/sample_scale_plug_loads_ecm.csv", 'w') { |csv| csv << measure_values.unshift("measure_id") }
984
- return log
985
- end
986
-
987
- #This method will set the ecm cold deck reset control.
988
- #@author phylroy.lopez@nrcan.gc.ca
989
- #@param model [OpenStudio::model::Model] A model object
990
- #@return [String] log
991
- def ecm_cold_deck_reset_control( model )
992
- log = ""
993
- measure_values = [
994
- "cold_deck_reset_enabled",
995
- "cold_deck_reset_max_supply_air_temp",
996
- "cold_deck_reset_min_supply_air_temp",
997
- ]
998
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
999
- self.set_instance_variables(measure_values)
1000
-
1001
- if @cold_deck_reset_enabled.to_bool == true
1002
-
1003
- model.getAirLoopHVACs.sort.each do |iairloop|
1004
- cooling_present = false
1005
- set_point_manager = nil
1006
- iairloop.components.each do |icomponent|
1007
- if icomponent.to_CoilCoolingDXSingleSpeed.is_initialized or
1008
- icomponent.to_CoilCoolingDXTwoSpeed.is_initialized or
1009
- icomponent.to_CoilCoolingWater.is_initialized or
1010
- icomponent.to_CoilCoolingCooledBeam.is_initialized or
1011
- icomponent.to_CoilCoolingDXMultiSpeed.is_initialized or
1012
- icomponent.to_CoilCoolingDXVariableRefrigerantFlow.is_initialized or
1013
- icomponent.to_CoilCoolingLowTempRadiantConstFlow.is_initialized or
1014
- icomponent.to_CoilCoolingLowTempRadiantVarFlow.is_initialized
1015
- cooling_present = true
1016
- log << "found cooling."
1017
- end
1018
- end
1019
- #check if setpoint manager is present at supply outlet.
1020
- model.getSetpointManagerSingleZoneReheats.sort.each do |manager|
1021
- if iairloop.supplyOutletNode == manager.setpointNode.get
1022
- set_point_manager = manager
1023
- end
1024
- end
1025
-
1026
- if set_point_manager.nil? and cooling_present == true
1027
- set_point_manager = OpenStudio::Model::SetpointManagerSingleZoneReheat.new(model)
1028
- set_point_manager.addToNode(iairloop.supplyOutletNode)
1029
- end
1030
-
1031
-
1032
-
1033
- if cooling_present == true and not set_point_manager.nil?
1034
- set_point_manager.setMaximumSupplyAirTemperature(@cold_deck_reset_max_supply_air_temp)
1035
- set_point_manager.setMinimumSupplyAirTemperature(@cold_deck_reset_min_supply_air_temp)
1036
- log << "to_SetpointManagerSingleZoneReheat set to 20.0 and 13.0"
1037
- end
1038
- end
1039
- end
1040
- return log
1041
- end
1042
-
1043
- #This method will reset the sat ecm.
1044
- #@author phylroy.lopez@nrcan.gc.ca
1045
- #@param model [OpenStudio::model::Model] A model object
1046
- #@return [String] log
1047
- def ecm_sat_reset( model )
1048
- log = ""
1049
- measure_values = [
1050
- "sat_reset_enabled",
1051
- "sat_reset_outdoor_high_temperature",
1052
- "sat_reset_outdoor_low_temperature",
1053
- "sat_reset_setpoint_at_outdoor_high_temperature",
1054
- "sat_reset_setpoint_at_outdoor_low_temperature"
1055
- ]
1056
-
1057
-
1058
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
1059
- self.set_instance_variables(measure_values)
1060
- if @sat_reset_enabled.to_bool == true
1061
- model.getAirLoopHVACs.sort.each do |iairloop|
1062
-
1063
- #check if setpoint manager is present at supply outlet
1064
- model.getSetpointManagerSingleZoneReheats.sort.each do |manager|
1065
- if iairloop.supplyOutletNode == manager.setpointNode.get
1066
- manager.disconnect
1067
- end
1068
- end
1069
-
1070
- new_set_point_manager = OpenStudio::Model::SetpointManagerOutdoorAirReset.new(model)
1071
- new_set_point_manager.addToNode(iairloop.supplyOutletNode)
1072
- new_set_point_manager.setOutdoorHighTemperature(@sat_reset_outdoor_high_temperature)
1073
- new_set_point_manager.setOutdoorLowTemperature(@sat_reset_outdoor_low_temperature)
1074
- new_set_point_manager.setSetpointatOutdoorHighTemperature(@sat_reset_setpoint_at_outdoor_high_temperature)
1075
- new_set_point_manager.setSetpointatOutdoorLowTemperature(@sat_reset_setpoint_at_outdoor_low_temperature)
1076
- new_set_point_manager.setControlVariable("Temperature")
1077
- log << "Replaced SingleZoneReheat with OA reset control."
1078
- end
1079
- end
1080
- return log
1081
- end
1082
-
1083
- #This method will set the ecm temperature setback.
1084
- #@author phylroy.lopez@nrcan.gc.ca
1085
- #@param model [OpenStudio::model::Model] A model object
1086
- #@return [String] log
1087
- def ecm_temp_setback( model )
1088
- log = ""
1089
- measure_values = [
1090
- "occ_stbck_enabled",
1091
- "occ_stbck_tolerance",
1092
- "occ_stbck_heat_setback",
1093
- "occ_stbck_heat_setpoint",
1094
- "occ_stbck_cool_setback",
1095
- "occ_stbck_cool_setpoint"
1096
- ]
1097
- #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
1098
- self.set_instance_variables(measure_values)
1099
- # get occupancy schedule if possible.
1100
- unless @occ_stbck_enabled.nil? or @occ_stbck_enabled == false
1101
- if model.building.get.defaultScheduleSet.is_initialized and
1102
- model.building.get.defaultScheduleSet.get.numberofPeopleSchedule.is_initialized and
1103
- model.building.get.defaultScheduleSet.get.numberofPeopleSchedule.get.to_ScheduleRuleset.is_initialized
1104
- occupancy_schedule = model.building.get.defaultScheduleSet.get.numberofPeopleSchedule.get
1105
- heating_schedule,cooling_schedule = BTAP::Resources::Schedules::create_setback_schedule_based_on_another_schedule(
1106
- model,
1107
- occupancy_schedule,
1108
- @occ_stbck_tolerance.to_f,
1109
- @occ_stbck_heat_setpoint.to_f,
1110
- @occ_stbck_heat_setback.to_f,
1111
- @occ_stbck_cool_setpoint.to_f,
1112
- @occ_stbck_cool_setback.to_f)
1113
- model.getThermostatSetpointDualSetpoints.sort.each do |dual_setpoint|
1114
- raise ("Could not set setback heating Schedule") unless dual_setpoint.setHeatingSetpointTemperatureSchedule(heating_schedule)
1115
- raise ("Could not set setback cooling Schedule") unless dual_setpoint.setCoolingSetpointTemperatureSchedule(cooling_schedule)
1116
- log << "modified....#{dual_setpoint}"
1117
- end
1118
- end
1119
- else
1120
- log << "no change to setbacks."
1121
- end
1122
- return log
1123
- end
1124
- end
1125
- end #module Resources
1126
- end #module BTAP
1127
-
1128
-
1129
-
1130
-
1131
- #"Construction"
1132
- # "CostPerArea"
1133
- #"Building"
1134
- # "CostPerEach"
1135
- # "CostPerArea"
1136
- # "CostPerThermalZone"
1137
- #"Space
1138
- #"CostPerEach"
1139
- #"CostPerArea"
1140
- #"ThermalZone"
1141
- #"CostPerEach"
1142
- #"CostPerArea"
1143
- #"AirLoop"
1144
- #"CostPerEach"
1145
- #"CostPerThermalZone"
1146
- #"PlantLoop"
1147
- #"CostPerEach"
1148
- #"ZoneHVAC"
1149
- #"CostPerEach"
1150
- #"Lights
1151
- # "CostPerEach"
1152
- # "CostPerArea"
1153
- #"Luminaire
1154
- #"CostPerEach"
1155
- #"Equipment
1156
- # "CostPerEach"
1157
- # "CostPerArea"
1158
- #"HVACComponent
1159
- #"CostPerEach"
1160
- #"ZoneHVACComponent
1161
- # "CostPerEach"
1162
- #All others
1163
- #"CostPerEach"
1
+ # # *********************************************************************
2
+ # # * Copyright (c) 2008-2015, Natural Resources Canada
3
+ # # * All rights reserved.
4
+ # # *
5
+ # # * This library is free software; you can redistribute it and/or
6
+ # # * modify it under the terms of the GNU Lesser General Public
7
+ # # * License as published by the Free Software Foundation; either
8
+ # # * version 2.1 of the License, or (at your option) any later version.
9
+ # # *
10
+ # # * This library is distributed in the hope that it will be useful,
11
+ # # * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # # * Lesser General Public License for more details.
14
+ # # *
15
+ # # * You should have received a copy of the GNU Lesser General Public
16
+ # # * License along with this library; if not, write to the Free Software
17
+ # # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ # # **********************************************************************/
19
+ #
20
+ #
21
+ # require "#{File.dirname(__FILE__)}/btap"
22
+ #
23
+ # module BTAP
24
+ # module Resources #Resources
25
+ # # This module contains methods that relate to Materials, Constructions and Construction Sets
26
+ # module Economics
27
+ #
28
+ # #This method removes all costs from model
29
+ # #@author phylroy.lopez@nrcan.gc.ca
30
+ # #@param model [OpenStudio::model::Model] A model object
31
+ # #@param runner [String]
32
+ # def self.remove_all_costs(model,runner = nil)
33
+ # #Remove all cost items.
34
+ # model.getLifeCycleCosts.sort.each { |cost_item| cost_item.remove }
35
+ # #log change
36
+ # message = "Removed all cost objects from model"
37
+ # runner.nil? ? puts(message) : runner.registerInfo(message)
38
+ # end
39
+ #
40
+ # #This method will add the costs.
41
+ # #@author phylroy.lopez@nrcan.gc.ca
42
+ # #@param model [OpenStudio::model::Model] A model object
43
+ # #@param name [String]
44
+ # #@param cost [Float]
45
+ # #@param unittype [String]
46
+ # #return cost_object [OpenStudio::model::Model] A model object
47
+ # def self.object_cost(model,name,cost,unittype)
48
+ # unless cost.nil? or cost == 0.0
49
+ # #add total construction cost if used in place of each construction.
50
+ # cost_object = OpenStudio::Model::LifeCycleCost.new(model)
51
+ # cost_object.setName(name)
52
+ # cost_object.setCost(cost)
53
+ # cost_object.setCostUnits(unittype)
54
+ # end
55
+ # return cost_object
56
+ # end
57
+ #
58
+ # #This method will add the cost per building.
59
+ # #@author phylroy.lopez@nrcan.gc.ca
60
+ # #@param model [OpenStudio::model::Model] A model object
61
+ # #@param name [String]
62
+ # #@param cost [Float]
63
+ # #@param runner [Float]
64
+ # def self.add_cost_per_building(model,name,cost,runner = nil)
65
+ # #cost per building and building area
66
+ # unless cost.nil? or cost == 0.0
67
+ # cost_obj = BTAP::Resources::Economics::object_cost(model.building.get,name,cost,"CostPerEach")
68
+ # #log change
69
+ # message = "Added cost of per building named: #{name} with cost/bldg = #{cost} and handle UI =#{cost_obj.handle()}"
70
+ # runner.nil? ? puts(message) : runner.registerInfo(message)
71
+ # end
72
+ # end
73
+ #
74
+ # #This method will add the cost per total area.
75
+ # #@author phylroy.lopez@nrcan.gc.ca
76
+ # #@param model [OpenStudio::model::Model] A model object
77
+ # #@param name [String]
78
+ # #@param cost [Float]
79
+ # #@param runner [Float]
80
+ # def self.add_cost_per_total_area(model,name,cost,runner = nil)
81
+ # #cost per building and building area
82
+ # unless cost.nil? or cost == 0.0
83
+ # cost_obj = BTAP::Resources::Economics::object_cost(model.building.get,name,cost,"CostPerArea")
84
+ # #log change
85
+ # message = "Added cost of per building total area named: #{name} with cost/area = #{cost} and handle UI =#{cost_obj.handle()}"
86
+ # runner.nil? ? puts(message) : runner.registerInfo(message)
87
+ # end
88
+ # end
89
+ #
90
+ # #This method will set the ecm envelope.
91
+ # #@author phylroy.lopez@nrcan.gc.ca
92
+ # #@param model [OpenStudio::model::Model] A model object
93
+ # #@param library_file_path [String]
94
+ # #@param default_construction_set_name [String]
95
+ # #@param ext_wall_rsi [Float]
96
+ # #@param ext_floor_rsi [Float]
97
+ # #@param ext_roof_rsi [Float]
98
+ # #@param ground_wall_rsi [Float]
99
+ # #@param ground_floor_rsi [Float]
100
+ # #@param ground_roof_rsi [Float]
101
+ # #@param fixed_window_rsi [Float]
102
+ # #@param fixed_wind_solar_trans [Float]
103
+ # #@param fixed_wind_vis_trans [Float]
104
+ # #@param operable_window_rsi [Float]
105
+ # #@param operable_wind_solar_trans [Float]
106
+ # #@param operable_wind_vis_trans [Float]
107
+ # #@param door_construction_rsi [Float]
108
+ # #@param glass_door_rsi [Float]
109
+ # #@param glass_door_solar_trans [Float]
110
+ # #@param glass_door_vis_trans [Float]
111
+ # #@param overhead_door_rsi [Float]
112
+ # #@param skylight_rsi [Float]
113
+ # #@param skylight_solar_trans [Float]
114
+ # #@param skylight_vis_trans [Float]
115
+ # #@param tubular_daylight_dome_rsi [Float]
116
+ # #@param tubular_daylight_dome_solar_trans [Float]
117
+ # #@param tubular_daylight_dome_vis_trans [Float]
118
+ # #@param tubular_daylight_diffuser_rsi [Float]
119
+ # #@param tubular_daylight_diffuser_solar_trans [Float]
120
+ # #@param tubular_daylight_diffuser_vis_trans [Float]
121
+ # #@param ext_wall_cost_m2 [Float]
122
+ # #@param ext_floor_cost_m2 [Float]
123
+ # #@param ext_roof_cost_m2 [Float]
124
+ # #@param ground_wall_cost_m2 [Float]
125
+ # #@param ground_floor_cost_m2 [Float]
126
+ # #@param ground_roof_cost_m2 [Float]
127
+ # #@param fixed_window_cost_m2 [Float]
128
+ # #@param operable_window_cost_m2 [Float]
129
+ # #@param door_construction_cost_m2 [Float]
130
+ # #@param glass_door_cost_m2 [Float]
131
+ # #@param overhead_door_cost_m2 [Float]
132
+ # #@param skylight_cost_m2 [Float]
133
+ # #@param tubular_daylight_dome_cost_m2 [Float]
134
+ # #@param tubular_daylight_diffuser_cost_m2 [Float]
135
+ # #@param total_building_construction_set_cost [Float]
136
+ # #@param runner [Float]
137
+ # #@return [Boolean]
138
+ # def ecm_envelope( model,
139
+ # library_file_path,
140
+ # default_construction_set_name,
141
+ # ext_wall_rsi,
142
+ # ext_floor_rsi,
143
+ # ext_roof_rsi,
144
+ # ground_wall_rsi,
145
+ # ground_floor_rsi,
146
+ # ground_roof_rsi,
147
+ # fixed_window_rsi,
148
+ # fixed_wind_solar_trans,
149
+ # fixed_wind_vis_trans,
150
+ # operable_window_rsi,
151
+ # operable_wind_solar_trans,
152
+ # operable_wind_vis_trans,
153
+ # door_construction_rsi,
154
+ # glass_door_rsi,
155
+ # glass_door_solar_trans,
156
+ # glass_door_vis_trans,
157
+ # overhead_door_rsi,
158
+ # skylight_rsi,
159
+ # skylight_solar_trans,
160
+ # skylight_vis_trans,
161
+ # tubular_daylight_dome_rsi,
162
+ # tubular_daylight_dome_solar_trans,
163
+ # tubular_daylight_dome_vis_trans,
164
+ # tubular_daylight_diffuser_rsi,
165
+ # tubular_daylight_diffuser_solar_trans,
166
+ # tubular_daylight_diffuser_vis_trans,
167
+ # ext_wall_cost_m2,
168
+ # ext_floor_cost_m2,
169
+ # ext_roof_cost_m2,
170
+ # ground_wall_cost_m2,
171
+ # ground_floor_cost_m2,
172
+ # ground_roof_cost_m2,
173
+ # fixed_window_cost_m2,
174
+ # operable_window_cost_m2,
175
+ # door_construction_cost_m2,
176
+ # glass_door_cost_m2,
177
+ # overhead_door_cost_m2,
178
+ # skylight_cost_m2,
179
+ # tubular_daylight_dome_cost_m2,
180
+ # tubular_daylight_diffuser_cost_m2,
181
+ # total_building_construction_set_cost,
182
+ # runner = nil)
183
+ #
184
+ # unless default_construction_set_name.nil? or library_file_path.nil?
185
+ #
186
+ # # #Remove all existing constructions from model.
187
+ # BTAP::Resources::Envelope::remove_all_envelope_information( model )
188
+ #
189
+ # # #Load Contruction osm library.
190
+ # construction_lib = BTAP::FileIO::load_osm("#{library_file_path}")
191
+ #
192
+ # #Get construction set.. I/O expensive so doing it here.
193
+ # vintage_construction_set = construction_lib.getDefaultConstructionSetByName(default_construction_set_name)
194
+ # if vintage_construction_set.empty?
195
+ # #log change
196
+ # message = "Could not load contructions #{default_construction_set_name} from #{library_file_path} "
197
+ # runner.nil? ? puts(message) : runner.registerError(message)
198
+ # return false
199
+ # else
200
+ # vintage_construction_set = construction_lib.getDefaultConstructionSetByName(default_construction_set_name).get
201
+ # end
202
+ #
203
+ # new_construction_set =vintage_construction_set.clone(model).to_DefaultConstructionSet.get
204
+ # #Set conductances to needed values in construction set if possible.
205
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!(
206
+ # model: model,
207
+ # name: "#{default_construction_set_name}-modified",
208
+ # default_surface_construction_set: new_construction_set,
209
+ # ext_wall_rsi: ext_wall_rsi, ext_floor_rsi: ext_floor_rsi, ext_roof_rsi: ext_roof_rsi,
210
+ # ground_wall_rsi: ground_wall_rsi, ground_floor_rsi: ground_floor_rsi, ground_roof_rsi: ground_roof_rsi,
211
+ # fixed_window_rsi: fixed_window_rsi, fixed_wind_solar_trans: fixed_wind_solar_trans, fixed_wind_vis_trans: fixed_wind_vis_trans,
212
+ # operable_window_rsi: operable_window_rsi, operable_wind_solar_trans: operable_wind_solar_trans, operable_wind_vis_trans: operable_wind_vis_trans,
213
+ # door_construction_rsi: door_construction_rsi,
214
+ # glass_door_rsi: glass_door_rsi, glass_door_solar_trans: glass_door_solar_trans, glass_door_vis_trans: glass_door_vis_trans,
215
+ # overhead_door_rsi: overhead_door_rsi,
216
+ # skylight_rsi: skylight_rsi, skylight_solar_trans: skylight_solar_trans, skylight_vis_trans: skylight_vis_trans,
217
+ # tubular_daylight_dome_rsi: tubular_daylight_dome_rsi, tubular_daylight_dome_solar_trans: tubular_daylight_dome_solar_trans, tubular_daylight_dome_vis_trans: tubular_daylight_dome_vis_trans,
218
+ # tubular_daylight_diffuser_rsi: tubular_daylight_diffuser_rsi, tubular_daylight_diffuser_solar_trans: tubular_daylight_diffuser_solar_trans, tubular_daylight_diffuser_vis_trans: tubular_daylight_diffuser_vis_trans
219
+ # )
220
+ #
221
+ #
222
+ # #Set as default to model.
223
+ # model.building.get.setDefaultConstructionSet( new_construction_set )
224
+ #
225
+ # #Set cost information.
226
+ # BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_costs(new_construction_set,
227
+ # ext_wall_cost_m2,
228
+ # ext_floor_cost_m2,
229
+ # ext_roof_cost_m2,
230
+ # ground_wall_cost_m2,
231
+ # ground_floor_cost_m2,
232
+ # ground_roof_cost_m2,
233
+ # fixed_window_cost_m2,
234
+ # operable_window_cost_m2,
235
+ # door_construction_cost_m2,
236
+ # glass_door_cost_m2,
237
+ # overhead_door_cost_m2,
238
+ # skylight_cost_m2,
239
+ # tubular_daylight_dome_cost_m2,
240
+ # tubular_daylight_diffuser_cost_m2,
241
+ # total_building_construction_set_cost
242
+ # )
243
+ # #Give adiabatic surfaces a construction. Does not matter what. This is a bug in OpenStudio that leave these surfaces unassigned by the default construction set.
244
+ # all_adiabatic_surfaces = BTAP::Geometry::Surfaces::filter_by_boundary_condition(model.getSurfaces, "Adiabatic")
245
+ # unless all_adiabatic_surfaces.empty?
246
+ # BTAP::Geometry::Surfaces::set_surfaces_construction( all_adiabatic_surfaces, model.building.get.defaultConstructionSet.get.defaultInteriorSurfaceConstructions.get.wallConstruction.get)
247
+ # end
248
+ # #log change
249
+ # message = "Changed Contructions : #{BTAP::Resources::Envelope::ConstructionSets::get_construction_set_info( new_construction_set )}"
250
+ # runner.nil? ? puts(message) : runner.registerInfo(message)
251
+ # return true
252
+ # else
253
+ # #log change
254
+ # message = "Could not load contructions #{default_construction_set_name} from #{library_file_path} "
255
+ # runner.nil? ? puts(message) : runner.registerError(message)
256
+ # return false
257
+ # end
258
+ # end
259
+ #
260
+ # #This method will set the ecm infiltration.
261
+ # #@author phylroy.lopez@nrcan.gc.ca
262
+ # #@param model [OpenStudio::model::Model] A model object
263
+ # #@param infiltration_design_flow_rate [Float]
264
+ # #@param infiltration_flow_per_space [Float]
265
+ # #@param infiltration_flow_per_exterior_area [Float]
266
+ # #@param infiltration_air_changes_per_hour [Float]
267
+ # #@param cost_per_building [Float]
268
+ # #@param cost_per_exterior_area_m2 [Float]
269
+ # #@param runner [Float]
270
+ # #@return [Boolean]
271
+ # def ecm_infiltration( model,
272
+ # infiltration_design_flow_rate,
273
+ # infiltration_flow_per_space,
274
+ # infiltration_flow_per_exterior_area,
275
+ # infiltration_air_changes_per_hour,
276
+ # cost_per_building,
277
+ # cost_per_exterior_area_m2,
278
+ # runner = nil
279
+ # )
280
+ # default_surface_construction_set = model.building.get.defaultConstructionSet.get
281
+ # log = BTAP::Resources::SpaceLoads::ScaleLoads::set_inflitration_magnitude(
282
+ # model,
283
+ # infiltration_design_flow_rate,
284
+ # infiltration_flow_per_space,
285
+ # infiltration_flow_per_exterior_area,
286
+ # infiltration_air_changes_per_hour
287
+ # )
288
+ # #log change
289
+ # message = log
290
+ # runner.nil? ? puts(message) : runner.registerinfo(message)
291
+ # #set costs based on all external surface type constructions.
292
+ # constructions_and_cost = [
293
+ # ["infiltration_ext_wall_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.wallConstruction.get],
294
+ # ["infiltration_ext_floor_cost_m3", cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.floorConstruction.get],
295
+ # ["infiltration_ext_roof_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.roofCeilingConstruction.get],
296
+ # ["infiltration_fixed_window_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.fixedWindowConstruction.get],
297
+ # ["infiltration_operable_window_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.operableWindowConstruction.get],
298
+ # ["infiltration_door_construction_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.doorConstruction.get],
299
+ # ["infiltration_glass_door_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.glassDoorConstruction.get],
300
+ # ["infiltration_overhead_door_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.overheadDoorConstruction.get],
301
+ # ["infiltration_skylight_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.skylightConstruction.get],
302
+ # ["infiltration_tubular_daylight_dome_cost_m3",cost_per_exterior_area_m2, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDomeConstruction.get],
303
+ # ["infiltration_tubular_daylight_diffuser_cost_m3" ,cost_per_exterior_area_m2 , default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDiffuserConstruction.get]
304
+ # ]
305
+ # #Assign cost to each construction.
306
+ # constructions_and_cost.each do |item|
307
+ # unless item[1].nil?
308
+ # item[2].removeLifeCycleCosts()
309
+ # raise("Could not remove LCC info from construction #{item[2]}") unless item[2].lifeCycleCosts.size == 0
310
+ # construction_cost_object = OpenStudio::Model::LifeCycleCost.new(item[2])
311
+ # construction_cost_object.setName(item[0])
312
+ # construction_cost_object.setCost(item[1])
313
+ # construction_cost_object.setCostUnits("CostPerArea")
314
+ # end
315
+ # end
316
+ # #create building total construction cost if needed.
317
+ # building = default_surface_construction_set.model.building.get
318
+ # BTAP::Resources::Economics::object_cost(building, "Infiltration Cost per building.", cost_per_building, "CostPerEach")
319
+ # return true
320
+ # end
321
+ #
322
+ # #This method will set the ecm fans.
323
+ # #@author phylroy.lopez@nrcan.gc.ca
324
+ # #@param model [OpenStudio::model::Model] A model object
325
+ # #@return [String] log
326
+ # def ecm_fans( model )
327
+ # measure_values =
328
+ # [
329
+ # "fan_total_eff",
330
+ # "fan_motor_eff",
331
+ # "fan_volume_type"
332
+ # ]
333
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
334
+ # self.set_instance_variables(measure_values)
335
+ # log = ""
336
+ # unless model.getFanVariableVolumes.empty?
337
+ # log = "fan_variable_volume_name,fan_total_eff,fan_motor_eff\n"
338
+ # model.getFanVariableVolumes.sort.each do |fan|
339
+ # fan.setFanEfficiency( @fan_total_eff ) unless @fan_total_eff.nil?
340
+ # fan.setMotorEfficiency( @fan_motor_eff ) unless @fan_motor_eff.nil?
341
+ # log << fan.name.get.to_s << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
342
+ # end
343
+ # end
344
+ #
345
+ # unless model.getFanConstantVolumes.empty?
346
+ # log = "fan_constant_volume_name,fan_total_eff,fan_motor_eff\n"
347
+ # model.getFanConstantVolumes.sort.each do |fan|
348
+ # fan.setFanEfficiency( @fan_total_eff ) unless @fan_total_eff.nil?
349
+ # fan.setMotorEfficiency( @fan_motor_eff ) unless @fan_motor_eff.nil?
350
+ # log << fan.name.get.to_s << ",#{fan.fanEfficiency},#{fan.motorEfficiency}\n"
351
+ # end
352
+ #
353
+ # end
354
+ #
355
+ # case @fan_volume_type
356
+ #
357
+ # when "VariableVolume"
358
+ # model.getFanConstantVolumes.sort.each do |fan_const|
359
+ # #check that this is indeed connected to an airloop.
360
+ # log << "Found Const Vol Fan #{fan_const.name.get.to_s}"
361
+ # unless fan_const.loop.empty?
362
+ # fan_variable = OpenStudio::Model::FanVariableVolume.new(model,fan_const.availabilitySchedule)
363
+ # #pass information from old fan as much as possible.
364
+ # fan_variable.setFanEfficiency(fan_const.fanEfficiency)
365
+ # fan_variable.setPressureRise( fan_const.pressureRise() )
366
+ # fan_variable.autosizeMaximumFlowRate
367
+ # fan_variable.setFanPowerMinimumFlowRateInputMethod("FixedFlowRate")
368
+ # fan_variable.setFanPowerMinimumFlowFraction(0.25)
369
+ # fan_variable.setMotorInAirstreamFraction( fan_const.motorInAirstreamFraction() )
370
+ # fan_variable.setFanPowerCoefficient1(0.35071223)
371
+ # fan_variable.setFanPowerCoefficient2(0.30850535)
372
+ # fan_variable.setFanPowerCoefficient3(-0.54137364)
373
+ # fan_variable.setFanPowerCoefficient4(0.87198823)
374
+ #
375
+ # #get the airloop.
376
+ # air_loop = fan_const.loop.get
377
+ # #add the FanVariableVolume
378
+ # fan_variable.addToNode(air_loop.supplyOutletNode())
379
+ # #Remove FanConstantVolume
380
+ # fan_const.remove()
381
+ # log << "Replaced by Variable Vol Fan #{fan_variable.name.get.to_s}"
382
+ # end
383
+ # end
384
+ # when "ConstantVolume"
385
+ # model.getFanVariableVolumes.sort.each do |fan|
386
+ # #check that this is indeed connected to an airloop.
387
+ # log << "Found Const Vol Fan #{fan.name.get.to_s}"
388
+ # unless fan.loop.empty?
389
+ # new_fan = OpenStudio::Model::FanConstantVolume.new(model,fan.availabilitySchedule)
390
+ # #pass information from constant speed fan as much as possible.
391
+ # new_fan.setFanEfficiency(fan.fanEfficiency)
392
+ # new_fan.setPressureRise( fan.pressureRise() )
393
+ # new_fan.setMotorEfficiency(fan.motorEfficiency)
394
+ # new_fan.setMotorInAirstreamFraction( fan.motorInAirstreamFraction() )
395
+ # new_fan.autosizeMaximumFlowRate
396
+ # #get the airloop.
397
+ # air_loop = fan.loop.get
398
+ # #add the FanVariableVolume
399
+ # new_fan.addToNode(air_loop.supplyOutletNode())
400
+ # #Remove FanConstantVolume
401
+ # fan.remove()
402
+ # log << "Replaced by Constant Vol Fan #{new_fan.name.get.to_s}"
403
+ # end
404
+ # end
405
+ # when nil
406
+ # log << "No changes to Fan."
407
+ # else
408
+ # raise("fan_volume_type should be ConstantVolume or VariableVolume")
409
+ # end
410
+ # return log
411
+ # end
412
+ #
413
+ #
414
+ # #This method will set the ecm pumps.
415
+ # #@author phylroy.lopez@nrcan.gc.ca
416
+ # #@param model [OpenStudio::model::Model] A model object
417
+ # #@return [String] log
418
+ # def ecm_pumps( model )
419
+ # measure_values =
420
+ # [
421
+ # "pump_motor_eff",
422
+ # "pump_control_type",
423
+ # "pump_speed_type"
424
+ # ]
425
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
426
+ # self.set_instance_variables(measure_values)
427
+ # log = ""
428
+ # unless model.getPumpVariableSpeeds.empty?
429
+ # log = "pump_variable_speed_name,@pump_motor_eff\n"
430
+ # model.getPumpVariableSpeeds.sort.each do |pump|
431
+ # pump.setMotorEfficiency( @pump_motor_eff.to_f ) unless @pump_motor_eff.nil?
432
+ # pump.setPumpControlType( @pump_control_type ) unless @pump_control_type.nil?
433
+ # log << pump.name.get.to_s << ",#{pump.motorEfficiency}\n"
434
+ # end
435
+ # end
436
+ # unless model.getPumpConstantSpeeds.empty?
437
+ # log << "pump_variable_speed_name,@pump_motor_eff\n"
438
+ # model.getPumpConstantSpeeds.sort.each do |pump|
439
+ # pump.setMotorEfficiency( @pump_motor_eff.to_f ) unless @pump_motor_eff.nil?
440
+ # pump.setPumpControlType( @pump_control_type ) unless @pump_control_type.nil?
441
+ # log << pump.name.get.to_s << ",#{pump.motorEfficiency}\n"
442
+ # end
443
+ # end
444
+ #
445
+ # #set pump speed type based on existing pump.
446
+ # case @pump_speed_type
447
+ # when "VariableSpeed"
448
+ # model.getPumpConstantSpeeds.sort.each do |pump_const|
449
+ # log << "Found Const Vol Fan #{pump_const.name.get.to_s}"
450
+ # #check that this is indeed connected to an plant loop.
451
+ # unless pump_const.plantLoop.empty?
452
+ # pump_variable = OpenStudio::Model::PumpVariableSpeed.new(model)
453
+ # #pass information from constant speed fan as much as possible.
454
+ # pump_variable.setRatedFlowRate(pump_const.ratedFlowRate.get)
455
+ # pump_variable.setRatedPumpHead(pump_const.ratedPumpHead)
456
+ # pump_variable.setRatedPowerConsumption(pump_const.ratedPowerConsumption.to_f)
457
+ # pump_variable.setMotorEfficiency(pump_const.motorEfficiency.to_f)
458
+ # pump_variable.setPumpControlType(pump_const.pumpControlType)
459
+ # pump_variable.setFractionofMotorInefficienciestoFluidStream(pump_const.fractionofMotorInefficienciestoFluidStream.to_f)
460
+ # pump_variable.autosizeRatedFlowRate if pump_const.isRatedFlowRateAutosized
461
+ # pump_variable.autosizeRatedPowerConsumption if pump_const.isRatedPowerConsumptionAutosized
462
+ #
463
+ # #get the hot water loop.
464
+ # hw_loop = pump_const.plantLoop.get
465
+ # #Remove PumpConstantSpeed
466
+ # pump_const.remove()
467
+ # #add
468
+ # pump_variable.addToNode(hw_loop.supplyInletNode)
469
+ # log << "Replaced by Variable Vol Pump #{pump_variable.name.get.to_s}"
470
+ # end
471
+ # end #end loop PumpConstantSpeeds
472
+ # when "ConstantSpeed"
473
+ # model.getPumpVariableSpeeds.sort.each do |pump|
474
+ # log << "Found Variable Speed Pump #{pump.name.get.to_s}"
475
+ # #check that this is indeed connected to an plant loop.
476
+ # unless pump.plantLoop.empty?
477
+ # new_pump = OpenStudio::Model::PumpVariableSpeed.new(model)
478
+ # #pass information from constant speed fan as much as possible.
479
+ #
480
+ # new_pump.setRatedFlowRate(pump.ratedFlowRate.get)
481
+ # new_pump.setRatedPumpHead(pump.ratedPumpHead)
482
+ # new_pump.setRatedPowerConsumption(pump.ratedPowerConsumption.to_f)
483
+ # new_pump.setMotorEfficiency(pump.motorEfficiency.to_f)
484
+ # new_pump.setFractionofMotorInefficienciestoFluidStream(pump.fractionofMotorInefficienciestoFluidStream.to_f)
485
+ # new_pump.setPumpControlType(pump.pumpControlType)
486
+ # new_pump.autosizeRatedFlowRate if pump.isRatedFlowRateAutosized
487
+ # new_pump.autosizeRatedPowerConsumption if pump.isRatedPowerConsumptionAutosized
488
+ # #get the hot water loop.
489
+ # hw_loop = pump.plantLoop.get
490
+ # #Remove PumpVariableSpeed
491
+ # pump.remove()
492
+ # #add the pump to loop.
493
+ # new_pump.addToNode(hw_loop.supplyInletNode)
494
+ #
495
+ # log << "Replaced by constant speed Pump #{new_pump.name.get.to_s}"
496
+ # end
497
+ # end #end loop Pump variable Speeds
498
+ # when nil
499
+ # log << "No changes"
500
+ # else
501
+ # raise( "pump_speed_type field is not ConstantSpeed or VariableSpeed" )
502
+ # end
503
+ #
504
+ # #Create sample csv file.
505
+ # CSV.open("#{@script_root_folder_path}/sample_pump_eff_ecm.csv", 'w') { |csv| csv << measure_values.unshift("measure_id") }
506
+ # return log
507
+ # end
508
+ #
509
+ # #This method will set the ecm cooling COP.
510
+ # #@author phylroy.lopez@nrcan.gc.ca
511
+ # #@param model [OpenStudio::model::Model] A model object
512
+ # def ecm_cooling_cop( model )
513
+ # log = ""
514
+ # measure_values =[
515
+ # "cop"
516
+ # ]
517
+ #
518
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
519
+ # self.set_instance_variables(measure_values)
520
+ #
521
+ # unless model.getCoilCoolingDXSingleSpeeds.empty?
522
+ # log = "coil_cooling_dx_single_speed_name,cop\n"
523
+ # model.getCoilCoolingDXSingleSpeeds.sort.each do |cooling_coil|
524
+ # cooling_coil.setRatedCOP( OpenStudio::OptionalDouble.new( @cop ) ) unless @cop.nil?
525
+ # cop = "NA"
526
+ # # Prior to 3.5.0, it was an optional double, now it's a double
527
+ # cop_ = OpenStudio::OptionalDouble.new(cooling_coil.ratedCOP)
528
+ # cop = cop_.get unless cop_.empty?
529
+ # log << cooling_coil.name.get.to_s << ",#{cop}\n"
530
+ #
531
+ # end
532
+ # end
533
+ #
534
+ # unless model.getCoilCoolingDXTwoSpeeds.empty?
535
+ # log << "coil_cooling_dx_two_speed_name,cop\n"
536
+ # model.getCoilCoolingDXTwoSpeeds.sort.each do |cooling_coil|
537
+ # cooling_coil.setRatedHighSpeedCOP( @cop ) unless @cop.nil?
538
+ # cooling_coil.setRatedLowSpeedCOP( @cop ) unless @cop.nil?
539
+ # cop_high = "NA"
540
+ # # Prior to 3.5.0, it was an optional double, now it's a double
541
+ # cop_ = OpenStudio::OptionalDouble.new(cooling_coil.ratedHighSpeedCOP)
542
+ # cop_high = cop_.get unless cop_.empty?
543
+ # cop_low = "NA"
544
+ # cop_ = OpenStudio::OptionalDouble.new(cooling_coil.ratedLowSpeedCOP)
545
+ # cop_low = cop_.get unless cop_.empty?
546
+ # log << cooling_coil.name.get.to_s << ",#{cop_high},#{cop_low}\n"
547
+ # end
548
+ # end
549
+ # return log
550
+ # end
551
+ #
552
+ # #This method will set the ecm economizers.
553
+ # #@author phylroy.lopez@nrcan.gc.ca
554
+ # #@param model [OpenStudio::model::Model] A model object
555
+ # #@return [String] log
556
+ # def ecm_economizers( model )
557
+ #
558
+ # measure_values =[
559
+ # "economizer_control_type",
560
+ # "economizer_control_action_type",
561
+ # "economizer_maximum_limit_dry_bulb_temperature",
562
+ # "economizer_maximum_limit_enthalpy",
563
+ # "economizer_maximum_limit_dewpoint_temperature",
564
+ # "economizer_minimum_limit_dry_bulb_temperature" ]
565
+ #
566
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
567
+ # self.set_instance_variables(measure_values)
568
+ # log = ""
569
+ # unless @economizer_control_type.nil?
570
+ # log << BTAP::Resources::HVAC::enable_economizer(
571
+ # model,
572
+ # @economizer_control_type,
573
+ # @economizer_control_action_type,
574
+ # @economizer_maximum_limit_dry_bulb_temperature,
575
+ # @economizer_maximum_limit_enthalpy,
576
+ # @economizer_maximum_limit_dewpoint_temperature,
577
+ # @economizer_minimum_limit_dry_bulb_temperature
578
+ # )
579
+ #
580
+ # end
581
+ # return log
582
+ # end
583
+ # #This method will set the ecm sizing.
584
+ # #@author phylroy.lopez@nrcan.gc.ca
585
+ # #@param model [OpenStudio::model::Model] A model object
586
+ # #@return [String] table
587
+ # def ecm_sizing( model)
588
+ # measure_values =[
589
+ # "heating_sizing_factor",
590
+ # "cooling_sizing_factor",
591
+ # "zone_heating_sizing_factor",
592
+ # "zone_cooling_sizing_factor"
593
+ # ]
594
+ #
595
+ # table = "*Sizing Factor Measure*"
596
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
597
+ # self.set_instance_variables(measure_values)
598
+ # table = "handle,heating_sizing_factor,cooling_sizing_factor\n"
599
+ # #Sizing Parameters
600
+ #
601
+ # model.getSizingParameters.setHeatingSizingFactor(@heating_sizing_factor) unless @heating_sizing_factor.nil?
602
+ # model.getSizingParameters.setCoolingSizingFactor(@cooling_sizing_factor) unless @cooling_sizing_factor.nil?
603
+ #
604
+ #
605
+ # #SizingZone
606
+ # table << "handle,zone_heating_sizing_factor,zone_cooling_sizing_factor\n"
607
+ # model.getSizingZones.sort.each do |item|
608
+ # item.setZoneHeatingSizingFactor(@zone_heating_sizing_factor) unless @zone_heating_sizing_factor.nil?
609
+ # item.setZoneCoolingSizingFactor(@zone_cooling_sizing_factor) unless @zone_cooling_sizing_factor.nil?
610
+ # table << "#{item.handle},#{item.zoneHeatingSizingFactor.get},#{item.zoneCoolingSizingFactor.get}\n"
611
+ # end
612
+ # #Create sample csv file.
613
+ # CSV.open("#{@script_root_folder_path}/sample_sizing_param_ecm.csv", 'w') { |csv| csv << measure_values.unshift("measure_id") }
614
+ # return table
615
+ # end
616
+ #
617
+ # #This method will set the ecm domestic hot water.
618
+ # #@author phylroy.lopez@nrcan.gc.ca
619
+ # #@param model [OpenStudio::model::Model] A model object
620
+ # #@return [String] log
621
+ # def ecm_dhw( model )
622
+ # log = "shw_setpoint_sched,shw_heater_fuel_type,shw_thermal_eff\n"
623
+ # measure_values =[
624
+ # "shw_setpoint_sched_name",
625
+ # "shw_heater_fuel_type",
626
+ # "shw_thermal_eff"
627
+ # ]
628
+ # log = "*SHW Measures*\n"
629
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
630
+ # self.set_instance_variables(measure_values)
631
+ #
632
+ # #Create Schedule
633
+ # #schedule = BTAP::Resources::Schedules::create_annual_ruleset_schedule_detailed_json(model, @shw_setpoint_sched) unless @shw_setpoint_sched_name.nil? or @shw_setpoint_sched.nil?
634
+ #
635
+ # #iterate through water heaters.
636
+ # model.getWaterHeaterMixeds.sort.each do |item|
637
+ # unless @shw_setpoint_sched_name.nil? or @shw_setpoint_sched.nil?
638
+ # item.setSetpointTemperatureSchedule(schedule)
639
+ # end
640
+ # item.setHeaterFuelType(@shw_heater_fuel_type) unless @shw_heater_fuel_type.nil?
641
+ # item.setHeaterThermalEfficiency(@shw_thermal_eff) unless @shw_thermal_eff.nil?
642
+ # log << item.name.get.to_s << ",#{item.setpointTemperatureSchedule},#{item.heaterFuelType},#{item.heaterThermalEfficiency}\n"
643
+ # end
644
+ # return log
645
+ # end
646
+ #
647
+ # #This method will set the ecm chotwater boilers.
648
+ # #@author phylroy.lopez@nrcan.gc.ca
649
+ # #@param model [OpenStudio::model::Model] A model object
650
+ # #@return [String] table
651
+ # def ecm_hotwater_boilers( model )
652
+ # measure_values = [
653
+ # "hw_boiler_design_water_outlet_temperature",
654
+ # "hw_boiler_fuel_type",
655
+ # "hw_boiler_thermal_eff",
656
+ # "hw_boiler_curve",
657
+ # "hw_boiler_flow_mode",#
658
+ # "hw_boiler_eff_curve_temp_eval_var",#
659
+ # "hw_boiler_reset_highsupplytemp" ,
660
+ # "hw_boiler_reset_outsidehighsupplytemp" ,
661
+ # "hw_boiler_reset_lowsupplytemp" ,
662
+ # "hw_boiler_reset_outsidelowsupplytemp" ,
663
+ # ]
664
+ #
665
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
666
+ # self.set_instance_variables(measure_values)
667
+ # table = "name,boiler_design_water_outlet_temperature,boiler_fuel_type,boiler_thermal_eff\n"
668
+ #
669
+ # model.getPlantLoops.sort.each do |iplantloop|
670
+ # iplantloop.components.each do |icomponent|
671
+ # if icomponent.to_BoilerHotWater.is_initialized
672
+ # boiler = icomponent.to_BoilerHotWater.get
673
+ #
674
+ # #set design outlet temp
675
+ # if model.version < OpenStudio::VersionString.new('3.0.0')
676
+ # boiler.setDesignWaterOutletTemperature(@hw_boiler_design_water_outlet_temperature) unless @hw_boiler_design_water_outlet_temperature.nil?
677
+ # end
678
+ # #set fuel type
679
+ # boiler.setFuelType(@hw_boiler_fuel_type) unless @hw_boiler_fuel_type.nil?
680
+ # #set thermal eff
681
+ # boiler.setNominalThermalEfficiency(@hw_boiler_thermal_eff) unless @hw_boiler_thermal_eff.nil?
682
+ # #set boiler flow mode
683
+ # unless @hw_boiler_flow_mode.nil?
684
+ # ["ConstantFlow","LeavingSetpointModulated","NotModulated"].include?(@hw_boiler_flow_mode) ? boiler.setBoilerFlowMode(@hw_boiler_flow_mode) : raise("Boiler flow mode #{@hw_boiler_flow_mode} invalid.")
685
+ # end
686
+ # #set setDesignWaterOutletTemperature
687
+ # if model.version < OpenStudio::VersionString.new('3.0.0')
688
+ # boiler.setDesignWaterOutletTemperature(@hotwaterboiler_reset_highsupplytemp) unless @hotwaterboiler_reset_highsupplytemp.nil?
689
+ # end
690
+ # #set EfficiencyCurveTemperatureEvaluationVariable
691
+ # unless @hw_boiler_eff_curve_temp_eval_var.nil?
692
+ # ["LeavingBoiler","EnteringBoiler"].include?(@hw_boiler_eff_curve_temp_eval_var) ? boiler.setEfficiencyCurveTemperatureEvaluationVariable(@hw_boiler_eff_curve_temp_eval_var) : raise("EfficiencyCurveTemperatureEvaluationVariable #{@hw_boiler_eff_curve_temp_eval_var} invalid.")
693
+ # end
694
+ #
695
+ #
696
+ # #Set boiler curve
697
+ # curve = boiler.normalizedBoilerEfficiencyCurve
698
+ # if not @hw_boiler_curve.nil? and curve.is_initialized and curve.get.to_CurveBiquadratic.is_initialized
699
+ # case @hw_boiler_curve.downcase
700
+ # when "atmospheric"
701
+ # biqcurve = curve.get.to_CurveBiquadratic.get
702
+ # biqcurve.setCoefficient1Constant(1.057059)
703
+ # biqcurve.setCoefficient1Constant(1.057059)
704
+ # biqcurve.setCoefficient2x(-0.0774177)
705
+ # biqcurve.setCoefficient3xPOW2(0.07875142)
706
+ # biqcurve.setCoefficient4y(0.0003943856)
707
+ # biqcurve.setCoefficient5yPOW2(-0.000004074629)
708
+ # biqcurve.setCoefficient6xTIMESY(-0.002202606)
709
+ # biqcurve.setMinimumValueofx(0.3)
710
+ # biqcurve.setMaximumValueofx(1.0)
711
+ # biqcurve.setMinimumValueofy(40.0)
712
+ # biqcurve.setMaximumValueofy(90.0)
713
+ # biqcurve.setMinimumCurveOutput(0.0)
714
+ # biqcurve.setMaximumCurveOutput(1.1)
715
+ # biqcurve.setInputUnitTypeforX("Dimensionless")
716
+ # biqcurve.setInputUnitTypeforY("Temperature")
717
+ # biqcurve.setOutputUnitType("Dimensionless")
718
+ # when "condensing"
719
+ # biqcurve = curve.get.to_CurveBiquadratic.get
720
+ # biqcurve.setCoefficient1Constant(0.4873)
721
+ # biqcurve.setCoefficient2x(1.1322)
722
+ # biqcurve.setCoefficient3xPOW2(-0.6425)
723
+ # biqcurve.setCoefficient4y(0.0)
724
+ # biqcurve.setCoefficient5yPOW2(0.0)
725
+ # biqcurve.setCoefficient6xTIMESY(0.0)
726
+ # biqcurve.setMinimumValueofx(0.1)
727
+ # biqcurve.setMaximumValueofx(1.0)
728
+ # biqcurve.setMinimumValueofy(0.0)
729
+ # biqcurve.setMaximumValueofy(0.0)
730
+ # biqcurve.setMinimumCurveOutput(0.0)
731
+ # biqcurve.setMaximumCurveOutput(1.0)
732
+ # biqcurve.setInputUnitTypeforX("Dimensionless")
733
+ # biqcurve.setInputUnitTypeforY("Temperature")
734
+ # biqcurve.setOutputUnitType("Dimensionless")
735
+ # else
736
+ # raise("#{@hotwaterboiler_curve} is not a valid boiler curve name (condensing_boiler_curve,atmospheric_boiler_curve")
737
+ # end
738
+ # end
739
+ #
740
+ # #boiler reset setpoint manager
741
+ # unless @hotwaterboiler_reset_lowsupplytemp.nil? and @hotwaterboiler_reset_outsidelowsupplytemp.nil? and @hotwaterboiler_reset_highsupplytemp.nil? and @hotwaterboiler_reset_outsidehighsupplytemp.nil?
742
+ # #check if setpoint manager is present at supply outlet
743
+ # #Find any setpoint manager if it exists and outlet node and remove it.
744
+ # iplantloop.supplyOutletNode.setpointManagers.each {|sm| sm.disconnect}
745
+ #
746
+ # #Add new setpoint manager
747
+ # oar_stpt_manager = OpenStudio::Model::SetpointManagerOutdoorAirReset.new(model)
748
+ # oar_stpt_manager.addToNode(iplantloop.supplyOutletNode)
749
+ # oar_stpt_manager.setSetpointatOutdoorHighTemperature(@hw_boiler_reset_lowsupplytemp) unless @hw_boiler_reset_lowsupplytemp.nil?
750
+ # oar_stpt_manager.setOutdoorHighTemperature(@hotwaterboiler_reset_outsidelowsupplytemp) unless @hw_boiler_reset_outsidelowsupplytemp.nil?
751
+ # oar_stpt_manager.setSetpointatOutdoorLowTemperature(@hw_boiler_reset_highsupplytemp) unless @hw_boiler_reset_highsupplytemp.nil?
752
+ # oar_stpt_manager.setOutdoorLowTemperature(@hw_boiler_reset_outsidehighsupplytemp) unless @hw_boiler_reset_outsidehighsupplytemp.nil?
753
+ # end
754
+ # table << boiler.name.get.to_s << ","
755
+ # boiler.designWaterOutletTemperature.empty? ? dowt = "NA" : dowt = boiler.designWaterOutletTemperature.get
756
+ # table << "#{dowt},#{boiler.fuelType},#{boiler.nominalThermalEfficiency}\n"
757
+ # end
758
+ # end
759
+ # end #end boilers loop
760
+ # return table
761
+ # end
762
+ #
763
+ # #This method will set the ecm dcv.
764
+ # #@author phylroy.lopez@nrcan.gc.ca
765
+ # #@param model [OpenStudio::model::Model] A model object
766
+ # #@return [String] log
767
+ # def ecm_dcv( model )
768
+ # log = ""
769
+ # measure_values =[
770
+ # "dcv_enabled"
771
+ # ]
772
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
773
+ # self.set_instance_variables(measure_values)
774
+ # unless @dcv_enabled.nil?
775
+ # log = BTAP::Resources::HVAC::enable_demand_control_ventilation(model,@dcv_enabled.to_bool)
776
+ # end
777
+ # return log
778
+ # end
779
+ #
780
+ # #This method will set the ecm heating and cooling setpoints.
781
+ # #@author phylroy.lopez@nrcan.gc.ca
782
+ # #@param model [OpenStudio::model::Model] A model object
783
+ # #@return [String] log
784
+ # def ecm_heating_cooling_setpoints(model)
785
+ #
786
+ # log = ""
787
+ # measure_values =[
788
+ # "library_file",
789
+ # "heating_schedule_name",
790
+ # "cooling_schedule_name"
791
+ # ]
792
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
793
+ # self.set_instance_variables(measure_values)
794
+ #
795
+ # library_file = @library_file
796
+ # heating_schedule_name = @heating_schedule_name
797
+ # cooling_schedule_name = @cooling_schedule_name
798
+ #
799
+ # unless @heating_schedule_name.nil? and @cooling_schedule_name.nil?
800
+ # #Load Contruction osm library.
801
+ # lib = BTAP::FileIO::load_osm("#{@script_root_folder_path}/#{library_file}")
802
+ #
803
+ # unless heating_schedule_name.nil?
804
+ # #Get heating schedule from library and clone it.
805
+ # heating_schedule = lib.getScheduleRulesetByName(heating_schedule_name)
806
+ # if heating_schedule.empty?
807
+ # raise("#{heating_schedule_name} does not exist in #{library_file} library ")
808
+ # else
809
+ # heating_schedule = lib.getScheduleRulesetByName(heating_schedule_name).get.clone(model).to_ScheduleRuleset.get
810
+ # end
811
+ # end
812
+ #
813
+ # unless cooling_schedule_name.nil?
814
+ # #Get cooling schedule from library and clone it.
815
+ # cooling_schedule = lib.getScheduleRulesetByName(cooling_schedule_name)
816
+ # if cooling_schedule.empty?
817
+ # raise("#{cooling_schedule_name} does not exist in #{library_file} library ")
818
+ # else
819
+ # cooling_schedule = lib.getScheduleRulesetByName(cooling_schedule_name).get.clone(model).to_ScheduleRuleset.get
820
+ # end
821
+ # end
822
+ # model.getThermostatSetpointDualSetpoints.sort.each do |dual_setpoint|
823
+ # unless heating_schedule_name.nil?
824
+ # raise ("Could not set heating Schedule") unless dual_setpoint.setHeatingSetpointTemperatureSchedule(heating_schedule)
825
+ # end
826
+ # unless cooling_schedule_name.nil?
827
+ # raise ("Could not set cooling Schedule") unless dual_setpoint.setCoolingSetpointTemperatureSchedule(cooling_schedule)
828
+ # end
829
+ # end
830
+ # end
831
+ # return log
832
+ # end
833
+ #
834
+ # #This method will set the ecm erv.
835
+ # #@author phylroy.lopez@nrcan.gc.ca
836
+ # #@param model [OpenStudio::model::Model] A model object
837
+ # #@return [String] log
838
+ # def ecm_erv( model )
839
+ # log = ""
840
+ # measure_values =[
841
+ # "erv_enabled",
842
+ # "erv_autosizeNominalSupplyAirFlowRate",
843
+ # "erv_NominalSupplyAirFlowRate",
844
+ # "erv_HeatExchangerType",
845
+ # "erv_SensibleEffectivenessat100CoolingAirFlow",
846
+ # "erv_SensibleEffectivenessat75CoolingAirFlow",
847
+ # "erv_LatentEffectiveness100Cooling",
848
+ # "erv_LatentEffectiveness75Cooling",
849
+ # "erv_SensibleEffectiveness100Heating",
850
+ # "erv_SensibleEffectiveness75Heating",
851
+ # "erv_LatentEffectiveness100Heating",
852
+ # "erv_LatentEffectiveness75Heating",
853
+ # "erv_SupplyAirOutletTemperatureControl",
854
+ # "erv_setFrostControlType",
855
+ # "erv_ThresholdTemperature",
856
+ # "erv_InitialDefrostTimeFraction",
857
+ # "erv_nominal_electric_power",
858
+ # "erv_economizer_lockout"
859
+ # ]
860
+ #
861
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
862
+ # self.set_instance_variables(measure_values)
863
+ #
864
+ #
865
+ # unless @erv_enabled.nil? or @erv_enabled.to_bool == false
866
+ # BTAP::Resources::HVAC::enable_erv(
867
+ # model,
868
+ # @erv_autosizeNominalSupplyAirFlowRate,
869
+ # @erv_NominalSupplyAirFlowRate,
870
+ # @erv_HeatExchangerType,
871
+ # @erv_SensibleEffectivenessat100CoolingAirFlow,
872
+ # @erv_SensibleEffectivenessat75CoolingAirFlow,
873
+ # @erv_LatentEffectiveness100Cooling,
874
+ # @erv_LatentEffectiveness75Cooling,
875
+ # @erv_SensibleEffectiveness100Heating,
876
+ # @erv_SensibleEffectiveness75Heating,
877
+ # @erv_LatentEffectiveness100Heating,
878
+ # @erv_LatentEffectiveness75Heating,
879
+ # @erv_SupplyAirOutletTemperatureControl.to_bool,
880
+ # @erv_setFrostControlType,
881
+ # @erv_ThresholdTemperature,
882
+ # @erv_InitialDefrostTimeFraction,
883
+ # @erv_nominal_electric_power,
884
+ # @erv_economizer_lockout.to_bool
885
+ # ).each { |erv| log << erv.to_s }
886
+ #
887
+ #
888
+ # #Add setpoint manager to all OA object in airloops.
889
+ # model.getHeatExchangerAirToAirSensibleAndLatents.sort.each do |erv|
890
+ #
891
+ # #needed to get the supply outlet node from the erv to place the setpoint manager.
892
+ # node = erv.primaryAirOutletModelObject.get.to_Node.get if erv.primaryAirOutletModelObject.is_initialized
893
+ # new_set_point_manager = OpenStudio::Model::SetpointManagerWarmest.new(model)
894
+ # raise ("Could not add setpoint manager") unless new_set_point_manager.addToNode(node)
895
+ # log << "added warmest control to node #{node}"
896
+ # new_set_point_manager.setMaximumSetpointTemperature(16.0)
897
+ # new_set_point_manager.setMinimumSetpointTemperature(5.0)
898
+ # new_set_point_manager.setStrategy("MaximumTemperature")
899
+ # new_set_point_manager.setControlVariable("Temperature")
900
+ # end
901
+ # log << "ERV have been modified.\n"
902
+ # else
903
+ # log << "ERV not changed."
904
+ # end
905
+ # return log
906
+ # end
907
+ #
908
+ # #This method will set the ecm cexhaust fans.
909
+ # #@author phylroy.lopez@nrcan.gc.ca
910
+ # #@param model [OpenStudio::model::Model] A model object
911
+ # #@return [String] log
912
+ # def ecm_exhaust_fans( model )
913
+ # log = ""
914
+ # #Exhaust ECM
915
+ # measure_values =[
916
+ # "exhaust_fans_occ_control_enabled"
917
+ # ]
918
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
919
+ # self.set_instance_variables(measure_values)
920
+ # unless @exhaust_fans_occ_control_enabled.nil? or @exhaust_fans_occ_control_enabled.to_bool == false
921
+ # fans = BTAP::Resources::Schedules::set_exhaust_fans_availability_to_building_default_occ_schedule(model)
922
+ # fans.each { |fan| log << fan.to_s}
923
+ # else
924
+ # log << "No changes to exhaust fans."
925
+ # end
926
+ # return log
927
+ # end
928
+ #
929
+ # #This method will set the ecm lighting.
930
+ # #@author phylroy.lopez@nrcan.gc.ca
931
+ # #@param model [OpenStudio::model::Model] A model object
932
+ # #@return [String] log
933
+ # def ecm_lighting( model )
934
+ # log = ""
935
+ # #Lighting ECM
936
+ # measure_values =[
937
+ # "lighting_scaling_factor",
938
+ # "lighting_fraction_radiant",
939
+ # "lighting_fraction_visible",
940
+ # "lighting_return_air_fraction"
941
+ # ]
942
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
943
+ # self.set_instance_variables(measure_values)
944
+ # BTAP::Resources::SpaceLoads::ScaleLoads::scale_lighting_loads(
945
+ # model,
946
+ # @lighting_scaling_factor ) unless @lighting_scaling_factor.nil?
947
+ # #Set lighting variables
948
+ # model.getLightsDefinitions.sort.each do |lightsdef|
949
+ # lightsdef.setFractionRadiant(@lighting_fraction_radiant.to_f)
950
+ # lightsdef.setFractionVisible(@lighting_fraction_visible.to_f)
951
+ # lightsdef.setReturnAirFraction(@lighting_return_air_fraction.to_f)
952
+ # end
953
+ # return log
954
+ # end
955
+ #
956
+ # #This method will set the ecm temperature setback.
957
+ # #@author phylroy.lopez@nrcan.gc.ca
958
+ # #@param model [OpenStudio::model::Model] A model object
959
+ # #@return [String] log
960
+ # def ecm_plugs( model )
961
+ # log = ""
962
+ # #Plug loads ECM
963
+ # measure_values = [
964
+ # "elec_equipment_scaling_factor",
965
+ # "elec_equipment_fraction_radiant",
966
+ # "elec_equipment_fraction_latent",
967
+ # "elec_equipment_fraction_lost"
968
+ # ]
969
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
970
+ # self.set_instance_variables(measure_values)
971
+ #
972
+ # BTAP::Resources::SpaceLoads::ScaleLoads::scale_electrical_loads(
973
+ # model,
974
+ # @elec_equipment_scaling_factor) unless @elec_equipment_scaling_factor.nil?
975
+ #
976
+ # #Set plug loads variables
977
+ # model.getElectricEquipmentDefinitions.sort.each do |elec_equip_def|
978
+ # elec_equip_def.setFractionRadiant(@elec_equipment_fraction_radiant.to_f)
979
+ # elec_equip_def.setFractionLatent(@elec_equipment_fraction_latent.to_f)
980
+ # elec_equip_def.setFractionLost(@elec_equipment_fraction_lost.to_f)
981
+ # end
982
+ #
983
+ # CSV.open("#{@script_root_folder_path}/sample_scale_plug_loads_ecm.csv", 'w') { |csv| csv << measure_values.unshift("measure_id") }
984
+ # return log
985
+ # end
986
+ #
987
+ # #This method will set the ecm cold deck reset control.
988
+ # #@author phylroy.lopez@nrcan.gc.ca
989
+ # #@param model [OpenStudio::model::Model] A model object
990
+ # #@return [String] log
991
+ # def ecm_cold_deck_reset_control( model )
992
+ # log = ""
993
+ # measure_values = [
994
+ # "cold_deck_reset_enabled",
995
+ # "cold_deck_reset_max_supply_air_temp",
996
+ # "cold_deck_reset_min_supply_air_temp",
997
+ # ]
998
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
999
+ # self.set_instance_variables(measure_values)
1000
+ #
1001
+ # if @cold_deck_reset_enabled.to_bool == true
1002
+ #
1003
+ # model.getAirLoopHVACs.sort.each do |iairloop|
1004
+ # cooling_present = false
1005
+ # set_point_manager = nil
1006
+ # iairloop.components.each do |icomponent|
1007
+ # if icomponent.to_CoilCoolingDXSingleSpeed.is_initialized or
1008
+ # icomponent.to_CoilCoolingDXTwoSpeed.is_initialized or
1009
+ # icomponent.to_CoilCoolingWater.is_initialized or
1010
+ # icomponent.to_CoilCoolingCooledBeam.is_initialized or
1011
+ # icomponent.to_CoilCoolingDXMultiSpeed.is_initialized or
1012
+ # icomponent.to_CoilCoolingDXVariableRefrigerantFlow.is_initialized or
1013
+ # icomponent.to_CoilCoolingLowTempRadiantConstFlow.is_initialized or
1014
+ # icomponent.to_CoilCoolingLowTempRadiantVarFlow.is_initialized
1015
+ # cooling_present = true
1016
+ # log << "found cooling."
1017
+ # end
1018
+ # end
1019
+ # #check if setpoint manager is present at supply outlet.
1020
+ # model.getSetpointManagerSingleZoneReheats.sort.each do |manager|
1021
+ # if iairloop.supplyOutletNode == manager.setpointNode.get
1022
+ # set_point_manager = manager
1023
+ # end
1024
+ # end
1025
+ #
1026
+ # if set_point_manager.nil? and cooling_present == true
1027
+ # set_point_manager = OpenStudio::Model::SetpointManagerSingleZoneReheat.new(model)
1028
+ # set_point_manager.addToNode(iairloop.supplyOutletNode)
1029
+ # end
1030
+ #
1031
+ #
1032
+ #
1033
+ # if cooling_present == true and not set_point_manager.nil?
1034
+ # set_point_manager.setMaximumSupplyAirTemperature(@cold_deck_reset_max_supply_air_temp)
1035
+ # set_point_manager.setMinimumSupplyAirTemperature(@cold_deck_reset_min_supply_air_temp)
1036
+ # log << "to_SetpointManagerSingleZoneReheat set to 20.0 and 13.0"
1037
+ # end
1038
+ # end
1039
+ # end
1040
+ # return log
1041
+ # end
1042
+ #
1043
+ # #This method will reset the sat ecm.
1044
+ # #@author phylroy.lopez@nrcan.gc.ca
1045
+ # #@param model [OpenStudio::model::Model] A model object
1046
+ # #@return [String] log
1047
+ # def ecm_sat_reset( model )
1048
+ # log = ""
1049
+ # measure_values = [
1050
+ # "sat_reset_enabled",
1051
+ # "sat_reset_outdoor_high_temperature",
1052
+ # "sat_reset_outdoor_low_temperature",
1053
+ # "sat_reset_setpoint_at_outdoor_high_temperature",
1054
+ # "sat_reset_setpoint_at_outdoor_low_temperature"
1055
+ # ]
1056
+ #
1057
+ #
1058
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
1059
+ # self.set_instance_variables(measure_values)
1060
+ # if @sat_reset_enabled.to_bool == true
1061
+ # model.getAirLoopHVACs.sort.each do |iairloop|
1062
+ #
1063
+ # #check if setpoint manager is present at supply outlet
1064
+ # model.getSetpointManagerSingleZoneReheats.sort.each do |manager|
1065
+ # if iairloop.supplyOutletNode == manager.setpointNode.get
1066
+ # manager.disconnect
1067
+ # end
1068
+ # end
1069
+ #
1070
+ # new_set_point_manager = OpenStudio::Model::SetpointManagerOutdoorAirReset.new(model)
1071
+ # new_set_point_manager.addToNode(iairloop.supplyOutletNode)
1072
+ # new_set_point_manager.setOutdoorHighTemperature(@sat_reset_outdoor_high_temperature)
1073
+ # new_set_point_manager.setOutdoorLowTemperature(@sat_reset_outdoor_low_temperature)
1074
+ # new_set_point_manager.setSetpointatOutdoorHighTemperature(@sat_reset_setpoint_at_outdoor_high_temperature)
1075
+ # new_set_point_manager.setSetpointatOutdoorLowTemperature(@sat_reset_setpoint_at_outdoor_low_temperature)
1076
+ # new_set_point_manager.setControlVariable("Temperature")
1077
+ # log << "Replaced SingleZoneReheat with OA reset control."
1078
+ # end
1079
+ # end
1080
+ # return log
1081
+ # end
1082
+ #
1083
+ # #This method will set the ecm temperature setback.
1084
+ # #@author phylroy.lopez@nrcan.gc.ca
1085
+ # #@param model [OpenStudio::model::Model] A model object
1086
+ # #@return [String] log
1087
+ # def ecm_temp_setback( model )
1088
+ # log = ""
1089
+ # measure_values = [
1090
+ # "occ_stbck_enabled",
1091
+ # "occ_stbck_tolerance",
1092
+ # "occ_stbck_heat_setback",
1093
+ # "occ_stbck_heat_setpoint",
1094
+ # "occ_stbck_cool_setback",
1095
+ # "occ_stbck_cool_setpoint"
1096
+ # ]
1097
+ # #Set all the above instance variables to the @csv_data values or, if not set or == 'na', to nil.
1098
+ # self.set_instance_variables(measure_values)
1099
+ # # get occupancy schedule if possible.
1100
+ # unless @occ_stbck_enabled.nil? or @occ_stbck_enabled == false
1101
+ # if model.building.get.defaultScheduleSet.is_initialized and
1102
+ # model.building.get.defaultScheduleSet.get.numberofPeopleSchedule.is_initialized and
1103
+ # model.building.get.defaultScheduleSet.get.numberofPeopleSchedule.get.to_ScheduleRuleset.is_initialized
1104
+ # occupancy_schedule = model.building.get.defaultScheduleSet.get.numberofPeopleSchedule.get
1105
+ # heating_schedule,cooling_schedule = BTAP::Resources::Schedules::create_setback_schedule_based_on_another_schedule(
1106
+ # model,
1107
+ # occupancy_schedule,
1108
+ # @occ_stbck_tolerance.to_f,
1109
+ # @occ_stbck_heat_setpoint.to_f,
1110
+ # @occ_stbck_heat_setback.to_f,
1111
+ # @occ_stbck_cool_setpoint.to_f,
1112
+ # @occ_stbck_cool_setback.to_f)
1113
+ # model.getThermostatSetpointDualSetpoints.sort.each do |dual_setpoint|
1114
+ # raise ("Could not set setback heating Schedule") unless dual_setpoint.setHeatingSetpointTemperatureSchedule(heating_schedule)
1115
+ # raise ("Could not set setback cooling Schedule") unless dual_setpoint.setCoolingSetpointTemperatureSchedule(cooling_schedule)
1116
+ # log << "modified....#{dual_setpoint}"
1117
+ # end
1118
+ # end
1119
+ # else
1120
+ # log << "no change to setbacks."
1121
+ # end
1122
+ # return log
1123
+ # end
1124
+ # end
1125
+ # end #module Resources
1126
+ # end #module BTAP
1127
+ #
1128
+ #
1129
+ #
1130
+ #
1131
+ # #"Construction"
1132
+ # # "CostPerArea"
1133
+ # #"Building"
1134
+ # # "CostPerEach"
1135
+ # # "CostPerArea"
1136
+ # # "CostPerThermalZone"
1137
+ # #"Space
1138
+ # #"CostPerEach"
1139
+ # #"CostPerArea"
1140
+ # #"ThermalZone"
1141
+ # #"CostPerEach"
1142
+ # #"CostPerArea"
1143
+ # #"AirLoop"
1144
+ # #"CostPerEach"
1145
+ # #"CostPerThermalZone"
1146
+ # #"PlantLoop"
1147
+ # #"CostPerEach"
1148
+ # #"ZoneHVAC"
1149
+ # #"CostPerEach"
1150
+ # #"Lights
1151
+ # # "CostPerEach"
1152
+ # # "CostPerArea"
1153
+ # #"Luminaire
1154
+ # #"CostPerEach"
1155
+ # #"Equipment
1156
+ # # "CostPerEach"
1157
+ # # "CostPerArea"
1158
+ # #"HVACComponent
1159
+ # #"CostPerEach"
1160
+ # #"ZoneHVACComponent
1161
+ # # "CostPerEach"
1162
+ # #All others
1163
+ # #"CostPerEach"