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
1 change: 1 addition & 0 deletions config/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ plotting:
services rural biomass boiler: '#c6cf98'
services urban decentral biomass boiler: '#dde5b5'
biomass to liquid: '#32CD32'
unsustainable solid biomass: '#998622'
unsustainable bioliquids: '#32CD32'
electrobiofuels: 'red'
BioSNG: '#123456'
Expand Down
Empty file modified rules/build_sector.smk
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions scripts/build_biomass_potentials.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def add_unsustainable_potentials(df):
)

share_sus = params.get("share_sustainable_potential_available").get(investment_year)
df *= share_sus
df.loc[df_wo_ch.index] *= share_sus

df = df.join(df_wo_ch.filter(like="unsustainable")).fillna(0)

Expand All @@ -347,8 +347,8 @@ def add_unsustainable_potentials(df):
snakemake = mock_snakemake(
"build_biomass_potentials",
simpl="",
clusters="37",
planning_horizons=2020,
clusters="38",
planning_horizons=2050,
)

configure_logging(snakemake)
Expand Down
57 changes: 50 additions & 7 deletions scripts/prepare_sector_network.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ def define_spatial(nodes, options):

if options.get("biomass_spatial", options["biomass_transport"]):
spatial.biomass.nodes = nodes + " solid biomass"
spatial.biomass.bioliquids = nodes + " bioliquids"
spatial.biomass.nodes_unsustainable = nodes + " unsustainable solid biomass"
spatial.biomass.bioliquids = nodes + " unsustainable bioliquids"
spatial.biomass.locations = nodes
spatial.biomass.industry = nodes + " solid biomass for industry"
spatial.biomass.industry_cc = nodes + " solid biomass for industry CC"
spatial.msw.nodes = nodes + " municipal solid waste"
spatial.msw.locations = nodes
else:
spatial.biomass.nodes = ["EU solid biomass"]
spatial.biomass.nodes_unsustainable = ["EU unsustainable solid biomass"]
spatial.biomass.bioliquids = ["EU unsustainable bioliquids"]
spatial.biomass.locations = ["EU"]
spatial.biomass.industry = ["solid biomass for industry"]
Expand Down Expand Up @@ -2465,14 +2467,21 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu,
)

n.madd(
"Bus",
spatial.biomass.nodes_unsustainable,
location=spatial.biomass.locations,
carrier="unsustainable solid biomass",
unit="MWh_LHV",
)

e_max_pu = pd.DataFrame(1, index=n.snapshots, columns=spatial.biomass.nodes)
e_max_pu.iloc[-1] = 0

n.madd(
"Store",
spatial.biomass.nodes,
suffix=" unsustainable",
bus=spatial.biomass.nodes,
spatial.biomass.nodes_unsustainable,
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 +2490,16 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu,
)

n.madd(
"Link",
spatial.biomass.nodes_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 All @@ -2497,7 +2516,6 @@ def add_biomass(n, costs):
n.madd(
"Store",
spatial.biomass.bioliquids,
suffix=" unsustainable",
bus=spatial.biomass.bioliquids,
carrier="unsustainable bioliquids",
e_nom=unsustainable_liquid_biofuel_potentials_spatial,
Expand All @@ -2507,6 +2525,8 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu,
)

add_carrier_buses(n, "oil")

n.madd(
"Link",
spatial.biomass.bioliquids,
Expand Down Expand Up @@ -2633,6 +2653,29 @@ def add_biomass(n, costs):
constant=biomass_potentials["solid biomass"].sum(),
type="operational_limit",
)
if biomass_potentials["unsustainable solid biomass"].sum() > 0:
n.madd(
"Generator",
spatial.biomass.nodes_unsustainable,
bus=spatial.biomass.nodes_unsustainable,
carrier="unsustainable solid biomass",
p_nom=10000,
marginal_cost=costs.at["fuelwood", "fuel"]
+ bus_transport_costs * average_distance,
)
# Set last snapshot of e_max_pu for unsustainable solid biomass to 1 to make operational limit work
unsus_stores_idx = n.stores.loc[
n.stores.carrier == "unsustainable solid biomass"
].index
n.stores_t.e_max_pu.loc[n.snapshots[-1], unsus_stores_idx] = 1
n.add(
"GlobalConstraint",
"unsustainable biomass limit",
carrier_attribute="unsustainable solid biomass",
sense="==",
constant=biomass_potentials["unsustainable solid biomass"].sum(),
type="operational_limit",
)

if options["municipal_solid_waste"]:
# Add municipal solid waste
Expand Down Expand Up @@ -4246,10 +4289,10 @@ def add_enhanced_geothermal(n, egs_potentials, egs_overlap, costs):
"prepare_sector_network",
simpl="",
opts="",
clusters="37",
clusters="38",
ll="vopt",
sector_opts="",
planning_horizons="2050",
planning_horizons="2030",
)

configure_logging(snakemake)
Expand Down
Loading