Follow-Up: Unsustainable Biomass (#1254)

* add oil bus; extend global biomass limit; set unsustainable potentials to zero for overnight

* keep sustainable potentials for switzerland

* remove potential distinction for overnight; additional global constraint for unsustainable solid biomass

* add unsustainable generator suffix

* added unsustainable solid biomass bus; changed global constraints to equality; removed forced emptying of unsustainable solid biomass store

* restored equality constraint for sustainable solid biomass; restored forced emptying of unsustainable store

* remove directory change for debugger

* added tech_color for unsustainable solid biomass

* modified spatial namespaces and removed suffixes
This commit is contained in:
cpschau 2024-09-08 11:59:37 +02:00 committed by GitHub
parent a7bb478865
commit 53f84f7eea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 54 additions and 10 deletions

View File

@ -1127,6 +1127,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'

0
rules/build_sector.smk Normal file → Executable file
View File

6
scripts/build_biomass_potentials.py Normal file → Executable file
View File

@ -330,7 +330,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)
@ -345,8 +345,8 @@ if __name__ == "__main__":
snakemake = mock_snakemake(
"build_biomass_potentials",
simpl="",
clusters="37",
planning_horizons=2020,
clusters="38",
planning_horizons=2050,
)
configure_logging(snakemake)

57
scripts/prepare_sector_network.py Normal file → Executable file
View File

@ -63,7 +63,8 @@ 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"
@ -71,6 +72,7 @@ def define_spatial(nodes, options):
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"]
@ -2493,14 +2495,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"],
@ -2509,6 +2518,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,
@ -2525,7 +2544,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,
@ -2535,6 +2553,8 @@ def add_biomass(n, costs):
e_max_pu=e_max_pu,
)
add_carrier_buses(n, "oil")
n.madd(
"Link",
spatial.biomass.bioliquids,
@ -2663,6 +2683,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
@ -4285,10 +4328,10 @@ if __name__ == "__main__":
"prepare_sector_network",
simpl="",
opts="",
clusters="37",
clusters="38",
ll="vopt",
sector_opts="",
planning_horizons="2050",
planning_horizons="2030",
)
configure_logging(snakemake)