hub/city_model_structure/thermal_zone.py

187 lines
4.7 KiB
Python
Raw Normal View History

2020-06-09 14:07:47 -04:00
"""
ThermalZone module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
2020-06-10 13:08:51 -04:00
from typing import List, TypeVar
from city_model_structure.usage_zone import UsageZone
2020-06-10 13:08:51 -04:00
from city_model_structure.surface import Surface
from helpers.configuration_helper import ConfigurationHelper
2020-06-10 13:08:51 -04:00
ThermalBoundary = TypeVar('ThermalBoundary')
class ThermalZone:
2020-06-10 13:08:51 -04:00
"""
ThermalZone class
"""
def __init__(self, surfaces):
self._surfaces = surfaces
self._floor_area = None
self._bounded = None
self._heated = ConfigurationHelper().heated
self._cooled = ConfigurationHelper().cooled
self._additional_thermal_bridge_u_value = ConfigurationHelper().additional_thermal_bridge_u_value
self._effective_thermal_capacity = None
self._indirectly_heated_area_ratio = ConfigurationHelper().indirectly_heated_area_ratio
self._infiltration_rate_system_on = ConfigurationHelper().infiltration_rate_system_on
self._infiltration_rate_system_off = None
self._usage_zones = None
@property
def heated(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone heated flag
:return: Boolean
"""
return self._heated
@property
def cooled(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone cooled flag
:return: Boolean
"""
return self._cooled
@property
def floor_area(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone floor area in square meters
2020-06-10 13:08:51 -04:00
:return: float
"""
if self._floor_area is None:
self._floor_area = 0
for s in self._surfaces:
if s.type == 'Ground':
self._floor_area += s.area
return self._floor_area
@property
2020-06-10 13:08:51 -04:00
def bounded(self) -> List[ThermalBoundary]:
"""
Get thermal boundaries bounding with the thermal zone
:return: [ThermalBoundary]
"""
return self._bounded
@bounded.setter
def bounded(self, value):
2020-06-10 13:08:51 -04:00
"""
Set thermal boundaries bounding with the thermal zone
:param value: [ThermalBoundary]
:return: None
"""
self._bounded = value
@property
2020-06-10 13:08:51 -04:00
def surfaces(self) -> List[Surface]:
2020-06-16 10:06:32 -04:00
# todo: This property should be erased
2020-06-10 13:08:51 -04:00
"""
Get thermal zone surfaces
:return: [Surface]
"""
return self._surfaces
@property
def additional_thermal_bridge_u_value(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone additional thermal bridge u value W/m2K
2020-06-10 13:08:51 -04:00
:return: float
"""
return self._additional_thermal_bridge_u_value
@additional_thermal_bridge_u_value.setter
def additional_thermal_bridge_u_value(self, value):
2020-06-10 13:08:51 -04:00
"""
Set thermal zone additional thermal bridge u value W/m2K
2020-06-10 13:08:51 -04:00
:param value: float
:return: None
"""
self._additional_thermal_bridge_u_value = value
@property
def effective_thermal_capacity(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone effective thermal capacity
:return: float
"""
return self._effective_thermal_capacity
@effective_thermal_capacity.setter
def effective_thermal_capacity(self, value):
2020-06-10 13:08:51 -04:00
"""
Set thermal zone effective thermal capacity
:param value: float
:return: None
"""
self._effective_thermal_capacity = value
@property
def indirectly_heated_area_ratio(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone indirectly heated area ratio
:return: float
"""
return self._indirectly_heated_area_ratio
@indirectly_heated_area_ratio.setter
def indirectly_heated_area_ratio(self, value):
2020-06-10 13:08:51 -04:00
"""
Set thermal zone indirectly heated area ratio
:param value: float
:return: None
"""
self._indirectly_heated_area_ratio = value
@property
def infiltration_rate_system_on(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone infiltration rate system on in air changes per hour
:return: float
"""
return self._infiltration_rate_system_on
@infiltration_rate_system_on.setter
def infiltration_rate_system_on(self, value):
2020-06-10 13:08:51 -04:00
"""
Set thermal zone infiltration rate system on in air changes per hour
:param value: float
:return: None
"""
self._infiltration_rate_system_on = value
@property
def infiltration_rate_system_off(self):
2020-06-10 13:08:51 -04:00
"""
Get thermal zone infiltration rate system off in air changes per hour
:return: float
"""
return self._infiltration_rate_system_off
@infiltration_rate_system_off.setter
def infiltration_rate_system_off(self, value):
2020-06-10 13:08:51 -04:00
"""
Set thermal zone infiltration rate system on in air changes per hour
:param value: float
:return: None
"""
self._infiltration_rate_system_off = value
@property
def usage_zones(self) -> List[UsageZone]:
2020-06-10 13:08:51 -04:00
"""
Get thermal zone usage zones
:return: [UsageZone]
"""
return self._usage_zones
@usage_zones.setter
def usage_zones(self, values):
2020-06-10 13:08:51 -04:00
"""
Set thermal zone usage zones
:param values: [UsageZone]
:return: None
"""
self._usage_zones = values