Skip to content

Commit

Permalink
bug fix in heat pump load, added standing loss
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFrankenQ committed Aug 4, 2023
1 parent e72703b commit cfeb7d6
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions scripts/prepare_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,18 @@ def add_heat_pump_load(
p_set=hp_heat_demand,
)

n.madd(
"Link",
gb_nodes,
suffix = " heat pump",
bus0=gb_nodes,
bus1=gb_nodes + " elec heat demand",
carrier="heat pump",
p_nom_extendable=True,
capital_cost=0.,
marginal_cost=0.,
)

import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1, figsize=(16, 4))

Expand All @@ -572,6 +584,8 @@ def add_heat_pump_load(

shift_size = snakemake.config["flexibility"]["heat_shift_size"]

standing_loss = snakemake.config["flexibility"]["hourly_heat_loss"]

s = n.snapshots

logger.warning("Check timezone-issue!!")
Expand Down Expand Up @@ -650,6 +664,7 @@ def add_heat_pump_load(
bus=gb_nodes + " thermal inertia",
e_nom=e_nom,
e_max_pu=e_max_pu,
standing_loss=standing_loss,
)

n.madd(
Expand Down Expand Up @@ -1281,11 +1296,13 @@ def add_batteries(n):

flexopts = snakemake.wildcards.flexopts.split("-")

assert sum(list(map(lambda x: x in {"ss", "reg", "bev", "heat"}, flexopts))) == len(flexopts), (
"flexopts must be a combination of 'ss', 'reg', 'bev', 'heat', currently is {}".format(
snakemake.wildcards.flexopts
print(flexopts)
if not (len(flexopts) == 1 and "" in flexopts):
assert sum(list(map(lambda x: x in {"ss", "reg", "bev", "heat"}, flexopts))) == len(flexopts), (
"flexopts must be a combination of 'ss', 'reg', 'bev', 'heat', currently is {}".format(
snakemake.wildcards.flexopts
)
)
)

logger.info(f"Using Flexibility Options: {flexopts}")

Expand Down

0 comments on commit cfeb7d6

Please sign in to comment.