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

Circuit sharing and pausing for Panels project TEA #119

Draft
wants to merge 53 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5d56a12
Run multiple script for panels project, runnable initial version
JingWang-CUB Apr 26, 2024
5c644a8
Script for running multiple EV profiles
JingWang-CUB May 7, 2024
68c192b
updating EV inputs for randomization
mnblonsky May 16, 2024
117ab8c
Merge branch 'ev-batt-bugs' of https://github.com/NREL/OCHRE into pan…
JingWang-CUB May 16, 2024
b956e61
Resolve conflicts
JingWang-CUB May 16, 2024
2fb64c8
Add tested circuit sharing and pausing control code
JingWang-CUB Jul 9, 2024
6eca453
include csv containing all control scenarios and panel sizes
JingWang-CUB Jul 18, 2024
594ae80
force to use ideal capacity for variable speed HVAC devices
JingWang-CUB Jul 19, 2024
9502348
1. change timestep 2. add timestamp of dryer interruption 3. not use …
JingWang-CUB Jul 19, 2024
f16323e
Add scenarios list w/o duplicated building ids
JingWang-CUB Jul 26, 2024
88279b8
Changes to run control scenarios from reading a file
JingWang-CUB Jul 31, 2024
14d1358
align end use names with OCHRE
JingWang-CUB Jul 31, 2024
4ac85b2
resolve conflict
JingWang-CUB Aug 1, 2024
6ecf4f2
change level2 EV charger power
JingWang-CUB Aug 1, 2024
ea1e91e
ingore "hot_water_showers" schedule (for now)
jmaguire1 Aug 1, 2024
3ad06c8
merge dev
JingWang-CUB Aug 1, 2024
3d6916c
Initial creation of 120V HPWH model
jmaguire1 Aug 6, 2024
a5cac45
parse 120V HPWH based on temp logic in HPXML for panels branch
jmaguire1 Aug 6, 2024
212c4df
Trying to add a tempering valve, still some hard coded things for panels
jmaguire1 Aug 6, 2024
0ba3e01
More 120V HPWH changes, update test run
jmaguire1 Aug 6, 2024
314e900
Merge remote-tracking branch 'remotes/origin/dev' into 120V_hpwh
jmaguire1 Aug 6, 2024
1411e40
A couple of bug fixes on the initial attempt
jmaguire1 Aug 6, 2024
a1f26fb
merge 120V_hpwh
JingWang-CUB Aug 7, 2024
29bc8ba
Process schedule for low power appliances
JingWang-CUB Aug 7, 2024
78df804
remove unnecessary equipment auguments
JingWang-CUB Aug 13, 2024
75c8a9b
remove simulation_name argument when initializing dwelling
JingWang-CUB Aug 13, 2024
acbda73
update output path
JingWang-CUB Aug 13, 2024
ce59ce5
bug fix for accumulating draw_total values
JingWang-CUB Aug 14, 2024
1174c46
Issue with the tempering valve that accumulated hot draws. Thanks @Ji…
jmaguire1 Aug 15, 2024
fccbfc8
add spreadsheet for timed out circuit sharing scenarios
JingWang-CUB Aug 20, 2024
c5b150a
Revert "add spreadsheet for timed out circuit sharing scenarios"
JingWang-CUB Aug 20, 2024
20f697f
add right timedout spreadsheet
JingWang-CUB Aug 20, 2024
8dd4a52
replace spreadsheet
JingWang-CUB Aug 20, 2024
a6578ad
change some end use power to avoid unrealistic peaks
JingWang-CUB Aug 21, 2024
09f4b3a
code for postprocessing results
JingWang-CUB Aug 21, 2024
93acd03
update log file
JingWang-CUB Aug 21, 2024
cc3fc99
Add in flat garage roofs
jmaguire1 Aug 26, 2024
c08345a
Match roof insulation properties to .idf files
jmaguire1 Aug 26, 2024
9650140
add EV controller
JingWang-CUB Aug 26, 2024
fd375ab
Merge branch 'panel-tea' of https://github.com/NREL/OCHRE into panel-tea
JingWang-CUB Aug 26, 2024
8592674
test sh file for sbatch test run
JingWang-CUB Aug 27, 2024
b781132
adding shower draw for unmet loads
mnblonsky Aug 28, 2024
49350c6
moved some low power HPWH inputs to hpxml.py
mnblonsky Aug 29, 2024
f099d2a
set default tempering valve to off
mnblonsky Aug 29, 2024
03f2a8a
merge 120V_hpwh
JingWang-CUB Sep 3, 2024
90d12f2
uncomment to use hot_water_showers
JingWang-CUB Sep 4, 2024
9aa89c3
prepare for HPC run
JingWang-CUB Sep 6, 2024
deeec2f
Revert "set default tempering valve to off"
jmaguire1 Sep 6, 2024
344fea7
Merge remote-tracking branch 'origin/120V_hpwh' into panel-tea
JingWang-CUB Sep 6, 2024
aeb1c72
One more tempering valve fix
jmaguire1 Sep 6, 2024
ef5f15f
Merge remote-tracking branch 'origin/120V_hpwh' into panel-tea
JingWang-CUB Sep 6, 2024
41cfdc3
default the tempering valve to t_set
jmaguire1 Sep 6, 2024
a7ed790
Merge remote-tracking branch 'origin/120V_hpwh' into panel-tea
JingWang-CUB Sep 6, 2024
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
3,642 changes: 3,642 additions & 0 deletions bin/control_scenarios_processed.csv

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions bin/postprocess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 18 11:40:03 2024

@author: jwang5
"""

import pandas as pd
import os
import numpy as np


#%% identify unsimulated cases except timed out ones
input_path=os.getcwd()

df=pd.read_csv(os.path.join(input_path, 'simulation_log.csv'))
df2=pd.read_csv(os.path.join(input_path, 'control_scenarios_processed.csv'))

# order by upgrade and then building id
df = df.sort_values(by=["Upgrade", "Building ID"], ascending=[True, True])

# double check duplicates
consecutive_duplicates = df['Building ID'] == df['Building ID'].shift()

for i in range(len(consecutive_duplicates)):
if consecutive_duplicates.iloc[i]:
print(f'Found duplicate at index {i}')
# df = df.drop(i)

# df.to_csv(os.path.join(input_path, 'simulation_log.csv'), index=False)

# generate a spreadsheet for failed simulations to rerun
filtered_df = df[df["Status"].str.contains("Completed")]
# check if ochre_complete exists in result folder
for i in range(len(filtered_df)):
upgrade = filtered_df['Upgrade'].iloc[i]
bldg_id = filtered_df['Building ID'].iloc[i]
# result_path = os.path.join(os.getcwd(), '..', 'upgrade'+str(upgrade), 'results', 'simulation_output', 'up01', 'bldg'+str(bldg_id).zfill(7), 'run', 'ochre_output')
result_path = os.path.join(os.getcwd(), 'upgrade'+str(upgrade), str(bldg_id), 'ochre_output')
if not os.path.exists(os.path.join(result_path, 'OCHRE_complete')):
filtered_df['Status'].iloc[i] = 'Failed'

filtered_df = filtered_df[filtered_df["Status"].str.contains("Failed")]

filtered_df2 = df2[df2["building_id"].isin(filtered_df["Building ID"])]
filtered_df2.to_csv(os.path.join(input_path, 'control_scenarios_cs_failed.csv'), index=False)


#%% code for analyzing results
















6 changes: 4 additions & 2 deletions bin/run_dwelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
'time_zone': None, # option to specify daylight savings, in development

# Input parameters - Sample building (uses HPXML file and time series schedule file)
'hpxml_file': os.path.join(default_input_path, 'Input Files', 'sample_resstock_properties.xml'),
'schedule_input_file': os.path.join(default_input_path, 'Input Files', 'sample_resstock_schedule.csv'),
#'hpxml_file': os.path.join(default_input_path, 'Input Files', 'sample_resstock_properties.xml'),
#'schedule_input_file': os.path.join(default_input_path, 'Input Files', 'sample_resstock_schedule.csv'),
'hpxml_file': 'C:/OCHRE-120V-hpwh/in.xml',
'schedule_input_file': 'C:/OCHRE-120V-hpwh/schedules.csv',

# Input parameters - weather (note weather_path can be used when Weather Station is specified in HPXML file)
# 'weather_path': weather_path,
Expand Down
33 changes: 19 additions & 14 deletions bin/run_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
default_args = {
'start_time': dt.datetime(2018, 1, 1, 0, 0), # year, month, day, hour, minute
'time_res': dt.timedelta(minutes=15),
'duration': dt.timedelta(days=10),
'verbosity': 6, # verbosity of results (1-9)
'save_results': False, # if True, must specify output_path
# 'output_path': os.getcwd(),
'duration': dt.timedelta(days=365),
'verbosity': 7, # verbosity of results (1-9)
'save_results': True, # if True, must specify output_path
# 'output_path': os.path.join(os.getcwd(),'EVProfiles','Level2')
}


Expand Down Expand Up @@ -185,25 +185,29 @@ def run_hvac():
CreateFigures.plt.show()


def run_ev():
def run_ev(seed):
equipment_args = {
# Equipment parameters
'vehicle_type': 'BEV',
'charging_level': 'Level 1',
'mileage': 100,
"vehicle_type": "BEV",
"charging_level": "Level 1",
"equipment_event_file": "pdf_Veh4_Level2.csv",
"capacity": 57.5,
"seed": seed,
"output_path": os.path.join(os.getcwd(), "EVProfiles", "Level2", str(seed)),
**default_args,
}

# Initialize equipment
equipment = ElectricVehicle(**equipment_args)

# Simulate equipment
equipment.main_simulator = True
df = equipment.simulate()

print(df.head())
CreateFigures.plot_daily_profile(df, 'EV Electric Power (kW)', plot_max=False, plot_min=False)
CreateFigures.plot_time_series_detailed((df['EV SOC (-)'],))
CreateFigures.plt.show()
# print(df.head())
# CreateFigures.plot_daily_profile(df, 'EV Electric Power (kW)', plot_max=False, plot_min=False)
# CreateFigures.plot_time_series_detailed((df['EV SOC (-)'],))
# CreateFigures.plt.show()


def run_equipment_from_house_model():
Expand All @@ -228,9 +232,10 @@ def run_equipment_from_house_model():
if __name__ == '__main__':
# Choose a scenario to run:

run_battery()
# run_battery()
# run_battery_controlled()
# run_water_heater()
# run_hvac()
# run_ev()
for i in range(1,2):
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mnblonsky: Do you think it's useful to have an example of running level 1 and level 2 charging, or should we revert/comment this out if we're eventually going to merge this? Along with some other EV changes above.

run_ev(i)
# run_equipment_from_house_model()
Loading