Skip to content

Avoid giving free energy at the end of a grid outage#1278

Merged
brtietz merged 4 commits into
patchfrom
ssc_1270_solve_free_energy
Feb 18, 2025
Merged

Avoid giving free energy at the end of a grid outage#1278
brtietz merged 4 commits into
patchfrom
ssc_1270_solve_free_energy

Conversation

@brtietz

@brtietz brtietz commented Feb 14, 2025

Copy link
Copy Markdown
Collaborator

The check_SOC() function in capacity_t was written before the grid outage code, and didn't expect the SOC limits to change dynamically during the simulation. Therefore at the end of the grid outage, the check_SOC() function granted the battery some free energy.

Changing the function means that the charge value is only adjusted when the current is adjusted, and the battery doesn't spontaneously gain energy without charging.

Test file here: ssc_1270_test_case (2).zip
Expectation is that the grid outage will end a few hours before the battery recharges above 10% (even though the minimum SOC is 30%.

Fixes #1270

@brtietz brtietz added this to the 2024 Release Patch 1 milestone Feb 14, 2025
@brtietz brtietz requested review from dguittet and sjanzou February 14, 2025 23:24

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe one more test to update - seems consistent on all platforms
image

@brtietz

brtietz commented Feb 17, 2025

Copy link
Copy Markdown
Collaborator Author

Thanks for flagging! I also realized the max SOC code required the same change, so have updated the test file and the manual tests to deal with that case.

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for updating the tests. The max SOC seems to work without the "free energy" results now!

@dguittet dguittet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It makes sense that the charge in the battery doesn't change unless there's some charging or discharging

@brtietz brtietz merged commit 8e31c5d into patch Feb 18, 2025
@brtietz brtietz modified the milestones: 2024 Release Patch 1, SAM Spring 2025 Release Mar 7, 2025
@brtietz brtietz deleted the ssc_1270_solve_free_energy branch April 18, 2025 22:23
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.

Batteries get free energy at the end of a grid outage

4 participants