Skip to content

Commit

Permalink
Merge pull request #386 from cpschau/add_electrolyzer_sens
Browse files Browse the repository at this point in the history
Add electrolyzer sensitivity
  • Loading branch information
hazemakhalek authored Oct 30, 2024
2 parents fabb36b + af1c684 commit 2eacba2
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 80 deletions.
121 changes: 56 additions & 65 deletions Snakefile

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions config.bright_BI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary_dir: results/
costs_dir: data/ #TODO change to the equivalent of technology data

run:
name: 281023_endogenousexports
name: 241031_electrolyzer_cc_sensitivity
name_subworkflow: "" # scenario name of the pypsa-earth subworkflow
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled
Expand Down Expand Up @@ -40,7 +40,7 @@ policy_config:
allowed_excess: 1.0
is_reference: false # Whether or not this network is a reference case network, relevant only if additionality is _true_
remove_h2_load: false #Whether or not to remove the h2 load from the network, relevant only if is_reference is _true_
path_to_ref: "/scratch/htc/cschauss/BRIGHT/submodules/pypsa-earth-sec/results/281023_endogenousexports/postnetworks/elec_s_11_ec_lv1.0_Co2L_3H_2035_0.071_BI_0export_endogenousmp.nc" # Path to the reference case network for additionality calculation, relevant only if additionality is _true_ and is_reference is _false_
path_to_ref: "/scratch/htc/cschauss/BRIGHT/submodules/pypsa-earth-sec/results/241031_electrolyzer_cc_sensitivity/postnetworks/elec_s_11_ec_lv1.0_Co2L_3H_2035_0.071_BI_0export_endogenousmp.nc" # Path to the reference case network for additionality calculation, relevant only if additionality is _true_ and is_reference is _false_
limit_SMR_dispatch: true # Limits the dispatch of SMR to the reference case
re_country_load: false # Set to "True" to force the RE electricity to be equal to the electricity required for hydrogen export and the country electricity load. "False" excludes the country electricity load from the constraint.

Expand All @@ -66,7 +66,8 @@ fossil_reserves:

export:
h2export: "endogenous" #,20,30,40,50,60,70,80,90,100] or "endogenous" in combination with h2mp # Yearly export demand in TWh
h2mp: [45, 60, 75] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous
h2mp: [65, 67.5, 70, 72.5, 75, 77.5, 80, 82.5, 85, 87.5, 90] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous
store: false # [True, False] # specifies wether an export store to balance demand is implemented
store_capital_costs: "no_costs" # ["standard_costs", "no_costs"] # specifies the costs of the export store. "standard_costs" takes CAPEX of "hydrogen storage tank type 1 including compressor"
export_profile: "constant" # use "ship" or "constant"
constant_nodal_export: true
Expand Down Expand Up @@ -111,6 +112,8 @@ costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_ho
H2: 0.
battery: 0.

electrolyzer_cc: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]

emission_prices: # only used with the option Ep (emission prices)
co2: 0.

Expand Down
4 changes: 3 additions & 1 deletion config.bright_BI_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary_dir: results/
costs_dir: data/ #TODO change to the equivalent of technology data

run:
name: 281023_endogenousexports
name: 241031_electrolyzer_cc_sensitivity
name_subworkflow: "" # scenario name of the pypsa-earth subworkflow
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled
Expand Down Expand Up @@ -113,6 +113,8 @@ costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_ho
H2: 0.
battery: 0.

electrolyzer_cc: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]

emission_prices: # only used with the option Ep (emission prices)
co2: 0.

Expand Down
8 changes: 5 additions & 3 deletions config.bright_DE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary_dir: results/
costs_dir: data/ #TODO change to the equivalent of technology data

run:
name: 281023_endogenousexports
name: 241031_electrolyzer_cc_sensitivity
name_subworkflow: "" # scenario name of the pypsa-earth subworkflow
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled
Expand Down Expand Up @@ -40,7 +40,7 @@ policy_config:
allowed_excess: 1.0
is_reference: false # Whether or not this network is a reference case network, relevant only if additionality is _true_
remove_h2_load: false #Whether or not to remove the h2 load from the network, relevant only if is_reference is _true_
path_to_ref: "/scratch/htc/cschauss/BRIGHT/submodules/pypsa-earth-sec/results/281023_endogenousexports/postnetworks/elec_s_11_ec_lv1.0_Co2L_3H_2035_0.071_DE_0export_endogenousmp.nc" # Path to the reference case network for additionality calculation, relevant only if additionality is _true_ and is_reference is _false_
path_to_ref: "/scratch/htc/cschauss/BRIGHT/submodules/pypsa-earth-sec/results/241031_electrolyzer_cc_sensitivity/postnetworks/elec_s_11_ec_lv1.0_Co2L_3H_2035_0.071_DE_0export_endogenousmp.nc" # Path to the reference case network for additionality calculation, relevant only if additionality is _true_ and is_reference is _false_
limit_SMR_dispatch: true # Limits the dispatch of SMR to the reference case
re_country_load: false # Set to "True" to force the RE electricity to be equal to the electricity required for hydrogen export and the country electricity load. "False" excludes the country electricity load from the constraint.

Expand All @@ -66,7 +66,7 @@ fossil_reserves:

export:
h2export: "endogenous" #,20,30,40,50,60,70,80,90,100] or "endogenous" in combination with h2mp # Yearly export demand in TWh
h2mp: [45, 60, 75] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous
h2mp: [65, 67.5, 70, 72.5, 75, 77.5, 80, 82.5, 85, 87.5, 90] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous
store: false # [True, False] # specifies wether an export store to balance demand is implemented
store_capital_costs: "no_costs" # ["standard_costs", "no_costs"] # specifies the costs of the export store. "standard_costs" takes CAPEX of "hydrogen storage tank type 1 including compressor"
export_profile: "constant" # use "ship" or "constant"
Expand Down Expand Up @@ -112,6 +112,8 @@ costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_ho
H2: 0.
battery: 0.

electrolyzer_cc: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]

emission_prices: # only used with the option Ep (emission prices)
co2: 0.

Expand Down
4 changes: 3 additions & 1 deletion config.bright_DE_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary_dir: results/
costs_dir: data/ #TODO change to the equivalent of technology data

run:
name: 281023_endogenousexports
name: 241031_electrolyzer_cc_sensitivity
name_subworkflow: "" # scenario name of the pypsa-earth subworkflow
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled
Expand Down Expand Up @@ -112,6 +112,8 @@ costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_ho
H2: 0.
battery: 0.

electrolyzer_cc: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]

emission_prices: # only used with the option Ep (emission prices)
co2: 0.

Expand Down
8 changes: 5 additions & 3 deletions config.bright_GH.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary_dir: results/
costs_dir: data/ #TODO change to the equivalent of technology data

run:
name: 281023_endogenousexports
name: 241031_electrolyzer_cc_sensitivity
name_subworkflow: "" # scenario name of the pypsa-earth subworkflow
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled
Expand Down Expand Up @@ -40,7 +40,7 @@ policy_config:
allowed_excess: 1.0
is_reference: false # Whether or not this network is a reference case network, relevant only if additionality is _true_
remove_h2_load: false #Whether or not to remove the h2 load from the network, relevant only if is_reference is _true_
path_to_ref: "/scratch/htc/cschauss/BRIGHT/submodules/pypsa-earth-sec/results/281023_endogenousexports/postnetworks/elec_s_11_ec_lv1.0_Co2L_3H_2035_0.071_GH_0export_endogenousmp.nc" # Path to the reference case network for additionality calculation, relevant only if additionality is _true_ and is_reference is _false_
path_to_ref: "/scratch/htc/cschauss/BRIGHT/submodules/pypsa-earth-sec/results/241031_electrolyzer_cc_sensitivity/postnetworks/elec_s_11_ec_lv1.0_Co2L_3H_2035_0.071_GH_0export_endogenousmp.nc" # Path to the reference case network for additionality calculation, relevant only if additionality is _true_ and is_reference is _false_
limit_SMR_dispatch: true # Limits the dispatch of SMR to the reference case
re_country_load: false # Set to "True" to force the RE electricity to be equal to the electricity required for hydrogen export and the country electricity load. "False" excludes the country electricity load from the constraint.

Expand All @@ -66,7 +66,7 @@ fossil_reserves:

export:
h2export: "endogenous" #,20,30,40,50,60,70,80,90,100] or "endogenous" in combination with h2mp # Yearly export demand in TWh
h2mp: [45, 60, 75] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous
h2mp: [65, 67.5, 70, 72.5, 75, 77.5, 80, 82.5, 85, 87.5, 90] # Global hydrogen market price in EUR/MWh if h2export is set to endogenous
store: false # [True, False] # specifies wether an export store to balance demand is implemented
store_capital_costs: "no_costs" # ["standard_costs", "no_costs"] # specifies the costs of the export store. "standard_costs" takes CAPEX of "hydrogen storage tank type 1 including compressor"
export_profile: "constant" # use "ship" or "constant"
Expand Down Expand Up @@ -114,6 +114,8 @@ costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_ho
H2: 0.
battery: 0.

electrolyzer_cc: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]

emission_prices: # only used with the option Ep (emission prices)
co2: 0.

Expand Down
5 changes: 4 additions & 1 deletion config.bright_GH_ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary_dir: results/
costs_dir: data/ #TODO change to the equivalent of technology data

run:
name: 281023_endogenousexports
name: 291023_endogenousexports
name_subworkflow: "" # scenario name of the pypsa-earth subworkflow
shared_cutouts: true # set to true to share the default cutout(s) across runs
# Note: value false requires build_cutout to be enabled
Expand Down Expand Up @@ -67,6 +67,7 @@ fossil_reserves:
export:
h2export: [0] #,20,30,40,50,60,70,80,90,100] or "endogenous" in combination with h2mp # Yearly export demand in TWh
h2mp: "endogenous" # Global hydrogen market price in EUR/MWh if h2export is set to endogenous else "endogenous"
store: false # [True, False] # specifies wether an export store to balance demand is implemented
store_capital_costs: "no_costs" # ["standard_costs", "no_costs"] # specifies the costs of the export store. "standard_costs" takes CAPEX of "hydrogen storage tank type 1 including compressor"
export_profile: "constant" # use "ship" or "constant"
constant_nodal_export: true
Expand Down Expand Up @@ -113,6 +114,8 @@ costs: # Costs used in PyPSA-Earth-Sec. Year depends on the wildcard planning_ho
H2: 0.
battery: 0.

electrolyzer_cc: [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5]

emission_prices: # only used with the option Ep (emission prices)
co2: 0.

Expand Down
4 changes: 3 additions & 1 deletion scripts/make_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ def make_summaries(networks_dict):
"demand",
"export",
"h2mp",
"electrolyzer_cc",
],
)

Expand Down Expand Up @@ -709,9 +710,10 @@ def to_csv(df):
snakemake.wildcards["demand"],
snakemake.wildcards["h2export"],
snakemake.wildcards["h2mp"],
snakemake.wildcards["electrolyzer_cc"],
): snakemake.params.results_dir
+ snakemake.params.run["name"]
+ f"/postnetworks/elec_s{snakemake.wildcards['simpl']}_{snakemake.wildcards['clusters']}_ec_l{snakemake.wildcards['ll']}_{snakemake.wildcards['opts']}_{snakemake.wildcards['sopts']}_{snakemake.wildcards['planning_horizons']}_{snakemake.wildcards['discountrate']}_{snakemake.wildcards['demand']}_{snakemake.wildcards['h2export']}export_{snakemake.wildcards['h2mp']}mp.nc"
+ f"/postnetworks/elec_s{snakemake.wildcards['simpl']}_{snakemake.wildcards['clusters']}_ec_l{snakemake.wildcards['ll']}_{snakemake.wildcards['opts']}_{snakemake.wildcards['sopts']}_{snakemake.wildcards['planning_horizons']}_{snakemake.wildcards['discountrate']}_{snakemake.wildcards['demand']}_{snakemake.wildcards['h2export']}export_{snakemake.wildcards['h2mp']}mp_{snakemake.wildcards['electrolyzer_cc']}ecc.nc"
}

print(networks_dict)
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ def add_biomass(n, costs):
p_nom_extendable=False,
p_min_pu=p_minmax_pu,
p_max_pu=p_minmax_pu,
capital_cost=costs.at["BtL", "fixed"] * costs.at["BtL", "efficiency"],
capital_cost=0, # costs.at["BtL", "fixed"] * costs.at["BtL", "efficiency"],
marginal_cost=costs.at["BtL", "VOM"] * costs.at["BtL", "efficiency"],
)

Expand Down
9 changes: 8 additions & 1 deletion scripts/solve_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ def prepare_network(n, solve_opts=None):
# pass
# n.carriers.co2_emissions = n.carriers.co2_emissions * 1e-6
# n.global_constraints.at["CO2Limit", "constant"] = n.global_constraints.at["CO2Limit", "constant"] * 1e-6

# modify electrolyzer capital costs
n.links.loc[n.links.carrier == "H2 Electrolysis", "capital_cost"] *= float(
snakemake.wildcards.electrolyzer_cc
)

if "lv_limit" in n.global_constraints.index:
n.line_volume_limit = n.global_constraints.at["lv_limit", "constant"]
n.line_volume_limit_dual = n.global_constraints.at["lv_limit", "mu"]
Expand Down Expand Up @@ -636,11 +642,12 @@ def add_existing(n):
ll="v1.0",
opts="Co2L",
planning_horizons="2035",
sopts="3H",
sopts="876H",
discountrate=0.071,
demand="BI",
h2export="0",
h2mp="endogenous",
electrolyzer_cc=1.0,
)

sets_path_to_root("pypsa-earth-sec")
Expand Down

0 comments on commit 2eacba2

Please sign in to comment.