forked from s_ranjbar/city_retrofit
modifications for hourly values
This commit is contained in:
parent
51df504a52
commit
7b3197c5f0
|
@ -2,6 +2,7 @@
|
|||
Building module
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||
contributors: Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
|
|
|
@ -18,16 +18,20 @@ class MonthlyToHourlyDemand:
|
|||
|
||||
@property
|
||||
def hourly_heating(self):
|
||||
"""
|
||||
hourly distribution of the monthly heating of a building
|
||||
:return: [hourly_heating]
|
||||
"""
|
||||
# todo: this method and the insel model have to be reviewed for more than one thermal zone
|
||||
external_temp = self._building.hourly_external_temperature
|
||||
|
||||
# todo: review index depending on how the schedules are defined, either 8760 or 24 hours
|
||||
# todo: usage_zone values not implemented
|
||||
period = 'day'
|
||||
for usage_zone in self._building.usage_zones:
|
||||
temp_set = usage_zone.heating_setpoint
|
||||
temp_back = usage_zone.heating_setback
|
||||
occupancy = usage_zone.occupancy(period)
|
||||
occupancy = usage_zone.occupancy.occupant_schedule(period)
|
||||
# todo: heating_schedule is still missing
|
||||
heating_schedule = usage_zone.heating_schedule_month
|
||||
|
||||
self._hourly_heating = pd.DataFrame(columns=['monthly to hourly'])
|
||||
|
@ -40,8 +44,7 @@ class MonthlyToHourlyDemand:
|
|||
external_temp_med += external_temp[i]/24
|
||||
for hour in range(0, 24):
|
||||
if external_temp_med < temp_set[i] & heating_schedule[month] == 1:
|
||||
schedule = usage_zone.heating_schedule_day[day]
|
||||
if schedule[hour] == 1:
|
||||
if occupancy[hour] == 1:
|
||||
temp_grad_day = temp_set[i] - external_temp[i]
|
||||
else:
|
||||
temp_grad_day = temp_back[i] - external_temp[i]
|
||||
|
|
|
@ -11,7 +11,8 @@ class Occupancy:
|
|||
"""
|
||||
|
||||
def __init__(self, internal_heat_gain, heat_dissipation, occupant_rate, occupant_type, occupant_zone,
|
||||
number_of_occupants, arrival_time, departure_time, break_time, day_of_week, pd_of_meetings_duration):
|
||||
number_of_occupants, arrival_time=None, departure_time=None, break_time=None, day_of_week=None,
|
||||
pd_of_meetings_duration=None, occupant_schedule=None):
|
||||
"""
|
||||
Constructor
|
||||
"""
|
||||
|
@ -21,12 +22,13 @@ class Occupancy:
|
|||
self._occupant_rate = occupant_rate
|
||||
self._occupant_type = occupant_type
|
||||
self._occupant_zone = occupant_zone
|
||||
self._occupant_schedule = occupant_schedule
|
||||
self._number_of_occupants = number_of_occupants
|
||||
self._arrival_time = arrival_time = None
|
||||
self._departure_time = departure_time = None
|
||||
self._break_time = break_time = None
|
||||
self._day_of_week = day_of_week = None
|
||||
self._pd_of_meetings_duration = pd_of_meetings_duration = None
|
||||
self._arrival_time = arrival_time
|
||||
self._departure_time = departure_time
|
||||
self._break_time = break_time
|
||||
self._day_of_week = day_of_week
|
||||
self._pd_of_meetings_duration = pd_of_meetings_duration
|
||||
|
||||
@property
|
||||
def internal_heat_gain(self):
|
||||
|
@ -68,6 +70,14 @@ class Occupancy:
|
|||
"""
|
||||
return self._occupant_zone
|
||||
|
||||
@property
|
||||
def occupant_schedule(self):
|
||||
"""
|
||||
Get the schedule when an occupant is in a zone
|
||||
:return: occupant schedule
|
||||
"""
|
||||
return self._occupant_schedule
|
||||
|
||||
@property
|
||||
def number_of_occupants(self):
|
||||
"""
|
||||
|
|
|
@ -7,6 +7,7 @@ from typing import List
|
|||
|
||||
from city_model_structure.internal_gains import InternalGains
|
||||
from helpers.configuration_helper import ConfigurationHelper
|
||||
from city_model_structure.occupancy import Occupancy
|
||||
|
||||
|
||||
class UsageZone:
|
||||
|
@ -24,6 +25,8 @@ class UsageZone:
|
|||
# todo: this must come from library, talk to Rabeeh
|
||||
self._mechanical_air_change = ConfigurationHelper().min_air_change
|
||||
|
||||
self._occupancy = None
|
||||
|
||||
@property
|
||||
def internal_gains(self) -> List[InternalGains]:
|
||||
"""
|
||||
|
@ -159,3 +162,19 @@ class UsageZone:
|
|||
:return: None
|
||||
"""
|
||||
self._usage = value
|
||||
|
||||
@property
|
||||
def occupancy(self) -> List[Occupancy]:
|
||||
"""
|
||||
Get occupancy data
|
||||
:return: [Occupancy]
|
||||
"""
|
||||
return self._occupancy
|
||||
|
||||
@occupancy.setter
|
||||
def occupancy(self, values):
|
||||
"""
|
||||
Set occupancy
|
||||
:param values: [Occupancy]
|
||||
"""
|
||||
self._occupancy = values
|
||||
|
|
Loading…
Reference in New Issue
Block a user