Skip to content

Fix heat pump constraints - #787

Open
danielelerede-oet wants to merge 16 commits into
PyPSA:developfrom
open-energy-transition:fix_heat_pump_constraints
Open

danielelerede-oet wants to merge 16 commits into
PyPSA:developfrom
open-energy-transition:fix_heat_pump_constraints

Conversation

@danielelerede-oet

@danielelerede-oet danielelerede-oet commented Aug 28, 2026

Copy link
Copy Markdown

Changes proposed in this Pull Request

This PR fixes heating/cooling coupling constraints for air-source and ground-source heat pumps.

The previous implementation selected cooling Links using -cooling, although the network builder uses -cool. It also mixed the Link and Link-ext dimensions, introducing a Cartesian product instead of one operating constraint per heat pump pair and snapshot.

Changes include:

  • Pair heating and cooling Links explicitly by name, independently of their ordering.
  • Align dispatch, COP profiles and nominal capacities on the same Link dimension.
  • Preserve the existing capacity equality and shared heating/cooling output limit.
  • Support static and time-varying COPs, selected model snapshots, and fixed capacities, including those frozen during myopic optimisation.
  • Validate missing counterparts and inconsistent fixed capacities.

Changes are confined to workflow/scripts/opts/sector.py and the branch builds on defer_sector_demand (see #786 ), which in turn builds on improve_workflow (see #785 ).

Model size and solver runtime observed on the full US sector-coupled model with 134 clusters and 168h resolution:

Metric Before After Change
Constraints 10,155,525 2,570,589 −75%
Variables 1,160,100 1,160,100 Unchanged
Barrier iterations 280 78 −72%
Gurobi-reported barrier solve time 19,409.90 s (~5 h 23 min) 94.25 s −99.5% (~206× speedup)

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.

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.

1 participant