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

Integration of Clean Cooking technologies #1030

Closed
wants to merge 14 commits into from

Conversation

Mwiche96
Copy link

Closes # (if applicable).

Changes proposed in this Pull Request

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.

@davide-f
Copy link
Member

davide-f commented May 27, 2024

Great @Mwiche96 for the first draft PR!!! 🚀
Shall we talk about it on Thursday? will you be there?

@Mwiche96
Copy link
Author

Mwiche96 commented May 27, 2024 via email

@davide-f
Copy link
Member

Hi Davide, Yes please, we can have a chat about it on Thursday. Thank you.

________________________________ From: Davide Fioriti @.> Sent: Monday, May 27, 2024 12:20 PM To: pypsa-meets-earth/pypsa-earth @.> Cc: Mwiche Simpemba @.>; Mention @.> Subject: Re: [pypsa-meets-earth/pypsa-earth] Integration of Clean Cooking technologies (PR #1030) Great @Mwiche96https://github.com/Mwiche96 for the first draft PR!!! 🚀 Shall we talk about it on Thursday? will you be there? — Reply to this email directly, view it on GitHub<#1030 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYJSMD4XCIK2LNBYVATSRPTZEMCFRAVCNFSM6AAAAABIIXHGK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZTGE2TSMZRGM. You are receiving this because you were mentioned.Message ID: @.***>

Super :D It would be great to hear also the updates from the project :)

@Mwiche96
Copy link
Author

Mwiche96 commented May 27, 2024 via email

@Mwiche96
Copy link
Author

Mwiche96 commented May 29, 2024 via email

@Mwiche96
Copy link
Author

Mwiche96 commented May 29, 2024 via email

@ekatef
Copy link
Collaborator

ekatef commented Jun 13, 2024

Hello @Mwiche96!

Thanks for sharing your ideas in a post on PyPSA-meets-Earth discord server! If you don't mind, I'd copy a link to the discussion here to facilitate keeping track of things.

Also, copying suggestions by @pz-max:

Here some guidance:

add somewhere your cost & demand etc data
if you add new files, add input data to the Snakefile that you try to modify:

pypsa-earth/Snakefile

Lines 510 to 553 in bae5586

rule add_electricity:
params:
countries=config["countries"],
costs=config["costs"],
conventional=config.get("conventional", {}),
electricity=config["electricity"],
alternative_clustering=config["cluster_options"]["alternative_clustering"],
renewable=config["renewable"],
length_factor=config["lines"]["length_factor"],
input:
**{
f"profile_{tech}": "resources/"
+ RDIR
+ f"renewable_profiles/profile_{tech}.nc"
for tech in config["renewable"]
if tech in config["electricity"]["renewable_carriers"]
},
**{
f"conventional_{carrier}_{attr}": fn
for carrier, d in config.get("conventional", {None: {}}).items()
for attr, fn in d.items()
if str(fn).startswith("data/")
},
base_network="networks/" + RDIR + "base.nc",
tech_costs=COSTS,
powerplants="resources/" + RDIR + "powerplants.csv",
#gadm_shapes="resources/" + RDIR + "shapes/MAR2.geojson",
#using this line instead of the following will test updated gadm shapes for MA.
#To use: downlaod file from the google drive and place it in resources/" + RDIR + "shapes/
#Link: https://drive.google.com/drive/u/1/folders/1dkW1wKBWvSY4i-XEuQFFBj242p0VdUlM
gadm_shapes="resources/" + RDIR + "shapes/gadm_shapes.geojson",
hydro_capacities="data/hydro_capacities.csv",
demand_profiles="resources/" + RDIR + "demand_profiles.csv",
output:
"networks/" + RDIR + "elec.nc",
log:
"logs/" + RDIR + "add_electricity.log",
benchmark:
"benchmarks/" + RDIR + "add_electricity"
threads: 1
resources:
mem_mb=3000,
script:
"scripts/add_electricity.py"

make sure all data from the Snakefile can be imported in the script:
n = pypsa.Network(snakemake.input.base_network)
Nyears = n.snapshot_weightings.objective.sum() / 8760.0
# Snakemake imports:
demand_profiles = snakemake.input["demand_profiles"]
costs = load_costs(
snakemake.input.tech_costs,
snakemake.params.costs,
snakemake.params.electricity,
Nyears,
)

start with config options that you have in mind and make again sure that they can be read in the script:
electricity:
base_voltage: 380.
voltages: [132., 220., 300., 380., 500., 750.]
co2limit: 1.487e+9
co2base: 1.487e+9
agg_p_nom_limits: data/agg_p_nom_minmax.csv
hvdc_as_lines: false # should HVDC lines be modeled as `Line` or as `Link` component?
automatic_emission: true
automatic_emission_base_year: 1990 # 1990 is taken as default. Any year from 1970 to 2018 can be selected.
operational_reserve: # like https://genxproject.github.io/GenX/dev/core/#Reserves
activate: false
epsilon_load: 0.02 # share of total load
epsilon_vres: 0.02 # share of total renewable supply
contingency: 0 # fixed capacity in MW
max_hours:
battery: 6
H2: 168
extendable_carriers:
Generator: [solar, onwind, offwind-ac, offwind-dc, OCGT]
StorageUnit: [] # battery, H2
Store: [battery, H2]
Link: [] # H2 pipeline
powerplants_filter: (DateOut >= 2022 or DateOut != DateOut)
custom_powerplants: false # "false" use only powerplantmatching (ppm) data, "merge" combines ppm and custom powerplants, "replace" use only custom powerplants
conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
renewable_carriers: [solar, csp, onwind, offwind-ac, offwind-dc, hydro]
estimate_renewable_capacities:
stats: "irena" # False, = greenfield expansion, 'irena' uses IRENA stats to add expansion limits
year: 2020 # Reference year, available years for IRENA stats are 2000 to 2020
p_nom_min: 1 # any float, scales the minimum expansion acquired from stats, i.e. 110% of <years>'s capacities => p_nom_min: 1.1
p_nom_max: false # sets the expansion constraint, False to deactivate this option and use estimated renewable potentials determine by the workflow, float scales the p_nom_min factor accordingly
technology_mapping:
# Wind is the Fueltype in ppm.data.Capacity_stats, onwind, offwind-{ac,dc} the carrier in PyPSA-Earth
Offshore: [offwind-ac, offwind-dc]
Onshore: [onwind]
PV: [solar]

write some functions to add the clean cooking logic

@ekatef
Copy link
Collaborator

ekatef commented Jun 13, 2024

@Mwiche96 My general feeling is that the task is very interesting, but could be probably more relevant for pypsa-distribution.

An application domain of pypsa-earth itself is the area covered by centralised power supply which makes unavoidable some simplifications on the micro-level. While pypsa-distribution is build upon pypsa-earth but designed to accurately represent the local features of energy supply which potentially can be more consistent with a proper representation of the cooking technologies.

What is your feeling about that @Mwiche96 @davide-f @pz-max?

@Mwiche96 Mwiche96 reopened this Jun 20, 2024
@Mwiche96
Copy link
Author

Mwiche96 commented Jun 20, 2024

Hi @ekatef I have changed to add the cooking csv dynamically as well as added the cooking technologies and the parameters as stores.

@Mwiche96 Mwiche96 closed this Jun 20, 2024
@Mwiche96 Mwiche96 deleted the cooking branch June 20, 2024 23:33
@Mwiche96 Mwiche96 restored the cooking branch June 20, 2024 23:33
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.

None yet

3 participants