NREL / REopt-Analysis-Scripts

BSD 3-Clause "New" or "Revised" License
33 stars 35 forks source link

Resilience and outage time and date #59

Closed Janeyyt closed 2 years ago

Janeyyt commented 2 years ago

Hi! I have a question about using the ReOpt API. I was wondering if it is possible to add resilience as a goal in the optimization like the Step 1 on the ReOpt web app? I saw in the output json file that there is LoadProfile|resilience_check_flag, but I don't know how to set it in the input. Another question is that, what is the different between outage_start_hour and outage_start_time_step? If I'm using 15 min interval load data, should the time step be multiplied by 4? I'd really appreciate your help. Thanks!

NLaws commented 2 years ago

Resilience scenarios in the web app are the same as adding an outage to the model. When an outage is included in the model the critical load must be met during the outage. (The web app also runs the same scenario without the outage for the "Financial" comparison on the results page.)

The outage_start_hour is an old input that has been kept for backwards compatibility. You can use the outage_start_time_step value for 15 minute interval load data.

Our wiki has a link to all of the API inputs:

resilience_check_flag is not an input; It is true if the critical load can be met during the outage with the existing generation technologies: https://github.com/NREL/REopt_API/blob/bb85165ecfad7ff478e80b7746a8a755f658167d/reo/src/load_profile.py#L769 In the next major API version the resilience_check_flag output will be renamed to bau_critical_load_met: https://github.com/NREL/REopt_API/blob/fb89f2c17fba2aec8d0d5d1eaa901415dfd129b0/job/models.py#L799 (bau = business-as-usual)

Janeyyt commented 2 years ago

Thank you Nick for getting back to me on this. This really clarifies things a lot. A follow-up question on the resilience criterion. I added an outage for 4 hours (16 time steps) , with the chosen technologies of solar, battery storage, and with or without generator. In both specifications, the resilience_check_flag returned to be false. Is there a way that I can force the outage to be met? I run the same assumptions with the Web Tool and the optimized capacities are very different. I think the resilience issue might be playing a role here. I'd really appreciate it if you could help me with this. Thanks!

NLaws commented 2 years ago

The resilience_check_flag only applies to the business-as-usual scenario. For every "Scenario" that you POST to the job endpoint two scenarios are run:

  1. The business-as-usual (BAU) scenario, which determines the cost of meeting the (electric and thermal) loads with the grid and any existing technologies; and
  2. The optimal scenario, which determines the cost-optimal size and dispatch of considered technologies.

In your case, the false resilience_check_flag indicates that the critical load is not entirely met in the BAU scenario (if you have no existing technologies then zero percent of the critical load is met in the BAU scenario). If you want to include an existing Generator for example then you must provide the generator capacity in the existing_kw input field.

One reason for the differences in your webtool and API scenarios could be that the webtool only runs hourly models (even if 15 minute data is provided). We do this in the webtool because 15 minute scenarios typically take longer to solve than hourly scenarios.

Janeyyt commented 2 years ago

Thank you Nick, this makes perfect sense now. I will go with the API solved optimal capacities then. Thank you!

NLaws commented 2 years ago

@Janeyyt you're welcome! And FYI we have a Discussions tab for general usage questions of the API and Webtool. (I will copy this discussion into the Resilience section there).