Avoid giving free energy at the end of a grid outage#1278
Merged
Conversation
sjanzou
reviewed
Feb 17, 2025
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
approved these changes
Feb 18, 2025
sjanzou
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for updating the tests. The max SOC seems to work without the "free energy" results now!
dguittet
approved these changes
Feb 18, 2025
dguittet
left a comment
Collaborator
There was a problem hiding this comment.
It makes sense that the charge in the battery doesn't change unless there's some charging or discharging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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