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

Panels TEA Run - DO NOT MERGE #1208

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
2,225 changes: 0 additions & 2,225 deletions measures/ApplyUpgrade/README.md

This file was deleted.

155 changes: 155 additions & 0 deletions measures/BuildExistingModel/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,161 @@ def run(model, runner, user_arguments)
return false
end

#report sechedule
require 'csv'
schedule_csv_file_path = measures['BuildResidentialScheduleFile'][0]['output_csv_path']

# calculate the time that each value represent in hour
if File.exist?(schedule_csv_file_path)
@tmp_schedules = CSV.table(schedule_csv_file_path)
hour_each_value = 8760.0 / @tmp_schedules.length

cooking_range_max_value = nil
cooking_range_full_load_operation = 0
cooking_range_operation = 0
cooking_range_event_num = 0

dishwasher_max_value = nil
dishwasher_full_load_operation = 0
dishwasher_operation = 0
dishwasher_event_num = 0

clothes_washer_max_value = nil
clothes_washer_full_load_operation = 0
clothes_washer_operation = 0
clothes_washer_event_num = 0

clothes_dryer_max_value = nil
clothes_dryer_full_load_operation = 0
clothes_dryer_operation = 0
clothes_dryer_event_num = 0

#peak power
CSV.foreach(schedule_csv_file_path, headers: true) do |row|
cooking_range_column_value = row['cooking_range'].to_f
dishwasher_column_value = row['dishwasher'].to_f
clothes_washer_column_value = row['clothes_washer'].to_f
clothes_dryer_column_value = row['clothes_dryer'].to_f

if cooking_range_max_value.nil? || cooking_range_column_value > cooking_range_max_value
cooking_range_max_value = cooking_range_column_value
end

if dishwasher_max_value.nil? || dishwasher_column_value > dishwasher_max_value
dishwasher_max_value = dishwasher_column_value
end

if clothes_washer_max_value.nil? || clothes_washer_column_value > clothes_washer_max_value
clothes_washer_max_value = clothes_washer_column_value
end

if clothes_dryer_max_value.nil? || clothes_dryer_column_value > clothes_dryer_max_value
clothes_dryer_max_value = clothes_dryer_column_value
end
end

#number of events and operation hour
cooking_range_previous_row_value = nil
dishwasher_previous_row_value = nil
clothes_washer_previous_row_value = nil
clothes_dryer_previous_row_value = nil
CSV.foreach(schedule_csv_file_path, headers: true) do |row|
cooking_range_column_value = row['cooking_range'].to_f
dishwasher_column_value = row['dishwasher'].to_f
clothes_washer_column_value = row['clothes_washer'].to_f
clothes_dryer_column_value = row['clothes_dryer'].to_f

if cooking_range_previous_row_value.nil?
cooking_range_previous_row_value = cooking_range_column_value
else
if cooking_range_previous_row_value == 0 && cooking_range_column_value > 0
cooking_range_event_num += 1
end
end
cooking_range_previous_row_value = cooking_range_column_value
if cooking_range_column_value == cooking_range_max_value
cooking_range_full_load_operation += 1
end
if cooking_range_column_value > 0
cooking_range_operation += 1
end

if dishwasher_previous_row_value.nil?
dishwasher_previous_row_value = dishwasher_column_value
else
if dishwasher_previous_row_value == 0 && dishwasher_column_value > 0
dishwasher_event_num += 1
end
end
dishwasher_previous_row_value = dishwasher_column_value
if dishwasher_column_value == dishwasher_max_value
dishwasher_full_load_operation += 1
end
if dishwasher_column_value > 0
dishwasher_operation += 1
end

if clothes_washer_previous_row_value.nil?
clothes_washer_previous_row_value = clothes_washer_column_value
else
if clothes_washer_previous_row_value == 0 && clothes_washer_column_value > 0
clothes_washer_event_num += 1
end
end
clothes_washer_previous_row_value = clothes_washer_column_value
if clothes_washer_column_value == clothes_washer_max_value
clothes_washer_full_load_operation += 1
end
if clothes_washer_column_value > 0
clothes_washer_operation += 1
end

if clothes_dryer_previous_row_value.nil?
clothes_dryer_previous_row_value = clothes_dryer_column_value
else
if clothes_dryer_previous_row_value == 0 && clothes_dryer_column_value > 0
clothes_dryer_event_num += 1
end
end
clothes_dryer_previous_row_value = clothes_dryer_column_value
if clothes_dryer_column_value == clothes_dryer_max_value
clothes_dryer_full_load_operation += 1
end
if clothes_dryer_column_value > 0
clothes_dryer_operation += 1
end
end

#register outputs
cooking_range_full_load_operation_hour = (cooking_range_full_load_operation * hour_each_value).to_s
cooking_range_operation_hour = (cooking_range_operation * hour_each_value).to_s
cooking_range_event_num = (cooking_range_event_num).to_s
register_value(runner, 'cooking_range_full_load_operation_hour', cooking_range_full_load_operation_hour)
register_value(runner, 'cooking_range_operation_hour', cooking_range_operation_hour)
register_value(runner, 'cooking_range_event_num', cooking_range_event_num)

dishwasher_full_load_operation_hour = (dishwasher_full_load_operation * hour_each_value).to_s
dishwasher_operation_hour = (dishwasher_operation * hour_each_value).to_s
dishwasher_event_num = (dishwasher_event_num).to_s
register_value(runner, 'dishwaser_full_load_operation_hour', dishwasher_full_load_operation_hour)
register_value(runner, 'dishwasher_operation_hour', dishwasher_operation_hour)
register_value(runner, 'dishwasher_event_num', dishwasher_event_num)

clothes_washer_full_load_operation_hour = (clothes_washer_full_load_operation * hour_each_value).to_s
clothes_washer_operation_hour = (clothes_washer_operation * hour_each_value).to_s
clothes_washer_event_num = (clothes_washer_event_num).to_s
register_value(runner, 'clothes_washer_full_load_operation_hour', clothes_washer_full_load_operation_hour)
register_value(runner, 'clothes_washer_operation_hour', clothes_washer_operation_hour)
register_value(runner, 'clothes_washer_event_num', clothes_washer_event_num)

clothes_dryer_full_load_operation_hour = (clothes_dryer_full_load_operation * hour_each_value).to_s
clothes_dryer_operation_hour = (clothes_dryer_operation * hour_each_value).to_s
clothes_dryer_event_num = (clothes_dryer_event_num).to_s
register_value(runner, 'clothes_dryer_full_load_operation_hour', clothes_dryer_full_load_operation_hour)
register_value(runner, 'clothes_dryer_operation_hour', clothes_dryer_operation_hour)
register_value(runner, 'clothes_dryer_event_num', clothes_dryer_event_num)
end

# Copy existing.xml to home.xml for downstream HPXMLtoOpenStudio
# We need existing.xml (and not just home.xml) for UpgradeCosts
in_path = File.expand_path('../home.xml')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Dependency=Usage Level Option=80% Usage Option=100% Usage Option=120% Usage sampling_probability
Average 0 1 0 0
Medium 0 1 0 0.5
Low 1 0 0 0.25
High 0 0 1 0.25
Low 0 1 0 0.25
High 0 1 0 0.25
# Created by: sources\other\tsv_maker.py
# Description: Clothes dryer energy usage level multiplier.
# Source: n/a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Dependency=Usage Level Option=80% Usage Option=100% Usage Option=120% Usage sampling_probability
Average 0 1 0 0
Medium 0 1 0 0.5
Low 1 0 0 0.25
High 0 0 1 0.25
Low 0 1 0 0.25
High 0 1 0 0.25
# Created by: sources\other\tsv_maker.py
# Description: Clothes washer energy usage level multiplier.
# Source: n/a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Dependency=Usage Level Option=80% Usage Option=100% Usage Option=120% Usage sampling_probability
Average 0 1 0 0
Medium 0 1 0 0.5
Low 1 0 0 0.25
High 0 0 1 0.25
Low 0 1 0 0.25
High 0 1 0 0.25
# Created by: sources\other\tsv_maker.py
# Description: Cooling range energy usage level multiplier.
# Source: n/a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Dependency=Usage Level Option=80% Usage Option=100% Usage Option=120% Usage sampling_probability
Average 0 1 0 0
Medium 0 1 0 0.5
Low 1 0 0 0.25
High 0 0 1 0.25
Low 0 1 0 0.25
High 0 1 0 0.25
# Created by: sources\other\tsv_maker.py
# Description: Dishwasher energy usage level multiplier.
# Source: n/a
Expand Down
53 changes: 32 additions & 21 deletions project_national/national_baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ os_version: 3.7.0
os_sha: d5269793f1
buildstock_directory: ../ # Relative to this file or absolute
project_directory: project_national # Relative to buildstock_directory
output_directory: national_baseline
weather_files_url: https://data.nrel.gov/system/files/156/Buildstock_TMY3_FIPS-1678817889.zip
# weather_files_path: c:/OpenStudio/BuildStock_TMY3_FIPS.zip
output_directory: /kfs2/projects/panels/schedule_based_appliance/test_run20231221
#weather_files_url: https://data.nrel.gov/system/files/156/Buildstock_TMY3_FIPS-1678817889.zip
weather_files_path: /kfs2/shared-projects/buildstock/weather/BuildStock_TMY3_FIPS.zip

sampler:
type: residential_quota
type: precomputed
args:
n_datapoints: 250
sample_file: /kfs2/projects/panels/schedule_based_appliance/buildstock_550K.csv

workflow_generator:
type: residential_hpxml
args:
build_existing_model:
simulation_control_timestep: 60
simulation_control_timestep: 15
simulation_control_run_period_begin_month: 1
simulation_control_run_period_begin_day_of_month: 1
simulation_control_run_period_end_month: 12
simulation_control_run_period_end_day_of_month: 31
simulation_control_run_period_calendar_year: 2007

emissions:
- scenario_name: LRMER_MidCase_15
type: CO2e
elec_folder: data/cambium/2022/LRMER_MidCase_15
#emissions:
#- scenario_name: LRMER_MidCase_15
# type: CO2e
# elec_folder: data/cambium/2022/LRMER_MidCase_15

utility_bills:
- scenario_name: Bills
#utility_bills:
#- scenario_name: Bills

simulation_output_report:
timeseries_frequency: hourly
timeseries_frequency: timestep
include_timeseries_total_consumptions: true
include_timeseries_fuel_consumptions: true
include_timeseries_end_use_consumptions: true
Expand All @@ -58,12 +58,23 @@ workflow_generator:
baseline:
n_buildings_represented: 139647020 # American Community Survey 2021 5-year, B25001, does not include territories ( 138765649 without AK and HI )

eagle:
n_jobs: 3
minutes_per_sim: 30
account: <account you are authorized to use>
postprocessing:
time: 20
n_workers: 1
kestrel:
n_jobs: 240
minutes_per_sim: 2
account: panels
sampling:
time: 5
time: 60
postprocessing:
time: 2000
n_workers: 32

postprocessing:
aws:
region_name: us-west-2
s3:
bucket: resstock-panels
prefix: resstock-panels_runs
athena:
glue_service_role: service-role/AWSGlueServiceRole-default
database_name: resstock_panels
max_crawling_time: 1200
Loading