Skip to content

Commit

Permalink
feat: add endogenous export option
Browse files Browse the repository at this point in the history
  • Loading branch information
energyLS committed Aug 12, 2024
1 parent 68b6cd6 commit 9c3badc
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions scripts/add_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,30 @@ def add_export(n, hydrogen_buses_ports, export_profile):
elif snakemake.params.store == False:
pass

# add load
n.add(
"Load",
"H2 export load",
bus="H2 export bus",
carrier="H2",
p_set=export_profile,
)
if snakemake.params.export_endogenous == False:
# add load
n.add(
"Load",
"H2 export load",
bus="H2 export bus",
carrier="H2",
p_set=export_profile,
)
elif snakemake.params.export_endogenous == True:
# add endogenous export by implementing a negative generation
n.add("Generator",
"H2 export load",
bus="H2 export bus",
carrier="H2",
sign=-1,
p_nom_extendable=True,
marginal_cost=snakemake.params.endogenous_price,
)

else:
logger.error(
f"Value {snakemake.params.export_endogenous} for ['export']['export_endogenous'] is not valid"
)

return

Expand Down Expand Up @@ -183,13 +199,13 @@ def create_export_profile():
"add_export",
simpl="",
clusters="10",
ll="c1.0",
ll="c3.0",
opts="Co2L",
planning_horizons="2030",
sopts="144H",
sopts="3H",
discountrate="0.071",
demand="AB",
h2export="120",
h2export="20",
)
sets_path_to_root("pypsa-earth-sec")

Expand Down

0 comments on commit 9c3badc

Please sign in to comment.