Repository navigation
Report the Cost of External Hydrogen in the Cost Summary - #241
Merged
Merged
Conversation
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.
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.
Problem
A hydrogen source, i.e., a reformer or an import terminal declared through
MaximumProductionH2, produces hydrogen atProductionCostH2. Its cost enters the total system cost throughvTotalH2SrcCostineTotalTCost. 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
9nH2with one reformer added onNode_1(0.5 tH2/h at 2000 EUR/tH2), solved with HiGHS for the full year:vTotalSCost,total_cost_meur)vTotalH2SrcCost, weighted)The gap of 5.2580 MEUR (2.7 % of the total system cost) equals the hydrogen source cost exactly.
Solution
CostSummaryResultswrites the hydrogen source cost per period in a row namedOperation 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:
Operation Cost External HydrogenNotes
tests/test_cost_summary_hydrogen_sources.pycontains two solve tests on9nH2reduced 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.oT_Dict_Generation; otherwise, the case stops with aKeyErroronpRatedMaxPowerElec. The input data documentation does not state this requirement.