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

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

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

brtietz
Copy link
Collaborator

@brtietz brtietz commented Feb 14, 2025

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

Copy link
Collaborator

@sjanzou sjanzou left a comment

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
Copy link
Collaborator Author

brtietz commented Feb 17, 2025

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.

Copy link
Collaborator

@sjanzou sjanzou left a 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 tests. The max SOC seems to work without the "free energy" results now!

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.

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
8 checks passed
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
3 participants