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 utility bill calculations #71

Merged
merged 20 commits into from
Jan 22, 2024
Merged

Add utility bill calculations #71

merged 20 commits into from
Jan 22, 2024

Conversation

asparke2
Copy link
Member

@asparke2 asparke2 commented Jan 8, 2024

Pull request overview

This pull request adds utility bill calculations for electricity, natural gas, propane, and fuel oil. Electricity rates are from the U.S. Utility Rate Database on OpenEI. Petroleum fuel rates are volumetric prices derived from EIA data. All bills reflect 2022 prices.

See change documentation here: https://nrel.sharepoint.com/:w:/r/sites/comstock/Shared%20Documents/ComStock%20Filing%20Cabinet/ComStock%20Core/Change%20Documentation/Changes/vTBD%20Utility%20Rates/ComStock%20Change%20Adds%20Utility%20Rates.docx?d=w1dbdbc340bec4de9a6234a3d05a9345c&csf=1&web=1&e=teBIKO

Pull Request Author

This pull request makes changes to (select all the apply):

  • Documentation
  • Infrastructure (includes singularity image, buildstock batch, dependencies, continuous integration tests)
  • Sampling
  • Workflow Measures
  • Upgrade Measures
  • Reporting Measures
  • Postprocessing

Author pull request checklist:

  • Tagged the pull request with the appropriate label (documentation, infrastructure, sampling, workflow measure, upgrade measure, reporting measure, postprocessing) to help categorize changes in the release notes.
  • Added tests for new measures
  • Updated measure .xml(s)
  • Register values added to comstock_column_definitions.csv
  • Both options_lookup.tsv files updated
  • 10k+ test run
  • Change documentation written
  • Measure documentation written
  • ComStock documentation updated
  • Changes reflected in example .yml files
  • Changes reflected in README.md files
  • Added 'See ComStock License' language to first two lines of each code file
  • All new and existing tests pass the CI

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a code review on GitHub
  • All related changes have been implemented: data and method additions, changes, tests
  • If fixing a defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • Reviewed change documentation
  • Ensured code files contain License reference
  • Results differences are reasonable
  • CI status: all tests pass

ComStock Licensing Language - Add to Beginning of Each Code File

# ComStock™, Copyright (c) 2023 Alliance for Sustainable Energy, LLC. All rights reserved.
# See top level LICENSE.txt file for license terms.

@asparke2 asparke2 added the enhancement New feature or request label Jan 8, 2024
@asparke2 asparke2 requested a review from eringold January 8, 2024 23:26
with open(args.kwhpath) as f:
for val in f:
hourly_kwh.append(float(val))
assert len(hourly_kwh) == 8760, f"Got {len(hourly_kwh)} instead of expected 8760 hourly kWh values"
Copy link
Contributor

Choose a reason for hiding this comment

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

how will you account for leap years?

Copy link
Member Author

Choose a reason for hiding this comment

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

ComStock runs the first 365 days of the year for leap years, so it cuts off Dec 31st when there is a leap year, always leaving 8760 hours worth of timeseries data

result = OpenStudio::IdfObjectVector.new

# Request hourly data for fuel types with hourly bill calculations
fuel_types = ['Electricity'] # 'NaturalGas', 'DistrictCooling', 'DistrictHeating', 'FuelOilNo2', 'Propane'
Copy link
Contributor

Choose a reason for hiding this comment

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

why are other fuel types commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

We only need hourly data for electricity bill calculations, the other fuels are all currently annual volumetric prices.

mdahlhausen
mdahlhausen previously approved these changes Jan 11, 2024
@mdahlhausen
Copy link
Contributor

Other comments:

eringold
eringold previously approved these changes Jan 11, 2024
@asparke2
Copy link
Member Author

@eringold @mdahlhausen made another two fixes and ran:

  1. Actually pull the start date from each rate and use that as the basis for adjustment to 2022
  2. Add code to shift the timeseries electricity data to match a Monday start day (PySAM's assumption). This didn't affect the rates since ComStock uses 2018 which happens to start on a Monday, but covered for future/good measure.

Result:
Electricity rates generally dropped a bit. This helped the most over-estimated region, driven by CA utilities who have more up-to-date rates in the URDB. Updated the change doc with new figures if you want to look. Otherwise I think this is good to merge.

@eringold eringold merged commit 19c725c into main Jan 22, 2024
@eringold eringold deleted the asparke2/utility_rates branch January 22, 2024 20:33
@mdahlhausen mdahlhausen changed the title Adds utility bill calculations Add utility bill calculations Mar 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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants