Skip to content

Commit

Permalink
added unit test, update Changelog.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhou601 committed Oct 22, 2024
1 parent e4fe01f commit 1d527a1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
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>c7b48e40-d833-483a-85f5-fdaf4e3abc29</version_id>
<version_modified>2024-10-17T22:04:30Z</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 @@ -327,7 +327,7 @@
<filename>defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>5DCDE4B3</checksum>
<checksum>1B4820ED</checksum>
</file>
<file>
<filename>energyplus.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
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 1d527a1

Please sign in to comment.