Skip to content

Report the Cost of External Hydrogen in the Cost Summary - #241

Merged
erikfilias merged 3 commits into
masterfrom
fix/cost-summary-hydrogen-sources
Nov 27, 2026
Merged

erikfilias merged 3 commits into
masterfrom
fix/cost-summary-hydrogen-sources

Conversation

@erikfilias

@erikfilias erikfilias commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A hydrogen source, i.e., a reformer or an import terminal declared through MaximumProductionH2, produces hydrogen at ProductionCostH2. Its cost enters the total system cost through vTotalH2SrcCost in eTotalTCost. However, the cost summary has no row for it, so its rows do not add up to the total system cost, and the difference equals the hydrogen source cost.

None of the shipped cases declares a hydrogen source, so neither the cases nor the tests reach this path.

Observed behaviour

Case 9nH2 with one reformer added on Node_1 (0.5 tH2/h at 2000 EUR/tH2), solved with HiGHS for the full year:

MEUR
Total system cost (vTotalSCost, total_cost_meur) 195.7821
Sum of the cost summary rows, master 190.5241
Hydrogen source cost (vTotalH2SrcCost, weighted) 5.2580

The gap of 5.2580 MEUR (2.7 % of the total system cost) equals the hydrogen source cost exactly.

Solution

CostSummaryResults writes the hydrogen source cost per period in a row named Operation Cost External Hydrogen. The hydrogen of a source is external: it is bought at a fixed price from outside the modelled system, as the gas burnt by a reformer is not modelled either. The model does not distinguish a reformer from an import terminal, so the row covers both. Hydrogen from electrolysis is not in this row, since its cost is the electricity it uses, which the electricity rows already report. The row is added only when the case models hydrogen and has at least one source, as the two AC rows are added only on an AC case. Hence, the cost summary of every other case keeps its shape.

After the change

The same case:

MEUR
Total system cost 195.7821
Sum of the cost summary rows 195.7821
Operation Cost External Hydrogen 5.2580

Notes

  • The new module tests/test_cost_summary_hydrogen_sources.py contains two solve tests on 9nH2 reduced to 24 load levels (about 4 s). The first fails on master, where the row is missing; the second checks that a case without a source has no such row and that its rows still add up to the total system cost.
  • The cost summary per area is not changed. It reports the electricity costs of each area, and it has no hydrogen row of any kind.
  • A hydrogen source must also be listed in oT_Dict_Generation; otherwise, the case stops with a KeyError on pRatedMaxPowerElec. The input data documentation does not state this requirement.

The cost of hydrogen from reforming and imports enters the total system
cost, but the cost summary had no row for it, so its rows did not add up to
the total. The new row is written only when the case has a hydrogen source.
@erikfilias erikfilias changed the title Report the Hydrogen Source Cost in the Cost Summary Report the Hydrogen Operation Cost in the Cost Summary Nov 26, 2026
@erikfilias erikfilias changed the title Report the Hydrogen Operation Cost in the Cost Summary Report the Cost of External Hydrogen in the Cost Summary Nov 26, 2026
@erikfilias
erikfilias merged commit 5a2b1fc into master Nov 27, 2026
14 checks passed
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