Add option to exclude fossil fuels

This commit is contained in:
millingermarkus 2024-07-04 11:16:00 +02:00
parent 54009e7af8
commit 5c7bb2bf51
2 changed files with 16 additions and 2 deletions

View File

@ -407,6 +407,7 @@ sector:
biomass: true biomass: true
industry: true industry: true
agriculture: true agriculture: true
fossil_fuels: true
district_heating: district_heating:
potential: 0.6 potential: 0.6
progress: progress:

View File

@ -542,11 +542,19 @@ def add_carrier_buses(n, carrier, nodes=None):
capital_cost=capital_cost, capital_cost=capital_cost,
) )
fossils = ['coal', 'gas', 'oil', 'lignite']
if not options.get('fossil_fuels',True) and carrier in fossils:
print('Not adding fossil ', carrier)
extendable = False
else:
print('Adding fossil ', carrier)
extendable = True
n.madd( n.madd(
"Generator", "Generator",
nodes, nodes,
bus=nodes, bus=nodes,
p_nom_extendable=True, p_nom_extendable=extendable,
carrier=carrier, carrier=carrier,
marginal_cost=costs.at[carrier, "fuel"], marginal_cost=costs.at[carrier, "fuel"],
) )
@ -2894,12 +2902,17 @@ def add_industry(n, costs):
carrier="oil", carrier="oil",
) )
if not options.get('fossil_fuels', True):
extendable = False
else:
extendable = True
if "oil" not in n.generators.carrier.unique(): if "oil" not in n.generators.carrier.unique():
n.madd( n.madd(
"Generator", "Generator",
spatial.oil.nodes, spatial.oil.nodes,
bus=spatial.oil.nodes, bus=spatial.oil.nodes,
p_nom_extendable=True, p_nom_extendable=extendable,
carrier="oil", carrier="oil",
marginal_cost=costs.at["oil", "fuel"], marginal_cost=costs.at["oil", "fuel"],
) )