diff --git a/config/config.default.yaml b/config/config.default.yaml index 81dda14a..5a588650 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -451,6 +451,7 @@ sector: coal_cc: false dac: true co2_vent: false + central_heat_vent: false allam_cycle: false hydrogen_fuel_cell: true hydrogen_turbine: false @@ -878,6 +879,7 @@ plotting: services rural heat: '#ff9c9c' central heat: '#cc1f1f' urban central heat: '#d15959' + urban central heat vent: '#a74747' decentral heat: '#750606' residential urban decentral heat: '#a33c3c' services urban decentral heat: '#cc1f1f' diff --git a/config/test/config.myopic.yaml b/config/test/config.myopic.yaml index 0bb85ec6..d566c6cb 100644 --- a/config/test/config.myopic.yaml +++ b/config/test/config.myopic.yaml @@ -30,6 +30,9 @@ snapshots: start: "2013-03-01" end: "2013-03-08" +sector: + central_heat_vent: true + electricity: co2limit: 100.e+6 diff --git a/config/test/config.perfect.yaml b/config/test/config.perfect.yaml index c99f4122..49886b26 100644 --- a/config/test/config.perfect.yaml +++ b/config/test/config.perfect.yaml @@ -44,6 +44,7 @@ electricity: sector: min_part_load_fischer_tropsch: 0 min_part_load_methanolisation: 0 + atlite: default_cutout: be-03-2013-era5 cutouts: diff --git a/scripts/make_summary_perfect.py b/scripts/make_summary_perfect.py index 7ca4055d..c387c6cf 100644 --- a/scripts/make_summary_perfect.py +++ b/scripts/make_summary_perfect.py @@ -28,6 +28,16 @@ idx = pd.IndexSlice opt_name = {"Store": "e", "Line": "s", "Transformer": "s"} +def reindex_columns(df, cols): + investments = cols.levels[3] + if len(cols.names) != len(df.columns.levels): + df = pd.concat([df] * len(investments), axis=1) + df.columns = cols + df = df.reindex(cols, axis=1) + + return df + + def calculate_costs(n, label, costs): investments = n.investment_periods cols = pd.MultiIndex.from_product( @@ -39,7 +49,8 @@ def calculate_costs(n, label, costs): ], names=costs.columns.names[:3] + ["year"], ) - costs = costs.reindex(cols, axis=1) + + costs = reindex_columns(costs, cols) for c in n.iterate_components( n.branch_components | n.controllable_one_port_components ^ {"Load"} @@ -176,7 +187,7 @@ def calculate_capacities(n, label, capacities): ], names=capacities.columns.names[:3] + ["year"], ) - capacities = capacities.reindex(cols, axis=1) + capacities = reindex_columns(capacities, cols) for c in n.iterate_components( n.branch_components | n.controllable_one_port_components ^ {"Load"} @@ -229,7 +240,7 @@ def calculate_energy(n, label, energy): ], names=energy.columns.names[:3] + ["year"], ) - energy = energy.reindex(cols, axis=1) + energy = reindex_columns(energy, cols) for c in n.iterate_components(n.one_port_components | n.branch_components): if c.name in n.one_port_components: @@ -336,7 +347,7 @@ def calculate_supply_energy(n, label, supply_energy): ], names=supply_energy.columns.names[:3] + ["year"], ) - supply_energy = supply_energy.reindex(cols, axis=1) + supply_energy = reindex_columns(supply_energy, cols) bus_carriers = n.buses.carrier.unique() @@ -604,7 +615,7 @@ def calculate_price_statistics(n, label, price_statistics): price_statistics.at["mean", label] = n.buses_t.marginal_price[buses].mean().mean() price_statistics.at["standard_deviation", label] = ( - n.buses_t.marginal_price[buses].droplevel(0).unstack().std() + n.buses_t.marginal_price[buses].std().std() ) return price_statistics diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index ee72042f..f585ad04 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1693,6 +1693,18 @@ def add_heat(n, costs): unit="MWh_th", ) + if name == "urban central" and options.get("central_heat_vent"): + n.madd( + "Generator", + nodes[name] + f" {name} heat vent", + location=nodes[name], + carrier=name + " heat vent", + p_nom_extendable=True, + p_max_pu=0, + p_min_pu=-1, + unit="MWh_th", + ) + ## Add heat load for sector in sectors: