prepare_sector_network.py: add oil bus whenever industry is added (#1247)

* prepare_sector_network.py: add oil bus whenever industry is added

* prepare_sector_network: Move added oil and methnaol buses to top of "add_industry", and add oil buses where used in "add_biomass"
This commit is contained in:
Philipp Glaum 2024-08-30 12:06:11 +02:00 committed by GitHub
parent 2cf6951858
commit bc09f1df77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2447,7 +2447,7 @@ def add_biomass(n, costs):
)
if biomass_potentials.filter(like="unsustainable").sum().sum() > 0:
add_carrier_buses(n, "oil")
# Create timeseries to force usage of unsustainable potentials
e_max_pu = pd.DataFrame(1, index=n.snapshots, columns=spatial.gas.biogas)
e_max_pu.iloc[-1] = 0
@ -2731,6 +2731,7 @@ def add_biomass(n, costs):
# Solid biomass to liquid fuel
if options["biomass_to_liquid"]:
add_carrier_buses(n, "oil")
n.madd(
"Link",
spatial.biomass.nodes,
@ -2774,7 +2775,7 @@ def add_biomass(n, costs):
# Combination of efuels and biomass to liquid, both based on Fischer-Tropsch.
# Experimental version - use with caution
if options["electrobiofuels"]:
add_carrier_buses(n, "oil")
efuel_scale_factor = costs.at["BtL", "C stored"]
name = (
pd.Index(spatial.biomass.nodes)
@ -2886,6 +2887,10 @@ def add_biomass(n, costs):
def add_industry(n, costs):
logger.info("Add industrial demand")
# add oil buses for shipping, aviation and naptha for industry
add_carrier_buses(n, "oil")
# add methanol buses for industry
add_carrier_buses(n, "methanol")
nodes = pop_layout.index
nhours = n.snapshot_weightings.generators.sum()
@ -3021,8 +3026,6 @@ def add_industry(n, costs):
# methanol for industry
add_carrier_buses(n, "methanol")
n.madd(
"Bus",
spatial.methanol.industry,
@ -3194,8 +3197,6 @@ def add_industry(n, costs):
if shipping_oil_share:
add_carrier_buses(n, "oil")
p_set_oil = shipping_oil_share * p_set.rename(lambda x: x + " shipping oil")
if not options["regional_oil_demand"]: