Skip to content

Commit

Permalink
More HVAC tests, new dryer and mechvent tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Dec 4, 2024
1 parent 4c381f9 commit 5ad9701
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 24 deletions.
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>eff4aee6-4410-475b-b510-4d241b54f33b</version_id>
<version_modified>2024-12-04T04:55:16Z</version_modified>
<version_id>7bbe1832-37ed-4d7e-a6a2-936db28293cc</version_id>
<version_modified>2024-12-04T19:18:14Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -336,7 +336,7 @@
<filename>defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>36D8BB2E</checksum>
<checksum>66567476</checksum>
</file>
<file>
<filename>electric_panel.rb</filename>
Expand Down Expand Up @@ -684,7 +684,7 @@
<filename>test_electric_panel.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>7F389ECE</checksum>
<checksum>507617B7</checksum>
</file>
<file>
<filename>test_enclosure.rb</filename>
Expand Down
9 changes: 2 additions & 7 deletions HPXMLtoOpenStudio/resources/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5919,12 +5919,12 @@ def self.get_panel_load_power_breaker_spaces_default_values(hpxml_bldg, panel_lo

if heat_pump.backup_type == HPXML::HeatPumpBackupTypeIntegrated

if heat_pump.simultaneous_backup # sum
if heat_pump.simultaneous_backup # sum; backup > compressor
watts += HVAC.get_dx_heating_coil_power_watts_from_capacity(UnitConversions.convert(heat_pump.heating_capacity, 'btu/hr', 'kbtu/hr'))
if heat_pump.backup_heating_fuel == HPXML::FuelTypeElectricity
watts += UnitConversions.convert(HVAC.get_heating_input_capacity(heat_pump.backup_heating_capacity, heat_pump.backup_heating_efficiency_afue, heat_pump.backup_heating_efficiency_percent), 'btu/hr', 'w')
end
else # max
else # max; switchover
if heat_pump.backup_heating_fuel == HPXML::FuelTypeElectricity
watts += [HVAC.get_dx_heating_coil_power_watts_from_capacity(UnitConversions.convert(heat_pump.heating_capacity, 'btu/hr', 'kbtu/hr')),
UnitConversions.convert(HVAC.get_heating_input_capacity(heat_pump.backup_heating_capacity, heat_pump.backup_heating_efficiency_afue, heat_pump.backup_heating_efficiency_percent), 'btu/hr', 'w')].max
Expand Down Expand Up @@ -6045,11 +6045,6 @@ def self.get_panel_load_power_breaker_spaces_default_values(hpxml_bldg, panel_lo
next if !system_ids.include?(ventilation_fan.id)
next if ventilation_fan.is_shared_system

# if ventilation_fan.fan_location == HPXML::LocationKitchen
# watts += 90 * ventilation_fan.count
# elsif ventilation_fan.fan_location == HPXML::LocationBath
# watts += 15 * ventilation_fan.count
# end
if [HPXML::LocationKitchen, HPXML::LocationBath].include?(ventilation_fan.fan_location)
watts += ventilation_fan.count * ventilation_fan.fan_power
elsif not ventilation_fan.fan_power.nil?
Expand Down
101 changes: 88 additions & 13 deletions HPXMLtoOpenStudio/tests/test_electric_panel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,29 @@ def test_hvac_configurations
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 561 + 5801 + 10551, 6)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 600 + 5801, 0)

test_name = 'ASHP w/integrated gas backup'
test_name = 'ASHP w/integrated gas backup switchover'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-dual-fuel-air-to-air-heat-pump-1-speed.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 561 + 5801, 3)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 600 + 5801, 0)

# ASHP w/integrated switchover
test_name = 'ASHP w/separate gas backup'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-air-to-air-heat-pump-var-speed-backup-boiler.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 210 + 3096 + 96, 3)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 225 + 3096, 0)

# ASHP w/separate backup
test_name = 'ASHP w/separate gas backup switchover'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-air-to-air-heat-pump-var-speed-backup-boiler-switchover-temperature.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

# ASHP w/separate switchover
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 210 + 3096 + 96, 3)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 225 + 3096, 0)

test_name = 'Ducted MSHP w/out backup'
hpxml, hpxml_bldg = _create_hpxml('base-hvac-mini-split-heat-pump-ducted.xml', test_name)
Expand All @@ -279,13 +289,21 @@ def test_hvac_configurations
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 202 + 5801, 2)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 216 + 5801, 0)

# Ducted MSHP w/integrated backup
test_name = 'Ducted MSHP w/integrated electric backup'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-mini-split-heat-pump-ducted.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

# Ducted MSHP w/integrated switchover
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 202 + 5801 + 10551, 6)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 216 + 5801, 0)

# Ducted MSHP w/separate backup
test_name = 'Ducted MSHP w/integrated gas backup switchover'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-dual-fuel-mini-split-heat-pump-ducted.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

# Ducted MSHP w/separate switchover
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 202 + 5801, 3)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 216 + 5801, 0)

test_name = 'Ductless MSHP w/out backup'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-mini-split-heat-pump-ductless.xml', test_name)
Expand All @@ -295,16 +313,24 @@ def test_hvac_configurations
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 84 + 5801, 2)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 84 + 5801, 0)

# Ductless MSHP w/integrated backup
test_name = 'Ductless MSHP w/separate electric backup'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-mini-split-heat-pump-ductless-backup-baseboard.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

# Ductless MSHP w/integrated switchover
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 42 + 3096 + 17584, 6)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 42 + 3096, 0)

# Ductless MSHP w/separate backup
test_name = 'Ductless MSHP w/separate gas backup'
hpxml, _hpxml_bldg = _create_hpxml('base-hvac-mini-split-heat-pump-ductless-backup-furnace.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

# Ductless MSHP w/separate switchover
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 42 + 3096 + 655, 3)
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 42 + 3096, 0)
end

def test_wh_configurations
def test_water_heater_configurations
args_hash = { 'hpxml_path' => File.absolute_path(@tmp_hpxml_path),
'skip_validation' => true }

Expand Down Expand Up @@ -337,6 +363,55 @@ def test_wh_configurations
_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeWaterHeater, 1064, 2)
end

def test_clothes_dryer_configurations
args_hash = { 'hpxml_path' => File.absolute_path(@tmp_hpxml_path),
'skip_validation' => true }

test_name = 'Vented clothes dryer'
hpxml, _hpxml_bldg = _create_hpxml('base.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeClothesDryer, 5760, 2)

test_name = 'HP clothes dryer'
hpxml, _hpxml_bldg = _create_hpxml('base-appliances-modified.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeClothesDryer, 860, 2)

test_name = '120v HP clothes dryer'
hpxml, hpxml_bldg = _create_hpxml('base-appliances-modified.xml', test_name)
panel_loads = hpxml_bldg.electric_panels[0].panel_loads
panel_loads.add(type: HPXML::ElectricPanelLoadTypeClothesDryer,
voltage: HPXML::ElectricPanelVoltage120,
system_idrefs: [hpxml_bldg.clothes_dryers[0].id])
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeClothesDryer, 996, 1)
end

def test_ventilation_fans_configurations
args_hash = { 'hpxml_path' => File.absolute_path(@tmp_hpxml_path),
'skip_validation' => true }

test_name = 'Kitchen and bath fans'
hpxml, _hpxml_bldg = _create_hpxml('base-mechvent-bath-kitchen-fans.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeMechVent, 60, 1)

test_name = 'Exhaust fan'
hpxml, _hpxml_bldg = _create_hpxml('base-mechvent-exhaust.xml', test_name)
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)

_test_panel_load_power_and_breaker_spaces(hpxml_bldg, HPXML::ElectricPanelLoadTypeMechVent, 30, 1)
end

def _test_panel_load_power_and_breaker_spaces(hpxml_bldg, type, power, breaker_spaces)
panel_loads = hpxml_bldg.electric_panels[0].panel_loads
pl = panel_loads.select { |pl| pl.type == type }
Expand Down

0 comments on commit 5ad9701

Please sign in to comment.