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

Sam 1869 battery adjust losses #1241

Merged
merged 26 commits into from
Nov 14, 2024
Merged

Conversation

brtietz
Copy link
Collaborator

@brtietz brtietz commented Nov 8, 2024

Add adjust/availability losses to batteries.

These losses affect both power and capacity, such that when a loss kicks in the battery has x% of each at that time. We assume that the cells have to be discharged to work on them safely, so x% is removed from state of charge and needs to be returned once the loss is over.

Note that this can lead to SOC less than the minimum SOC on the dispatch page. For example, a battery with a 10% minimum SOC and a 50% availability loss could go down to 5%.

Pairs with SAM pull request: NREL/SAM#1902

Closes NREL/SAM#1869

…onvention (PV only applies to PV when AC connected
…ill has a problem with a giant resistor that doesn't exist
@@ -394,17 +399,22 @@ bool dispatch_t::restrict_power(double& I)
}
else
{
if (std::abs(powerBattery) > m_batteryPower->powerBatteryDischargeMaxDC * (1 + low_tolerance))
double max_discharge_dc = (1 - m_batteryPower->adjustLosses) * m_batteryPower->powerBatteryDischargeMaxDC;
double max_discharge_ac = (1 - m_batteryPower->adjustLosses) * m_batteryPower->powerBatteryDischargeMaxAC;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sprinkling (1 - m_batteryPower->adjustLosses) around everywhere seems like a potentially leaky way to handle this loss adjustment. I think this final post-loss max value should be concretely defined somewhere, and then used where appropriate...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call - making those variables private revealed several locations I'd missed. Addressed in latest push.

Copy link
Collaborator

@cpaulgilman cpaulgilman left a comment

Choose a reason for hiding this comment

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

I'm getting a simulation error now with hourly simulations when the time series battery availability losses are in Hourly mode. This is for both PV-Battery and PVWatts-Battery configurations.

exec fail(battery): failed to setup battery adjustment factors: Time series availability losses must have the same time step as the simulation time step unless losses are daily, weekly, monthly, annual, or single value.
Simulation pvsamv1 failed :exec fail(battery): failed to setup battery adjustment factors: Time series availability losses must have the same time step as the simulation time step unless losses are daily, weekly, monthly, annual, or single value.
monthly_grid_to_batt not assigned
Simulation singleowner failed :monthly_grid_to_batt not assigned

@brtietz
Copy link
Collaborator Author

brtietz commented Nov 12, 2024

I'm getting a simulation error now with hourly simulations when the time series battery availability losses are in Hourly mode. This is for both PV-Battery and PVWatts-Battery configurations.

exec fail(battery): failed to setup battery adjustment factors: Time series availability losses must have the same time step as the simulation time step unless losses are daily, weekly, monthly, annual, or single value.
Simulation pvsamv1 failed :exec fail(battery): failed to setup battery adjustment factors: Time series availability losses must have the same time step as the simulation time step unless losses are daily, weekly, monthly, annual, or single value.
monthly_grid_to_batt not assigned
Simulation singleowner failed :monthly_grid_to_batt not assigned

Ugh, thanks for catching that. Fortunately it was an easy fix!

@cpaulgilman
Copy link
Collaborator

I'm getting a simulation error now with hourly simulations when the time series battery availability losses are in Hourly mode. This is for both PV-Battery and PVWatts-Battery configurations.

exec fail(battery): failed to setup battery adjustment factors: Time series availability losses must have the same time step as the simulation time step unless losses are daily, weekly, monthly, annual, or single value.
Simulation pvsamv1 failed :exec fail(battery): failed to setup battery adjustment factors: Time series availability losses must have the same time step as the simulation time step unless losses are daily, weekly, monthly, annual, or single value.
monthly_grid_to_batt not assigned
Simulation singleowner failed :monthly_grid_to_batt not assigned

Ugh, thanks for catching that. Fortunately it was an easy fix!

Hourly time series losses are working now for PV-Battery (I tested FOM and BTM), but I'm still getting the simulation error for PVWatts-Battery.

@brtietz
Copy link
Collaborator Author

brtietz commented Nov 13, 2024

Hourly time series losses are working now for PV-Battery (I tested FOM and BTM), but I'm still getting the simulation error for PVWatts-Battery.

Thanks for your patience while testing this. This should be fixed - it required changes to both ssc and SAM (lk to pass the right analysis period).

@cpaulgilman
Copy link
Collaborator

Hourly time series losses are working now for PV-Battery (I tested FOM and BTM), but I'm still getting the simulation error for PVWatts-Battery.

Thanks for your patience while testing this. This should be fixed - it required changes to both ssc and SAM (lk to pass the right analysis period).

PVWatts-Battery is working correctly now. Thanks for the fixes!

Copy link
Collaborator

@dguittet dguittet left a comment

Choose a reason for hiding this comment

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

Thanks!!

@brtietz brtietz merged commit da7f153 into develop Nov 14, 2024
8 checks passed
@brtietz brtietz deleted the sam_1869_battery_adjust_losses branch November 14, 2024 21:35
cpaulgilman added a commit to NREL/SAM that referenced this pull request Dec 7, 2024
Grid limits do not affect electricity imports from the grid.

Revise IPH molten salt linear Fresnel topics

Power tower heliostast pivot point height definition.

New Financial Parameters topic for LCOH Calculator.

Wind wake loss inputs NREL/ssc#1186

Annual energy and monthly energy label updates: NREL/ssc#1236

Replace parentheses with commas for installation cost units

Battery availability loss. NREL/ssc#1241

Tidal Energy Converter page revisions for new options, see #1807.

New net billing with carryover options. NREL/ssc#1200

IPH MSLF revisions: #1444

Fix fuel cell model link https://www.nrel.gov/hydrogen/fuel-cell-power-model.html, replace with https://www.nrel.gov/docs/fy13osti/57457.pdf.

PV GCR affects output for bifacial modules.

Revise report generator topic to explain template not available for some configurations.

Add topics for IPH financial models

Generic system to custom generatio profile

Standalone battery time step

New autographs and default graphs for battery configurations: #1884

System Availability three hour option for marine, "hourly" to "time series"

## October 24, 2024

Update Cambium note about years for Cambium 2023

Battery dispatch (BTM and FOM) battery can charge from grid-limited system power

Grid limits battery can charge from grid-limited system power

Project with 100% debt results in IRR = NaN

Revise real discount rate description

Geothermal system availability losses

Revise metrics topics to facilitate navigation.

Revise weather file format to include CSV for wind

Revise PV subhourly clipping "Allen method"

Revise Cost of Acquiring Financing.
cpaulgilman added a commit to NREL/SAM that referenced this pull request Dec 10, 2024
* Help revisions for SAM 2024.12.12

Grid limits do not affect electricity imports from the grid.

Revise IPH molten salt linear Fresnel topics

Power tower heliostast pivot point height definition.

New Financial Parameters topic for LCOH Calculator.

Wind wake loss inputs NREL/ssc#1186

Annual energy and monthly energy label updates: NREL/ssc#1236

Replace parentheses with commas for installation cost units

Battery availability loss. NREL/ssc#1241

Tidal Energy Converter page revisions for new options, see #1807.

New net billing with carryover options. NREL/ssc#1200

IPH MSLF revisions: #1444

Fix fuel cell model link https://www.nrel.gov/hydrogen/fuel-cell-power-model.html, replace with https://www.nrel.gov/docs/fy13osti/57457.pdf.

PV GCR affects output for bifacial modules.

Revise report generator topic to explain template not available for some configurations.

Add topics for IPH financial models

Generic system to custom generatio profile

Standalone battery time step

New autographs and default graphs for battery configurations: #1884

System Availability three hour option for marine, "hourly" to "time series"

## October 24, 2024

Update Cambium note about years for Cambium 2023

Battery dispatch (BTM and FOM) battery can charge from grid-limited system power

Grid limits battery can charge from grid-limited system power

Project with 100% debt results in IRR = NaN

Revise real discount rate description

Geothermal system availability losses

Revise metrics topics to facilitate navigation.

Revise weather file format to include CSV for wind

Revise PV subhourly clipping "Allen method"

Revise Cost of Acquiring Financing.

* Help revisions

Revise "receiver startup delay time" and "receiver startup delay energy fraction" descriptions for trough and Fresnel models.

Fix remaining references to "generic system" model.

---------

Co-authored-by: Steven Janzou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loss factors widget for batteries
3 participants