Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/#349 distribute rural heat supply #356

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/egon/data/datasets/heat_demand_timeseries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ def create_district_heating_profile_python_like(scenario="eGon2035"):
scenario=scenario,
dist_aggregated_mw=(cts.values[0]).tolist(),
)
else:
entry = EgonTimeseriesDistrictHeating(
area_id=int(area),
scenario=scenario,
dist_aggregated_mw=np.repeat(0, 8760).tolist(),
)
print(f"Timeseries for area {area} is zero.")

session.add(entry)
session.commit()
Expand Down
2 changes: 1 addition & 1 deletion src/egon/data/datasets/heat_supply/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class HeatSupply(Dataset):
def __init__(self, dependencies):
super().__init__(
name="HeatSupply",
version="0.0.10",
version="0.0.11",
dependencies=dependencies,
tasks=(
create_tables,
Expand Down
44 changes: 39 additions & 5 deletions src/egon/data/datasets/heat_supply/individual_heating.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,16 @@ def cascade_per_technology(
FROM {sources['scenario_capacities']['schema']}.
{sources['scenario_capacities']['table']} a
WHERE scenario_name = '{scenario}'
AND carrier = 'residential_rural_heat_pump'
AND carrier IN ('rural_air_heat_pump', 'rural_ground_heat_pump')
"""
)

if not target.capacity[0]:
target.capacity[0] = 0

if config.settings()["egon-data"]["--dataset-boundary"] == "Schleswig-Holstein":
target.capacity[0] /= 16

heat_per_mv["share"] = (
heat_per_mv.remaining_demand
/ heat_per_mv.remaining_demand.sum()
Expand All @@ -581,13 +587,41 @@ def cascade_per_technology(
{"bus_id": "mv_grid_id", "share": "capacity"}, axis=1, inplace=True
)

elif tech.index == "gas_boiler":
elif tech.index in ("gas_boiler", "resistive_heater", "solar_thermal"):
# Select target value for Germany
target = db.select_dataframe(
f"""
SELECT SUM(capacity) AS capacity
FROM {sources['scenario_capacities']['schema']}.
{sources['scenario_capacities']['table']} a
WHERE scenario_name = '{scenario}'
AND carrier = 'rural_{tech.index[0]}'
"""
)

if config.settings()["egon-data"]["--dataset-boundary"] == "Schleswig-Holstein":
target.capacity[0] /= 16

heat_per_mv["share"] = (
heat_per_mv.remaining_demand
/ heat_per_mv.remaining_demand.sum()
)

append_df = (
heat_per_mv["share"].mul(target.capacity[0]).reset_index()
)

append_df.rename(
{"bus_id": "mv_grid_id", "share": "capacity"}, axis=1, inplace=True
)

else:
append_df = pd.DataFrame(
data={
"capacity": heat_per_mv.remaining_demand.div(
tech.estimated_flh.values[0]
),
"carrier": "residential_rural_gas_boiler",
"carrier": f"residential_rural_{tech.index}",
"mv_grid_id": heat_per_mv.index,
"scenario": scenario,
}
Expand Down Expand Up @@ -675,9 +709,9 @@ def cascade_heat_supply_indiv(scenario, distribution_level, plotting=True):
)
elif scenario == "eGon100RE":
technologies = pd.DataFrame(
index=["heat_pump"],
index=["heat_pump", "resistive_heater", "solar_thermal", "gas_boiler", "oil_boiler"],
columns=["estimated_flh", "priority"],
data={"estimated_flh": [4000], "priority": [1]},
data={"estimated_flh": [4000, 2000, 2000, 8000, 8000], "priority": [5,4,3,2,1]},
)
elif scenario == "status2019":
technologies = pd.DataFrame(
Expand Down
Loading