Skip to content

Commit

Permalink
Add defaults for lighting, kitchen, laundry load types.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Oct 11, 2024
1 parent 26d35ee commit db2c775
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 39 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>234433de-8f4b-4cf9-94bf-957f8acc1386</version_id>
<version_modified>2024-10-11T17:53:59Z</version_modified>
<version_id>08fe701b-5f29-4fca-8d76-aad134f99def</version_id>
<version_modified>2024-10-11T19:11:18Z</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>565B79FD</checksum>
<checksum>DAEDA793</checksum>
</file>
<file>
<filename>energyplus.rb</filename>
Expand Down Expand Up @@ -357,7 +357,7 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>1089D1C3</checksum>
<checksum>16703773</checksum>
</file>
<file>
<filename>hpxml_schema/HPXML.xsd</filename>
Expand Down Expand Up @@ -663,7 +663,7 @@
<filename>test_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>9FBD7BE5</checksum>
<checksum>389B9BDC</checksum>
</file>
<file>
<filename>test_enclosure.rb</filename>
Expand Down
68 changes: 41 additions & 27 deletions HPXMLtoOpenStudio/resources/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3127,37 +3127,49 @@ def self.apply_electric_panels(hpxml_bldg, unit_num)
electric_panel.max_current_rating_isdefaulted = true
end

if electric_panel.panel_loads.empty?
panel_loads = electric_panel.panel_loads
if panel_loads.find { |pl| pl.type == HPXML::ElectricPanelLoadTypeHeating }.nil?
electric_panel.panel_loads.add(type: HPXML::ElectricPanelLoadTypeHeating)
end
if panel_loads.find { |pl| pl.type == HPXML::ElectricPanelLoadTypeCooling }.nil?
electric_panel.panel_loads.add(type: HPXML::ElectricPanelLoadTypeCooling)
end
if panel_loads.find { |pl| pl.type == HPXML::ElectricPanelLoadTypeWaterHeater }.nil?
electric_panel.panel_loads.add(type: HPXML::ElectricPanelLoadTypeWaterHeater)
end
if panel_loads.find { |pl| pl.type == HPXML::ElectricPanelLoadTypeClothesDryer }.nil?
electric_panel.panel_loads.add(type: HPXML::ElectricPanelLoadTypeClothesDryer)
end
electric_panel.panel_loads.add(type: HPXML::ElectricPanelLoadTypeLighting)
electric_panel.panel_loads.add(type: HPXML::ElectricPanelLoadTypeKitchen)
electric_panel.panel_loads.add(type: HPXML::ElectricPanelLoadTypeLaundry)

electric_panel.panel_loads.each do |panel_load|
if panel_load.type == HPXML::ElectricPanelLoadTypeHeating
if panel_load.watts.nil?
panel_load.watts = default_values[:heating_watts]
panel_load.watts_isdefaulted = true
end
elsif panel_load.type == HPXML::ElectricPanelLoadTypeCooling
if panel_load.watts.nil?
panel_load.watts = default_values[:cooling_watts]
panel_load.watts_isdefaulted = true
end
elsif panel_load.type == HPXML::ElectricPanelLoadTypeWaterHeater
if panel_load.watts.nil?
panel_load.watts = default_values[:water_heater_watts]
panel_load.watts_isdefaulted = true
end
elsif panel_load.type == HPXML::ElectricPanelLoadTypeClothesDryer
if panel_load.watts.nil?
panel_load.watts = default_values[:clothes_dryer_watts]
panel_load.watts_isdefaulted = true
if panel_load.watts.nil?
if panel_load.type == HPXML::ElectricPanelLoadTypeHeating
watts = default_values[:heating_watts]
elsif panel_load.type == HPXML::ElectricPanelLoadTypeCooling
watts = default_values[:cooling_watts]
elsif panel_load.type == HPXML::ElectricPanelLoadTypeWaterHeater
watts = default_values[:water_heater_watts]
elsif panel_load.type == HPXML::ElectricPanelLoadTypeClothesDryer
watts = default_values[:clothes_dryer_watts]
elsif panel_load.type == HPXML::ElectricPanelLoadTypeLighting
watts = default_values[:lighting_watts]
elsif panel_load.type == HPXML::ElectricPanelLoadTypeKitchen
watts = default_values[:kitchen_watts]
elsif panel_load.type == HPXML::ElectricPanelLoadTypeLaundry
watts = default_values[:laundry_watts]
end
panel_load.watts = watts
panel_load.watts_isdefaulted = true
end
if panel_load.voltage.nil?
panel_load.voltage = default_values[:load_voltage]
if panel_load.watts < default_values[:load_voltage_120_max]
panel_load.voltage = HPXML::ElectricPanelVoltage120
else
panel_load.voltage = HPXML::ElectricPanelVoltage240
end
panel_load.voltage_isdefaulted = true
end
if panel_load.addition.nil?
Expand Down Expand Up @@ -5595,16 +5607,15 @@ def self.get_electric_panel_values(hpxml_bldg)
max_cooling_capacity = 0.0

(hpxml_bldg.heating_systems + hpxml_bldg.heat_pumps).each do |heating_system|
next if heating_system.heating_system_fuel != HPXML::FuelTypeElectricity
is_hp = heating_system.is_a? HPXML::HeatPump
next if !is_hp && heating_system.heating_system_fuel != HPXML::FuelTypeElectricity

max_heating_capacity = [max_heating_capacity, heating_system.heating_capacity].max
if heating_system.is_a? HPXML::HeatPump
if is_hp
max_backup_heating_capacity = [max_backup_heating_capacity, heating_system.backup_heating_capacity].max
end
end
(hpxml_bldg.cooling_systems + hpxml_bldg.heat_pumps).each do |cooling_system|
next if cooling_system.cooling_system_fuel != HPXML::FuelTypeElectricity

max_cooling_capacity = [max_cooling_capacity, cooling_system.cooling_capacity].max
end

Expand All @@ -5616,12 +5627,15 @@ def self.get_electric_panel_values(hpxml_bldg)
cooling_handler_watts = 230.0 * [0.111 * UnitConversions.convert(max_cooling_capacity, 'btu/hr', 'kbtu/hr') + 2.22, 5].max

return { panel_voltage: HPXML::ElectricPanelVoltage240,
max_current_rating: 150.0,
max_current_rating: 150.0, # A
heating_watts: heating_watts + heating_handler_watts + backup_heating_watts,
cooling_watts: cooling_watts + cooling_handler_watts,
water_heater_watts: 4500,
clothes_dryer_watts: 5760,
load_voltage: HPXML::ElectricPanelVoltage120,
lighting_watts: 3 * hpxml_bldg.building_construction.conditioned_floor_area,
kitchen_watts: 3000,
laundry_watts: 1500,
load_voltage_120_max: 2500, # W
load_addition: false }
end

Expand Down
3 changes: 3 additions & 0 deletions HPXMLtoOpenStudio/resources/hpxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ class HPXML < Object
ElectricPanelLoadTypeCooling = 'Cooling'
ElectricPanelLoadTypeWaterHeater = 'Hot Water'
ElectricPanelLoadTypeClothesDryer = 'Clothes Dryer'
ElectricPanelLoadTypeLighting = 'Lighting'
ElectricPanelLoadTypeKitchen = 'Kitchen'
ElectricPanelLoadTypeLaundry = 'Laundry'
ElectricPanelVoltage120 = '120'
ElectricPanelVoltage240 = '240'
ElectricResistanceDistributionRadiantCeiling = 'radiant ceiling'
Expand Down
12 changes: 9 additions & 3 deletions HPXMLtoOpenStudio/tests/test_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3512,6 +3512,9 @@ def test_electric_panels
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 2000, HPXML::ElectricPanelVoltage120, true)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeWaterHeater, 3000, HPXML::ElectricPanelVoltage120, true)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeClothesDryer, 4000, HPXML::ElectricPanelVoltage120, true)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeLighting, 8100, HPXML::ElectricPanelVoltage240, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeKitchen, 3000, HPXML::ElectricPanelVoltage240, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeLaundry, 1500, HPXML::ElectricPanelVoltage120, false)

# Test defaults
hpxml_bldg.electric_panels[0].voltage = nil
Expand All @@ -3525,9 +3528,12 @@ def test_electric_panels
_default_hpxml, default_hpxml_bldg = _test_measure()
_test_default_electric_panel_values(default_hpxml_bldg, HPXML::ElectricPanelVoltage240, 150.0)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeHeating, 1525.82, HPXML::ElectricPanelVoltage120, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 4981.34, HPXML::ElectricPanelVoltage120, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeWaterHeater, 4500, HPXML::ElectricPanelVoltage120, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeClothesDryer, 5760, HPXML::ElectricPanelVoltage120, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeCooling, 4981.34, HPXML::ElectricPanelVoltage240, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeWaterHeater, 4500, HPXML::ElectricPanelVoltage240, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeClothesDryer, 5760, HPXML::ElectricPanelVoltage240, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeLighting, 8100, HPXML::ElectricPanelVoltage240, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeKitchen, 3000, HPXML::ElectricPanelVoltage240, false)
_test_default_panel_load_values(default_hpxml_bldg, HPXML::ElectricPanelLoadTypeLaundry, 1500, HPXML::ElectricPanelVoltage120, false)
end

def test_batteries
Expand Down
42 changes: 38 additions & 4 deletions docs/source/workflow_inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4555,31 +4555,65 @@ A single electric panel can be entered as a ``/HPXML/Building/BuildingDetails/Sy
``SystemIdentifier`` id Yes Unique identifier
``Voltage`` string See [#]_ No 240
``MaxCurrentRating`` double No 150
``PanelLoads`` element No <none> Individual electric panel loads [#]_
``PanelLoads`` element No See [#]_ Individual electric panel loads [#]_
==================================================== ======= ========= ======================= ======== ======== ============================================

.. [#] Voltage choices are "120" or "240".
.. [#] The following if they exist:
\- Heating
\- Cooling
\- Hot Water
\- Clothes Dryer
Always the following:
\- Lighting
\- Kitchen
\- Laundry
.. [#] If PanelLoads is provided, see :ref:`panel_loads`.
.. _panel_loads:

Panel Loads
~~~~~~~~~~~

TODO entered in ``extension/PanelLoads/PanelLoad``.
Individual panel loads entered in ``extension/PanelLoads/PanelLoad``.

============================================== ======== ============== =========== ======== ========= ==========================================
Element Type Units Constraints Required Default Notes
============================================== ======== ============== =========== ======== ========= ==========================================
``Type`` string See [#]_ Yes
``Watts`` double W No autosized
``Watts`` double W No See [#]_
``Voltage`` string V See [#]_ No See [#]_
``Addition`` boolean No false
============================================== ======== ============== =========== ======== ========= ==========================================

.. [#] Type choices are "Heating", "Cooling", "Hot Water", or "Clothes Dryer".
.. [#] If Watts not provided, defaults as follows:
\- Heating: autosized
\- Cooling: autosized
\- Hot Water: 4500
\- Clothes Dryer: 5760
\- Lighting: 3 * CFA
\- Kitchen: 3000
\- Laundry: 1500
.. [#] Voltage choices are "120" or "240".
.. [#] "240" if Watts > X, otherwise "120"?
.. [#] "120" if Watts <= 2500, otherwise "240".
.. _hpxml_batteries:

Expand Down

0 comments on commit db2c775

Please sign in to comment.