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

Add unmet water heater loads EMS program #1502

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft

Conversation

jmaguire1
Copy link
Collaborator

@jmaguire1 jmaguire1 commented Oct 4, 2023

Pull Request Description

Add an EMS program for calculating unmet water heating loads. Focus is on unmet showers, but we can also calculate this for each end use if we wanted to. Addresses #1170.

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

@jmaguire1 jmaguire1 changed the title Add unmet loads EMS program Add unmet water heater loads EMS program Oct 13, 2023
@shorowit shorowit mentioned this pull request Oct 17, 2023
12 tasks
@jmaguire1
Copy link
Collaborator Author

Right now, this method calculates:

  • Unmet shower energy (mcpdelta T when T_delivered < 105 F)
  • Unmet shower time
  • Total shower time

Unmet shower energy I feel is the most complete metric, since it accounts for how far off from the desired temperature you are. However, no one really has a sense for if say 2 kWh of unmet showers is too many, so this way you can calculate the % of shower time where loads are unmet.

We could also add metrics related to ALL hot water usage, or all fixtures. We'd want to account for the different desired delivered temperature for appliances, but it wouldn't be hard to add metrics like Unmet Energy for all fixtures.

@jmaguire1 jmaguire1 mentioned this pull request Nov 1, 2023
7 tasks
Copy link
Contributor

@shorowit shorowit left a comment

Choose a reason for hiding this comment

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

Some comments while I think of it. Addressing these comments will make it easier to pull in the master branch.

@@ -1317,6 +1319,8 @@ def self.add_hot_water_and_appliances(runner, model, weather, spaces)

# Add combi-system EMS program with water use equipment information
Waterheater.apply_combi_system_EMS(model, @hpxml.water_heating_systems, plantloop_map)

return plantloop_map[sys_id]
Copy link
Contributor

Choose a reason for hiding this comment

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

This currently just returns the last plant loop, which isn't what you want when there are multiple water heaters in a dwelling unit.

Comment on lines 969 to 994
nbeds = hpxml.building_construction.additional_properties.adjusted_number_of_bedrooms

# Process fixtures
fixtures_usage_multiplier = hpxml.water_heating.water_fixtures_usage_multiplier
fixtures_all_low_flow = true
hpxml.water_fixtures.each do |water_fixture|
next unless [HPXML::WaterFixtureTypeShowerhead, HPXML::WaterFixtureTypeFaucet].include? water_fixture.water_fixture_type

fixtures_all_low_flow = false if not water_fixture.low_flow
end

# Get distribution system
if hpxml.water_heating_systems.size > 0
hot_water_distribution = hpxml.hot_water_distributions[0]
end

# Calculate mixed water fractions
t_mix = 105.0 # F, Temperature of mixed water at fixtures
avg_setpoint_temp = 0.0 # WH Setpoint: Weighted average by fraction DHW load served
hpxml.water_heating_systems.each do |water_heating_system|
wh_setpoint = water_heating_system.temperature
wh_setpoint = Waterheater.get_default_hot_water_temperature(eri_version) if wh_setpoint.nil? # using detailed schedules
avg_setpoint_temp += wh_setpoint * water_heating_system.fraction_dhw_load_served
end
daily_wh_inlet_temperatures = calc_water_heater_daily_inlet_temperatures(weather, nbeds, hot_water_distribution, fixtures_all_low_flow, hpxml.header.sim_calendar_year)
daily_mw_fractions = calc_mixed_water_daily_fractions(daily_wh_inlet_temperatures, avg_setpoint_temp, t_mix)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is all duplicated code from elsewhere. We should rework this code so that the new calculation & EMS program is simply created in the existing code as we process each water heater (rather than trying to do this all at the end of the measure).

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, at one point I did have most of this integrated in with the fixtures, but I was having trouble figuring out to structure things. Let me take another shot at that and then if I get stuck I'll ask you or Joe for some help.

@jmaguire1
Copy link
Collaborator Author

@shorowit: I just did a major refactor of this, no more duplicate code. Thanks for the suggestions. It'd be good to know if you think this is a decent way to organize things at a minimum if/when you have a chance to take a look, we're looking to use this with the 120 V HPWH relatively soon.

@shorowit shorowit added the enhancement New feature or request label Jan 13, 2024
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
Status: In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants