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

Follow-Up: Unsustainable Biomass #1254

Merged
merged 9 commits into from
Sep 8, 2024
34 changes: 28 additions & 6 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2465,14 +2465,20 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu,
)

e_max_pu = pd.DataFrame(1, index=n.snapshots, columns=spatial.biomass.nodes)
e_max_pu.iloc[-1] = 0
n.madd(
"Bus",
spatial.biomass.nodes,
suffix=" unsustainable",
location=spatial.biomass.locations,
carrier="unsustainable solid biomass",
unit="MWh_LHV",
)

n.madd(
"Store",
spatial.biomass.nodes,
suffix=" unsustainable",
bus=spatial.biomass.nodes,
bus=spatial.biomass.nodes + " unsustainable",
carrier="unsustainable solid biomass",
e_nom=unsustainable_solid_biomass_potentials_spatial,
marginal_cost=costs.at["fuelwood", "fuel"],
Expand All @@ -2481,6 +2487,17 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu,
)

n.madd(
"Link",
spatial.biomass.nodes,
suffix=" unsustainable",
bus0=spatial.biomass.nodes + " unsustainable",
bus1=spatial.biomass.nodes,
carrier="unsustainable solid biomass",
efficiency=1,
p_nom=unsustainable_solid_biomass_potentials_spatial,
)

n.madd(
"Bus",
spatial.biomass.bioliquids,
Expand Down Expand Up @@ -2631,7 +2648,7 @@ def add_biomass(n, costs):
"GlobalConstraint",
"biomass limit",
carrier_attribute="solid biomass",
sense="<=",
sense="==",
cpschau marked this conversation as resolved.
Show resolved Hide resolved
constant=biomass_potentials["solid biomass"].sum(),
type="operational_limit",
)
Expand All @@ -2640,7 +2657,7 @@ def add_biomass(n, costs):
"Generator",
spatial.biomass.nodes,
suffix=" unsustainable",
bus=spatial.biomass.nodes,
bus=spatial.biomass.nodes + " unsustainable",
carrier="unsustainable solid biomass",
p_nom=10000,
marginal_cost=costs.at["fuelwood", "fuel"]
Expand All @@ -2650,7 +2667,7 @@ def add_biomass(n, costs):
"GlobalConstraint",
"unsustainable biomass limit",
carrier_attribute="unsustainable solid biomass",
sense="<=",
sense="==",
constant=biomass_potentials["unsustainable solid biomass"].sum(),
type="operational_limit",
)
Expand Down Expand Up @@ -4261,8 +4278,13 @@ def add_enhanced_geothermal(n, egs_potentials, egs_overlap, costs):
if __name__ == "__main__":
if "snakemake" not in globals():

import os

from _helpers import mock_snakemake

# Change directory to this script
os.chdir(os.path.dirname(os.path.realpath(__file__)))

snakemake = mock_snakemake(
"prepare_sector_network",
simpl="",
Expand Down
Loading