Merge pull request #901 from PyPSA/dac-location-consistency

prepare_sector_network: reorder buses for dac components
This commit is contained in:
Fabian Neumann 2024-02-05 12:19:21 +01:00 committed by GitHub
commit 7e2ad98011
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 13 deletions

View File

@ -57,6 +57,8 @@ Upcoming Release
* Add the option to customise map projection in plotting config. * Add the option to customise map projection in plotting config.
* The order of buses (bus0, bus1, ...) for DAC components has changed to meet the convention of the other components. Therefore, `bus0` refers to the electricity bus (input), `bus1` to the heat bus (input), 'bus2' to the CO2 atmosphere bus (input), and `bus3` to the CO2 storage bus (output).
* The rule ``plot_network`` has been split into separate rules for plotting * The rule ``plot_network`` has been split into separate rules for plotting
electricity, hydrogen and gas networks. electricity, hydrogen and gas networks.

View File

@ -288,7 +288,7 @@ def attach_load(n, regions, load, nuts3_shapes, ua_md_gdp, countries, scaling=1.
ua_md_gdp = pd.read_csv(ua_md_gdp, dtype={"name": "str"}).set_index("name") ua_md_gdp = pd.read_csv(ua_md_gdp, dtype={"name": "str"}).set_index("name")
logger.info(f"Load data scaled with scalling factor {scaling}.") logger.info(f"Load data scaled by factor {scaling}.")
opsd_load *= scaling opsd_load *= scaling
nuts3 = gpd.read_file(nuts3_shapes).set_index("index") nuts3 = gpd.read_file(nuts3_shapes).set_index("index")

View File

@ -710,27 +710,27 @@ def add_dac(n, costs):
heat_buses = n.buses.index[n.buses.carrier.isin(heat_carriers)] heat_buses = n.buses.index[n.buses.carrier.isin(heat_carriers)]
locations = n.buses.location[heat_buses] locations = n.buses.location[heat_buses]
efficiency2 = -( electricity_input = (
costs.at["direct air capture", "electricity-input"] costs.at["direct air capture", "electricity-input"]
+ costs.at["direct air capture", "compression-electricity-input"] + costs.at["direct air capture", "compression-electricity-input"]
) ) # MWh_el / tCO2
efficiency3 = -( heat_input = (
costs.at["direct air capture", "heat-input"] costs.at["direct air capture", "heat-input"]
- costs.at["direct air capture", "compression-heat-output"] - costs.at["direct air capture", "compression-heat-output"]
) ) # MWh_th / tCO2
n.madd( n.madd(
"Link", "Link",
heat_buses.str.replace(" heat", " DAC"), heat_buses.str.replace(" heat", " DAC"),
bus0="co2 atmosphere", bus0=locations.values,
bus1=spatial.co2.df.loc[locations, "nodes"].values, bus1=heat_buses,
bus2=locations.values, bus2="co2 atmosphere",
bus3=heat_buses, bus3=spatial.co2.df.loc[locations, "nodes"].values,
carrier="DAC", carrier="DAC",
capital_cost=costs.at["direct air capture", "fixed"], capital_cost=costs.at["direct air capture", "fixed"] / electricity_input,
efficiency=1.0, efficiency=-heat_input / electricity_input,
efficiency2=efficiency2, efficiency2=-1 / electricity_input,
efficiency3=efficiency3, efficiency3=1 / electricity_input,
p_nom_extendable=True, p_nom_extendable=True,
lifetime=costs.at["direct air capture", "lifetime"], lifetime=costs.at["direct air capture", "lifetime"],
) )