Skip to content

Commit

Permalink
Merge pull request #1862 from NREL/detailed_performance_autosizing_bu…
Browse files Browse the repository at this point in the history
…gfix

Bugfix for autosizing when detailed performance capacity fractions are provided
  • Loading branch information
shorowit authored Oct 22, 2024
2 parents 9332bad + 1e4ecf4 commit 9112f44
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,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>aab4ee31-48b7-4f7a-bfc0-1d8edf16961d</version_id>
<version_modified>2024-10-22T03:59:34Z</version_modified>
<version_id>e7d819f6-fda2-4bf2-b6c3-cd1ff3adb569</version_id>
<version_modified>2024-10-22T17:43:11Z</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)
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

0 comments on commit 9112f44

Please sign in to comment.