2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
ThermalOpening module
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
2021-04-07 11:47:39 -04:00
|
|
|
Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-08-31 12:17:42 -04:00
|
|
|
import uuid
|
2021-09-14 13:46:48 -04:00
|
|
|
from typing import TypeVar, Union
|
2022-03-08 19:19:52 -05:00
|
|
|
from helpers.configuration_helper import ConfigurationHelper as ch
|
2021-03-16 13:43:59 -04:00
|
|
|
|
|
|
|
Polygon = TypeVar('Polygon')
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ThermalOpening:
|
|
|
|
"""
|
|
|
|
ThermalOpening class
|
|
|
|
"""
|
2021-03-02 18:57:09 -05:00
|
|
|
def __init__(self):
|
2021-08-31 12:17:42 -04:00
|
|
|
self._id = None
|
2021-03-02 18:57:09 -05:00
|
|
|
self._area = None
|
2020-10-28 13:42:58 -04:00
|
|
|
self._openable_ratio = None
|
|
|
|
self._conductivity = None
|
2021-03-11 14:31:28 -05:00
|
|
|
self._frame_ratio = None
|
2020-10-28 13:42:58 -04:00
|
|
|
self._g_value = None
|
|
|
|
self._thickness = None
|
|
|
|
self._front_side_solar_transmittance_at_normal_incidence = None
|
|
|
|
self._back_side_solar_transmittance_at_normal_incidence = None
|
|
|
|
self._overall_u_value = None
|
2022-03-08 19:19:52 -05:00
|
|
|
self._hi = ch().convective_heat_transfer_coefficient_interior
|
|
|
|
self._he = ch().convective_heat_transfer_coefficient_exterior
|
2021-08-26 09:36:10 -04:00
|
|
|
self._inside_emissivity = None
|
|
|
|
self._alpha_coefficient = None
|
|
|
|
self._radiative_coefficient = None
|
2022-04-04 22:41:34 -04:00
|
|
|
self._construction_name = None
|
2021-03-16 12:19:35 -04:00
|
|
|
|
2021-08-31 12:17:42 -04:00
|
|
|
@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
|
|
|
|
|
2021-03-02 18:57:09 -05:00
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def area(self) -> Union[None, float]:
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get thermal opening area in square meters
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
|
|
|
return self._area
|
2020-10-28 13:42:58 -04:00
|
|
|
|
2021-08-26 09:36:10 -04:00
|
|
|
@area.setter
|
|
|
|
def area(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set thermal opening area in square meters
|
2021-08-26 09:36:10 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._area = float(value)
|
2021-08-26 09:36:10 -04:00
|
|
|
|
2020-10-28 13:42:58 -04:00
|
|
|
@property
|
|
|
|
def openable_ratio(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Raises not implemented error
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-05-27 17:20:06 -04:00
|
|
|
raise NotImplementedError
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@openable_ratio.setter
|
|
|
|
def openable_ratio(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Raises not implemented error
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-05-27 17:20:06 -04:00
|
|
|
raise NotImplementedError
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def conductivity(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal opening conductivity in W/mK
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._conductivity
|
|
|
|
|
|
|
|
@conductivity.setter
|
|
|
|
def conductivity(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set thermal opening conductivity in W/mK
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
|
|
|
# The code to calculate overall_u_value is duplicated here and in thickness_m.
|
|
|
|
# This ensures a more robust code that returns the overall_u_value regardless the order the parameters are read.
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._conductivity = float(value)
|
|
|
|
if self._overall_u_value is None and self.thickness is not None:
|
|
|
|
h_i = self.hi
|
|
|
|
h_e = self.he
|
|
|
|
r_value = 1 / h_i + 1 / h_e + float(self._conductivity) / float(self.thickness)
|
|
|
|
self._overall_u_value = 1 / r_value
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def frame_ratio(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal opening frame ratio
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._frame_ratio
|
|
|
|
|
|
|
|
@frame_ratio.setter
|
|
|
|
def frame_ratio(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal opening frame ratio
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._frame_ratio = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def g_value(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get thermal opening g-value
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._g_value
|
|
|
|
|
|
|
|
@g_value.setter
|
|
|
|
def g_value(self, value):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Set thermal opening g-value
|
2021-06-09 14:23:45 -04:00
|
|
|
:param value: float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._g_value = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def thickness(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal opening thickness in meters
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._thickness
|
|
|
|
|
|
|
|
@thickness.setter
|
|
|
|
def thickness(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal opening thickness in meters
|
|
|
|
:param value: float
|
|
|
|
"""
|
|
|
|
# The code to calculate overall_u_value is duplicated here and in conductivity.
|
|
|
|
# This ensures a more robust code that returns the overall_u_value regardless the order the parameters are read.
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._thickness = float(value)
|
|
|
|
if self._overall_u_value is None and self.conductivity is not None:
|
|
|
|
h_i = self.hi
|
|
|
|
h_e = self.he
|
|
|
|
r_value = 1 / h_i + 1 / h_e + float(self.conductivity) / float(self._thickness)
|
|
|
|
self._overall_u_value = 1 / r_value
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def front_side_solar_transmittance_at_normal_incidence(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal opening front side solar transmittance at normal incidence
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._front_side_solar_transmittance_at_normal_incidence
|
|
|
|
|
|
|
|
@front_side_solar_transmittance_at_normal_incidence.setter
|
|
|
|
def front_side_solar_transmittance_at_normal_incidence(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal opening front side solar transmittance at normal incidence
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._front_side_solar_transmittance_at_normal_incidence = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def back_side_solar_transmittance_at_normal_incidence(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get thermal opening back side solar transmittance at normal incidence
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._back_side_solar_transmittance_at_normal_incidence
|
|
|
|
|
|
|
|
@back_side_solar_transmittance_at_normal_incidence.setter
|
|
|
|
def back_side_solar_transmittance_at_normal_incidence(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal opening back side solar transmittance at normal incidence
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._back_side_solar_transmittance_at_normal_incidence = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def overall_u_value(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get thermal opening overall U-value in W/m2K
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._overall_u_value
|
|
|
|
|
|
|
|
@overall_u_value.setter
|
|
|
|
def overall_u_value(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set thermal opening overall U-value in W/m2K
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._overall_u_value = float(value)
|
2021-03-02 18:57:09 -05:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def hi(self) -> Union[None, float]:
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
|
|
|
Get internal convective heat transfer coefficient (W/m2K)
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
|
|
|
return self._hi
|
|
|
|
|
|
|
|
@hi.setter
|
|
|
|
def hi(self, value):
|
|
|
|
"""
|
|
|
|
Set internal convective heat transfer coefficient (W/m2K)
|
2021-08-30 14:39:24 -04:00
|
|
|
:param value: float
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._hi = float(value)
|
2021-03-02 18:57:09 -05:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def he(self) -> Union[None, float]:
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
|
|
|
Get external convective heat transfer coefficient (W/m2K)
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
|
|
|
return self._he
|
|
|
|
|
|
|
|
@he.setter
|
|
|
|
def he(self, value):
|
|
|
|
"""
|
|
|
|
Set external convective heat transfer coefficient (W/m2K)
|
2021-08-30 14:39:24 -04:00
|
|
|
:param value: float
|
2021-03-02 18:57:09 -05:00
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._he = float(value)
|
2021-03-16 13:43:59 -04:00
|
|
|
|
2021-08-26 09:36:10 -04:00
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def inside_emissivity(self) -> Union[None, float]:
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
|
|
|
Get the short wave emissivity factor of the thermal opening's internal surface (-)
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
2021-08-26 09:36:10 -04:00
|
|
|
return self._inside_emissivity
|
|
|
|
|
|
|
|
@inside_emissivity.setter
|
|
|
|
def inside_emissivity(self, value):
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
|
|
|
Set short wave emissivity factor of the thermal opening's internal surface (-)
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._inside_emissivity = float(value)
|
2021-08-26 09:36:10 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def alpha_coefficient(self) -> Union[None, float]:
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
|
|
|
Get the long wave emissivity factor of the thermal opening's internal surface (-)
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
2021-08-26 09:36:10 -04:00
|
|
|
return self._alpha_coefficient
|
|
|
|
|
|
|
|
@alpha_coefficient.setter
|
|
|
|
def alpha_coefficient(self, value):
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
|
|
|
Set long wave emissivity factor of the thermal opening's internal surface (-)
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._alpha_coefficient = float(value)
|
2021-08-26 09:36:10 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def radiative_coefficient(self) -> Union[None, float]:
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
|
|
|
Get the radiative coefficient of the thermal opening's external surface (-)
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
2021-08-26 09:36:10 -04:00
|
|
|
return self._radiative_coefficient
|
|
|
|
|
|
|
|
@radiative_coefficient.setter
|
|
|
|
def radiative_coefficient(self, value):
|
2021-08-26 11:21:12 -04:00
|
|
|
"""
|
|
|
|
Set radiative coefficient of the thermal opening's external surface (-)
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._radiative_coefficient = float(value)
|
2022-04-04 22:41:34 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def construction_name(self):
|
|
|
|
"""
|
|
|
|
Get thermal opening construction name
|
|
|
|
"""
|
|
|
|
return self._construction_name
|
|
|
|
|
|
|
|
@construction_name.setter
|
|
|
|
def construction_name(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal opening construction name
|
|
|
|
"""
|
|
|
|
self._construction_name = value
|