-
Notifications
You must be signed in to change notification settings - Fork 114
Grid outage powerflow calculations #594
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
Conversation
…eed to add code to powerflow calcs
… the lifetime labels
…n access the lifetime labels" This reverts commit ad9c316.
…werflow code such that the new variable (powerInterconnecitonLoss) always has the info it needs to report the correct value. Still expect unit test failures for the powerflow code at this stage
…ction/curtailment
…t, then battery, even though it's all the same power at that point
|
"powerInterconnectionLoss calculates the power lost due to interconnection limits, curtailment, or a grid outage. It's not currently possible to specify a grid outage in the GUI (only the tests), but the behavior of the variable can be seen by specifying the interconnection limit to zero." I understand that if the grid is down, then no exporting is possible but I think that the text on the UI should be updated for grid outages... |
sjanzou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems okay, I would still like to go through with the tests and merge in the PVSmoothing changes so I do not have to update all the calls to dispatch_t with the additional argument added to the base class ;-)
| batt_vars->gridCurtailmentLifetime_MW = curtailment_limit; | ||
| batt_vars->grid_interconnection_limit_kW = interconnection_limit; | ||
| if (interconnection_limit < 1e+38) { | ||
| batt_vars->enable_interconnection_limit = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the interconnection limit be forced on? We have a separate variable to enable the interconnection limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular chunk of code doesn't have access to the vartable, so it has to interpret the state of the boolean from the double value. The ssc vartable value you're thinking of is checked in cm_battwatts::setup_variables. I thought this was preferable to passing in two inputs to this function, but welcome other opinions (such as passing in the vartable).
| batt->update_grid_power(*this, PVSystem->p_systemACPower[idx], p_load_full[idx], idx); | ||
| if (en_batt) { | ||
| if (batt->is_outage_step(idx % nrec)) { | ||
| batt->update_grid_power(*this, PVSystem->p_systemACPower[idx], p_crit_load_in[idx % nrec], idx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How dows this work? If the grid is out, how is there any grid power to update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is responsible for updating the interconnection loss variable, given the critical load and the updated PV generation, given the set of AC losses that weren't available when the battery is first run.
I'm fine to hold this until PV smoothing is merged in and take care of the merge conflicts on this branch, if we think we can get PV smoothing merged in within the next week or so. |
I can update UI (and Help) descriptions like these after the code is implemented. The "interconnection loss" includes all power "lost" at the interconnection point, i.e., not delivered to the grid because of the interconnection limit, curtailment, or a grid outage. |
dguittet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! LGTM.
I think some updated comments, and updating this PR's info and the things in Help to make clear what power flows are changed and how, by an outage vs grid limits, etc (such as asked by my comments).
shared/lib_battery_powerflow.cpp
Outdated
| P_pv_to_batt_dc = 0.0; // Don't allow losses to drive this negative | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line?
| EXPECT_NEAR(m_batteryPower->powerBatteryToLoad, 0, error); | ||
| EXPECT_NEAR(m_batteryPower->powerConversionLoss, 0, error); | ||
| EXPECT_NEAR(m_batteryPower->powerSystemLoss, 0.5, error); | ||
| EXPECT_NEAR(m_batteryPower->powerCritLoadUnmet, 25.5, error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to remember and make explicit to users that the Critical Unmet load can be higher than original critical load due to system losses
| check_net_flows("1st case"); | ||
|
|
||
| // battery steals all of the energy and leaves critical load unmet - dispatch controller needs to avoid this situation | ||
| m_batteryPower->powerBatteryDC = -100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an earlier case line 826, the battery charging is reduced because it couldn't be charged from grid during an outage. Here the battery charging is not reduced because it could be charged from the system. While I understand the how this is an intermediate state for the dispatch / power flow code, it's another thing we need to make explicit.
…ariables that it handles are correct, but these losses need to be recorded somewhere for things to add up
…to show losses in the powerflow calculations. Fix the interconnection losses reported at night. Fix a few typos and copy paste errors throughout the loss code
sjanzou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the pv smoothing library. Did Paul sign off on the new output names? LGTM and all tests passing!
| { SSC_OUTPUT, SSC_ARRAY, "ac_transmission_loss", "Transmission loss", "kW", "", "Time Series (Transmission)", "", "", "" }, | ||
|
|
||
| // Post batt AC losses - record so the powerflows from PV and batt to grid add up properly | ||
| { SSC_OUTPUT, SSC_ARRAY, "ac_perf_adj_loss", "AC performance adjustment loss", "kW", "", "Time Series (AC Loss)", "", "", "" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpaulgilman, do you like the "friendly" names here?

Adds new variables to lib battery powerflow and partially connects them to the battery cmods.
New inputs:
New outputs:
powerInterconnectionLoss calculates the power lost due to interconnection limits, curtailment, or a grid outage. It's not currently possible to specify a grid outage in the GUI (only the tests), but the behavior of the variable can be seen by specifying the interconnection limit to zero.
This is the first of several PRs over the next few weeks for the Puerto Rico project. Future PRs will include:
Some of this work builds towards NREL/SAM#181 - since the dispatch classes will now have access towards the numbers they need.