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

update FT to account for Hydrogen and Electricity input #1226

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

GbotemiB
Copy link
Contributor

@GbotemiB GbotemiB commented Dec 5, 2024

Closes # (if applicable).

Changes proposed in this Pull Request

This PR aims to revise the implementation of FT to account for hydrogen and electricity input. The changes is adapted from pypsa-eur

@ekatef @davide-f @hazemakhalek

Checklist

  • I consent to the release of this PR's code under the AGPLv3 license and non-code contributions under CC0-1.0 and CC-BY-4.0.
  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Newly introduced dependencies are added to envs/environment.yaml and doc/requirements.txt.
  • Changes in configuration options are added in all of config.default.yaml and config.tutorial.yaml.
  • Add a test config or line additions to test/ (note tests are changing the config.tutorial.yaml)
  • Changes in configuration options are also documented in doc/configtables/*.csv and line references are adjusted in doc/configuration.rst and doc/tutorial.rst.
  • A note for the release notes doc/release_notes.rst is amended in the format of previous release notes, including reference to the requested PR.

@GbotemiB GbotemiB marked this pull request as ready for review December 5, 2024 15:57
Copy link
Collaborator

@yerbol-akhmetov yerbol-akhmetov left a comment

Choose a reason for hiding this comment

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

Thanks @GbotemiB for the PR. What was the reason of changing efficiency and efficiency2`? In PyPSA-Eur, efficiencies were similar as it is in PyPSA-earth previously.

        efficiency=costs.at["Fischer-Tropsch", "efficiency"],
        efficiency2=-costs.at["oil", "CO2 intensity"]
        * costs.at["Fischer-Tropsch", "efficiency"],

], # Use efficiency to convert from EUR/MW_FT/a to EUR/MW_H2/a
efficiency2=-costs.at["oil", "CO2 intensity"]
* costs.at["Fischer-Tropsch", "efficiency"],
/ costs.at["Fischer-Tropsch", "electricity-input"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, I think capital_cost should be multiplication of fixed with efficiency as previously defined.

Copy link
Member

Choose a reason for hiding this comment

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

Agree, see comment below

Comment on lines 179 to 180
marginal_cost=costs.at["Fischer-Tropsch", "VOM"]
/ costs.at["Fischer-Tropsch", "electricity-input"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

The same is true for marginal_cost. Efficiency should be multiplied. @davide-f, can you please comment? Also generally efficiency is used rather than electricity-input.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed the multiplication with efficiency is appropriate because of the unit of measurement used for the calculation.
Regarding this PR, I'm adding a comment below also

Copy link
Member

@davide-f davide-f left a comment

Choose a reason for hiding this comment

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

Mmm could you explain the proposal?
The referenced link to pypsa-eur refers to the haber-bosch process that converts electricity and hydrogen into ammonia, while here the edited code is Fischer-Tropsch that converts hydrogen and CO2 into oil products.
It feels to me that we are mixing things, could you please check?

Note that fischer trops is also availabel in pypsa-eur with a similar formulations as in -earth:
https://github.com/PyPSA/pypsa-eur/blob/920ffb444497c9767fade5f2a9bdaa457a1b627b/scripts/prepare_sector_network.py#L3610-L3616

Comment on lines 179 to 180
marginal_cost=costs.at["Fischer-Tropsch", "VOM"]
/ costs.at["Fischer-Tropsch", "electricity-input"],
Copy link
Member

Choose a reason for hiding this comment

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

Indeed the multiplication with efficiency is appropriate because of the unit of measurement used for the calculation.
Regarding this PR, I'm adding a comment below also

], # Use efficiency to convert from EUR/MW_FT/a to EUR/MW_H2/a
efficiency2=-costs.at["oil", "CO2 intensity"]
* costs.at["Fischer-Tropsch", "efficiency"],
/ costs.at["Fischer-Tropsch", "electricity-input"],
Copy link
Member

Choose a reason for hiding this comment

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

Agree, see comment below

@GbotemiB
Copy link
Contributor Author

Hi @yerbol-akhmetov @davide-f @danielelerede-oet, I will be closing this PR for now. The purpose of this PR was to add electricity and hydrogen input for FT. But this is no longer needed as the current implementation is sufficient for now.

@GbotemiB GbotemiB closed this Dec 10, 2024
@GbotemiB GbotemiB reopened this Dec 13, 2024
@GbotemiB
Copy link
Contributor Author

Hi @davide-f @hazemakhalek @yerbol-akhmetov @danielelerede-oet
I have remodified the H2_liquid_fossil_conversions function, by adding electricity bus to bus3. I also made change to how the efficiency is calculated.

Here is an explanation. Big thanks to @yerbol-akhmetov
image

Copy link
Collaborator

@yerbol-akhmetov yerbol-akhmetov left a comment

Choose a reason for hiding this comment

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

Thanks, @GbotemiB, for the proposal. I agree with using 1 / costs.at["Fischer-Tropsch", "hydrogen-input"] as an efficiency as hydrogen-input has units of MWh_H2/MWh_FT. So it maps output to input. Note, 1/hydrogen-input is very close to efficiency value in costs. It is interesting how efficiency is estimated and what it refers to?
Another question is: if we use 1 / costs.at["Fischer-Tropsch", "hydrogen-input"] as efficiency from inpu to output, then should we change costs.at["Fischer-Tropsch", "efficiency"] elsewhere? What do you think @davide-f ?

Copy link
Member

@davide-f davide-f left a comment

Choose a reason for hiding this comment

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

Thanks @GbotemiB and @yerbol-akhmetov :D

The proposal is quite neat; I'd advise for a minor release note also.

Regarding the point by @yerbol-akhmetov , I agree that it is advisable to use -input parameters or efficiency, but not a mix of them for consistency.
For reproducibility considerations, I'd be more prone in merging a contribution where we keep using efficiency instead of hydrogen-input for now, for consistency with pypsa-eur and reproducibility considerations.
Using hydrogen-input sounds appealing, but given its potential breaking changes may require some alignment with others.

The potential issue I see is that with this change, the results of the model with the same cost configuration will change because the code selects a different input data.
The current efficiency and the efficiency with hydrogen-input differ by >5% that may have implications; on the other hand, the electricity-input is likely to have a small impact.
Current CI changes only marginally [727049... vs 727069...], but the CO2 constraint is limited so the impact of FT is not big.

Is there a specific need to adopt hydrogen-input here for @yerbol-akhmetov and @GbotemiB ?

I ping also @FabianHofmann as it would be good to keep an alignment with pypsa-eur and @energyLS who worked on -sec PRs about it.
For fabian and -sec modellers, using hydrogen-input and electricity-input seems interesting: the data source of *-input in technology data is newer. Are you aware of reasons for not using it?
Personally, using hydrogen-input and electricity-input seems appealing but need to align before acting here

@davide-f
Copy link
Member

davide-f commented Dec 20, 2024

Hello @yerbol-akhmetov @GbotemiB,
I'm just writing here to avoid stalling, is there a reason to adopt hydrogen-input instead of efficiency for your application?
Could efficiency be used instead?

@GbotemiB
Copy link
Contributor Author

Hi @davide-f, We can just use efficiency.

@GbotemiB GbotemiB requested a review from davide-f December 21, 2024 12:27
@davide-f
Copy link
Member

This looks good to me.
To clarify, @GbotemiB have you discussed this contribution with the sec team during a -sec meeting?

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.

3 participants