Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce retrofit potential in myopic optimization #1258

Merged
merged 3 commits into from
Sep 25, 2024
Merged

Conversation

toniseibold
Copy link
Contributor

@toniseibold toniseibold commented Sep 4, 2024

Closes #1240.

Changes proposed in this Pull Request

The reduction of retrofitting of the gas grid to hydrogen is now more robust.
In prepare_sector_network the original capacity of a gas connection is written into p_nom_max of the gas pipeline and H2 pipeline retrofitted. However, in a myopic optimization, this capacity is/can be reduced from baseyear to baseyear.
So far the capacity of the retrofitting potential was not decreased if the gas network is not explicitly modeled.
This PR closes that gap.

Check

The p_nom_max of a H2 pipeline retrofitted link plus the already retrofitted capacity should be constant over a myopic optimization. Also the p_nom of the corresponding gas pipeline should be reduced to match the equivalent capacity of the p_nom_max value.

image

# myopic optimization [2020, 2030, 2040, 2050] since H2 retrofit is allowed from 2030 on, code gets easier
year = 2040 
CH4_per_H2 = 0.6
# already retrofitted
h2_retrofitted_fixed_i = n.links[
    (n.links.carrier == "H2 pipeline retrofitted")
    & (n.links.build_year != year)
].index
h2_retrofitted = n.links[(n.links.carrier=="H2 pipeline retrofitted") & 
                         (n.links.build_year == year)].index

potential = n.links.loc[h2_retrofitted].p_nom_max
already_retro = n.links.loc[h2_retrofitted_fixed_i].p_nom

# gas pipelines
gas_index = potential.index.str[:-5]
gas_index = gas_index.str.replace("H2 pipeline retrofitted", "gas pipeline")
gas_cap = n.links.loc[gas_index].p_nom*CH4_per_H2

# plotting
potential.index = potential.index.str.replace("H2 pipeline retrofitted ", "")
potential.index = potential.index.str[:-5]
already_retro.index = already_retro.index.str.replace("H2 pipeline retrofitted ", "")
already_retro.index = already_retro.index.str[:-5]
gas_cap.index = gas_cap.index.str.replace("gas pipeline ","")

df = pd.concat([-gas_cap, potential, already_retro], axis=1)
df = df.fillna(0)
df.columns = ['gas', 'H2 retro potential', 'H2 retro']
df.plot.bar(stacked=True)

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.
  • A release note doc/release_notes.rst is added.

@toniseibold toniseibold marked this pull request as ready for review September 4, 2024 07:38
@lindnemi
Copy link
Contributor

lindnemi commented Sep 6, 2024

Looks good to me and i will merge into ariadne2

@fneum
Copy link
Member

fneum commented Sep 10, 2024

Could you confirm/check that this works still correctly with overnight optimisation? Cheers!

@toniseibold
Copy link
Contributor Author

@fneum Can you specify? In an overnight scenario, it wouldn't make sense to optimize multiple planning_horizons?

@fneum fneum merged commit 79cea53 into master Sep 25, 2024
8 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.

Reduction of H2 retrofit pipelines when not spatially resolving gas network in myopic optimization
3 participants