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,759 +1,759 @@
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 "SecureRandom"
21
-
22
- module BTAP
23
-
24
- module SimManager
25
-
26
- #This method will simulate all files in a folder.
27
- #@author phylroy.lopez@nrcan.gc.ca
28
- #@param folder [String] folder
29
- def self.simulate_all_files_in_folder(folder)
30
- osm_files = BTAP::FileIO::get_find_files_from_folder_by_extension(folder, ".osm")
31
- self.simulate_files(folder,osm_files)
32
- end
33
-
34
- #This method will simulate all files in a array.
35
- #@author phylroy.lopez@nrcan.gc.ca
36
- #@param folder Array[String] folder
37
- def self.simulate_files(folder,osm_files)
38
-
39
- co = OpenStudio::Runmanager::ConfigOptions.new()
40
- co.fastFindEnergyPlus()
41
- rm = OpenStudio::Runmanager::RunManager.new("SecureRandom.hex.db", true)
42
- rm.setPaused(false)
43
- counter = 0
44
-
45
- osm_files.each do |model_path|
46
- counter = counter + 1
47
- work_items = OpenStudio::Runmanager::WorkItemVector.new
48
- work_items << OpenStudio::Runmanager::WorkItem.new("ModelToIdf".to_JobType)
49
- work_items << OpenStudio::Runmanager::WorkItem.new("ExpandObjects".to_JobType)
50
- # ruby_job = OpenStudio::Runmanager::RubyJobBuilder.new(cost_injection)
51
- # ruby_job.setIncludeDir(OpenStudio::Path.new("#{$OpenStudio_Dir}"))
52
- # work_items << ruby_job.toWorkItem
53
- work_items << OpenStudio::Runmanager::WorkItem.new("EnergyPlus".to_JobType)
54
- #work_items << OpenStudio::Runmanager::WorkItem.new("ReadVars".to_JobType)
55
- work_items << OpenStudio::Runmanager::WorkItem.new("OpenStudioPostProcess".to_JobType)
56
- workflow = OpenStudio::Runmanager::Workflow.new(work_items)
57
- params = OpenStudio::Runmanager::JobParams.new;
58
- params.append("cleanoutfiles", "standard");
59
- workflow.add(params)
60
- workflow.add(co.getTools())
61
- rm.enqueue( workflow.create( OpenStudio::Path.new("#{folder}/#{File.basename(model_path, ".osm")}"), OpenStudio::Path.new(model_path)),false)
62
- # puts "#{model_path} enqueued. #{counter} of #{osm_files.size}"
63
- end
64
- #rm.showStatusDialog()
65
- rm.waitForFinished()
66
- end
67
-
68
-
69
-
70
- #This method will run the simulation. You must provide a folder where you wish
71
- #to run the simulation, and if not previously defined, the weather file. This will delete and recreate the folder provided to ensure that it is clean.
72
- #@author Phylroy A. Lopez
73
- #@param model [OpenStudio::model::Model] A model object
74
- #@param folder_name [String] a simple string of the simulation folder path, remember to escape the slashes..(i.e. // not / )
75
- #@param epw_path [String] a simple string of the epw file path, remember to escape the slashes..(i.e. // not / )
76
- #@return [OpenStudio::Model::Model] the OpenStudio model object (self reference).
77
- def self.run_simulation( model, folder_name,epw_path = "" )
78
-
79
- if not File.exists?(epw_path) and not File.exists?(model.getWeatherFile.path.get.to_s)
80
- raise ("Error: Weather file not set. Cannot run. Please set weather file using the OpenStudio::Model::WeatherFile::setWeatherFile(model,filepath) command ")
81
- else if epw_path != ""
82
- BTAP::Site::set_weather_file(model,epw_path)
83
- end
84
- #Create RunManager
85
- Dir::mkdir(folder_name) unless File.exists?( folder_name )
86
- process_manager = BTAP::SimManager::ProcessManager.new( folder_name )
87
- process_manager.addModel(model)
88
- process_manager.start_sims
89
- end
90
- return model
91
- end
92
-
93
-
94
-
95
- class ProcessManager
96
-
97
- attr_accessor :run_manager
98
- attr_accessor :workflow
99
- attr_accessor :model_array
100
- attr_accessor :results_folder
101
-
102
-
103
- def getPaths
104
- #set the Energyplus.exe path variable
105
- @ep_path = OpenStudio.getEnergyPlusExecutable
106
- #set the root folder for E+
107
- @ep_parent_path = OpenStudio.getEnergyPlusDirectory
108
-
109
- #find IDD path
110
- idd_path = @ep_parent_path.to_s + "/Energy+.idd"
111
-
112
- if (not File.exists?(idd_path))
113
- raise("Cannot locate the input data dictionary (IDD) in the EnergyPlus directory #{idd_path}. Correct the EXE path and try again.")
114
- return(false)
115
- end
116
-
117
- #Find the expand object exe.
118
- expandobjects_path = ''
119
- expandobjects_path = @ep_parent_path.to_s + '/ExpandObjects.exe'
120
- if (not File.exists?(expandobjects_path))
121
- UI.messagebox("Cannot locate ExpandObjects in the EnergyPlus directory. Correct the EXE path and try again.")
122
- end
123
-
124
- #Find the ReadVarsESO.exe
125
-
126
- @readvars_path = ""
127
- if (/mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM))
128
- @readvars_path = @ep_parent_path.to_s + "/PostProcess/ReadVarsESO.exe"
129
- else
130
- @readvars_path = @ep_parent_path.to_s + '/readvars'
131
- end
132
-
133
-
134
- if (not File.exists?(@readvars_path))
135
- @readvars_path = @ep_parent_path.to_s + '/readvars.exe'
136
- end
137
- if (not File.exists?(@readvars_path))
138
- UI.messagebox("Cannot locate ReadVarsESO in the EnergyPlus directory. Correct the EXE path and try again.")
139
- return(false)
140
- end
141
- end
142
-
143
- #This method finds the energyplus folder and returns the path string.
144
- #@author Phylroy A. Lopez
145
- #@return [String] a simple string of the epw file path, remember to escape the slashes..(i.e. // not / )
146
- def self.find_energyplus_folder()
147
- return OpenStudio.getEnergyPlusDirectory.to_s
148
- end
149
-
150
- #This method finds the eReadVarsESO.exe and returns the path string.
151
- #@author Phylroy A. Lopez
152
- #@return [String] readvars_path a simple string of the eReadVarsESO.exe file path, remember to escape the slashes..(i.e. // not / )
153
- def self.find_read_vars_eso()
154
- #Find the ReadVarsESO.exe
155
- readvars_path = ""
156
- ep_parent_path = self.find_energyplus_folder()
157
- if (/mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM))
158
- readvars_path = ep_parent_path.to_s + "/PostProcess/ReadVarsESO.exe"
159
- else
160
- readvars_path = ep_parent_path.to_s + '/readvars'
161
- end
162
- if (not File.exists?(readvars_path))
163
- readvars_path = ep_parent_path.to_s + '/readvars.exe'
164
- end
165
- if (not File.exists?(readvars_path))
166
- raise("Cannot locate ReadVarsESO in the EnergyPlus directory #{ep_parent_path}. Correct the EXE path and try again.")
167
- end
168
- return readvars_path
169
- end
170
-
171
- #This method initializes the Analysis Folder.
172
- #@author Phylroy A. Lopez
173
- #@param analysisFolder [String] a simple string of the Analysis Folder file path, remember to escape the slashes..(i.e. // not / )
174
- def initialize(analysisFolder)
175
-
176
- @model_array = Array
177
- #set Analysis Folder.
178
- @analysisFolder = analysisFolder
179
- #FileUtils.rm_rf(@analysisFolder)
180
- FileUtils.mkdir_p("#{@analysisFolder}")
181
- FileUtils.mkdir_p("#{@analysisFolder}/simulations") unless File.exists?("#{@analysisFolder}/simulations")
182
- FileUtils.mkdir_p("#{@analysisFolder}/results") unless File.exists?("#{@analysisFolder}/results")
183
- #create Runmanager
184
- runmanager_db_path = OpenStudio::Path.new(@analysisFolder + "\\runmanager.sql")
185
- #FileUtils.rm(runmanager_db_path.to_s) if OpenStudio::exists(runmanager_db_path)
186
- #OpenStudio::Runmanager::ConfigOptions::setMaxLocalJobs(6)
187
- @run_manager = OpenStudio::Runmanager::RunManager.new(runmanager_db_path, true)
188
-
189
-
190
- #create Workflow.
191
- @workflow = OpenStudio::Runmanager::Workflow.new();
192
-
193
- #Set up tools for workflow.
194
- self.getPaths
195
- tools = OpenStudio::Runmanager::Tools.new()
196
- tools.append(OpenStudio::Runmanager::ToolInfo.new("readvars", OpenStudio::Runmanager::ToolVersion.new(), OpenStudio::Path.new(@readvars_path)))
197
- expand = OpenStudio::Runmanager::JobFactory::createExpandObjectsJob(tools, OpenStudio::Runmanager::JobParams.new(), OpenStudio::Runmanager::Files.new())
198
- #readvars = OpenStudio::Runmanager::JobFactory::createReadVarsJob(tools, OpenStudio::Runmanager::JobParams.new(), OpenStudio::Runmanager::Files.new())
199
-
200
- #Create ModeltoIDF->Expand->EnergyPlus->ReadVars workflow.
201
- @workflow.addJob(OpenStudio::Runmanager::JobType.new("ModelToIdf"));
202
- @workflow.addJob( OpenStudio::Runmanager::JobType.new("ExpandObjects") )
203
- @workflow.addJob(OpenStudio::Runmanager::JobType.new("EnergyPlus"));
204
- #@workflow.addJob(OpenStudio::Runmanager::JobType.new("OpenStudioPostProcess"));
205
- #@workflow.addJob(OpenStudio::Runmanager::JobType.new("ReadVars"))
206
- @workflow.add(OpenStudio::Runmanager::ConfigOptions::makeTools(
207
- @ep_parent_path,
208
- OpenStudio::Path.new,
209
- OpenStudio::Path.new,
210
- $OpenStudio_RubyExeDir,
211
- OpenStudio::Path.new))
212
- tools.append(OpenStudio::Runmanager::ToolInfo.new("readvars", OpenStudio::Runmanager::ToolVersion.new(), OpenStudio::Path.new(@readvars_path)))
213
- #create Project Database
214
- #create the project database
215
- @projectPath = OpenStudio::Path.new(@analysisFolder + "\\projectdb.osp")
216
- FileUtils.rm(@projectPath.to_s) if OpenStudio::exists(@projectPath)
217
- database = OpenStudio::Project::ProjectDatabase.new(@projectPath, @run_manager)
218
- end
219
-
220
- #This method adds the model to the folder.
221
- #@author phylroy.lopez@nrcan.gc.ca
222
- #@param model [OpenStudio::model::Model] A model object
223
- #@param folder [String]
224
- #@return [String] self
225
- def addModel(model, folder = @analysisFolder )
226
-
227
- run_name = model.building.get.name.get.to_s
228
- working_folder = OpenStudio::Path.new(folder.to_s + "\\simulations\\" + run_name )
229
- osm_save_path = OpenStudio::Path.new(folder.to_s + "\\simulations\\" + run_name + "\\" + run_name + ".osm" )
230
- model.save(OpenStudio::Path.new(osm_save_path), true);
231
- @run_manager.enqueue(@workflow.create(working_folder, osm_save_path, model.getWeatherFile.path.get),true)
232
- return self
233
- end
234
-
235
- #This method simulates all files in a folder.
236
- #@author phylroy.lopez@nrcan.gc.ca
237
- #@param folder [String]
238
- def simulate_all_files_in_folder(folder)
239
- co = OpenStudio::Runmanager::ConfigOptions.new()
240
- co.fastFindEnergyPlus()
241
- @run_manager.showStatusDialog()
242
- @workflow = OpenStudio::Runmanager::Workflow.new("ModelToIdf->ExpandObjects->EnergyPlus")
243
-
244
- @workflow.add(co.getTools())
245
-
246
- BTAP::FileIO::get_find_files_from_folder_by_extension(folder, ".osm").each do |model_path|
247
- basename = File.basename(model_path, ".osm")
248
- proc_folder = "#{folder}/#{basename}"
249
- @run_manager.enqueue( @workflow.create( OpenStudio::Path.new(proc_folder), OpenStudio::Path.new(model_path)),true)
250
- @run_manager.setPaused(false)
251
- GC.start()
252
- end
253
- @run_manager.showStatusDialog()
254
- @run_manager.waitForFinished()
255
-
256
- end
257
-
258
-
259
-
260
- def start_sims
261
- unless File.exist?(@analysisFolder)
262
- Dir.mkdir(@analysisFolder)
263
- end
264
- @run_manager.showStatusDialog()
265
- @run_manager.waitForFinished()
266
- end
267
-
268
- class SummaryReport
269
- # End Uses data
270
- End_use_report_name = 'AnnualBuildingUtilityPerformanceSummary'
271
- End_use_reportForString = 'Entire Facility'
272
- End_use_table_name = 'End Uses'
273
- Fuel_types = [
274
- ['Electricity', 'GJ'],
275
- ['Natural Gas', 'GJ'],
276
- ['Other Fuel', 'GJ'],
277
- ['District Cooling', 'GJ'],
278
- ['District Heating', 'GJ'],
279
- ['Water', 'm3']]
280
- End_use_types = [
281
- 'Heating',
282
- 'Cooling',
283
- 'Interior Lighting',
284
- 'Exterior Lighting',
285
- 'Interior Equipment',
286
- 'Exterior Equipment',
287
- 'Fans',
288
- 'Pumps',
289
- 'Heat Rejection',
290
- 'Humidification',
291
- 'Heat Recovery',
292
- 'Water Systems',
293
- 'Refrigeration',
294
- 'Generators'
295
- ]
296
-
297
-
298
- def get_header
299
- end_use_header_array = ""
300
- #Print Header
301
- end_use_header = end_use_header + "OSM File,"
302
- end_use_header = end_use_header + "SQL File,"
303
- end_use_header = end_use_header + "Conditioned Building Area m2,"
304
- end_use_header = end_use_header + "Average Wall Conductance,"
305
- end_use_header = end_use_header + "Average Roof Conductance,"
306
- #End Uses
307
- End_use_types.each do |end_use|
308
- Fuel_types.each do |fuel_type|
309
- end_use_header_array = end_use_header_array + "#{end_use} #{fuel_type[0]} (#{fuel_type[1]}),"
310
- end
311
- end
312
- end
313
-
314
- def initialize()
315
- header = get_header()
316
-
317
- end
318
- end
319
-
320
- #This method will return an array of common annual data results. With header and unit information and returns an annual results string array.
321
- #@author phylroy.lopez@nrcan.gc.ca
322
- #@param osm_file [String]
323
- #@param sql_path [String]
324
- #@return [annual_results_array<String>]
325
- def self.old_get_annual_results_model_results(osm_file,sql_path)
326
-
327
- #load Osm file.
328
- model = BTAP::FileIO::load_osm(osm_file)
329
- #construct sql path.
330
- basename = File.basename(osm_file,".osm")
331
- sql_file = OpenStudio::SqlFile.new(OpenStudio::Path.new(sql_path))
332
-
333
- #link sql output
334
- model.setSqlFile(sql_file)
335
-
336
- current_building = model.building.get
337
- current_facility = model.getFacility
338
- weather_object = model.getWeatherFile
339
-
340
- #Create hash of results.
341
- annual_results_array = Array.new()
342
-
343
- if match = current_building.name.get.match(/(^.*)~(.*)~(.*)/)
344
- building_name, vintage_name, ecm_name = match.captures
345
- annual_results_array.push( [ building_name,"building_type",""])
346
- annual_results_array.push( [ vintage_name,"vintage_name",""])
347
- annual_results_array.push( [ ecm_name,"measure_id",""])
348
- else
349
- annual_results_array.push( [ current_building.name,"building_name",""])
350
- end
351
- annual_results_array.push( [ osm_file,"OSM file",""])
352
- annual_results_array.push( [ sql_path,"SQL file",""])
353
- #Weather file
354
- annual_results_array.push( [ weather_object.city, "City","-"])
355
- annual_results_array.push( [ weather_object.stateProvinceRegion, "Province","-"])
356
- annual_results_array.push( [ weather_object.country, "Country","-"])
357
- annual_results_array.push( [ weather_object.dataSource, "Data Source","-"])
358
- annual_results_array.push( [ weather_object.wMONumber, "wMONumber","-"])
359
- annual_results_array.push( [ weather_object.latitude, "Latitude","-"])
360
- annual_results_array.push( [ weather_object.longitude, "Longitude","-"])
361
-
362
- hdd = BTAP::Environment::WeatherFile.new( weather_object.path.get.to_s ).hdd18
363
- cdd = BTAP::Environment::WeatherFile.new( weather_object.path.get.to_s ).cdd18
364
- annual_results_array.push( [ hdd, "Heating Degree Days","deg*Day"])
365
- annual_results_array.push( [ cdd, "Cooling Degree Days","deg*Day"])
366
- annual_results_array.push( [ NECB2011.new().get_climate_zone_name(hdd), "NECB Climate Zone",""])
367
-
368
-
369
- annual_results_array.push( [ current_building.floorArea(),"Total Floor Area", "M2"])
370
- annual_results_array.push( [ current_building.conditionedFloorArea(),"Conditioned Floor Area", "M2"])
371
- annual_results_array.push( [ current_building.exteriorSurfaceArea,"Exterior Surface Area", "M2"])
372
- annual_results_array.push( [ current_building.exteriorWallArea,"Exterior Wall Area", "M2"])
373
- annual_results_array.push( [ current_building.airVolume,"Building Air Volume", "M3"])
374
- annual_results_array.push( [ current_building.numberOfPeople(),"Number of People","Persons"])
375
-
376
- annual_results_array.push( [ current_building.peoplePerFloorArea(),"Number of People per Area","Persons/M2"])
377
- annual_results_array.push( [ current_building.lightingPower ,"Lighting Power","W"])
378
- annual_results_array.push( [ current_building.lightingPowerPerFloorArea(),"Lighting Power Density","W/M2"])
379
- annual_results_array.push( [ current_building.lightingPowerPerPerson() ,"Lighting Power Per Person","W/Person"])
380
- annual_results_array.push( [ current_building.electricEquipmentPower(),"Electric Equipment Power","W"])
381
- annual_results_array.push( [ current_building.electricEquipmentPowerPerFloorArea(),"Electric Equipment Power per Floor Area","W/M2"])
382
- annual_results_array.push( [ current_building.electricEquipmentPowerPerPerson(), "Electric Equipment Power Per Person","W/person"])
383
- annual_results_array.push( [ current_building.gasEquipmentPower(), "Gas Equipment Power","W"])
384
- annual_results_array.push( [ current_building.gasEquipmentPowerPerFloorArea(),"Gas Equipment Power per Floor Area","W/M2"])
385
- annual_results_array.push( [ current_building.gasEquipmentPowerPerPerson(), "Gas Equipment Power Per Person","W/person"] )
386
- annual_results_array.push( [ model.getBuildingStorys.size, "Number of Stories", ""])
387
-
388
- annual_results_array.push( [ current_facility.totalSiteEnergy(), "Total Site Energy", "GJ"])
389
- annual_results_array.push( [ current_facility.netSiteEnergy(), "Net Site Energy", "GJ"])
390
- annual_results_array.push( [ current_facility.totalSourceEnergy(), "Total Source Energy", "GJ"])
391
- annual_results_array.push( [ current_facility.netSourceEnergy(), "Net Source Energy", "GJ"])
392
-
393
- annual_results_array.push( [ current_facility.hoursHeatingSetpointNotMet(),"Hours Heating Setpoint Not Met", "Hours"])
394
- annual_results_array.push( [ current_facility.hoursCoolingSetpointNotMet(),"Hours Cooling Setpoint Not Met", "Hours"])
395
-
396
- #cost information
397
- # annual_results_array.push( [ current_facility.annualTotalCost(OpenStudio::FuelType.new("NaturalGas")), "Annual Natural Gas Total Cost", "$"])
398
- # annual_results_array.push( [ current_facility.annualTotalCostPerBldgArea(OpenStudio::FuelType.new("NaturalGas")),"Annual Natural Gas Total Cost per Bldg Area", "$/M2"])
399
- # annual_results_array.push( [ current_facility.annualTotalCostPerNetConditionedBldgArea(OpenStudio::FuelType.new("NaturalGas")), "Annual Natural Gas Total Cost per Conditioned Bldg Area", "$/M2"])
400
- # annual_results_array.push( [ current_facility.annualTotalUtilityCost(), "Annual Total Utility Cost", "$"])
401
- # annual_results_array.push( [ current_facility.annualElectricTotalCost() , "Annual Total Electric Utility Cost", "$"])
402
- # annual_results_array.push( [ current_facility.annualGasTotalCost(), "Annual Total Gas Utility Cost", "$"])
403
- # annual_results_array.push( [ current_facility.annualDistrictCoolingTotalCost(), "Annual Total District Cooling Utility Cost", "$"])
404
- # annual_results_array.push( [ current_facility.annualDistrictHeatingTotalCost(), "Annual Total District Heating Utility Cost", "$"])
405
- # annual_results_array.push( [ current_facility.annualWaterTotalCost(), "Annual Total Water Cost", "$"])
406
- # annual_results_array.push( [ current_facility.totalEnergyTimeDependentValuation(), "Annual Total Water Cost", "$"])
407
- # annual_results_array.push( [ current_facility.totalCostTimeDependentValuation(), "Annual Total Water Cost", "$"])
408
- # annual_results_array.push( [ current_facility.electricityEnergyTimeDependentValuation(), "electricityEnergyTimeDependentValuation", "J"])
409
- # annual_results_array.push( [ current_facility.electricityCostTimeDependentValuation(), "electricityCostTimeDependentValuation", "$"])
410
- # annual_results_array.push( [ current_facility.fossilFuelEnergyTimeDependentValuation(),"fossilFuelEnergyTimeDependentValuation", "J"])
411
- # annual_results_array.push( [ current_facility.fossilFuelCostTimeDependentValuation(), "fossilFuelCostTimeDependentValuation", "$"])
412
- # annual_results_array.push( [ current_facility.economicsCapitalCost(), "economics Capitol Costs", "$"])
413
- # annual_results_array.push( [ current_facility.economicsEnergyCost(), "economics Energy Costs", "$"])
414
- # annual_results_array.push( [ current_facility.economicsTLCC(), "economics Total Life Cycle Costs", "$"])
415
-
416
-
417
- value = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='Life-Cycle Cost Report' AND ReportForString='Entire Facility' AND TableName='Present Value by Category' AND RowName='Grand Total' AND ColumnName='Present Value'")
418
-
419
- if value.empty?
420
- value = 0.0
421
- else
422
- value = value.get
423
- end
424
- annual_results_array.push( [ value, "Total Capitol Costs", "$"])
425
-
426
-
427
-
428
-
429
- # annual_results_array.push( [ current_facility.economicsVirtualRateGas(), "economics Virtual Rate Gas", "$/GJ"])
430
- # annual_results_array.push( [ current_facility.economicsVirtualRateElec(), "economics Virtual Rate Electric", "$/GJ"])
431
- # annual_results_array.push( [ current_facility.economicsVirtualRateCombined(), "economics Virtual Rate Combined", "$/GJ"])
432
- # annual_results_array.push( [ current_facility.economicsSPB(), "economics Simple Pay Back", "Years"])
433
- # annual_results_array.push( [ current_facility.economicsDPB(), "economics Discounted Payback", "Years"])
434
- # annual_results_array.push( [ current_facility.economicsNPV(), "economics Net Present Value", "$"])
435
- # annual_results_array.push( [ current_facility.economicsIRR(), "economics Internal Rate of Return", "%"])
436
-
437
- # annual_results_array.each {|result| puts "#{result[0]}, #{result[1]}, #{result[2]}, #{basename}" }
438
- #Determine weighted area average conductances
439
- outdoor_surfaces = BTAP::Geometry::Surfaces::filter_by_boundary_condition(model.getSurfaces(), "Outdoors")
440
- outdoor_walls = BTAP::Geometry::Surfaces::filter_by_surface_types(outdoor_surfaces, "Wall")
441
- outdoor_roofs = BTAP::Geometry::Surfaces::filter_by_surface_types(outdoor_surfaces, "RoofCeiling")
442
- outdoor_floors = BTAP::Geometry::Surfaces::filter_by_surface_types(outdoor_surfaces, "Floor")
443
- outdoor_subsurfaces = BTAP::Geometry::Surfaces::get_subsurfaces_from_surfaces(outdoor_surfaces)
444
- windows = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["FixedWindow" , "OperableWindow" ])
445
- skylights = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["Skylight", "TubularDaylightDiffuser","TubularDaylightDome" ])
446
- doors = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["Door" , "GlassDoor" ])
447
- overhead_doors = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["OverheadDoor" ])
448
- outdoor_walls_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(outdoor_walls)
449
- outdoor_roofs_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(outdoor_roofs)
450
- outdoor_floors_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(outdoor_floors)
451
- windows_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(windows)
452
- skylights_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(skylights)
453
- doors_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(doors)
454
- overhead_doors_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(overhead_doors)
455
- #Store Values
456
- annual_results_array.push( [ outdoor_walls_average_conductance ,"outdoor_walls_average_conductance", "?"])
457
- annual_results_array.push( [ outdoor_roofs_average_conductance ,"outdoor_roofs_average_conductance", "?"])
458
- annual_results_array.push( [ outdoor_floors_average_conductance ,"outdoor_floors_average_conductance", "?"])
459
- annual_results_array.push( [ windows_average_conductance ,"outdoor_windows_average_conductance", "?"])
460
- annual_results_array.push( [ doors_average_conductance ,"outdoor_doors_average_conductance", "?"])
461
- annual_results_array.push( [ overhead_doors_average_conductance ,"outdoor_overhead_doors_average_conductance", "?"])
462
- annual_results_array.push( [ skylights_average_conductance ,"skylights_average_conductance", "?"])
463
- annual_results_array.push( [ BTAP::Geometry::get_fwdr(model), "Fenestration To Wall Ratio", "-"])
464
- annual_results_array.push( [ BTAP::Geometry::get_srr(model), "Skylight to Roof Ratio", "-"])
465
-
466
- #Get peak watts for gas and elec
467
- electric_peak = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='EnergyMeters'" +
468
- " AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Electricity' AND RowName='Electricity:Facility'" +
469
- " AND ColumnName='Electricity Maximum Value' AND Units='W'")
470
- if electric_peak.empty?
471
- electric_peak = 0.0
472
- end
473
-
474
- natural_gas_peak = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='EnergyMeters'" +
475
- " AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Natural Gas' AND RowName='NaturalGas:Facility'" +
476
- " AND ColumnName='Natural Gas Maximum Value' AND Units='W'")
477
- if natural_gas_peak.empty?
478
- natural_gas_peak = 0.0
479
- end
480
-
481
- annual_results_array.push( [ electric_peak ,"Peak Electricity", "W"])
482
- annual_results_array.push( [ natural_gas_peak ,"Peak Gas", "W"])
483
-
484
- #Get End Uses by fuel type.
485
- fuel_types = [
486
- ['Electricity', 'GJ'],
487
- ['Natural Gas', 'GJ'],
488
- ['Other Fuel', 'GJ'],
489
- ['District Cooling', 'GJ'],
490
- ['District Heating', 'GJ'],
491
- ['Water', 'm3']]
492
- use_types = [
493
- 'Heating',
494
- 'Cooling',
495
- 'Interior Lighting',
496
- 'Exterior Lighting',
497
- 'Interior Equipment',
498
- 'Exterior Equipment',
499
- 'Fans',
500
- 'Pumps',
501
- 'Heat Rejection',
502
- 'Humidification',
503
- 'Heat Recovery',
504
- 'Water Systems',
505
- 'Refrigeration',
506
- 'Generators'
507
- ]
508
- use_types.each do |use_type|
509
- fuel_types.each do |fuel_type|
510
- fuel_name = fuel_type[0]
511
- fuel_units = fuel_type[1]
512
- value = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'")
513
- if value.empty?
514
- value = 0.0
515
- else
516
- value = value.get
517
- end
518
- annual_results_array.push( [ value, "#{fuel_name}-#{use_type}", fuel_units])
519
- annual_results_array.push( [ value / current_building.floorArea() , "#{fuel_name}-#{use_type} Total Floor Area Intensity", "#{fuel_units}/m2"] )
520
- end
521
- end
522
- return annual_results_array
523
- end
524
-
525
- #This method will return an array of common annual data results. With header and unit information and returns an annual results string array.
526
- #@author phylroy.lopez@nrcan.gc.ca
527
- #@param osm_file [String]
528
- #@param sql_path [String]
529
- #@return [annual_results_array<String>]
530
- def self.get_annual_results_model_results(osm_file,sql_path)
531
-
532
- #load Osm file.
533
- model = BTAP::FileIO::load_osm(osm_file)
534
- #link sql output
535
- model.setSqlFile(OpenStudio::SqlFile.new(OpenStudio::Path.new(sql_path)))
536
-
537
- #Create hash of results.
538
- annual_results_array = Array.new()
539
- annual_results_array.push( [ osm_file,"osm_file",""])
540
- annual_results_array.push( [ sql_path,"sql_path",""])
541
- if match = model.building.get.name.get.match(/(^.*)~(.*)~(.*)/)
542
- building_name, vintage_name, ecm_name = match.captures
543
- annual_results_array.push( [ building_name,"building_name",""])
544
- annual_results_array.push( [ vintage_name,"vintage_name",""])
545
- annual_results_array.push( [ ecm_name,"measure_id",""])
546
- else
547
- annual_results_array.push( [ model.building.get.name,"building_name",""])
548
- end
549
-
550
- #Capitol Costs
551
- value = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='Life-Cycle Cost Report' AND ReportForString='Entire Facility' AND TableName='Present Value by Category' AND RowName='Grand Total' AND ColumnName='Present Value'")
552
- if value.empty?
553
- value = 0.0
554
- else
555
- value = value.get
556
- end
557
- annual_results_array.push( [ value, "Simulation Total Capitol Costs", "$"])
558
-
559
-
560
- #Total floor Areas
561
- annual_results_array.push( [ model.building.get.floorArea(),"Total Floor Area", "M2"])
562
- #Conditioned floor area
563
- annual_results_array.push( [ model.building.get.conditionedFloorArea(),"Conditioned Floor Area", "M2"])
564
-
565
-
566
- #District Heating
567
- fuel_name,use_type,fuel_units = "District Heating","Heating", 'GJ'
568
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
569
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
570
-
571
- #District Cooling
572
- fuel_name,use_type,fuel_units = "District Cooling","Cooling", 'GJ'
573
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
574
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
575
-
576
-
577
- #Electrical Heating
578
- fuel_name,use_type,fuel_units = "Electricity","Heating", 'GJ'
579
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
580
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
581
-
582
- #Natural Gas Heating
583
- fuel_name,use_type,fuel_units = "Natural Gas","Heating", 'GJ'
584
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
585
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
586
-
587
- #Electric Cooling
588
- fuel_name,use_type,fuel_units = "Electricity","Cooling", 'GJ'
589
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
590
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
591
-
592
- #Electric Water systems
593
- fuel_name,use_type,fuel_units = "Electricity","Water Systems", 'GJ'
594
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
595
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
596
-
597
- #NG Water systems
598
- fuel_name,use_type,fuel_units = "Natural Gas","Water Systems", 'GJ'
599
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
600
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
601
-
602
- fuel_name,use_type,fuel_units = "Electricity","Interior Lighting", 'GJ'
603
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
604
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
605
-
606
- fuel_name,use_type,fuel_units = "Electricity","Interior Equipment", 'GJ'
607
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
608
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
609
-
610
- fuel_name,use_type,fuel_units = "District Heating","Interior Equipment", 'GJ'
611
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
612
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
613
-
614
-
615
- fuel_name,use_type,fuel_units = "Electricity","Fans", 'GJ'
616
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
617
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
618
-
619
- fuel_name,use_type,fuel_units = "Electricity","Pumps", 'GJ'
620
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
621
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
622
-
623
- fuel_name,use_type,fuel_units = "Electricity","Heat Recovery", 'GJ'
624
- sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
625
- annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
626
-
627
-
628
- return annual_results_array
629
- end
630
-
631
- #This method will convert eso to cvs.
632
- #@author phylroy.lopez@nrcan.gc.ca
633
- #@param eso_file_path [String]
634
- def self.convert_eso_to_csv(eso_file_path)
635
- #Run ESO Vars command must be run in folder.
636
- root_folder = Dir.getwd()
637
- # puts File.dirname(eso_file_path)
638
- Dir.chdir(File.dirname(eso_file_path))
639
- system(self.find_read_vars_eso())
640
- #get name of run from html file. This is faster than loading OSM file.
641
- runname = ""
642
- f = File.open("eplustbl.htm")
643
- f.each_line do |line|
644
- if line =~ /<p>Building: <b>(.*)<\/b><\/p>/
645
- runname = $1
646
- break
647
- end
648
- end
649
- f.close
650
- #copy files over with distinct names
651
- FileUtils.cp("eplusout.csv","#{runname}_eplusout.csv")
652
- FileUtils.cp("eplustbl.htm","#{runname}_eplustbl.htm")
653
- FileUtils.cp("eplusout.sql","#{runname}_eplusout.sql")
654
- Dir.chdir(root_folder)
655
- end
656
-
657
- #This method will copy results to a folder.
658
- #@author phylroy.lopez@nrcan.gc.ca
659
- #@param in_folder [String]
660
- #@param out_folder [String]
661
- def copy_results_to_folder(in_folder,out_folder)
662
- #find all csv hourly output
663
- BTAP::FILEIO::get_find_files_from_folder_by_extension(in_folder, "_eplusout.csv").each {|file| FileUtils.cp(file,out_folder)}
664
- BTAP::FILEIO::get_find_files_from_folder_by_extension(in_folder, "_eplustbl.htm").each {|file| FileUtils.cp(file,out_folder)}
665
- BTAP::FILEIO::get_find_files_from_folder_by_extension(in_folder, "_eplusout.sql").each {|file| FileUtils.cp(file,out_folder)}
666
-
667
- end
668
-
669
-
670
- #This method copies report files to a single folder for convenience.
671
- #@author phylroy.lopez@nrcan.gc.ca
672
- #@param run_name [String]
673
- #@return [OpenStudio::model::Model] A model object
674
- def processResults(run_name)
675
- #make sql folder
676
- Dir.mkdir(@outdir.to_s+"\\sqlresults") unless File.exists?(@outdir.to_s+"\\sqlresults")
677
- #make html folder
678
- Dir.mkdir(@outdir.to_s+"\\htmlresults") unless File.exists?(@outdir.to_s+"\\htmlresults")
679
- #puts "processing results for " + run_name
680
-
681
- #load sql file
682
- # see if we can find sql file
683
- sql_path = OpenStudio::Path.new(@outdir.to_s+"\\" + run_name + "_osm\\ModelToIdf\\ExpandObjects-0\\EnergyPlus-0\\eplusout.sql")
684
- html_path = OpenStudio::Path.new(@outdir.to_s+"\\" + run_name + "_osm\\ModelToIdf\\ExpandObjects-0\\EnergyPlus-0\\eplustbl.htm")
685
- FileUtils.cp(sql_path.to_s,@outdir.to_s+"/sqlresults/" + run_name + ".sql")
686
- FileUtils.cp(html_path.to_s,@outdir.to_s+"/htmlresults/" + run_name + ".htm")
687
-
688
- #load osm file to attach sql file
689
- model_path = OpenStudio::Path.new(@outdir.to_s+"\\"+ run_name + ".osm")
690
- if OpenStudio::exists(model_path)
691
- model = BTAP::FileIO::load_osm(model_path)
692
- end
693
-
694
-
695
- #attach sql file
696
- if OpenStudio::exists(sql_path)
697
- # translate the results and load them into the model
698
- sqlFile = OpenStudio::SqlFile.new(sql_path)
699
- model.setSqlFile(sqlFile)
700
- else
701
- #puts "could not load sql file" + sql_path
702
- end
703
-
704
-
705
- #construct path to E+ run.
706
- ep_project_folder = @outdir.to_s+"\\" + run_name + "_osm\\ModelToIdf\\ExpandObjects-0\\EnergyPlus-0\\"
707
- eso_file = ep_project_folder + "\\eplusout.eso"
708
- #create csv folder at top of folder hieracrhy.
709
- cvs_results_folder = @outdir.to_s+"/csvresults/"
710
- Dir.mkdir(cvs_results_folder) unless File.exists?(cvs_results_folder)
711
- #create path to e+ csv file and copy it to folder.
712
-
713
-
714
- #Run ESO Vars command must be run in folder.
715
- root_folder = Dir.getwd()
716
- Dir.chdir(ep_project_folder)
717
- system(@readvars_path)
718
- csv_file = ep_project_folder + "\\eplusout.csv"
719
- FileUtils.cp(csv_file, cvs_results_folder + run_name + ".csv")
720
- Dir.chdir(root_folder)
721
- return model
722
- end
723
-
724
- #This method will fix underheated hours
725
- #@author Phylroy A. Lopez
726
- #@param model [OpenStudio::model::Model] A model object
727
- #@param folder_name [String] a simple string of the simulation folder path, remember to escape the slashes..(i.e. // not / )
728
- #@param epw_path [String] a simple string of the epw file path, remember to escape the slashes..(i.e. // not / )
729
- def fix_underheated_hours(model,epw_path,folder_name = "c:/temp/")
730
-
731
- #Run model.
732
- BTAP::SimManager::run_simulation(model, folder_name, epw_path)
733
-
734
- #Look at hours unmet per zone table in eplusout.htm file
735
- #Make sure that the zone with the problem is not a slave zone on a single-zone VAV system.
736
- #Check your thermostat setpoint schedules for this zone to make sure values are reasonable
737
- #Check that design days are for the same location as the weather file
738
- #Open the .osm in a text editor to look at this.
739
- #Check the tolerance for reporting unmet hours
740
- #Try 2F and re-run. If tolerance is too tight, you can get false alarms.
741
- #Check design/sizing temperature for each plant loop.
742
- #This is found by clicking the dashed line in the center of a plant loop.
743
- #Check the operational temperature in the plant loop's setpoint manager.
744
- #It should match up with the design/sizing temperature for that loop.
745
- #If you size the loop for 180F water but tell it to operate at 150F, the equipment won't be big enough during peak times.
746
- #Check design/sizing heating and cooling supply air temperatures for air loop.
747
- #This is found by clicking the dashed line in the center of the air loop.
748
- #Check the operational temperature in the air loop's setpoint manager.
749
- #It should match up with the design/sizing temperature for that loop.
750
- #If you size the loop for 55F supply air but tell it to operate at 60F, the equipment might not be big enough during peak times.
751
- #Check that sizing design day thermostat is using a constant setpoint schedule with no setback.
752
- #This is a 90.1 requirement. If your design day has a setback, your system will be oversized in an attempt to be able to go from setback to setup in a single timestep.
753
- #Equipment that is significantly oversized might not operate properly at low load conditions.
754
- end
755
-
756
- end
757
-
758
- end
759
- 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 "SecureRandom"
21
+ #
22
+ # module BTAP
23
+ #
24
+ # module SimManager
25
+ #
26
+ # #This method will simulate all files in a folder.
27
+ # #@author phylroy.lopez@nrcan.gc.ca
28
+ # #@param folder [String] folder
29
+ # def self.simulate_all_files_in_folder(folder)
30
+ # osm_files = BTAP::FileIO::get_find_files_from_folder_by_extension(folder, ".osm")
31
+ # self.simulate_files(folder,osm_files)
32
+ # end
33
+ #
34
+ # #This method will simulate all files in a array.
35
+ # #@author phylroy.lopez@nrcan.gc.ca
36
+ # #@param folder Array[String] folder
37
+ # def self.simulate_files(folder,osm_files)
38
+ #
39
+ # co = OpenStudio::Runmanager::ConfigOptions.new()
40
+ # co.fastFindEnergyPlus()
41
+ # rm = OpenStudio::Runmanager::RunManager.new("SecureRandom.hex.db", true)
42
+ # rm.setPaused(false)
43
+ # counter = 0
44
+ #
45
+ # osm_files.each do |model_path|
46
+ # counter = counter + 1
47
+ # work_items = OpenStudio::Runmanager::WorkItemVector.new
48
+ # work_items << OpenStudio::Runmanager::WorkItem.new("ModelToIdf".to_JobType)
49
+ # work_items << OpenStudio::Runmanager::WorkItem.new("ExpandObjects".to_JobType)
50
+ # # ruby_job = OpenStudio::Runmanager::RubyJobBuilder.new(cost_injection)
51
+ # # ruby_job.setIncludeDir(OpenStudio::Path.new("#{$OpenStudio_Dir}"))
52
+ # # work_items << ruby_job.toWorkItem
53
+ # work_items << OpenStudio::Runmanager::WorkItem.new("EnergyPlus".to_JobType)
54
+ # #work_items << OpenStudio::Runmanager::WorkItem.new("ReadVars".to_JobType)
55
+ # work_items << OpenStudio::Runmanager::WorkItem.new("OpenStudioPostProcess".to_JobType)
56
+ # workflow = OpenStudio::Runmanager::Workflow.new(work_items)
57
+ # params = OpenStudio::Runmanager::JobParams.new;
58
+ # params.append("cleanoutfiles", "standard");
59
+ # workflow.add(params)
60
+ # workflow.add(co.getTools())
61
+ # rm.enqueue( workflow.create( OpenStudio::Path.new("#{folder}/#{File.basename(model_path, ".osm")}"), OpenStudio::Path.new(model_path)),false)
62
+ # # puts "#{model_path} enqueued. #{counter} of #{osm_files.size}"
63
+ # end
64
+ # #rm.showStatusDialog()
65
+ # rm.waitForFinished()
66
+ # end
67
+ #
68
+ #
69
+ #
70
+ # #This method will run the simulation. You must provide a folder where you wish
71
+ # #to run the simulation, and if not previously defined, the weather file. This will delete and recreate the folder provided to ensure that it is clean.
72
+ # #@author Phylroy A. Lopez
73
+ # #@param model [OpenStudio::model::Model] A model object
74
+ # #@param folder_name [String] a simple string of the simulation folder path, remember to escape the slashes..(i.e. // not / )
75
+ # #@param epw_path [String] a simple string of the epw file path, remember to escape the slashes..(i.e. // not / )
76
+ # #@return [OpenStudio::Model::Model] the OpenStudio model object (self reference).
77
+ # def self.run_simulation( model, folder_name,epw_path = "" )
78
+ #
79
+ # if not File.exists?(epw_path) and not File.exists?(model.getWeatherFile.path.get.to_s)
80
+ # raise ("Error: Weather file not set. Cannot run. Please set weather file using the OpenStudio::Model::WeatherFile::setWeatherFile(model,filepath) command ")
81
+ # else if epw_path != ""
82
+ # BTAP::Site::set_weather_file(model,epw_path)
83
+ # end
84
+ # #Create RunManager
85
+ # Dir::mkdir(folder_name) unless File.exists?( folder_name )
86
+ # process_manager = BTAP::SimManager::ProcessManager.new( folder_name )
87
+ # process_manager.addModel(model)
88
+ # process_manager.start_sims
89
+ # end
90
+ # return model
91
+ # end
92
+ #
93
+ #
94
+ #
95
+ # class ProcessManager
96
+ #
97
+ # attr_accessor :run_manager
98
+ # attr_accessor :workflow
99
+ # attr_accessor :model_array
100
+ # attr_accessor :results_folder
101
+ #
102
+ #
103
+ # def getPaths
104
+ # #set the Energyplus.exe path variable
105
+ # @ep_path = OpenStudio.getEnergyPlusExecutable
106
+ # #set the root folder for E+
107
+ # @ep_parent_path = OpenStudio.getEnergyPlusDirectory
108
+ #
109
+ # #find IDD path
110
+ # idd_path = @ep_parent_path.to_s + "/Energy+.idd"
111
+ #
112
+ # if (not File.exists?(idd_path))
113
+ # raise("Cannot locate the input data dictionary (IDD) in the EnergyPlus directory #{idd_path}. Correct the EXE path and try again.")
114
+ # return(false)
115
+ # end
116
+ #
117
+ # #Find the expand object exe.
118
+ # expandobjects_path = ''
119
+ # expandobjects_path = @ep_parent_path.to_s + '/ExpandObjects.exe'
120
+ # if (not File.exists?(expandobjects_path))
121
+ # UI.messagebox("Cannot locate ExpandObjects in the EnergyPlus directory. Correct the EXE path and try again.")
122
+ # end
123
+ #
124
+ # #Find the ReadVarsESO.exe
125
+ #
126
+ # @readvars_path = ""
127
+ # if (/mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM))
128
+ # @readvars_path = @ep_parent_path.to_s + "/PostProcess/ReadVarsESO.exe"
129
+ # else
130
+ # @readvars_path = @ep_parent_path.to_s + '/readvars'
131
+ # end
132
+ #
133
+ #
134
+ # if (not File.exists?(@readvars_path))
135
+ # @readvars_path = @ep_parent_path.to_s + '/readvars.exe'
136
+ # end
137
+ # if (not File.exists?(@readvars_path))
138
+ # UI.messagebox("Cannot locate ReadVarsESO in the EnergyPlus directory. Correct the EXE path and try again.")
139
+ # return(false)
140
+ # end
141
+ # end
142
+ #
143
+ # #This method finds the energyplus folder and returns the path string.
144
+ # #@author Phylroy A. Lopez
145
+ # #@return [String] a simple string of the epw file path, remember to escape the slashes..(i.e. // not / )
146
+ # def self.find_energyplus_folder()
147
+ # return OpenStudio.getEnergyPlusDirectory.to_s
148
+ # end
149
+ #
150
+ # #This method finds the eReadVarsESO.exe and returns the path string.
151
+ # #@author Phylroy A. Lopez
152
+ # #@return [String] readvars_path a simple string of the eReadVarsESO.exe file path, remember to escape the slashes..(i.e. // not / )
153
+ # def self.find_read_vars_eso()
154
+ # #Find the ReadVarsESO.exe
155
+ # readvars_path = ""
156
+ # ep_parent_path = self.find_energyplus_folder()
157
+ # if (/mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM))
158
+ # readvars_path = ep_parent_path.to_s + "/PostProcess/ReadVarsESO.exe"
159
+ # else
160
+ # readvars_path = ep_parent_path.to_s + '/readvars'
161
+ # end
162
+ # if (not File.exists?(readvars_path))
163
+ # readvars_path = ep_parent_path.to_s + '/readvars.exe'
164
+ # end
165
+ # if (not File.exists?(readvars_path))
166
+ # raise("Cannot locate ReadVarsESO in the EnergyPlus directory #{ep_parent_path}. Correct the EXE path and try again.")
167
+ # end
168
+ # return readvars_path
169
+ # end
170
+ #
171
+ # #This method initializes the Analysis Folder.
172
+ # #@author Phylroy A. Lopez
173
+ # #@param analysisFolder [String] a simple string of the Analysis Folder file path, remember to escape the slashes..(i.e. // not / )
174
+ # def initialize(analysisFolder)
175
+ #
176
+ # @model_array = Array
177
+ # #set Analysis Folder.
178
+ # @analysisFolder = analysisFolder
179
+ # #FileUtils.rm_rf(@analysisFolder)
180
+ # FileUtils.mkdir_p("#{@analysisFolder}")
181
+ # FileUtils.mkdir_p("#{@analysisFolder}/simulations") unless File.exists?("#{@analysisFolder}/simulations")
182
+ # FileUtils.mkdir_p("#{@analysisFolder}/results") unless File.exists?("#{@analysisFolder}/results")
183
+ # #create Runmanager
184
+ # runmanager_db_path = OpenStudio::Path.new(@analysisFolder + "\\runmanager.sql")
185
+ # #FileUtils.rm(runmanager_db_path.to_s) if OpenStudio::exists(runmanager_db_path)
186
+ # #OpenStudio::Runmanager::ConfigOptions::setMaxLocalJobs(6)
187
+ # @run_manager = OpenStudio::Runmanager::RunManager.new(runmanager_db_path, true)
188
+ #
189
+ #
190
+ # #create Workflow.
191
+ # @workflow = OpenStudio::Runmanager::Workflow.new();
192
+ #
193
+ # #Set up tools for workflow.
194
+ # self.getPaths
195
+ # tools = OpenStudio::Runmanager::Tools.new()
196
+ # tools.append(OpenStudio::Runmanager::ToolInfo.new("readvars", OpenStudio::Runmanager::ToolVersion.new(), OpenStudio::Path.new(@readvars_path)))
197
+ # expand = OpenStudio::Runmanager::JobFactory::createExpandObjectsJob(tools, OpenStudio::Runmanager::JobParams.new(), OpenStudio::Runmanager::Files.new())
198
+ # #readvars = OpenStudio::Runmanager::JobFactory::createReadVarsJob(tools, OpenStudio::Runmanager::JobParams.new(), OpenStudio::Runmanager::Files.new())
199
+ #
200
+ # #Create ModeltoIDF->Expand->EnergyPlus->ReadVars workflow.
201
+ # @workflow.addJob(OpenStudio::Runmanager::JobType.new("ModelToIdf"));
202
+ # @workflow.addJob( OpenStudio::Runmanager::JobType.new("ExpandObjects") )
203
+ # @workflow.addJob(OpenStudio::Runmanager::JobType.new("EnergyPlus"));
204
+ # #@workflow.addJob(OpenStudio::Runmanager::JobType.new("OpenStudioPostProcess"));
205
+ # #@workflow.addJob(OpenStudio::Runmanager::JobType.new("ReadVars"))
206
+ # @workflow.add(OpenStudio::Runmanager::ConfigOptions::makeTools(
207
+ # @ep_parent_path,
208
+ # OpenStudio::Path.new,
209
+ # OpenStudio::Path.new,
210
+ # $OpenStudio_RubyExeDir,
211
+ # OpenStudio::Path.new))
212
+ # tools.append(OpenStudio::Runmanager::ToolInfo.new("readvars", OpenStudio::Runmanager::ToolVersion.new(), OpenStudio::Path.new(@readvars_path)))
213
+ # #create Project Database
214
+ # #create the project database
215
+ # @projectPath = OpenStudio::Path.new(@analysisFolder + "\\projectdb.osp")
216
+ # FileUtils.rm(@projectPath.to_s) if OpenStudio::exists(@projectPath)
217
+ # database = OpenStudio::Project::ProjectDatabase.new(@projectPath, @run_manager)
218
+ # end
219
+ #
220
+ # #This method adds the model to the folder.
221
+ # #@author phylroy.lopez@nrcan.gc.ca
222
+ # #@param model [OpenStudio::model::Model] A model object
223
+ # #@param folder [String]
224
+ # #@return [String] self
225
+ # def addModel(model, folder = @analysisFolder )
226
+ #
227
+ # run_name = model.building.get.name.get.to_s
228
+ # working_folder = OpenStudio::Path.new(folder.to_s + "\\simulations\\" + run_name )
229
+ # osm_save_path = OpenStudio::Path.new(folder.to_s + "\\simulations\\" + run_name + "\\" + run_name + ".osm" )
230
+ # model.save(OpenStudio::Path.new(osm_save_path), true);
231
+ # @run_manager.enqueue(@workflow.create(working_folder, osm_save_path, model.getWeatherFile.path.get),true)
232
+ # return self
233
+ # end
234
+ #
235
+ # #This method simulates all files in a folder.
236
+ # #@author phylroy.lopez@nrcan.gc.ca
237
+ # #@param folder [String]
238
+ # def simulate_all_files_in_folder(folder)
239
+ # co = OpenStudio::Runmanager::ConfigOptions.new()
240
+ # co.fastFindEnergyPlus()
241
+ # @run_manager.showStatusDialog()
242
+ # @workflow = OpenStudio::Runmanager::Workflow.new("ModelToIdf->ExpandObjects->EnergyPlus")
243
+ #
244
+ # @workflow.add(co.getTools())
245
+ #
246
+ # BTAP::FileIO::get_find_files_from_folder_by_extension(folder, ".osm").each do |model_path|
247
+ # basename = File.basename(model_path, ".osm")
248
+ # proc_folder = "#{folder}/#{basename}"
249
+ # @run_manager.enqueue( @workflow.create( OpenStudio::Path.new(proc_folder), OpenStudio::Path.new(model_path)),true)
250
+ # @run_manager.setPaused(false)
251
+ # GC.start()
252
+ # end
253
+ # @run_manager.showStatusDialog()
254
+ # @run_manager.waitForFinished()
255
+ #
256
+ # end
257
+ #
258
+ #
259
+ #
260
+ # def start_sims
261
+ # unless File.exist?(@analysisFolder)
262
+ # Dir.mkdir(@analysisFolder)
263
+ # end
264
+ # @run_manager.showStatusDialog()
265
+ # @run_manager.waitForFinished()
266
+ # end
267
+ #
268
+ # class SummaryReport
269
+ # # End Uses data
270
+ # End_use_report_name = 'AnnualBuildingUtilityPerformanceSummary'
271
+ # End_use_reportForString = 'Entire Facility'
272
+ # End_use_table_name = 'End Uses'
273
+ # Fuel_types = [
274
+ # ['Electricity', 'GJ'],
275
+ # ['Natural Gas', 'GJ'],
276
+ # ['Other Fuel', 'GJ'],
277
+ # ['District Cooling', 'GJ'],
278
+ # ['District Heating', 'GJ'],
279
+ # ['Water', 'm3']]
280
+ # End_use_types = [
281
+ # 'Heating',
282
+ # 'Cooling',
283
+ # 'Interior Lighting',
284
+ # 'Exterior Lighting',
285
+ # 'Interior Equipment',
286
+ # 'Exterior Equipment',
287
+ # 'Fans',
288
+ # 'Pumps',
289
+ # 'Heat Rejection',
290
+ # 'Humidification',
291
+ # 'Heat Recovery',
292
+ # 'Water Systems',
293
+ # 'Refrigeration',
294
+ # 'Generators'
295
+ # ]
296
+ #
297
+ #
298
+ # def get_header
299
+ # end_use_header_array = ""
300
+ # #Print Header
301
+ # end_use_header = end_use_header + "OSM File,"
302
+ # end_use_header = end_use_header + "SQL File,"
303
+ # end_use_header = end_use_header + "Conditioned Building Area m2,"
304
+ # end_use_header = end_use_header + "Average Wall Conductance,"
305
+ # end_use_header = end_use_header + "Average Roof Conductance,"
306
+ # #End Uses
307
+ # End_use_types.each do |end_use|
308
+ # Fuel_types.each do |fuel_type|
309
+ # end_use_header_array = end_use_header_array + "#{end_use} #{fuel_type[0]} (#{fuel_type[1]}),"
310
+ # end
311
+ # end
312
+ # end
313
+ #
314
+ # def initialize()
315
+ # header = get_header()
316
+ #
317
+ # end
318
+ # end
319
+ #
320
+ # #This method will return an array of common annual data results. With header and unit information and returns an annual results string array.
321
+ # #@author phylroy.lopez@nrcan.gc.ca
322
+ # #@param osm_file [String]
323
+ # #@param sql_path [String]
324
+ # #@return [annual_results_array<String>]
325
+ # def self.old_get_annual_results_model_results(osm_file,sql_path)
326
+ #
327
+ # #load Osm file.
328
+ # model = BTAP::FileIO::load_osm(osm_file)
329
+ # #construct sql path.
330
+ # basename = File.basename(osm_file,".osm")
331
+ # sql_file = OpenStudio::SqlFile.new(OpenStudio::Path.new(sql_path))
332
+ #
333
+ # #link sql output
334
+ # model.setSqlFile(sql_file)
335
+ #
336
+ # current_building = model.building.get
337
+ # current_facility = model.getFacility
338
+ # weather_object = model.getWeatherFile
339
+ #
340
+ # #Create hash of results.
341
+ # annual_results_array = Array.new()
342
+ #
343
+ # if match = current_building.name.get.match(/(^.*)~(.*)~(.*)/)
344
+ # building_name, vintage_name, ecm_name = match.captures
345
+ # annual_results_array.push( [ building_name,"building_type",""])
346
+ # annual_results_array.push( [ vintage_name,"vintage_name",""])
347
+ # annual_results_array.push( [ ecm_name,"measure_id",""])
348
+ # else
349
+ # annual_results_array.push( [ current_building.name,"building_name",""])
350
+ # end
351
+ # annual_results_array.push( [ osm_file,"OSM file",""])
352
+ # annual_results_array.push( [ sql_path,"SQL file",""])
353
+ # #Weather file
354
+ # annual_results_array.push( [ weather_object.city, "City","-"])
355
+ # annual_results_array.push( [ weather_object.stateProvinceRegion, "Province","-"])
356
+ # annual_results_array.push( [ weather_object.country, "Country","-"])
357
+ # annual_results_array.push( [ weather_object.dataSource, "Data Source","-"])
358
+ # annual_results_array.push( [ weather_object.wMONumber, "wMONumber","-"])
359
+ # annual_results_array.push( [ weather_object.latitude, "Latitude","-"])
360
+ # annual_results_array.push( [ weather_object.longitude, "Longitude","-"])
361
+ #
362
+ # hdd = BTAP::Environment::WeatherFile.new( weather_object.path.get.to_s ).hdd18
363
+ # cdd = BTAP::Environment::WeatherFile.new( weather_object.path.get.to_s ).cdd18
364
+ # annual_results_array.push( [ hdd, "Heating Degree Days","deg*Day"])
365
+ # annual_results_array.push( [ cdd, "Cooling Degree Days","deg*Day"])
366
+ # annual_results_array.push( [ NECB2011.new().get_climate_zone_name(hdd), "NECB Climate Zone",""])
367
+ #
368
+ #
369
+ # annual_results_array.push( [ current_building.floorArea(),"Total Floor Area", "M2"])
370
+ # annual_results_array.push( [ current_building.conditionedFloorArea(),"Conditioned Floor Area", "M2"])
371
+ # annual_results_array.push( [ current_building.exteriorSurfaceArea,"Exterior Surface Area", "M2"])
372
+ # annual_results_array.push( [ current_building.exteriorWallArea,"Exterior Wall Area", "M2"])
373
+ # annual_results_array.push( [ current_building.airVolume,"Building Air Volume", "M3"])
374
+ # annual_results_array.push( [ current_building.numberOfPeople(),"Number of People","Persons"])
375
+ #
376
+ # annual_results_array.push( [ current_building.peoplePerFloorArea(),"Number of People per Area","Persons/M2"])
377
+ # annual_results_array.push( [ current_building.lightingPower ,"Lighting Power","W"])
378
+ # annual_results_array.push( [ current_building.lightingPowerPerFloorArea(),"Lighting Power Density","W/M2"])
379
+ # annual_results_array.push( [ current_building.lightingPowerPerPerson() ,"Lighting Power Per Person","W/Person"])
380
+ # annual_results_array.push( [ current_building.electricEquipmentPower(),"Electric Equipment Power","W"])
381
+ # annual_results_array.push( [ current_building.electricEquipmentPowerPerFloorArea(),"Electric Equipment Power per Floor Area","W/M2"])
382
+ # annual_results_array.push( [ current_building.electricEquipmentPowerPerPerson(), "Electric Equipment Power Per Person","W/person"])
383
+ # annual_results_array.push( [ current_building.gasEquipmentPower(), "Gas Equipment Power","W"])
384
+ # annual_results_array.push( [ current_building.gasEquipmentPowerPerFloorArea(),"Gas Equipment Power per Floor Area","W/M2"])
385
+ # annual_results_array.push( [ current_building.gasEquipmentPowerPerPerson(), "Gas Equipment Power Per Person","W/person"] )
386
+ # annual_results_array.push( [ model.getBuildingStorys.size, "Number of Stories", ""])
387
+ #
388
+ # annual_results_array.push( [ current_facility.totalSiteEnergy(), "Total Site Energy", "GJ"])
389
+ # annual_results_array.push( [ current_facility.netSiteEnergy(), "Net Site Energy", "GJ"])
390
+ # annual_results_array.push( [ current_facility.totalSourceEnergy(), "Total Source Energy", "GJ"])
391
+ # annual_results_array.push( [ current_facility.netSourceEnergy(), "Net Source Energy", "GJ"])
392
+ #
393
+ # annual_results_array.push( [ current_facility.hoursHeatingSetpointNotMet(),"Hours Heating Setpoint Not Met", "Hours"])
394
+ # annual_results_array.push( [ current_facility.hoursCoolingSetpointNotMet(),"Hours Cooling Setpoint Not Met", "Hours"])
395
+ #
396
+ # #cost information
397
+ # # annual_results_array.push( [ current_facility.annualTotalCost(OpenStudio::FuelType.new("NaturalGas")), "Annual Natural Gas Total Cost", "$"])
398
+ # # annual_results_array.push( [ current_facility.annualTotalCostPerBldgArea(OpenStudio::FuelType.new("NaturalGas")),"Annual Natural Gas Total Cost per Bldg Area", "$/M2"])
399
+ # # annual_results_array.push( [ current_facility.annualTotalCostPerNetConditionedBldgArea(OpenStudio::FuelType.new("NaturalGas")), "Annual Natural Gas Total Cost per Conditioned Bldg Area", "$/M2"])
400
+ # # annual_results_array.push( [ current_facility.annualTotalUtilityCost(), "Annual Total Utility Cost", "$"])
401
+ # # annual_results_array.push( [ current_facility.annualElectricTotalCost() , "Annual Total Electric Utility Cost", "$"])
402
+ # # annual_results_array.push( [ current_facility.annualGasTotalCost(), "Annual Total Gas Utility Cost", "$"])
403
+ # # annual_results_array.push( [ current_facility.annualDistrictCoolingTotalCost(), "Annual Total District Cooling Utility Cost", "$"])
404
+ # # annual_results_array.push( [ current_facility.annualDistrictHeatingTotalCost(), "Annual Total District Heating Utility Cost", "$"])
405
+ # # annual_results_array.push( [ current_facility.annualWaterTotalCost(), "Annual Total Water Cost", "$"])
406
+ # # annual_results_array.push( [ current_facility.totalEnergyTimeDependentValuation(), "Annual Total Water Cost", "$"])
407
+ # # annual_results_array.push( [ current_facility.totalCostTimeDependentValuation(), "Annual Total Water Cost", "$"])
408
+ # # annual_results_array.push( [ current_facility.electricityEnergyTimeDependentValuation(), "electricityEnergyTimeDependentValuation", "J"])
409
+ # # annual_results_array.push( [ current_facility.electricityCostTimeDependentValuation(), "electricityCostTimeDependentValuation", "$"])
410
+ # # annual_results_array.push( [ current_facility.fossilFuelEnergyTimeDependentValuation(),"fossilFuelEnergyTimeDependentValuation", "J"])
411
+ # # annual_results_array.push( [ current_facility.fossilFuelCostTimeDependentValuation(), "fossilFuelCostTimeDependentValuation", "$"])
412
+ # # annual_results_array.push( [ current_facility.economicsCapitalCost(), "economics Capitol Costs", "$"])
413
+ # # annual_results_array.push( [ current_facility.economicsEnergyCost(), "economics Energy Costs", "$"])
414
+ # # annual_results_array.push( [ current_facility.economicsTLCC(), "economics Total Life Cycle Costs", "$"])
415
+ #
416
+ #
417
+ # value = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='Life-Cycle Cost Report' AND ReportForString='Entire Facility' AND TableName='Present Value by Category' AND RowName='Grand Total' AND ColumnName='Present Value'")
418
+ #
419
+ # if value.empty?
420
+ # value = 0.0
421
+ # else
422
+ # value = value.get
423
+ # end
424
+ # annual_results_array.push( [ value, "Total Capitol Costs", "$"])
425
+ #
426
+ #
427
+ #
428
+ #
429
+ # # annual_results_array.push( [ current_facility.economicsVirtualRateGas(), "economics Virtual Rate Gas", "$/GJ"])
430
+ # # annual_results_array.push( [ current_facility.economicsVirtualRateElec(), "economics Virtual Rate Electric", "$/GJ"])
431
+ # # annual_results_array.push( [ current_facility.economicsVirtualRateCombined(), "economics Virtual Rate Combined", "$/GJ"])
432
+ # # annual_results_array.push( [ current_facility.economicsSPB(), "economics Simple Pay Back", "Years"])
433
+ # # annual_results_array.push( [ current_facility.economicsDPB(), "economics Discounted Payback", "Years"])
434
+ # # annual_results_array.push( [ current_facility.economicsNPV(), "economics Net Present Value", "$"])
435
+ # # annual_results_array.push( [ current_facility.economicsIRR(), "economics Internal Rate of Return", "%"])
436
+ #
437
+ # # annual_results_array.each {|result| puts "#{result[0]}, #{result[1]}, #{result[2]}, #{basename}" }
438
+ # #Determine weighted area average conductances
439
+ # outdoor_surfaces = BTAP::Geometry::Surfaces::filter_by_boundary_condition(model.getSurfaces(), "Outdoors")
440
+ # outdoor_walls = BTAP::Geometry::Surfaces::filter_by_surface_types(outdoor_surfaces, "Wall")
441
+ # outdoor_roofs = BTAP::Geometry::Surfaces::filter_by_surface_types(outdoor_surfaces, "RoofCeiling")
442
+ # outdoor_floors = BTAP::Geometry::Surfaces::filter_by_surface_types(outdoor_surfaces, "Floor")
443
+ # outdoor_subsurfaces = BTAP::Geometry::Surfaces::get_subsurfaces_from_surfaces(outdoor_surfaces)
444
+ # windows = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["FixedWindow" , "OperableWindow" ])
445
+ # skylights = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["Skylight", "TubularDaylightDiffuser","TubularDaylightDome" ])
446
+ # doors = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["Door" , "GlassDoor" ])
447
+ # overhead_doors = BTAP::Geometry::Surfaces::filter_subsurfaces_by_types(outdoor_subsurfaces, ["OverheadDoor" ])
448
+ # outdoor_walls_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(outdoor_walls)
449
+ # outdoor_roofs_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(outdoor_roofs)
450
+ # outdoor_floors_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(outdoor_floors)
451
+ # windows_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(windows)
452
+ # skylights_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(skylights)
453
+ # doors_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(doors)
454
+ # overhead_doors_average_conductance = BTAP::Geometry::Surfaces::get_weighted_average_surface_conductance(overhead_doors)
455
+ # #Store Values
456
+ # annual_results_array.push( [ outdoor_walls_average_conductance ,"outdoor_walls_average_conductance", "?"])
457
+ # annual_results_array.push( [ outdoor_roofs_average_conductance ,"outdoor_roofs_average_conductance", "?"])
458
+ # annual_results_array.push( [ outdoor_floors_average_conductance ,"outdoor_floors_average_conductance", "?"])
459
+ # annual_results_array.push( [ windows_average_conductance ,"outdoor_windows_average_conductance", "?"])
460
+ # annual_results_array.push( [ doors_average_conductance ,"outdoor_doors_average_conductance", "?"])
461
+ # annual_results_array.push( [ overhead_doors_average_conductance ,"outdoor_overhead_doors_average_conductance", "?"])
462
+ # annual_results_array.push( [ skylights_average_conductance ,"skylights_average_conductance", "?"])
463
+ # annual_results_array.push( [ BTAP::Geometry::get_fwdr(model), "Fenestration To Wall Ratio", "-"])
464
+ # annual_results_array.push( [ BTAP::Geometry::get_srr(model), "Skylight to Roof Ratio", "-"])
465
+ #
466
+ # #Get peak watts for gas and elec
467
+ # electric_peak = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='EnergyMeters'" +
468
+ # " AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Electricity' AND RowName='Electricity:Facility'" +
469
+ # " AND ColumnName='Electricity Maximum Value' AND Units='W'")
470
+ # if electric_peak.empty?
471
+ # electric_peak = 0.0
472
+ # end
473
+ #
474
+ # natural_gas_peak = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='EnergyMeters'" +
475
+ # " AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Natural Gas' AND RowName='NaturalGas:Facility'" +
476
+ # " AND ColumnName='Natural Gas Maximum Value' AND Units='W'")
477
+ # if natural_gas_peak.empty?
478
+ # natural_gas_peak = 0.0
479
+ # end
480
+ #
481
+ # annual_results_array.push( [ electric_peak ,"Peak Electricity", "W"])
482
+ # annual_results_array.push( [ natural_gas_peak ,"Peak Gas", "W"])
483
+ #
484
+ # #Get End Uses by fuel type.
485
+ # fuel_types = [
486
+ # ['Electricity', 'GJ'],
487
+ # ['Natural Gas', 'GJ'],
488
+ # ['Other Fuel', 'GJ'],
489
+ # ['District Cooling', 'GJ'],
490
+ # ['District Heating', 'GJ'],
491
+ # ['Water', 'm3']]
492
+ # use_types = [
493
+ # 'Heating',
494
+ # 'Cooling',
495
+ # 'Interior Lighting',
496
+ # 'Exterior Lighting',
497
+ # 'Interior Equipment',
498
+ # 'Exterior Equipment',
499
+ # 'Fans',
500
+ # 'Pumps',
501
+ # 'Heat Rejection',
502
+ # 'Humidification',
503
+ # 'Heat Recovery',
504
+ # 'Water Systems',
505
+ # 'Refrigeration',
506
+ # 'Generators'
507
+ # ]
508
+ # use_types.each do |use_type|
509
+ # fuel_types.each do |fuel_type|
510
+ # fuel_name = fuel_type[0]
511
+ # fuel_units = fuel_type[1]
512
+ # value = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'")
513
+ # if value.empty?
514
+ # value = 0.0
515
+ # else
516
+ # value = value.get
517
+ # end
518
+ # annual_results_array.push( [ value, "#{fuel_name}-#{use_type}", fuel_units])
519
+ # annual_results_array.push( [ value / current_building.floorArea() , "#{fuel_name}-#{use_type} Total Floor Area Intensity", "#{fuel_units}/m2"] )
520
+ # end
521
+ # end
522
+ # return annual_results_array
523
+ # end
524
+ #
525
+ # #This method will return an array of common annual data results. With header and unit information and returns an annual results string array.
526
+ # #@author phylroy.lopez@nrcan.gc.ca
527
+ # #@param osm_file [String]
528
+ # #@param sql_path [String]
529
+ # #@return [annual_results_array<String>]
530
+ # def self.get_annual_results_model_results(osm_file,sql_path)
531
+ #
532
+ # #load Osm file.
533
+ # model = BTAP::FileIO::load_osm(osm_file)
534
+ # #link sql output
535
+ # model.setSqlFile(OpenStudio::SqlFile.new(OpenStudio::Path.new(sql_path)))
536
+ #
537
+ # #Create hash of results.
538
+ # annual_results_array = Array.new()
539
+ # annual_results_array.push( [ osm_file,"osm_file",""])
540
+ # annual_results_array.push( [ sql_path,"sql_path",""])
541
+ # if match = model.building.get.name.get.match(/(^.*)~(.*)~(.*)/)
542
+ # building_name, vintage_name, ecm_name = match.captures
543
+ # annual_results_array.push( [ building_name,"building_name",""])
544
+ # annual_results_array.push( [ vintage_name,"vintage_name",""])
545
+ # annual_results_array.push( [ ecm_name,"measure_id",""])
546
+ # else
547
+ # annual_results_array.push( [ model.building.get.name,"building_name",""])
548
+ # end
549
+ #
550
+ # #Capitol Costs
551
+ # value = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='Life-Cycle Cost Report' AND ReportForString='Entire Facility' AND TableName='Present Value by Category' AND RowName='Grand Total' AND ColumnName='Present Value'")
552
+ # if value.empty?
553
+ # value = 0.0
554
+ # else
555
+ # value = value.get
556
+ # end
557
+ # annual_results_array.push( [ value, "Simulation Total Capitol Costs", "$"])
558
+ #
559
+ #
560
+ # #Total floor Areas
561
+ # annual_results_array.push( [ model.building.get.floorArea(),"Total Floor Area", "M2"])
562
+ # #Conditioned floor area
563
+ # annual_results_array.push( [ model.building.get.conditionedFloorArea(),"Conditioned Floor Area", "M2"])
564
+ #
565
+ #
566
+ # #District Heating
567
+ # fuel_name,use_type,fuel_units = "District Heating","Heating", 'GJ'
568
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
569
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
570
+ #
571
+ # #District Cooling
572
+ # fuel_name,use_type,fuel_units = "District Cooling","Cooling", 'GJ'
573
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
574
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
575
+ #
576
+ #
577
+ # #Electrical Heating
578
+ # fuel_name,use_type,fuel_units = "Electricity","Heating", 'GJ'
579
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
580
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
581
+ #
582
+ # #Natural Gas Heating
583
+ # fuel_name,use_type,fuel_units = "Natural Gas","Heating", 'GJ'
584
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
585
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
586
+ #
587
+ # #Electric Cooling
588
+ # fuel_name,use_type,fuel_units = "Electricity","Cooling", 'GJ'
589
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
590
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
591
+ #
592
+ # #Electric Water systems
593
+ # fuel_name,use_type,fuel_units = "Electricity","Water Systems", 'GJ'
594
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
595
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
596
+ #
597
+ # #NG Water systems
598
+ # fuel_name,use_type,fuel_units = "Natural Gas","Water Systems", 'GJ'
599
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
600
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
601
+ #
602
+ # fuel_name,use_type,fuel_units = "Electricity","Interior Lighting", 'GJ'
603
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
604
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
605
+ #
606
+ # fuel_name,use_type,fuel_units = "Electricity","Interior Equipment", 'GJ'
607
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
608
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
609
+ #
610
+ # fuel_name,use_type,fuel_units = "District Heating","Interior Equipment", 'GJ'
611
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
612
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
613
+ #
614
+ #
615
+ # fuel_name,use_type,fuel_units = "Electricity","Fans", 'GJ'
616
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
617
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
618
+ #
619
+ # fuel_name,use_type,fuel_units = "Electricity","Pumps", 'GJ'
620
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
621
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
622
+ #
623
+ # fuel_name,use_type,fuel_units = "Electricity","Heat Recovery", 'GJ'
624
+ # sql_query = "SELECT Value FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='End Uses' AND RowName='#{use_type}' AND ColumnName='#{fuel_name}' AND Units='#{fuel_units}'"
625
+ # annual_results_array.push( [ model.sqlFile().get().execAndReturnFirstDouble(sql_query).get ? model.sqlFile().get().execAndReturnFirstDouble(sql_query).get * 277.778 : 0.0, "#{fuel_name}-#{use_type}", "KWh"])
626
+ #
627
+ #
628
+ # return annual_results_array
629
+ # end
630
+ #
631
+ # #This method will convert eso to cvs.
632
+ # #@author phylroy.lopez@nrcan.gc.ca
633
+ # #@param eso_file_path [String]
634
+ # def self.convert_eso_to_csv(eso_file_path)
635
+ # #Run ESO Vars command must be run in folder.
636
+ # root_folder = Dir.getwd()
637
+ # # puts File.dirname(eso_file_path)
638
+ # Dir.chdir(File.dirname(eso_file_path))
639
+ # system(self.find_read_vars_eso())
640
+ # #get name of run from html file. This is faster than loading OSM file.
641
+ # runname = ""
642
+ # f = File.open("eplustbl.htm")
643
+ # f.each_line do |line|
644
+ # if line =~ /<p>Building: <b>(.*)<\/b><\/p>/
645
+ # runname = $1
646
+ # break
647
+ # end
648
+ # end
649
+ # f.close
650
+ # #copy files over with distinct names
651
+ # FileUtils.cp("eplusout.csv","#{runname}_eplusout.csv")
652
+ # FileUtils.cp("eplustbl.htm","#{runname}_eplustbl.htm")
653
+ # FileUtils.cp("eplusout.sql","#{runname}_eplusout.sql")
654
+ # Dir.chdir(root_folder)
655
+ # end
656
+ #
657
+ # #This method will copy results to a folder.
658
+ # #@author phylroy.lopez@nrcan.gc.ca
659
+ # #@param in_folder [String]
660
+ # #@param out_folder [String]
661
+ # def copy_results_to_folder(in_folder,out_folder)
662
+ # #find all csv hourly output
663
+ # BTAP::FILEIO::get_find_files_from_folder_by_extension(in_folder, "_eplusout.csv").each {|file| FileUtils.cp(file,out_folder)}
664
+ # BTAP::FILEIO::get_find_files_from_folder_by_extension(in_folder, "_eplustbl.htm").each {|file| FileUtils.cp(file,out_folder)}
665
+ # BTAP::FILEIO::get_find_files_from_folder_by_extension(in_folder, "_eplusout.sql").each {|file| FileUtils.cp(file,out_folder)}
666
+ #
667
+ # end
668
+ #
669
+ #
670
+ # #This method copies report files to a single folder for convenience.
671
+ # #@author phylroy.lopez@nrcan.gc.ca
672
+ # #@param run_name [String]
673
+ # #@return [OpenStudio::model::Model] A model object
674
+ # def processResults(run_name)
675
+ # #make sql folder
676
+ # Dir.mkdir(@outdir.to_s+"\\sqlresults") unless File.exists?(@outdir.to_s+"\\sqlresults")
677
+ # #make html folder
678
+ # Dir.mkdir(@outdir.to_s+"\\htmlresults") unless File.exists?(@outdir.to_s+"\\htmlresults")
679
+ # #puts "processing results for " + run_name
680
+ #
681
+ # #load sql file
682
+ # # see if we can find sql file
683
+ # sql_path = OpenStudio::Path.new(@outdir.to_s+"\\" + run_name + "_osm\\ModelToIdf\\ExpandObjects-0\\EnergyPlus-0\\eplusout.sql")
684
+ # html_path = OpenStudio::Path.new(@outdir.to_s+"\\" + run_name + "_osm\\ModelToIdf\\ExpandObjects-0\\EnergyPlus-0\\eplustbl.htm")
685
+ # FileUtils.cp(sql_path.to_s,@outdir.to_s+"/sqlresults/" + run_name + ".sql")
686
+ # FileUtils.cp(html_path.to_s,@outdir.to_s+"/htmlresults/" + run_name + ".htm")
687
+ #
688
+ # #load osm file to attach sql file
689
+ # model_path = OpenStudio::Path.new(@outdir.to_s+"\\"+ run_name + ".osm")
690
+ # if OpenStudio::exists(model_path)
691
+ # model = BTAP::FileIO::load_osm(model_path)
692
+ # end
693
+ #
694
+ #
695
+ # #attach sql file
696
+ # if OpenStudio::exists(sql_path)
697
+ # # translate the results and load them into the model
698
+ # sqlFile = OpenStudio::SqlFile.new(sql_path)
699
+ # model.setSqlFile(sqlFile)
700
+ # else
701
+ # #puts "could not load sql file" + sql_path
702
+ # end
703
+ #
704
+ #
705
+ # #construct path to E+ run.
706
+ # ep_project_folder = @outdir.to_s+"\\" + run_name + "_osm\\ModelToIdf\\ExpandObjects-0\\EnergyPlus-0\\"
707
+ # eso_file = ep_project_folder + "\\eplusout.eso"
708
+ # #create csv folder at top of folder hieracrhy.
709
+ # cvs_results_folder = @outdir.to_s+"/csvresults/"
710
+ # Dir.mkdir(cvs_results_folder) unless File.exists?(cvs_results_folder)
711
+ # #create path to e+ csv file and copy it to folder.
712
+ #
713
+ #
714
+ # #Run ESO Vars command must be run in folder.
715
+ # root_folder = Dir.getwd()
716
+ # Dir.chdir(ep_project_folder)
717
+ # system(@readvars_path)
718
+ # csv_file = ep_project_folder + "\\eplusout.csv"
719
+ # FileUtils.cp(csv_file, cvs_results_folder + run_name + ".csv")
720
+ # Dir.chdir(root_folder)
721
+ # return model
722
+ # end
723
+ #
724
+ # #This method will fix underheated hours
725
+ # #@author Phylroy A. Lopez
726
+ # #@param model [OpenStudio::model::Model] A model object
727
+ # #@param folder_name [String] a simple string of the simulation folder path, remember to escape the slashes..(i.e. // not / )
728
+ # #@param epw_path [String] a simple string of the epw file path, remember to escape the slashes..(i.e. // not / )
729
+ # def fix_underheated_hours(model,epw_path,folder_name = "c:/temp/")
730
+ #
731
+ # #Run model.
732
+ # BTAP::SimManager::run_simulation(model, folder_name, epw_path)
733
+ #
734
+ # #Look at hours unmet per zone table in eplusout.htm file
735
+ # #Make sure that the zone with the problem is not a slave zone on a single-zone VAV system.
736
+ # #Check your thermostat setpoint schedules for this zone to make sure values are reasonable
737
+ # #Check that design days are for the same location as the weather file
738
+ # #Open the .osm in a text editor to look at this.
739
+ # #Check the tolerance for reporting unmet hours
740
+ # #Try 2F and re-run. If tolerance is too tight, you can get false alarms.
741
+ # #Check design/sizing temperature for each plant loop.
742
+ # #This is found by clicking the dashed line in the center of a plant loop.
743
+ # #Check the operational temperature in the plant loop's setpoint manager.
744
+ # #It should match up with the design/sizing temperature for that loop.
745
+ # #If you size the loop for 180F water but tell it to operate at 150F, the equipment won't be big enough during peak times.
746
+ # #Check design/sizing heating and cooling supply air temperatures for air loop.
747
+ # #This is found by clicking the dashed line in the center of the air loop.
748
+ # #Check the operational temperature in the air loop's setpoint manager.
749
+ # #It should match up with the design/sizing temperature for that loop.
750
+ # #If you size the loop for 55F supply air but tell it to operate at 60F, the equipment might not be big enough during peak times.
751
+ # #Check that sizing design day thermostat is using a constant setpoint schedule with no setback.
752
+ # #This is a 90.1 requirement. If your design day has a setback, your system will be oversized in an attempt to be able to go from setback to setup in a single timestep.
753
+ # #Equipment that is significantly oversized might not operate properly at low load conditions.
754
+ # end
755
+ #
756
+ # end
757
+ #
758
+ # end
759
+ # end