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

Compatibility with PyPSA-Ariadne derivative #827

Merged
merged 23 commits into from
Jan 4, 2024
Merged

Compatibility with PyPSA-Ariadne derivative #827

merged 23 commits into from
Jan 4, 2024

Conversation

nworbmot
Copy link
Member

@nworbmot nworbmot commented Jan 2, 2024

These changes allow compatibility with the model PyPSA-Ariadne that builds on PyPSA-Eur with PyPSA-Eur as a submodule.

Changes proposed in this Pull Request

  • solve_network.py: An input file called additional_functionality can be passed to the rule and imported and run as extra_functionality. See the PyPSA-Ariadne example.
  • solve_network.py: If model is infeasible, compute and print infeasibilities.
  • prepare_sector_network.py: Remove all negative loads on the co2 atmosphere bus representing emissions for e.g. fixed fossil demands for transport oil. Instead these are handled more transparently with fixed transport oil demand and a link taking care of the emissions to the co2 atmosphere bus. This is also good preparation for endogenous transport optimisation, where demand will be subject to optimisation.
  • prepare_sector_network.py: Allow possibility to go from EU to nodal methanol and oil demand with switches regional_{oil,methanol}_demand. This allows nodal/regional CO2 constraints to be applied.
  • prepare_sector_network.py: Process emissions from steam crackers (i.e. naphtha processing for HVC) are now piped from the consumption link to the process emissions bus where the model can decide about carbon capture. Previously the process emissions for naphtha were a fixed load.
  • add_brownfield.py: New function disable_grid_expansion_if_LV_limit_hit to disable grid expansion if the line volume limit is hit. This is to avoid numerical problems.

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.

chrstphtrs and others added 23 commits October 18, 2023 16:59
… land transport oil (ICEs), naphtha for industry and kerosene for aviation (before summed as 'oil'), shipping oil, shipping methanol, agriculture machinery oil
…et_national'] to include all necessary links in national co2 budget constraints
So that DAC extracts CO2 rather than pumping into air; for p>0, link
withdraws from bus0, but injects into bus1/2/3, so you have to take
account of this sign difference-
Without this naming fix, the p_set is a NaN once added
This was overestimating ICE oil demand by factor 1/0.3.
Now naphtha demand causes process emissions from steak crackers to
route to process emissions bus, then rest of CO2 goes to atmosphere.
Numerical problems were causing infeasibilities otherwise
To add this, overwrite the rule with a new argument:

snakemake.input.additional_functionality
This undoes commit 830019a.

Reason: this was introduced for the PyPSA-Ariadne derivative, but
can be handled more elegantly within the derivative repository.
Force a single supply bus for oil/methanol (until we allow
oil/methanol transport). Introduce new config switches
"regional_oil/methanol_demand" that allow demand to be
regionalised. This is important if regional CO2 budgets need to be
enforced.
This can be added by derived workflows like PyPSA-Eur via
additional_functionality.

Changed additional_functionality to pass snakemake rather than
wildcards and config separately. This gives maximal flexibility.
@nworbmot nworbmot changed the title Merge changes for compatibility with PyPSA-Ariadne derivative Compatibility with PyPSA-Ariadne derivative Jan 2, 2024
Copy link
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! We'll have to see how the computational burden pans out with the additional links, but I can see the need for it. The layout will also help with further endogenising demands.

I'll resolve the merge conflicts and add release notes / some documentation.

@fneum
Copy link
Member

fneum commented Jan 4, 2024

Confirmed virtually identical results to previous version, both with copperplated or regionalised MeOH/oil demands.

@fneum fneum merged commit 8316861 into master Jan 4, 2024
5 checks passed
@fneum fneum deleted the ariadne branch January 4, 2024 11:48
@fneum fneum mentioned this pull request Jan 4, 2024
6 tasks
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.

4 participants