openstudio-standards 0.3.0 → 0.3.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/data/geometry/ASHRAESuperMarket.json +29 -38
  3. data/data/standards/OpenStudio_Standards-deer-ALL-comstock(space_types).xlsx +0 -0
  4. data/data/standards/metadata_units_OpenStudio_Standards-deer-ALL-comstockspace_types.csv +172 -0
  5. data/data/standards/test_performance_expected_dd_results.csv +12 -12
  6. data/lib/openstudio-standards/btap/analysis.rb +389 -389
  7. data/lib/openstudio-standards/btap/bridging.rb +2099 -0
  8. data/lib/openstudio-standards/btap/btap.model.rb +717 -717
  9. data/lib/openstudio-standards/btap/btap.rb +33 -30
  10. data/lib/openstudio-standards/btap/economics.rb +1163 -1163
  11. data/lib/openstudio-standards/btap/envelope.rb +4 -4
  12. data/lib/openstudio-standards/btap/equest.rb +2524 -2524
  13. data/lib/openstudio-standards/btap/fileio.rb +9 -0
  14. data/lib/openstudio-standards/btap/measures.rb +1515 -1515
  15. data/lib/openstudio-standards/btap/mpc.rb +554 -554
  16. data/lib/openstudio-standards/btap/reporting.rb +287 -287
  17. data/lib/openstudio-standards/btap/simmanager.rb +759 -759
  18. data/lib/openstudio-standards/btap/spaceloads.rb +439 -439
  19. data/lib/openstudio-standards/btap/spacetypes.rb +113 -113
  20. data/lib/openstudio-standards/btap/utilities.rb +134 -134
  21. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVAC.rb +8 -83
  22. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingWater.rb +3 -99
  23. data/lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb +81 -75
  24. data/lib/openstudio-standards/hvac_sizing/Siz.Model.rb +7 -306
  25. data/lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb +70 -98
  26. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.Model.rb +41 -14
  27. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Model.rb +40 -14
  28. data/lib/openstudio-standards/prototypes/common/buildings/Prototype.SuperMarket.rb +1 -23
  29. data/lib/openstudio-standards/prototypes/common/objects/Prototype.ServiceWaterHeating.rb +93 -4
  30. data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +13 -0
  31. data/lib/openstudio-standards/prototypes/common/objects/Prototype.refrigeration.rb +5 -4
  32. data/lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb +24 -4
  33. data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +18 -2
  34. data/lib/openstudio-standards/standards/Standards.BoilerHotWater.rb +18 -0
  35. data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +13 -10
  36. data/lib/openstudio-standards/standards/Standards.CoilDX.rb +5 -3
  37. data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +11 -8
  38. data/lib/openstudio-standards/standards/Standards.Construction.rb +1 -1
  39. data/lib/openstudio-standards/standards/Standards.Model.rb +68 -52
  40. data/lib/openstudio-standards/standards/Standards.PlantLoop.rb +2 -2
  41. data/lib/openstudio-standards/standards/Standards.Space.rb +16 -18
  42. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.ref_cases.json +510 -0
  43. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_compressors.json +18 -0
  44. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_walkins.json +410 -0
  45. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.spc_typ.json +2 -2
  46. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.ref_cases.json +510 -0
  47. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_compressors.json +18 -0
  48. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_walkins.json +410 -0
  49. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.spc_typ.json +2 -2
  50. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.ref_cases.json +510 -0
  51. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_compressors.json +18 -0
  52. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_walkins.json +410 -0
  53. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.spc_typ.json +2 -2
  54. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.ref_cases.json +510 -0
  55. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_compressors.json +18 -0
  56. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_walkins.json +410 -0
  57. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.spc_typ.json +2 -2
  58. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.spc_typ.json +2 -2
  59. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.spc_typ.json +2 -2
  60. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.AirLoopHVAC.rb +9 -0
  61. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.Model.rb +2 -0
  62. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.rb +4 -3
  63. data/lib/openstudio-standards/standards/deer/deer_1985/comstock_deer_1985/data/comstock_deer_1985.spc_typ.json +405 -405
  64. data/lib/openstudio-standards/standards/deer/deer_1996/comstock_deer_1996/data/comstock_deer_1996.spc_typ.json +405 -405
  65. data/lib/openstudio-standards/standards/deer/deer_2003/comstock_deer_2003/data/comstock_deer_2003.spc_typ.json +405 -405
  66. data/lib/openstudio-standards/standards/deer/deer_2003/deer_2003.ThermalZone.rb +21 -0
  67. data/lib/openstudio-standards/standards/deer/deer_2007/comstock_deer_2007/data/comstock_deer_2007.spc_typ.json +405 -405
  68. data/lib/openstudio-standards/standards/deer/deer_2007/deer_2007.ThermalZone.rb +21 -0
  69. data/lib/openstudio-standards/standards/deer/deer_2011/comstock_deer_2011/data/comstock_deer_2011.spc_typ.json +405 -405
  70. data/lib/openstudio-standards/standards/deer/deer_2011/deer_2011.ThermalZone.rb +21 -0
  71. data/lib/openstudio-standards/standards/deer/deer_2014/comstock_deer_2014/data/comstock_deer_2014.spc_typ.json +405 -405
  72. data/lib/openstudio-standards/standards/deer/deer_2014/deer_2014.ThermalZone.rb +21 -0
  73. data/lib/openstudio-standards/standards/deer/deer_2015/comstock_deer_2015/data/comstock_deer_2015.spc_typ.json +405 -405
  74. data/lib/openstudio-standards/standards/deer/deer_2015/deer_2015.ThermalZone.rb +21 -0
  75. data/lib/openstudio-standards/standards/deer/deer_2017/comstock_deer_2017/data/comstock_deer_2017.spc_typ.json +405 -405
  76. data/lib/openstudio-standards/standards/deer/deer_2017/deer_2017.ThermalZone.rb +21 -0
  77. data/lib/openstudio-standards/standards/deer/deer_2020/comstock_deer_2020/data/comstock_deer_2020.spc_typ.json +405 -405
  78. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.AirLoopHVAC.rb +8 -0
  79. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.ThermalZone.rb +21 -0
  80. data/lib/openstudio-standards/standards/deer/deer_2025/comstock_deer_2025/data/comstock_deer_2025.spc_typ.json +405 -405
  81. data/lib/openstudio-standards/standards/deer/deer_2030/comstock_deer_2030/data/comstock_deer_2030.spc_typ.json +405 -405
  82. data/lib/openstudio-standards/standards/deer/deer_2035/comstock_deer_2035/data/comstock_deer_2035.spc_typ.json +405 -405
  83. data/lib/openstudio-standards/standards/deer/deer_2040/comstock_deer_2040/data/comstock_deer_2040.spc_typ.json +405 -405
  84. data/lib/openstudio-standards/standards/deer/deer_2045/comstock_deer_2045/data/comstock_deer_2045.spc_typ.json +405 -405
  85. data/lib/openstudio-standards/standards/deer/deer_2050/comstock_deer_2050/data/comstock_deer_2050.spc_typ.json +405 -405
  86. data/lib/openstudio-standards/standards/deer/deer_2055/comstock_deer_2055/data/comstock_deer_2055.spc_typ.json +405 -405
  87. data/lib/openstudio-standards/standards/deer/deer_2060/comstock_deer_2060/data/comstock_deer_2060.spc_typ.json +405 -405
  88. data/lib/openstudio-standards/standards/deer/deer_2065/comstock_deer_2065/data/comstock_deer_2065.spc_typ.json +405 -405
  89. data/lib/openstudio-standards/standards/deer/deer_2070/comstock_deer_2070/data/comstock_deer_2070.spc_typ.json +405 -405
  90. data/lib/openstudio-standards/standards/deer/deer_2075/comstock_deer_2075/data/comstock_deer_2075.spc_typ.json +405 -405
  91. data/lib/openstudio-standards/standards/deer/deer_pre_1975/comstock_deer_pre_1975/data/comstock_deer_pre_1975.spc_typ.json +405 -405
  92. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/btap_pre1980.rb +1 -1
  93. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_3_and_8_single_speed.rb +3 -1
  94. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_4.rb +3 -1
  95. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_6.rb +2 -2
  96. data/lib/openstudio-standards/standards/necb/ECMS/data/curves.json +233 -0
  97. data/lib/openstudio-standards/standards/necb/ECMS/data/unitary_acs.json +180 -0
  98. data/lib/openstudio-standards/standards/necb/ECMS/ecms.rb +6 -1
  99. data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +807 -258
  100. data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +102 -66
  101. data/lib/openstudio-standards/standards/necb/NECB2011/data/fuel_type_sets.json +85 -8
  102. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/HighriseApartment.osm +2483 -992
  103. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LowriseApartment.osm +4 -336
  104. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/MidriseApartment.osm +228 -231
  105. data/lib/openstudio-standards/standards/necb/NECB2011/data/heat_pumps_heating.json +12 -18
  106. data/lib/openstudio-standards/standards/necb/NECB2011/data/space_type_unit_definitions.txt +76 -0
  107. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_multi_speed.rb +6 -1
  108. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_single_speed.rb +111 -24
  109. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_2_and_5.rb +1 -0
  110. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_multi_speed.rb +3 -1
  111. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_single_speed.rb +64 -16
  112. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_4.rb +61 -17
  113. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_6.rb +128 -0
  114. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +252 -23
  115. data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +316 -20
  116. data/lib/openstudio-standards/standards/necb/NECB2011/qaqc/necb_qaqc.rb +1 -1
  117. data/lib/openstudio-standards/standards/necb/NECB2011/service_water_heating.rb +3 -5
  118. data/lib/openstudio-standards/standards/necb/NECB2011/system_fuels.rb +38 -0
  119. data/lib/openstudio-standards/standards/necb/NECB2015/data/heat_pumps_heating.json +16 -24
  120. data/lib/openstudio-standards/standards/necb/NECB2015/hvac_systems.rb +48 -25
  121. data/lib/openstudio-standards/standards/necb/NECB2020/building_envelope.rb +3 -3
  122. data/lib/openstudio-standards/standards/necb/NECB2020/data/chillers.json +36 -19
  123. data/lib/openstudio-standards/standards/necb/NECB2020/data/furnaces.json +19 -4
  124. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps.json +20 -40
  125. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps_heating.json +74 -36
  126. data/lib/openstudio-standards/standards/necb/NECB2020/necb_2020.rb +0 -2
  127. data/lib/openstudio-standards/standards/necb/NECB2020/service_water_heating.rb +123 -56
  128. data/lib/openstudio-standards/standards/necb/common/btap_data.rb +124 -2
  129. data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +15 -2
  130. data/lib/openstudio-standards/standards/necb/common/necb_reference_runs.csv +1 -1
  131. data/lib/openstudio-standards/utilities/simulation.rb +1 -1
  132. data/lib/openstudio-standards/version.rb +1 -1
  133. data/lib/openstudio-standards/weather/Weather.stat_file.rb +33 -1
  134. data/lib/openstudio-standards.rb +1 -0
  135. metadata +14 -121
  136. data/data/standards/OpenStudio_Standards-ashrae_90_1.xlsx +0 -0
  137. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.ddy +0 -2342
  138. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw +0 -8768
  139. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.stat +0 -700
  140. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.ddy +0 -2342
  141. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw +0 -8768
  142. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.stat +0 -700
  143. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.ddy +0 -2342
  144. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw +0 -8768
  145. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.stat +0 -700
  146. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.ddy +0 -276
  147. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw +0 -8768
  148. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.stat +0 -611
  149. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.ddy +0 -276
  150. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.epw +0 -8768
  151. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.stat +0 -610
  152. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.ddy +0 -2342
  153. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw +0 -8768
  154. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.stat +0 -700
  155. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.ddy +0 -2342
  156. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw +0 -8768
  157. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.stat +0 -700
  158. data/lib/openstudio-standards/hvac_sizing/Siz.AirConditionerVariableRefrigerantFlow.rb +0 -81
  159. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatCoolVAVChngByp.rb +0 -27
  160. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAir.rb +0 -69
  161. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.rb +0 -178
  162. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitarySystem.rb +0 -27
  163. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolCooledBeam.rb +0 -27
  164. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolFourPipeInduction.rb +0 -27
  165. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolReheat.rb +0 -27
  166. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctParallelPIUReheat.rb +0 -67
  167. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctSeriesPIUReheat.rb +0 -27
  168. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctUncontrolled.rb +0 -30
  169. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolNoReheat.rb +0 -27
  170. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolReheat.rb +0 -27
  171. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVNoReheat.rb +0 -68
  172. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVReheat.rb +0 -68
  173. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerHotWater.rb +0 -42
  174. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerSteam.rb +0 -27
  175. data/lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb +0 -58
  176. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXMultiSpeed.rb +0 -171
  177. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXSingleSpeed.rb +0 -56
  178. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXTwoSpeed.rb +0 -89
  179. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXVariableRefrigerantFlow.rb +0 -50
  180. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingWaterToAirHeatPumpEquationFit.rb +0 -69
  181. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXMultiSpeed.rb +0 -120
  182. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXSingleSpeed.rb +0 -56
  183. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXVariableRefrigerantFlow.rb +0 -41
  184. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDesuperheater.rb +0 -27
  185. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingElectric.rb +0 -30
  186. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGas.rb +0 -30
  187. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGasMultiStage.rb +0 -68
  188. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWater.rb +0 -61
  189. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWaterToAirHeatPumpEquationFit.rb +0 -57
  190. data/lib/openstudio-standards/hvac_sizing/Siz.CoilWaterHeatingDesuperheater.rb +0 -27
  191. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerOutdoorAir.rb +0 -59
  192. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerWaterCoil.rb +0 -49
  193. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerSingleSpeed.rb +0 -90
  194. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerTwoSpeed.rb +0 -83
  195. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerVariableSpeed.rb +0 -57
  196. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictCooling.rb +0 -27
  197. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictHeating.rb +0 -27
  198. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerDirectResearchSpecial.rb +0 -27
  199. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerIndirectResearchSpecial.rb +0 -27
  200. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeFluidCoolerSingleSpeed.rb +0 -27
  201. data/lib/openstudio-standards/hvac_sizing/Siz.FanConstantVolume.rb +0 -29
  202. data/lib/openstudio-standards/hvac_sizing/Siz.FanOnOff.rb +0 -27
  203. data/lib/openstudio-standards/hvac_sizing/Siz.FanVariableVolume.rb +0 -29
  204. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsConstantSpeed.rb +0 -55
  205. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsVariableSpeed.rb +0 -55
  206. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerAirToAirSensibleAndLatent.rb +0 -38
  207. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerFluidToFluid.rb +0 -27
  208. data/lib/openstudio-standards/hvac_sizing/Siz.HumidifierSteamElectric.rb +0 -27
  209. data/lib/openstudio-standards/hvac_sizing/Siz.PlantLoop.rb +0 -42
  210. data/lib/openstudio-standards/hvac_sizing/Siz.PumpConstantSpeed.rb +0 -59
  211. data/lib/openstudio-standards/hvac_sizing/Siz.PumpVariableSpeed.rb +0 -59
  212. data/lib/openstudio-standards/hvac_sizing/Siz.SizingSystem.rb +0 -48
  213. data/lib/openstudio-standards/hvac_sizing/Siz.WaterHeaterMixed.rb +0 -16
  214. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveElectric.rb +0 -27
  215. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveWater.rb +0 -27
  216. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACFourPipeFanCoil.rb +0 -27
  217. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACHighTemperatureRadiant.rb +0 -27
  218. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACIdealLoadsAirSystem.rb +0 -27
  219. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantConstFlow.rb +0 -27
  220. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantVarFlow.rb +0 -27
  221. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTemperatureRadiantElectric.rb +0 -27
  222. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalAirConditioner.rb +0 -88
  223. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalHeatPump.rb +0 -88
  224. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACTerminalUnitVariableRefrigerantFlow.rb +0 -104
  225. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACUnitHeater.rb +0 -27
  226. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACWaterToAirHeatPump.rb +0 -27
@@ -1,113 +1,113 @@
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
- require "#{File.dirname(__FILE__)}/btap"
21
-
22
- module BTAP
23
- module Resources #Resources
24
- # This module contains methods that relate to Materials, Constructions and Construction Sets
25
-
26
- module SpaceTypes # BTAP::Resources::SpaceTypes
27
-
28
- #Test SpaceType Module
29
- if __FILE__ == $0
30
- require 'test/unit'
31
- class SpaceLoadsTests < Test::Unit::TestCase
32
- #This method will take 0 variables and tests that the loads will be created correctly.
33
- #@author phylroy.lopez@nrcan.gc.ca
34
- def test_create_all_loads()
35
- model = OpenStudio::Model::Model.new()
36
- people_load = BTAP::Resources::SpaceLoads::create_people_load(model,"people_load_test")
37
- lighting_load = BTAP::Resources::SpaceLoads::create_lighting_load(model,"lights_load_test")
38
- electric_load = BTAP::Resources::SpaceLoads::create_electric_load(model,"electric_load_test")
39
- hotwater_load = BTAP::Resources::SpaceLoads::create_hotwater_load(model,"hotwater_load_test")
40
- oa_load = BTAP::Resources::SpaceLoads::create_oa_load(model,"oa_load_test")
41
- infiltration_load = BTAP::Resources::SpaceLoads::create_infiltration_load(model,"infiltration_load_test")
42
- default_schedule_set = nil
43
- #Check to see if the objects were really created.
44
- space_type = BTAP::Resources::SpaceTypes::create_space_type(model,"space type test",default_schedule_set,people_load,lighting_load,electric_load,hotwater_load,oa_load,infiltration_load)
45
- assert( !(space_type.to_SpaceType.empty?))
46
- end
47
- end
48
- end # End Test SpaceType
49
-
50
- #This method will take 9 variables and returns the space type.
51
- #@author phylroy.lopez@nrcan.gc.ca
52
- #@param model [Object]
53
- #@param space_type_name [String]
54
- #@param default_schedule_set [OpenStudio::Model::DefaultScheduleSet]
55
- #@param people_load [Array]
56
- #@param lighting_load [Array]
57
- #@param electric_load [Array]
58
- #@param hotwater_load [Array]
59
- #@param oa_load [Array]
60
- #@param infiltration_load [Array]
61
- #@return [OpenStudio::Model::SpaceType] spacetype
62
- def self.create_space_type(model,space_type_name,default_schedule_set,people_load,lighting_load,electric_load,hotwater_load,oa_load,infiltration_load)
63
- raise("SpaceType #{space_type_name} already exists. Please use a different name") unless model.getSpaceTypeByName(space_type_name).empty?
64
- spacetype = OpenStudio::Model::SpaceType.new(model)
65
- spacetype.setName(space_type_name)
66
- spacetype.setDefaultScheduleSet(default_schedule_set) unless nil == default_schedule_set
67
- BTAP::Common::validate_array(model,people_load,"People").first.setSpaceType(spacetype) unless nil == people_load
68
- BTAP::Common::validate_array(model,lighting_load,"Lights").first.setSpaceType(spacetype) unless nil == lighting_load
69
- BTAP::Common::validate_array(model,electric_load,"ElectricEquipment").first.setSpaceType(spacetype) unless nil == electric_load
70
- BTAP::Common::validate_array(model,hotwater_load,"HotWaterEquipment").first.setSpaceType(spacetype) unless nil == hotwater_load
71
- spacetype.setDesignSpecificationOutdoorAir(BTAP::Common::validate_array(model,oa_load,"DesignSpecificationOutdoorAir").first) unless nil == oa_load
72
- BTAP::Common::validate_array(model,infiltration_load,"SpaceInfiltrationDesignFlowRate").first.setSpaceType(spacetype) unless nil == infiltration_load
73
- #puts "Created spacetype #{spacetype.name} in model."
74
- return spacetype
75
- end
76
-
77
- #This method will take 2 variables and merge the space types.
78
- #@author phylroy.lopez@nrcan.gc.ca
79
- #@param model [Object]
80
- #@param spacetype_precentage_array [Array]
81
- def self.create_merged_space_type(model,spacetype_precentage_array)
82
- new_spacetype = OpenStudio::Model::SpaceType.new(model)
83
- spacetype_precentage_array.each do |spacetype_percentage|
84
- spacetype = BTAP::Common::validate_array(model,spacetype_percentage[0],"SpaceType").first
85
- spacetype.getDefaultSchedule()
86
- spacetype.internalMass()
87
- spacetype.people()
88
- spacetype.lights()
89
- spacetype.luminaires()
90
- spacetype.electricEquipment()
91
- spacetype.gasEquipment()
92
- spacetype.hotWaterEquipment()
93
- spacetype.steamEquipment()
94
- spacetype.otherEquipment()
95
- #A bit more tricky
96
- spacetype.designSpecificationOutdoorAir()
97
- spacetype.spaceInfiltrationDesignFlowRates()
98
- end
99
- end
100
-
101
- #This method will take 1 variable this method will attempt to find the dominant schedule of the surround spaces
102
- #@author phylroy.lopez@nrcan.gc.ca
103
- #@param model [Object] (description)
104
- def self.set_wildcard_spacetype_schedules_to_dominant_schedule(model)
105
- #1.Find all spaces with wildcard spaces.
106
- #2.Iterate through spaces
107
- #2.1 Find all adjacent spaces
108
- #2.2 Determine dominant space type
109
- #2.2 Set the appropriate schedule for occ, lighting, plugs and
110
- end
111
- end #module SpaceTypes
112
- end #module Resources
113
- end
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
+ # require "#{File.dirname(__FILE__)}/btap"
21
+ #
22
+ # module BTAP
23
+ # module Resources #Resources
24
+ # # This module contains methods that relate to Materials, Constructions and Construction Sets
25
+ #
26
+ # module SpaceTypes # BTAP::Resources::SpaceTypes
27
+ #
28
+ # #Test SpaceType Module
29
+ # if __FILE__ == $0
30
+ # require 'test/unit'
31
+ # class SpaceLoadsTests < Test::Unit::TestCase
32
+ # #This method will take 0 variables and tests that the loads will be created correctly.
33
+ # #@author phylroy.lopez@nrcan.gc.ca
34
+ # def test_create_all_loads()
35
+ # model = OpenStudio::Model::Model.new()
36
+ # people_load = BTAP::Resources::SpaceLoads::create_people_load(model,"people_load_test")
37
+ # lighting_load = BTAP::Resources::SpaceLoads::create_lighting_load(model,"lights_load_test")
38
+ # electric_load = BTAP::Resources::SpaceLoads::create_electric_load(model,"electric_load_test")
39
+ # hotwater_load = BTAP::Resources::SpaceLoads::create_hotwater_load(model,"hotwater_load_test")
40
+ # oa_load = BTAP::Resources::SpaceLoads::create_oa_load(model,"oa_load_test")
41
+ # infiltration_load = BTAP::Resources::SpaceLoads::create_infiltration_load(model,"infiltration_load_test")
42
+ # default_schedule_set = nil
43
+ # #Check to see if the objects were really created.
44
+ # space_type = BTAP::Resources::SpaceTypes::create_space_type(model,"space type test",default_schedule_set,people_load,lighting_load,electric_load,hotwater_load,oa_load,infiltration_load)
45
+ # assert( !(space_type.to_SpaceType.empty?))
46
+ # end
47
+ # end
48
+ # end # End Test SpaceType
49
+ #
50
+ # #This method will take 9 variables and returns the space type.
51
+ # #@author phylroy.lopez@nrcan.gc.ca
52
+ # #@param model [Object]
53
+ # #@param space_type_name [String]
54
+ # #@param default_schedule_set [OpenStudio::Model::DefaultScheduleSet]
55
+ # #@param people_load [Array]
56
+ # #@param lighting_load [Array]
57
+ # #@param electric_load [Array]
58
+ # #@param hotwater_load [Array]
59
+ # #@param oa_load [Array]
60
+ # #@param infiltration_load [Array]
61
+ # #@return [OpenStudio::Model::SpaceType] spacetype
62
+ # def self.create_space_type(model,space_type_name,default_schedule_set,people_load,lighting_load,electric_load,hotwater_load,oa_load,infiltration_load)
63
+ # raise("SpaceType #{space_type_name} already exists. Please use a different name") unless model.getSpaceTypeByName(space_type_name).empty?
64
+ # spacetype = OpenStudio::Model::SpaceType.new(model)
65
+ # spacetype.setName(space_type_name)
66
+ # spacetype.setDefaultScheduleSet(default_schedule_set) unless nil == default_schedule_set
67
+ # BTAP::Common::validate_array(model,people_load,"People").first.setSpaceType(spacetype) unless nil == people_load
68
+ # BTAP::Common::validate_array(model,lighting_load,"Lights").first.setSpaceType(spacetype) unless nil == lighting_load
69
+ # BTAP::Common::validate_array(model,electric_load,"ElectricEquipment").first.setSpaceType(spacetype) unless nil == electric_load
70
+ # BTAP::Common::validate_array(model,hotwater_load,"HotWaterEquipment").first.setSpaceType(spacetype) unless nil == hotwater_load
71
+ # spacetype.setDesignSpecificationOutdoorAir(BTAP::Common::validate_array(model,oa_load,"DesignSpecificationOutdoorAir").first) unless nil == oa_load
72
+ # BTAP::Common::validate_array(model,infiltration_load,"SpaceInfiltrationDesignFlowRate").first.setSpaceType(spacetype) unless nil == infiltration_load
73
+ # #puts "Created spacetype #{spacetype.name} in model."
74
+ # return spacetype
75
+ # end
76
+ #
77
+ # #This method will take 2 variables and merge the space types.
78
+ # #@author phylroy.lopez@nrcan.gc.ca
79
+ # #@param model [Object]
80
+ # #@param spacetype_precentage_array [Array]
81
+ # def self.create_merged_space_type(model,spacetype_precentage_array)
82
+ # new_spacetype = OpenStudio::Model::SpaceType.new(model)
83
+ # spacetype_precentage_array.each do |spacetype_percentage|
84
+ # spacetype = BTAP::Common::validate_array(model,spacetype_percentage[0],"SpaceType").first
85
+ # spacetype.getDefaultSchedule()
86
+ # spacetype.internalMass()
87
+ # spacetype.people()
88
+ # spacetype.lights()
89
+ # spacetype.luminaires()
90
+ # spacetype.electricEquipment()
91
+ # spacetype.gasEquipment()
92
+ # spacetype.hotWaterEquipment()
93
+ # spacetype.steamEquipment()
94
+ # spacetype.otherEquipment()
95
+ # #A bit more tricky
96
+ # spacetype.designSpecificationOutdoorAir()
97
+ # spacetype.spaceInfiltrationDesignFlowRates()
98
+ # end
99
+ # end
100
+ #
101
+ # #This method will take 1 variable this method will attempt to find the dominant schedule of the surround spaces
102
+ # #@author phylroy.lopez@nrcan.gc.ca
103
+ # #@param model [Object] (description)
104
+ # def self.set_wildcard_spacetype_schedules_to_dominant_schedule(model)
105
+ # #1.Find all spaces with wildcard spaces.
106
+ # #2.Iterate through spaces
107
+ # #2.1 Find all adjacent spaces
108
+ # #2.2 Determine dominant space type
109
+ # #2.2 Set the appropriate schedule for occ, lighting, plugs and
110
+ # end
111
+ # end #module SpaceTypes
112
+ # end #module Resources
113
+ # end
@@ -1,134 +1,134 @@
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
- # To change this template, choose Tools | Templates
21
- # and open the template in the editor.
22
- #require 'openstudio'
23
- #require 'win32/registry'
24
- require "#{File.dirname(__FILE__)}/btap"
25
-
26
- class Utilities
27
- #this will determine which diff client to use.. Windows must use kdiff3
28
- #this method will get the path of Kdiff3 from the registry.
29
- # def self.get_diff_client
30
- # Win32::Registry::HKEY_LOCAL_MACHINE.open('Software\Kdiff3') do |reg|
31
- # reg_typ, reg_val = reg.read('')
32
- # return reg_val
33
- # end
34
- # end
35
-
36
- #This method checks the bounds and raise an exception if the value is out of bounds.
37
- #@author phylroy.lopez@nrcan.gc.ca
38
- #@param left_value [Number]
39
- #@param left_operator [String]
40
- #@param center_value [Number]
41
- #@param right_operator [String]
42
- #@param right_value [Number]
43
- def self.check_bounds(left_value,left_operator,center_value,right_operator,right_value)
44
- operation = left_value.to_s + " " + left_operator.to_s + " " + center_value.to_s + " or " + center_value.to_s + " " + right_operator.to_s + " " + right_value.to_s
45
- raise("Error: in bounds." + operation_1 ) unless eval(operation +" ? true :false")
46
- end
47
-
48
- #This method will take 3 variables and will bring up Kdiff3 for a 2 or 3-way diff view of the OSM file.
49
- #argument model(s). This is handy for quickly viewing changes to the file during
50
- #runtime for debugging and QA.
51
- #@author phylroy.lopez@nrcan.gc.ca
52
- #@param model1 [OpenStudio::model::Model] A model object.
53
- #@param model2 [OpenStudio::model::Model] A model object.
54
- #@param model3 [OpenStudio::model::Model] A model object.
55
- def self.kdiff3_model_osm(model1, model2, model3 = "")
56
- Dir::mkdir("C:\\kdiff_test") unless File.exists?("C:\\kdiff_test")
57
- model1.save(OpenStudio::Path.new("c:\\kdiff_test\\diffA.osm"))
58
- model2.save(OpenStudio::Path.new("c:\\kdiff_test\\diffB.osm"))
59
- if model3 == ""
60
- system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.osm", "c:\\kdiff_test\\diffB.osm")
61
- else
62
- model3.save(OpenStudio::Path.new("c:\\kdiff_test\\C.osm"))
63
- system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.osm", "c:\\kdiff_test\\diffB.osm", "c:\\kdiff_test\\diffC.osm" )
64
- end
65
- FileUtils.rm_rf("C:\\kdiff_test")
66
-
67
- end
68
-
69
- #This method will take 3 variables and bring up Kdiff3 for a 2 or 3-way diff view of the OSM file.
70
- #The second argument is optional, it will compare the current model with the
71
- #argument model(s). This is handy for quickly viewing changes to the file during
72
- #runtime for debugging and QA.
73
- #@author phylroy.lopez@nrcan.gc.ca
74
- #@param model1 [OpenStudio::model::Model] A model object.
75
- #@param model2 [OpenStudio::model::Model] A model object.
76
- #@param model3 [OpenStudio::model::Model] A model object.
77
- def self.kdiff3_model_idf(model1, model2, model3 = "")
78
- Dir::mkdir("C:\\kdiff_test") unless File.exists?("C:\\kdiff_test")
79
-
80
- OpenStudio::EnergyPlus::ForwardTranslator.new().translateModel(model1).toIdfFile().save(OpenStudio::Path.new("c:\\kdiff_test\\diffA.idf"),true)
81
- self.sort_idf_file("c:\\kdiff_test\\diffA.idf")
82
- OpenStudio::EnergyPlus::ForwardTranslator.new().translateModel(model2).toIdfFile().save(OpenStudio::Path.new("c:\\kdiff_test\\diffB.idf"),true)
83
- self.sort_idf_file("c:\\kdiff_test\\diffB.idf")
84
- if model3 == ""
85
- system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.idf.sorted", "c:\\kdiff_test\\diffB.idf.sorted")
86
- else
87
- OpenStudio::EnergyPlus::ForwardTranslator.new().translateModel(model3).toIdfFile().save(OpenStudio::Path.new("c:\\kdiff_test\\diffC.idf"),true)
88
- self.sort_idf_file("c:\\kdiff_test\\diffC.idf")
89
- system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.idf.sorted", "c:\\kdiff_test\diffB.idf.sorted", "c:\\kdiff_test\diffC.idf.sorted" )
90
- end
91
- end
92
-
93
- #This method will sort an idf file and produce a sorted idf file. This is helpful for doing diffs on idf files.
94
- #@author phylroy.lopez@nrcan.gc.ca
95
- #@param idf_file [String]
96
- def self.sort_idf_file(idf_file)
97
- idf_model = OpenStudio::IdfFile::load(OpenStudio::Path.new(idf_file), "EnergyPlus".to_IddFileType).get
98
- save_filename = idf_file + ".sorted"
99
-
100
- # Iterate over all the IDF objects and put into a ruby array.
101
- # Note that you must strip the object name because for some reason it has
102
- # trailing characters
103
- sorted_idf = {}
104
- verobj = idf_model.versionObject
105
- if not verobj.empty?
106
- verobj = verobj.get
107
- objname = verobj.getString(0).get
108
- obj = verobj.to_s.gsub("!-", "!")
109
- sorted_idf["#{verobj.iddObject.name()} #{objname}"] = obj
110
- end
111
- idf_model.objects.each do |object|
112
- if object.iddObject.type != "CommentOnly".to_IddObjectType
113
- objname = object.name()
114
- objname = objname.to_s.strip
115
- if objname == ""
116
- # puts "[DEBUG] ObjectName is Blank, using first field"
117
- objname = object.getString(0).get
118
- end
119
- # puts "Class Name: #{object.iddObject.name()} Object Name: #{objname} Size: #{object.numFields()}"
120
-
121
- # Clean up the comment field. They comments flags change on translation!
122
- obj = object.to_s.gsub("!-", "!")
123
- sorted_idf["#{object.iddObject.name()} #{objname}"] = obj
124
- end
125
- end
126
-
127
- out = sorted_idf.sort #returns a nested array, 0 is key, 1 is value
128
- File.open(save_filename, 'w') do |file|
129
- out.each do |value|
130
- file << value[1]
131
- end
132
- end
133
- end
134
- end
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
+ # # To change this template, choose Tools | Templates
21
+ # # and open the template in the editor.
22
+ # #require 'openstudio'
23
+ # #require 'win32/registry'
24
+ # require "#{File.dirname(__FILE__)}/btap"
25
+ #
26
+ # class Utilities
27
+ # #this will determine which diff client to use.. Windows must use kdiff3
28
+ # #this method will get the path of Kdiff3 from the registry.
29
+ # # def self.get_diff_client
30
+ # # Win32::Registry::HKEY_LOCAL_MACHINE.open('Software\Kdiff3') do |reg|
31
+ # # reg_typ, reg_val = reg.read('')
32
+ # # return reg_val
33
+ # # end
34
+ # # end
35
+ #
36
+ # #This method checks the bounds and raise an exception if the value is out of bounds.
37
+ # #@author phylroy.lopez@nrcan.gc.ca
38
+ # #@param left_value [Number]
39
+ # #@param left_operator [String]
40
+ # #@param center_value [Number]
41
+ # #@param right_operator [String]
42
+ # #@param right_value [Number]
43
+ # def self.check_bounds(left_value,left_operator,center_value,right_operator,right_value)
44
+ # operation = left_value.to_s + " " + left_operator.to_s + " " + center_value.to_s + " or " + center_value.to_s + " " + right_operator.to_s + " " + right_value.to_s
45
+ # raise("Error: in bounds." + operation_1 ) unless eval(operation +" ? true :false")
46
+ # end
47
+ #
48
+ # #This method will take 3 variables and will bring up Kdiff3 for a 2 or 3-way diff view of the OSM file.
49
+ # #argument model(s). This is handy for quickly viewing changes to the file during
50
+ # #runtime for debugging and QA.
51
+ # #@author phylroy.lopez@nrcan.gc.ca
52
+ # #@param model1 [OpenStudio::model::Model] A model object.
53
+ # #@param model2 [OpenStudio::model::Model] A model object.
54
+ # #@param model3 [OpenStudio::model::Model] A model object.
55
+ # def self.kdiff3_model_osm(model1, model2, model3 = "")
56
+ # Dir::mkdir("C:\\kdiff_test") unless File.exists?("C:\\kdiff_test")
57
+ # model1.save(OpenStudio::Path.new("c:\\kdiff_test\\diffA.osm"))
58
+ # model2.save(OpenStudio::Path.new("c:\\kdiff_test\\diffB.osm"))
59
+ # if model3 == ""
60
+ # system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.osm", "c:\\kdiff_test\\diffB.osm")
61
+ # else
62
+ # model3.save(OpenStudio::Path.new("c:\\kdiff_test\\C.osm"))
63
+ # system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.osm", "c:\\kdiff_test\\diffB.osm", "c:\\kdiff_test\\diffC.osm" )
64
+ # end
65
+ # FileUtils.rm_rf("C:\\kdiff_test")
66
+ #
67
+ # end
68
+ #
69
+ # #This method will take 3 variables and bring up Kdiff3 for a 2 or 3-way diff view of the OSM file.
70
+ # #The second argument is optional, it will compare the current model with the
71
+ # #argument model(s). This is handy for quickly viewing changes to the file during
72
+ # #runtime for debugging and QA.
73
+ # #@author phylroy.lopez@nrcan.gc.ca
74
+ # #@param model1 [OpenStudio::model::Model] A model object.
75
+ # #@param model2 [OpenStudio::model::Model] A model object.
76
+ # #@param model3 [OpenStudio::model::Model] A model object.
77
+ # def self.kdiff3_model_idf(model1, model2, model3 = "")
78
+ # Dir::mkdir("C:\\kdiff_test") unless File.exists?("C:\\kdiff_test")
79
+ #
80
+ # OpenStudio::EnergyPlus::ForwardTranslator.new().translateModel(model1).toIdfFile().save(OpenStudio::Path.new("c:\\kdiff_test\\diffA.idf"),true)
81
+ # self.sort_idf_file("c:\\kdiff_test\\diffA.idf")
82
+ # OpenStudio::EnergyPlus::ForwardTranslator.new().translateModel(model2).toIdfFile().save(OpenStudio::Path.new("c:\\kdiff_test\\diffB.idf"),true)
83
+ # self.sort_idf_file("c:\\kdiff_test\\diffB.idf")
84
+ # if model3 == ""
85
+ # system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.idf.sorted", "c:\\kdiff_test\\diffB.idf.sorted")
86
+ # else
87
+ # OpenStudio::EnergyPlus::ForwardTranslator.new().translateModel(model3).toIdfFile().save(OpenStudio::Path.new("c:\\kdiff_test\\diffC.idf"),true)
88
+ # self.sort_idf_file("c:\\kdiff_test\\diffC.idf")
89
+ # system(self.get_diff_client + "\\kdiff3.exe", "c:\\kdiff_test\\diffA.idf.sorted", "c:\\kdiff_test\diffB.idf.sorted", "c:\\kdiff_test\diffC.idf.sorted" )
90
+ # end
91
+ # end
92
+ #
93
+ # #This method will sort an idf file and produce a sorted idf file. This is helpful for doing diffs on idf files.
94
+ # #@author phylroy.lopez@nrcan.gc.ca
95
+ # #@param idf_file [String]
96
+ # def self.sort_idf_file(idf_file)
97
+ # idf_model = OpenStudio::IdfFile::load(OpenStudio::Path.new(idf_file), "EnergyPlus".to_IddFileType).get
98
+ # save_filename = idf_file + ".sorted"
99
+ #
100
+ # # Iterate over all the IDF objects and put into a ruby array.
101
+ # # Note that you must strip the object name because for some reason it has
102
+ # # trailing characters
103
+ # sorted_idf = {}
104
+ # verobj = idf_model.versionObject
105
+ # if not verobj.empty?
106
+ # verobj = verobj.get
107
+ # objname = verobj.getString(0).get
108
+ # obj = verobj.to_s.gsub("!-", "!")
109
+ # sorted_idf["#{verobj.iddObject.name()} #{objname}"] = obj
110
+ # end
111
+ # idf_model.objects.each do |object|
112
+ # if object.iddObject.type != "CommentOnly".to_IddObjectType
113
+ # objname = object.name()
114
+ # objname = objname.to_s.strip
115
+ # if objname == ""
116
+ # # puts "[DEBUG] ObjectName is Blank, using first field"
117
+ # objname = object.getString(0).get
118
+ # end
119
+ # # puts "Class Name: #{object.iddObject.name()} Object Name: #{objname} Size: #{object.numFields()}"
120
+ #
121
+ # # Clean up the comment field. They comments flags change on translation!
122
+ # obj = object.to_s.gsub("!-", "!")
123
+ # sorted_idf["#{object.iddObject.name()} #{objname}"] = obj
124
+ # end
125
+ # end
126
+ #
127
+ # out = sorted_idf.sort #returns a nested array, 0 is key, 1 is value
128
+ # File.open(save_filename, 'w') do |file|
129
+ # out.each do |value|
130
+ # file << value[1]
131
+ # end
132
+ # end
133
+ # end
134
+ # end
@@ -2,41 +2,17 @@
2
2
  # Reopen the OpenStudio class to add methods to apply standards to this object
3
3
  class OpenStudio::Model::AirLoopHVAC
4
4
 
5
- # Sets all auto-sizeable fields to autosize
6
- def autosize
7
- self.autosizeDesignSupplyAirFlowRate
8
- end
9
-
10
- # Takes the values calculated by the EnergyPlus sizing routines
11
- # and puts them into this object model in place of the autosized fields.
12
- # Must have previously completed a run with sql output for this to work.
13
- def applySizingValues
14
-
15
- design_supply_air_flow_rate = self.autosizedDesignSupplyAirFlowRate
16
- if design_supply_air_flow_rate.is_initialized
17
- self.setDesignSupplyAirFlowRate(design_supply_air_flow_rate.get)
18
- end
19
-
20
- end
21
-
22
- # returns the autosized design supply air flow rate as an optional double
23
- def autosizedDesignSupplyAirFlowRate
24
-
25
- return self.model.getAutosizedValue(self, 'Design Supply Air Flow Rate', 'm3/s')
26
-
27
- end
28
-
29
5
  # Retrieves an airloop sum of air terminal minimum heating flow rates: sum(Vpz_min)
30
6
  def autosizeSumMinimumHeatingAirFlowRates
31
7
  result = OpenStudio::OptionalDouble.new
32
8
  name = self.name.get.upcase
33
9
  sql = self.model.sqlFile
34
10
  if sql.is_initialized
35
- sql = sql.get
36
- query = "SELECT Value
11
+ sql = sql.get
12
+ query = "SELECT Value
37
13
  FROM tabulardatawithstrings
38
- WHERE ReportName='ComponentSizingSummary'
39
- AND ReportForString='Entire Facility'
14
+ WHERE ReportName='ComponentSizingSummary'
15
+ AND ReportForString='Entire Facility'
40
16
  AND TableName='AirLoopHVAC'
41
17
  AND ColumnName='Sum of Air Terminal Minimum Heating Flow Rates'
42
18
  AND RowName='#{name}'
@@ -53,68 +29,17 @@ class OpenStudio::Model::AirLoopHVAC
53
29
 
54
30
  end
55
31
 
56
- # Retrieve an airloop's design outdoor air intake (Vot)
57
- # Ideally, this would only be used to retrieve Vot when
58
- # calculated by EnergyPlus' built-in design VRP calculations
59
- def autosize621OutdoorAirIntakeFlow
60
- flow_types = ['Heating', 'Cooling']
61
- flow_rates = []
62
- flow_types.each do |flow_type|
63
- result = OpenStudio::OptionalDouble.new
64
- name = self.name.get.upcase
65
- sql = self.model.sqlFile
66
- if sql.is_initialized
67
- sql = sql.get
68
- query = "SELECT Value
69
- FROM tabulardatawithstrings
70
- WHERE ReportName='Standard62.1Summary'
71
- AND ReportForString='Entire Facility'
72
- AND TableName='System Ventilation Requirements for #{flow_type}'
73
- AND ColumnName='Outdoor Air Intake Flow Vot'
74
- AND RowName='#{name}'
75
- AND Units='m3/s'"
76
- val = sql.execAndReturnFirstDouble(query)
77
- if val.is_initialized
78
- result = OpenStudio::OptionalDouble.new(val.get)
79
- end
80
- # Inconsistency in column name in EnergyPlus 9.0:
81
- # "Outdoor Air Intake Flow - Vot" vs "Outdoor Air Intake Flow Vot"
82
- # The following could be deleted if the inconsistency was ever fixed
83
- if result.to_f == 0.0
84
- query = "SELECT Value
85
- FROM tabulardatawithstrings
86
- WHERE ReportName='Standard62.1Summary'
87
- AND ReportForString='Entire Facility'
88
- AND TableName='System Ventilation Requirements for #{flow_type}'
89
- AND ColumnName='Outdoor Air Intake Flow - Vot'
90
- AND RowName='#{name}'
91
- AND Units='m3/s'"
92
- val = sql.execAndReturnFirstDouble(query)
93
- if val.is_initialized
94
- result = OpenStudio::OptionalDouble.new(val.get)
95
- end
96
- end
97
- else
98
- OpenStudio::logFree(OpenStudio::Error, 'openstudio.model.Model', 'Model has no sql file containing results, cannot lookup data.')
99
- end
100
- flow_rates << result.to_f
101
- end
102
-
103
- return flow_rates.max
104
-
105
- end
106
-
107
32
  # Retrieve an airloop's sum of air terminal maximum flow rates: sum(Vpz)
108
33
  def autosizeSumAirTerminalMaxAirFlowRate
109
34
  result = OpenStudio::OptionalDouble.new
110
35
  name = self.name.get.upcase
111
36
  sql = self.model.sqlFile
112
37
  if sql.is_initialized
113
- sql = sql.get
114
- query = "SELECT Value
38
+ sql = sql.get
39
+ query = "SELECT Value
115
40
  FROM tabulardatawithstrings
116
- WHERE ReportName='ComponentSizingSummary'
117
- AND ReportForString='Entire Facility'
41
+ WHERE ReportName='ComponentSizingSummary'
42
+ AND ReportForString='Entire Facility'
118
43
  AND TableName='AirLoopHVAC'
119
44
  AND ColumnName='Sum of Air Terminal Maximum Flow Rates'
120
45
  AND RowName='#{name}'