pypsa-eur icon indicating copy to clipboard operation
pypsa-eur copied to clipboard

Refactor: Implementation of ptes temperature boosting constraints

Open TomKae00 opened this issue 5 months ago • 0 comments

Changes proposed in this Pull Request

Addresses issue #1728. Incorporates #1748 (with minor fixes).

This PR introduces temperature boosting for Pit Thermal Energy Storage (PTES) during both discharging (to meet district heating (DH) forward temperature) and charging (to raise PTES top temperature and increase usable capacity). Boosting is modeled via linear constraints that couple PTES flows with booster technologies—resistive heaters, air-source heat pumps (ASHP) for charging and discharging, and a PTES-sourced heat pump for discharge boosting.

Additionally, a new class TesTemperatureMode enables selecting the PTES top-temperature regime:

  • constant — keeps the PTES top temperature fixed at the configured maximum.
  • dynamic — tracks the DH forward setpoint (a function of ambient temperature) until the setpoint exceeds the PTES maximum; beyond that, the top temperature is clamped at the maximum.

Model assumptions

  • PTES max top temperature T_top,max = 90 °C.
  • PTES bottom temperature T_bottom = 35 °C.
  • Both charge and discharge boosting may be enabled to enforce physically consistent temperature levels.
  • When charge_boosting_required = true, temperature_profile = dynamic is not permitted (the forward temperature is boosted up to T_top,max, so the dynamic rule would collapse to the constant case). Use temperature_profile = constant in that situation.
  • The charge boosting ratio is clipped at 1.0 to prevent heat venting, since booster technologies can also be used to charge the PTES.

Boosting ratios

Let

  • $\dot V$ … volumetric flow rate (assumed constant),
  • $\rho$ … fluid density (assumed constant),
  • $c_p$ … specific heat capacity (assumed constant),
  • $T_{\text{return}}$ … DH return temperature,
  • $T_{\text{fwd}}$ … DH forward temperature setpoint,
  • $T_{\text{store}}$ … PTES top temperature at the considered time step,
  • $T_{\text{top,max}}$ … configured maximum PTES top temperature,
  • $T_{\text{bottom}}$ … PTES bottom temperature.

Generic heat-rate form:

$$ Q = \dot V\ \cdot\ \rho\ \cdot\ c_p\ \cdot\ \Delta\ T $$

Discharging (meeting the DH forward temperature)

The discharge boosting ratio $\gamma_d$ quantifies the extra lift required from boosters relative to what PTES already supplies:

$$ \gamma_d \equiv \frac{Q_{\text{boost}}}{Q_{\text{discharge}}} = \frac{T_{\text{fwd}} - T_{\text{store}}}{T_{\text{store}} - T_{\text{return}}} $$

A value of 0 means no boosting ($T_{\text{store}}\ge T_{\text{fwd}}$); larger values imply more boosting is required.

Charging (raising the PTES top temperature)

To fill the storage from the DH return up to the maximum top temperature, split the total energy as

Define the charge boosting ratio $\gamma_c$ as

$$ \gamma_c \equiv \frac{Q_{\text{boost}}}{Q_{\text{charge}}} = \frac{T_{\text{top,max}} - T_{\text{fwd}}}{T_{\text{fwd}} - T_{\text{return}}} $$

Wherever $T_{\text{fwd}} \ge T_{\text{top,max}}$, we set $\gamma_c = 0$ since no further boost is needed.


Constraints

We derive a direct-utilisation indicator from the boosting ratio,

$$ \phi(\gamma) = \frac{\gamma}{\gamma+\varepsilon} $$

with small $\varepsilon>0$. It acts as a smoothed 0/1 gate in the constraints: if no boosting is needed ($\gamma=0$), then $\phi=0$ and the RHS vanishes—disabling the coupling so dispatch variables remain free; if boosting is required ($\gamma>0$), $\phi>0$ activates the coupling. The $\varepsilon$ term is only for numerical stability and has no physical meaning.

Discharging constraint

For discharger link $d$:

$$ (COP_{ptes} - 1) \cdot p_{ptes} + \sum_{b \in B} p_b \cdot\ \beta_b \ge\ \phi(\gamma_d)\ \cdot\ p_d $$

PTES-HP source cap. Each PTES-sourced heat pump draws its thermal source from the PTES discharge, so its boost contribution is capped by the portion of discharge that actually requires boosting. For every $h \in H$:

$$ (COP_{ptes} - 1)\cdot p_{ptes} \le \phi(\gamma_d)\cdot p_d $$

Where:

  • $B$: set of booster technologies; $p_b$ their dispatch; $\beta_b$ their discharge boosting factor.
  • $p_d$, $\gamma_d$: discharger dispatch and its boosting ratio profile .

PTES-HP accounting. In prepare_sector_network, the PTES-sourced heat pump is represented as a link converting 1 unit of electric power to 1 unit of heat (because its thermal source is the PTES). The energy balance follows

$$ Q_{\text{out}} = Q_{\text{source}} + P_{\text{el}} $$

where the $Q_{\text{source}}$ term is simultaneously accounted by the PTES discharger delivering heat directly to the DH system. This split preserves the correct PTES energy balance for HP operation.

Charging constraint

For each charger link $c$:

$$ \sum_{b \in B} p_b \cdot\ \beta_b \ge\ \phi(\gamma_c)\ \cdot\ p_c $$

  • $B$: set of booster technologies; $p_b$ their dispatch; $\beta_b$: charge boosting ratio
  • $p_c$, $\gamma_c$: charger dispatch and its boosting ratio profile

Limitations & future work

  • PTES-HP sourcing: The PTES-sourced heat pump can, in principle, exploit temperatures below 35 °C. A more detailed implementation could pre-heat DH return via PTES (heat exchanger) and let the HP provide the remaining lift via mixing—expanding usable storage capacity.
  • Top-temperature trajectory: The PTES top temperature is likely time-varying in practice; extending beyond constant/dynamic to a more realistic trajectory model would improve fidelity.
  • Selective charge boosting: Not all technologies should require charge boosting. Distinguish high-temperature sources (e.g., resistive heaters, CHP) that can charge directly at $T_{\text{top,max}}$ from low-temperature sources (e.g., geothermal at ~65 °C) that either cannot charge directly or would require boosting.

Testing

scenario:
  clusters:
  - 16
  planning_horizons:
  - 2030

foresight: overnight
countries: ['DE', 'PL', 'AT' ,'DK']

sector:
  district_heating:
    ptes:
      enable: true
      dynamic_capacity: false
      discharge_boosting_required: true #false
      charge_boosting_required: true #false
      temperature_profile: 'constant'
      booster_technologies: [ "resistive heater", "air heat pump", "water pits heat pump" ]
      max_top_temperature: 90
      min_bottom_temperature: 35
    ttes:
      enable: true
  heat_pump_sources:
    urban central:
      - water pits
      - air
      - geothermal

clustering:
  temporal:
    resolution_sector: 6h

Results


Total system cost

Scenario Total cost [€ bn] Δ vs. no boosting [€ bn] Δ vs. no boosting [%]
No charge & no discharge boosting 169.94
Charge and discharge boosting 170.21 0.27 0.16%
Discharge boosting only (no charge boost) 169.98 0.04 0.03%

Scenario overviews

No charge & no discharge boosting

overview_master_PL0_0

Charge & discharge boosting (“bidiboost”)

overview_bidiboost_PL0_0

Discharge boosting only

overview_discharge_PL0_0

Interpretation

  • With no boosting, PTES can be used freely year-round; resistive heaters cover the required charging.
  • Under charge & discharge boosting, resistive-heater capacity is unchanged, but an air-source heat pump is additionally built to provide winter boosting (notably November–December).
  • With discharge-only boosting, boosting is handled solely by the resistive heater.
  • The current PTES-sourced HP configuration is not competitive against resistive heaters / ASHP for boosting in these runs. If bottom-temperature cooling were allowed only for PTES-HP (as in practice) and implemented as outlined in Future work, relative competitiveness could shift.

Heat balances

boost_compare

PTES remains present across scenarios. In master (no boosting) and discharge-only cases, PTES usage is stronger; with bidiboost, PTES capacity declines and TTES becomes relatively more favored, though PTES is still built.

Checklist

  • [x] I tested my contribution locally and it works as intended.
  • [x] Code and workflow changes are sufficiently documented.
  • [x] Changes in configuration options are added in config/config.default.yaml.
  • [x] Changes in configuration options are documented in doc/configtables/*.csv.
  • [x] A release note doc/release_notes.rst is added.

TomKae00 avatar Jul 21 '25 16:07 TomKae00