Skip to content
Merged
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
12 changes: 8 additions & 4 deletions districtgenerator/functions/opti_central.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,15 +1721,17 @@ def helper_func_extract_eh_results(model, results_dict, variable_type, device_se
# Heat devices
for n in range(nbuildings):
for device in ECS_HEAT:
results_dict[n][device] = {}
if not results_dict[n].get(device):
results_dict[n][device] = {}
results_dict[n][device]["Q_th"] = []
for t in time_steps:
results_dict[n][device]["Q_th"].append(round(pyo.value(model.heat_dom[device, n, t]), 0))

# Cooling devices
for n in range(nbuildings):
for device in ECS_COOL:
results_dict[n][device] = {}
if not results_dict[n].get(device):
results_dict[n][device] = {}
results_dict[n][device]["Q_cool"] = []
for t in time_steps:
results_dict[n][device]["Q_cool"].append(round(pyo.value(model.cool_dom[device, n, t]), 0))
Expand All @@ -1754,15 +1756,17 @@ def helper_func_extract_eh_results(model, results_dict, variable_type, device_se
# Power devices
for n in range(nbuildings):
for device in ECS_POWER:
results_dict[n][device] = {}
if not results_dict[n].get(device):
results_dict[n][device] = {}
results_dict[n][device]["P_el"] = []
for t in time_steps:
results_dict[n][device]["P_el"].append(round(pyo.value(model.power_dom[device, n, t]), 0))

# Storage devices
for n in range(nbuildings):
for device in ECS_STORAGE:
results_dict[n][device] = {}
if not results_dict[n].get(device):
results_dict[n][device] = {}
for v in ("ch", "dch", "soc"):
results_dict[n][device][v] = []
for t in time_steps:
Expand Down