Skip to content

Conversation

@joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Jan 7, 2026

Pull Request Description

Addresses #1499. Adds custom meters to calculate energy use for each dwelling unit.

Checklist

Not all may apply:

  • Schematron validator (EPvalidator.sch) has been updated
  • Sample files have been added/updated (openstudio tasks.rb update_hpxmls)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests/test*.rb and/or workflow/tests/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

Comment on lines 402 to 409
if @hpxml_bldgs.size == 1
Model.add_output_meter(model, meter_name: "#{fuel.meter.gsub(':', '_')}_CustomMeter", reporting_frequency: 'runperiod') # Used for error checking
else
@hpxml_bldgs.each do |hpxml_bldg|
unit_num = @hpxml_bldgs.index(hpxml_bldg) + 1
Model.add_output_meter(model, meter_name: "unit#{unit_num}_#{fuel.meter.gsub(':', '_')}_CustomMeter", reporting_frequency: 'runperiod') # Used for error checking
end
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrap this in a method?

Comment on lines 396 to 397
Outputs.create_unit_fuel_meter(model, EPlus::FuelTypeElectricity, 'ElectricityProduced:Facility')
Outputs.create_unit_fuel_meter(model, EPlus::FuelTypeElectricity, 'ElectricStorage:ElectricityProduced')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using these meters is motivated by resilience calculations for batteries. Should we additionally create unit meters for MeterCustomElectricityTotal, MeterCustomElectricityNet, and MeterCustomElectricityPV so that we can support reporting out Electricity Total and Net for each unit?

Fuel Use: Unit1: Electricity: Total (MBtu), x
Fuel Use: Unit1: Electricity: Net (MBtu), y
Fuel Use: Unit1: Natural Gas: Total (MBtu), z
...

@joseph-robertson joseph-robertson changed the base branch from master to battery-resilience-refactor January 13, 2026 20:00
Comment on lines +118 to +133
Annual Energy by Fuel Use by Unit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fuel uses by unit are listed below.

================================================== ===========================
Type Notes
================================================== ===========================
Fuel Use: <BuildingID>: Electricity: Total (MBtu) Total electricity consumption
Fuel Use: <BuildingID>: Electricity: Net (MBtu) Total energy consumption minus power produced by PV
Fuel Use: <BuildingID>: Natural Gas: Total (MBtu)
Fuel Use: <BuildingID>: Fuel Oil: Total (MBtu) Includes "fuel oil", "fuel oil 1", "fuel oil 2", "fuel oil 4", "fuel oil 5/6", "kerosene", and "diesel"
Fuel Use: <BuildingID>: Propane: Total (MBtu)
Fuel Use: <BuildingID>: Wood Cord: Total (MBtu)
Fuel Use: <BuildingID>: Wood Pellets: Total (MBtu)
Fuel Use: <BuildingID>: Coal: Total (MBtu) Includes "coal", "anthracite coal", "bituminous coal", and "coke"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note about only populating these outputs if running whole-building simulation (i.e., more than 1 dwelling unit)?

@shorowit shorowit moved this from Triage to In progress in OpenStudio-HPXML Jan 16, 2026
@shorowit
Copy link
Contributor

We should think about how this interacts with modeling central/shared systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants