hub/city_model_structure/building_demand/thermal_zone.py
2022-03-24 18:43:55 -04:00

217 lines
5.9 KiB
Python

"""
ThermalZone module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import uuid
from typing import List, Union, Tuple, TypeVar
from city_model_structure.building_demand.usage_zone import UsageZone
from city_model_structure.building_demand.thermal_control import ThermalControl
from city_model_structure.energy_systems.hvac_system import HvacSystem
from city_model_structure.attributes.schedule import Schedule
ThermalBoundary = TypeVar('ThermalBoundary')
class ThermalZone:
"""
ThermalZone class
"""
def __init__(self, thermal_boundaries, volume, floor_area):
self._id = None
self._floor_area = floor_area
self._thermal_boundaries = thermal_boundaries
self._additional_thermal_bridge_u_value = None
self._effective_thermal_capacity = None
self._indirectly_heated_area_ratio = None
self._infiltration_rate_system_on = None
self._infiltration_rate_system_off = None
self._usage_zones = None
self._volume = volume
self._ordinate_number = None
self._thermal_control = None
self._hvac_system = None
@property
def id(self):
"""
Get thermal zone id, an universally unique identifier randomly generated
:return: str
"""
if self._id is None:
self._id = uuid.uuid4()
return self._id
@property
def floor_area(self) -> float:
"""
Get thermal zone floor area in m2
:return: float
"""
return self._floor_area
@property
def thermal_boundaries(self) -> List[ThermalBoundary]:
"""
Get thermal boundaries bounding with the thermal zone
:return: [ThermalBoundary]
"""
return self._thermal_boundaries
@property
def additional_thermal_bridge_u_value(self) -> Union[None, float]:
"""
Get thermal zone additional thermal bridge u value W/m2K
:return: None or 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
"""
if value is not None:
self._additional_thermal_bridge_u_value = float(value)
@property
def effective_thermal_capacity(self) -> Union[None, float]:
"""
Get thermal zone effective thermal capacity in J/m2K
:return: None or float
"""
return self._effective_thermal_capacity
@effective_thermal_capacity.setter
def effective_thermal_capacity(self, value):
"""
Set thermal zone effective thermal capacity in J/m2K
:param value: float
"""
if value is not None:
self._effective_thermal_capacity = float(value)
@property
def indirectly_heated_area_ratio(self) -> Union[None, float]:
"""
Get thermal zone indirectly heated area ratio
:return: None or 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
"""
if value is not None:
self._indirectly_heated_area_ratio = float(value)
@property
def infiltration_rate_system_on(self) -> Union[None, Schedule]:
"""
Get thermal zone infiltration rate system on in air changes per hour (ACH)
:return: None or Schedule
"""
return self._infiltration_rate_system_on
@infiltration_rate_system_on.setter
def infiltration_rate_system_on(self, value):
"""
Set thermal zone infiltration rate system on in air changes per hour (ACH)
:param value: Schedule
"""
self._infiltration_rate_system_on = value
@property
def infiltration_rate_system_off(self) -> Union[None, Schedule]:
"""
Get thermal zone infiltration rate system off in air changes per hour (ACH)
:return: None or Schedule
"""
return self._infiltration_rate_system_off
@infiltration_rate_system_off.setter
def infiltration_rate_system_off(self, value):
"""
Set thermal zone infiltration rate system on in air changes per hour (ACH)
:param value: Schedule
"""
self._infiltration_rate_system_off = value
@property
def usage_zones(self) -> Tuple[float, UsageZone]:
"""
Get list of usage zones and the percentage of thermal zone's volume affected by that usage
:return: [UsageZone]
"""
return self._usage_zones
@usage_zones.setter
def usage_zones(self, values):
"""
Set list of usage zones and the percentage of thermal zone's volume affected by that usage
:param values: Tuple[float, UsageZone]
"""
self._usage_zones = values
@property
def volume(self):
"""
Get thermal zone volume
:return: float
"""
return self._volume
@property
def ordinate_number(self) -> Union[None, int]:
"""
Get the order in which the thermal_zones need to be enumerated
:return: None or int
"""
return self._ordinate_number
@ordinate_number.setter
def ordinate_number(self, value):
"""
Set a specific order of the zones to be called
:param value: int
"""
if value is not None:
self._ordinate_number = int(value)
@property
def thermal_control(self) -> Union[None, ThermalControl]:
"""
Get thermal control of this thermal zone
:return: None or ThermalControl
"""
return self._thermal_control
@thermal_control.setter
def thermal_control(self, value):
"""
Set thermal control for this thermal zone
:param value: ThermalControl
"""
self._thermal_control = value
@property
def hvac_system(self) -> Union[None, HvacSystem]:
"""
Get HVAC system installed for this thermal zone
:return: None or HvacSystem
"""
return self._hvac_system
@hvac_system.setter
def hvac_system(self, value):
"""
Set HVAC system installed for this thermal zone
:param value: HvacSystem
"""
self._hvac_system = value