urbanopt-cli 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (641) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/{nightly_build.yml → nightly_ci_build.yml} +6 -5
  3. data/CHANGELOG.md +16 -2
  4. data/CMakeLists.txt +7 -7
  5. data/Gemfile +8 -7
  6. data/LICENSE.md +18 -15
  7. data/README.md +2 -1
  8. data/Rakefile +2 -37
  9. data/example_files/Gemfile +10 -8
  10. data/example_files/mappers/Baseline.rb +170 -191
  11. data/example_files/mappers/ChilledWaterStorage.rb +8 -30
  12. data/example_files/mappers/ClassProject.rb +2 -27
  13. data/example_files/mappers/CreateBar.rb +2 -28
  14. data/example_files/mappers/EvCharging.rb +2 -27
  15. data/example_files/mappers/FlexibleHotWater.rb +2 -27
  16. data/example_files/mappers/Floorspace.rb +2 -27
  17. data/example_files/mappers/HighEfficiency.rb +2 -27
  18. data/example_files/mappers/HighEfficiencyCreateBar.rb +2 -27
  19. data/example_files/mappers/HighEfficiencyFloorspace.rb +2 -27
  20. data/example_files/mappers/PeakHoursMelsShedding.rb +4 -27
  21. data/example_files/mappers/PeakHoursThermostatAdjust.rb +4 -27
  22. data/example_files/mappers/ThermalStorage.rb +2 -28
  23. data/example_files/measures/BuildResidentialModel/measure.rb +30 -60
  24. data/example_files/measures/BuildResidentialModel/measure.xml +253 -84
  25. data/example_files/measures/BuildResidentialModel/resources/util.rb +45 -45
  26. data/example_files/python_deps/dependencies.json +3 -3
  27. data/example_files/resources/hpxml-measures/.github/pull_request_template.md +1 -1
  28. data/example_files/resources/hpxml-measures/.github/workflows/config.yml +28 -19
  29. data/example_files/resources/hpxml-measures/.gitignore +0 -997
  30. data/example_files/resources/hpxml-measures/.readthedocs.yml +9 -0
  31. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/measure.rb +476 -230
  32. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/measure.xml +244 -75
  33. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/resources/geometry.rb +42 -15
  34. data/example_files/resources/hpxml-measures/BuildResidentialHPXML/tests/build_residential_hpxml_test.rb +24 -9
  35. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/measure.rb +11 -33
  36. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/measure.xml +23 -50
  37. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/resources/README.md +2 -2
  38. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/resources/constants.rb +119 -0
  39. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/resources/schedules.rb +67 -290
  40. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/resources/schedules_config.md +6 -5
  41. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/tests/build_residential_schedule_file_test.rb +78 -349
  42. data/example_files/resources/hpxml-measures/Changelog.md +80 -10
  43. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/measure.rb +212 -144
  44. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/measure.xml +164 -170
  45. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/airflow.rb +238 -167
  46. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/battery.rb +1 -1
  47. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/constants.rb +12 -4
  48. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/constructions.rb +36 -6
  49. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/data/unavailable_periods.csv +33 -0
  50. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/energyplus.rb +1 -0
  51. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/geometry.rb +9 -7
  52. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hotwater_appliances.rb +79 -61
  53. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml.rb +387 -124
  54. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_defaults.rb +427 -196
  55. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_schema/HPXML.xsd +11515 -2
  56. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_schema/README.md +1 -0
  57. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_schematron/EPvalidator.xml +224 -85
  58. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hvac.rb +334 -319
  59. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hvac_sizing.rb +572 -838
  60. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/lighting.rb +162 -68
  61. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/location.rb +4 -20
  62. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/meta_measure.rb +12 -10
  63. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/misc_loads.rb +34 -37
  64. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/output.rb +8 -101
  65. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/psychrometrics.rb +31 -40
  66. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/pv.rb +1 -1
  67. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedule_files/occupancy-non-stochastic.csv +8761 -0
  68. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedule_files/occupancy-stochastic-10-mins.csv +52561 -52561
  69. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedule_files/occupancy-stochastic.csv +8761 -8761
  70. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedules.rb +384 -155
  71. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/unit_conversions.rb +1 -1
  72. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/util.rb +2 -2
  73. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/version.rb +2 -2
  74. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/waterheater.rb +68 -90
  75. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/weather.rb +34 -223
  76. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/xmlhelper.rb +1 -1
  77. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/xmlvalidator.rb +16 -4
  78. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_airflow.rb +94 -40
  79. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_defaults.rb +765 -302
  80. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_enclosure.rb +119 -69
  81. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_generator.rb +8 -8
  82. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hotwater_appliance.rb +1 -1
  83. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hvac.rb +51 -11
  84. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_hvac_sizing.rb +196 -9
  85. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_lighting.rb +36 -13
  86. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_miscloads.rb +3 -3
  87. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_pv.rb +2 -2
  88. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_schedules.rb +571 -61
  89. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_validation.rb +190 -81
  90. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_water_heater.rb +11 -11
  91. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_weather.rb +188 -50
  92. data/example_files/resources/hpxml-measures/README.md +3 -3
  93. data/example_files/resources/hpxml-measures/ReportSimulationOutput/measure.rb +659 -815
  94. data/example_files/resources/hpxml-measures/ReportSimulationOutput/measure.xml +301 -1112
  95. data/example_files/resources/hpxml-measures/ReportSimulationOutput/tests/output_report_test.rb +605 -350
  96. data/example_files/resources/hpxml-measures/ReportUtilityBills/measure.rb +18 -14
  97. data/example_files/resources/hpxml-measures/ReportUtilityBills/measure.xml +15 -15
  98. data/example_files/resources/hpxml-measures/ReportUtilityBills/tests/utility_bills_test.rb +13 -3
  99. data/example_files/resources/hpxml-measures/docs/source/usage_instructions.rst +3 -3
  100. data/example_files/resources/hpxml-measures/docs/source/workflow_inputs.rst +894 -596
  101. data/example_files/resources/hpxml-measures/docs/source/workflow_outputs.rst +127 -76
  102. data/example_files/resources/hpxml-measures/tasks.rb +185 -2802
  103. data/example_files/resources/hpxml-measures/workflow/hpxml_inputs.json +3401 -0
  104. data/example_files/resources/hpxml-measures/workflow/real_homes/house001.xml +0 -1
  105. data/example_files/resources/hpxml-measures/workflow/real_homes/house002.xml +0 -1
  106. data/example_files/resources/hpxml-measures/workflow/real_homes/house003.xml +0 -1
  107. data/example_files/resources/hpxml-measures/workflow/real_homes/house004.xml +0 -1
  108. data/example_files/resources/hpxml-measures/workflow/real_homes/house005.xml +0 -1
  109. data/example_files/resources/hpxml-measures/workflow/real_homes/house006.xml +1 -3
  110. data/example_files/resources/hpxml-measures/workflow/real_homes/house007.xml +0 -1
  111. data/example_files/resources/hpxml-measures/workflow/real_homes/house008.xml +1 -3
  112. data/example_files/resources/hpxml-measures/workflow/real_homes/house009.xml +0 -1
  113. data/example_files/resources/hpxml-measures/workflow/real_homes/house010.xml +1 -3
  114. data/example_files/resources/hpxml-measures/workflow/real_homes/house011.xml +0 -1
  115. data/example_files/resources/hpxml-measures/workflow/real_homes/house012.xml +0 -1
  116. data/example_files/resources/hpxml-measures/workflow/real_homes/house013.xml +0 -1
  117. data/example_files/resources/hpxml-measures/workflow/real_homes/house014.xml +0 -1
  118. data/example_files/resources/hpxml-measures/workflow/real_homes/house015.xml +0 -1
  119. data/example_files/resources/hpxml-measures/workflow/real_homes/house016.xml +3 -4
  120. data/example_files/resources/hpxml-measures/workflow/real_homes/house017.xml +17 -4
  121. data/example_files/resources/hpxml-measures/workflow/real_homes/house018.xml +2 -3
  122. data/example_files/resources/hpxml-measures/workflow/real_homes/house019.xml +3 -4
  123. data/example_files/resources/hpxml-measures/workflow/real_homes/house020.xml +3 -4
  124. data/example_files/resources/hpxml-measures/workflow/real_homes/house021.xml +4 -5
  125. data/example_files/resources/hpxml-measures/workflow/real_homes/house022.xml +3 -4
  126. data/example_files/resources/hpxml-measures/workflow/real_homes/house023.xml +3 -4
  127. data/example_files/resources/hpxml-measures/workflow/real_homes/house024.xml +3 -4
  128. data/example_files/resources/hpxml-measures/workflow/real_homes/house025.xml +3 -4
  129. data/example_files/resources/hpxml-measures/workflow/real_homes/house026.xml +1 -1
  130. data/example_files/resources/hpxml-measures/workflow/real_homes/house027.xml +1 -1
  131. data/example_files/resources/hpxml-measures/workflow/real_homes/house028.xml +1 -1
  132. data/example_files/resources/hpxml-measures/workflow/real_homes/house029.xml +1 -1
  133. data/example_files/resources/hpxml-measures/workflow/real_homes/house030.xml +0 -1
  134. data/example_files/resources/hpxml-measures/workflow/real_homes/house031.xml +4 -5
  135. data/example_files/resources/hpxml-measures/workflow/real_homes/house032.xml +3 -3
  136. data/example_files/resources/hpxml-measures/workflow/real_homes/house033.xml +3 -3
  137. data/example_files/resources/hpxml-measures/workflow/real_homes/house034.xml +3 -4
  138. data/example_files/resources/hpxml-measures/workflow/real_homes/house035.xml +3 -3
  139. data/example_files/resources/hpxml-measures/workflow/real_homes/house036.xml +3 -4
  140. data/example_files/resources/hpxml-measures/workflow/real_homes/house037.xml +3 -3
  141. data/example_files/resources/hpxml-measures/workflow/real_homes/house038.xml +3 -4
  142. data/example_files/resources/hpxml-measures/workflow/real_homes/house039.xml +3 -3
  143. data/example_files/resources/hpxml-measures/workflow/real_homes/house040.xml +3 -4
  144. data/example_files/resources/hpxml-measures/workflow/real_homes/house041.xml +0 -1
  145. data/example_files/resources/hpxml-measures/workflow/real_homes/house042.xml +0 -1
  146. data/example_files/resources/hpxml-measures/workflow/real_homes/house043.xml +0 -1
  147. data/example_files/resources/hpxml-measures/workflow/real_homes/house044.xml +0 -1
  148. data/example_files/resources/hpxml-measures/workflow/real_homes/house045.xml +0 -1
  149. data/example_files/resources/hpxml-measures/workflow/real_homes/house046.xml +1 -0
  150. data/example_files/resources/hpxml-measures/workflow/real_homes/house047.xml +1 -0
  151. data/example_files/resources/hpxml-measures/workflow/run_simulation.rb +12 -8
  152. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-coal.xml +10 -40
  153. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier-ief-portable.xml +10 -40
  154. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier-ief-whole-home.xml +10 -40
  155. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier-multiple.xml +10 -40
  156. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-dehumidifier.xml +10 -40
  157. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-gas.xml +10 -40
  158. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-modified.xml +10 -40
  159. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-none.xml +10 -40
  160. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-oil-location-miami-fl.xml +10 -40
  161. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-oil.xml +10 -40
  162. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-propane-location-portland-or.xml +10 -40
  163. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-propane.xml +10 -40
  164. data/example_files/resources/hpxml-measures/workflow/sample_files/base-appliances-wood.xml +10 -40
  165. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-cathedral.xml +10 -40
  166. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-conditioned.xml +9 -39
  167. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-flat.xml +9 -39
  168. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-radiant-barrier.xml +10 -40
  169. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-unvented-insulated-roof.xml +10 -40
  170. data/example_files/resources/hpxml-measures/workflow/sample_files/base-atticroof-vented.xml +10 -40
  171. data/example_files/resources/hpxml-measures/workflow/sample_files/base-battery-scheduled.xml +10 -40
  172. data/example_files/resources/hpxml-measures/workflow/sample_files/base-battery.xml +10 -40
  173. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-bldgtype-single-family-attached-2stories.xml → base-bldgtype-attached-2stories.xml} +610 -639
  174. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-bldgtype-single-family-attached-atticroof-cathedral.xml → base-bldgtype-attached-atticroof-cathedral.xml} +558 -587
  175. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-attached-infil-compartmentalization-test.xml +611 -0
  176. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-bldgtype-single-family-attached.xml → base-bldgtype-attached.xml} +610 -639
  177. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-adjacent-to-multifamily-buffer-space.xml +10 -39
  178. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-adjacent-to-multiple.xml +10 -39
  179. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-adjacent-to-non-freezing-space.xml +10 -39
  180. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-adjacent-to-other-heated-space.xml +10 -39
  181. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-adjacent-to-other-housing-unit.xml +10 -39
  182. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-infil-compartmentalization-test.xml +462 -0
  183. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-bldgtype-multifamily-calctype-operational.xml → base-bldgtype-multifamily-residents-1.xml} +453 -480
  184. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-baseboard.xml +10 -39
  185. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-fan-coil-ducted.xml +10 -39
  186. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-fan-coil.xml +10 -39
  187. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-chiller-water-loop-heat-pump.xml +10 -39
  188. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-cooling-tower-water-loop-heat-pump.xml +10 -39
  189. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-baseboard.xml +10 -39
  190. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil-ducted.xml +10 -39
  191. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil-eae.xml +10 -39
  192. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-fan-coil.xml +10 -39
  193. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-boiler-only-water-loop-heat-pump.xml +10 -39
  194. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-baseboard.xml +10 -39
  195. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-fan-coil-ducted.xml +10 -39
  196. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-fan-coil.xml +10 -39
  197. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-chiller-only-water-loop-heat-pump.xml +10 -39
  198. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-cooling-tower-only-water-loop-heat-pump.xml +10 -39
  199. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-generator.xml +11 -40
  200. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-ground-loop-ground-to-air-heat-pump.xml +10 -39
  201. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-laundry-room-multiple-water-heaters.xml +10 -39
  202. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-laundry-room.xml +10 -39
  203. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-mechvent-multiple.xml +10 -39
  204. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-mechvent-preconditioning.xml +10 -39
  205. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-mechvent.xml +10 -39
  206. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-pv.xml +15 -40
  207. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-water-heater-recirc.xml +10 -39
  208. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily-shared-water-heater.xml +10 -39
  209. data/example_files/resources/hpxml-measures/workflow/sample_files/base-bldgtype-multifamily.xml +10 -39
  210. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-combi-tankless-outside.xml +10 -40
  211. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-combi-tankless.xml +10 -40
  212. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-2-speed.xml +10 -40
  213. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-gshp.xml +10 -40
  214. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-hpwh.xml +10 -40
  215. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-tankless.xml +10 -40
  216. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater-var-speed.xml +10 -40
  217. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-desuperheater.xml +10 -40
  218. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-dwhr.xml +10 -40
  219. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-detailed-setpoints.xml +10 -40
  220. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-dse.xml +10 -40
  221. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-outside.xml +10 -40
  222. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-standbyloss.xml +10 -40
  223. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect-with-solar-fraction.xml +10 -40
  224. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-indirect.xml +10 -40
  225. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-electric.xml +10 -40
  226. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-gas.xml +10 -40
  227. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-hpwh.xml +10 -40
  228. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-jacket-indirect.xml +10 -40
  229. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-low-flow-fixtures.xml +10 -40
  230. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-multiple.xml +10 -40
  231. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-none.xml +10 -40
  232. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-demand.xml +10 -40
  233. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-manual.xml +10 -40
  234. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-nocontrol.xml +10 -40
  235. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-temperature.xml +10 -40
  236. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-recirc-timer.xml +10 -40
  237. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-evacuated-tube.xml +10 -40
  238. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-flat-plate.xml +10 -40
  239. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-direct-ics.xml +10 -40
  240. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-fraction.xml +10 -40
  241. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-indirect-flat-plate.xml +10 -40
  242. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-solar-thermosyphon-flat-plate.xml +10 -40
  243. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-coal.xml +10 -40
  244. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-detailed-setpoints.xml +10 -40
  245. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-elec-uef.xml +10 -40
  246. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas-outside.xml +10 -40
  247. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas-uef-fhr.xml +10 -40
  248. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas-uef.xml +10 -40
  249. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-gas.xml +10 -40
  250. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-detailed-schedules.xml +10 -40
  251. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-operating-mode-heat-pump-only.xml +11 -43
  252. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-outside.xml +10 -40
  253. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-uef.xml +10 -40
  254. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-with-solar-fraction.xml +10 -40
  255. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump-with-solar.xml +10 -40
  256. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-heat-pump.xml +10 -40
  257. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-model-type-stratified-detailed-occupancy-stochastic.xml +10 -40
  258. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-model-type-stratified.xml +10 -40
  259. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-oil.xml +10 -40
  260. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tank-wood.xml +10 -40
  261. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-detailed-setpoints.xml +10 -40
  262. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric-outside.xml +10 -40
  263. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric-uef.xml +10 -40
  264. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-electric.xml +10 -40
  265. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-uef.xml +10 -40
  266. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-with-solar-fraction.xml +10 -40
  267. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas-with-solar.xml +10 -40
  268. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-gas.xml +10 -40
  269. data/example_files/resources/hpxml-measures/workflow/sample_files/base-dhw-tankless-propane.xml +10 -40
  270. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-2stories-garage.xml +19 -25
  271. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-2stories.xml +10 -40
  272. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-1.xml +10 -40
  273. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-2.xml +10 -40
  274. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-4.xml +10 -40
  275. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-beds-5.xml +10 -40
  276. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-ceilingtypes.xml +10 -40
  277. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-floortypes.xml +10 -40
  278. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-garage.xml +18 -24
  279. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-ach-house-pressure.xml +11 -41
  280. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-cfm-house-pressure.xml +11 -41
  281. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-cfm50.xml +10 -40
  282. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-ela.xml +549 -0
  283. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-flue.xml +13 -43
  284. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-natural-ach.xml +10 -40
  285. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-infil-natural-cfm.xml +552 -0
  286. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-orientations.xml +10 -40
  287. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-overhangs.xml +10 -40
  288. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-rooftypes.xml +17 -47
  289. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-skylights-physical-properties.xml +10 -40
  290. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-skylights-shading.xml +10 -40
  291. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-skylights-storms.xml +10 -40
  292. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-skylights.xml +10 -40
  293. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-level.xml +10 -40
  294. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-thermal-mass.xml +10 -40
  295. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-walltypes.xml +10 -40
  296. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-natural-ventilation-availability.xml +10 -40
  297. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-none.xml +10 -40
  298. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-physical-properties.xml +10 -40
  299. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-shading-seasons.xml +559 -0
  300. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-shading.xml +10 -40
  301. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-windows-storms.xml +10 -40
  302. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-ambient.xml +10 -40
  303. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-basement-garage.xml +19 -25
  304. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-complex.xml +10 -40
  305. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-conditioned-basement-slab-insulation.xml +10 -40
  306. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-conditioned-basement-wall-insulation.xml +10 -40
  307. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-conditioned-crawlspace.xml +10 -40
  308. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-multiple.xml +10 -40
  309. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-slab.xml +10 -40
  310. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-above-grade.xml +10 -40
  311. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-assembly-r.xml +10 -40
  312. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement-wall-insulation.xml +10 -40
  313. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unconditioned-basement.xml +10 -40
  314. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-unvented-crawlspace.xml +10 -40
  315. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-vented-crawlspace.xml +10 -40
  316. data/example_files/resources/hpxml-measures/workflow/sample_files/base-foundation-walkout-basement.xml +10 -40
  317. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-1-speed-autosized-backup.xml +557 -0
  318. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-1-speed-cooling-only.xml +16 -41
  319. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-electric.xml → base-hvac-air-to-air-heat-pump-1-speed-heating-capacity-17f.xml} +552 -583
  320. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-1-speed-heating-only.xml +16 -41
  321. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-hvac-air-to-air-heat-pump-1-speed-backup-lockout-temperature.xml → base-hvac-air-to-air-heat-pump-1-speed-lockout-temperatures.xml} +562 -586
  322. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-1-speed-seer2-hspf2.xml +16 -41
  323. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-1-speed.xml +16 -41
  324. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-2-speed.xml +16 -41
  325. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-var-speed-backup-boiler-hvac-seasons.xml +587 -0
  326. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-var-speed-backup-boiler-switchover-temperature.xml +17 -42
  327. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-var-speed-backup-boiler.xml +16 -41
  328. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-var-speed-backup-furnace.xml +16 -41
  329. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-air-to-air-heat-pump-var-speed.xml +16 -41
  330. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-cooling-only.xml +10 -40
  331. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-heating-only.xml +10 -40
  332. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-sizing-methodology-acca.xml +10 -40
  333. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-sizing-methodology-hers.xml +10 -40
  334. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-sizing-methodology-maxload-miami-fl.xml +10 -40
  335. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-1-speed-sizing-methodology-maxload.xml +10 -40
  336. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-2-speed-sizing-methodology-acca.xml +10 -40
  337. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-2-speed-sizing-methodology-hers.xml +10 -40
  338. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-2-speed-sizing-methodology-maxload.xml +10 -40
  339. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-var-speed-backup-boiler.xml +10 -40
  340. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-var-speed-backup-furnace.xml +10 -40
  341. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-var-speed-sizing-methodology-acca.xml +10 -40
  342. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-var-speed-sizing-methodology-hers.xml +10 -40
  343. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-air-to-air-heat-pump-var-speed-sizing-methodology-maxload.xml +10 -40
  344. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-boiler-elec-only.xml +10 -40
  345. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-boiler-gas-central-ac-1-speed.xml +10 -40
  346. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-boiler-gas-only.xml +10 -40
  347. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-central-ac-only-1-speed.xml +10 -40
  348. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-central-ac-only-2-speed.xml +10 -40
  349. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-central-ac-only-var-speed.xml +10 -40
  350. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-central-ac-plus-air-to-air-heat-pump-heating.xml +10 -40
  351. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-dual-fuel-air-to-air-heat-pump-1-speed-sizing-methodology-acca.xml +11 -41
  352. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-dual-fuel-air-to-air-heat-pump-1-speed-sizing-methodology-hers.xml +11 -41
  353. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-dual-fuel-air-to-air-heat-pump-1-speed-sizing-methodology-maxload.xml +11 -41
  354. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-dual-fuel-mini-split-heat-pump-ducted-backup-hardsized.xml +553 -0
  355. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-dual-fuel-mini-split-heat-pump-ducted.xml +11 -41
  356. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-elec-resistance-only.xml +10 -40
  357. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-evap-cooler-furnace-gas.xml +10 -40
  358. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-floor-furnace-propane-only.xml +10 -40
  359. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-furnace-elec-only.xml +10 -40
  360. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-furnace-gas-central-ac-2-speed.xml +10 -40
  361. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-furnace-gas-central-ac-var-speed.xml +10 -40
  362. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-furnace-gas-only.xml +10 -40
  363. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-furnace-gas-room-ac.xml +10 -40
  364. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ground-to-air-heat-pump-cooling-only.xml +10 -40
  365. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ground-to-air-heat-pump-heating-only.xml +10 -40
  366. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ground-to-air-heat-pump-sizing-methodology-acca.xml +10 -40
  367. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ground-to-air-heat-pump-sizing-methodology-hers.xml +10 -40
  368. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ground-to-air-heat-pump-sizing-methodology-maxload.xml +10 -40
  369. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-air-conditioner-only-ducted.xml +10 -40
  370. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ducted-cooling-only.xml +10 -40
  371. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ducted-heating-only.xml +10 -40
  372. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ducted-sizing-methodology-acca.xml +10 -40
  373. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ducted-sizing-methodology-hers.xml +10 -40
  374. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ducted-sizing-methodology-maxload.xml +10 -40
  375. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ductless-backup-baseboard.xml +519 -0
  376. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-mini-split-heat-pump-ductless-backup-stove.xml +10 -40
  377. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ptac-with-heating.xml +10 -40
  378. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-ptac.xml +10 -40
  379. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-pthp-sizing-methodology-acca.xml +16 -40
  380. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-pthp-sizing-methodology-hers.xml +16 -40
  381. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-pthp-sizing-methodology-maxload.xml +16 -40
  382. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-room-ac-only.xml +10 -40
  383. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-room-ac-with-heating.xml +10 -40
  384. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-room-ac-with-reverse-cycle-sizing-methodology-acca.xml +16 -40
  385. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-room-ac-with-reverse-cycle-sizing-methodology-hers.xml +16 -40
  386. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-room-ac-with-reverse-cycle-sizing-methodology-maxload.xml +16 -40
  387. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-sizing-controls.xml +566 -0
  388. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-stove-oil-only.xml +10 -40
  389. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize-wall-furnace-elec-only.xml +10 -40
  390. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-autosize.xml +10 -40
  391. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-coal-only.xml +10 -40
  392. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-elec-only.xml +10 -40
  393. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-gas-central-ac-1-speed.xml +10 -40
  394. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-gas-only-pilot.xml +513 -0
  395. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-gas-only.xml +10 -40
  396. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-oil-only.xml +10 -40
  397. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-propane-only.xml +10 -40
  398. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-boiler-wood-only.xml +10 -40
  399. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-1-speed-seer2.xml +10 -40
  400. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-1-speed.xml +10 -40
  401. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-2-speed.xml +10 -40
  402. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-only-var-speed.xml +10 -40
  403. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-central-ac-plus-air-to-air-heat-pump-heating.xml +16 -41
  404. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-crankcase-heater-40w.xml +556 -0
  405. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dse.xml +10 -40
  406. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed-lockout-temperatures.xml +560 -0
  407. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-1-speed.xml +17 -42
  408. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-2-speed.xml +17 -42
  409. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-air-to-air-heat-pump-var-speed.xml +17 -42
  410. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-dual-fuel-mini-split-heat-pump-ducted.xml +17 -42
  411. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-area-fractions.xml +10 -40
  412. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-area-multipliers.xml +10 -40
  413. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-buried.xml +555 -0
  414. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-effective-rvalue.xml +553 -0
  415. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-leakage-cfm50.xml +10 -40
  416. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ducts-leakage-percent.xml +10 -40
  417. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-elec-resistance-only.xml +10 -40
  418. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-furnace-gas.xml +10 -40
  419. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-only-ducted.xml +10 -40
  420. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-evap-cooler-only.xml +10 -40
  421. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-fireplace-wood-only.xml +10 -40
  422. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-fixed-heater-gas-only.xml +10 -40
  423. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-floor-furnace-propane-only-pilot-light.xml +506 -0
  424. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-floor-furnace-propane-only.xml +10 -40
  425. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-coal-only.xml +10 -40
  426. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-elec-central-ac-1-speed.xml +10 -40
  427. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-elec-only.xml +10 -40
  428. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-central-ac-2-speed.xml +10 -40
  429. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-central-ac-var-speed.xml +10 -40
  430. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-only-detailed-setpoints.xml +10 -40
  431. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-only-pilot.xml +542 -0
  432. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-only.xml +10 -40
  433. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-gas-room-ac.xml +10 -40
  434. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-oil-only.xml +10 -40
  435. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-propane-only.xml +10 -40
  436. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-wood-only.xml +10 -40
  437. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-furnace-x3-dse.xml +10 -40
  438. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ground-to-air-heat-pump-cooling-only.xml +10 -40
  439. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ground-to-air-heat-pump-heating-only.xml +10 -40
  440. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ground-to-air-heat-pump.xml +10 -40
  441. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-air-to-air-heat-pump-1-speed.xml +14 -41
  442. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-air-to-air-heat-pump-2-speed.xml +14 -41
  443. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-air-to-air-heat-pump-var-speed.xml +14 -41
  444. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-furnace-gas-central-ac-1-speed.xml +10 -40
  445. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-furnace-gas-central-ac-2-speed.xml +10 -40
  446. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-furnace-gas-central-ac-var-speed.xml +10 -40
  447. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-furnace-gas-only.xml +10 -40
  448. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-ground-to-air-heat-pump.xml +10 -40
  449. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-mini-split-air-conditioner-only-ducted.xml +10 -40
  450. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-install-quality-mini-split-heat-pump-ducted.xml +14 -41
  451. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-air-conditioner-only-ducted.xml +10 -40
  452. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-air-conditioner-only-ductless.xml +10 -40
  453. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted-cooling-only.xml +16 -41
  454. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted-heating-only.xml +16 -41
  455. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ducted.xml +16 -41
  456. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ductless-backup-baseboard.xml +525 -0
  457. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ductless-backup-furnace.xml +564 -0
  458. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ductless-backup-stove.xml +16 -41
  459. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ductless-heating-capacity-17f.xml +506 -0
  460. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-mini-split-heat-pump-ductless.xml +16 -41
  461. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-multiple.xml +10 -40
  462. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-none.xml +10 -40
  463. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-portable-heater-gas-only.xml +10 -40
  464. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ptac-with-heating-electricity.xml +10 -40
  465. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ptac-with-heating-natural-gas.xml +10 -40
  466. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-ptac.xml +10 -40
  467. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-pthp-heating-capacity-17f.xml +513 -0
  468. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-pthp.xml +16 -40
  469. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only-33percent.xml +10 -40
  470. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only-ceer.xml +10 -40
  471. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only-detailed-setpoints.xml +10 -40
  472. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-only.xml +10 -40
  473. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-with-heating.xml +10 -40
  474. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-room-ac-with-reverse-cycle.xml +16 -40
  475. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-seasons.xml +10 -40
  476. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-setpoints-daily-schedules.xml +10 -40
  477. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-setpoints-daily-setbacks.xml +10 -40
  478. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-setpoints.xml +10 -40
  479. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-stove-oil-only.xml +10 -40
  480. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-stove-wood-pellets-only.xml +10 -40
  481. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-undersized-allow-increased-fixed-capacities.xml +10 -40
  482. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-undersized.xml +10 -40
  483. data/example_files/resources/hpxml-measures/workflow/sample_files/base-hvac-wall-furnace-elec-only.xml +10 -40
  484. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-ceiling-fans.xml +11 -41
  485. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-holiday.xml +10 -40
  486. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-kwh-per-year.xml +529 -0
  487. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-mixed.xml +537 -0
  488. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-none-ceiling-fans.xml +516 -0
  489. data/example_files/resources/hpxml-measures/workflow/sample_files/base-lighting-none.xml +1 -7
  490. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-AMY-2012.xml +10 -40
  491. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-baltimore-md.xml +10 -40
  492. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-capetown-zaf.xml +10 -40
  493. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-dallas-tx.xml +10 -40
  494. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-duluth-mn.xml +10 -40
  495. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-helena-mt.xml +10 -40
  496. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-honolulu-hi.xml +10 -40
  497. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-miami-fl.xml +10 -40
  498. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-phoenix-az.xml +10 -40
  499. data/example_files/resources/hpxml-measures/workflow/sample_files/base-location-portland-or.xml +10 -40
  500. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-balanced.xml +10 -40
  501. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-bath-kitchen-fans.xml +12 -42
  502. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-airflow-fraction-zero.xml +10 -40
  503. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-dse.xml +10 -40
  504. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-evap-cooler-only-ducted.xml +10 -40
  505. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-supplemental-fan-exhaust.xml +10 -40
  506. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis-supplemental-fan-supply.xml +10 -40
  507. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-cfis.xml +10 -40
  508. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-erv-atre-asre.xml +10 -40
  509. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-erv.xml +10 -40
  510. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-exhaust-rated-flow-rate.xml +10 -40
  511. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-exhaust.xml +10 -40
  512. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-hrv-asre.xml +10 -40
  513. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-hrv.xml +10 -40
  514. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-multiple.xml +14 -44
  515. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-supply.xml +10 -40
  516. data/example_files/resources/hpxml-measures/workflow/sample_files/base-mechvent-whole-house-fan.xml +10 -40
  517. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-additional-properties.xml +10 -38
  518. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-bills-none.xml +10 -40
  519. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-bills-pv-detailed-only.xml +16 -42
  520. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-bills-pv-mixed.xml +16 -42
  521. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-bills-pv.xml +16 -42
  522. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-bills.xml +10 -40
  523. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-defaults.xml +14 -37
  524. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-emissions.xml +16 -42
  525. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-generators-battery-scheduled.xml +12 -42
  526. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-generators-battery.xml +12 -42
  527. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-generators.xml +12 -42
  528. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-ground-conductivity.xml +10 -40
  529. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-large-uncommon.xml +10 -38
  530. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-large-uncommon2.xml +10 -38
  531. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-loads-none.xml +10 -40
  532. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-neighbor-shading-bldgtype-multifamily.xml +509 -0
  533. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-neighbor-shading.xml +10 -40
  534. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-shielding-of-home.xml +10 -40
  535. data/example_files/resources/hpxml-measures/workflow/sample_files/base-misc-usage-multiplier.xml +10 -41
  536. data/example_files/resources/hpxml-measures/workflow/sample_files/base-multiple-buildings.xml +30 -138
  537. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-battery-ah.xml +16 -42
  538. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-battery-garage.xml +24 -26
  539. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-battery-round-trip-efficiency.xml +16 -42
  540. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-battery-scheduled.xml +16 -42
  541. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-battery.xml +16 -42
  542. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-generators-battery-scheduled.xml +18 -44
  543. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-generators-battery.xml +18 -44
  544. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv-generators.xml +18 -44
  545. data/example_files/resources/hpxml-measures/workflow/sample_files/base-pv.xml +16 -42
  546. data/example_files/resources/hpxml-measures/workflow/sample_files/base-residents-0-runperiod-1-month.xml +560 -0
  547. data/example_files/resources/hpxml-measures/workflow/sample_files/base-residents-0.xml +556 -0
  548. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-calctype-operational-misc-loads-large-uncommon.xml → base-residents-1-misc-loads-large-uncommon.xml} +616 -644
  549. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-calctype-operational-misc-loads-large-uncommon2.xml → base-residents-1-misc-loads-large-uncommon2.xml} +616 -644
  550. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-calctype-operational.xml → base-residents-1.xml} +547 -575
  551. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-calctype-operational-misc-defaults.xml → base-residents-5.xml} +515 -539
  552. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-all-10-mins.xml +10 -40
  553. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-occupancy-stochastic-10-mins.xml +10 -40
  554. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-occupancy-stochastic-power-outage.xml +565 -0
  555. data/example_files/resources/hpxml-measures/workflow/sample_files/{base-schedules-detailed-occupancy-smooth.xml → base-schedules-detailed-occupancy-stochastic-vacancy-year-round.xml} +563 -583
  556. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-occupancy-stochastic-vacancy.xml +21 -41
  557. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-occupancy-stochastic.xml +10 -40
  558. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-setpoints-daily-schedules.xml +10 -40
  559. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-setpoints-daily-setbacks.xml +10 -40
  560. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-detailed-setpoints.xml +10 -40
  561. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-simple-power-outage-natvent-available.xml +565 -0
  562. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-simple-power-outage-natvent-unavailable.xml +565 -0
  563. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-simple-power-outage.xml +620 -0
  564. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-simple-vacancy-year-round.xml +619 -0
  565. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-simple-vacancy.xml +619 -0
  566. data/example_files/resources/hpxml-measures/workflow/sample_files/base-schedules-simple.xml +10 -38
  567. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-calendar-year-custom.xml +10 -40
  568. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-daylight-saving-custom.xml +10 -40
  569. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-daylight-saving-disabled.xml +10 -40
  570. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-runperiod-1-month.xml +10 -40
  571. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-temperature-capacitance-multiplier.xml +10 -40
  572. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-timestep-10-mins-occupancy-stochastic-10-mins.xml +10 -40
  573. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-timestep-10-mins-occupancy-stochastic-60-mins.xml +10 -40
  574. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-timestep-10-mins.xml +10 -40
  575. data/example_files/resources/hpxml-measures/workflow/sample_files/base-simcontrol-timestep-30-mins.xml +10 -40
  576. data/example_files/resources/hpxml-measures/workflow/sample_files/base.xml +10 -37
  577. data/example_files/resources/hpxml-measures/workflow/template-build-and-run-hpxml-with-stochastic-occupancy.osw +16 -4
  578. data/example_files/resources/hpxml-measures/workflow/template-run-hpxml-with-stochastic-occupancy-subset.osw +16 -3
  579. data/example_files/resources/hpxml-measures/workflow/template-run-hpxml-with-stochastic-occupancy.osw +16 -3
  580. data/example_files/resources/hpxml-measures/workflow/template-run-hpxml.osw +16 -2
  581. data/example_files/resources/hpxml-measures/workflow/tests/ACCA_Examples/Long_Residence.xml +386 -0
  582. data/example_files/resources/hpxml-measures/workflow/tests/ACCA_Examples/Vatilo_Residence.xml +381 -0
  583. data/example_files/resources/hpxml-measures/workflow/tests/ACCA_Examples/Victor_Residence.xml +370 -0
  584. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L100AC.xml +2 -2
  585. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L100AL.xml +2 -5
  586. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L110AC.xml +2 -5
  587. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L110AL.xml +2 -5
  588. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L120AC.xml +2 -5
  589. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L120AL.xml +2 -5
  590. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L130AC.xml +2 -5
  591. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L130AL.xml +2 -5
  592. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L140AC.xml +2 -5
  593. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L140AL.xml +2 -5
  594. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L150AC.xml +2 -5
  595. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L150AL.xml +2 -5
  596. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L155AC.xml +2 -5
  597. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L155AL.xml +2 -5
  598. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L160AC.xml +2 -5
  599. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L160AL.xml +2 -5
  600. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L170AC.xml +2 -12
  601. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L170AL.xml +2 -12
  602. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L200AC.xml +2 -5
  603. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L200AL.xml +2 -5
  604. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L202AC.xml +2 -5
  605. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L202AL.xml +2 -5
  606. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L302XC.xml +2 -5
  607. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L304XC.xml +2 -5
  608. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L322XC.xml +6 -9
  609. data/example_files/resources/hpxml-measures/workflow/tests/ASHRAE_Standard_140/L324XC.xml +6 -9
  610. data/example_files/resources/hpxml-measures/workflow/tests/base_results/results.csv +475 -444
  611. data/example_files/resources/hpxml-measures/workflow/tests/base_results/results_bills.csv +475 -444
  612. data/example_files/resources/hpxml-measures/workflow/tests/hpxml_translator_test.rb +177 -112
  613. data/example_files/resources/meta_measure.rb +2 -27
  614. data/example_files/xml_building/17/README.md +3 -3
  615. data/lib/uo_cli/version.rb +3 -38
  616. data/lib/uo_cli.rb +3 -38
  617. data/uo_cli.gemspec +6 -7
  618. metadata +70 -51
  619. data/example_files/resources/hpxml-measures/BuildResidentialScheduleFile/resources/schedules_config.json +0 -388
  620. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_schema/HPXMLBaseElements.xsd +0 -6136
  621. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml_schema/HPXMLDataTypes.xsd +0 -4846
  622. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedule_files/occupancy-smooth.csv +0 -8761
  623. data/example_files/resources/hpxml-measures/HPXMLtoOpenStudio/resources/schedule_files/occupancy-stochastic-vacancy.csv +0 -8761
  624. data/example_files/resources/hpxml-measures/weather/USA_AZ_Phoenix-Sky.Harbor.Intl.AP.722780_TMY3-cache.csv +0 -35
  625. data/example_files/resources/hpxml-measures/weather/USA_CO_Colorado.Springs-Peterson.Field.724660_TMY3-cache.csv +0 -35
  626. data/example_files/resources/hpxml-measures/weather/USA_CO_Denver.Intl.AP.725650_TMY3-cache.csv +0 -35
  627. data/example_files/resources/hpxml-measures/weather/USA_DE_Wilmington-New.Castle.County.AP.724089_TMY3-cache.csv +0 -35
  628. data/example_files/resources/hpxml-measures/weather/USA_FL_Miami.Intl.AP.722020_TMY3-cache.csv +0 -35
  629. data/example_files/resources/hpxml-measures/weather/USA_HI_Honolulu.Intl.AP.911820_TMY3-cache.csv +0 -35
  630. data/example_files/resources/hpxml-measures/weather/USA_MD_Baltimore-Washington.Intl.AP.724060_TMY3-cache.csv +0 -35
  631. data/example_files/resources/hpxml-measures/weather/USA_MN_Duluth.Intl.AP.727450_TMY3-cache.csv +0 -35
  632. data/example_files/resources/hpxml-measures/weather/USA_MT_Helena.Rgnl.AP.727720_TMY3-cache.csv +0 -35
  633. data/example_files/resources/hpxml-measures/weather/USA_NC_Charlotte-Douglas.Intl.AP.723140_TMY3-cache.csv +0 -35
  634. data/example_files/resources/hpxml-measures/weather/USA_NJ_Cape.May.County.AP.745966_TMY3-cache.csv +0 -35
  635. data/example_files/resources/hpxml-measures/weather/USA_NV_Las.Vegas-McCarran.Intl.AP.723860_TMY3-cache.csv +0 -35
  636. data/example_files/resources/hpxml-measures/weather/USA_OR_Portland.Intl.AP.726980_TMY3-cache.csv +0 -35
  637. data/example_files/resources/hpxml-measures/weather/USA_TX_Dallas-Fort.Worth.Intl.AP.722590_TMY3-cache.csv +0 -35
  638. data/example_files/resources/hpxml-measures/weather/US_CO_Boulder_AMY_2012-cache.csv +0 -35
  639. data/example_files/resources/hpxml-measures/weather/ZAF_Cape.Town.688160_IWEC-cache.csv +0 -35
  640. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-surfaces.xml +0 -2508
  641. data/example_files/resources/hpxml-measures/workflow/sample_files/base-enclosure-split-surfaces2.xml +0 -2508
@@ -1,29 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class HVACSizing
4
- def self.calculate(weather, hpxml, cfa, nbeds, hvac_systems)
4
+ def self.calculate(weather, hpxml, cfa, hvac_systems)
5
5
  # Calculates heating/cooling design loads, and selects equipment
6
6
  # values (e.g., capacities, airflows) specific to each HVAC system.
7
7
  # Calculations generally follow ACCA Manual J/S.
8
8
 
9
9
  @hpxml = hpxml
10
10
  @cfa = cfa
11
- @nbeds = nbeds
12
-
13
- def self.is_system_to_skip(hvac)
14
- # These shared systems should be converted to other equivalent
15
- # systems before being autosized
16
- if [HPXML::HVACTypeChiller,
17
- HPXML::HVACTypeCoolingTower].include?(hvac.CoolType)
18
- return true
19
- end
20
- if [HPXML::HVACTypeHeatPumpWaterLoopToAir].include?(hvac.HeatType) &&
21
- hvac.HeatingLoadFraction.nil?
22
- return true
23
- end
24
-
25
- return false
26
- end
27
11
 
28
12
  process_site_calcs_and_design_temps(weather)
29
13
 
@@ -31,8 +15,8 @@ class HVACSizing
31
15
  bldg_design_loads = DesignLoads.new
32
16
  process_load_windows_skylights(bldg_design_loads, weather)
33
17
  process_load_doors(bldg_design_loads)
34
- process_load_walls(bldg_design_loads, weather)
35
- process_load_roofs(bldg_design_loads, weather)
18
+ process_load_walls(bldg_design_loads)
19
+ process_load_roofs(bldg_design_loads)
36
20
  process_load_ceilings(bldg_design_loads)
37
21
  process_load_floors(bldg_design_loads)
38
22
  process_load_slabs(bldg_design_loads)
@@ -46,23 +30,26 @@ class HVACSizing
46
30
  all_hvac_sizing_values = {}
47
31
  system_design_loads = bldg_design_loads.dup
48
32
  hvac_systems.each do |hvac_system|
49
- hvac = get_hvac_information(hvac_system)
50
- next if is_system_to_skip(hvac)
33
+ hvac_heating, hvac_cooling = hvac_system[:heating], hvac_system[:cooling]
34
+ set_hvac_types(hvac_heating, hvac_cooling)
35
+ next if is_system_to_skip(hvac_heating)
51
36
 
52
37
  # Apply duct loads as needed
53
- apply_hvac_temperatures(hvac, system_design_loads)
54
- ducts_heat_load = calculate_load_ducts_heating(system_design_loads, hvac)
55
- ducts_cool_load_sens, ducts_cool_load_lat = calculate_load_ducts_cooling(system_design_loads, weather, hvac)
38
+ set_fractions_load_served(hvac_heating, hvac_cooling)
39
+ apply_hvac_temperatures(system_design_loads, hvac_heating, hvac_cooling)
40
+ ducts_heat_load = calculate_load_ducts_heating(system_design_loads, hvac_heating)
41
+ ducts_cool_load_sens, ducts_cool_load_lat = calculate_load_ducts_cooling(system_design_loads, weather, hvac_cooling)
56
42
  apply_load_ducts(bldg_design_loads, ducts_heat_load, ducts_cool_load_sens, ducts_cool_load_lat) # Update duct loads in reported building design loads
57
43
 
58
44
  hvac_sizing_values = HVACSizingValues.new
59
- apply_hvac_loads(hvac, hvac_sizing_values, system_design_loads, ducts_heat_load, ducts_cool_load_sens, ducts_cool_load_lat)
60
- apply_hvac_heat_pump_logic(hvac_sizing_values, hvac)
61
- apply_hvac_equipment_adjustments(hvac_sizing_values, weather, hvac)
62
- apply_hvac_installation_quality(hvac_sizing_values, weather, hvac)
63
- apply_hvac_fixed_capacities(hvac_sizing_values, hvac)
64
- apply_hvac_ground_loop(hvac_sizing_values, weather, hvac)
65
- apply_hvac_finalize_airflows(hvac_sizing_values, hvac)
45
+ apply_hvac_loads(hvac_heating, hvac_sizing_values, system_design_loads, ducts_heat_load, ducts_cool_load_sens, ducts_cool_load_lat)
46
+ apply_hvac_size_limits(hvac_cooling)
47
+ apply_hvac_heat_pump_logic(hvac_sizing_values, hvac_cooling)
48
+ apply_hvac_equipment_adjustments(hvac_sizing_values, weather, hvac_heating, hvac_cooling, hvac_system)
49
+ apply_hvac_installation_quality(hvac_sizing_values, hvac_heating, hvac_cooling)
50
+ apply_hvac_fixed_capacities(hvac_sizing_values, hvac_heating, hvac_cooling)
51
+ apply_hvac_ground_loop(hvac_sizing_values, weather, hvac_cooling)
52
+ apply_hvac_finalize_airflows(hvac_sizing_values, hvac_heating, hvac_cooling)
66
53
 
67
54
  all_hvac_sizing_values[hvac_system] = hvac_sizing_values
68
55
  end
@@ -72,6 +59,21 @@ class HVACSizing
72
59
 
73
60
  private
74
61
 
62
+ def self.is_system_to_skip(hvac_heating)
63
+ # These shared systems should be converted to other equivalent
64
+ # systems before being autosized
65
+ if [HPXML::HVACTypeChiller,
66
+ HPXML::HVACTypeCoolingTower].include?(@cooling_type)
67
+ return true
68
+ end
69
+ if (@heating_type == HPXML::HVACTypeHeatPumpWaterLoopToAir) &&
70
+ hvac_heating.fraction_heat_load_served.nil?
71
+ return true
72
+ end
73
+
74
+ return false
75
+ end
76
+
75
77
  def self.process_site_calcs_and_design_temps(weather)
76
78
  '''
77
79
  Site Calculations and Design Temperatures
@@ -81,14 +83,14 @@ class HVACSizing
81
83
  @daily_range_temp_adjust = [4, 0, -5]
82
84
 
83
85
  # Manual J inside conditions
84
- @cool_setpoint = 75.0
85
- @heat_setpoint = 70.0
86
+ @cool_setpoint = @hpxml.header.manualj_cooling_setpoint
87
+ @heat_setpoint = @hpxml.header.manualj_heating_setpoint
86
88
 
87
89
  @cool_design_grains = UnitConversions.convert(weather.design.CoolingHumidityRatio, 'lbm/lbm', 'grains')
88
90
 
89
91
  # Calculate the design temperature differences
90
- @ctd = [weather.design.CoolingDrybulb - @cool_setpoint, 0.0].max
91
- @htd = [@heat_setpoint - weather.design.HeatingDrybulb, 0.0].max
92
+ @ctd = [@hpxml.header.manualj_cooling_design_temp - @cool_setpoint, 0.0].max
93
+ @htd = [@heat_setpoint - @hpxml.header.manualj_heating_design_temp, 0.0].max
92
94
 
93
95
  # Calculate the average Daily Temperature Range (DTR) to determine the class (low, medium, high)
94
96
  dtr = weather.design.DailyTemperatureRange
@@ -109,11 +111,12 @@ class HVACSizing
109
111
  @acf = MathTools.interp2(weather.header.Altitude, alt_cnt * 1000.0, (alt_cnt + 1.0) * 1000.0, acfs[alt_cnt], acfs[alt_cnt + 1])
110
112
 
111
113
  # Calculate the interior humidity in Grains and enthalpy in Btu/lb for cooling
112
- pwsat = UnitConversions.convert(0.430075, 'psi', 'kPa') # Calculated for 75degF indoor temperature
113
- rh_indoor_cooling = 0.55 # Manual J is vague on the indoor RH. 55% corresponds to BA goals
114
+ cool_setpoint_c = UnitConversions.convert(@cool_setpoint, 'F', 'C')
115
+ pwsat = 6.11 * 10**(7.5 * cool_setpoint_c / (237.3 + cool_setpoint_c)) / 10.0 # kPa, using https://www.weather.gov/media/epz/wxcalc/vaporPressure.pdf
116
+ rh_indoor_cooling = 0.5 # Manual J is vague on the indoor RH but uses 50% in its examples
114
117
  hr_indoor_cooling = (0.62198 * rh_indoor_cooling * pwsat) / (UnitConversions.convert(weather.header.LocalPressure, 'atm', 'kPa') - rh_indoor_cooling * pwsat)
115
118
  @cool_indoor_grains = UnitConversions.convert(hr_indoor_cooling, 'lbm/lbm', 'grains')
116
- @wetbulb_indoor_cooling = Psychrometrics.Twb_fT_R_P(@cool_setpoint, rh_indoor_cooling, UnitConversions.convert(weather.header.LocalPressure, 'atm', 'psi'))
119
+ @wetbulb_indoor_cooling = Psychrometrics.Twb_fT_R_P(nil, @cool_setpoint, rh_indoor_cooling, UnitConversions.convert(weather.header.LocalPressure, 'atm', 'psi'))
117
120
 
118
121
  db_indoor_degC = UnitConversions.convert(@cool_setpoint, 'F', 'C')
119
122
  @enthalpy_indoor_cooling = (1.006 * db_indoor_degC + hr_indoor_cooling * (2501.0 + 1.86 * db_indoor_degC)) * UnitConversions.convert(1.0, 'kJ', 'Btu') * UnitConversions.convert(1.0, 'lbm', 'kg')
@@ -144,11 +147,11 @@ class HVACSizing
144
147
 
145
148
  if [HPXML::LocationOtherHousingUnit, HPXML::LocationOtherHeatedSpace, HPXML::LocationOtherMultifamilyBufferSpace,
146
149
  HPXML::LocationOtherNonFreezingSpace, HPXML::LocationExteriorWall, HPXML::LocationUnderSlab].include? location
147
- @cool_design_temps[location] = calculate_scheduled_space_design_temps(location, @cool_setpoint, weather.design.CoolingDrybulb, weather.data.GroundMonthlyTemps.max)
148
- @heat_design_temps[location] = calculate_scheduled_space_design_temps(location, @heat_setpoint, weather.design.HeatingDrybulb, weather.data.GroundMonthlyTemps.min)
150
+ @cool_design_temps[location] = calculate_scheduled_space_design_temps(location, @cool_setpoint, @hpxml.header.manualj_cooling_design_temp, weather.data.GroundMonthlyTemps.max)
151
+ @heat_design_temps[location] = calculate_scheduled_space_design_temps(location, @heat_setpoint, @hpxml.header.manualj_heating_design_temp, weather.data.GroundMonthlyTemps.min)
149
152
  elsif [HPXML::LocationOutside, HPXML::LocationRoofDeck].include? location
150
- @cool_design_temps[location] = weather.design.CoolingDrybulb
151
- @heat_design_temps[location] = weather.design.HeatingDrybulb
153
+ @cool_design_temps[location] = @hpxml.header.manualj_cooling_design_temp
154
+ @heat_design_temps[location] = @hpxml.header.manualj_heating_design_temp
152
155
  elsif HPXML::conditioned_locations.include? location
153
156
  @cool_design_temps[location] = process_design_temp_cooling(weather, HPXML::LocationLivingSpace)
154
157
  @heat_design_temps[location] = process_design_temp_heating(weather, HPXML::LocationLivingSpace)
@@ -164,7 +167,7 @@ class HVACSizing
164
167
  heat_temp = @heat_setpoint
165
168
 
166
169
  elsif location == HPXML::LocationGarage
167
- heat_temp = weather.design.HeatingDrybulb + 13.0
170
+ heat_temp = @hpxml.header.manualj_heating_design_temp + 13.0
168
171
 
169
172
  elsif (location == HPXML::LocationAtticUnvented) || (location == HPXML::LocationAtticVented)
170
173
 
@@ -178,16 +181,16 @@ class HVACSizing
178
181
  # Attic is considered to be encapsulated. MJ8 says to use an attic
179
182
  # temperature of 95F, however alternative approaches are permissible
180
183
  if location == HPXML::LocationAtticVented
181
- heat_temp = weather.design.HeatingDrybulb
184
+ heat_temp = @hpxml.header.manualj_heating_design_temp
182
185
  else
183
- heat_temp = calculate_space_design_temps(location, weather, @heat_setpoint, weather.design.HeatingDrybulb, weather.data.GroundMonthlyTemps.min)
186
+ heat_temp = calculate_space_design_temps(location, weather, @heat_setpoint, @hpxml.header.manualj_heating_design_temp, weather.data.GroundMonthlyTemps.min)
184
187
  end
185
188
  else
186
- heat_temp = weather.design.HeatingDrybulb
189
+ heat_temp = @hpxml.header.manualj_heating_design_temp
187
190
  end
188
191
 
189
192
  elsif [HPXML::LocationBasementUnconditioned, HPXML::LocationCrawlspaceUnvented, HPXML::LocationCrawlspaceVented].include? location
190
- heat_temp = calculate_space_design_temps(location, weather, @heat_setpoint, weather.design.HeatingDrybulb, weather.data.GroundMonthlyTemps.min)
193
+ heat_temp = calculate_space_design_temps(location, weather, @heat_setpoint, @hpxml.header.manualj_heating_design_temp, weather.data.GroundMonthlyTemps.min)
191
194
 
192
195
  end
193
196
 
@@ -224,15 +227,15 @@ class HVACSizing
224
227
  # Calculate the garage cooling design temperature based on Table 4C
225
228
  # Linearly interpolate between having living space over the garage and not having living space above the garage
226
229
  if @daily_range_num == 0.0
227
- cool_temp = (weather.design.CoolingDrybulb +
230
+ cool_temp = (@hpxml.header.manualj_cooling_design_temp +
228
231
  (11.0 * garage_frac_under_conditioned) +
229
232
  (22.0 * (1.0 - garage_frac_under_conditioned)))
230
233
  elsif @daily_range_num == 1.0
231
- cool_temp = (weather.design.CoolingDrybulb +
234
+ cool_temp = (@hpxml.header.manualj_cooling_design_temp +
232
235
  (6.0 * garage_frac_under_conditioned) +
233
236
  (17.0 * (1.0 - garage_frac_under_conditioned)))
234
237
  elsif @daily_range_num == 2.0
235
- cool_temp = (weather.design.CoolingDrybulb +
238
+ cool_temp = (@hpxml.header.manualj_cooling_design_temp +
236
239
  (1.0 * garage_frac_under_conditioned) +
237
240
  (12.0 * (1.0 - garage_frac_under_conditioned)))
238
241
  end
@@ -249,9 +252,9 @@ class HVACSizing
249
252
  # Attic is considered to be encapsulated. MJ8 says to use an attic
250
253
  # temperature of 95F, however alternative approaches are permissible
251
254
  if location == HPXML::LocationAtticVented
252
- cool_temp = weather.design.CoolingDrybulb + 40.0 # This is the number from a California study with dark shingle roof and similar ventilation.
255
+ cool_temp = @hpxml.header.manualj_cooling_design_temp + 40.0 # This is the number from a California study with dark shingle roof and similar ventilation.
253
256
  else
254
- cool_temp = calculate_space_design_temps(location, weather, @cool_setpoint, weather.design.CoolingDrybulb, weather.data.GroundMonthlyTemps.max, true)
257
+ cool_temp = calculate_space_design_temps(location, weather, @cool_setpoint, @hpxml.header.manualj_cooling_design_temp, weather.data.GroundMonthlyTemps.max, true)
255
258
  end
256
259
 
257
260
  else
@@ -267,9 +270,9 @@ class HVACSizing
267
270
 
268
271
  if location == HPXML::LocationAtticUnvented
269
272
  if not roof.radiant_barrier
270
- cool_temp += (150.0 + (weather.design.CoolingDrybulb - 95.0) + @daily_range_temp_adjust[@daily_range_num]) * roof.net_area
273
+ cool_temp += (150.0 + (@hpxml.header.manualj_cooling_design_temp - 95.0) + @daily_range_temp_adjust[@daily_range_num]) * roof.net_area
271
274
  else
272
- cool_temp += (130.0 + (weather.design.CoolingDrybulb - 95.0) + @daily_range_temp_adjust[@daily_range_num]) * roof.net_area
275
+ cool_temp += (130.0 + (@hpxml.header.manualj_cooling_design_temp - 95.0) + @daily_range_temp_adjust[@daily_range_num]) * roof.net_area
273
276
  end
274
277
  else
275
278
  if not roof.radiant_barrier
@@ -331,11 +334,11 @@ class HVACSizing
331
334
  cool_temp /= tot_roof_area
332
335
 
333
336
  # Adjust base CLTD for cooling design temperature and daily range
334
- cool_temp += (weather.design.CoolingDrybulb - 95.0) + @daily_range_temp_adjust[@daily_range_num]
337
+ cool_temp += (@hpxml.header.manualj_cooling_design_temp - 95.0) + @daily_range_temp_adjust[@daily_range_num]
335
338
  end
336
339
 
337
340
  elsif [HPXML::LocationBasementUnconditioned, HPXML::LocationCrawlspaceUnvented, HPXML::LocationCrawlspaceVented].include? location
338
- cool_temp = calculate_space_design_temps(location, weather, @cool_setpoint, weather.design.CoolingDrybulb, weather.data.GroundMonthlyTemps.max)
341
+ cool_temp = calculate_space_design_temps(location, weather, @cool_setpoint, @hpxml.header.manualj_cooling_design_temp, weather.data.GroundMonthlyTemps.max)
339
342
 
340
343
  end
341
344
 
@@ -476,7 +479,7 @@ class HVACSizing
476
479
  # Windows
477
480
  bldg_design_loads.Heat_Windows = 0.0
478
481
  alp_load = 0.0 # Average Load Procedure (ALP) Load
479
- afl_hr = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # Initialize Hourly Aggregate Fenestration Load (AFL)
482
+ afl_hr = [0.0] * 12 # Initialize Hourly Aggregate Fenestration Load (AFL)
480
483
 
481
484
  @hpxml.windows.each do |window|
482
485
  next unless window.wall.is_exterior_thermal_boundary
@@ -489,7 +492,7 @@ class HVACSizing
489
492
 
490
493
  bldg_design_loads.Heat_Windows += window_ufactor * window.area * @htd
491
494
 
492
- for hr in -1..12
495
+ for hr in -1..11
493
496
 
494
497
  # If hr == -1: Calculate the Average Load Procedure (ALP) Load
495
498
  # Else: Calculate the hourly Aggregate Fenestration Load (AFL)
@@ -610,7 +613,7 @@ class HVACSizing
610
613
  # Skylights
611
614
  bldg_design_loads.Heat_Skylights = 0.0
612
615
  alp_load = 0.0 # Average Load Procedure (ALP) Load
613
- afl_hr = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # Initialize Hourly Aggregate Fenestration Load (AFL)
616
+ afl_hr = [0.0] * 12 # Initialize Hourly Aggregate Fenestration Load (AFL)
614
617
 
615
618
  @hpxml.skylights.each do |skylight|
616
619
  skylight_summer_sf = skylight.interior_shading_factor_summer * skylight.exterior_shading_factor_summer
@@ -622,7 +625,7 @@ class HVACSizing
622
625
 
623
626
  bldg_design_loads.Heat_Skylights += skylight_ufactor * skylight.area * @htd
624
627
 
625
- for hr in -1..12
628
+ for hr in -1..11
626
629
 
627
630
  # If hr == -1: Calculate the Average Load Procedure (ALP) Load
628
631
  # Else: Calculate the hourly Aggregate Fenestration Load (AFL)
@@ -716,7 +719,7 @@ class HVACSizing
716
719
  end
717
720
  end
718
721
 
719
- def self.process_load_walls(bldg_design_loads, weather)
722
+ def self.process_load_walls(bldg_design_loads)
720
723
  '''
721
724
  Heating and Cooling Loads: Walls
722
725
  '''
@@ -771,7 +774,7 @@ class HVACSizing
771
774
 
772
775
  if @ctd >= 10.0
773
776
  # Adjust the CLTD for different cooling design temperatures
774
- cltd += (weather.design.CoolingDrybulb - 95.0)
777
+ cltd += (@hpxml.header.manualj_cooling_design_temp - 95.0)
775
778
  # Adjust the CLTD for daily temperature range
776
779
  cltd += @daily_range_temp_adjust[@daily_range_num]
777
780
  else
@@ -799,7 +802,7 @@ class HVACSizing
799
802
  end
800
803
  end
801
804
 
802
- def self.process_load_roofs(bldg_design_loads, weather)
805
+ def self.process_load_roofs(bldg_design_loads)
803
806
  '''
804
807
  Heating and Cooling Loads: Roofs
805
808
  '''
@@ -846,7 +849,7 @@ class HVACSizing
846
849
  end
847
850
 
848
851
  # Adjust base CLTD for different CTD or DR
849
- cltd += (weather.design.CoolingDrybulb - 95.0) + @daily_range_temp_adjust[@daily_range_num]
852
+ cltd += (@hpxml.header.manualj_cooling_design_temp - 95.0) + @daily_range_temp_adjust[@daily_range_num]
850
853
 
851
854
  bldg_design_loads.Cool_Roofs += (1.0 / roof.insulation_assembly_r_value) * roof.net_area * cltd
852
855
  bldg_design_loads.Heat_Roofs += (1.0 / roof.insulation_assembly_r_value) * roof.net_area * @htd
@@ -953,9 +956,16 @@ class HVACSizing
953
956
  bldg_design_loads.Heat_Slabs += f_value * slab.exposed_perimeter * @htd
954
957
  elsif HPXML::conditioned_below_grade_locations.include? slab.interior_adjacent_to
955
958
  # Based on MJ 8th Ed. A12-7 and ASHRAE HoF 2013 pg 18.31 Eq 40
956
- # FIXME: Assumes slab is uninsulated?
957
- k_soil = @hpxml.site.ground_conductivity
958
- r_other = Material.Concrete(4.0).rvalue + Material.AirFilmFloorAverage.rvalue
959
+ slab_is_insulated = false
960
+ if slab.under_slab_insulation_width > 0 && slab.under_slab_insulation_r_value > 0
961
+ slab_is_insulated = true
962
+ elsif slab.perimeter_insulation_depth > 0 && slab.perimeter_insulation_r_value > 0
963
+ slab_is_insulated = true
964
+ elsif slab.under_slab_insulation_spans_entire_slab && slab.under_slab_insulation_r_value > 0
965
+ slab_is_insulated = true
966
+ end
967
+ k_soil = 0.8 # Value from ASHRAE HoF, probably used by Manual J
968
+ r_other = 1.47 # Value from ASHRAE HoF, probably used by Manual J
959
969
  foundation_walls = @hpxml.foundation_walls.select { |fw| fw.is_thermal_boundary }
960
970
  z_f = foundation_walls.map { |fw| fw.depth_below_grade }.sum(0.0) / foundation_walls.size # Average below-grade depth
961
971
  sqrt_term = [slab.exposed_perimeter**2 - 16.0 * slab.area, 0.0].max
@@ -964,8 +974,11 @@ class HVACSizing
964
974
  w_b = [length, width].min
965
975
  w_b = [w_b, 1.0].max # handle zero exposed perimeter
966
976
  u_avg_bf = (2.0 * k_soil / (Math::PI * w_b)) * (Math::log(w_b / 2.0 + z_f / 2.0 + (k_soil * r_other) / Math::PI) - Math::log(z_f / 2.0 + (k_soil * r_other) / Math::PI))
967
- u_value_mj8 = 0.85 * u_avg_bf
968
- bldg_design_loads.Heat_Slabs += u_value_mj8 * slab.area * @htd
977
+ u_value = 0.85 * u_avg_bf # To account for the storage effect of soil, multiply by 0.85
978
+ if slab_is_insulated
979
+ u_value *= 0.7 # U-values are multiplied y 0.70 to produce U-values for insulated floors
980
+ end
981
+ bldg_design_loads.Heat_Slabs += u_value * slab.area * @htd
969
982
  end
970
983
  end
971
984
  end
@@ -975,23 +988,8 @@ class HVACSizing
975
988
  Heating and Cooling Loads: Infiltration & Ventilation
976
989
  '''
977
990
 
978
- # FUTURE: Consolidate code w/ airflow.rb
979
- infil_volume = @hpxml.air_infiltration_measurements.select { |i| !i.infiltration_volume.nil? }[0].infiltration_volume
980
- infil_height = @hpxml.air_infiltration_measurements.select { |i| !i.infiltration_height.nil? }[0].infiltration_height
981
- sla = nil
982
- @hpxml.air_infiltration_measurements.each do |measurement|
983
- if [HPXML::UnitsACH, HPXML::UnitsCFM].include?(measurement.unit_of_measure) && !measurement.house_pressure.nil?
984
- if measurement.unit_of_measure == HPXML::UnitsACH
985
- ach50 = Airflow.calc_air_leakage_at_diff_pressure(0.65, measurement.air_leakage, measurement.house_pressure, 50.0)
986
- elsif measurement.unit_of_measure == HPXML::UnitsCFM
987
- achXX = measurement.air_leakage * 60.0 / infil_volume # Convert CFM to ACH
988
- ach50 = Airflow.calc_air_leakage_at_diff_pressure(0.65, achXX, measurement.house_pressure, 50.0)
989
- end
990
- sla = Airflow.get_infiltration_SLA_from_ACH50(ach50, 0.65, @cfa, infil_volume)
991
- elsif measurement.unit_of_measure == HPXML::UnitsACHNatural
992
- sla = Airflow.get_infiltration_SLA_from_ACH(measurement.air_leakage, infil_height, weather)
993
- end
994
- end
991
+ sla, _ach50, _nach, _volume, _height, a_ext = Airflow.get_values_from_air_infiltration_measurements(@hpxml, @cfa, weather)
992
+ sla *= a_ext
995
993
  ela = sla * @cfa
996
994
 
997
995
  ncfl_ag = @hpxml.building_construction.number_of_conditioned_floors_above_grade
@@ -1012,13 +1010,13 @@ class HVACSizing
1012
1010
 
1013
1011
  cfm_Heating = q_bal_Sens + (icfm_Heating**2.0 + q_unb_cfm**2.0)**0.5 - q_preheat - q_recirc
1014
1012
 
1015
- cfm_Cool_Load_Sens = q_bal_Sens + (icfm_Cooling**2.0 + q_unb_cfm**2.0)**0.5 - q_precool - q_recirc
1016
- cfm_Cool_Load_Lat = q_bal_Lat + (icfm_Cooling**2.0 + q_unb_cfm**2.0)**0.5 - q_recirc
1013
+ cfm_cool_load_sens = q_bal_Sens + (icfm_Cooling**2.0 + q_unb_cfm**2.0)**0.5 - q_precool - q_recirc
1014
+ cfm_cool_load_lat = q_bal_Lat + (icfm_Cooling**2.0 + q_unb_cfm**2.0)**0.5 - q_recirc
1017
1015
 
1018
1016
  bldg_design_loads.Heat_InfilVent = 1.1 * @acf * cfm_Heating * @htd
1019
1017
 
1020
- bldg_design_loads.Cool_Infil_Sens = 1.1 * @acf * cfm_Cool_Load_Sens * @ctd
1021
- bldg_design_loads.Cool_Infil_Lat = 0.68 * @acf * cfm_Cool_Load_Lat * (@cool_design_grains - @cool_indoor_grains)
1018
+ bldg_design_loads.Cool_InfilVent_Sens = 1.1 * @acf * cfm_cool_load_sens * @ctd
1019
+ bldg_design_loads.Cool_InfilVent_Lat = 0.68 * @acf * cfm_cool_load_lat * (@cool_design_grains - @cool_indoor_grains)
1022
1020
  end
1023
1021
 
1024
1022
  def self.process_load_internal_gains(bldg_design_loads)
@@ -1026,10 +1024,8 @@ class HVACSizing
1026
1024
  Cooling Load: Internal Gains
1027
1025
  '''
1028
1026
 
1029
- # Per ANSI/RESNET/ICC 301
1030
- n_occupants = @nbeds + 1
1031
- bldg_design_loads.Cool_IntGains_Sens = 1600.0 + 230.0 * n_occupants
1032
- bldg_design_loads.Cool_IntGains_Lat = 200.0 * n_occupants
1027
+ bldg_design_loads.Cool_IntGains_Sens = @hpxml.header.manualj_internal_loads_sensible + 230.0 * @hpxml.header.manualj_num_occupants
1028
+ bldg_design_loads.Cool_IntGains_Lat = @hpxml.header.manualj_internal_loads_latent + 200.0 * @hpxml.header.manualj_num_occupants
1033
1029
  end
1034
1030
 
1035
1031
  def self.aggregate_loads(bldg_design_loads)
@@ -1048,12 +1044,12 @@ class HVACSizing
1048
1044
  bldg_design_loads.Cool_Sens = bldg_design_loads.Cool_Windows + bldg_design_loads.Cool_Skylights +
1049
1045
  bldg_design_loads.Cool_Doors + bldg_design_loads.Cool_Walls +
1050
1046
  bldg_design_loads.Cool_Floors + bldg_design_loads.Cool_Ceilings +
1051
- bldg_design_loads.Cool_Roofs + bldg_design_loads.Cool_Infil_Sens +
1047
+ bldg_design_loads.Cool_Roofs + bldg_design_loads.Cool_InfilVent_Sens +
1052
1048
  bldg_design_loads.Cool_IntGains_Sens
1053
- bldg_design_loads.Cool_Lat = bldg_design_loads.Cool_Infil_Lat + bldg_design_loads.Cool_IntGains_Lat
1049
+ bldg_design_loads.Cool_Lat = bldg_design_loads.Cool_InfilVent_Lat + bldg_design_loads.Cool_IntGains_Lat
1054
1050
  if bldg_design_loads.Cool_Lat < 0 # No latent loads; also zero out individual components
1055
1051
  bldg_design_loads.Cool_Lat = 0.0
1056
- bldg_design_loads.Cool_Infil_Lat = 0.0
1052
+ bldg_design_loads.Cool_InfilVent_Lat = 0.0
1057
1053
  bldg_design_loads.Cool_IntGains_Lat = 0.0
1058
1054
  end
1059
1055
  bldg_design_loads.Cool_Tot = bldg_design_loads.Cool_Sens + bldg_design_loads.Cool_Lat
@@ -1064,60 +1060,55 @@ class HVACSizing
1064
1060
  bldg_design_loads.Cool_Ducts_Lat = 0.0
1065
1061
  end
1066
1062
 
1067
- def self.apply_hvac_temperatures(hvac, system_design_loads)
1063
+ def self.apply_hvac_temperatures(system_design_loads, hvac_heating, hvac_cooling)
1068
1064
  '''
1069
1065
  HVAC Temperatures
1070
1066
  '''
1071
1067
  # Evaporative cooler temperature calculation based on Manual S Figure 4-7
1072
- if hvac.CoolType == HPXML::HVACTypeEvaporativeCooler
1068
+ if @cooling_type == HPXML::HVACTypeEvaporativeCooler
1073
1069
  td_potential = @cool_design_temps[HPXML::LocationOutside] - @wetbulb_outdoor_cooling
1074
- td = td_potential * hvac.EvapCoolerEffectiveness
1075
- hvac.LeavingAirTemp = @cool_design_temps[HPXML::LocationOutside] - td
1070
+ td = td_potential * hvac_cooling.additional_properties.effectiveness
1071
+ @leaving_air_temp = @cool_design_temps[HPXML::LocationOutside] - td
1076
1072
  else
1077
1073
  # Calculate Leaving Air Temperature
1078
1074
  shr = [system_design_loads.Cool_Sens / system_design_loads.Cool_Tot, 1.0].min
1079
1075
  # Determine the Leaving Air Temperature (LAT) based on Manual S Table 1-4
1080
1076
  if shr < 0.80
1081
- hvac.LeavingAirTemp = 54.0 # F
1077
+ @leaving_air_temp = 54.0 # F
1082
1078
  elsif shr < 0.85
1083
1079
  # MJ8 says to use 56 degF in this SHR range. Linear interpolation provides a more
1084
1080
  # continuous supply air flow rate across building efficiency levels.
1085
- hvac.LeavingAirTemp = ((58.0 - 54.0) / (0.85 - 0.80)) * (shr - 0.8) + 54.0 # F
1081
+ @leaving_air_temp = ((58.0 - 54.0) / (0.85 - 0.80)) * (shr - 0.8) + 54.0 # F
1086
1082
  else
1087
- hvac.LeavingAirTemp = 58.0 # F
1083
+ @leaving_air_temp = 58.0 # F
1088
1084
  end
1089
1085
  end
1090
1086
 
1091
1087
  # Calculate Supply Air Temperature
1092
- if [HPXML::HVACTypeHeatPumpAirToAir,
1093
- HPXML::HVACTypeHeatPumpMiniSplit,
1094
- HPXML::HVACTypeHeatPumpGroundToAir,
1095
- HPXML::HVACTypeHeatPumpWaterLoopToAir,
1096
- HPXML::HVACTypeHeatPumpPTHP,
1097
- HPXML::HVACTypeHeatPumpRoom].include? hvac.HeatType
1098
- hvac.SupplyAirTemp = 105.0 # F
1099
- hvac.BackupSupplyAirTemp = 120.0 # F
1088
+ if hvac_heating.is_a? HPXML::HeatPump
1089
+ @supply_air_temp = 105.0 # F
1090
+ @backup_supply_air_temp = 120.0 # F
1100
1091
  else
1101
- hvac.SupplyAirTemp = 120.0 # F
1092
+ @supply_air_temp = 120.0 # F
1102
1093
  end
1103
1094
  end
1104
1095
 
1105
- def self.apply_hvac_loads(hvac, system_design_loads, bldg_design_loads, ducts_heat_load, ducts_cool_load_sens, ducts_cool_load_lat)
1096
+ def self.apply_hvac_loads(hvac_heating, system_design_loads, bldg_design_loads, ducts_heat_load, ducts_cool_load_sens, ducts_cool_load_lat)
1106
1097
  # Calculate design loads that this HVAC system serves
1107
1098
 
1108
1099
  # Heating
1109
- system_design_loads.Heat_Load = bldg_design_loads.Heat_Tot * hvac.HeatingLoadFraction
1110
- if hvac.HeatType == HPXML::HVACTypeHeatPumpWaterLoopToAir
1100
+ system_design_loads.Heat_Load = bldg_design_loads.Heat_Tot * @fraction_heat_load_served
1101
+ if @heating_type == HPXML::HVACTypeHeatPumpWaterLoopToAir
1111
1102
  # Size to meet original fraction load served (not adjusted value from HVAC.apply_shared_heating_systems()
1112
1103
  # This ensures, e.g., that an appropriate heating airflow is used for duct losses.
1113
- system_design_loads.Heat_Load = system_design_loads.Heat_Load / (1.0 / hvac.HeatingCOP)
1104
+ system_design_loads.Heat_Load = system_design_loads.Heat_Load / (1.0 / hvac_heating.heating_efficiency_cop)
1114
1105
  end
1115
1106
  system_design_loads.Heat_Load_Supp = system_design_loads.Heat_Load
1116
1107
 
1117
1108
  # Cooling
1118
- system_design_loads.Cool_Load_Tot = bldg_design_loads.Cool_Tot * hvac.CoolingLoadFraction
1119
- system_design_loads.Cool_Load_Sens = bldg_design_loads.Cool_Sens * hvac.CoolingLoadFraction
1120
- system_design_loads.Cool_Load_Lat = bldg_design_loads.Cool_Lat * hvac.CoolingLoadFraction
1109
+ system_design_loads.Cool_Load_Tot = bldg_design_loads.Cool_Tot * @fraction_cool_load_served
1110
+ system_design_loads.Cool_Load_Sens = bldg_design_loads.Cool_Sens * @fraction_cool_load_served
1111
+ system_design_loads.Cool_Load_Lat = bldg_design_loads.Cool_Lat * @fraction_cool_load_served
1121
1112
 
1122
1113
  # After applying load fraction to building design loads (w/o ducts), add duct load specific to this HVAC system
1123
1114
  system_design_loads.Heat_Load += ducts_heat_load.to_f
@@ -1127,54 +1118,65 @@ class HVACSizing
1127
1118
  system_design_loads.Cool_Load_Tot += ducts_cool_load_sens.to_f + ducts_cool_load_lat.to_f
1128
1119
  end
1129
1120
 
1130
- def self.apply_hvac_heat_pump_logic(hvac_sizing_values, hvac)
1131
- # If HERS/MaxLoad methodology, uses at least the larger of heating and cooling loads for heat pump sizing (required for ERI).
1132
- if [HPXML::HVACTypeHeatPumpAirToAir,
1133
- HPXML::HVACTypeHeatPumpMiniSplit,
1134
- HPXML::HVACTypeHeatPumpGroundToAir,
1135
- HPXML::HVACTypeHeatPumpWaterLoopToAir,
1136
- HPXML::HVACTypeHeatPumpPTHP,
1137
- HPXML::HVACTypeHeatPumpRoom].include? hvac.CoolType
1138
- if (@hpxml.header.heat_pump_sizing_methodology != HPXML::HeatPumpSizingACCA) && (hvac.CoolingLoadFraction > 0) && (hvac.HeatingLoadFraction > 0)
1139
- # Note: Heat_Load_Supp should NOT be adjusted; we only want to adjust the HP capacity, not the HP backup heating capacity.
1140
- max_load = [hvac_sizing_values.Heat_Load, hvac_sizing_values.Cool_Load_Tot].max
1141
- hvac_sizing_values.Heat_Load = max_load
1142
- hvac_sizing_values.Cool_Load_Sens *= max_load / hvac_sizing_values.Cool_Load_Tot
1143
- hvac_sizing_values.Cool_Load_Lat *= max_load / hvac_sizing_values.Cool_Load_Tot
1144
- hvac_sizing_values.Cool_Load_Tot = max_load
1121
+ def self.apply_hvac_size_limits(hvac_cooling)
1122
+ @oversize_limit = 1.15
1123
+ @oversize_delta = 15000.0
1124
+ @undersize_limit = 0.9
1145
1125
 
1146
- # Override Manual S oversize allowances:
1147
- hvac.OverSizeLimit = 1.0
1148
- hvac.OverSizeDelta = 0.0
1126
+ if not hvac_cooling.nil?
1127
+ if hvac_cooling.compressor_type == HPXML::HVACCompressorTypeTwoStage
1128
+ @oversize_limit = 1.2
1129
+ elsif hvac_cooling.compressor_type == HPXML::HVACCompressorTypeVariableSpeed
1130
+ @oversize_limit = 1.3
1149
1131
  end
1150
1132
  end
1151
1133
  end
1152
1134
 
1135
+ def self.apply_hvac_heat_pump_logic(hvac_sizing_values, hvac_cooling)
1136
+ # If HERS/MaxLoad methodology, uses at least the larger of heating and cooling loads for heat pump sizing (required for ERI).
1137
+ return unless hvac_cooling.is_a? HPXML::HeatPump
1138
+ return if @fraction_cool_load_served == 0
1139
+ return if @fraction_heat_load_served == 0
1140
+
1141
+ if (@hpxml.header.heat_pump_sizing_methodology != HPXML::HeatPumpSizingACCA)
1142
+ # Note: Heat_Load_Supp should NOT be adjusted; we only want to adjust the HP capacity, not the HP backup heating capacity.
1143
+ max_load = [hvac_sizing_values.Heat_Load, hvac_sizing_values.Cool_Load_Tot].max
1144
+ hvac_sizing_values.Heat_Load = max_load
1145
+ hvac_sizing_values.Cool_Load_Sens *= max_load / hvac_sizing_values.Cool_Load_Tot
1146
+ hvac_sizing_values.Cool_Load_Lat *= max_load / hvac_sizing_values.Cool_Load_Tot
1147
+ hvac_sizing_values.Cool_Load_Tot = max_load
1148
+
1149
+ # Override Manual S oversize allowances:
1150
+ @oversize_limit = 1.0
1151
+ @oversize_delta = 0.0
1152
+ end
1153
+ end
1154
+
1153
1155
  def self.get_duct_regain_factor(duct)
1154
1156
  # dse_Fregain values comes from MJ8 pg 204 and Walker (1998) "Technical background for default
1155
1157
  # values used for forced air systems in proposed ASHRAE Std. 152"
1156
1158
 
1157
1159
  dse_Fregain = nil
1158
1160
 
1159
- if [HPXML::LocationOutside, HPXML::LocationRoofDeck].include? duct.Location
1161
+ if [HPXML::LocationOutside, HPXML::LocationRoofDeck].include? duct.duct_location
1160
1162
  dse_Fregain = 0.0
1161
1163
 
1162
1164
  elsif [HPXML::LocationOtherHousingUnit, HPXML::LocationOtherHeatedSpace, HPXML::LocationOtherMultifamilyBufferSpace,
1163
- HPXML::LocationOtherNonFreezingSpace, HPXML::LocationExteriorWall, HPXML::LocationUnderSlab].include? duct.Location
1164
- space_values = Geometry.get_temperature_scheduled_space_values(duct.Location)
1165
+ HPXML::LocationOtherNonFreezingSpace, HPXML::LocationExteriorWall, HPXML::LocationUnderSlab].include? duct.duct_location
1166
+ space_values = Geometry.get_temperature_scheduled_space_values(duct.duct_location)
1165
1167
  dse_Fregain = space_values[:f_regain]
1166
1168
 
1167
- elsif [HPXML::LocationBasementUnconditioned, HPXML::LocationCrawlspaceVented, HPXML::LocationCrawlspaceUnvented].include? duct.Location
1169
+ elsif [HPXML::LocationBasementUnconditioned, HPXML::LocationCrawlspaceVented, HPXML::LocationCrawlspaceUnvented].include? duct.duct_location
1168
1170
 
1169
- ceilings = @hpxml.floors.select { |f| f.is_floor && [f.interior_adjacent_to, f.exterior_adjacent_to].include?(duct.Location) }
1171
+ ceilings = @hpxml.floors.select { |f| f.is_floor && [f.interior_adjacent_to, f.exterior_adjacent_to].include?(duct.duct_location) }
1170
1172
  avg_ceiling_rvalue = calculate_average_r_value(ceilings)
1171
1173
  ceiling_insulated = (avg_ceiling_rvalue > 4)
1172
1174
 
1173
- walls = @hpxml.foundation_walls.select { |f| [f.interior_adjacent_to, f.exterior_adjacent_to].include? duct.Location }
1175
+ walls = @hpxml.foundation_walls.select { |f| [f.interior_adjacent_to, f.exterior_adjacent_to].include? duct.duct_location }
1174
1176
  avg_wall_rvalue = calculate_average_r_value(walls)
1175
1177
  walls_insulated = (avg_wall_rvalue > 4)
1176
1178
 
1177
- if duct.Location == HPXML::LocationBasementUnconditioned
1179
+ if duct.duct_location == HPXML::LocationBasementUnconditioned
1178
1180
  if not ceiling_insulated
1179
1181
  if not walls_insulated
1180
1182
  dse_Fregain = 0.50 # Uninsulated ceiling, uninsulated walls
@@ -1184,7 +1186,7 @@ class HVACSizing
1184
1186
  else
1185
1187
  dse_Fregain = 0.30 # Insulated ceiling
1186
1188
  end
1187
- elsif duct.Location == HPXML::LocationCrawlspaceVented
1189
+ elsif duct.duct_location == HPXML::LocationCrawlspaceVented
1188
1190
  if ceiling_insulated && walls_insulated
1189
1191
  dse_Fregain = 0.17 # Insulated ceiling, insulated walls
1190
1192
  elsif ceiling_insulated && (not walls_insulated)
@@ -1194,7 +1196,7 @@ class HVACSizing
1194
1196
  elsif (not ceiling_insulated) && (not walls_insulated)
1195
1197
  dse_Fregain = 0.50 # Uninsulated ceiling, uninsulated walls
1196
1198
  end
1197
- elsif duct.Location == HPXML::LocationCrawlspaceUnvented
1199
+ elsif duct.duct_location == HPXML::LocationCrawlspaceUnvented
1198
1200
  if ceiling_insulated && walls_insulated
1199
1201
  dse_Fregain = 0.30 # Insulated ceiling, insulated walls
1200
1202
  elsif ceiling_insulated && (not walls_insulated)
@@ -1206,13 +1208,13 @@ class HVACSizing
1206
1208
  end
1207
1209
  end
1208
1210
 
1209
- elsif [HPXML::LocationAtticVented, HPXML::LocationAtticUnvented].include? duct.Location
1211
+ elsif [HPXML::LocationAtticVented, HPXML::LocationAtticUnvented].include? duct.duct_location
1210
1212
  dse_Fregain = 0.10 # This would likely be higher for unvented attics with roof insulation
1211
1213
 
1212
- elsif [HPXML::LocationGarage].include? duct.Location
1214
+ elsif [HPXML::LocationGarage].include? duct.duct_location
1213
1215
  dse_Fregain = 0.05
1214
1216
 
1215
- elsif HPXML::conditioned_locations.include? duct.Location
1217
+ elsif HPXML::conditioned_locations.include? duct.duct_location
1216
1218
  dse_Fregain = 1.0
1217
1219
 
1218
1220
  end
@@ -1220,31 +1222,20 @@ class HVACSizing
1220
1222
  return dse_Fregain
1221
1223
  end
1222
1224
 
1223
- def self.calculate_load_ducts_heating(system_design_loads, hvac)
1225
+ def self.calculate_load_ducts_heating(system_design_loads, hvac_heating)
1224
1226
  '''
1225
1227
  Heating Duct Loads
1226
1228
  '''
1227
1229
 
1228
- return if (system_design_loads.Heat_Tot == 0) || (hvac.HeatingLoadFraction == 0) || hvac.Ducts.empty?
1230
+ return if hvac_heating.nil? || (system_design_loads.Heat_Tot == 0) || hvac_heating.distribution_system.nil? || hvac_heating.distribution_system.ducts.empty?
1231
+ return if @fraction_heat_load_served == 0
1229
1232
 
1230
- init_heat_load = system_design_loads.Heat_Tot * hvac.HeatingLoadFraction
1233
+ init_heat_load = system_design_loads.Heat_Tot * @fraction_heat_load_served
1231
1234
 
1232
1235
  # Distribution system efficiency (DSE) calculations based on ASHRAE Standard 152
1233
- dse_As, dse_Ar = calc_ducts_areas(hvac.Ducts)
1234
- supply_r, return_r = calc_ducts_rvalues(hvac.Ducts)
1235
-
1236
- design_temp_values = { HPXML::DuctTypeSupply => @heat_design_temps, HPXML::DuctTypeReturn => @heat_design_temps }
1237
- dse_Tamb_heating_s, dse_Tamb_heating_r = calc_ducts_area_weighted_average(hvac.Ducts, design_temp_values)
1238
1236
 
1239
- # ASHRAE 152 6.5.2
1240
- # For systems with ducts in several locations, F_regain shall be weighted by the fraction of exposed duct area
1241
- # in each space. F_regain shall be calculated separately for supply and return locations.
1242
- dse_Fregains = {}
1243
- hvac.Ducts.each do |duct|
1244
- dse_Fregains[duct.Location] = get_duct_regain_factor(duct)
1245
- end
1246
- fregain_values = { HPXML::DuctTypeSupply => dse_Fregains, HPXML::DuctTypeReturn => dse_Fregains }
1247
- dse_Fregain_s, dse_Fregain_r = calc_ducts_area_weighted_average(hvac.Ducts, fregain_values)
1237
+ duct_values = calc_duct_conduction_values(hvac_heating.distribution_system, @heat_design_temps)
1238
+ dse_As, dse_Ar, supply_r, return_r, dse_Tamb_s, dse_Tamb_r, dse_Fregain_s, dse_Fregain_r = duct_values
1248
1239
 
1249
1240
  # Initialize for the iteration
1250
1241
  delta = 1
@@ -1256,11 +1247,11 @@ class HVACSizing
1256
1247
  heat_load_prev = heat_load_next
1257
1248
 
1258
1249
  # Calculate the new heating air flow rate
1259
- heat_cfm = calc_airflow_rate_manual_s(heat_load_next, (hvac.SupplyAirTemp - @heat_setpoint))
1250
+ heat_cfm = calc_airflow_rate_manual_s(heat_load_next, (@supply_air_temp - @heat_setpoint))
1260
1251
 
1261
- dse_Qs, dse_Qr = calc_ducts_leakages(hvac.Ducts, heat_cfm)
1252
+ dse_Qs, dse_Qr = calc_duct_leakages_cfm25(hvac_heating.distribution_system, heat_cfm)
1262
1253
 
1263
- dse_DE = calc_delivery_effectiveness_heating(dse_Qs, dse_Qr, heat_cfm, heat_load_next, dse_Tamb_heating_s, dse_Tamb_heating_r, dse_As, dse_Ar, @heat_setpoint, dse_Fregain_s, dse_Fregain_r, supply_r, return_r)
1254
+ dse_DE = calc_delivery_effectiveness_heating(dse_Qs, dse_Qr, heat_cfm, heat_load_next, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, @heat_setpoint, dse_Fregain_s, dse_Fregain_r, supply_r, return_r)
1264
1255
 
1265
1256
  # Calculate the increase in heating load due to ducts (Approach: DE = Qload/Qequip -> Qducts = Qequip-Qload)
1266
1257
  heat_load_next = init_heat_load / dse_DE
@@ -1273,41 +1264,31 @@ class HVACSizing
1273
1264
  return ducts_heat_load
1274
1265
  end
1275
1266
 
1276
- def self.calculate_load_ducts_cooling(system_design_loads, weather, hvac)
1267
+ def self.calculate_load_ducts_cooling(system_design_loads, weather, hvac_cooling)
1277
1268
  '''
1278
1269
  Cooling Duct Loads
1279
1270
  '''
1280
- return if (system_design_loads.Cool_Sens == 0) || (hvac.CoolingLoadFraction == 0) || hvac.Ducts.empty?
1281
1271
 
1282
- init_cool_load_sens = system_design_loads.Cool_Sens * hvac.CoolingLoadFraction
1283
- init_cool_load_lat = system_design_loads.Cool_Lat * hvac.CoolingLoadFraction
1272
+ return if hvac_cooling.nil? || (system_design_loads.Cool_Sens == 0) || hvac_cooling.distribution_system.nil? || hvac_cooling.distribution_system.ducts.empty?
1273
+ return if @fraction_cool_load_served == 0
1274
+
1275
+ init_cool_load_sens = system_design_loads.Cool_Sens * @fraction_cool_load_served
1276
+ init_cool_load_lat = system_design_loads.Cool_Lat * @fraction_cool_load_served
1284
1277
 
1285
1278
  # Distribution system efficiency (DSE) calculations based on ASHRAE Standard 152
1286
- dse_As, dse_Ar = calc_ducts_areas(hvac.Ducts)
1287
- supply_r, return_r = calc_ducts_rvalues(hvac.Ducts)
1288
1279
 
1289
- design_temp_values = { HPXML::DuctTypeSupply => @cool_design_temps, HPXML::DuctTypeReturn => @cool_design_temps }
1290
- dse_Tamb_cooling_s, dse_Tamb_cooling_r = calc_ducts_area_weighted_average(hvac.Ducts, design_temp_values)
1291
-
1292
- # ASHRAE 152 6.5.2
1293
- # For systems with ducts in several locations, F_regain shall be weighted by the fraction of exposed duct area
1294
- # in each space. F_regain shall be calculated separately for supply and return locations.
1295
- dse_Fregains = {}
1296
- hvac.Ducts.each do |duct|
1297
- dse_Fregains[duct.Location] = get_duct_regain_factor(duct)
1298
- end
1299
- fregain_values = { HPXML::DuctTypeSupply => dse_Fregains, HPXML::DuctTypeReturn => dse_Fregains }
1300
- dse_Fregain_s, dse_Fregain_r = calc_ducts_area_weighted_average(hvac.Ducts, fregain_values)
1280
+ duct_values = calc_duct_conduction_values(hvac_cooling.distribution_system, @cool_design_temps)
1281
+ dse_As, dse_Ar, supply_r, return_r, dse_Tamb_s, dse_Tamb_r, dse_Fregain_s, dse_Fregain_r = duct_values
1301
1282
 
1302
1283
  # Calculate the air enthalpy in the return duct location for DSE calculations
1303
- dse_h_r = (1.006 * UnitConversions.convert(dse_Tamb_cooling_r, 'F', 'C') + weather.design.CoolingHumidityRatio * (2501.0 + 1.86 * UnitConversions.convert(dse_Tamb_cooling_r, 'F', 'C'))) * UnitConversions.convert(1.0, 'kJ', 'Btu') * UnitConversions.convert(1.0, 'lbm', 'kg')
1284
+ dse_h_r = (1.006 * UnitConversions.convert(dse_Tamb_r, 'F', 'C') + weather.design.CoolingHumidityRatio * (2501.0 + 1.86 * UnitConversions.convert(dse_Tamb_r, 'F', 'C'))) * UnitConversions.convert(1.0, 'kJ', 'Btu') * UnitConversions.convert(1.0, 'lbm', 'kg')
1304
1285
 
1305
1286
  # Initialize for the iteration
1306
1287
  delta = 1
1307
1288
  cool_load_tot_next = init_cool_load_sens + init_cool_load_lat
1308
1289
 
1309
- cool_cfm = calc_airflow_rate_manual_s(init_cool_load_sens, (@cool_setpoint - hvac.LeavingAirTemp))
1310
- _dse_Qs, dse_Qr = calc_ducts_leakages(hvac.Ducts, cool_cfm)
1290
+ cool_cfm = calc_airflow_rate_manual_s(init_cool_load_sens, (@cool_setpoint - @leaving_air_temp))
1291
+ _dse_Qs, dse_Qr = calc_duct_leakages_cfm25(hvac_cooling.distribution_system, cool_cfm)
1311
1292
 
1312
1293
  for _iter in 1..50
1313
1294
  break if delta.abs <= 0.001
@@ -1318,11 +1299,11 @@ class HVACSizing
1318
1299
  cool_load_tot = cool_load_lat + cool_load_sens
1319
1300
 
1320
1301
  # Calculate the new cooling air flow rate
1321
- cool_cfm = calc_airflow_rate_manual_s(cool_load_sens, (@cool_setpoint - hvac.LeavingAirTemp))
1302
+ cool_cfm = calc_airflow_rate_manual_s(cool_load_sens, (@cool_setpoint - @leaving_air_temp))
1322
1303
 
1323
- dse_Qs, dse_Qr = calc_ducts_leakages(hvac.Ducts, cool_cfm)
1304
+ dse_Qs, dse_Qr = calc_duct_leakages_cfm25(hvac_cooling.distribution_system, cool_cfm)
1324
1305
 
1325
- dse_DE, _dse_dTe_cooling, _cool_duct_sens = calc_delivery_effectiveness_cooling(dse_Qs, dse_Qr, hvac.LeavingAirTemp, cool_cfm, cool_load_sens, dse_Tamb_cooling_s, dse_Tamb_cooling_r, dse_As, dse_Ar, @cool_setpoint, dse_Fregain_s, dse_Fregain_r, cool_load_tot, dse_h_r, supply_r, return_r)
1306
+ dse_DE, _dse_dTe_cooling, _cool_duct_sens = calc_delivery_effectiveness_cooling(dse_Qs, dse_Qr, @leaving_air_temp, cool_cfm, cool_load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, @cool_setpoint, dse_Fregain_s, dse_Fregain_r, cool_load_tot, dse_h_r, supply_r, return_r)
1326
1307
 
1327
1308
  cool_load_tot_next = (init_cool_load_sens + init_cool_load_lat) / dse_DE
1328
1309
 
@@ -1345,17 +1326,19 @@ class HVACSizing
1345
1326
  bldg_design_loads.Cool_Tot += total_ducts_cool_load_sens.to_f + total_ducts_cool_load_lat.to_f
1346
1327
  end
1347
1328
 
1348
- def self.apply_hvac_equipment_adjustments(hvac_sizing_values, weather, hvac)
1329
+ def self.apply_hvac_equipment_adjustments(hvac_sizing_values, weather, hvac_heating, hvac_cooling, hvac_system)
1349
1330
  '''
1350
1331
  Equipment Adjustments
1351
1332
  '''
1352
1333
 
1353
- underSizeLimit = 0.9
1354
-
1355
1334
  # Cooling
1356
1335
 
1336
+ if not hvac_cooling.nil?
1337
+ hvac_cooling_ap = hvac_cooling.additional_properties
1338
+ end
1339
+
1357
1340
  # Calculate the air flow rate required for design conditions
1358
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Cool_Load_Sens, (@cool_setpoint - hvac.LeavingAirTemp))
1341
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Cool_Load_Sens, (@cool_setpoint - @leaving_air_temp))
1359
1342
 
1360
1343
  if hvac_sizing_values.Cool_Load_Tot <= 0
1361
1344
 
@@ -1364,19 +1347,21 @@ class HVACSizing
1364
1347
  hvac_sizing_values.Cool_Airflow = 0.0
1365
1348
 
1366
1349
  elsif [HPXML::HVACTypeCentralAirConditioner,
1367
- HPXML::HVACTypeHeatPumpAirToAir].include? hvac.CoolType
1350
+ HPXML::HVACTypeHeatPumpAirToAir].include? @cooling_type
1368
1351
 
1369
- enteringTemp = weather.design.CoolingDrybulb
1370
- coefficients = hvac.COOL_CAP_FT_SPEC[hvac.SizingSpeed]
1352
+ entering_temp = @hpxml.header.manualj_cooling_design_temp
1353
+ hvac_cooling_speed = get_sizing_speed(hvac_cooling_ap)
1354
+ coefficients = hvac_cooling_ap.cool_cap_ft_spec[hvac_cooling_speed]
1371
1355
 
1372
- totalCap_CurveValue = MathTools.biquadratic(@wetbulb_indoor_cooling, enteringTemp, coefficients)
1373
- coolCap_Rated = hvac_sizing_values.Cool_Load_Tot / totalCap_CurveValue
1356
+ total_cap_curve_value = MathTools.biquadratic(@wetbulb_indoor_cooling, entering_temp, coefficients)
1357
+ cool_cap_rated = hvac_sizing_values.Cool_Load_Tot / total_cap_curve_value
1374
1358
 
1375
- sensCap_Rated = coolCap_Rated * hvac.SHRRated[hvac.SizingSpeed]
1359
+ hvac_cooling_shr = hvac_cooling_ap.cool_rated_shrs_gross[hvac_cooling_speed]
1360
+ sens_cap_rated = cool_cap_rated * hvac_cooling_shr
1376
1361
 
1377
- sensibleCap_CurveValue = process_curve_fit(hvac_sizing_values.Cool_Airflow, hvac_sizing_values.Cool_Load_Tot, enteringTemp)
1378
- sensCap_Design = sensCap_Rated * sensibleCap_CurveValue
1379
- latCap_Design = [hvac_sizing_values.Cool_Load_Tot - sensCap_Design, 1.0].max
1362
+ sensible_cap_curve_value = process_curve_fit(hvac_sizing_values.Cool_Airflow, hvac_sizing_values.Cool_Load_Tot, entering_temp)
1363
+ sens_cap_design = sens_cap_rated * sensible_cap_curve_value
1364
+ lat_cap_design = [hvac_sizing_values.Cool_Load_Tot - sens_cap_design, 1.0].max
1380
1365
 
1381
1366
  shr_biquadratic = get_shr_biquadratic
1382
1367
  a_sens = shr_biquadratic[0]
@@ -1385,75 +1370,75 @@ class HVACSizing
1385
1370
  d_sens = shr_biquadratic[5]
1386
1371
 
1387
1372
  # Adjust Sizing
1388
- if latCap_Design < hvac_sizing_values.Cool_Load_Lat
1373
+ if lat_cap_design < hvac_sizing_values.Cool_Load_Lat
1389
1374
  # Size by MJ8 Latent load, return to rated conditions
1390
1375
 
1391
1376
  # Solve for the new sensible and total capacity at design conditions:
1392
- # CoolingLoad_Lat = cool_Capacity_Design - cool_Load_SensCap_Design
1393
- # solve the following for cool_Capacity_Design: SensCap_Design = SHRRated * cool_Capacity_Design / TotalCap_CurveValue * function(CFM/cool_Capacity_Design, ODB)
1394
- # substituting in CFM = cool_Load_SensCap_Design / (1.1 * ACF * (cool_setpoint - LAT))
1377
+ # CoolingLoad_Lat = cool_cap_design - cool_load_sens_cap_design
1378
+ # solve the following for cool_cap_design: sens_cap_design = SHRRated * cool_cap_design / total_cap_curve_value * function(CFM/cool_cap_design, ODB)
1379
+ # substituting in CFM = cool_load_sens_cap_design / (1.1 * ACF * (cool_setpoint - LAT))
1395
1380
 
1396
- cool_Load_SensCap_Design = hvac_sizing_values.Cool_Load_Lat / ((totalCap_CurveValue / hvac.SHRRated[hvac.SizingSpeed] - \
1397
- (UnitConversions.convert(b_sens, 'ton', 'Btu/hr') + UnitConversions.convert(d_sens, 'ton', 'Btu/hr') * enteringTemp) / \
1398
- (1.1 * @acf * (@cool_setpoint - hvac.LeavingAirTemp))) / \
1399
- (a_sens + c_sens * enteringTemp) - 1.0)
1381
+ cool_load_sens_cap_design = hvac_sizing_values.Cool_Load_Lat / ((total_cap_curve_value / hvac_cooling_shr - \
1382
+ (UnitConversions.convert(b_sens, 'ton', 'Btu/hr') + UnitConversions.convert(d_sens, 'ton', 'Btu/hr') * entering_temp) / \
1383
+ (1.1 * @acf * (@cool_setpoint - @leaving_air_temp))) / \
1384
+ (a_sens + c_sens * entering_temp) - 1.0)
1400
1385
 
1401
- cool_Capacity_Design = cool_Load_SensCap_Design + hvac_sizing_values.Cool_Load_Lat
1386
+ cool_cap_design = cool_load_sens_cap_design + hvac_sizing_values.Cool_Load_Lat
1402
1387
 
1403
1388
  # The SHR of the equipment at the design condition
1404
- sHR_design = cool_Load_SensCap_Design / cool_Capacity_Design
1389
+ shr_design = cool_load_sens_cap_design / cool_cap_design
1405
1390
 
1406
1391
  # If the adjusted equipment size is negative (occurs at altitude), use oversize limit (the adjustment
1407
1392
  # almost always hits the oversize limit in this case, making this a safe assumption)
1408
- if (cool_Capacity_Design < 0) || (cool_Load_SensCap_Design < 0)
1409
- cool_Capacity_Design = hvac.OverSizeLimit * hvac_sizing_values.Cool_Load_Tot
1393
+ if (cool_cap_design < 0) || (cool_load_sens_cap_design < 0)
1394
+ cool_cap_design = @oversize_limit * hvac_sizing_values.Cool_Load_Tot
1410
1395
  end
1411
1396
 
1412
1397
  # Limit total capacity to oversize limit
1413
- cool_Capacity_Design = [cool_Capacity_Design, hvac.OverSizeLimit * hvac_sizing_values.Cool_Load_Tot].min
1398
+ cool_cap_design = [cool_cap_design, @oversize_limit * hvac_sizing_values.Cool_Load_Tot].min
1414
1399
 
1415
1400
  # Determine the final sensible capacity at design using the SHR
1416
- cool_Load_SensCap_Design = sHR_design * cool_Capacity_Design
1401
+ cool_load_sens_cap_design = shr_design * cool_cap_design
1417
1402
 
1418
1403
  # Calculate the final air flow rate using final sensible capacity at design
1419
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_Load_SensCap_Design, (@cool_setpoint - hvac.LeavingAirTemp))
1404
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_load_sens_cap_design, (@cool_setpoint - @leaving_air_temp))
1420
1405
 
1421
1406
  # Determine rated capacities
1422
- hvac_sizing_values.Cool_Capacity = cool_Capacity_Design / totalCap_CurveValue
1423
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1407
+ hvac_sizing_values.Cool_Capacity = cool_cap_design / total_cap_curve_value
1408
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1424
1409
 
1425
- elsif sensCap_Design < underSizeLimit * hvac_sizing_values.Cool_Load_Sens
1410
+ elsif sens_cap_design < @undersize_limit * hvac_sizing_values.Cool_Load_Sens
1426
1411
  # Size by MJ8 Sensible load, return to rated conditions, find Sens with SHRRated. Limit total
1427
1412
  # capacity to oversizing limit
1428
1413
 
1429
- sensCap_Design = underSizeLimit * hvac_sizing_values.Cool_Load_Sens
1414
+ sens_cap_design = @undersize_limit * hvac_sizing_values.Cool_Load_Sens
1430
1415
 
1431
1416
  # Solve for the new total system capacity at design conditions:
1432
- # SensCap_Design = SensCap_Rated * SensibleCap_CurveValue
1433
- # = SHRRated * cool_Capacity_Design / TotalCap_CurveValue * SensibleCap_CurveValue
1434
- # = SHRRated * cool_Capacity_Design / TotalCap_CurveValue * function(CFM/cool_Capacity_Design, ODB)
1417
+ # sens_cap_design = sens_cap_rated * sensible_cap_curve_value
1418
+ # = SHRRated * cool_cap_design / total_cap_curve_value * sensible_cap_curve_value
1419
+ # = SHRRated * cool_cap_design / total_cap_curve_value * function(CFM/cool_cap_design, ODB)
1435
1420
 
1436
- cool_Capacity_Design = (sensCap_Design / (hvac.SHRRated[hvac.SizingSpeed] / totalCap_CurveValue) - \
1421
+ cool_cap_design = (sens_cap_design / (hvac_cooling_shr / total_cap_curve_value) - \
1437
1422
  (b_sens * UnitConversions.convert(hvac_sizing_values.Cool_Airflow, 'ton', 'Btu/hr') + \
1438
- d_sens * UnitConversions.convert(hvac_sizing_values.Cool_Airflow, 'ton', 'Btu/hr') * enteringTemp)) / \
1439
- (a_sens + c_sens * enteringTemp)
1423
+ d_sens * UnitConversions.convert(hvac_sizing_values.Cool_Airflow, 'ton', 'Btu/hr') * entering_temp)) / \
1424
+ (a_sens + c_sens * entering_temp)
1440
1425
 
1441
1426
  # Limit total capacity to oversize limit
1442
- cool_Capacity_Design = [cool_Capacity_Design, hvac.OverSizeLimit * hvac_sizing_values.Cool_Load_Tot].min
1427
+ cool_cap_design = [cool_cap_design, @oversize_limit * hvac_sizing_values.Cool_Load_Tot].min
1443
1428
 
1444
- hvac_sizing_values.Cool_Capacity = cool_Capacity_Design / totalCap_CurveValue
1445
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1429
+ hvac_sizing_values.Cool_Capacity = cool_cap_design / total_cap_curve_value
1430
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1446
1431
 
1447
1432
  # Recalculate the air flow rate in case the oversizing limit has been used
1448
- cool_Load_SensCap_Design = hvac_sizing_values.Cool_Capacity_Sens * sensibleCap_CurveValue
1449
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_Load_SensCap_Design, (@cool_setpoint - hvac.LeavingAirTemp))
1433
+ cool_load_sens_cap_design = hvac_sizing_values.Cool_Capacity_Sens * sensible_cap_curve_value
1434
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_load_sens_cap_design, (@cool_setpoint - @leaving_air_temp))
1450
1435
 
1451
1436
  else
1452
- hvac_sizing_values.Cool_Capacity = hvac_sizing_values.Cool_Load_Tot / totalCap_CurveValue
1453
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1437
+ hvac_sizing_values.Cool_Capacity = hvac_sizing_values.Cool_Load_Tot / total_cap_curve_value
1438
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1454
1439
 
1455
- cool_Load_SensCap_Design = hvac_sizing_values.Cool_Capacity_Sens * sensibleCap_CurveValue
1456
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_Load_SensCap_Design, (@cool_setpoint - hvac.LeavingAirTemp))
1440
+ cool_load_sens_cap_design = hvac_sizing_values.Cool_Capacity_Sens * sensible_cap_curve_value
1441
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_load_sens_cap_design, (@cool_setpoint - @leaving_air_temp))
1457
1442
  end
1458
1443
 
1459
1444
  # Ensure the air flow rate is in between 200 and 500 cfm/ton.
@@ -1465,85 +1450,93 @@ class HVACSizing
1465
1450
  end
1466
1451
 
1467
1452
  elsif [HPXML::HVACTypeHeatPumpMiniSplit,
1468
- HPXML::HVACTypeMiniSplitAirConditioner].include? hvac.CoolType
1453
+ HPXML::HVACTypeMiniSplitAirConditioner].include? @cooling_type
1469
1454
 
1470
- enteringTemp = weather.design.CoolingDrybulb
1471
- coefficients = hvac.COOL_CAP_FT_SPEC[hvac.SizingSpeed]
1455
+ entering_temp = @hpxml.header.manualj_cooling_design_temp
1456
+ hvac_cooling_speed = get_sizing_speed(hvac_cooling_ap)
1457
+ coefficients = hvac_cooling_ap.cool_cap_ft_spec[hvac_cooling_speed]
1472
1458
 
1473
- totalCap_CurveValue = MathTools.biquadratic(@wetbulb_indoor_cooling, enteringTemp, coefficients)
1459
+ total_cap_curve_value = MathTools.biquadratic(@wetbulb_indoor_cooling, entering_temp, coefficients)
1460
+ hvac_cooling_shr = hvac_cooling_ap.cool_rated_shrs_gross[hvac_cooling_speed]
1474
1461
 
1475
- hvac_sizing_values.Cool_Capacity = (hvac_sizing_values.Cool_Load_Tot / totalCap_CurveValue)
1476
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1477
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_user(hvac_sizing_values.Cool_Capacity, hvac.RatedCFMperTonCooling[-1], hvac.CapacityRatioCooling[-1])
1462
+ hvac_sizing_values.Cool_Capacity = (hvac_sizing_values.Cool_Load_Tot / total_cap_curve_value)
1463
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1464
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_user(hvac_sizing_values.Cool_Capacity, hvac_cooling_ap.cool_rated_cfm_per_ton[-1], hvac_cooling_ap.cool_capacity_ratios[-1])
1478
1465
 
1479
1466
  elsif [HPXML::HVACTypeRoomAirConditioner,
1480
1467
  HPXML::HVACTypePTAC,
1481
1468
  HPXML::HVACTypeHeatPumpPTHP,
1482
- HPXML::HVACTypeHeatPumpRoom].include? hvac.CoolType
1469
+ HPXML::HVACTypeHeatPumpRoom].include? @cooling_type
1483
1470
 
1484
- enteringTemp = weather.design.CoolingDrybulb
1485
- totalCap_CurveValue = MathTools.biquadratic(@wetbulb_indoor_cooling, enteringTemp, hvac.COOL_CAP_FT_SPEC[hvac.SizingSpeed])
1471
+ entering_temp = @hpxml.header.manualj_cooling_design_temp
1472
+ hvac_cooling_speed = get_sizing_speed(hvac_cooling_ap)
1473
+ total_cap_curve_value = MathTools.biquadratic(@wetbulb_indoor_cooling, entering_temp, hvac_cooling_ap.cool_cap_ft_spec[hvac_cooling_speed])
1474
+ hvac_cooling_shr = hvac_cooling_ap.cool_rated_shrs_gross[hvac_cooling_speed]
1486
1475
 
1487
- hvac_sizing_values.Cool_Capacity = hvac_sizing_values.Cool_Load_Tot / totalCap_CurveValue
1488
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1489
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_user(hvac_sizing_values.Cool_Capacity, hvac.RatedCFMperTonCooling[hvac.SizingSpeed], 1.0)
1476
+ hvac_sizing_values.Cool_Capacity = hvac_sizing_values.Cool_Load_Tot / total_cap_curve_value
1477
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1478
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_user(hvac_sizing_values.Cool_Capacity, hvac_cooling_ap.cool_rated_cfm_per_ton[hvac_cooling_speed], 1.0)
1490
1479
 
1491
- elsif hvac.CoolType == HPXML::HVACTypeHeatPumpGroundToAir
1480
+ elsif HPXML::HVACTypeHeatPumpGroundToAir == @cooling_type
1492
1481
  coil_bf = gshp_coil_bf
1493
- enteringTemp = hvac.GSHP_design_chw
1482
+ entering_temp = hvac_cooling_ap.design_chw
1483
+ hvac_cooling_speed = get_sizing_speed(hvac_cooling_ap)
1494
1484
 
1495
1485
  # Neglecting the water flow rate for now because it's not available yet. Air flow rate is pre-adjusted values.
1496
1486
  design_wb_temp = UnitConversions.convert(@wetbulb_indoor_cooling, 'f', 'k')
1497
1487
  design_db_temp = UnitConversions.convert(@cool_setpoint, 'f', 'k')
1498
- design_w_temp = UnitConversions.convert(enteringTemp, 'f', 'k')
1488
+ design_w_temp = UnitConversions.convert(entering_temp, 'f', 'k')
1499
1489
  design_vfr_air = UnitConversions.convert(hvac_sizing_values.Cool_Airflow, 'cfm', 'm^3/s')
1500
1490
 
1501
- totalCap_CurveValue, sensibleCap_CurveValue = calc_gshp_clg_curve_value(hvac, design_wb_temp, design_db_temp, design_w_temp, design_vfr_air, nil)
1491
+ cool_cap_curve_spec = hvac_cooling_ap.cool_cap_curve_spec[hvac_cooling_speed]
1492
+ cool_sh_curve_spec = hvac_cooling_ap.cool_sh_curve_spec[hvac_cooling_speed]
1493
+ total_cap_curve_value, sensible_cap_curve_value = calc_gshp_clg_curve_value(cool_cap_curve_spec, cool_sh_curve_spec, design_wb_temp, design_db_temp, design_w_temp, design_vfr_air, nil)
1502
1494
 
1503
- bypassFactor_CurveValue = MathTools.biquadratic(@wetbulb_indoor_cooling, @cool_setpoint, gshp_coil_bf_ft_spec)
1495
+ bypass_factor_curve_value = MathTools.biquadratic(@wetbulb_indoor_cooling, @cool_setpoint, gshp_coil_bf_ft_spec)
1496
+ hvac_cooling_shr = hvac_cooling_ap.cool_rated_shrs_gross[hvac_cooling_speed]
1504
1497
 
1505
- hvac_sizing_values.Cool_Capacity = hvac_sizing_values.Cool_Load_Tot / totalCap_CurveValue # Note: cool_Capacity_Design = hvac_sizing_values.Cool_Load_Tot
1506
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1498
+ hvac_sizing_values.Cool_Capacity = hvac_sizing_values.Cool_Load_Tot / total_cap_curve_value # Note: cool_cap_design = hvac_sizing_values.Cool_Load_Tot
1499
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1507
1500
 
1508
- cool_Load_SensCap_Design = (hvac_sizing_values.Cool_Capacity_Sens * sensibleCap_CurveValue /
1509
- (1.0 + (1.0 - coil_bf * bypassFactor_CurveValue) *
1510
- (80.0 - @cool_setpoint) / (@cool_setpoint - hvac.LeavingAirTemp)))
1511
- cool_Load_LatCap_Design = hvac_sizing_values.Cool_Load_Tot - cool_Load_SensCap_Design
1501
+ cool_load_sens_cap_design = (hvac_sizing_values.Cool_Capacity_Sens * sensible_cap_curve_value /
1502
+ (1.0 + (1.0 - coil_bf * bypass_factor_curve_value) *
1503
+ (80.0 - @cool_setpoint) / (@cool_setpoint - @leaving_air_temp)))
1504
+ cool_load_lat_cap_design = hvac_sizing_values.Cool_Load_Tot - cool_load_sens_cap_design
1512
1505
 
1513
- # Adjust Sizing so that coil sensible at design >= CoolingLoad_MJ8_Sens, and coil latent at design >= CoolingLoad_MJ8_Lat, and equipment SHRRated is maintained.
1514
- cool_Load_SensCap_Design = [cool_Load_SensCap_Design, hvac_sizing_values.Cool_Load_Sens].max
1515
- cool_Load_LatCap_Design = [cool_Load_LatCap_Design, hvac_sizing_values.Cool_Load_Lat].max
1516
- cool_Capacity_Design = cool_Load_SensCap_Design + cool_Load_LatCap_Design
1506
+ # Adjust Sizing so that coil sensible at design >= CoolingLoad_Sens, and coil latent at design >= CoolingLoad_Lat, and equipment SHRRated is maintained.
1507
+ cool_load_sens_cap_design = [cool_load_sens_cap_design, hvac_sizing_values.Cool_Load_Sens].max
1508
+ cool_load_lat_cap_design = [cool_load_lat_cap_design, hvac_sizing_values.Cool_Load_Lat].max
1509
+ cool_cap_design = cool_load_sens_cap_design + cool_load_lat_cap_design
1517
1510
 
1518
1511
  # Limit total capacity via oversizing limit
1519
- cool_Capacity_Design = [cool_Capacity_Design, hvac.OverSizeLimit * hvac_sizing_values.Cool_Load_Tot].min
1520
- hvac_sizing_values.Cool_Capacity = cool_Capacity_Design / totalCap_CurveValue
1521
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1512
+ cool_cap_design = [cool_cap_design, @oversize_limit * hvac_sizing_values.Cool_Load_Tot].min
1513
+ hvac_sizing_values.Cool_Capacity = cool_cap_design / total_cap_curve_value
1514
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1522
1515
 
1523
1516
  # Recalculate the air flow rate in case the oversizing limit has been used
1524
- cool_Load_SensCap_Design = (hvac_sizing_values.Cool_Capacity_Sens * sensibleCap_CurveValue /
1525
- (1.0 + (1.0 - coil_bf * bypassFactor_CurveValue) *
1526
- (80.0 - @cool_setpoint) / (@cool_setpoint - hvac.LeavingAirTemp)))
1527
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_Load_SensCap_Design, (@cool_setpoint - hvac.LeavingAirTemp))
1517
+ cool_load_sens_cap_design = (hvac_sizing_values.Cool_Capacity_Sens * sensible_cap_curve_value /
1518
+ (1.0 + (1.0 - coil_bf * bypass_factor_curve_value) *
1519
+ (80.0 - @cool_setpoint) / (@cool_setpoint - @leaving_air_temp)))
1520
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_load_sens_cap_design, (@cool_setpoint - @leaving_air_temp))
1528
1521
 
1529
- elsif hvac.CoolType == HPXML::HVACTypeEvaporativeCooler
1522
+ elsif HPXML::HVACTypeEvaporativeCooler == @cooling_type
1530
1523
 
1531
1524
  hvac_sizing_values.Cool_Capacity = hvac_sizing_values.Cool_Load_Tot
1532
1525
  hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Load_Sens
1533
- if @cool_setpoint - hvac.LeavingAirTemp > 0
1534
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Cool_Load_Sens, (@cool_setpoint - hvac.LeavingAirTemp))
1526
+ if @cool_setpoint - @leaving_air_temp > 0
1527
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Cool_Load_Sens, (@cool_setpoint - @leaving_air_temp))
1535
1528
  else
1536
1529
  hvac_sizing_values.Cool_Airflow = @cfa * 2.0 # Use industry rule of thumb sizing method adopted by HEScore
1537
1530
  end
1538
1531
 
1539
- elsif hvac.CoolType == HPXML::HVACTypeHeatPumpWaterLoopToAir
1532
+ elsif HPXML::HVACTypeHeatPumpWaterLoopToAir == @cooling_type
1540
1533
 
1541
1534
  # Model only currently used for heating
1542
1535
  hvac_sizing_values.Cool_Capacity = 0.0
1543
1536
  hvac_sizing_values.Cool_Capacity_Sens = 0.0
1544
1537
  hvac_sizing_values.Cool_Airflow = 0.0
1545
1538
 
1546
- elsif hvac.CoolType.nil?
1539
+ elsif @cooling_type.nil?
1547
1540
 
1548
1541
  hvac_sizing_values.Cool_Capacity = 0.0
1549
1542
  hvac_sizing_values.Cool_Capacity_Sens = 0.0
@@ -1551,11 +1544,16 @@ class HVACSizing
1551
1544
 
1552
1545
  else
1553
1546
 
1554
- fail "Unexpected cooling type: #{hvac.CoolType}."
1547
+ fail "Unexpected cooling type: #{@cooling_type}."
1555
1548
 
1556
1549
  end
1557
1550
 
1558
1551
  # Heating
1552
+
1553
+ if not hvac_heating.nil?
1554
+ hvac_heating_ap = hvac_heating.additional_properties
1555
+ end
1556
+
1559
1557
  if hvac_sizing_values.Heat_Load <= 0
1560
1558
 
1561
1559
  hvac_sizing_values.Heat_Capacity = 0.0
@@ -1566,17 +1564,17 @@ class HVACSizing
1566
1564
  elsif [HPXML::HVACTypeHeatPumpAirToAir,
1567
1565
  HPXML::HVACTypeHeatPumpMiniSplit,
1568
1566
  HPXML::HVACTypeHeatPumpPTHP,
1569
- HPXML::HVACTypeHeatPumpRoom].include? hvac.HeatType
1570
- process_heat_pump_adjustment(hvac_sizing_values, weather, hvac, totalCap_CurveValue)
1567
+ HPXML::HVACTypeHeatPumpRoom].include? @heating_type
1568
+ process_heat_pump_adjustment(hvac_sizing_values, weather, hvac_heating, total_cap_curve_value, hvac_system)
1571
1569
  hvac_sizing_values.Heat_Capacity_Supp = hvac_sizing_values.Heat_Load_Supp
1572
- if hvac.HeatType == HPXML::HVACTypeHeatPumpAirToAir
1573
- hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (hvac.SupplyAirTemp - @heat_setpoint))
1570
+ if @heating_type == HPXML::HVACTypeHeatPumpAirToAir
1571
+ hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (@supply_air_temp - @heat_setpoint))
1574
1572
  else
1575
- hvac_sizing_values.Heat_Airflow = calc_airflow_rate_user(hvac_sizing_values.Heat_Capacity, hvac.RatedCFMperTonHeating[-1], hvac.CapacityRatioHeating[-1])
1573
+ hvac_sizing_values.Heat_Airflow = calc_airflow_rate_user(hvac_sizing_values.Heat_Capacity, hvac_heating_ap.heat_rated_cfm_per_ton[-1], hvac_heating_ap.heat_capacity_ratios[-1])
1576
1574
  end
1577
- hvac_sizing_values.Heat_Airflow_Supp = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity_Supp, (hvac.BackupSupplyAirTemp - @heat_setpoint))
1575
+ hvac_sizing_values.Heat_Airflow_Supp = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity_Supp, (@backup_supply_air_temp - @heat_setpoint))
1578
1576
 
1579
- elsif [HPXML::HVACTypeHeatPumpGroundToAir].include? hvac.HeatType
1577
+ elsif [HPXML::HVACTypeHeatPumpGroundToAir].include? @heating_type
1580
1578
 
1581
1579
  if hvac_sizing_values.Cool_Capacity > 0
1582
1580
  hvac_sizing_values.Heat_Capacity = hvac_sizing_values.Heat_Load
@@ -1591,32 +1589,32 @@ class HVACSizing
1591
1589
  hvac_sizing_values.Cool_Capacity = [hvac_sizing_values.Cool_Capacity, hvac_sizing_values.Heat_Capacity].max
1592
1590
  hvac_sizing_values.Heat_Capacity = hvac_sizing_values.Cool_Capacity
1593
1591
 
1594
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1595
- cool_Load_SensCap_Design = (hvac_sizing_values.Cool_Capacity_Sens * sensibleCap_CurveValue /
1596
- (1.0 + (1.0 - gshp_coil_bf * bypassFactor_CurveValue) *
1597
- (80.0 - @cool_setpoint) / (@cool_setpoint - hvac.LeavingAirTemp)))
1598
- hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_Load_SensCap_Design, (@cool_setpoint - hvac.LeavingAirTemp))
1592
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_shr
1593
+ cool_load_sens_cap_design = (hvac_sizing_values.Cool_Capacity_Sens * sensible_cap_curve_value /
1594
+ (1.0 + (1.0 - gshp_coil_bf * bypass_factor_curve_value) *
1595
+ (80.0 - @cool_setpoint) / (@cool_setpoint - @leaving_air_temp)))
1596
+ hvac_sizing_values.Cool_Airflow = calc_airflow_rate_manual_s(cool_load_sens_cap_design, (@cool_setpoint - @leaving_air_temp))
1599
1597
  else
1600
1598
  hvac_sizing_values.Heat_Capacity = hvac_sizing_values.Heat_Load
1601
1599
  hvac_sizing_values.Heat_Capacity_Supp = hvac_sizing_values.Heat_Load_Supp
1602
1600
  end
1603
- hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (hvac.SupplyAirTemp - @heat_setpoint))
1604
- hvac_sizing_values.Heat_Airflow_Supp = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity_Supp, (hvac.BackupSupplyAirTemp - @heat_setpoint))
1601
+ hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (@supply_air_temp - @heat_setpoint))
1602
+ hvac_sizing_values.Heat_Airflow_Supp = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity_Supp, (@backup_supply_air_temp - @heat_setpoint))
1605
1603
 
1606
- elsif [HPXML::HVACTypeHeatPumpWaterLoopToAir].include? hvac.HeatType
1604
+ elsif [HPXML::HVACTypeHeatPumpWaterLoopToAir].include? @heating_type
1607
1605
 
1608
1606
  hvac_sizing_values.Heat_Capacity = hvac_sizing_values.Heat_Load
1609
1607
  hvac_sizing_values.Heat_Capacity_Supp = hvac_sizing_values.Heat_Load_Supp
1610
1608
 
1611
- hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (hvac.SupplyAirTemp - @heat_setpoint))
1612
- hvac_sizing_values.Heat_Airflow_Supp = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity_Supp, (hvac.BackupSupplyAirTemp - @heat_setpoint))
1609
+ hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (@supply_air_temp - @heat_setpoint))
1610
+ hvac_sizing_values.Heat_Airflow_Supp = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity_Supp, (@backup_supply_air_temp - @heat_setpoint))
1613
1611
 
1614
- elsif (hvac.HeatType == HPXML::HVACTypeFurnace) || hvac.HasIntegratedHeating
1612
+ elsif (@heating_type == HPXML::HVACTypeFurnace) || ((not hvac_cooling.nil?) && hvac_cooling.has_integrated_heating)
1615
1613
 
1616
1614
  hvac_sizing_values.Heat_Capacity = hvac_sizing_values.Heat_Load
1617
1615
  hvac_sizing_values.Heat_Capacity_Supp = 0.0
1618
1616
 
1619
- hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (hvac.SupplyAirTemp - @heat_setpoint))
1617
+ hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (@supply_air_temp - @heat_setpoint))
1620
1618
  hvac_sizing_values.Heat_Airflow_Supp = 0.0
1621
1619
 
1622
1620
  elsif [HPXML::HVACTypeStove,
@@ -1624,29 +1622,29 @@ class HVACSizing
1624
1622
  HPXML::HVACTypeFixedHeater,
1625
1623
  HPXML::HVACTypeWallFurnace,
1626
1624
  HPXML::HVACTypeFloorFurnace,
1627
- HPXML::HVACTypeFireplace].include? hvac.HeatType
1625
+ HPXML::HVACTypeFireplace].include? @heating_type
1628
1626
 
1629
1627
  hvac_sizing_values.Heat_Capacity = hvac_sizing_values.Heat_Load
1630
1628
  hvac_sizing_values.Heat_Capacity_Supp = 0.0
1631
1629
 
1632
- if hvac.RatedCFMperTonHeating[0] > 0
1630
+ if hvac_heating_ap.heat_rated_cfm_per_ton[0] > 0
1633
1631
  # Fixed airflow rate
1634
- hvac_sizing_values.Heat_Airflow = UnitConversions.convert(hvac_sizing_values.Heat_Capacity, 'Btu/hr', 'ton') * hvac.RatedCFMperTonHeating[0]
1632
+ hvac_sizing_values.Heat_Airflow = UnitConversions.convert(hvac_sizing_values.Heat_Capacity, 'Btu/hr', 'ton') * hvac_heating_ap.heat_rated_cfm_per_ton[0]
1635
1633
  else
1636
1634
  # Autosized airflow rate
1637
- hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (hvac.SupplyAirTemp - @heat_setpoint))
1635
+ hvac_sizing_values.Heat_Airflow = calc_airflow_rate_manual_s(hvac_sizing_values.Heat_Capacity, (@supply_air_temp - @heat_setpoint))
1638
1636
  end
1639
1637
  hvac_sizing_values.Heat_Airflow_Supp = 0.0
1640
1638
 
1641
1639
  elsif [HPXML::HVACTypeBoiler,
1642
- HPXML::HVACTypeElectricResistance].include? hvac.HeatType
1640
+ HPXML::HVACTypeElectricResistance].include? @heating_type
1643
1641
 
1644
1642
  hvac_sizing_values.Heat_Capacity = hvac_sizing_values.Heat_Load
1645
1643
  hvac_sizing_values.Heat_Capacity_Supp = 0.0
1646
1644
  hvac_sizing_values.Heat_Airflow = 0.0
1647
1645
  hvac_sizing_values.Heat_Airflow_Supp = 0.0
1648
1646
 
1649
- elsif hvac.HeatType.nil?
1647
+ elsif @heating_type.nil?
1650
1648
 
1651
1649
  hvac_sizing_values.Heat_Capacity = 0.0
1652
1650
  hvac_sizing_values.Heat_Capacity_Supp = 0.0
@@ -1655,51 +1653,64 @@ class HVACSizing
1655
1653
 
1656
1654
  else
1657
1655
 
1658
- fail "Unexpected heating type: #{hvac.HeatType}."
1656
+ fail "Unexpected heating type: #{@heating_type}."
1659
1657
 
1660
1658
  end
1661
1659
  end
1662
1660
 
1663
- def self.apply_hvac_installation_quality(hvac_sizing_values, weather, hvac)
1661
+ def self.apply_hvac_installation_quality(hvac_sizing_values, hvac_heating, hvac_cooling)
1664
1662
  # Increases the autosized heating/cooling capacities to account for any reduction
1665
1663
  # in capacity due to HVAC installation quality. This is done to prevent causing
1666
1664
  # unmet loads.
1667
1665
 
1668
- return unless [HPXML::HVACTypeCentralAirConditioner,
1669
- HPXML::HVACTypeHeatPumpAirToAir,
1670
- HPXML::HVACTypeHeatPumpMiniSplit,
1671
- HPXML::HVACTypeMiniSplitAirConditioner,
1672
- HPXML::HVACTypeHeatPumpGroundToAir].include? hvac.CoolType
1673
- return if (hvac.ChargeDefectRatio.to_f.abs < 0.001) && (hvac.AirflowDefectRatioCooling.to_f.abs < 0.001) && (hvac.AirflowDefectRatioHeating.to_f.abs < 0.001)
1666
+ cool_charge_defect_ratio = 0.0
1667
+ cool_airflow_defect_ratio = 0.0
1668
+ heat_airflow_defect_ratio = 0.0
1674
1669
 
1675
- tin_cool = UnitConversions.convert(@cool_setpoint, 'F', 'C')
1676
- tout_cool = UnitConversions.convert(weather.design.CoolingDrybulb, 'F', 'C')
1677
- tout_heat = UnitConversions.convert(weather.design.HeatingDrybulb, 'F', 'C')
1670
+ if not hvac_cooling.nil?
1671
+ if hvac_cooling.respond_to? :charge_defect_ratio
1672
+ cool_charge_defect_ratio = hvac_cooling.charge_defect_ratio.to_f
1673
+ end
1674
+ if hvac_cooling.respond_to? :airflow_defect_ratio
1675
+ cool_airflow_defect_ratio = hvac_cooling.airflow_defect_ratio.to_f
1676
+ end
1677
+ end
1678
+ if (not hvac_heating.nil?)
1679
+ if hvac_heating.respond_to? :airflow_defect_ratio
1680
+ heat_airflow_defect_ratio = hvac_heating.airflow_defect_ratio.to_f
1681
+ end
1682
+ end
1678
1683
 
1679
- f_ch = hvac.ChargeDefectRatio.round(3)
1684
+ return if (cool_charge_defect_ratio.abs < 0.001) && (cool_airflow_defect_ratio.abs < 0.001) && (heat_airflow_defect_ratio.abs < 0.001)
1680
1685
 
1681
1686
  # Cooling
1687
+
1688
+ f_ch = cool_charge_defect_ratio.round(3)
1689
+
1682
1690
  if [HPXML::HVACTypeHeatPumpAirToAir,
1683
1691
  HPXML::HVACTypeCentralAirConditioner,
1684
1692
  HPXML::HVACTypeHeatPumpMiniSplit,
1685
1693
  HPXML::HVACTypeMiniSplitAirConditioner,
1686
- HPXML::HVACTypeHeatPumpGroundToAir].include?(hvac.CoolType) && hvac.CoolingLoadFraction > 0
1694
+ HPXML::HVACTypeHeatPumpGroundToAir].include?(@cooling_type) && @fraction_cool_load_served > 0
1695
+
1696
+ hvac_cooling_ap = hvac_cooling.additional_properties
1687
1697
 
1688
1698
  cool_airflow_rated_defect_ratio = []
1689
1699
  cool_airflow_rated_ratio = []
1690
- cool_cfm_m3s = UnitConversions.convert(hvac_sizing_values.Cool_Airflow, 'cfm', 'm^3/s')
1691
- if hvac.CoolType != HPXML::HVACTypeHeatPumpGroundToAir
1692
- for speed in 0..(hvac.NumSpeedsCooling - 1)
1693
- cool_airflow_rated_ratio << cool_cfm_m3s / HVAC.calc_rated_airflow(hvac_sizing_values.Cool_Capacity, hvac.RatedCFMperTonCooling[speed], hvac.CapacityRatioCooling[speed])
1694
- cool_airflow_rated_defect_ratio << cool_cfm_m3s * (1 + hvac.AirflowDefectRatioCooling) / HVAC.calc_rated_airflow(hvac_sizing_values.Cool_Capacity, hvac.RatedCFMperTonCooling[speed], hvac.CapacityRatioCooling[speed])
1700
+ if @cooling_type != HPXML::HVACTypeHeatPumpGroundToAir
1701
+ cool_cfm_m3s = UnitConversions.convert(hvac_sizing_values.Cool_Airflow, 'cfm', 'm^3/s')
1702
+ for speed in 0..(hvac_cooling_ap.cool_rated_cfm_per_ton.size - 1)
1703
+ cool_airflow_rated_ratio << cool_cfm_m3s / HVAC.calc_rated_airflow(hvac_sizing_values.Cool_Capacity, hvac_cooling_ap.cool_rated_cfm_per_ton[speed], hvac_cooling_ap.cool_capacity_ratios[speed])
1704
+ cool_airflow_rated_defect_ratio << cool_cfm_m3s * (1 + cool_airflow_defect_ratio) / HVAC.calc_rated_airflow(hvac_sizing_values.Cool_Capacity, hvac_cooling_ap.cool_rated_cfm_per_ton[speed], hvac_cooling_ap.cool_capacity_ratios[speed])
1695
1705
  end
1696
1706
  else
1697
1707
  cool_airflow_rated_ratio = [1.0] # actual air flow is equal to rated (before applying defect ratio) in current methodology
1698
- cool_airflow_rated_defect_ratio = [1 + hvac.AirflowDefectRatioCooling]
1708
+ cool_airflow_rated_defect_ratio = [1 + cool_airflow_defect_ratio]
1699
1709
  end
1710
+
1700
1711
  if not cool_airflow_rated_defect_ratio.empty?
1701
1712
  cap_clg_ratios = []
1702
- for speed in 0..(hvac.NumSpeedsCooling - 1)
1713
+ for speed in 0..(cool_airflow_rated_defect_ratio.size - 1)
1703
1714
  # NOTE: heat pump (cooling) curves don't exhibit expected trends at extreme faults;
1704
1715
  clg_fff_cap_coeff, _clg_fff_eir_coeff = HVAC.get_airflow_fault_cooling_coeff()
1705
1716
  a1_AF_Qgr_c = clg_fff_cap_coeff[0]
@@ -1714,8 +1725,8 @@ class HVACSizing
1714
1725
  a4_CH_Qgr_c = qgr_values[3]
1715
1726
 
1716
1727
  q0_CH = a1_CH_Qgr_c
1717
- q1_CH = a2_CH_Qgr_c * tin_cool
1718
- q2_CH = a3_CH_Qgr_c * tout_cool
1728
+ q1_CH = a2_CH_Qgr_c * UnitConversions.convert(@cool_setpoint, 'F', 'C')
1729
+ q2_CH = a3_CH_Qgr_c * UnitConversions.convert(@hpxml.header.manualj_cooling_design_temp, 'F', 'C')
1719
1730
  q3_CH = a4_CH_Qgr_c * f_ch
1720
1731
  y_CH_Q_c = 1 + ((q0_CH + q1_CH + q2_CH + q3_CH) * f_ch)
1721
1732
 
@@ -1739,7 +1750,7 @@ class HVACSizing
1739
1750
 
1740
1751
  prev_capacity = hvac_sizing_values.Cool_Capacity
1741
1752
  hvac_sizing_values.Cool_Capacity *= cap_clg_ratios.max
1742
- hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac.SHRRated[hvac.SizingSpeed]
1753
+ hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity * hvac_cooling_ap.cool_rated_shrs_gross[get_sizing_speed(hvac_cooling_ap)]
1743
1754
  if prev_capacity > 0 # Preserve cfm/ton
1744
1755
  hvac_sizing_values.Cool_Airflow = hvac_sizing_values.Cool_Airflow * hvac_sizing_values.Cool_Capacity / prev_capacity
1745
1756
  else
@@ -1749,24 +1760,29 @@ class HVACSizing
1749
1760
  end
1750
1761
 
1751
1762
  # Heating
1763
+
1752
1764
  if [HPXML::HVACTypeHeatPumpAirToAir,
1753
1765
  HPXML::HVACTypeHeatPumpMiniSplit,
1754
- HPXML::HVACTypeHeatPumpGroundToAir].include?(hvac.HeatType) && hvac.HeatingLoadFraction > 0
1766
+ HPXML::HVACTypeHeatPumpGroundToAir].include?(@heating_type) && @fraction_heat_load_served > 0
1767
+
1768
+ hvac_heating_ap = hvac_heating.additional_properties
1769
+
1755
1770
  heat_airflow_rated_defect_ratio = []
1756
1771
  heat_airflow_rated_ratio = []
1757
- heat_cfm_m3s = UnitConversions.convert(hvac_sizing_values.Heat_Airflow, 'cfm', 'm^3/s')
1758
- if hvac.HeatType != HPXML::HVACTypeHeatPumpGroundToAir
1759
- for speed in 0..(hvac.NumSpeedsHeating - 1)
1760
- heat_airflow_rated_ratio << heat_cfm_m3s / HVAC.calc_rated_airflow(hvac_sizing_values.Heat_Capacity, hvac.RatedCFMperTonHeating[speed], hvac.CapacityRatioHeating[speed])
1761
- heat_airflow_rated_defect_ratio << heat_cfm_m3s * (1 + hvac.AirflowDefectRatioHeating) / HVAC.calc_rated_airflow(hvac_sizing_values.Heat_Capacity, hvac.RatedCFMperTonHeating[speed], hvac.CapacityRatioHeating[speed])
1772
+ if @heating_type != HPXML::HVACTypeHeatPumpGroundToAir
1773
+ heat_cfm_m3s = UnitConversions.convert(hvac_sizing_values.Heat_Airflow, 'cfm', 'm^3/s')
1774
+ for speed in 0..(hvac_heating_ap.heat_rated_cfm_per_ton.size - 1)
1775
+ heat_airflow_rated_ratio << heat_cfm_m3s / HVAC.calc_rated_airflow(hvac_sizing_values.Heat_Capacity, hvac_heating_ap.heat_rated_cfm_per_ton[speed], hvac_heating_ap.heat_capacity_ratios[speed])
1776
+ heat_airflow_rated_defect_ratio << heat_cfm_m3s * (1 + heat_airflow_defect_ratio) / HVAC.calc_rated_airflow(hvac_sizing_values.Heat_Capacity, hvac_heating_ap.heat_rated_cfm_per_ton[speed], hvac_heating_ap.heat_capacity_ratios[speed])
1762
1777
  end
1763
1778
  else
1764
1779
  heat_airflow_rated_ratio = [1.0] # actual air flow is equal to rated (before applying defect ratio) in current methodology
1765
- heat_airflow_rated_defect_ratio = [1 + hvac.AirflowDefectRatioHeating]
1780
+ heat_airflow_rated_defect_ratio = [1 + heat_airflow_defect_ratio]
1766
1781
  end
1782
+
1767
1783
  if not heat_airflow_rated_defect_ratio.empty?
1768
1784
  cap_htg_ratios = []
1769
- for speed in 0..(hvac.NumSpeedsHeating - 1)
1785
+ for speed in 0..(heat_airflow_rated_defect_ratio.size - 1)
1770
1786
  htg_fff_cap_coeff, _htg_fff_eir_coeff = HVAC.get_airflow_fault_heating_coeff()
1771
1787
  a1_AF_Qgr_h = htg_fff_cap_coeff[0]
1772
1788
  a2_AF_Qgr_h = htg_fff_cap_coeff[1]
@@ -1779,7 +1795,7 @@ class HVACSizing
1779
1795
  a3_CH_Qgr_h = qgr_values[3]
1780
1796
 
1781
1797
  qh1_CH = a1_CH_Qgr_h
1782
- qh2_CH = a2_CH_Qgr_h * tout_heat
1798
+ qh2_CH = a2_CH_Qgr_h * UnitConversions.convert(@hpxml.header.manualj_heating_design_temp, 'F', 'C')
1783
1799
  qh3_CH = a3_CH_Qgr_h * f_ch
1784
1800
  y_CH_Q_h = 1 + ((qh1_CH + qh2_CH + qh3_CH) * f_ch)
1785
1801
 
@@ -1800,6 +1816,7 @@ class HVACSizing
1800
1816
  cap_htg_ratio = 1 / (heat_cap_fff / heat_cap_fff_nodefect)
1801
1817
  cap_htg_ratios << cap_htg_ratio
1802
1818
  end
1819
+
1803
1820
  prev_capacity = hvac_sizing_values.Heat_Capacity
1804
1821
  hvac_sizing_values.Heat_Capacity *= cap_htg_ratios.max
1805
1822
  if prev_capacity > 0 # Preserve cfm/ton
@@ -1811,32 +1828,47 @@ class HVACSizing
1811
1828
  end
1812
1829
  end
1813
1830
 
1814
- def self.apply_hvac_fixed_capacities(hvac_sizing_values, hvac)
1831
+ def self.apply_hvac_fixed_capacities(hvac_sizing_values, hvac_heating, hvac_cooling)
1815
1832
  '''
1816
1833
  Fixed Sizing Equipment
1817
1834
  '''
1818
1835
 
1819
1836
  # Override HVAC capacities if values are provided
1820
- if (not hvac.FixedCoolingCapacity.nil?) && (hvac_sizing_values.Cool_Capacity > 0)
1837
+ if not hvac_cooling.nil?
1838
+ fixed_cooling_capacity = hvac_cooling.cooling_capacity
1839
+ end
1840
+ if (not fixed_cooling_capacity.nil?) && (hvac_sizing_values.Cool_Capacity > 0)
1821
1841
  prev_capacity = hvac_sizing_values.Cool_Capacity
1822
- hvac_sizing_values.Cool_Capacity = hvac.FixedCoolingCapacity
1842
+ hvac_sizing_values.Cool_Capacity = fixed_cooling_capacity
1823
1843
  if @hpxml.header.allow_increased_fixed_capacities
1824
1844
  hvac_sizing_values.Cool_Capacity = [hvac_sizing_values.Cool_Capacity, prev_capacity].max
1825
1845
  end
1826
1846
  hvac_sizing_values.Cool_Capacity_Sens = hvac_sizing_values.Cool_Capacity_Sens * hvac_sizing_values.Cool_Capacity / prev_capacity
1827
1847
  hvac_sizing_values.Cool_Airflow = hvac_sizing_values.Cool_Airflow * hvac_sizing_values.Cool_Capacity / prev_capacity
1828
1848
  end
1829
- if (not hvac.FixedHeatingCapacity.nil?) && (hvac_sizing_values.Heat_Capacity > 0)
1849
+ if not hvac_heating.nil?
1850
+ fixed_heating_capacity = hvac_heating.heating_capacity
1851
+ elsif (not hvac_cooling.nil?) && hvac_cooling.has_integrated_heating
1852
+ fixed_heating_capacity = hvac_cooling.integrated_heating_system_capacity
1853
+ end
1854
+ if (not fixed_heating_capacity.nil?) && (hvac_sizing_values.Heat_Capacity > 0)
1830
1855
  prev_capacity = hvac_sizing_values.Heat_Capacity
1831
- hvac_sizing_values.Heat_Capacity = hvac.FixedHeatingCapacity
1856
+ hvac_sizing_values.Heat_Capacity = fixed_heating_capacity
1832
1857
  if @hpxml.header.allow_increased_fixed_capacities
1833
1858
  hvac_sizing_values.Heat_Capacity = [hvac_sizing_values.Heat_Capacity, prev_capacity].max
1834
1859
  end
1835
1860
  hvac_sizing_values.Heat_Airflow = hvac_sizing_values.Heat_Airflow * hvac_sizing_values.Heat_Capacity / prev_capacity
1836
1861
  end
1837
- if (not hvac.FixedSuppHeatingCapacity.nil?) && (hvac_sizing_values.Heat_Capacity_Supp > 0)
1862
+ if hvac_heating.is_a? HPXML::HeatPump
1863
+ if not hvac_heating.backup_heating_capacity.nil?
1864
+ fixed_supp_heating_capacity = hvac_heating.backup_heating_capacity
1865
+ elsif not hvac_heating.backup_system.nil?
1866
+ fixed_supp_heating_capacity = hvac_heating.backup_system.heating_capacity
1867
+ end
1868
+ end
1869
+ if (not fixed_supp_heating_capacity.nil?) && (hvac_sizing_values.Heat_Capacity_Supp > 0)
1838
1870
  prev_capacity = hvac_sizing_values.Heat_Capacity_Supp
1839
- hvac_sizing_values.Heat_Capacity_Supp = hvac.FixedSuppHeatingCapacity
1871
+ hvac_sizing_values.Heat_Capacity_Supp = fixed_supp_heating_capacity
1840
1872
  if @hpxml.header.allow_increased_fixed_capacities
1841
1873
  hvac_sizing_values.Heat_Capacity_Supp = [hvac_sizing_values.Heat_Capacity_Supp, prev_capacity].max
1842
1874
  end
@@ -1844,16 +1876,18 @@ class HVACSizing
1844
1876
  end
1845
1877
  end
1846
1878
 
1847
- def self.apply_hvac_ground_loop(hvac_sizing_values, weather, hvac)
1879
+ def self.apply_hvac_ground_loop(hvac_sizing_values, weather, hvac_cooling)
1848
1880
  '''
1849
1881
  GSHP Ground Loop Sizing Calculations
1850
1882
  '''
1851
- return unless hvac.CoolType == HPXML::HVACTypeHeatPumpGroundToAir
1883
+ return if @cooling_type != HPXML::HVACTypeHeatPumpGroundToAir
1884
+
1885
+ hvac_cooling_ap = hvac_cooling.additional_properties
1852
1886
 
1853
1887
  # Autosize ground loop heat exchanger length
1854
1888
  bore_spacing = 20.0 # ft, distance between bores
1855
- pipe_r_value = gshp_hx_pipe_rvalue(hvac)
1856
- nom_length_heat, nom_length_cool = gshp_hxbore_ft_per_ton(weather, hvac, bore_spacing, pipe_r_value)
1889
+ pipe_r_value = gshp_hx_pipe_rvalue(hvac_cooling_ap)
1890
+ nom_length_heat, nom_length_cool = gshp_hxbore_ft_per_ton(weather, hvac_cooling_ap, bore_spacing, pipe_r_value)
1857
1891
 
1858
1892
  bore_length_heat = nom_length_heat * hvac_sizing_values.Heat_Capacity / UnitConversions.convert(1.0, 'ton', 'Btu/hr')
1859
1893
  bore_length_cool = nom_length_cool * hvac_sizing_values.Cool_Capacity / UnitConversions.convert(1.0, 'ton', 'Btu/hr')
@@ -1909,15 +1943,13 @@ class HVACSizing
1909
1943
  else
1910
1944
  # Search for first valid bore field
1911
1945
  new_bore_config = nil
1912
- valid_field_found = false
1913
1946
  valid_configs.keys.each do |bore_config|
1914
1947
  next unless valid_configs[bore_config].include? num_bore_holes
1915
1948
 
1916
- valid_field_found = true
1917
1949
  new_bore_config = bore_config
1918
1950
  break
1919
1951
  end
1920
- if valid_field_found
1952
+ if not new_bore_config.nil?
1921
1953
  bore_config = new_bore_config
1922
1954
  else
1923
1955
  fail 'Could not construct a valid GSHP bore field configuration.'
@@ -1936,47 +1968,62 @@ class HVACSizing
1936
1968
  hvac_sizing_values.GSHP_G_Functions = [lntts, gfnc_coeff]
1937
1969
  end
1938
1970
 
1939
- def self.apply_hvac_finalize_airflows(hvac_sizing_values, hvac)
1971
+ def self.apply_hvac_finalize_airflows(hvac_sizing_values, hvac_heating, hvac_cooling)
1940
1972
  '''
1941
1973
  Finalize Sizing Calculations
1942
1974
  '''
1943
1975
 
1944
- if hvac_sizing_values.Heat_Airflow > 0
1945
- hvac_sizing_values.Heat_Airflow *= (1.0 + hvac.AirflowDefectRatioHeating)
1976
+ if (not hvac_heating.nil?) && hvac_heating.respond_to?(:airflow_defect_ratio)
1977
+ if hvac_sizing_values.Heat_Airflow > 0
1978
+ hvac_sizing_values.Heat_Airflow *= (1.0 + hvac_heating.airflow_defect_ratio.to_f)
1979
+ end
1946
1980
  end
1947
1981
 
1948
- if hvac_sizing_values.Cool_Airflow > 0
1949
- hvac_sizing_values.Cool_Airflow *= (1.0 + hvac.AirflowDefectRatioCooling)
1982
+ if (not hvac_cooling.nil?) && hvac_cooling.respond_to?(:airflow_defect_ratio)
1983
+ if hvac_sizing_values.Cool_Airflow > 0
1984
+ hvac_sizing_values.Cool_Airflow *= (1.0 + hvac_cooling.airflow_defect_ratio.to_f)
1985
+ end
1950
1986
  end
1951
1987
  end
1952
1988
 
1953
- def self.process_heat_pump_adjustment(hvac_sizing_values, weather, hvac, totalCap_CurveValue)
1989
+ def self.process_heat_pump_adjustment(hvac_sizing_values, weather, hvac_heating, total_cap_curve_value, hvac_system)
1954
1990
  '''
1955
1991
  Adjust heat pump sizing
1956
1992
  '''
1957
- if hvac.NumSpeedsHeating > 1
1958
- coefficients = hvac.HEAT_CAP_FT_SPEC[hvac.NumSpeedsHeating - 1]
1959
- capacity_ratio = hvac.CapacityRatioHeating[hvac.NumSpeedsHeating - 1]
1993
+
1994
+ hvac_heating_ap = hvac_heating.additional_properties
1995
+
1996
+ if hvac_heating_ap.heat_cap_ft_spec.size > 1
1997
+ coefficients = hvac_heating_ap.heat_cap_ft_spec[-1]
1998
+ capacity_ratio = hvac_heating_ap.heat_capacity_ratios[-1]
1960
1999
  else
1961
- coefficients = hvac.HEAT_CAP_FT_SPEC[0]
2000
+ coefficients = hvac_heating_ap.heat_cap_ft_spec[0]
1962
2001
  capacity_ratio = 1.0
1963
2002
  end
1964
2003
 
1965
- if (not hvac.SwitchoverTemperature.nil?) && (hvac.SwitchoverTemperature > weather.design.HeatingDrybulb)
2004
+ if hvac_heating.is_a? HPXML::HeatPump
2005
+ if not hvac_heating.backup_heating_switchover_temp.nil?
2006
+ min_compressor_temp = hvac_heating.backup_heating_switchover_temp
2007
+ elsif not hvac_heating.compressor_lockout_temp.nil?
2008
+ min_compressor_temp = hvac_heating.compressor_lockout_temp
2009
+ end
2010
+ end
2011
+ if (not min_compressor_temp.nil?) && (min_compressor_temp > @hpxml.header.manualj_heating_design_temp)
1966
2012
  # Calculate the heating load at the switchover temperature to limit uninitialized capacity
1967
- switchover_weather = Marshal.load(Marshal.dump(weather))
1968
- switchover_weather.design.HeatingDrybulb = hvac.SwitchoverTemperature
1969
- _switchover_bldg_design_loads, switchover_all_hvac_sizing_values = calculate(switchover_weather, @hpxml, @cfa, @nbeds, [hvac.hvac_system])
1970
- heating_load = switchover_all_hvac_sizing_values[hvac.hvac_system].Heat_Load
1971
- heating_db = switchover_weather.design.HeatingDrybulb
2013
+ temp_heat_design_temp = @hpxml.header.manualj_heating_design_temp
2014
+ @hpxml.header.manualj_heating_design_temp = min_compressor_temp
2015
+ _alternate_bldg_design_loads, alternate_all_hvac_sizing_values = calculate(weather, @hpxml, @cfa, [hvac_system])
2016
+ heating_load = alternate_all_hvac_sizing_values[hvac_system].Heat_Load
2017
+ heating_db = min_compressor_temp
2018
+ @hpxml.header.manualj_heating_design_temp = temp_heat_design_temp
1972
2019
  else
1973
2020
  heating_load = hvac_sizing_values.Heat_Load
1974
- heating_db = weather.design.HeatingDrybulb
2021
+ heating_db = @hpxml.header.manualj_heating_design_temp
1975
2022
  end
1976
2023
 
1977
2024
  heat_cap_rated = (heating_load / MathTools.biquadratic(@heat_setpoint, heating_db, coefficients)) / capacity_ratio
1978
2025
 
1979
- if totalCap_CurveValue.nil? # Heat pump has no cooling
2026
+ if total_cap_curve_value.nil? # Heat pump has no cooling
1980
2027
  if @hpxml.header.heat_pump_sizing_methodology == HPXML::HeatPumpSizingMaxLoad
1981
2028
  # Size based on heating, taking into account reduced heat pump capacity at the design temperature
1982
2029
  hvac_sizing_values.Heat_Capacity = heat_cap_rated
@@ -1997,10 +2044,10 @@ class HVACSizing
1997
2044
  load_shr = hvac_sizing_values.Cool_Load_Sens / hvac_sizing_values.Cool_Load_Tot
1998
2045
  if ((weather.data.HDD65F / weather.data.CDD50F) < 2.0) || (load_shr < 0.95)
1999
2046
  # Mild winter or has a latent cooling load
2000
- hvac_sizing_values.Cool_Capacity = [(hvac.OverSizeLimit * hvac_sizing_values.Cool_Load_Tot) / totalCap_CurveValue, heat_cap_rated].min
2047
+ hvac_sizing_values.Cool_Capacity = [(@oversize_limit * hvac_sizing_values.Cool_Load_Tot) / total_cap_curve_value, heat_cap_rated].min
2001
2048
  else
2002
2049
  # Cold winter and no latent cooling load (add a ton rule applies)
2003
- hvac_sizing_values.Cool_Capacity = [(hvac_sizing_values.Cool_Load_Tot + hvac.OverSizeDelta) / totalCap_CurveValue, heat_cap_rated].min
2050
+ hvac_sizing_values.Cool_Capacity = [(hvac_sizing_values.Cool_Load_Tot + @oversize_delta) / total_cap_curve_value, heat_cap_rated].min
2004
2051
  end
2005
2052
  end
2006
2053
  hvac_sizing_values.Cool_Airflow = cfm_per_btuh * hvac_sizing_values.Cool_Capacity
@@ -2073,7 +2120,7 @@ class HVACSizing
2073
2120
  return rated_cfm_per_ton * capacity_ratio * UnitConversions.convert(capacity, 'Btu/hr', 'ton') # Maximum air flow under heating operation
2074
2121
  end
2075
2122
 
2076
- def self.calc_gshp_clg_curve_value(hvac, wb_temp, db_temp, w_temp, vfr_air, loop_flow = nil, rated_vfr_air = nil)
2123
+ def self.calc_gshp_clg_curve_value(cool_cap_curve_spec, cool_sh_curve_spec, wb_temp, db_temp, w_temp, vfr_air, loop_flow = nil, rated_vfr_air = nil)
2077
2124
  # Reference conditions in thesis with largest capacity:
2078
2125
  # See Appendix B Figure B.3 of https://hvac.okstate.edu/sites/default/files/pubs/theses/MS/27-Tang_Thesis_05.pdf
2079
2126
  ref_temp = 283 # K
@@ -2085,66 +2132,47 @@ class HVACSizing
2085
2132
  end
2086
2133
  ref_vfr_water = 0.000284
2087
2134
 
2088
- a_1 = hvac.COOL_CAP_CURVE_SPEC[hvac.SizingSpeed][0]
2089
- a_2 = hvac.COOL_CAP_CURVE_SPEC[hvac.SizingSpeed][1]
2090
- a_3 = hvac.COOL_CAP_CURVE_SPEC[hvac.SizingSpeed][2]
2091
- a_4 = hvac.COOL_CAP_CURVE_SPEC[hvac.SizingSpeed][3]
2092
- a_5 = hvac.COOL_CAP_CURVE_SPEC[hvac.SizingSpeed][4]
2093
- b_1 = hvac.COOL_SH_CURVE_SPEC[hvac.SizingSpeed][0]
2094
- b_2 = hvac.COOL_SH_CURVE_SPEC[hvac.SizingSpeed][1]
2095
- b_3 = hvac.COOL_SH_CURVE_SPEC[hvac.SizingSpeed][2]
2096
- b_4 = hvac.COOL_SH_CURVE_SPEC[hvac.SizingSpeed][3]
2097
- b_5 = hvac.COOL_SH_CURVE_SPEC[hvac.SizingSpeed][4]
2098
- b_6 = hvac.COOL_SH_CURVE_SPEC[hvac.SizingSpeed][5]
2099
-
2100
- if not loop_flow.nil?
2101
- totalCap_CurveValue = a_1 + wb_temp / ref_temp * a_2 + w_temp / ref_temp * a_3 + vfr_air / ref_vfr_air * a_4 + loop_flow / ref_vfr_water * a_5
2102
- sensibleCap_CurveValue = b_1 + db_temp / ref_temp * b_2 + wb_temp / ref_temp * b_3 + w_temp / ref_temp * b_4 + vfr_air / ref_vfr_air * b_5 + loop_flow / ref_vfr_water * b_6
2103
- else
2104
- totalCap_CurveValue = a_1 + wb_temp / ref_temp * a_2 + w_temp / ref_temp * a_3 + vfr_air / ref_vfr_air * a_4
2105
- sensibleCap_CurveValue = b_1 + db_temp / ref_temp * b_2 + wb_temp / ref_temp * b_3 + w_temp / ref_temp * b_4 + vfr_air / ref_vfr_air * b_5
2106
- end
2107
- return totalCap_CurveValue, sensibleCap_CurveValue
2108
- end
2135
+ a_1 = cool_cap_curve_spec[0]
2136
+ a_2 = cool_cap_curve_spec[1]
2137
+ a_3 = cool_cap_curve_spec[2]
2138
+ a_4 = cool_cap_curve_spec[3]
2139
+ a_5 = cool_cap_curve_spec[4]
2140
+ b_1 = cool_sh_curve_spec[0]
2141
+ b_2 = cool_sh_curve_spec[1]
2142
+ b_3 = cool_sh_curve_spec[2]
2143
+ b_4 = cool_sh_curve_spec[3]
2144
+ b_5 = cool_sh_curve_spec[4]
2145
+ b_6 = cool_sh_curve_spec[5]
2109
2146
 
2110
- def self.calc_gshp_htg_curve_value(hvac, db_temp, w_temp, vfr_air, loop_flow)
2111
- # Reference conditions in thesis with largest capacity:
2112
- # See Appendix B Figure B.3 of https://hvac.okstate.edu/sites/default/files/pubs/theses/MS/27-Tang_Thesis_05.pdf
2113
- ref_temp = 283 # K
2114
- ref_vfr_air = UnitConversions.convert(1200, 'cfm', 'm^3/s')
2115
- ref_vfr_water = 0.000284
2147
+ loop_flow = 0.0 if loop_flow.nil?
2116
2148
 
2117
- a_1 = hvac.HEAT_CAP_FT_SPEC[hvac.SizingSpeed][0]
2118
- a_2 = hvac.HEAT_CAP_FT_SPEC[hvac.SizingSpeed][1]
2119
- a_3 = hvac.HEAT_CAP_FT_SPEC[hvac.SizingSpeed][2]
2120
- a_4 = hvac.HEAT_CAP_FT_SPEC[hvac.SizingSpeed][3]
2121
- a_5 = hvac.HEAT_CAP_FT_SPEC[hvac.SizingSpeed][4]
2149
+ total_cap_curve_value = a_1 + wb_temp / ref_temp * a_2 + w_temp / ref_temp * a_3 + vfr_air / ref_vfr_air * a_4 + loop_flow / ref_vfr_water * a_5
2150
+ sensible_cap_curve_value = b_1 + db_temp / ref_temp * b_2 + wb_temp / ref_temp * b_3 + w_temp / ref_temp * b_4 + vfr_air / ref_vfr_air * b_5 + loop_flow / ref_vfr_water * b_6
2122
2151
 
2123
- cap_CurveValue = a_1 + db_temp / ref_temp * a_2 + w_temp / ref_temp * a_3 + vfr_air / ref_vfr_air * a_4 + loop_flow / ref_vfr_water * a_5
2124
- return cap_CurveValue
2152
+ return total_cap_curve_value, sensible_cap_curve_value
2125
2153
  end
2126
2154
 
2127
2155
  def self.calc_delivery_effectiveness_heating(dse_Qs, dse_Qr, system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Fregain_s, dse_Fregain_r, supply_r, return_r, air_dens = @inside_air_dens, air_cp = Gas.Air.cp)
2128
2156
  '''
2129
2157
  Calculate the Delivery Effectiveness for heating (using the method of ASHRAE Standard 152).
2130
2158
  '''
2131
- dse_Bs, dse_Br, dse_a_s, dse_a_r, dse_dTe, dse_dT_s, dse_dT_r = _calc_dse_init(system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Qs, dse_Qr, supply_r, return_r, air_dens, air_cp)
2132
- dse_DE = _calc_dse_DE_heating(dse_a_s, dse_Bs, dse_a_r, dse_Br, dse_dT_s, dse_dT_r, dse_dTe)
2133
- dse_DEcorr = _calc_dse_DEcorr(dse_DE, dse_Fregain_s, dse_Fregain_r, dse_Br, dse_a_r, dse_dT_r, dse_dTe)
2159
+ dse_Bs, dse_Br, dse_As, dse_Ar, dse_dTe, dse_dT_s, dse_dT_r = _calc_dse_init(system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Qs, dse_Qr, supply_r, return_r, air_dens, air_cp)
2160
+ dse_DE = _calc_dse_DE_heating(dse_As, dse_Bs, dse_Ar, dse_Br, dse_dT_s, dse_dT_r, dse_dTe)
2161
+ dse_DEcorr = _calc_dse_DEcorr(dse_DE, dse_Fregain_s, dse_Fregain_r, dse_Br, dse_Ar, dse_dT_r, dse_dTe)
2134
2162
 
2135
2163
  return dse_DEcorr
2136
2164
  end
2137
2165
 
2138
- def self.calc_delivery_effectiveness_cooling(dse_Qs, dse_Qr, leavingAirTemp, system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Fregain_s, dse_Fregain_r, load_total, dse_h_r, supply_r, return_r, air_dens = @inside_air_dens, air_cp = Gas.Air.cp, h_in = @enthalpy_indoor_cooling)
2166
+ def self.calc_delivery_effectiveness_cooling(dse_Qs, dse_Qr, leaving_air_temp, system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Fregain_s, dse_Fregain_r, load_total, dse_h_r, supply_r, return_r, air_dens = @inside_air_dens, air_cp = Gas.Air.cp, h_in = @enthalpy_indoor_cooling)
2139
2167
  '''
2140
2168
  Calculate the Delivery Effectiveness for cooling (using the method of ASHRAE Standard 152).
2141
2169
  '''
2142
- dse_Bs, dse_Br, dse_a_s, dse_a_r, dse_dTe, _dse_dT_s, dse_dT_r = _calc_dse_init(system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Qs, dse_Qr, supply_r, return_r, air_dens, air_cp)
2170
+ dse_Bs, dse_Br, dse_As, dse_Ar, dse_dTe, _dse_dT_s, dse_dT_r = _calc_dse_init(system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Qs, dse_Qr, supply_r, return_r, air_dens, air_cp)
2143
2171
  dse_dTe *= -1.0
2144
- dse_DE, coolingLoad_Ducts_Sens = _calc_dse_DE_cooling(dse_a_s, system_cfm, load_total, dse_a_r, dse_h_r, dse_Br, dse_dT_r, dse_Bs, leavingAirTemp, dse_Tamb_s, load_sens, air_dens, air_cp, h_in)
2145
- dse_DEcorr = _calc_dse_DEcorr(dse_DE, dse_Fregain_s, dse_Fregain_r, dse_Br, dse_a_r, dse_dT_r, dse_dTe)
2172
+ dse_DE, cooling_load_ducts_sens = _calc_dse_DE_cooling(dse_As, system_cfm, load_total, dse_Ar, dse_h_r, dse_Br, dse_dT_r, dse_Bs, leaving_air_temp, dse_Tamb_s, load_sens, air_dens, air_cp, h_in)
2173
+ dse_DEcorr = _calc_dse_DEcorr(dse_DE, dse_Fregain_s, dse_Fregain_r, dse_Br, dse_Ar, dse_dT_r, dse_dTe)
2146
2174
 
2147
- return dse_DEcorr, dse_dTe, coolingLoad_Ducts_Sens
2175
+ return dse_DEcorr, dse_dTe, cooling_load_ducts_sens
2148
2176
  end
2149
2177
 
2150
2178
  def self._calc_dse_init(system_cfm, load_sens, dse_Tamb_s, dse_Tamb_r, dse_As, dse_Ar, t_setpoint, dse_Qs, dse_Qr, supply_r, return_r, air_dens, air_cp)
@@ -2152,43 +2180,43 @@ class HVACSizing
2152
2180
  dse_Bs = Math.exp((-1.0 * dse_As) / (60.0 * system_cfm * air_dens * air_cp * supply_r))
2153
2181
  dse_Br = Math.exp((-1.0 * dse_Ar) / (60.0 * system_cfm * air_dens * air_cp * return_r))
2154
2182
 
2155
- dse_a_s = (system_cfm - dse_Qs) / system_cfm
2156
- dse_a_r = (system_cfm - dse_Qr) / system_cfm
2183
+ dse_As = (system_cfm - dse_Qs) / system_cfm
2184
+ dse_Ar = (system_cfm - dse_Qr) / system_cfm
2157
2185
 
2158
2186
  dse_dTe = load_sens / (60.0 * system_cfm * air_dens * air_cp)
2159
2187
  dse_dT_s = t_setpoint - dse_Tamb_s
2160
2188
  dse_dT_r = t_setpoint - dse_Tamb_r
2161
2189
 
2162
- return dse_Bs, dse_Br, dse_a_s, dse_a_r, dse_dTe, dse_dT_s, dse_dT_r
2190
+ return dse_Bs, dse_Br, dse_As, dse_Ar, dse_dTe, dse_dT_s, dse_dT_r
2163
2191
  end
2164
2192
 
2165
- def self._calc_dse_DE_cooling(dse_a_s, system_cfm, load_total, dse_a_r, dse_h_r, dse_Br, dse_dT_r, dse_Bs, leavingAirTemp, dse_Tamb_s, load_sens, air_dens, air_cp, h_in)
2193
+ def self._calc_dse_DE_cooling(dse_As, system_cfm, load_total, dse_Ar, dse_h_r, dse_Br, dse_dT_r, dse_Bs, leaving_air_temp, dse_Tamb_s, load_sens, air_dens, air_cp, h_in)
2166
2194
  # Calculate the delivery effectiveness (Equation 6-25)
2167
- dse_DE = ((dse_a_s * 60.0 * system_cfm * air_dens) / (-1.0 * load_total)) * \
2195
+ dse_DE = ((dse_As * 60.0 * system_cfm * air_dens) / (-1.0 * load_total)) * \
2168
2196
  (((-1.0 * load_total) / (60.0 * system_cfm * air_dens)) + \
2169
- (1.0 - dse_a_r) * (dse_h_r - h_in) + \
2170
- dse_a_r * air_cp * (dse_Br - 1.0) * dse_dT_r + \
2171
- air_cp * (dse_Bs - 1.0) * (leavingAirTemp - dse_Tamb_s))
2197
+ (1.0 - dse_Ar) * (dse_h_r - h_in) + \
2198
+ dse_Ar * air_cp * (dse_Br - 1.0) * dse_dT_r + \
2199
+ air_cp * (dse_Bs - 1.0) * (leaving_air_temp - dse_Tamb_s))
2172
2200
 
2173
2201
  # Calculate the sensible heat transfer from surroundings
2174
- coolingLoad_Ducts_Sens = (1.0 - [dse_DE, 0.0].max) * load_sens
2202
+ cooling_load_ducts_sens = (1.0 - [dse_DE, 0.0].max) * load_sens
2175
2203
 
2176
- return dse_DE, coolingLoad_Ducts_Sens
2204
+ return dse_DE, cooling_load_ducts_sens
2177
2205
  end
2178
2206
 
2179
- def self._calc_dse_DE_heating(dse_a_s, dse_Bs, dse_a_r, dse_Br, dse_dT_s, dse_dT_r, dse_dTe)
2207
+ def self._calc_dse_DE_heating(dse_As, dse_Bs, dse_Ar, dse_Br, dse_dT_s, dse_dT_r, dse_dTe)
2180
2208
  # Calculate the delivery effectiveness (Equation 6-23)
2181
- dse_DE = (dse_a_s * dse_Bs -
2182
- dse_a_s * dse_Bs * (1.0 - dse_a_r * dse_Br) * (dse_dT_r / dse_dTe) -
2183
- dse_a_s * (1.0 - dse_Bs) * (dse_dT_s / dse_dTe))
2209
+ dse_DE = (dse_As * dse_Bs -
2210
+ dse_As * dse_Bs * (1.0 - dse_Ar * dse_Br) * (dse_dT_r / dse_dTe) -
2211
+ dse_As * (1.0 - dse_Bs) * (dse_dT_s / dse_dTe))
2184
2212
 
2185
2213
  return dse_DE
2186
2214
  end
2187
2215
 
2188
- def self._calc_dse_DEcorr(dse_DE, dse_Fregain_s, dse_Fregain_r, dse_Br, dse_a_r, dse_dT_r, dse_dTe)
2216
+ def self._calc_dse_DEcorr(dse_DE, dse_Fregain_s, dse_Fregain_r, dse_Br, dse_Ar, dse_dT_r, dse_dTe)
2189
2217
  # Calculate the delivery effectiveness corrector for regain (Equation 6-40)
2190
2218
  dse_DEcorr = (dse_DE + dse_Fregain_s * (1.0 - dse_DE) - (dse_Fregain_s - dse_Fregain_r -
2191
- dse_Br * (dse_a_r * dse_Fregain_s - dse_Fregain_r)) * dse_dT_r / dse_dTe)
2219
+ dse_Br * (dse_Ar * dse_Fregain_s - dse_Fregain_r)) * dse_dT_r / dse_dTe)
2192
2220
 
2193
2221
  # Limit the DE to a reasonable value to prevent negative values and huge equipment
2194
2222
  dse_DEcorr = [dse_DEcorr, 0.25].max
@@ -2197,382 +2225,92 @@ class HVACSizing
2197
2225
  return dse_DEcorr
2198
2226
  end
2199
2227
 
2200
- def self.calculate_sensible_latent_split(return_leakage_cfm, cool_load_tot, coolingLoadLat)
2228
+ def self.calculate_sensible_latent_split(return_leakage_cfm, cool_load_tot, cool_load_lat)
2201
2229
  # Calculate the latent duct leakage load (Manual J accounts only for return duct leakage)
2202
- dse_Cool_Load_Latent = [0.0, 0.68 * @acf * return_leakage_cfm * (@cool_design_grains - @cool_indoor_grains)].max
2230
+ dse_cool_load_latent = [0.0, 0.68 * @acf * return_leakage_cfm * (@cool_design_grains - @cool_indoor_grains)].max
2203
2231
 
2204
2232
  # Calculate final latent and load
2205
- cool_Load_Lat = coolingLoadLat + dse_Cool_Load_Latent
2206
- cool_Load_Sens = cool_load_tot - cool_Load_Lat
2233
+ cool_load_lat += dse_cool_load_latent
2234
+ cool_load_sens = cool_load_tot - cool_load_lat
2207
2235
 
2208
- return cool_Load_Lat, cool_Load_Sens
2236
+ return cool_load_lat, cool_load_sens
2209
2237
  end
2210
2238
 
2211
- def self.calc_ducts_area_weighted_average(ducts, values)
2212
- '''
2213
- Calculate area-weighted average values for unconditioned duct(s)
2214
- '''
2215
- uncond_area = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2216
- ducts.each do |duct|
2217
- next if HPXML::conditioned_locations_this_unit.include? duct.Location
2218
-
2219
- uncond_area[duct.Side] += duct.Area
2220
- end
2239
+ def self.calc_duct_conduction_values(distribution_system, design_temps)
2240
+ dse_A = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2241
+ dse_Ufactor = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2242
+ dse_Tamb = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2243
+ dse_Fregain = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2221
2244
 
2222
- value = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2223
- ducts.each do |duct|
2224
- next if HPXML::conditioned_locations_this_unit.include? duct.Location
2245
+ [HPXML::DuctTypeSupply, HPXML::DuctTypeReturn].each do |duct_type|
2246
+ # Calculate total area outside this unit's conditioned space
2247
+ total_area = 0.0
2248
+ distribution_system.ducts.each do |duct|
2249
+ next if duct.duct_type != duct_type
2250
+ next if HPXML::conditioned_locations_this_unit.include? duct.duct_location
2225
2251
 
2226
- if uncond_area[duct.Side] > 0
2227
- value[duct.Side] += values[duct.Side][duct.Location] * duct.Area / uncond_area[duct.Side]
2228
- else
2229
- value[duct.Side] += values[duct.Side][duct.Location]
2252
+ total_area += duct.duct_surface_area * duct.duct_surface_area_multiplier
2230
2253
  end
2231
- end
2232
2254
 
2233
- return value[HPXML::DuctTypeSupply], value[HPXML::DuctTypeReturn]
2234
- end
2235
-
2236
- def self.calc_ducts_areas(ducts)
2237
- '''
2238
- Calculate total supply & return duct areas in unconditioned space
2239
- '''
2255
+ if total_area == 0
2256
+ # There still may be leakage to the outside, so set Tamb to outside environment
2257
+ dse_Tamb[duct_type] = design_temps[HPXML::LocationOutside]
2258
+ else
2259
+ distribution_system.ducts.each do |duct|
2260
+ next if duct.duct_type != duct_type
2261
+ next if HPXML::conditioned_locations_this_unit.include? duct.duct_location
2240
2262
 
2241
- areas = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2242
- ducts.each do |duct|
2243
- next if HPXML::conditioned_locations_this_unit.include? duct.Location
2263
+ duct_area = duct.duct_surface_area * duct.duct_surface_area_multiplier
2264
+ dse_A[duct_type] += duct_area
2244
2265
 
2245
- areas[duct.Side] += duct.Area
2246
- end
2266
+ # Calculate area-weighted values:
2247
2267
 
2248
- return areas[HPXML::DuctTypeSupply], areas[HPXML::DuctTypeReturn]
2249
- end
2268
+ duct_area_fraction = duct_area / total_area
2250
2269
 
2251
- def self.calc_ducts_leakages(ducts, system_cfm)
2252
- '''
2253
- Calculate total supply & return duct leakage in cfm.
2254
- '''
2270
+ dse_Ufactor[duct_type] += 1.0 / duct.duct_effective_r_value * duct_area_fraction
2255
2271
 
2256
- cfms = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2257
- ducts.each do |duct|
2258
- next if HPXML::conditioned_locations_this_unit.include? duct.Location
2272
+ dse_Tamb[duct_type] += design_temps[duct.duct_location] * duct_area_fraction
2259
2273
 
2260
- if duct.LeakageFrac.to_f > 0
2261
- cfms[duct.Side] += duct.LeakageFrac * system_cfm
2262
- elsif duct.LeakageCFM25.to_f > 0
2263
- cfms[duct.Side] += duct.LeakageCFM25
2264
- elsif duct.LeakageCFM50.to_f > 0
2265
- cfms[duct.Side] += Airflow.calc_air_leakage_at_diff_pressure(0.65, duct.LeakageCFM50, 50.0, 25.0)
2274
+ dse_Fregain[duct_type] += get_duct_regain_factor(duct) * duct_area_fraction
2275
+ end
2266
2276
  end
2267
2277
  end
2268
2278
 
2269
- return cfms[HPXML::DuctTypeSupply], cfms[HPXML::DuctTypeReturn]
2279
+ return dse_A[HPXML::DuctTypeSupply], dse_A[HPXML::DuctTypeReturn],
2280
+ 1.0 / dse_Ufactor[HPXML::DuctTypeSupply], 1.0 / dse_Ufactor[HPXML::DuctTypeReturn],
2281
+ dse_Tamb[HPXML::DuctTypeSupply], dse_Tamb[HPXML::DuctTypeReturn],
2282
+ dse_Fregain[HPXML::DuctTypeSupply], dse_Fregain[HPXML::DuctTypeReturn]
2270
2283
  end
2271
2284
 
2272
- def self.calc_ducts_rvalues(ducts)
2285
+ def self.calc_duct_leakages_cfm25(distribution_system, system_cfm)
2273
2286
  '''
2274
- Calculate UA-weighted average R-value for supply & return ducts.
2287
+ Calculate supply & return duct leakage in cfm25.
2275
2288
  '''
2276
2289
 
2277
- u_factors = { HPXML::DuctTypeSupply => {}, HPXML::DuctTypeReturn => {} }
2278
- ducts.each do |duct|
2279
- next if HPXML::conditioned_locations_this_unit.include? duct.Location
2280
-
2281
- u_factors[duct.Side][duct.Location] = 1.0 / duct.Rvalue
2282
- end
2283
-
2284
- supply_u, return_u = calc_ducts_area_weighted_average(ducts, u_factors)
2285
-
2286
- return 1.0 / supply_u, 1.0 / return_u
2287
- end
2288
-
2289
- def self.get_hvac_information(hvac_system)
2290
- # FUTURE: Remove this method and use hvac_system objects directly.
2291
- hvac = HVACInfo.new
2292
-
2293
- hpxml_hvacs = []
2294
- if not hvac_system[:heating].nil?
2295
- hpxml_hvacs << hvac_system[:heating]
2296
- end
2297
- if not hvac_system[:cooling].nil?
2298
- hpxml_hvacs << hvac_system[:cooling]
2299
- end
2300
-
2301
- # Get heating/cooling system info from HPXML objects
2302
- hpxml_hvacs.uniq.each do |hpxml_hvac|
2303
- hpxml_hvac_ap = hpxml_hvac.additional_properties
2304
-
2305
- hvac.hvac_system = hvac_system
2306
-
2307
- # System type
2308
- if hpxml_hvac.respond_to? :heating_system_type
2309
- hvac.HeatType = hpxml_hvac.heating_system_type
2310
- elsif hpxml_hvac.respond_to? :cooling_system_type
2311
- hvac.CoolType = hpxml_hvac.cooling_system_type
2312
- elsif hpxml_hvac.respond_to? :heat_pump_type
2313
- hvac.HeatType = hpxml_hvac.heat_pump_type
2314
- hvac.CoolType = hpxml_hvac.heat_pump_type
2315
- end
2316
-
2317
- # Load fractions
2318
- if hpxml_hvac.respond_to? :fraction_heat_load_served
2319
- hvac.HeatingLoadFraction = hpxml_hvac.fraction_heat_load_served
2320
- end
2321
- if hpxml_hvac.respond_to? :fraction_cool_load_served
2322
- hvac.CoolingLoadFraction = hpxml_hvac.fraction_cool_load_served
2323
- end
2324
- if hpxml_hvac.is_a?(HPXML::HeatingSystem) && hpxml_hvac.is_heat_pump_backup_system
2325
- # Use the same load fractions as the heat pump
2326
- heat_pump = @hpxml.heat_pumps.select { |hp| hp.backup_system_idref == hpxml_hvac.id }[0]
2327
- hvac.HeatingLoadFraction = heat_pump.fraction_heat_load_served
2328
- hvac.CoolingLoadFraction = heat_pump.fraction_cool_load_served
2329
- end
2330
-
2331
- # Capacities
2332
- if hpxml_hvac.is_a?(HPXML::HeatingSystem) || hpxml_hvac.is_a?(HPXML::HeatPump)
2333
- hvac.FixedHeatingCapacity = hpxml_hvac.heating_capacity
2334
- end
2335
- if hpxml_hvac.is_a?(HPXML::CoolingSystem) || hpxml_hvac.is_a?(HPXML::HeatPump)
2336
- hvac.FixedCoolingCapacity = hpxml_hvac.cooling_capacity
2337
- end
2338
- if hpxml_hvac.is_a?(HPXML::HeatPump)
2339
- if not hpxml_hvac.backup_heating_capacity.nil?
2340
- hvac.FixedSuppHeatingCapacity = hpxml_hvac.backup_heating_capacity
2341
- elsif not hpxml_hvac.backup_system.nil?
2342
- hvac.FixedSuppHeatingCapacity = hpxml_hvac.backup_system.heating_capacity
2343
- end
2344
- end
2345
-
2346
- # Integrated heating systems
2347
- if hpxml_hvac.is_a?(HPXML::CoolingSystem) && hpxml_hvac.has_integrated_heating
2348
- hvac.HasIntegratedHeating = true
2349
- hvac.HeatingLoadFraction = hpxml_hvac.integrated_heating_system_fraction_heat_load_served
2350
- hvac.FixedHeatingCapacity = hpxml_hvac.integrated_heating_system_capacity
2351
- end
2352
-
2353
- # HP Switchover Temperature
2354
- if hpxml_hvac.is_a?(HPXML::HeatPump)
2355
- hvac.SwitchoverTemperature = hpxml_hvac.backup_heating_switchover_temp
2356
- end
2357
-
2358
- # Number of speeds
2359
- if hpxml_hvac.is_a?(HPXML::CoolingSystem) || hpxml_hvac.is_a?(HPXML::HeatPump)
2360
- # Cooling
2361
- if hpxml_hvac_ap.respond_to? :num_speeds
2362
- num_speeds = hpxml_hvac_ap.num_speeds
2363
- end
2364
- num_speeds = 1 if num_speeds.nil?
2365
- hvac.NumSpeedsCooling = num_speeds
2366
- if hvac.NumSpeedsCooling == 2
2367
- hvac.OverSizeLimit = 1.2
2368
- elsif hvac.NumSpeedsCooling > 2
2369
- hvac.OverSizeLimit = 1.3
2370
- end
2371
- end
2372
- if hpxml_hvac.is_a?(HPXML::HeatingSystem) || hpxml_hvac.is_a?(HPXML::HeatPump)
2373
- # Heating
2374
- if hpxml_hvac_ap.respond_to? :num_speeds
2375
- num_speeds = hpxml_hvac_ap.num_speeds
2376
- end
2377
- num_speeds = 1 if num_speeds.nil?
2378
- hvac.NumSpeedsHeating = num_speeds
2379
- end
2380
-
2381
- # HVAC installation quality
2382
- if hpxml_hvac.respond_to? :charge_defect_ratio
2383
- if [HPXML::HVACTypeCentralAirConditioner,
2384
- HPXML::HVACTypeMiniSplitAirConditioner,
2385
- HPXML::HVACTypeHeatPumpAirToAir,
2386
- HPXML::HVACTypeHeatPumpMiniSplit,
2387
- HPXML::HVACTypeHeatPumpGroundToAir].include? hvac.CoolType
2388
- hvac.ChargeDefectRatio = hpxml_hvac.charge_defect_ratio
2389
- end
2390
- end
2391
- if hpxml_hvac.respond_to? :airflow_defect_ratio
2392
- # Cooling
2393
- if [HPXML::HVACTypeCentralAirConditioner,
2394
- HPXML::HVACTypeMiniSplitAirConditioner,
2395
- HPXML::HVACTypeHeatPumpAirToAir,
2396
- HPXML::HVACTypeHeatPumpMiniSplit,
2397
- HPXML::HVACTypeHeatPumpGroundToAir].include? hvac.CoolType
2398
- if not hpxml_hvac.distribution_system.nil? # Exclude ductless
2399
- hvac.AirflowDefectRatioCooling = hpxml_hvac.airflow_defect_ratio
2400
- end
2401
- end
2402
- # Heating
2403
- if [HPXML::HVACTypeFurnace,
2404
- HPXML::HVACTypeHeatPumpAirToAir,
2405
- HPXML::HVACTypeHeatPumpMiniSplit,
2406
- HPXML::HVACTypeHeatPumpGroundToAir].include? hvac.HeatType
2407
- if not hpxml_hvac.distribution_system.nil? # Exclude ductless
2408
- hvac.AirflowDefectRatioHeating = hpxml_hvac.airflow_defect_ratio
2409
- end
2410
- end
2411
- end
2412
-
2413
- # Rated airflow rates
2414
- if hpxml_hvac_ap.respond_to? :cool_rated_cfm_per_ton
2415
- hvac.RatedCFMperTonCooling = hpxml_hvac_ap.cool_rated_cfm_per_ton
2416
- end
2417
- if hpxml_hvac_ap.respond_to? :heat_rated_cfm_per_ton
2418
- hvac.RatedCFMperTonHeating = hpxml_hvac_ap.heat_rated_cfm_per_ton
2419
- end
2420
-
2421
- # Capacity ratios
2422
- if hpxml_hvac_ap.respond_to? :cool_capacity_ratios
2423
- hvac.CapacityRatioCooling = hpxml_hvac_ap.cool_capacity_ratios
2424
- end
2425
- if hpxml_hvac_ap.respond_to? :heat_capacity_ratios
2426
- hvac.CapacityRatioHeating = hpxml_hvac_ap.heat_capacity_ratios
2427
- end
2428
-
2429
- # Sizing speed
2430
- hvac.SizingSpeed = get_sizing_speed(hvac.NumSpeedsCooling, hvac.CapacityRatioCooling)
2431
-
2432
- # Rated SHRs
2433
- if hpxml_hvac_ap.respond_to? :cool_rated_shrs_gross
2434
- hvac.SHRRated = hpxml_hvac_ap.cool_rated_shrs_gross
2435
- end
2436
-
2437
- # Performance curves
2438
- if hpxml_hvac_ap.respond_to? :cool_cap_ft_spec
2439
- hvac.COOL_CAP_FT_SPEC = hpxml_hvac_ap.cool_cap_ft_spec
2440
- end
2441
- if hpxml_hvac_ap.respond_to? :cool_sh_ft_spec
2442
- hvac.COOL_SH_FT_SPEC = hpxml_hvac_ap.cool_sh_ft_spec
2443
- end
2444
- if hpxml_hvac_ap.respond_to? :heat_cap_ft_spec
2445
- hvac.HEAT_CAP_FT_SPEC = hpxml_hvac_ap.heat_cap_ft_spec
2446
- end
2447
- if hpxml_hvac_ap.respond_to? :cool_cap_fflow_spec
2448
- hvac.COOL_CAP_FFLOW_SPEC = hpxml_hvac_ap.cool_cap_fflow_spec
2449
- end
2450
- if hpxml_hvac_ap.respond_to? :heat_cap_fflow_spec
2451
- hvac.HEAT_CAP_FFLOW_SPEC = hpxml_hvac_ap.heat_cap_fflow_spec
2452
- end
2453
- if hpxml_hvac_ap.respond_to? :cool_cap_curve_spec
2454
- hvac.COOL_CAP_CURVE_SPEC = hpxml_hvac_ap.cool_cap_curve_spec
2455
- end
2456
- if hpxml_hvac_ap.respond_to? :cool_sh_curve_spec
2457
- hvac.COOL_SH_CURVE_SPEC = hpxml_hvac_ap.cool_sh_curve_spec
2458
- end
2459
- if hpxml_hvac_ap.respond_to? :heat_cap_curve_spec
2460
- hvac.HEAT_CAP_CURVE_SPEC = hpxml_hvac_ap.heat_cap_curve_spec
2461
- end
2290
+ cfms = { HPXML::DuctTypeSupply => 0.0, HPXML::DuctTypeReturn => 0.0 }
2462
2291
 
2463
- # WLHP
2464
- if hpxml_hvac.respond_to? :heating_efficiency_cop
2465
- hvac.HeatingCOP = hpxml_hvac.heating_efficiency_cop
2466
- end
2292
+ distribution_system.duct_leakage_measurements.each do |m|
2293
+ next if m.duct_leakage_total_or_to_outside != HPXML::DuctLeakageToOutside
2294
+ next unless [HPXML::DuctTypeSupply, HPXML::DuctTypeReturn].include? m.duct_type
2467
2295
 
2468
- # GSHP
2469
- if hpxml_hvac_ap.respond_to? :u_tube_spacing_type
2470
- hvac.GSHP_SpacingType = hpxml_hvac_ap.u_tube_spacing_type
2471
- end
2472
- if hpxml_hvac_ap.respond_to? :cool_rated_eirs
2473
- hvac.CoolingEIR = hpxml_hvac_ap.cool_rated_eirs[0]
2296
+ if m.duct_leakage_units == HPXML::UnitsPercent
2297
+ cfms[m.duct_type] += m.duct_leakage_value * system_cfm
2298
+ elsif m.duct_leakage_units == HPXML::UnitsCFM25
2299
+ cfms[m.duct_type] += m.duct_leakage_value
2300
+ elsif m.duct_leakage_units == HPXML::UnitsCFM50
2301
+ cfms[m.duct_type] += Airflow.calc_air_leakage_at_diff_pressure(0.65, m.duct_leakage_value, 50.0, 25.0)
2474
2302
  end
2475
- if hpxml_hvac_ap.respond_to? :heat_rated_eirs
2476
- hvac.HeatingEIR = hpxml_hvac_ap.heat_rated_eirs[0]
2477
- end
2478
- if hvac.HeatType == HPXML::HVACTypeHeatPumpGroundToAir
2479
- hvac.GSHP_design_chw = hpxml_hvac_ap.design_chw
2480
- hvac.GSHP_design_delta_t = hpxml_hvac_ap.design_delta_t
2481
- hvac.GSHP_design_hw = hpxml_hvac_ap.design_hw
2482
- hvac.GSHP_bore_d = hpxml_hvac_ap.bore_diameter
2483
- hvac.GSHP_pipe_od = hpxml_hvac_ap.pipe_od
2484
- hvac.GSHP_pipe_id = hpxml_hvac_ap.pipe_id
2485
- hvac.GSHP_pipe_cond = hpxml_hvac_ap.pipe_cond
2486
- hvac.GSHP_grout_k = hpxml_hvac_ap.grout_conductivity
2487
- end
2488
-
2489
- # Evaporative cooler
2490
- if hpxml_hvac_ap.respond_to? :effectiveness
2491
- hvac.EvapCoolerEffectiveness = hpxml_hvac_ap.effectiveness
2492
- end
2493
-
2494
- # Ducts
2495
- # FUTURE: Consolidate w/ ducts code in measure.rb
2496
- hvac.Ducts = []
2497
- next unless not hpxml_hvac.distribution_system.nil?
2498
-
2499
- lto = { supply_percent: nil, supply_cfm25: nil, return_percent: nil, return_cfm25: nil }
2500
- hpxml_hvac.distribution_system.duct_leakage_measurements.each do |m|
2501
- next unless m.duct_leakage_total_or_to_outside == 'to outside'
2303
+ end
2502
2304
 
2503
- if m.duct_leakage_units == HPXML::UnitsPercent && m.duct_type == HPXML::DuctTypeSupply
2504
- lto[:supply_percent] = m.duct_leakage_value
2505
- elsif m.duct_leakage_units == HPXML::UnitsCFM25 && m.duct_type == HPXML::DuctTypeSupply
2506
- lto[:supply_cfm25] = m.duct_leakage_value
2507
- elsif m.duct_leakage_units == HPXML::UnitsCFM50 && m.duct_type == HPXML::DuctTypeSupply
2508
- lto[:supply_cfm50] = m.duct_leakage_value
2509
- elsif m.duct_leakage_units == HPXML::UnitsPercent && m.duct_type == HPXML::DuctTypeReturn
2510
- lto[:return_percent] = m.duct_leakage_value
2511
- elsif m.duct_leakage_units == HPXML::UnitsCFM25 && m.duct_type == HPXML::DuctTypeReturn
2512
- lto[:return_cfm25] = m.duct_leakage_value
2513
- elsif m.duct_leakage_units == HPXML::UnitsCFM50 && m.duct_type == HPXML::DuctTypeReturn
2514
- lto[:return_cfm50] = m.duct_leakage_value
2515
- end
2516
- end
2517
- total_uncond_supply_area = hpxml_hvac.distribution_system.total_unconditioned_duct_areas[HPXML::DuctTypeSupply]
2518
- total_uncond_return_area = hpxml_hvac.distribution_system.total_unconditioned_duct_areas[HPXML::DuctTypeReturn]
2519
- hpxml_hvac.distribution_system.ducts.each do |duct|
2520
- next if HPXML::conditioned_locations_this_unit.include? duct.duct_location
2305
+ return cfms[HPXML::DuctTypeSupply], cfms[HPXML::DuctTypeReturn]
2306
+ end
2521
2307
 
2522
- d = DuctInfo.new
2523
- d.Side = duct.duct_type
2524
- d.Location = duct.duct_location
2525
- d.Area = duct.duct_surface_area * duct.duct_surface_area_multiplier
2526
-
2527
- # Calculate R-value w/ air film
2528
- d.Rvalue = Airflow.get_duct_insulation_rvalue(duct.duct_insulation_r_value, d.Side)
2529
-
2530
- # Leakage to Outside apportioned to this duct
2531
- if d.Side == HPXML::DuctTypeSupply
2532
- d.LeakageFrac = lto[:supply_percent].to_f * d.Area / total_uncond_supply_area
2533
- d.LeakageCFM25 = lto[:supply_cfm25].to_f * d.Area / total_uncond_supply_area
2534
- d.LeakageCFM50 = lto[:supply_cfm50].to_f * d.Area / total_uncond_supply_area
2535
- elsif d.Side == HPXML::DuctTypeReturn
2536
- d.LeakageFrac = lto[:return_percent].to_f * d.Area / total_uncond_return_area
2537
- d.LeakageCFM25 = lto[:return_cfm25].to_f * d.Area / total_uncond_return_area
2538
- d.LeakageCFM50 = lto[:return_cfm50].to_f * d.Area / total_uncond_return_area
2539
- end
2540
- hvac.Ducts << d
2541
- end
2542
- # If all ducts are in conditioned space, treat leakage as going to outside
2543
- if (lto[:supply_percent].to_f + lto[:supply_cfm25].to_f + lto[:supply_cfm50].to_f) > 0 && total_uncond_supply_area == 0
2544
- d = DuctInfo.new
2545
- d.Side = HPXML::DuctTypeSupply
2546
- d.Location = HPXML::LocationOutside
2547
- d.Area = 0.0
2548
- d.Rvalue = Airflow.get_duct_insulation_rvalue(0.0, d.Side)
2549
- d.LeakageFrac = lto[:supply_percent]
2550
- d.LeakageCFM25 = lto[:supply_cfm25]
2551
- d.LeakageCFM50 = lto[:supply_cfm50]
2552
- hvac.Ducts << d
2553
- end
2554
- next unless (lto[:return_percent].to_f + lto[:return_cfm25].to_f + lto[:return_cfm50].to_f) > 0 && total_uncond_return_area == 0
2555
-
2556
- d = DuctInfo.new
2557
- d.Side = HPXML::DuctTypeReturn
2558
- d.Location = HPXML::LocationOutside
2559
- d.Area = 0.0
2560
- d.Rvalue = Airflow.get_duct_insulation_rvalue(0.0, d.Side)
2561
- d.LeakageFrac = lto[:return_percent]
2562
- d.LeakageCFM25 = lto[:return_cfm25]
2563
- d.LeakageCFM50 = lto[:return_cfm50]
2564
- hvac.Ducts << d
2565
- end
2566
-
2567
- return hvac
2568
- end
2569
-
2570
- def self.process_curve_fit(airFlowRate, capacity, temp)
2308
+ def self.process_curve_fit(airflow_rate, capacity, temp)
2571
2309
  # TODO: Get rid of this curve by using ADP/BF calculations
2572
2310
  return 0 if capacity == 0
2573
2311
 
2574
2312
  capacity_tons = UnitConversions.convert(capacity, 'Btu/hr', 'ton')
2575
- return MathTools.biquadratic(airFlowRate / capacity_tons, temp, get_shr_biquadratic)
2313
+ return MathTools.biquadratic(airflow_rate / capacity_tons, temp, get_shr_biquadratic)
2576
2314
  end
2577
2315
 
2578
2316
  def self.get_shr_biquadratic
@@ -2582,19 +2320,19 @@ class HVACSizing
2582
2320
  return [1.08464364, 0.002096954, 0, -0.005766327, 0, -0.000011147]
2583
2321
  end
2584
2322
 
2585
- def self.get_sizing_speed(num_speeds_cooling, capacity_ratios_cooling)
2586
- if num_speeds_cooling > 1
2587
- sizingSpeed = num_speeds_cooling # Default
2588
- sizingSpeed_Test = 10 # Initialize
2589
- for speed in 0..(num_speeds_cooling - 1)
2323
+ def self.get_sizing_speed(hvac_cooling_ap)
2324
+ if hvac_cooling_ap.respond_to?(:cool_capacity_ratios) && (hvac_cooling_ap.cool_capacity_ratios.size > 1)
2325
+ sizing_speed = hvac_cooling_ap.cool_capacity_ratios.size # Default
2326
+ sizing_speed_delta = 10 # Initialize
2327
+ for speed in 0..(hvac_cooling_ap.cool_capacity_ratios.size - 1)
2590
2328
  # Select curves for sizing using the speed with the capacity ratio closest to 1
2591
- temp = (capacity_ratios_cooling[speed] - 1).abs
2592
- if temp <= sizingSpeed_Test
2593
- sizingSpeed = speed
2594
- sizingSpeed_Test = temp
2329
+ delta = (hvac_cooling_ap.cool_capacity_ratios[speed] - 1).abs
2330
+ if delta <= sizing_speed_delta
2331
+ sizing_speed = speed
2332
+ sizing_speed_delta = delta
2595
2333
  end
2596
2334
  end
2597
- return sizingSpeed
2335
+ return sizing_speed
2598
2336
  end
2599
2337
  return 0
2600
2338
  end
@@ -2638,10 +2376,10 @@ class HVACSizing
2638
2376
  if [HPXML::LocationCrawlspaceVented, HPXML::LocationAtticVented].include? location
2639
2377
  # Vented space
2640
2378
  if location == HPXML::LocationCrawlspaceVented
2641
- vented_crawl = @hpxml.foundations.select { |f| f.foundation_type == HPXML::FoundationTypeCrawlspaceVented }[0]
2379
+ vented_crawl = @hpxml.foundations.find { |f| f.foundation_type == HPXML::FoundationTypeCrawlspaceVented }
2642
2380
  sla = vented_crawl.vented_crawlspace_sla
2643
2381
  else
2644
- vented_attic = @hpxml.attics.select { |f| f.attic_type == HPXML::AtticTypeVented }[0]
2382
+ vented_attic = @hpxml.attics.find { |f| f.attic_type == HPXML::AtticTypeVented }
2645
2383
  if not vented_attic.vented_attic_sla.nil?
2646
2384
  sla = vented_attic.vented_attic_sla
2647
2385
  else
@@ -2915,32 +2653,32 @@ class HVACSizing
2915
2653
  return [1.21005458, -0.00664200, 0.00000000, 0.00348246, 0.00000000, 0.00000000]
2916
2654
  end
2917
2655
 
2918
- def self.gshp_hx_pipe_rvalue(hvac)
2656
+ def self.gshp_hx_pipe_rvalue(hvac_cooling_ap)
2919
2657
  # Thermal Resistance of Pipe
2920
- return Math.log(hvac.GSHP_pipe_od / hvac.GSHP_pipe_id) / 2.0 / Math::PI / hvac.GSHP_pipe_cond
2658
+ return Math.log(hvac_cooling_ap.pipe_od / hvac_cooling_ap.pipe_id) / 2.0 / Math::PI / hvac_cooling_ap.pipe_cond
2921
2659
  end
2922
2660
 
2923
- def self.gshp_hxbore_ft_per_ton(weather, hvac, bore_spacing, pipe_r_value)
2924
- if hvac.GSHP_SpacingType == 'b'
2661
+ def self.gshp_hxbore_ft_per_ton(weather, hvac_cooling_ap, bore_spacing, pipe_r_value)
2662
+ if hvac_cooling_ap.u_tube_spacing_type == 'b'
2925
2663
  beta_0 = 17.4427
2926
2664
  beta_1 = -0.6052
2927
- elsif hvac.GSHP_SpacingType == 'c'
2665
+ elsif hvac_cooling_ap.u_tube_spacing_type == 'c'
2928
2666
  beta_0 = 21.9059
2929
2667
  beta_1 = -0.3796
2930
- elsif hvac.GSHP_SpacingType == 'as'
2668
+ elsif hvac_cooling_ap.u_tube_spacing_type == 'as'
2931
2669
  beta_0 = 20.1004
2932
2670
  beta_1 = -0.94467
2933
2671
  end
2934
2672
 
2935
- r_value_ground = Math.log(bore_spacing / hvac.GSHP_bore_d * 12.0) / 2.0 / Math::PI / @hpxml.site.ground_conductivity
2936
- r_value_grout = 1.0 / hvac.GSHP_grout_k / beta_0 / ((hvac.GSHP_bore_d / hvac.GSHP_pipe_od)**beta_1)
2673
+ r_value_ground = Math.log(bore_spacing / hvac_cooling_ap.bore_diameter * 12.0) / 2.0 / Math::PI / @hpxml.site.ground_conductivity
2674
+ r_value_grout = 1.0 / hvac_cooling_ap.grout_conductivity / beta_0 / ((hvac_cooling_ap.bore_diameter / hvac_cooling_ap.pipe_od)**beta_1)
2937
2675
  r_value_bore = r_value_grout + pipe_r_value / 2.0 # Note: Convection resistance is negligible when calculated against Glhepro (Jeffrey D. Spitler, 2000)
2938
2676
 
2939
2677
  rtf_DesignMon_Heat = [0.25, (71.0 - weather.data.MonthlyAvgDrybulbs[0]) / @htd].max
2940
2678
  rtf_DesignMon_Cool = [0.25, (weather.data.MonthlyAvgDrybulbs[6] - 76.0) / @ctd].max
2941
2679
 
2942
- nom_length_heat = (1.0 - hvac.HeatingEIR) * (r_value_bore + r_value_ground * rtf_DesignMon_Heat) / (weather.data.AnnualAvgDrybulb - (2.0 * hvac.GSHP_design_hw - hvac.GSHP_design_delta_t) / 2.0) * UnitConversions.convert(1.0, 'ton', 'Btu/hr')
2943
- nom_length_cool = (1.0 + hvac.CoolingEIR) * (r_value_bore + r_value_ground * rtf_DesignMon_Cool) / ((2.0 * hvac.GSHP_design_chw + hvac.GSHP_design_delta_t) / 2.0 - weather.data.AnnualAvgDrybulb) * UnitConversions.convert(1.0, 'ton', 'Btu/hr')
2680
+ nom_length_heat = (1.0 - hvac_cooling_ap.heat_rated_eirs[0]) * (r_value_bore + r_value_ground * rtf_DesignMon_Heat) / (weather.data.AnnualAvgDrybulb - (2.0 * hvac_cooling_ap.design_hw - hvac_cooling_ap.design_delta_t) / 2.0) * UnitConversions.convert(1.0, 'ton', 'Btu/hr')
2681
+ nom_length_cool = (1.0 + hvac_cooling_ap.cool_rated_eirs[0]) * (r_value_bore + r_value_ground * rtf_DesignMon_Cool) / ((2.0 * hvac_cooling_ap.design_chw + hvac_cooling_ap.design_delta_t) / 2.0 - weather.data.AnnualAvgDrybulb) * UnitConversions.convert(1.0, 'ton', 'Btu/hr')
2944
2682
 
2945
2683
  return nom_length_heat, nom_length_cool
2946
2684
  end
@@ -3388,6 +3126,42 @@ class HVACSizing
3388
3126
 
3389
3127
  return f_values.sum() / f_values.size
3390
3128
  end
3129
+
3130
+ def self.set_hvac_types(hvac_heating, hvac_cooling)
3131
+ if hvac_heating.nil?
3132
+ @heating_type = nil
3133
+ elsif hvac_heating.is_a? HPXML::HeatingSystem
3134
+ @heating_type = hvac_heating.heating_system_type
3135
+ else
3136
+ @heating_type = hvac_heating.heat_pump_type
3137
+ end
3138
+ if hvac_cooling.nil?
3139
+ @cooling_type = nil
3140
+ elsif hvac_cooling.is_a? HPXML::CoolingSystem
3141
+ @cooling_type = hvac_cooling.cooling_system_type
3142
+ else
3143
+ @cooling_type = hvac_cooling.heat_pump_type
3144
+ end
3145
+ end
3146
+
3147
+ def self.set_fractions_load_served(hvac_heating, hvac_cooling)
3148
+ if hvac_cooling.is_a?(HPXML::CoolingSystem) && hvac_cooling.has_integrated_heating
3149
+ @fraction_heat_load_served = hvac_cooling.integrated_heating_system_fraction_heat_load_served
3150
+ elsif hvac_heating.nil?
3151
+ @fraction_heat_load_served = 0
3152
+ elsif hvac_heating.is_a?(HPXML::HeatingSystem) && hvac_heating.is_heat_pump_backup_system
3153
+ # Use the same load fractions as the heat pump
3154
+ heat_pump = @hpxml.heat_pumps.find { |hp| hp.backup_system_idref == hvac_heating.id }
3155
+ @fraction_heat_load_served = heat_pump.fraction_heat_load_served
3156
+ else
3157
+ @fraction_heat_load_served = hvac_heating.fraction_heat_load_served
3158
+ end
3159
+ if hvac_cooling.nil?
3160
+ @fraction_cool_load_served = 0
3161
+ else
3162
+ @fraction_cool_load_served = hvac_cooling.fraction_cool_load_served
3163
+ end
3164
+ end
3391
3165
  end
3392
3166
 
3393
3167
  class DesignLoads
@@ -3395,7 +3169,7 @@ class DesignLoads
3395
3169
  end
3396
3170
  attr_accessor(:Cool_Sens, :Cool_Lat, :Cool_Tot, :Heat_Tot, :Heat_Ducts, :Cool_Ducts_Sens, :Cool_Ducts_Lat,
3397
3171
  :Cool_Windows, :Cool_Skylights, :Cool_Doors, :Cool_Walls, :Cool_Roofs, :Cool_Floors,
3398
- :Cool_Ceilings, :Cool_Infil_Sens, :Cool_Infil_Lat, :Cool_IntGains_Sens, :Cool_IntGains_Lat,
3172
+ :Cool_Ceilings, :Cool_InfilVent_Sens, :Cool_InfilVent_Lat, :Cool_IntGains_Sens, :Cool_IntGains_Lat,
3399
3173
  :Heat_Windows, :Heat_Skylights, :Heat_Doors, :Heat_Walls, :Heat_Roofs, :Heat_Floors,
3400
3174
  :Heat_Slabs, :Heat_Ceilings, :Heat_InfilVent)
3401
3175
  end
@@ -3410,46 +3184,6 @@ class HVACSizingValues
3410
3184
  :GSHP_Loop_flow, :GSHP_Bore_Holes, :GSHP_Bore_Depth, :GSHP_G_Functions)
3411
3185
  end
3412
3186
 
3413
- class HVACInfo
3414
- # Model info for HVAC
3415
- def initialize
3416
- self.NumSpeedsCooling = 0
3417
- self.NumSpeedsHeating = 0
3418
- self.HeatingLoadFraction = 0.0
3419
- self.CoolingLoadFraction = 0.0
3420
- self.CapacityRatioCooling = [1.0]
3421
- self.CapacityRatioHeating = [1.0]
3422
- self.OverSizeLimit = 1.15
3423
- self.OverSizeDelta = 15000.0
3424
- self.Ducts = []
3425
- self.AirflowDefectRatioCooling = 0.0
3426
- self.AirflowDefectRatioHeating = 0.0
3427
- end
3428
-
3429
- attr_accessor(:HeatType, :CoolType, :Ducts, :NumSpeedsCooling, :NumSpeedsHeating,
3430
- :FixedCoolingCapacity, :FixedHeatingCapacity, :FixedSuppHeatingCapacity,
3431
- :AirflowDefectRatioCooling, :AirflowDefectRatioHeating,
3432
- :RatedCFMperTonCooling, :RatedCFMperTonHeating, :ChargeDefectRatio,
3433
- :COOL_CAP_FT_SPEC, :HEAT_CAP_FT_SPEC, :COOL_SH_FT_SPEC,
3434
- :COOL_CAP_FFLOW_SPEC, :HEAT_CAP_FFLOW_SPEC,
3435
- :COOL_CAP_CURVE_SPEC, :COOL_SH_CURVE_SPEC, :HEAT_CAP_CURVE_SPEC,
3436
- :SHRRated, :CapacityRatioCooling, :CapacityRatioHeating,
3437
- :OverSizeLimit, :OverSizeDelta, :hvac_system,
3438
- :HeatingEIR, :CoolingEIR, :SizingSpeed, :HeatingCOP,
3439
- :GSHP_SpacingType, :EvapCoolerEffectiveness, :SwitchoverTemperature, :LeavingAirTemp,
3440
- :HeatingLoadFraction, :CoolingLoadFraction, :SupplyAirTemp, :BackupSupplyAirTemp,
3441
- :GSHP_design_chw, :GSHP_design_delta_t, :GSHP_design_hw, :GSHP_bore_d,
3442
- :GSHP_pipe_od, :GSHP_pipe_id, :GSHP_pipe_cond, :GSHP_grout_k, :HasIntegratedHeating)
3443
- end
3444
-
3445
- class DuctInfo
3446
- # Model info for a duct
3447
- # FUTURE: Remove class; use either airflow.rb Duct class or HPXML Ducts class directly
3448
- def initial
3449
- end
3450
- attr_accessor(:LeakageFrac, :LeakageCFM25, :LeakageCFM50, :Area, :Rvalue, :Location, :Side)
3451
- end
3452
-
3453
3187
  class Numeric
3454
3188
  def deg2rad
3455
3189
  self * Math::PI / 180