Skip to content

Commit

Permalink
Fix error if detailed performance data provided and some capacities a…
Browse files Browse the repository at this point in the history
…re zero.
  • Loading branch information
shorowit committed Nov 14, 2023
1 parent d861ab0 commit 72c39ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
18 changes: 15 additions & 3 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>441f9a3f-8b7f-4b51-87b8-fc22b13ec262</version_id>
<version_modified>2023-11-13T22:10:19Z</version_modified>
<version_id>0b0fdd93-375d-48a7-94c7-141c1253acfc</version_id>
<version_modified>2023-11-14T04:26:24Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -222,6 +222,18 @@
<usage_type>resource</usage_type>
<checksum>63C6A1E2</checksum>
</file>
<file>
<filename>data/g_functions/README.md</filename>
<filetype>md</filetype>
<usage_type>resource</usage_type>
<checksum>3A6546AB</checksum>
</file>
<file>
<filename>data/g_functions/rectangle_5m_v1.0.json</filename>
<filetype>json</filetype>
<usage_type>resource</usage_type>
<checksum>25FFB6A8</checksum>
</file>
<file>
<filename>data/unavailable_periods.csv</filename>
<filetype>csv</filetype>
Expand Down Expand Up @@ -262,7 +274,7 @@
<filename>hpxml_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>43023BAC</checksum>
<checksum>9C9F94F7</checksum>
</file>
<file>
<filename>hpxml_schema/HPXML.xsd</filename>
Expand Down
12 changes: 6 additions & 6 deletions HPXMLtoOpenStudio/resources/hpxml_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1523,9 +1523,9 @@ def self.apply_detailed_performance_data_for_var_speed_systems(hpxml_bldg)
HVAC.set_cool_detailed_performance_data(hvac_system)
else
# override some properties based on detailed performance data
cool_rated_capacity = hvac_system.cooling_capacity
cool_max_capacity = hvac_system.cooling_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceCoolRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMaximum) }.capacity
cool_min_capacity = hvac_system.cooling_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceCoolRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMinimum) }.capacity
cool_rated_capacity = [hvac_system.cooling_capacity, 1.0].max
cool_max_capacity = [hvac_system.cooling_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceCoolRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMaximum) }.capacity, 1.0].max
cool_min_capacity = [hvac_system.cooling_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceCoolRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMinimum) }.capacity, 1.0].max
hvac_ap.cool_capacity_ratios = [cool_min_capacity / cool_rated_capacity, cool_max_capacity / cool_rated_capacity]
hvac_ap.cool_fan_speed_ratios = HVAC.calc_fan_speed_ratios(hvac_ap.cool_capacity_ratios, hvac_ap.cool_rated_cfm_per_ton, hvac_ap.cool_rated_airflow_rate)
end
Expand All @@ -1534,9 +1534,9 @@ def self.apply_detailed_performance_data_for_var_speed_systems(hpxml_bldg)
HVAC.set_heat_detailed_performance_data(hvac_system)
else
# override some properties based on detailed performance data
heat_rated_capacity = hvac_system.heating_capacity
heat_max_capacity = hvac_system.heating_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceHeatRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMaximum) }.capacity
heat_min_capacity = hvac_system.heating_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceHeatRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMinimum) }.capacity
heat_rated_capacity = [hvac_system.heating_capacity, 1.0].max
heat_max_capacity = [hvac_system.heating_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceHeatRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMaximum) }.capacity, 1.0].max
heat_min_capacity = [hvac_system.heating_detailed_performance_data.find { |dp| (dp.outdoor_temperature == HVAC::AirSourceHeatRatedODB) && (dp.capacity_description == HPXML::CapacityDescriptionMinimum) }.capacity, 1.0].max
hvac_ap.heat_capacity_ratios = [heat_min_capacity / heat_rated_capacity, heat_max_capacity / heat_rated_capacity]
hvac_ap.heat_fan_speed_ratios = HVAC.calc_fan_speed_ratios(hvac_ap.heat_capacity_ratios, hvac_ap.heat_rated_cfm_per_ton, hvac_ap.heat_rated_airflow_rate)
end
Expand Down

0 comments on commit 72c39ab

Please sign in to comment.