Balance internal commodity nodes (heat/steam networks) via first-class balance groups#2289
Open
Flix6x wants to merge 3 commits into
Open
Balance internal commodity nodes (heat/steam networks) via first-class balance groups#2289Flix6x wants to merge 3 commits into
Flix6x wants to merge 3 commits into
Conversation
Adds a balance_groups argument to device_scheduler: each group lists the devices of an internal commodity node (e.g. a heat or steam network without a grid connection) whose stock-side flows must sum to zero at every time step. This replaces the reference-device min=max=0 stock-group workaround used by the factory scenario, which is now tested in both modes. The StorageScheduler derives balance groups from the flex-config: a non-electricity commodity without energy prices becomes an internal node (previously this raised 'Missing consumption price'). Together with coupling groups (one flex-model entry per converter port), this makes the factory scenario (CHP + gas boiler + e-heater meeting a fixed steam demand) schedulable end-to-end through StorageScheduler.compute(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B
…terms A device can sit in both a commodity balance group (via its commodity) and a shared-stock group (via its state-of-charge sensor), e.g. a steamer that discharges a heat buffer to produce steam. Its derivative efficiencies and stock delta (e.g. the buffer's soc-usage losses assigned to it) describe the stock-side conversion and must not leak into the commodity balance: what crosses the node is the device's power flow (ems_power). Found while running a realistic factory scenario, where the heat buffer's soc-usage drain was distorting the steam balance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B
Member
Author
|
Supersedes #2279 (same content; one commit message reworded — the original couldn't be amended in place since force-pushes are blocked by repository rules). The #2272 interaction note from #2279 applies here unchanged. 🤖 Generated with Claude Code |
4 tasks
Documentation build overview
13 files changed ·
|
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.
Description
Stacked on #2218. Completes the missing piece of the CHP/factory work: scheduling a multi-commodity factory end-to-end through
StorageScheduler.compute().device_schedulergains abalance_groupsargument: each group lists the devices of an internal commodity node (a heat or steam network without a grid connection) whose stock-side flows must sum to zero at every time step. This replaces the earlier workaround of overlapping stock groups with a min=max=0 "reference device" (which never worked automatically from a flex-model — see the investigation notes ondev/simulate-factory).Missing consumption price). Electricity still requires a price.couplinggroup — so per-commodity balance groups are disjoint and no overlapping group tricks are needed.documentation/changelog.rstHow to test
The engine-level factory test is parametrized to run in both modes (reference-device stock groups and balance groups) and must produce identical dispatch. The new StorageScheduler test drives the full factory (CHP + gas boiler + e-heater + steamer meeting a fixed 15 kW steam demand from an inflexible sensor) purely from a flex-model and flex-context.
Further Improvements
Related Items
Stacked on #2218; continues the work explored on
dev/simulate-factory(#2113-era factory simulation).🤖 Generated with Claude Code
https://claude.ai/code/session_016MLCUiSdXDqDBmg8GbYp1B