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

BuildResidentialHPXML: create multiple Building elements #1457

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Aug 4, 2023

Pull Request Description

Addresses #1376.

Update BuildResidentialHPXML as follows:

  • Adds new optional existing_hpxml_path argument. If it's assigned, the measure adds a building to the HPXML file.
  • After appending a new building, sets unique HPXML IDs on the last building only.
  • If applying defaults, it does the same thing after the defaults are applied, and then writes out the file again.

This PR also:

  • Adds new BuildResidentialHPXML tests for successively calling the measure multiple times.
  • Updates some hpxml.rb items related to interior/exterior shading IDs,
  • Actually builds sample file base-multiple-buildings.xml using BuildResidentialHPXML.
  • Creates a new sample file base-multiple-buildings-varied-occupancy.xml

Checklist

PR Author: Check these when they're done. Not all may apply. strikethrough and check any that do not apply.

PR Reviewer: Verify each has been completed.

  • Schematron validator (EPvalidator.xml) has been updated
  • Sample files have been added/updated (via tasks.rb)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests and/or workflow/tests/hpxml_translator_test.rb)
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected changes to simulation results of sample files

@joseph-robertson joseph-robertson added the enhancement New feature or request label Aug 4, 2023
@joseph-robertson joseph-robertson self-assigned this Aug 4, 2023
@@ -367,7 +368,7 @@ def _run_xml(xml, worker_num = nil)
# Uses 'monthly' to verify timeseries results match annual results via error-checking
# inside the ReportSimulationOutput measure.
cli_path = OpenStudio.getOpenStudioCLI
command = "\"#{cli_path}\" \"#{File.join(File.dirname(__FILE__), '../run_simulation.rb')}\" -x \"#{xml}\" --add-component-loads -o \"#{rundir}\" --debug --monthly ALL"
command = "\"#{cli_path}\" \"#{File.join(File.dirname(__FILE__), '../run_simulation.rb')}\" -x \"#{xml}\" --add-component-loads -o \"#{rundir}\" --debug --monthly ALL -b ALL"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --monthly ALL causes, e.g., base-multiple-buildings.xml to fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the timeseries outputs should work, but I think the airflows outputs don't yet. At some point I'll get around to addressing this. In the meantime it should work if you just specify certain timeseries outputs (like enduses, hotwater, etc.).

@shorowit

This comment was marked as resolved.

@joseph-robertson joseph-robertson marked this pull request as ready for review September 25, 2023 15:55
BuildResidentialHPXML/measure.rb Show resolved Hide resolved
tasks.rb Outdated Show resolved Hide resolved
joseph-robertson and others added 3 commits September 26, 2023 08:13
…ithub.com/NREL/OpenStudio-HPXML into build_whole_sfa_mf_models_unit_multiplier

# Conflicts:
#	BuildResidentialHPXML/measure.xml
BuildResidentialHPXML/measure.rb Outdated Show resolved Hide resolved
hpxml.header.xml_type = 'HPXML'
hpxml.header.xml_generated_by = 'BuildResidentialHPXML'
hpxml.header.transaction = 'create'

if args[:schedules_vacancy_period].is_initialized
begin_month, begin_day, begin_hour, end_month, end_day, end_hour = Schedule.parse_date_time_range(args[:schedules_vacancy_period].get)
hpxml.header.unavailable_periods.add(column_name: 'Vacancy', begin_month: begin_month, begin_day: begin_day, begin_hour: begin_hour, end_month: end_month, end_day: end_day, end_hour: end_hour, natvent_availability: HPXML::ScheduleUnavailable)

natvent_availability = HPXML::ScheduleUnavailable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should be inside the unavailable_period_exists method and not here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand. It gets passed into the unavailable_period_exists method. For the "Vacancy" instance, it's always set to natvent_availability = HPXML::ScheduleUnavailable. For "Power Outage", it's assigned using an argument.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So inside the method, set natvent_availability = HPXML::ScheduleUnavailable if natvent_availability.nil??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess. We'd then be assigning natvent_availability = HPXML::ScheduleUnavailable twice for the "Vacancy" instance...

BuildResidentialHPXML/measure.rb Outdated Show resolved Hide resolved
BuildResidentialHPXML/measure.rb Outdated Show resolved Hide resolved
BuildResidentialHPXML/measure.rb Outdated Show resolved Hide resolved
BuildResidentialHPXML/measure.rb Outdated Show resolved Hide resolved
BuildResidentialHPXML/measure.rb Outdated Show resolved Hide resolved
BuildResidentialHPXML/measure.rb Outdated Show resolved Hide resolved
@shorowit shorowit merged commit 255fa70 into whole_sfa_mf_models_unit_multiplier Oct 3, 2023
5 checks passed
@shorowit shorowit deleted the build_whole_sfa_mf_models_unit_multiplier branch October 3, 2023 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants