openstudio-standards 0.3.0 → 0.3.1.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/data/geometry/ASHRAELargeOffice.json +4 -4
  3. data/data/geometry/ASHRAESuperMarket.json +29 -38
  4. data/data/standards/OpenStudio_Standards-deer-ALL-comstock(space_types).xlsx +0 -0
  5. data/data/standards/metadata_units_OpenStudio_Standards-deer-ALL-comstockspace_types.csv +172 -0
  6. data/data/standards/test_performance_expected_dd_results.csv +1890 -2016
  7. data/lib/openstudio-standards/btap/analysis.rb +389 -389
  8. data/lib/openstudio-standards/btap/bridging.rb +2099 -0
  9. data/lib/openstudio-standards/btap/btap.model.rb +717 -717
  10. data/lib/openstudio-standards/btap/btap.rb +33 -30
  11. data/lib/openstudio-standards/btap/economics.rb +1163 -1163
  12. data/lib/openstudio-standards/btap/envelope.rb +4 -4
  13. data/lib/openstudio-standards/btap/equest.rb +2524 -2524
  14. data/lib/openstudio-standards/btap/fileio.rb +10 -0
  15. data/lib/openstudio-standards/btap/measures.rb +1515 -1515
  16. data/lib/openstudio-standards/btap/mpc.rb +554 -554
  17. data/lib/openstudio-standards/btap/reporting.rb +287 -287
  18. data/lib/openstudio-standards/btap/simmanager.rb +759 -759
  19. data/lib/openstudio-standards/btap/spaceloads.rb +439 -439
  20. data/lib/openstudio-standards/btap/spacetypes.rb +113 -113
  21. data/lib/openstudio-standards/btap/utilities.rb +134 -134
  22. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVAC.rb +8 -83
  23. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingWater.rb +3 -99
  24. data/lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb +81 -75
  25. data/lib/openstudio-standards/hvac_sizing/Siz.Model.rb +7 -306
  26. data/lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb +75 -98
  27. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.Model.rb +41 -14
  28. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Model.rb +40 -14
  29. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Pump.rb +6 -6
  30. data/lib/openstudio-standards/prototypes/common/buildings/Prototype.LargeOffice.rb +7 -5
  31. data/lib/openstudio-standards/prototypes/common/buildings/Prototype.SuperMarket.rb +1 -23
  32. data/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb +1 -1
  33. data/lib/openstudio-standards/prototypes/common/objects/Prototype.PumpVariableSpeed.rb +3 -3
  34. data/lib/openstudio-standards/prototypes/common/objects/Prototype.ServiceWaterHeating.rb +93 -4
  35. data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +17 -4
  36. data/lib/openstudio-standards/prototypes/common/objects/Prototype.refrigeration.rb +5 -4
  37. data/lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb +24 -4
  38. data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +41 -25
  39. data/lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctParallelPIUReheat.rb +3 -3
  40. data/lib/openstudio-standards/standards/Standards.BoilerHotWater.rb +18 -0
  41. data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +13 -10
  42. data/lib/openstudio-standards/standards/Standards.CoilDX.rb +5 -3
  43. data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +11 -8
  44. data/lib/openstudio-standards/standards/Standards.Construction.rb +1 -1
  45. data/lib/openstudio-standards/standards/Standards.Fan.rb +6 -6
  46. data/lib/openstudio-standards/standards/Standards.Model.rb +88 -66
  47. data/lib/openstudio-standards/standards/Standards.PlantLoop.rb +2 -2
  48. data/lib/openstudio-standards/standards/Standards.Pump.rb +21 -19
  49. data/lib/openstudio-standards/standards/Standards.Space.rb +41 -36
  50. data/lib/openstudio-standards/standards/Standards.SpaceType.rb +2 -2
  51. data/lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb +3 -3
  52. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.ref_cases.json +510 -0
  53. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_compressors.json +18 -0
  54. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.refrigeration_walkins.json +410 -0
  55. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.spc_typ.json +2 -2
  56. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.ref_cases.json +510 -0
  57. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_compressors.json +18 -0
  58. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.refrigeration_walkins.json +410 -0
  59. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.spc_typ.json +2 -2
  60. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.ref_cases.json +510 -0
  61. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_compressors.json +18 -0
  62. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.refrigeration_walkins.json +410 -0
  63. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.spc_typ.json +2 -2
  64. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.ref_cases.json +510 -0
  65. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_compressors.json +18 -0
  66. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.refrigeration_walkins.json +410 -0
  67. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.spc_typ.json +2 -2
  68. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.spc_typ.json +2 -2
  69. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.spc_typ.json +2 -2
  70. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.AirLoopHVAC.rb +12 -3
  71. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.Model.rb +5 -3
  72. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.ZoneHVACComponent.rb +6 -6
  73. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.rb +4 -3
  74. data/lib/openstudio-standards/standards/deer/deer_1985/comstock_deer_1985/data/comstock_deer_1985.spc_typ.json +405 -405
  75. data/lib/openstudio-standards/standards/deer/deer_1996/comstock_deer_1996/data/comstock_deer_1996.spc_typ.json +405 -405
  76. data/lib/openstudio-standards/standards/deer/deer_2003/comstock_deer_2003/data/comstock_deer_2003.spc_typ.json +405 -405
  77. data/lib/openstudio-standards/standards/deer/deer_2003/deer_2003.ThermalZone.rb +21 -0
  78. data/lib/openstudio-standards/standards/deer/deer_2007/comstock_deer_2007/data/comstock_deer_2007.spc_typ.json +405 -405
  79. data/lib/openstudio-standards/standards/deer/deer_2007/deer_2007.ThermalZone.rb +21 -0
  80. data/lib/openstudio-standards/standards/deer/deer_2011/comstock_deer_2011/data/comstock_deer_2011.spc_typ.json +405 -405
  81. data/lib/openstudio-standards/standards/deer/deer_2011/deer_2011.ThermalZone.rb +21 -0
  82. data/lib/openstudio-standards/standards/deer/deer_2014/comstock_deer_2014/data/comstock_deer_2014.spc_typ.json +405 -405
  83. data/lib/openstudio-standards/standards/deer/deer_2014/deer_2014.ThermalZone.rb +21 -0
  84. data/lib/openstudio-standards/standards/deer/deer_2015/comstock_deer_2015/data/comstock_deer_2015.spc_typ.json +405 -405
  85. data/lib/openstudio-standards/standards/deer/deer_2015/deer_2015.ThermalZone.rb +21 -0
  86. data/lib/openstudio-standards/standards/deer/deer_2017/comstock_deer_2017/data/comstock_deer_2017.spc_typ.json +405 -405
  87. data/lib/openstudio-standards/standards/deer/deer_2017/deer_2017.ThermalZone.rb +21 -0
  88. data/lib/openstudio-standards/standards/deer/deer_2020/comstock_deer_2020/data/comstock_deer_2020.spc_typ.json +405 -405
  89. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.AirLoopHVAC.rb +8 -0
  90. data/lib/openstudio-standards/standards/deer/deer_2020/deer_2020.ThermalZone.rb +21 -0
  91. data/lib/openstudio-standards/standards/deer/deer_2025/comstock_deer_2025/data/comstock_deer_2025.spc_typ.json +405 -405
  92. data/lib/openstudio-standards/standards/deer/deer_2030/comstock_deer_2030/data/comstock_deer_2030.spc_typ.json +405 -405
  93. data/lib/openstudio-standards/standards/deer/deer_2035/comstock_deer_2035/data/comstock_deer_2035.spc_typ.json +405 -405
  94. data/lib/openstudio-standards/standards/deer/deer_2040/comstock_deer_2040/data/comstock_deer_2040.spc_typ.json +405 -405
  95. data/lib/openstudio-standards/standards/deer/deer_2045/comstock_deer_2045/data/comstock_deer_2045.spc_typ.json +405 -405
  96. data/lib/openstudio-standards/standards/deer/deer_2050/comstock_deer_2050/data/comstock_deer_2050.spc_typ.json +405 -405
  97. data/lib/openstudio-standards/standards/deer/deer_2055/comstock_deer_2055/data/comstock_deer_2055.spc_typ.json +405 -405
  98. data/lib/openstudio-standards/standards/deer/deer_2060/comstock_deer_2060/data/comstock_deer_2060.spc_typ.json +405 -405
  99. data/lib/openstudio-standards/standards/deer/deer_2065/comstock_deer_2065/data/comstock_deer_2065.spc_typ.json +405 -405
  100. data/lib/openstudio-standards/standards/deer/deer_2070/comstock_deer_2070/data/comstock_deer_2070.spc_typ.json +405 -405
  101. data/lib/openstudio-standards/standards/deer/deer_2075/comstock_deer_2075/data/comstock_deer_2075.spc_typ.json +405 -405
  102. data/lib/openstudio-standards/standards/deer/deer_pre_1975/comstock_deer_pre_1975/data/comstock_deer_pre_1975.spc_typ.json +405 -405
  103. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/btap_pre1980.rb +1 -1
  104. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_3_and_8_single_speed.rb +3 -1
  105. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_4.rb +3 -1
  106. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_6.rb +2 -2
  107. data/lib/openstudio-standards/standards/necb/ECMS/data/curves.json +233 -0
  108. data/lib/openstudio-standards/standards/necb/ECMS/data/unitary_acs.json +180 -0
  109. data/lib/openstudio-standards/standards/necb/ECMS/ecms.rb +6 -1
  110. data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +839 -290
  111. data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +102 -66
  112. data/lib/openstudio-standards/standards/necb/NECB2011/data/fuel_type_sets.json +85 -8
  113. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/HighriseApartment.osm +2483 -992
  114. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LowriseApartment.osm +4 -336
  115. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/MidriseApartment.osm +228 -231
  116. data/lib/openstudio-standards/standards/necb/NECB2011/data/heat_pumps_heating.json +12 -18
  117. data/lib/openstudio-standards/standards/necb/NECB2011/data/space_type_unit_definitions.txt +76 -0
  118. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_multi_speed.rb +6 -1
  119. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_single_speed.rb +111 -24
  120. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_2_and_5.rb +1 -0
  121. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_multi_speed.rb +3 -1
  122. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_single_speed.rb +64 -16
  123. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_4.rb +61 -17
  124. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_6.rb +128 -0
  125. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +252 -23
  126. data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +316 -20
  127. data/lib/openstudio-standards/standards/necb/NECB2011/qaqc/necb_qaqc.rb +1 -1
  128. data/lib/openstudio-standards/standards/necb/NECB2011/service_water_heating.rb +3 -5
  129. data/lib/openstudio-standards/standards/necb/NECB2011/system_fuels.rb +38 -0
  130. data/lib/openstudio-standards/standards/necb/NECB2015/data/heat_pumps_heating.json +16 -24
  131. data/lib/openstudio-standards/standards/necb/NECB2015/hvac_systems.rb +48 -25
  132. data/lib/openstudio-standards/standards/necb/NECB2020/building_envelope.rb +3 -3
  133. data/lib/openstudio-standards/standards/necb/NECB2020/data/chillers.json +36 -19
  134. data/lib/openstudio-standards/standards/necb/NECB2020/data/furnaces.json +19 -4
  135. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps.json +20 -40
  136. data/lib/openstudio-standards/standards/necb/NECB2020/data/heat_pumps_heating.json +74 -36
  137. data/lib/openstudio-standards/standards/necb/NECB2020/necb_2020.rb +0 -2
  138. data/lib/openstudio-standards/standards/necb/NECB2020/service_water_heating.rb +123 -56
  139. data/lib/openstudio-standards/standards/necb/common/btap_data.rb +124 -2
  140. data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +15 -2
  141. data/lib/openstudio-standards/standards/necb/common/necb_reference_runs.csv +1 -1
  142. data/lib/openstudio-standards/utilities/simulation.rb +1 -1
  143. data/lib/openstudio-standards/version.rb +1 -1
  144. data/lib/openstudio-standards/weather/Weather.stat_file.rb +33 -1
  145. data/lib/openstudio-standards.rb +1 -0
  146. metadata +14 -121
  147. data/data/standards/OpenStudio_Standards-ashrae_90_1.xlsx +0 -0
  148. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.ddy +0 -2342
  149. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw +0 -8768
  150. data/data/weather/CAN_ON_Kingston.AP.718200_TMYx.2004-2018.stat +0 -700
  151. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.ddy +0 -2342
  152. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw +0 -8768
  153. data/data/weather/CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.stat +0 -700
  154. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.ddy +0 -2342
  155. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw +0 -8768
  156. data/data/weather/CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.stat +0 -700
  157. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.ddy +0 -276
  158. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw +0 -8768
  159. data/data/weather/CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.stat +0 -611
  160. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.ddy +0 -276
  161. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.epw +0 -8768
  162. data/data/weather/CAN_QC_Granby.710367_TMYx.2004-2018.stat +0 -610
  163. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.ddy +0 -2342
  164. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw +0 -8768
  165. data/data/weather/CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.stat +0 -700
  166. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.ddy +0 -2342
  167. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw +0 -8768
  168. data/data/weather/CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.stat +0 -700
  169. data/lib/openstudio-standards/hvac_sizing/Siz.AirConditionerVariableRefrigerantFlow.rb +0 -81
  170. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatCoolVAVChngByp.rb +0 -27
  171. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAir.rb +0 -69
  172. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.rb +0 -178
  173. data/lib/openstudio-standards/hvac_sizing/Siz.AirLoopHVACUnitarySystem.rb +0 -27
  174. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolCooledBeam.rb +0 -27
  175. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolFourPipeInduction.rb +0 -27
  176. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctConstVolReheat.rb +0 -27
  177. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctParallelPIUReheat.rb +0 -67
  178. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctSeriesPIUReheat.rb +0 -27
  179. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctUncontrolled.rb +0 -30
  180. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolNoReheat.rb +0 -27
  181. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVHeatAndCoolReheat.rb +0 -27
  182. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVNoReheat.rb +0 -68
  183. data/lib/openstudio-standards/hvac_sizing/Siz.AirTermSnglDuctVAVReheat.rb +0 -68
  184. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerHotWater.rb +0 -42
  185. data/lib/openstudio-standards/hvac_sizing/Siz.BoilerSteam.rb +0 -27
  186. data/lib/openstudio-standards/hvac_sizing/Siz.ChillerElectricEIR.rb +0 -58
  187. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXMultiSpeed.rb +0 -171
  188. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXSingleSpeed.rb +0 -56
  189. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXTwoSpeed.rb +0 -89
  190. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingDXVariableRefrigerantFlow.rb +0 -50
  191. data/lib/openstudio-standards/hvac_sizing/Siz.CoilCoolingWaterToAirHeatPumpEquationFit.rb +0 -69
  192. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXMultiSpeed.rb +0 -120
  193. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXSingleSpeed.rb +0 -56
  194. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDXVariableRefrigerantFlow.rb +0 -41
  195. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingDesuperheater.rb +0 -27
  196. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingElectric.rb +0 -30
  197. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGas.rb +0 -30
  198. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingGasMultiStage.rb +0 -68
  199. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWater.rb +0 -61
  200. data/lib/openstudio-standards/hvac_sizing/Siz.CoilHeatingWaterToAirHeatPumpEquationFit.rb +0 -57
  201. data/lib/openstudio-standards/hvac_sizing/Siz.CoilWaterHeatingDesuperheater.rb +0 -27
  202. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerOutdoorAir.rb +0 -59
  203. data/lib/openstudio-standards/hvac_sizing/Siz.ControllerWaterCoil.rb +0 -49
  204. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerSingleSpeed.rb +0 -90
  205. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerTwoSpeed.rb +0 -83
  206. data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerVariableSpeed.rb +0 -57
  207. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictCooling.rb +0 -27
  208. data/lib/openstudio-standards/hvac_sizing/Siz.DistrictHeating.rb +0 -27
  209. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerDirectResearchSpecial.rb +0 -27
  210. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeCoolerIndirectResearchSpecial.rb +0 -27
  211. data/lib/openstudio-standards/hvac_sizing/Siz.EvaporativeFluidCoolerSingleSpeed.rb +0 -27
  212. data/lib/openstudio-standards/hvac_sizing/Siz.FanConstantVolume.rb +0 -29
  213. data/lib/openstudio-standards/hvac_sizing/Siz.FanOnOff.rb +0 -27
  214. data/lib/openstudio-standards/hvac_sizing/Siz.FanVariableVolume.rb +0 -29
  215. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsConstantSpeed.rb +0 -55
  216. data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsVariableSpeed.rb +0 -55
  217. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerAirToAirSensibleAndLatent.rb +0 -38
  218. data/lib/openstudio-standards/hvac_sizing/Siz.HeatExchangerFluidToFluid.rb +0 -27
  219. data/lib/openstudio-standards/hvac_sizing/Siz.HumidifierSteamElectric.rb +0 -27
  220. data/lib/openstudio-standards/hvac_sizing/Siz.PlantLoop.rb +0 -42
  221. data/lib/openstudio-standards/hvac_sizing/Siz.PumpConstantSpeed.rb +0 -59
  222. data/lib/openstudio-standards/hvac_sizing/Siz.PumpVariableSpeed.rb +0 -59
  223. data/lib/openstudio-standards/hvac_sizing/Siz.SizingSystem.rb +0 -48
  224. data/lib/openstudio-standards/hvac_sizing/Siz.WaterHeaterMixed.rb +0 -16
  225. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveElectric.rb +0 -27
  226. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACBaseboardConvectiveWater.rb +0 -27
  227. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACFourPipeFanCoil.rb +0 -27
  228. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACHighTemperatureRadiant.rb +0 -27
  229. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACIdealLoadsAirSystem.rb +0 -27
  230. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantConstFlow.rb +0 -27
  231. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTempRadiantVarFlow.rb +0 -27
  232. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACLowTemperatureRadiantElectric.rb +0 -27
  233. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalAirConditioner.rb +0 -88
  234. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACPackagedTerminalHeatPump.rb +0 -88
  235. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACTerminalUnitVariableRefrigerantFlow.rb +0 -104
  236. data/lib/openstudio-standards/hvac_sizing/Siz.ZoneHVACUnitHeater.rb +0 -27
  237. 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}'