system_assignation/city_model_structure/thermal_opening.py

87 lines
2.0 KiB
Python

"""
ThermalOpening module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from helpers.configuration import Configuration
class ThermalOpening:
def __init__(self):
self._openable_ratio = None
self._conductivity_w_mk = None
self._frame_ratio = Configuration().frame_ratio
self._g_value = None
self._thickness_m = None
self._inside_reflectance = None
self._outside_reflectance = None
self._u_value = None
@property
def openable_ratio(self):
raise Exception('Not implemented')
@openable_ratio.setter
def openable_ratio(self, value):
raise Exception('Not implemented')
@property
def conductivity_w_mk(self):
return self._conductivity_w_mk
@conductivity_w_mk.setter
def conductivity_w_mk(self, value):
self._conductivity_w_mk = value
@property
def frame_ratio(self):
return self._frame_ratio
@frame_ratio.setter
def frame_ratio(self, value):
self._frame_ratio = value
@property
def g_value(self):
return self._g_value
@g_value.setter
def g_value(self, value):
self._g_value = value
@property
def thickness_m(self):
return self._thickness_m
@thickness_m.setter
def thickness_m(self, value):
self._thickness_m = value
@property
def inside_reflectance(self):
return self._inside_reflectance
@inside_reflectance.setter
def inside_reflectance(self, value):
self._inside_reflectance = value
@property
def outside_reflectance(self):
return self._outside_reflectance
@outside_reflectance.setter
def outside_reflectance(self, value):
self._outside_reflectance = value
@property
def u_value(self):
if self._u_value is None:
try:
h_i = Configuration().h_i
h_e = Configuration().h_e
r_value = 1 / h_i + 1 / h_e + float(self.conductivity_w_mk) / float(self.thickness_m)
self._u_value = 1 / r_value
except TypeError:
Exception('Thermal opening is not initialized')
return self._u_value