92 lines
3.0 KiB
Python
92 lines
3.0 KiB
Python
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._front_side_solar_transmittance_at_normal_incidence = None
|
|
self._back_side_solar_transmittance_at_normal_incidence = None
|
|
self._overall_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):
|
|
# 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.
|
|
self._conductivity_w_mk = value
|
|
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
|
|
|
|
@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):
|
|
# 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.
|
|
self._thickness_m = value
|
|
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
|
|
|
|
@property
|
|
def front_side_solar_transmittance_at_normal_incidence(self):
|
|
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):
|
|
self._front_side_solar_transmittance_at_normal_incidence = value
|
|
|
|
@property
|
|
def back_side_solar_transmittance_at_normal_incidence(self):
|
|
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):
|
|
self._back_side_solar_transmittance_at_normal_incidence = value
|
|
|
|
@property
|
|
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
|