Skip to content

Commit

Permalink
Update defaults and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Dec 3, 2024
1 parent 169c1db commit fc556df
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
10 changes: 5 additions & 5 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>2b386dee-c591-4115-b2d5-db36120b7f26</version_id>
<version_modified>2024-12-02T21:49:03Z</version_modified>
<version_id>0cc1fe1e-2a8d-4066-a9d9-fe1ef1d8c04d</version_id>
<version_modified>2024-12-03T00:06:16Z</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>F5E7AE6E</checksum>
<checksum>4DBC9F4F</checksum>
</file>
<file>
<filename>electric_panel.rb</filename>
Expand Down Expand Up @@ -678,13 +678,13 @@
<filename>test_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>35B365FF</checksum>
<checksum>5C356AE4</checksum>
</file>
<file>
<filename>test_electric_panel.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>BF218F18</checksum>
<checksum>B6A477A9</checksum>
</file>
<file>
<filename>test_enclosure.rb</filename>
Expand Down
2 changes: 1 addition & 1 deletion HPXMLtoOpenStudio/resources/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5980,7 +5980,7 @@ def self.get_panel_load_power_breaker_spaces_default_values(hpxml_bldg, panel_lo
heating_system = cooling_system.attached_heating_system
if !heating_system.nil? &&
((heating_system.is_a? HPXML::HeatingSystem) && (heating_system.heating_system_fuel != HPXML::FuelTypeElectricity))
breaker_spaces += 3 # AHU; paired w/fuel heating system
breaker_spaces += 2 # AHU; paired w/fuel heating system
elsif voltage == 240
breaker_spaces += 2 # AHU
end
Expand Down
3 changes: 2 additions & 1 deletion HPXMLtoOpenStudio/tests/test_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3611,7 +3611,7 @@ def test_electric_panels
_default_hpxml, default_hpxml_bldg = _test_measure()
_test_default_electric_panel_values(default_hpxml_bldg, HPXML::ElectricPanelVoltage240, 150.0, 0, nil)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 428.0, HPXML::ElectricPanelVoltage120, 1, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 2794.0, HPXML::ElectricPanelVoltage240, 3, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 2794.0, HPXML::ElectricPanelVoltage240, 2, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeWaterHeater, 0, HPXML::ElectricPanelVoltage240, 0, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeClothesDryer, 0, HPXML::ElectricPanelVoltage240, 0, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeDishwasher, 1200, HPXML::ElectricPanelVoltage120, 1, false)
Expand All @@ -3624,6 +3624,7 @@ def test_electric_panels

# Test HVAC defaults
# Electric furnace + central air conditioner

hpxml_bldg.heating_systems[0].heating_system_fuel = HPXML::FuelTypeElectricity
hpxml_bldg.heating_systems[0].heating_capacity = 36000
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
Expand Down
12 changes: 6 additions & 6 deletions HPXMLtoOpenStudio/tests/test_electric_panel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def sample_files_dir
def test_upgrade
args_hash = {}
args_hash['hpxml_path'] = File.absolute_path(File.join(sample_files_dir, 'base-detailed-electric-panel.xml'))
_model, _hpxml, hpxml_bldg = _test_measure(args_hash)
_model, hpxml, hpxml_bldg = _test_measure(args_hash)
electric_panel = hpxml_bldg.electric_panels[0]

assert_in_epsilon(9762, electric_panel.capacity_total_watts[0], 0.01)
assert_in_epsilon(9762 / Float(HPXML::ElectricPanelVoltage240), electric_panel.capacity_total_amps[0], 0.01)
assert_in_epsilon(electric_panel.max_current_rating - 9762 / Float(HPXML::ElectricPanelVoltage240), electric_panel.capacity_headroom_amps[0], 0.01)
assert_equal(12, electric_panel.breaker_spaces_total)
assert_equal(7, electric_panel.breaker_spaces_occupied)
assert_equal(12 - 7, electric_panel.breaker_spaces_headroom)
assert_equal(11, electric_panel.breaker_spaces_total)
assert_equal(6, electric_panel.breaker_spaces_occupied)
assert_equal(11 - 6, electric_panel.breaker_spaces_headroom)

# Upgrade
electric_panel.headroom_breaker_spaces = nil
Expand Down Expand Up @@ -83,8 +83,8 @@ def test_upgrade
assert_in_epsilon(35851 / Float(HPXML::ElectricPanelVoltage240), electric_panel.capacity_total_amps[0], 0.01)
assert_in_epsilon(electric_panel.max_current_rating - 35851 / Float(HPXML::ElectricPanelVoltage240), electric_panel.capacity_headroom_amps[0], 0.01)
assert_equal(12, electric_panel.breaker_spaces_total)
assert_equal(14, electric_panel.breaker_spaces_occupied)
assert_equal(12 - 14, electric_panel.breaker_spaces_headroom)
assert_equal(13, electric_panel.breaker_spaces_occupied)
assert_equal(12 - 13, electric_panel.breaker_spaces_headroom)
end

def test_low_load
Expand Down

0 comments on commit fc556df

Please sign in to comment.