cost completed

This commit is contained in:
Guille Gutierrez 2023-08-01 16:41:37 -04:00
parent 2292bff1b8
commit 4d0f247a83
4 changed files with 48 additions and 0 deletions

View File

@ -388,6 +388,42 @@ class Building(CityObject):
""" """
self._domestic_hot_water_heat_demand = value self._domestic_hot_water_heat_demand = value
@property
def lighting_peak_load(self) -> Union[None, dict]:
"""
Get lighting peak load in W
:return: dict{[float]}
"""
results = {}
peak_lighting = 0
for thermal_zone in self.thermal_zones:
lighting = thermal_zone.lighting
for schedule in lighting.schedules:
peak = max(schedule.values) * lighting.density * thermal_zone.total_floor_area
if peak > peak_lighting:
peak_lighting = peak
results[cte.MONTH] = [peak for _ in range(0, 12)]
results[cte.YEAR] = [peak]
return results
@property
def appliances_peak_load(self) -> Union[None, dict]:
"""
Get appliances peak load in W
:return: dict{[float]}
"""
results = {}
peak_appliances = 0
for thermal_zone in self.thermal_zones:
appliances = thermal_zone.appliances
for schedule in appliances.schedules:
peak = max(schedule.values) * appliances.density * thermal_zone.total_floor_area
if peak > peak_appliances:
peak_appliances = peak
results[cte.MONTH] = [peak for _ in range(0, 12)]
results[cte.YEAR] = [peak]
return results
@property @property
def heating_peak_load(self) -> Union[None, dict]: def heating_peak_load(self) -> Union[None, dict]:
""" """

View File

@ -221,6 +221,10 @@ TestDBFactory
yearly_cooling_peak_load = building.cooling_peak_load[cte.YEAR] yearly_cooling_peak_load = building.cooling_peak_load[cte.YEAR]
monthly_heating_peak_load = building.heating_peak_load[cte.MONTH] monthly_heating_peak_load = building.heating_peak_load[cte.MONTH]
yearly_heating_peak_load = building.heating_peak_load[cte.YEAR] yearly_heating_peak_load = building.heating_peak_load[cte.YEAR]
monthly_lighting_peak_load = building.lighting_peak_load[cte.MONTH]
yearly_lighting_peak_load = building.lighting_peak_load[cte.YEAR]
monthly_appliances_peak_load = building.appliances_peak_load[cte.MONTH]
yearly_appliances_peak_load = building.appliances_peak_load[cte.YEAR]
monthly_cooling_demand = building.cooling_demand[cte.MONTH][cte.INSEL_MEB] monthly_cooling_demand = building.cooling_demand[cte.MONTH][cte.INSEL_MEB]
yearly_cooling_demand = building.cooling_demand[cte.YEAR][cte.INSEL_MEB] yearly_cooling_demand = building.cooling_demand[cte.YEAR][cte.INSEL_MEB]
monthly_heating_demand = building.heating_demand[cte.MONTH][cte.INSEL_MEB] monthly_heating_demand = building.heating_demand[cte.MONTH][cte.INSEL_MEB]
@ -248,6 +252,10 @@ TestDBFactory
{'yearly_cooling_peak_load': yearly_cooling_peak_load}, {'yearly_cooling_peak_load': yearly_cooling_peak_load},
{'monthly_heating_peak_load': monthly_heating_peak_load}, {'monthly_heating_peak_load': monthly_heating_peak_load},
{'yearly_heating_peak_load': yearly_heating_peak_load}, {'yearly_heating_peak_load': yearly_heating_peak_load},
{'monthly_lighting_peak_load': monthly_lighting_peak_load},
{'yearly_lighting_peak_load': yearly_lighting_peak_load},
{'monthly_appliances_peak_load': monthly_appliances_peak_load},
{'yearly_appliances_peak_load': yearly_appliances_peak_load},
{'monthly_cooling_demand': monthly_cooling_demand.tolist()}, {'monthly_cooling_demand': monthly_cooling_demand.tolist()},
{'yearly_cooling_demand': yearly_cooling_demand.tolist()}, {'yearly_cooling_demand': yearly_cooling_demand.tolist()},
{'monthly_heating_demand': monthly_heating_demand.tolist()}, {'monthly_heating_demand': monthly_heating_demand.tolist()},

View File

@ -69,6 +69,10 @@ class TestResultsImport(TestCase):
self.assertIsNotNone(building.cooling_demand[cte.MONTH][cte.INSEL_MEB]) self.assertIsNotNone(building.cooling_demand[cte.MONTH][cte.INSEL_MEB])
self.assertIsNotNone(building.heating_demand[cte.YEAR][cte.INSEL_MEB]) self.assertIsNotNone(building.heating_demand[cte.YEAR][cte.INSEL_MEB])
self.assertIsNotNone(building.cooling_demand[cte.YEAR][cte.INSEL_MEB]) self.assertIsNotNone(building.cooling_demand[cte.YEAR][cte.INSEL_MEB])
self.assertIsNotNone(building.lighting_peak_load[cte.MONTH])
self.assertIsNotNone(building.lighting_peak_load[cte.YEAR])
self.assertIsNotNone(building.appliances_peak_load[cte.MONTH])
self.assertIsNotNone(building.appliances_peak_load[cte.YEAR])
def test_peak_loads(self): def test_peak_loads(self):
# todo: this is not technically a import # todo: this is not technically a import

Binary file not shown.