def create_reference_project(info_list): """Reads BuildingInfo and creates type buildings into `prj` """ prj = Project(True) for building in info_list[:]: print('------------') print(building.building_number) print(building.area) print(building) if building.usage_type == 'office' or building.usage_type == \ 'institute' or building.usage_type == 'institute4' or \ building.usage_type == 'institute8': prj.add_non_residential( method='bmvbs', usage=building.usage_type, name=str(building.building_number), year_of_construction=building.year_of_construction, number_of_floors=building.floors, height_of_floors=building.height_of_floors, net_leased_area=building.area, construction_type=building.weight) elif building.usage_type == 'single_family_dwelling': prj.add_residential( method='iwu', usage=building.usage_type, name=str(building.building_number), year_of_construction=building.year_of_construction, number_of_floors=building.floors, height_of_floors=building.height_of_floors, net_leased_area=building.area, construction_type=building.weight) return prj
def to_modelica(self, scaffold, keep_original_models=False): """ Save the TEASER representation of the buildings to the filesystem. The path will be scaffold.loads_path.files_dir. :param scaffold: Scaffold object, contains all the paths of the project :param keep_original_models: boolean, whether or not to remove the models after exporting from Teaser """ # Teaser changes the current dir, so make sure to reset it back to where we started building_names = [] curdir = os.getcwd() try: prj = Project(load_data=True) for building in self.buildings: building_name = building["building_id"] prj.add_non_residential( method="bmvbs", usage=self.lookup_building_type(building["building_type"]), name=building_name, year_of_construction=building["year_built"], number_of_floors=building["num_stories"], height_of_floors=building["floor_height"], net_leased_area=building["area"], office_layout=1, window_layout=1, with_ahu=False, construction_type="heavy", ) building_names.append(building_name) prj.used_library_calc = "IBPSA" prj.number_of_elements_calc = self.system_parameters.get_param( "buildings.default.load_model_parameters.rc.order", default=2 ) prj.merge_windows_calc = False # calculate the properties of all the buildings and export to the Buildings library prj.calc_all_buildings() prj.export_ibpsa(library="Buildings", path=os.path.join(curdir, scaffold.loads_path.files_dir)) finally: os.chdir(curdir) self.post_process(scaffold, building_names, keep_original_models=keep_original_models)
def example_generate_archetype(): """"This function demonstrates the generation of residential and non-residential archetype buildings using the API function of TEASER""" # First step: Import the TEASER API (called Project) into your Python # module from teaser.project import Project # To use the API instantiate the Project class and rename the Project. The # parameter load_data=True indicates that we load `iwu` typology archetype # data into our Project (e.g. for Material properties and typical wall # constructions. This can take a few seconds, depending on the size of the # used data base). Be careful: Dymola does not like whitespaces in names and # filenames, thus we will delete them anyway in TEASER. prj = Project(load_data=True) prj.name = "ArchetypeExample" # There are two different types of archetype groups: residential and # non-residential buildings. Two API functions offer the opportunity to # generate specific archetypes. # To generate residential archetype buildings the function # Project.add_residential() is used. Seven parameters are compulsory, # additional parameters can be set according to the used method. `method` # and `usage` are used to distinguish between different archetype # methods. The name, year_of_construction, number and height of floors # and net_leased_area need to be set to provide enough information for # archetype generation. For specific information on the parameters please # read the docs. prj.add_residential( method='iwu', usage='single_family_dwelling', name="ResidentialBuilding", year_of_construction=1988, number_of_floors=2, height_of_floors=3.2, net_leased_area=200) # To generate non-residential archetype buildings (in this case an # office and a laboratory (a.k.a. institute)) the function # Project.add_residential() is used. The meaning of compulsory parameters # does not differ from the residential archetype building. prj.add_non_residential( method='bmvbs', usage='office', name="OfficeBuilding", year_of_construction=1988, number_of_floors=4, height_of_floors=3.5, net_leased_area=4500) prj.add_non_residential( method='bmvbs', usage='institute', name="InstituteBuilding", year_of_construction=1952, number_of_floors=5, height_of_floors=4.0, net_leased_area=3400) # Besides `iwu` and `bmvbs` there is a third option for archetype # generation. We integrated the typology of TABULA Germany # (http://webtool.building-typology.eu/#bm) and other countries are about to # follow. To use TABULA archetype simple choose `tabula_de` as the method # and `single_family_house`, `multi_family_house`, `terraced_house` or # `apartment_block` as the usage. In addition you can specify the # construction type of TABULA, chose between `tabula_standard` (default), # `tabula_retrofit` or `tabula_adv_retrofit`. In this case we generate one # single and one multi family house with TABULA typology. # Please not: as we need to load ne construction information which are # rather big for TABULA, switching from one typology to another in the same # Project takes some seconds. If you know from beginning you will only use # TABULA typology you should instantiate you Project class without loading # data. Project(load_data=False). prj.add_residential( method='tabula_de', usage='single_family_house', name="ResidentialBuildingTabula", year_of_construction=1988, number_of_floors=3, height_of_floors=3.2, net_leased_area=280, construction_type='tabula_standard') prj.add_residential( method='tabula_de', usage='multi_family_house', name="ResidentialBuildingTabulaMulti", year_of_construction=1960, number_of_floors=4, height_of_floors=3.2, net_leased_area=600, construction_type='tabula_retrofit') return prj
def example_generate_archetype(): """"This function demonstrates the generation of residential and non-residential archetype buildings using the API function of TEASER""" # First step: Import the TEASER API (called Project) into your Python # module from teaser.project import Project # To use the API instantiate the Project class and rename the Project. The # parameter load_data=True indicates that we load archetype data into our # Project (e.g. for Material properties and typical wall constructions. # This can take a few seconds, depending on the size of the used data base. # Be careful: Dymola does not like whitespaces in names and filenames, # thus we will delete them anyway in TEASER. prj = Project(load_data=True) prj.name = "ArchetypeExample" # There are two different types of archetype groups: residential and # non-residential buildings. Two API functions offer the opportunity to # generate specific archetypes. # To generate residential archetype buildings the function # Project.add_residential() is used. Seven parameters are compulsory, # additional parameters can be set according to the used method. `method` # and `usage` are used to distinguish between different archetype # methods. The name, year_of_construction, number and height of floors # and net_leased_area need to be set to provide enough information for # archetype generation. For specific information on the parameters please # read the docs. prj.add_residential( method='iwu', usage='single_family_dwelling', name="ResidentialBuilding", year_of_construction=1988, number_of_floors=2, height_of_floors=3.2, net_leased_area=200) # To generate non-residential archetype buildings (in this case an # office and a laboratory (a.k.a. institute)) the function # Project.add_residential() is used. The meaning of compulsory parameters # does not differ from the residential archetype building. prj.add_non_residential( method='bmvbs', usage='office', name="OfficeBuilding", year_of_construction=1988, number_of_floors=4, height_of_floors=3.5, net_leased_area=4500) prj.add_non_residential( method='bmvbs', usage='institute', name="InstituteBuilding", year_of_construction=1952, number_of_floors=5, height_of_floors=4.0, net_leased_area=3400) return prj
def test_ahu_profiles(self): """Test setting AHU profiles of different lengths Related to issue 553 at https://github.com/RWTH-EBC/TEASER/issues/553 """ prj_test = Project(load_data=True) prj_test.name = "TestAHUProfiles" prj_test.add_non_residential( method="bmvbs", usage="office", name="OfficeBuilding", year_of_construction=2015, number_of_floors=4, height_of_floors=3.5, net_leased_area=1000.0, ) prj_test.used_library_calc = "AixLib" prj_test.number_of_elements_calc = 2 heating_profile_workday = [ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, ] heating_profile_week = [] for day in range(7): for val in heating_profile_workday: if day < 5: set_point = val else: set_point = 290.0 heating_profile_week.append(set_point) for zone in prj_test.buildings[-1].thermal_zones: zone.use_conditions.heating_profile = heating_profile_week zone.use_conditions.cooling_profile = heating_profile_week zone.use_conditions.persons_profile = heating_profile_week zone.use_conditions.machines_profile = heating_profile_week zone.use_conditions.lighting_profile = heating_profile_week assert (prj_test.buildings[-1].thermal_zones[-1].use_conditions. heating_profile == heating_profile_week) assert (prj_test.buildings[-1].thermal_zones[-1].use_conditions. cooling_profile == heating_profile_week) assert (prj_test.buildings[-1].thermal_zones[-1].use_conditions. persons_profile == heating_profile_week) assert (prj_test.buildings[-1].thermal_zones[-1].use_conditions. machines_profile == heating_profile_week) assert (prj_test.buildings[-1].thermal_zones[-1].use_conditions. lighting_profile == heating_profile_week)