PyPSA / pypsa-ariadne

High resolution, sector-coupled model of the German Energy System
https://ariadneprojekt.de/en/model-documentation-pypsa/
MIT License
15 stars 7 forks source link

add compression losses for gas transport #259

Closed JulianGeis closed 1 month ago

JulianGeis commented 1 month ago

Before asking for a review for this PR make sure to complete the following checklist:

Related PR: https://github.com/PyPSA/pypsa-eur/pull/1391

github-actions[bot] commented 1 month ago

Validator Report

I am the Validator. Download all artifacts here. I'll be back and edit this comment for each new commit.

:exclamation: Run failed! _Download 'logs' artifact to see more details._ - `main` failed in: `modify_prenetwork` - `257-model-co2-emissions-from-gas-compression` failed in: `modify_prenetwork`

Model Metrics

Benchmarks Image not available Image not available Image not available

Comparing 257-model-co2-emissions-from-gas-compression (741784d) with main (e9de60c). Branch is 8 commits ahead and 2 commits behind. Last updated on 2024-10-24 16:25:32 CEST.

JulianGeis commented 1 month ago

Validation

for year in np.arange(2020,2050,5):
    print(year)
    for nw, name in zip([networks, networks_new], ["old", "new"]):
        print(name)
        n = nw[year]
        print(round(n.statistics.supply(
            groupby=n.statistics.groupers.get_name_bus_and_carrier,
            bus_carrier="gas"
        )/1e6, 2))
    print("")

Gas Data Overview (2020-2045)

2020

Old

Component Name Bus Carrier Value
Generator DE gas DE gas gas 966.35
EU gas EU gas gas 2553.99
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE renewable gas -> DE gas DE gas renewable gas 2.29
DE renewable gas -> EU gas EU gas renewable gas 0.07
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 84.06

New

Component Name Bus Carrier Value
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE gas compressing DE gas gas compressing 958.31
DE renewable gas -> DE gas DE gas renewable gas 2.31
DE renewable gas -> EU gas EU gas renewable gas 0.04
EU gas compressing EU gas gas compressing 2541.05
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 84.06

2025

Old

Component Name Bus Carrier Value
Generator DE gas DE gas gas 778.09
EU gas EU gas gas 2147.75
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE renewable gas -> DE gas DE gas renewable gas 0.00
DE renewable gas -> EU gas EU gas renewable gas 38.50
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 64.35

New

Component Name Bus Carrier Value
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE gas compressing DE gas gas compressing 782.23
DE renewable gas -> DE gas DE gas renewable gas 0.00
DE renewable gas -> EU gas EU gas renewable gas 58.29
EU gas compressing EU gas gas compressing 2116.50
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 64.35

2030

Old

Component Name Bus Carrier Value
Generator DE gas DE gas gas 526.05
EU gas EU gas gas 2043.81
Link DE renewable gas -> DE gas DE gas renewable gas 27.47
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 32.18

New

Component Name Bus Carrier Value
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE gas compressing DE gas gas compressing 508.15
DE renewable gas -> DE gas DE gas renewable gas 29.14
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU gas compressing EU gas gas compressing 1976.58
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 32.18

2035

Old

Component Name Bus Carrier Value
Generator DE gas DE gas gas 271.79
EU gas EU gas gas 682.27
Link DE renewable gas -> DE gas DE gas renewable gas 26.31
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 258.46

New

Component Name Bus Carrier Value
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE gas compressing DE gas gas compressing 268.88
DE renewable gas -> DE gas DE gas renewable gas 29.28
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU gas compressing EU gas gas compressing 627.51
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 258.46

2040

Old

Component Name Bus Carrier Value
Generator DE gas DE gas gas 110.05
EU gas EU gas gas 154.20
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE renewable gas -> DE gas DE gas renewable gas 31.54
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 260.75

New

Component Name Bus Carrier Value
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE gas compressing DE gas gas compressing 110.67
DE renewable gas -> DE gas DE gas renewable gas 31.54
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU gas compressing EU gas gas compressing 142.34
EU renewable gas -> DE gas DE gas renewable gas 0.00
EU renewable gas -> EU gas EU gas renewable gas 260.75

2045

Old

Component Name Bus Carrier Value
Generator DE gas DE gas gas 0.00
EU gas EU gas gas 180.62
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE renewable gas -> DE gas DE gas renewable gas 7.88
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU renewable gas -> DE gas DE gas renewable gas 91.97
EU renewable gas -> EU gas EU gas renewable gas 166.26

New

Component Name Bus Carrier Value
Store DE gas Store DE gas gas 0.00
EU gas Store EU gas gas 0.00
Link DE gas compressing DE gas gas compressing 0.00
DE renewable gas -> DE gas DE gas renewable gas 1.02
DE renewable gas -> EU gas EU gas renewable gas 0.00
EU gas compressing EU gas gas compressing 154.06
EU renewable gas -> DE gas DE gas renewable gas 106.45
EU renewable gas -> EU gas EU gas renewable gas 151.77

Differences

JulianGeis commented 1 month ago

@lindnemi if you review this especially have a look at the exporter. I think I added the changes everywhere necessary but ...

lindnemi commented 1 month ago

Very nice PR, also on the PyPSA-Eur side. Only had to change a few lines in the exporter.

I realized that the the gas_primary_factor, just as the oil_primary_factor was multiplied instead of divided as intended. This will add a few dozen TWh in primary energy, which is a good side effect.