def calc_building_parameter( self, number_of_elements=2, merge_windows=False, used_library="AixLib" ): """calc all building parameters This functions calculates the parameters of all zones in a building sums norm heat load of all zones sums volume of all zones Parameters ---------- number_of_elements : int defines the number of elements, that area aggregated, between 1 and 4, default is 2 merge_windows : bool True for merging the windows into the outer walls, False for separate resistance for window, default is False used_library : str used library (AixLib and IBPSA are supported) """ self._number_of_elements_calc = number_of_elements self._merge_windows_calc = merge_windows self._used_library_calc = used_library for zone in self.thermal_zones: zone.calc_zone_parameters( number_of_elements=number_of_elements, merge_windows=merge_windows, t_bt=5, ) self.sum_heat_load += zone.model_attr.heat_load if self.used_library_calc == self.library_attr.__class__.__name__: if self.used_library_calc == "AixLib": self.library_attr.calc_auxiliary_attr() else: pass elif self.library_attr is None: if self.used_library_calc == "AixLib": self.library_attr = AixLib(parent=self) self.library_attr.calc_auxiliary_attr() elif self.used_library_calc == "IBPSA": self.library_attr = IBPSA(parent=self) else: warnings.warn( "You set conflicting options for the used library " "in Building or Project class and " "calculation function of building. Your library " "attributes are set to default using the library " "you indicated in the function call, which is: " + self.used_library_calc ) if self.used_library_calc == "AixLib": self.library_attr = AixLib(parent=self) self.library_attr.calc_auxiliary_attr() elif self.used_library_calc == "IBPSA": self.library_attr = IBPSA(parent=self)
def used_library_calc(self, value): ass_error_1 = "used library needs to be AixLib or IBPSA" assert value != ["AixLib", "IBPSA"], ass_error_1 if self.parent is None and value is None: self._used_library_calc = "AixLib" elif self.parent is not None and value is None: self._used_library_calc = self.parent.used_library_calc elif value is not None: self._used_library_calc = value if self.used_library_calc == "AixLib": self.library_attr = AixLib(parent=self) elif self.used_library_calc == "IBPSA": self.library_attr = IBPSA(parent=self)