def get_input_parameters(self) -> Dict[str, Union[str, float, Qty]]: """Return a dictionary with the input parameters of the building element.""" return { 'A': Qty(self.A, 'm ** 2'), 'U': Qty(self.U, 'W / (m ** 2 * K)'), 'f1': self.f1 }
def get_input_parameters(self) -> Dict[str, Union[float, Qty]]: """Return a dictionary with the current state of the input parameters.""" return { 'q_env_50': Qty(self.q_env_50, 'm ** 3 / (m ** 2 * hr)'), 'V_ATD_d': Qty(self.V_ATD_d, 'm ** 3 / hr'), 'dP_ATD_d': Qty(self.dP_ATD_d, 'Pa'), 'v_leak': self.v_leak, 'f_fac': self.f_fac, 'f_V': self.f_V, 'f_dir': self.f_dir, 'f_iz': self.f_iz }
def get_input_parameters(self) -> Dict[str, Union[str, float, Qty]]: """Return a dictionary with the input parameters of the building element.""" input_params = super().get_input_parameters() input_params.update({ 'f_dT_an': self.f_dT_an, 'f_gw': self.f_gw, 'A_g': Qty(self.A_g, 'm ** 2'), 'P': Qty(self.P, 'm'), 'dU_tb': Qty(self.dU_tb, 'W / (m ** 2 * K)'), 'z': Qty(self.z, 'm') }) return input_params
def __init__(self, limits: Tuple[Union[str, int, float], Union[str, int, float]], default_unit: str = ''): super().__init__(default_unit) lower_value = limits[0] upper_value = limits[1] if default_unit: self.lower_value = Qty(lower_value, default_unit) self.upper_value = Qty(upper_value, default_unit) else: self.lower_value = float(lower_value) self.upper_value = float(upper_value)
def HT_iaBE(self) -> Qty: """Heat transfer coefficient from the heated space to adjacent building entities.""" HT_iaBE = sum([ be.H('W / K') for be in self.building_elements['adjacent_building_entity'] ]) return Qty(HT_iaBE, 'W / K')
def HT_ia(self) -> Qty: """Heat transfer coefficient from the heated space to adjacent heated spaces.""" HT_ia = sum([ be.H('W / K') for be in self.building_elements['adjacent_heated_space'] ]) return Qty(HT_ia, 'W / K')
def HT_iae(self) -> Qty: """Heat transfer coefficient from the heated space to the exterior through an adjacent unheated space or a neighbouring building.""" HT_iae = sum([ be.H('W / K') for be in self.building_elements['adjacent_unheated_space'] ]) return Qty(HT_iae, 'W / K')
def Q_ven(self) -> Qty: """Ventilation loss of the heated space.""" VT_inf = max(self.V_env + self.V_open, self.V_min - self.V_tech) * (self.T_ia - self.T_e_d) VT_sup = self.V_sup * (self.T_ia - self.T_sup) VT_trf = self.V_trf * (self.T_ia - self.T_trf) Q_ven = 0.34 * (VT_inf + VT_sup + VT_trf) return Qty(Q_ven, 'W')
def get_input_parameters(self) -> Dict[str, Union[str, float, Qty]]: """Return a dictionary with the input parameters of the building element.""" input_params = super().get_input_parameters() input_params.update({ 'dU_tb': Qty(self.dU_tb, 'W / (m ** 2 * K)'), 'f_U': self.f_U }) return input_params
def A_env(self) -> Qty: """ Envelope of a heated space; surface area of all building elements of a heated space in contact with external air or unheated spaces. """ A_ext = sum([be.A for be in self.building_elements['exterior']]) A_uhs = sum( [be.A for be in self.building_elements['adjacent_unheated_space']]) A_env_ = A_ext + A_uhs return Qty(A_env_, 'm ** 2')
def Q_ven(self) -> Qty: """Ventilation heat loss of the zone.""" VT = 0.0 for hs in self.heated_spaces.values(): VT_inf = max(hs.V_leak_ATD + hs.V_open, self.f_iz * hs.V_min - hs.V_tech) * (hs.T_ia - hs.T_e_d) VT_sup = hs.V_sup * (hs.T_ia - hs.T_sup) VT_tra = hs.V_trf * (hs.T_ia - hs.T_trf) VT += VT_inf + VT_sup + VT_tra Q_ven = 0.34 * VT return Qty(Q_ven, 'W')
def Q_trm(self) -> Qty: Q_ie = 0.0 Q_iae = 0.0 Q_ig = 0.0 for be in self.building_entities.values(): for hs in be.heated_spaces: Q_ie += hs.HT_ie('W / K') * (hs.T_i_d - hs.T_e_d) Q_iae += hs.HT_iae('W / K') * (hs.T_i_d - hs.T_e_d) Q_ig += hs.HT_ig('W / K') * (hs.T_i_d - hs.T_e_d) Q_trm = Q_ie + Q_iae + Q_ig return Qty(Q_trm, 'W')
def Q_trm(self) -> Qty: """Design transmission heat loss of the heated space.""" HT = sum([ self.HT_ie('W / K'), self.HT_ia('W / K'), self.HT_iaBE('W / K'), self.HT_iae('W / K'), self.HT_ig('W / K') ]) Q_trm = HT * (self.T_i_d - self.T_e_d) return Qty(Q_trm, 'W')
def __init__(self, allowed_values: List[Union[str, int, float]], default_unit: str = ''): super().__init__(default_unit) if default_unit: self.allowed_values: Union[List[Qty], List[float]] = [ Qty(value, default_unit) for value in allowed_values ] else: self.allowed_values: Union[List[Qty], List[float]] = [ float(value) for value in allowed_values ]
def Q_trm(self) -> Qty: Q_ie = 0.0 Q_iae = 0.0 Q_iaBE = 0.0 Q_ig = 0.0 for hs in self.heated_spaces: Q_ie += hs.HT_ie('W / K') * (hs.T_i_d - hs.T_e_d) Q_iae += hs.HT_iae('W / K') * (hs.T_i_d - hs.T_e_d) Q_iaBE += hs.HT_iaBE('W / K') * (hs.T_i_d - hs.T_e_d) Q_ig += hs.HT_ig('W / K') * (hs.T_i_d - hs.T_e_d) Q_trm = Q_ie + Q_iae + Q_iaBE + Q_ig return Qty(Q_trm, 'W')
def _make_float(self, value: Union[str, int, float], unit: str = '') -> Tuple[List[float], float]: if unit: qty = Qty(value, unit) value = qty() else: value = float(value) if isinstance(self.allowed_values[0], Qty): allowed_values = [qty() for qty in self.allowed_values] else: allowed_values = self.allowed_values return allowed_values, value
def _make_float(self, value: Union[str, int, float], unit: str = '') -> Tuple[float, float, float]: if unit: qty = Qty(value, unit) value = qty() else: value = float(value) if isinstance(self.lower_value, Qty) and isinstance( self.upper_value, Qty): lower_value = self.lower_value() upper_value = self.upper_value() else: lower_value = self.lower_value upper_value = self.upper_value return lower_value, value, upper_value
def process_read(self, value: Union[str, int, float], unit: str = '') -> Union[Qty, float, Any]: """ Transform a value (float, int or str) without unit into a float and with unit into a Quantity. Used for reading an InputField. """ if unit: return Qty(value, unit) else: try: return float(value) except ValueError as err: if value in self._exceptions: return value else: raise err
def temperature_drop(**params) -> Qty: """ Estimate temperature drop during thermostat setback. **params** - `T_i_d` Internal design temperature. - `T_e_sb` External temperature during setback period; if unknown, the external design temperature may be assumed. - `t_sb` Setback period. - `tau` Building time constant. """ unpacker = UnPacker(params) T_i_d = unpacker.unpack('T_i_d', 'degC') T_e_sb = unpacker.unpack('T_e_sb', 'degC') t_sb = unpacker.unpack('t_sb', 'hr') tau = unpacker.unpack('tau', 'hr') dT_sb = (T_i_d - T_e_sb) * (1 - math.exp(-t_sb / tau)) return Qty(dT_sb, 'K')
def get_input_parameters(self) -> Dict[str, Qty]: return { 'T_e_d': Qty(self.T_e_d, 'degC'), 'T_e_an': Qty(self.T_e_an, 'degC'), 'T_e_min': Qty(self.T_e_min, 'degC') }
def Q_load(self) -> Qty: Q_load = sum([self.Q_trm('W'), self.Q_ven('W'), self.Q_hu('W')]) Q_load -= self.Q_gain('W') return Qty(Q_load, 'W')
def Q_gain(self) -> Qty: Q_gain = sum( [be.Q_gain('W') for be in self.building_entities.values()]) return Qty(Q_gain, 'W')
def Q_hu(self) -> Qty: Q_hu = sum([be.Q_hu('W') for be in self.building_entities.values()]) return Qty(Q_hu, 'W')
def Q_gain(self) -> Qty: Q_gain = sum([hs.Q_gain('W') for hs in self.heated_spaces]) return Qty(Q_gain, 'W')
def Q_hu(self) -> Qty: Q_hu = sum([hs.Q_hu('W') for hs in self.heated_spaces]) return Qty(Q_hu, 'W')
def Q_ven(self) -> Qty: Q_ven = sum([vz.Q_ven('W') for vz in self.ventilation_zones.values()]) return Qty(Q_ven, 'W')
def Q_gain(self) -> Qty: """Optional heat gains for the heated space that occur under design external conditions.""" return Qty(0.0, 'W')
def Q_hu(self) -> Qty: """Optional additional heating-up power for the heated space in case of intermittent heating.""" Q_hu = self.A_fl * self.q_hu return Qty(Q_hu, 'W')
def HT_ie(self) -> Qty: """Heat transfer coefficient from the heated space directly to exterior.""" HT_ie = sum( [be.H('W / K') for be in self.building_elements['exterior']]) return Qty(HT_ie, 'W / K')
def HT_ig(self) -> Qty: """Heat transfer coefficient from the heated space to the ground.""" HT_ig = sum([be.H('W / K') for be in self.building_elements['ground']]) return Qty(HT_ig, 'W / K')