Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to *official* HPXML v4 schema #1490

Merged
merged 6 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
92 changes: 46 additions & 46 deletions BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2935,44 +2935,44 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
arg.setDescription('Multiplier on the pool heater energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.')
args << arg

arg = OpenStudio::Measure::OSArgument::makeBoolArgument('hot_tub_present', true)
arg.setDisplayName('Hot Tub: Present')
arg.setDescription('Whether there is a hot tub.')
arg = OpenStudio::Measure::OSArgument::makeBoolArgument('permanent_spa_present', true)
arg.setDisplayName('Permanent Spa: Present')
arg.setDescription('Whether there is a permanent spa.')
arg.setDefaultValue(false)
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('hot_tub_pump_annual_kwh', false)
arg.setDisplayName('Hot Tub: Pump Annual kWh')
arg.setDescription('The annual energy consumption of the hot tub pump. If not provided, the OS-HPXML default is used.')
arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('permanent_spa_pump_annual_kwh', false)
arg.setDisplayName('Permanent Spa: Pump Annual kWh')
arg.setDescription('The annual energy consumption of the permanent spa pump. If not provided, the OS-HPXML default is used.')
arg.setUnits('kWh/yr')
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('hot_tub_pump_usage_multiplier', false)
arg.setDisplayName('Hot Tub: Pump Usage Multiplier')
arg.setDescription('Multiplier on the hot tub pump energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.')
arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('permanent_spa_pump_usage_multiplier', false)
arg.setDisplayName('Permanent Spa: Pump Usage Multiplier')
arg.setDescription('Multiplier on the permanent spa pump energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.')
args << arg

arg = OpenStudio::Measure::OSArgument::makeChoiceArgument('hot_tub_heater_type', heater_type_choices, true)
arg.setDisplayName('Hot Tub: Heater Type')
arg.setDescription("The type of hot tub heater. Use '#{HPXML::TypeNone}' if there is no hot tub heater.")
arg = OpenStudio::Measure::OSArgument::makeChoiceArgument('permanent_spa_heater_type', heater_type_choices, true)
arg.setDisplayName('Permanent Spa: Heater Type')
arg.setDescription("The type of permanent spa heater. Use '#{HPXML::TypeNone}' if there is no permanent spa heater.")
arg.setDefaultValue(HPXML::TypeNone)
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('hot_tub_heater_annual_kwh', false)
arg.setDisplayName('Hot Tub: Heater Annual kWh')
arg.setDescription("The annual energy consumption of the #{HPXML::HeaterTypeElectricResistance} hot tub heater. If not provided, the OS-HPXML default is used.")
arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('permanent_spa_heater_annual_kwh', false)
arg.setDisplayName('Permanent Spa: Heater Annual kWh')
arg.setDescription("The annual energy consumption of the #{HPXML::HeaterTypeElectricResistance} permanent spa heater. If not provided, the OS-HPXML default is used.")
arg.setUnits('kWh/yr')
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('hot_tub_heater_annual_therm', false)
arg.setDisplayName('Hot Tub: Heater Annual therm')
arg.setDescription("The annual energy consumption of the #{HPXML::HeaterTypeGas} hot tub heater. If not provided, the OS-HPXML default is used.")
arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('permanent_spa_heater_annual_therm', false)
arg.setDisplayName('Permanent Spa: Heater Annual therm')
arg.setDescription("The annual energy consumption of the #{HPXML::HeaterTypeGas} permanent spa heater. If not provided, the OS-HPXML default is used.")
arg.setUnits('therm/yr')
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('hot_tub_heater_usage_multiplier', false)
arg.setDisplayName('Hot Tub: Heater Usage Multiplier')
arg.setDescription('Multiplier on the hot tub heater energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.')
arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('permanent_spa_heater_usage_multiplier', false)
arg.setDisplayName('Permanent Spa: Heater Usage Multiplier')
arg.setDescription('Multiplier on the permanent spa heater energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeStringArgument('emissions_scenario_names', false)
Expand Down Expand Up @@ -3427,7 +3427,7 @@ def self.create(runner, model, args, epw_path, hpxml_path)
set_misc_fuel_loads_lighting(hpxml, args)
set_misc_fuel_loads_fireplace(hpxml, args)
set_pool(hpxml, args)
set_hot_tub(hpxml, args)
set_permanent_spa(hpxml, args)
collapse_surfaces(hpxml, args)
renumber_hpxml_ids(hpxml)

Expand Down Expand Up @@ -6357,46 +6357,46 @@ def self.set_pool(hpxml, args)
heater_usage_multiplier: heater_usage_multiplier)
end

def self.set_hot_tub(hpxml, args)
return unless args[:hot_tub_present]
def self.set_permanent_spa(hpxml, args)
return unless args[:permanent_spa_present]

if args[:hot_tub_pump_annual_kwh].is_initialized
pump_kwh_per_year = args[:hot_tub_pump_annual_kwh].get
if args[:permanent_spa_pump_annual_kwh].is_initialized
pump_kwh_per_year = args[:permanent_spa_pump_annual_kwh].get
end

if args[:hot_tub_pump_usage_multiplier].is_initialized
pump_usage_multiplier = args[:hot_tub_pump_usage_multiplier].get
if args[:permanent_spa_pump_usage_multiplier].is_initialized
pump_usage_multiplier = args[:permanent_spa_pump_usage_multiplier].get
end

hot_tub_heater_type = args[:hot_tub_heater_type]
permanent_spa_heater_type = args[:permanent_spa_heater_type]

if [HPXML::HeaterTypeElectricResistance, HPXML::HeaterTypeHeatPump].include?(hot_tub_heater_type)
if args[:hot_tub_heater_annual_kwh].is_initialized
if [HPXML::HeaterTypeElectricResistance, HPXML::HeaterTypeHeatPump].include?(permanent_spa_heater_type)
if args[:permanent_spa_heater_annual_kwh].is_initialized
heater_load_units = HPXML::UnitsKwhPerYear
heater_load_value = args[:hot_tub_heater_annual_kwh].get
heater_load_value = args[:permanent_spa_heater_annual_kwh].get
end
end

if [HPXML::HeaterTypeGas].include?(hot_tub_heater_type)
if args[:hot_tub_heater_annual_therm].is_initialized
if [HPXML::HeaterTypeGas].include?(permanent_spa_heater_type)
if args[:permanent_spa_heater_annual_therm].is_initialized
heater_load_units = HPXML::UnitsThermPerYear
heater_load_value = args[:hot_tub_heater_annual_therm].get
heater_load_value = args[:permanent_spa_heater_annual_therm].get
end
end

if args[:hot_tub_heater_usage_multiplier].is_initialized
heater_usage_multiplier = args[:hot_tub_heater_usage_multiplier].get
if args[:permanent_spa_heater_usage_multiplier].is_initialized
heater_usage_multiplier = args[:permanent_spa_heater_usage_multiplier].get
end

hpxml.hot_tubs.add(id: "HotTub#{hpxml.hot_tubs.size + 1}",
type: HPXML::TypeUnknown,
pump_type: HPXML::TypeUnknown,
pump_kwh_per_year: pump_kwh_per_year,
pump_usage_multiplier: pump_usage_multiplier,
heater_type: hot_tub_heater_type,
heater_load_units: heater_load_units,
heater_load_value: heater_load_value,
heater_usage_multiplier: heater_usage_multiplier)
hpxml.permanent_spas.add(id: "PermanentSpa#{hpxml.permanent_spas.size + 1}",
type: HPXML::TypeUnknown,
pump_type: HPXML::TypeUnknown,
pump_kwh_per_year: pump_kwh_per_year,
pump_usage_multiplier: pump_usage_multiplier,
heater_type: permanent_spa_heater_type,
heater_load_units: heater_load_units,
heater_load_value: heater_load_value,
heater_usage_multiplier: heater_usage_multiplier)
end

def self.collapse_surfaces(hpxml, args)
Expand Down
50 changes: 25 additions & 25 deletions BuildResidentialHPXML/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>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>7c849980-9e94-4592-9cc8-c87acb1b90bc</version_id>
<version_modified>2023-09-14T23:51:55Z</version_modified>
<version_id>33151973-6b3c-43c9-a7d3-a0f32bdd8926</version_id>
<version_modified>2023-09-26T16:58:47Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -6284,9 +6284,9 @@
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>hot_tub_present</name>
<display_name>Hot Tub: Present</display_name>
<description>Whether there is a hot tub.</description>
<name>permanent_spa_present</name>
<display_name>Permanent Spa: Present</display_name>
<description>Whether there is a permanent spa.</description>
<type>Boolean</type>
<required>true</required>
<model_dependent>false</model_dependent>
Expand All @@ -6303,26 +6303,26 @@
</choices>
</argument>
<argument>
<name>hot_tub_pump_annual_kwh</name>
<display_name>Hot Tub: Pump Annual kWh</display_name>
<description>The annual energy consumption of the hot tub pump. If not provided, the OS-HPXML default is used.</description>
<name>permanent_spa_pump_annual_kwh</name>
<display_name>Permanent Spa: Pump Annual kWh</display_name>
<description>The annual energy consumption of the permanent spa pump. If not provided, the OS-HPXML default is used.</description>
<type>Double</type>
<units>kWh/yr</units>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>hot_tub_pump_usage_multiplier</name>
<display_name>Hot Tub: Pump Usage Multiplier</display_name>
<description>Multiplier on the hot tub pump energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.</description>
<name>permanent_spa_pump_usage_multiplier</name>
<display_name>Permanent Spa: Pump Usage Multiplier</display_name>
<description>Multiplier on the permanent spa pump energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.</description>
<type>Double</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>hot_tub_heater_type</name>
<display_name>Hot Tub: Heater Type</display_name>
<description>The type of hot tub heater. Use 'none' if there is no hot tub heater.</description>
<name>permanent_spa_heater_type</name>
<display_name>Permanent Spa: Heater Type</display_name>
<description>The type of permanent spa heater. Use 'none' if there is no permanent spa heater.</description>
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
Expand All @@ -6347,27 +6347,27 @@
</choices>
</argument>
<argument>
<name>hot_tub_heater_annual_kwh</name>
<display_name>Hot Tub: Heater Annual kWh</display_name>
<description>The annual energy consumption of the electric resistance hot tub heater. If not provided, the OS-HPXML default is used.</description>
<name>permanent_spa_heater_annual_kwh</name>
<display_name>Permanent Spa: Heater Annual kWh</display_name>
<description>The annual energy consumption of the electric resistance permanent spa heater. If not provided, the OS-HPXML default is used.</description>
<type>Double</type>
<units>kWh/yr</units>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>hot_tub_heater_annual_therm</name>
<display_name>Hot Tub: Heater Annual therm</display_name>
<description>The annual energy consumption of the gas fired hot tub heater. If not provided, the OS-HPXML default is used.</description>
<name>permanent_spa_heater_annual_therm</name>
<display_name>Permanent Spa: Heater Annual therm</display_name>
<description>The annual energy consumption of the gas fired permanent spa heater. If not provided, the OS-HPXML default is used.</description>
<type>Double</type>
<units>therm/yr</units>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>hot_tub_heater_usage_multiplier</name>
<display_name>Hot Tub: Heater Usage Multiplier</display_name>
<description>Multiplier on the hot tub heater energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.</description>
<name>permanent_spa_heater_usage_multiplier</name>
<display_name>Permanent Spa: Heater Usage Multiplier</display_name>
<description>Multiplier on the permanent spa heater energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default is used.</description>
<type>Double</type>
<required>false</required>
<model_dependent>false</model_dependent>
Expand Down Expand Up @@ -6740,7 +6740,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>9519F913</checksum>
<checksum>9CF40C8C</checksum>
</file>
<file>
<filename>geometry.rb</filename>
Expand All @@ -6752,7 +6752,7 @@
<filename>build_residential_hpxml_test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>9CC9525F</checksum>
<checksum>151CD1BB</checksum>
</file>
</files>
</measure>
10 changes: 5 additions & 5 deletions BuildResidentialHPXML/tests/build_residential_hpxml_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ def _set_measure_argument_values(hpxml_file, args)
args['misc_fuel_loads_fireplace_fuel_type'] = HPXML::FuelTypeNaturalGas
args['pool_present'] = false
args['pool_heater_type'] = HPXML::HeaterTypeElectricResistance
args['hot_tub_present'] = false
args['hot_tub_heater_type'] = HPXML::HeaterTypeElectricResistance
args['permanent_spa_present'] = false
args['permanent_spa_heater_type'] = HPXML::HeaterTypeElectricResistance
elsif ['base-sfa.xml'].include? hpxml_file
args['geometry_unit_type'] = HPXML::ResidentialTypeSFA
args['geometry_unit_cfa'] = 1800.0
Expand Down Expand Up @@ -774,9 +774,9 @@ def _set_measure_argument_values(hpxml_file, args)
args['pool_heater_type'] = HPXML::HeaterTypeGas
args['pool_heater_annual_kwh'] = 0
elsif ['extra-gas-hot-tub-heater-with-zero-kwh.xml'].include? hpxml_file
args['hot_tub_present'] = true
args['hot_tub_heater_type'] = HPXML::HeaterTypeGas
args['hot_tub_heater_annual_kwh'] = 0
args['permanent_spa_present'] = true
args['permanent_spa_heater_type'] = HPXML::HeaterTypeGas
args['permanent_spa_heater_annual_kwh'] = 0
elsif ['extra-no-rim-joists.xml'].include? hpxml_file
args.delete('geometry_rim_joist_height')
args.delete('rim_joist_assembly_r')
Expand Down
5 changes: 4 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
## OpenStudio-HPXML v1.7.0

__New Features__
- **Breaking change**: Updates to newer proposed HPXML v4.0:
- **Breaking change**: Updates to official HPXML v4.0:
- HPXML namespace changed from http://hpxmlonline.com/2019/10 to http://hpxmlonline.com/2023/09
- Replaces `HotTubs/HotTub` with `Spas/PermanentSpa`.
- Replaces `PortableHeater` and `FixedHeater` with `SpaceHeater`.
- Adds manufactured home belly as a foundation type and allows modeling ducts in a manufactured home belly.
- Output updates:
- **Breaking change**: "Hot Tub" outputs renamed to "Permanent Spa".
- Adds "Peak Electricity: Annual Total (W)" output.
- Adds battery resilience hours output; allows requesting timeseries output.
- ReportUtilityBills measure: Allows reporting monthly utility bills in addition to (or instead of) annual bills.
Expand Down
28 changes: 14 additions & 14 deletions HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def self.create(hpxml, runner, model, hpxml_path, epw_path, weather, output_dir,
add_mfls(runner, model, spaces)
add_lighting(runner, model, epw_file, spaces)

# Pools & Hot Tubs
add_pools_and_hot_tubs(runner, model, spaces)
# Pools & Permanent Spas
add_pools_and_permanent_spas(runner, model, spaces)

# Other
add_cooling_season(model, weather)
Expand Down Expand Up @@ -1621,27 +1621,27 @@ def self.add_lighting(runner, model, epw_file, spaces)
@schedules_file, @cfa, @hpxml.header.unavailable_periods)
end

def self.add_pools_and_hot_tubs(runner, model, spaces)
def self.add_pools_and_permanent_spas(runner, model, spaces)
@hpxml.pools.each do |pool|
next if pool.type == HPXML::TypeNone

MiscLoads.apply_pool_or_hot_tub_heater(runner, model, pool, Constants.ObjectNameMiscPoolHeater, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
MiscLoads.apply_pool_or_permanent_spa_heater(runner, model, pool, Constants.ObjectNameMiscPoolHeater, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
next if pool.pump_type == HPXML::TypeNone

MiscLoads.apply_pool_or_hot_tub_pump(runner, model, pool, Constants.ObjectNameMiscPoolPump, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
MiscLoads.apply_pool_or_permanent_spa_pump(runner, model, pool, Constants.ObjectNameMiscPoolPump, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
end

@hpxml.hot_tubs.each do |hot_tub|
next if hot_tub.type == HPXML::TypeNone
@hpxml.permanent_spas.each do |spa|
next if spa.type == HPXML::TypeNone

MiscLoads.apply_pool_or_hot_tub_heater(runner, model, hot_tub, Constants.ObjectNameMiscHotTubHeater, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
next if hot_tub.pump_type == HPXML::TypeNone
MiscLoads.apply_pool_or_permanent_spa_heater(runner, model, spa, Constants.ObjectNameMiscPermanentSpaHeater, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
next if spa.pump_type == HPXML::TypeNone

MiscLoads.apply_pool_or_hot_tub_pump(runner, model, hot_tub, Constants.ObjectNameMiscHotTubPump, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
MiscLoads.apply_pool_or_permanent_spa_pump(runner, model, spa, Constants.ObjectNameMiscPermanentSpaPump, spaces[HPXML::LocationLivingSpace],
@schedules_file, @hpxml.header.unavailable_periods)
end
end

Expand Down
Loading