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

EUSS FY25 Release 2 - Electric Resistance Boilers #255

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions national/housing_characteristics/options_lookup.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -4707,6 +4707,7 @@ hvac_economizer apply_measure upgrade_hvac_economizer
hvac_dcv_v2 demand_control_ventilation upgrade_hvac_dcv
hvac_exhaust_air_energy_or_heat_recovery add_energy_or_heat_recovery upgrade_hvac_exhaust_air_energy_or_heat_recovery
hvac_unocc_oa_control unocc_oa_control upgrade_unoccupied_oa_controls
hvac_electric_boiler elec_boiler upgrade_hvac_electric_boiler
fault_economizer_db_limit NA fault_hvac_economizer_changeover_temperature apply_measure=false econ_choice=all available economizer changeovertemp=10.88
fault_economizer_db_limit No fault fault_hvac_economizer_changeover_temperature apply_measure=false econ_choice=all available economizer changeovertemp=10.88
fault_economizer_db_limit Fault fault_hvac_economizer_changeover_temperature apply_measure=true econ_choice=all available economizer changeovertemp=10.88
Expand Down
89 changes: 89 additions & 0 deletions postprocessing/compare_runs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import logging

import comstockpostproc as cspp


logging.basicConfig(level='INFO') # Use DEBUG, INFO, or WARNING
logger = logging.getLogger(__name__)

def main():
# First ComStock run
comstock_a = cspp.ComStock(
s3_base_dir='eulp/euss_com', # If run not on S3, download results_up**.parquet manually
comstock_run_name='new_sampling_154k', # Name of the run on S3
comstock_run_version='new_sampling_154k', # Use whatever you want to see in plot and folder names
comstock_year=2018, # Typically don't change this
athena_table_name=None, # Typically don't change this
truth_data_version='v01', # Typically don't change this
buildstock_csv_name='buildstock.csv', # Download buildstock.csv manually
acceptable_failure_percentage=0.025, # Can increase this when testing and high failure are OK
drop_failed_runs=True, # False if you want to evaluate which runs failed in raw output data
color_hex='#0072B2', # Color used to represent this run in plots
skip_missing_columns=True, # False if you want to ensure you have all data specified for export
reload_from_csv=False, # True if CSV already made and want faster reload times
include_upgrades=False # False if not looking at upgrades
)

# Second ComStock run
# comstock_b = cspp.ComStock(
# s3_base_dir='eulp/euss_com', # If run not on S3, download results_up**.parquet manually
# comstock_run_name='new_sampling_154k', # Name of the run on S3
# comstock_run_version='new_sampling_154k', # Use whatever you want to see in plot and folder names
# comstock_year=2018, # Typically don't change this
# athena_table_name='rand_985932_20240321', # Typically same as comstock_run_name or None
# truth_data_version='v01', # Typically don't change this
# buildstock_csv_name='buildstock.csv', # Download buildstock.csv manually
# acceptable_failure_percentage=0.025, # Can increase this when testing and high failure are OK
# drop_failed_runs=True, # False if you want to evaluate which runs failed in raw output data
# color_hex='#56B4E9', # Color used to represent this run in plots
# skip_missing_columns=True, # False if you want to ensure you have all data specified for export
# reload_from_csv=False, # True if CSV already made and want faster reload times
# include_upgrades=False # False if not looking at upgrades
# )

# Stock Estimation for Apportionment:
stock_estimate = cspp.Apportion(
stock_estimation_version='2024R2', # Only updated when a new stock estimate is published
truth_data_version='v01' # Typically don't change this
)

# CBECS
cbecs = cspp.CBECS(
cbecs_year=2018, # 2012 and 2018 currently available
truth_data_version='v01', # Typically don't change this
color_hex='#009E73', # Color used to represent CBECS in plots
reload_from_csv=False # True if CSV already made and want faster reload times
)

# First scale ComStock runs to the 'truth data' from StockE V3 estimates using bucket-based apportionment
# Then scale both ComStock runs to CBECS 2018 AND remove non-ComStock buildings from CBECS
# This is how weights in the models are set to represent national energy consumption
comstock_a.add_weights_aportioned_by_stock_estimate(apportionment=stock_estimate)
comstock_a.add_national_scaling_weights(cbecs, remove_non_comstock_bldg_types_from_cbecs=True)
# comstock_b.add_weights_aportioned_by_stock_estimate(apportionment=stock_estimate)
# comstock_b.add_national_scaling_weights(cbecs, remove_non_comstock_bldg_types_from_cbecs=True)

# Export CBECS and ComStock data to wide and long formats for Tableau and to skip processing later
cbecs.export_to_csv_wide() # May comment this out if CSV output isn't needed
# comstock_a.create_national_aggregation() # May comment this out if CSV output isn't needed
# comstock_b.create_national_aggregation() # May comment this out if CSV output isn't needed
# TODO This (long CSV export) is not yet re-implemented
# comstock_a.export_to_csv_long() # Long format useful for stacking end uses and fuels
# comstock_b.export_to_csv_long() # Long format useful for stacking end uses and fuels

# Compare multiple ComStock runs to one another and to CBECS
comparison = cspp.ComStockToCBECSComparison(
cbecs_list=[cbecs],
comstock_list = [comstock_a],
make_comparison_plots=True
)

# Export the comparison data to wide format for Tableau
comparison.export_to_csv_wide()

# Code to execute the script
if __name__=="__main__":
main()
93 changes: 93 additions & 0 deletions postprocessing/compare_upgrades.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import logging

import comstockpostproc as cspp


logging.basicConfig(level='INFO') # Use DEBUG, INFO, or WARNING
logger = logging.getLogger(__name__)

def main():
# ComStock run
comstock = cspp.ComStock(
s3_base_dir='eulp/euss_com', # If run not on S3, download results_up**.parquet manually
<<<<<<< Updated upstream
comstock_run_name='new_sampling_154k', # Name of the run on S3
comstock_run_version='new_sampling_154k', # Use whatever you want to see in plot and folder names
=======
comstock_run_name='elec_boiler_10k', # Name of the run on S3
comstock_run_version='elec_boiler_10k', # Use whatever you want to see in plot and folder names
>>>>>>> Stashed changes
comstock_year=2018, # Typically don't change this
athena_table_name=None, # Typically don't change this
truth_data_version='v01', # Typically don't change this
buildstock_csv_name='buildstock.csv', # Download buildstock.csv manually
<<<<<<< Updated upstream
acceptable_failure_percentage=0.25, # Can increase this when testing and high failure are OK
=======
acceptable_failure_percentage=0.025, # Can increase this when testing and high failure are OK
>>>>>>> Stashed changes
drop_failed_runs=True, # False if you want to evaluate which runs failed in raw output data
color_hex='#0072B2', # Color used to represent this run in plots
skip_missing_columns=True, # False if you want to ensure you have all data specified for export
reload_from_csv=False, # True if CSV already made and want faster reload times
include_upgrades=True, # False if not looking at upgrades
upgrade_ids_to_skip=[], # Use [1, 3] etc. to exclude certain upgrades
make_timeseries_plots=False,
states={
#'MN': 'Minnesota', # specify state to use for timeseries plots in dictionary format. State ID must correspond correctly.
<<<<<<< Updated upstream
'MA':'Massachusetts',
=======
#'MA':'Massachusetts',
>>>>>>> Stashed changes
#'OR': 'Oregon',
#'LA': 'Louisiana',
#'AZ': 'Arizona',
#'TN': 'Tennessee'
},
upgrade_ids_for_comparison={} # Use {'<Name you want for comparison run folder>':[0,1,2]}; add as many upgrade IDs as needed, but plots look strange over 5
)

# Stock Estimation for Apportionment:
stock_estimate = cspp.Apportion(
stock_estimation_version='2024R2', # Only updated when a new stock estimate is published
truth_data_version='v01' # Typically don't change this
)

# CBECS
cbecs = cspp.CBECS(
cbecs_year=2018, # 2012 and 2018 currently available
truth_data_version='v01', # Typically don't change this
color_hex='#009E73', # Color used to represent CBECS in plots
reload_from_csv=False # True if CSV already made and want faster reload times
)

# Scale ComStock runs to the 'truth data' from StockE V3 estimates using bucket-based apportionment
comstock.add_weights_aportioned_by_stock_estimate(apportionment=stock_estimate)
# Scale ComStock run to CBECS 2018 AND remove non-ComStock buildings from CBECS
comstock.add_national_scaling_weights(cbecs, remove_non_comstock_bldg_types_from_cbecs=True)

# Export CBECS and ComStock data to wide and long formats for Tableau and to skip processing later
<<<<<<< Updated upstream
#cbecs.export_to_csv_wide() # May comment this out after run once
comstock.create_national_aggregation()
#comstock.create_geospatially_resolved_aggregations(comstock.STATE_ID, pretty_geo_col_name='state_id')
#comstock.create_geospatially_resolved_aggregations(comstock.COUNTY_ID, pretty_geo_col_name='county_id')
=======
# cbecs.export_to_csv_wide() # May comment this out after run once
# comstock.create_national_aggregation()
# comstock.create_geospatially_resolved_aggregations(comstock.STATE_ID, pretty_geo_col_name='state_id')
# comstock.create_geospatially_resolved_aggregations(comstock.COUNTY_ID, pretty_geo_col_name='county_id')
>>>>>>> Stashed changes
# TODO Long is def not working as expected anymore...
# comstock.export_to_csv_long() # Long format useful for stacking end uses and fuels

# Create measure run comparisons; only use if run has measures
comparison = cspp.ComStockMeasureComparison(comstock, states=comstock.states, make_comparison_plots = comstock.make_comparison_plots, make_timeseries_plots = comstock.make_timeseries_plots)

# Code to execute the script
if __name__=="__main__":
main()
27 changes: 27 additions & 0 deletions resources/measures/upgrade_hvac_electric_boiler/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

(1) Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.

(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
or promote products derived from this software without specific prior written permission from the
respective party.

(4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
designation without specific prior written permission from Alliance for Sustainable Energy, LLC.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 26 additions & 0 deletions resources/measures/upgrade_hvac_electric_boiler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@


###### (Automatically generated documentation)

# electric_resistance_boilers

## Description
This measure replaces an exising natural gas boiler with an electric resistance boiler.

## Modeler Description
This measure replaces an exising natural gas boiler with an electric resistance boiler. The measure loops through existing boiler objects and switches the fuel to "electricity". It also increases the nominal efficiency to 100% and replaces the efficiency curve to one representing electric boilers.

## Measure Type
ModelMeasure

## Taxonomy


## Arguments




This measure does not have any user arguments


42 changes: 42 additions & 0 deletions resources/measures/upgrade_hvac_electric_boiler/README.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<%#= README.md.erb is used to auto-generate README.md. %>
<%#= To manually maintain README.md throw away README.md.erb and manually edit README.md %>
###### (Automatically generated documentation)

# <%= name %>

## Description
<%= description %>

## Modeler Description
<%= modelerDescription %>

## Measure Type
<%= measureType %>

## Taxonomy
<%= taxonomy %>

## Arguments

<% arguments.each do |argument| %>
### <%= argument[:display_name] %>
<%= argument[:description] %>
**Name:** <%= argument[:name] %>,
**Type:** <%= argument[:type] %>,
**Units:** <%= argument[:units] %>,
**Required:** <%= argument[:required] %>,
**Model Dependent:** <%= argument[:model_dependent] %>
<% end %>

<% if arguments.size == 0 %>
<%= "This measure does not have any user arguments" %>
<% end %>

<% if outputs.size > 0 %>
## Outputs
<% output_names = [] %>
<% outputs.each do |output| %>
<% output_names << output[:display_name] %>
<% end %>
<%= output_names.join(", ") %>
<% end %>
Loading