2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
ThermalZone module
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
2021-03-02 18:57:09 -05:00
|
|
|
Contributors Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
from typing import List, TypeVar
|
|
|
|
|
|
|
|
from city_model_structure.attributes.surface import Surface
|
|
|
|
from city_model_structure.attributes.usage_zone import UsageZone
|
|
|
|
|
|
|
|
ThermalBoundary = TypeVar('ThermalBoundary')
|
2021-03-16 12:19:35 -04:00
|
|
|
Polyhedron = TypeVar('Polyhedron')
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ThermalZone:
|
|
|
|
"""
|
|
|
|
ThermalZone class
|
|
|
|
"""
|
2021-03-02 18:57:09 -05:00
|
|
|
def __init__(self, surfaces, is_heated, is_cooled):
|
2020-10-28 13:42:58 -04:00
|
|
|
self._surfaces = surfaces
|
|
|
|
self._floor_area = None
|
|
|
|
self._bounded = None
|
2021-03-02 18:57:09 -05:00
|
|
|
self._is_heated = is_heated
|
|
|
|
self._is_cooled = is_cooled
|
2021-03-16 12:19:35 -04:00
|
|
|
self._is_mechanically_ventilated = None
|
2021-03-02 18:57:09 -05:00
|
|
|
self._additional_thermal_bridge_u_value = None
|
2020-10-28 13:42:58 -04:00
|
|
|
self._effective_thermal_capacity = None
|
2021-03-02 18:57:09 -05:00
|
|
|
self._indirectly_heated_area_ratio = None
|
|
|
|
self._infiltration_rate_system_on = None
|
2020-10-28 13:42:58 -04:00
|
|
|
self._infiltration_rate_system_off = None
|
|
|
|
self._usage_zones = None
|
2021-03-02 18:57:09 -05:00
|
|
|
self._volume = None
|
2021-03-16 12:19:35 -04:00
|
|
|
self._volume_geometry = None
|
2021-03-02 18:57:09 -05:00
|
|
|
|
2020-10-28 13:42:58 -04:00
|
|
|
@property
|
2021-03-15 11:47:30 -04:00
|
|
|
def is_heated(self):
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal zone heated flag
|
|
|
|
:return: Boolean
|
|
|
|
"""
|
2021-03-02 18:57:09 -05:00
|
|
|
return self._is_heated
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-03-15 11:47:30 -04:00
|
|
|
def is_cooled(self):
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal zone cooled flag
|
|
|
|
:return: Boolean
|
|
|
|
"""
|
2021-03-02 18:57:09 -05:00
|
|
|
return self._is_cooled
|
2020-10-28 13:42:58 -04:00
|
|
|
|
2021-03-16 12:19:35 -04:00
|
|
|
@property
|
|
|
|
def is_mechanically_ventilated(self):
|
|
|
|
"""
|
|
|
|
Get thermal zone mechanical ventilation flag
|
|
|
|
:return: Boolean
|
|
|
|
"""
|
|
|
|
return self._is_mechanically_ventilated
|
|
|
|
|
2020-10-28 13:42:58 -04:00
|
|
|
@property
|
|
|
|
def floor_area(self):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get thermal zone floor area in m2
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
if self._floor_area is None:
|
|
|
|
self._floor_area = 0
|
|
|
|
for s in self._surfaces:
|
|
|
|
if s.type == 'Ground':
|
2021-03-08 18:27:14 -05:00
|
|
|
self._floor_area += s.perimeter_polygon.area
|
2020-10-28 13:42:58 -04:00
|
|
|
return self._floor_area
|
|
|
|
|
|
|
|
@property
|
|
|
|
def bounded(self) -> List[ThermalBoundary]:
|
|
|
|
"""
|
|
|
|
Get thermal boundaries bounding with the thermal zone
|
|
|
|
:return: [ThermalBoundary]
|
|
|
|
"""
|
|
|
|
return self._bounded
|
|
|
|
|
|
|
|
@bounded.setter
|
|
|
|
def bounded(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal boundaries bounding with the thermal zone
|
|
|
|
:param value: [ThermalBoundary]
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._bounded = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def surfaces(self) -> List[Surface]:
|
2021-03-15 11:47:30 -04:00
|
|
|
# todo: This property should be erased (@Guille: why??)
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal zone surfaces
|
|
|
|
:return: [Surface]
|
|
|
|
"""
|
|
|
|
return self._surfaces
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_thermal_bridge_u_value(self):
|
|
|
|
"""
|
|
|
|
Get thermal zone additional thermal bridge u value W/m2K
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._additional_thermal_bridge_u_value
|
|
|
|
|
|
|
|
@additional_thermal_bridge_u_value.setter
|
|
|
|
def additional_thermal_bridge_u_value(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal zone additional thermal bridge u value W/m2K
|
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._additional_thermal_bridge_u_value = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def effective_thermal_capacity(self):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get thermal zone effective thermal capacity in J/m2K
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._effective_thermal_capacity
|
|
|
|
|
|
|
|
@effective_thermal_capacity.setter
|
|
|
|
def effective_thermal_capacity(self, value):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Set thermal zone effective thermal capacity in J/m2K
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._effective_thermal_capacity = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def indirectly_heated_area_ratio(self):
|
|
|
|
"""
|
|
|
|
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):
|
|
|
|
"""
|
|
|
|
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):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get thermal zone infiltration rate system on in air changes per hour (ACH)
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._infiltration_rate_system_on
|
|
|
|
|
|
|
|
@infiltration_rate_system_on.setter
|
|
|
|
def infiltration_rate_system_on(self, value):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Set thermal zone infiltration rate system on in air changes per hour (ACH)
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._infiltration_rate_system_on = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def infiltration_rate_system_off(self):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get thermal zone infiltration rate system off in air changes per hour (ACH)
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._infiltration_rate_system_off
|
|
|
|
|
|
|
|
@infiltration_rate_system_off.setter
|
|
|
|
def infiltration_rate_system_off(self, value):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Set thermal zone infiltration rate system on in air changes per hour (ACH)
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._infiltration_rate_system_off = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def usage_zones(self) -> List[UsageZone]:
|
|
|
|
"""
|
|
|
|
Get thermal zone usage zones
|
|
|
|
:return: [UsageZone]
|
|
|
|
"""
|
|
|
|
return self._usage_zones
|
|
|
|
|
|
|
|
@usage_zones.setter
|
|
|
|
def usage_zones(self, values):
|
|
|
|
"""
|
|
|
|
Set thermal zone usage zones
|
|
|
|
:param values: [UsageZone]
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._usage_zones = values
|
2021-03-15 12:44:33 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def volume(self):
|
|
|
|
"""
|
|
|
|
Get thermal zone volume
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._volume
|
|
|
|
|
|
|
|
@volume.setter
|
|
|
|
def volume(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal zone volume
|
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._volume = value
|
2021-03-16 12:19:35 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def volume_geometry(self) -> Polyhedron:
|
|
|
|
"""
|
|
|
|
Get the polyhedron defined by the thermal zone
|
|
|
|
:return: Polyhedron
|
|
|
|
"""
|
|
|
|
return self._volume_geometry
|