Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for autosizing when detailed performance capacity fractions are provided #1862

Merged
merged 8 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ __Bugfixes__
- Fixes possible error for a combi boiler system.
- Fixes error if modeling a ground-to-air heat pump with a separate backup heating system.
- Fixes default CFIS fan power during ventilation only mode.
- Fixes a bug that potentially oversizes heat pumps when detailed performance capacity fractions are provided.

## OpenStudio-HPXML v1.8.1

Expand Down
8 changes: 4 additions & 4 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>5c60d469-73ac-415f-b37f-8b8401c8d5f3</version_id>
<version_modified>2024-10-16T17:32:33Z</version_modified>
<version_id>82d3603a-8c61-459a-b2fa-95dc6f600bda</version_id>
<version_modified>2024-10-22T16:40:43Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -393,7 +393,7 @@
<filename>hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>BEF6DAA5</checksum>
<checksum>CD77F9C7</checksum>
</file>
<file>
<filename>internal_gains.rb</filename>
Expand Down Expand Up @@ -693,7 +693,7 @@
<filename>test_hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>822ACA5D</checksum>
<checksum>C88CFFFC</checksum>
</file>
<file>
<filename>test_lighting.rb</filename>
Expand Down
7 changes: 5 additions & 2 deletions HPXMLtoOpenStudio/resources/hvac_sizing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2530,11 +2530,14 @@ def self.adjust_outdoor_condition_var_speed(outdoor_temp, hvac_sys, mode)
max_rated_dp = detailed_performance_data.find { |dp| dp.outdoor_temperature == rated_odb && dp.capacity_description == HPXML::CapacityDescriptionMaximum }
if max_rated_dp.capacity.nil?
property = :capacity_fraction_of_nominal
# Should use nominal instead of maximum
capacity_nominal = 1.0
else
property = :capacity
# Should use nominal instead of maximum
capacity_nominal = (mode == :clg) ? hvac_sys.cooling_capacity : hvac_sys.heating_capacity
end
capacity_max = detailed_performance_data.find { |dp| dp.outdoor_temperature == rated_odb && dp.capacity_description == HPXML::CapacityDescriptionMaximum }.send(property)
odb_adj = HVAC.interpolate_to_odb_table_point(detailed_performance_data, HPXML::CapacityDescriptionMaximum, outdoor_temp, property) / capacity_max
odb_adj = HVAC.interpolate_to_odb_table_point(detailed_performance_data, HPXML::CapacityDescriptionMaximum, outdoor_temp, property) / capacity_nominal
end
return odb_adj
end
Expand Down
30 changes: 30 additions & 0 deletions HPXMLtoOpenStudio/tests/test_hvac_sizing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ def test_autosizing_factors
htg_cap_orig = hpxml_bldg.heat_pumps[0].heating_capacity
clg_cap_orig = hpxml_bldg.heat_pumps[0].cooling_capacity
backup_htg_cap_orig = hpxml_bldg.heat_pumps[0].backup_heating_capacity

# apply autosizing factor
hpxml, hpxml_bldg = _create_hpxml('base-hvac-air-to-air-heat-pump-var-speed-detailed-performance-autosize.xml')
hpxml_bldg.heat_pumps[0].backup_heating_capacity = nil
Expand Down Expand Up @@ -1345,6 +1346,35 @@ def test_autosizing_limits
end
end

def test_detailed_performance_autosizing
args_hash = {}
args_hash['hpxml_path'] = File.absolute_path(@tmp_hpxml_path)

# Test heat pump w/ detailed performance
hpxml, hpxml_bldg = _create_hpxml('base-hvac-air-to-air-heat-pump-var-speed-detailed-performance-autosize.xml')
hpxml_bldg.header.heat_pump_sizing_methodology = HPXML::HeatPumpSizingMaxLoad
hpxml_bldg.heat_pumps[0].backup_heating_capacity = nil
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)
htg_cap_orig = hpxml_bldg.heat_pumps[0].heating_capacity
clg_cap_orig = hpxml_bldg.heat_pumps[0].cooling_capacity
backup_htg_cap_orig = hpxml_bldg.heat_pumps[0].backup_heating_capacity

# Test heat pump w/ detailed performance when maximum fractions are over 1.0 at rated temperature
hpxml, hpxml_bldg = _create_hpxml('base-hvac-air-to-air-heat-pump-var-speed-detailed-performance-autosize.xml')
hpxml_bldg.header.heat_pump_sizing_methodology = HPXML::HeatPumpSizingMaxLoad
hpxml_bldg.heat_pumps[0].backup_heating_capacity = nil
hpxml_bldg.heat_pumps[0].heating_capacity = nil
hpxml_bldg.heat_pumps[0].cooling_capacity = nil
hpxml_bldg.heat_pumps[0].heating_detailed_performance_data.find { |dp| dp.outdoor_temperature == HVAC::AirSourceHeatRatedODB && dp.capacity_description == HPXML::CapacityDescriptionMaximum }.capacity_fraction_of_nominal = 1.2
hpxml_bldg.heat_pumps[0].cooling_detailed_performance_data.find { |dp| dp.outdoor_temperature == HVAC::AirSourceCoolRatedODB && dp.capacity_description == HPXML::CapacityDescriptionMaximum }.capacity_fraction_of_nominal = 1.1
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)
assert_equal(hpxml_bldg.heat_pumps[0].heating_capacity, htg_cap_orig)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit test here verifies that the autosized rated capacity is the same as original, regardless of maximum speed capacity fractions of nominal at rated temperatures. The fractions will be applied later when pop up the capacities in detailed performance data points.

assert_equal(hpxml_bldg.heat_pumps[0].cooling_capacity, clg_cap_orig)
assert_equal(hpxml_bldg.heat_pumps[0].backup_heating_capacity, backup_htg_cap_orig)
end

def test_manual_j_detailed_sizing_inputs
# Run base
args_hash = {}
Expand Down