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 54 commits into
base: dev
Choose a base branch
from

Conversation

JingWang-CUB
Copy link
Collaborator

@JingWang-CUB JingWang-CUB commented Apr 26, 2024

@JingWang-CUB JingWang-CUB linked an issue Apr 26, 2024 that may be closed by this pull request
@jmaguire1 jmaguire1 self-requested a review April 26, 2024 21:20
@jmaguire1 jmaguire1 added enhancement New feature or request Medium Priority labels Apr 26, 2024
# weather_path = os.path.join('path', 'to', 'weather_files')
weather_path = os.path.join(os.getcwd(), 'ResStockFiles', 'Weather')

end_use_names=['HVAC Heating Electric Power (kW)', 'HVAC Cooling Electric Power (kW)', 'Water Heating Electric Power (kW)',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need pool/spa pumps/heaters on this list? I was leaning towards not including those because our model isn't up to snuff, let me confirm with LBNL next time we talk.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The only place this is used is to calculate the whole home amperage, where I think it deserves a discussion whether to monitor whole home power or whole home current. I think we might have discussed this last year but it's worth revisiting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case, don't we need to include all the uncommon electrical loads? Things like well pumps and freezers are only in a small % of homes but definitely affect whole home power.

If you don't already have it I can get you a list of all the ones that'd come up in ResStock.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we should include all loads to make this general. I included these based on what loads there were for the Vermont homes that we simulated last year, but it's not an exhaustive list.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here's everything that can show up but is in a small # of homes:

Extra Refrigerator
Freezer
Hot Tub Spa
Pool Heater
Pool Pump
Well Pump

If it's helpful I can also generate a .xml file for a home with all of these for testing through BEopt.

There's a few uncommon gas loads as well, like gas lighting. Not relevant here but just FYI.

Copy link
Collaborator

@jmaguire1 jmaguire1 left a comment

Choose a reason for hiding this comment

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

Looks great! Have we tested this at all? I'd be curious to see the results from a few test cases:

  • Circuit pausing where we had multiple pauses/year
  • Circuit sharing where CD is being paused.

# 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.

with Pool(n_parallel) as p:
p.starmap(run_single_building, map_args)

my_print('All processes finished, exiting.')
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mnblonsky: It might be useful to at least have examples of running multiple OCHRE runs locally? I know Andrew P was having to figure this out on his own too. Not like it's super hard but it's a common enough use case I'd like to package this into an example file (maybe not so project specific, we might have to modify this slightly and split it into it's own file for example purposes).

from multiprocessing import Pool
import pandas as pd

from ochre import Dwelling, Analysis, ElectricVehicle
Copy link
Collaborator

Choose a reason for hiding this comment

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

In general I think we should split this across multiple files, especially if we want to merge this into OCHRE development. I'll call out specifically how I'd refactor this below, but: none of those reorg changes are required before we start running, it's a longer term change.

my_print('All processes finished, exiting.')


def run_multiple_local(main_folder, overwrite='False', n_parallel=1, n_max=None, *args):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would be super useful to include as an example file, setting up multiple local runs. External people can't rely on HPC like we can.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function was written by Michael and I also find it very useful. I use this to test the controllers locally.



# create OCHRE building based on der type
if der_type == 'ev':
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we be loading existing EV runs to save time, rather than regenerating EV load profiles on the fly?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also worry we might add/drop buildings from the analysis at some point and that'll mess up which home gets which EV across multiple runs. My preference would be to pregenerate EV load profiles and assign different buildings different EV profiles in a .csv so we can be sure it stays consistent across any runs we do for this project.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes we could use pregenerated EV profiles. This work was delayed/canceled due to lack of budget. We can re-open it if needed.

return dwelling


def circuit_sharing_control(sim_type, dwelling, tech1, tech2, output_path):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd love to split circuit sharing and circuit pausing into their own separate file in bin. (or @mnblonsky might have a better suggestions for where it should live). But this is absolutely something that's going to be useful for other projects and I'd like to get it into develop.


control_signal = None

if tech2 == 'Clothes Dryer':
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is all we need for this project, but: theoretically could we generalize this to other appliance end uses? I guess if it uses water as well as power that might get more complicated, but longer term it'd be nice to have this work for as many devices as possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If they are all cycle-based and follow the same control algorithm then we can expand this to more devices.

house_status = dwelling.update(control_signal=control_signal)

# get primary load power
if tech1 in ['Strip Heat']:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We excluded this, but good to have this capability. I think it's much harder to do in practice than it is to do in simulation.

@jmaguire1
Copy link
Collaborator

One more thought @JingWang-CUB: Do we have all the metrics we need for unmet EV load? For water heater and HVAC we track unmet loads, and can look at the difference between baseline and our run. I'm not sure we have something similar for EVs though? Have you looked for this/done any test runs to check?

@JingWang-CUB
Copy link
Collaborator Author

JingWang-CUB commented Jul 17, 2024

One more thought @JingWang-CUB: Do we have all the metrics we need for unmet EV load? For water heater and HVAC we track unmet loads, and can look at the difference between baseline and our run. I'm not sure we have something similar for EVs though? Have you looked for this/done any test runs to check?

I have looked at EV SOC at departure as a discomfort metric. This can be done as part of the post-processing. Is this something you're thinking of?

@mnblonsky
Copy link
Collaborator

One more thought @JingWang-CUB: Do we have all the metrics we need for unmet EV load? For water heater and HVAC we track unmet loads, and can look at the difference between baseline and our run. I'm not sure we have something similar for EVs though? Have you looked for this/done any test runs to check?

We have EV unmet load already. It's based on the departure SOC being lower than it would have been given immediate charging.

@jmaguire1
Copy link
Collaborator

@JingWang-CUB: Is this basically done? Do you think it's ready for review (I'd probably ask @mnblonsky to take a detailed look too), and then we can merge it in?

@jmaguire1
Copy link
Collaborator

jmaguire1 commented Nov 18, 2024

@JingWang-CUB: The plan here was to start a new branch with just the relevant controls script, and leave this branch for the time being in case we have to go back to it for some of the other changes as we're wrapping up the project.

Could you add a note here referencing the new branch when you get a chance, so we have some history of what the ultimate resolution of this was? Having some circuit splitting/pausing code is a good starting point for some of the controls we might want for the new smart panel project.

@JingWang-CUB
Copy link
Collaborator Author

The example code for circuit sharing/pausing and smart EV charging control is merged into dev through this PR: #152 .

@jmaguire1
Copy link
Collaborator

I'll delete this after the project ends (well, we'll see when I remember to go through and clean up PRs at least...), but the changes we wanted were merged in with #152.

@JingWang-CUB
Copy link
Collaborator Author

Please let me know before you delete this branch. We are using the things on this branch for the NYSERDA project.

@jmaguire1
Copy link
Collaborator

@JingWang-CUB: Good to know! I took a pass at cleaning up old repos today (only removing stuff that had been merged). Your local copy won't go anywhere, but I don't really like just leaving things that'll never be merged up forever, it's going to lead to bloat. For this one I'll tag you first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Medium Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circuit sharing and pausing control for panels project TEA
3 participants