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

Align heating and cooling load profiles with electric load year #472

Merged
merged 28 commits into from
Jan 14, 2025

Conversation

Bill-Becker
Copy link
Collaborator

@Bill-Becker Bill-Becker commented Jan 9, 2025

Current issue/bug: if a custom ElectricLoad.loads_kw is input along with its corresponding calendar year, and then a heating and/or cooling load is "simulated" by either a commercial reference building (doe_reference_name, or blended_...) or schedule-based flat load (e.g. FlatLoad_16_5) which uses the 2017 year (start day == Sunday), then the load profiles will not be aligned (shifted in the weekdays/weekends). See attached images for current web tool behavior with uploaded electric load for 2024 (starts on Monday) with heating load (starts on Sunday).

This PR fixes this by passing the ElectricLoad.year to the constructors for HeatingLoad and CoolingLoad, and it shifts the simulated CRB or schedule-based flat load profiles to match the starting day of the year input.

Also, now that we have a custom load profile builder for heating loads in the REopt web tool, in which you build an 8760 heating load profile and assign a particular year to it, custom/uploaded heating loads will be used more often. This PR ensures that the year input for heating load profile matches the year input for the electric load profile input. It throws an error if it doesn't match.

Side note: we kind of got away with this for the last year because 2023 (the previous full year) starts on the same day as 2017, but now that 2024 is the most recent full historical year, I suspect this will start to become an issue more.

"Uploaded" 2024 (starts on Monday) Electric Load:
Uploaded 2024 Electric load with FlatLoad_16_5 profile

"Simulate Building" 16/5 Schedule Flat Load (2017 is the only option, starts on Sunday):
Heating FlatLoad_16_5 profile with uploaded Electric load for 2024

@Bill-Becker Bill-Becker requested a review from adfarth January 9, 2025 16:36
@Bill-Becker

This comment was marked as off-topic.

@adfarth
Copy link
Collaborator

adfarth commented Jan 9, 2025

Per the dev call, adding a note to check that the different load years do indeed get sent when using the web tool.

@adfarth

This comment was marked as outdated.

@@ -158,19 +158,13 @@ mutable struct ElectricLoad # mutable to adjust (critical_)loads_kw based off o
end
Copy link
Collaborator

@adfarth adfarth Jan 9, 2025

Choose a reason for hiding this comment

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

Adding a note here to require the year if a custom load profile is uploaded (here and for the heating loads)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added this requirement. Validation to check if year is not nothing can happen above the check for loads_kw, doe_reference_name, etc, since the default is assigned for CRB without a year input.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Bill-Becker I think it might be worth adding this to the CHANGELOG too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added to changelog.

adfarth and others added 2 commits January 9, 2025 13:44
Also made year required for HeatingLoad and CoolingLoad constructors with their equivalent timeseries load profile input, but that will typically get passed in from the ElectricLoad.year, if missing.
@Bill-Becker
Copy link
Collaborator Author

Per the dev call, adding a note to check that the different load years do indeed get sent when using the web tool.

I confirmed that the year is being passed with an uploaded electric load. The web developers are also working on adding the year input for uploaded heating and cooling loads.

CHANGELOG.md Outdated
### Fixed
- Align heating and cooling load profiles based on electric load year input, if using custom electric load profile with simulated (CRB or schedule-based flatloads) heating/cooling loads
### Changed
- Make `year` input required with `ElectricLoad.loads_kw` input
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also for the custom heating and cooling load inputs, correct? Could you add 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.

Updated the line to include any load profile input.

@@ -9,11 +9,13 @@
industrial_reference_name::String = "", # For ProcessHeatLoad
blended_industrial_reference_names::Array{String, 1} = String[], # For ProcessHeatLoad
blended_industrial_reference_percents::Array{<:Real,1} = Real[], # For ProcessHeatLoad
addressable_load_fraction::Any = 1.0, # Fraction of input fuel load which is addressable by heating technologies. Can be a scalar or vector with length aligned with use of monthly_mmbtu or fuel_loads_mmbtu_per_hour.
city::String = "",
year::Union{Int, Nothing} = doe_reference_name ≠ "" || blended_doe_reference_names ≠ String[] ? 2017 : nothing, # CRB profiles are 2017 by default. If providing load profile, specify year of data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this year check for defaulting to 2017 also need to account for industrial_reference_name and blended_industrial_reference_names? I'm not familiar with exactly how those are used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, I'll add that too.

)
max_heat_demand_kw = maximum(dhw_load.loads_kw)
else
# TODO need to add a dummy year here or else will error
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Bill-Becker is this still a pending TODO?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, done.

@adfarth
Copy link
Collaborator

adfarth commented Jan 13, 2025

@Bill-Becker do you think it matters that in ElectricTariff the year is still defaulted to 2022?

input_data = JSON.parsefile("./scenarios/load_year_align.json")
year = 2024
# ElectricLoad.loads_kw is 2024, and heating and cooling loads are shifted to align
# Use a FlatLoad_16_5 shifted to 2024 (Monday start) with the web tool's custom load builder
Copy link
Collaborator

Choose a reason for hiding this comment

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

this isn't that important, but what does this comment mean? That the flat load has already been shifted after getting the 2017 version from the web tool?

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 just built a load with the year=2024, and the web tool aligned the weekday/weekend profiles to the 2024 year.

Copy link
Collaborator

@adfarth adfarth left a comment

Choose a reason for hiding this comment

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

@Bill-Becker just a few small questions and asks, but I think this is good to merge after addressing those. These are great fixes!

@Bill-Becker
Copy link
Collaborator Author

@Bill-Becker do you think it matters that in ElectricTariff the year is still defaulted to 2022?

Removed the year default.

@Bill-Becker Bill-Becker merged commit 2e4b8e3 into develop Jan 14, 2025
2 checks passed
@Bill-Becker Bill-Becker deleted the load-year-align branch January 14, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants