Skip to content

Allow BESS to Export#471

Open
adfarth wants to merge 77 commits into
developfrom
bess-export
Open

Allow BESS to Export#471
adfarth wants to merge 77 commits into
developfrom
bess-export

Conversation

@adfarth

@adfarth adfarth commented Jan 7, 2025

Copy link
Copy Markdown
Collaborator

Added

  • Allow ElectricStorage to export to the grid with input options for grid export: can_net_meter, can_wholesale, can_export_beyond_nem_limitand associated decision variable dvStorageToGrid
  • Add result ElectricStorage storage_to_grid_series_kw

Fixed

  • Bug in max benefit constraint for WHL export; bug allowing for both WHL and NEM to be used

TODO:

  • Add BESS inputs for can_net_meter, can_wholesale, can_export_beyond_nem_limit
  • index dvStorageToGrid on metering type, following the logic of tech export bins
  • Determine whether to use dvs for total BESS discharge & BESStoGrid vs. BESStoLoad & BESStoGrid --> Choosing to mirror tech production by using dvDischargeFromStorage as total discharge with dvStorageToGrid
  • Incorporate dvStorageToGrid into load balancing constraints
  • Test outputs against expected values
  • Review and update emissions calculations to account for BESS export
  • Check and remove all references to "can_export_to_grid" (currently commented out)

Things to test:

  • BESS has NEM and PV does not --> This is now fixed and allowed
  • BESS has wholesale and PV does not --> should allow this (and test)
  • All 3 new inputs for BESS
  • Different solvers (with vs without indicator constraint compatibility)
  • PV has NEM or WHL and BESS does not
  • Make sure BESS serves load first
  • Test with thermal storage
  • Test solve time impacts compared to master branch (impacting solve times even without allowing BESS to export?)
  • Check export in MPC -- not currently high priority so could remove if this adds a lot of work

Future work:

  • Consider adding other frameworks outside of net metering or net billing. E.g. BESS can export and not receive any compensation, or can export and receives a per kWh compensation during defined periods (or other VPP/demand response compensation schemes)
  • Battery can now discharge to the grid, but this export is not yet accounted for in the RE calculation. This is only relevant if include_exported_renewable_electricity_in_total = false. If false, the battery could become a "back door" for export of RE to the grid since it's not subtracted here. Will require tracking of RE in BESS.

Notes/Assumptions:

  • BESS kW capacity does NOT count towards net metering limit
  • ElectricStorage can end up being sized, and export, much more than the peak load (this is currently true in develop, too, but now the issue is more extreme)

Comment thread src/constraints/electric_utility_constraints.jl
Comment thread src/constraints/storage_constraints.jl Outdated
Comment thread src/constraints/storage_constraints.jl Outdated
Comment thread src/core/energy_storage/electric_storage.jl Outdated
Comment thread src/core/reopt.jl Outdated
Comment thread src/core/reopt.jl Outdated
Comment thread src/core/reopt_multinode.jl Outdated
Comment thread src/mpc/model_multinode.jl Outdated
Comment thread src/core/reopt_inputs.jl Outdated
Comment thread src/core/reopt_inputs.jl Outdated
@adfarth adfarth changed the title Allow BESS to Export and Fixed SOC Allow BESS to Export May 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mpc/structs.jl
Comment thread src/core/energy_storage/electric_storage.jl
Comment thread test/development_tests.jl Outdated
Comment thread test/development_tests.jl Outdated
Comment thread test/development_tests.jl Outdated
Comment thread test/runtests.jl
Comment thread src/constraints/renewable_energy_constraints.jl
Comment thread src/constraints/electric_utility_constraints.jl
Comment thread src/core/reopt.jl
@adfarth adfarth marked this pull request as ready for review June 9, 2026 22:11
@adfarth adfarth requested a review from lixiangk1 June 9, 2026 22:11
Comment thread src/constraints/electric_utility_constraints.jl
Comment thread src/core/energy_storage/electric_storage.jl Outdated
Comment thread src/constraints/electric_utility_constraints.jl Outdated
Comment thread src/mpc/structs.jl Outdated
@lixiangk1

Copy link
Copy Markdown
Collaborator

I'm not sure how to add comments to files that haven't been changed, but...

  • Wondering if there should be an update to results/electric_tariff.jl#L230 to consider BESS exports?
  • Haven't checked MPC exports thoroughly, but may need to add dvStorageToGrid to the function at mpc/constraints.jl#L28

@adfarth

adfarth commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

I'm not sure how to add comments to files that haven't been changed, but...

  • Wondering if there should be an update to results/electric_tariff.jl#L230 to consider BESS exports?
  • Haven't checked MPC exports thoroughly, but may need to add dvStorageToGrid to the function at mpc/constraints.jl#L28

Great catch on electric_tariff.jl. I updated that to account for BESS export and fixed a bug in there.

Also updated the mpc constraint: c5a452c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants