2020-06-05 12:24:03 -04:00
|
|
|
from helpers.configuration import Configuration
|
2020-05-18 13:25:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ThermalOpening:
|
|
|
|
def __init__(self):
|
|
|
|
self._openable_ratio = None
|
|
|
|
self._conductivity_w_mk = None
|
2020-06-05 12:24:03 -04:00
|
|
|
self._frame_ratio = Configuration().frame_ratio
|
2020-05-18 13:25:08 -04:00
|
|
|
self._g_value = None
|
|
|
|
self._thickness_m = None
|
2020-06-09 15:17:19 -04:00
|
|
|
self._front_side_solar_transmittance_at_normal_incidence = None
|
|
|
|
self._back_side_solar_transmittance_at_normal_incidence = None
|
|
|
|
self._overall_u_value = None
|
2020-05-18 13:25:08 -04:00
|
|
|
|
|
|
|
@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):
|
2020-06-09 15:17:19 -04:00
|
|
|
# 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.
|
2020-05-18 13:25:08 -04:00
|
|
|
self._conductivity_w_mk = value
|
2020-06-09 15:17:19 -04:00
|
|
|
if self._overall_u_value is None and self.thickness_m is not None:
|
|
|
|
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._overall_u_value = 1 / r_value
|
2020-05-18 13:25:08 -04:00
|
|
|
|
|
|
|
@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):
|
2020-06-09 15:17:19 -04:00
|
|
|
# The code to calculate overall_u_value is duplicated here and in conductivity_w_mk.
|
|
|
|
# This ensures a more robust code that returns the overall_u_value regardless the order the parameters are read.
|
2020-05-18 13:25:08 -04:00
|
|
|
self._thickness_m = value
|
2020-06-09 15:17:19 -04:00
|
|
|
if self._overall_u_value is None and self.conductivity_w_mk is not None:
|
|
|
|
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._overall_u_value = 1 / r_value
|
2020-05-18 13:25:08 -04:00
|
|
|
|
|
|
|
@property
|
2020-06-09 15:17:19 -04:00
|
|
|
def front_side_solar_transmittance_at_normal_incidence(self):
|
|
|
|
return self._front_side_solar_transmittance_at_normal_incidence
|
2020-05-18 13:25:08 -04:00
|
|
|
|
2020-06-09 15:17:19 -04:00
|
|
|
@front_side_solar_transmittance_at_normal_incidence.setter
|
|
|
|
def front_side_solar_transmittance_at_normal_incidence(self, value):
|
|
|
|
self._front_side_solar_transmittance_at_normal_incidence = value
|
2020-05-18 13:25:08 -04:00
|
|
|
|
|
|
|
@property
|
2020-06-09 15:17:19 -04:00
|
|
|
def back_side_solar_transmittance_at_normal_incidence(self):
|
|
|
|
return self._back_side_solar_transmittance_at_normal_incidence
|
2020-05-18 13:25:08 -04:00
|
|
|
|
2020-06-09 15:17:19 -04:00
|
|
|
@back_side_solar_transmittance_at_normal_incidence.setter
|
|
|
|
def back_side_solar_transmittance_at_normal_incidence(self, value):
|
|
|
|
self._back_side_solar_transmittance_at_normal_incidence = value
|
2020-05-18 13:25:08 -04:00
|
|
|
|
|
|
|
@property
|
2020-06-09 15:17:19 -04:00
|
|
|
def overall_u_value(self):
|
|
|
|
return self._overall_u_value
|
|
|
|
|
|
|
|
@overall_u_value.setter
|
|
|
|
def overall_u_value(self, value):
|
|
|
|
self._overall_u_value = value
|