コード例 #1
0
ファイル: controller.py プロジェクト: mananthavelu/TEASER
    def click_add_zone_button(self, parent, name, area, zone_type):
        '''
        creates a thermal zone with specified area and type and blanco use
        conditions

        Parameters:
        ----------
        parent : building()
            parent class of zone

        name : str
            individual name

        area : float
            area of the zone

        usage : string
            usage type of zone

        Returns
        ----------

        parent : Building()
            parent class of zone
        '''

        zone = ThermalZone(parent)
        zone.use_conditions = BoundaryConditions(zone)
        zone.use_conditions.load_use_conditions(zone_type)
        zone.name = name
        zone.area = area
        zone.set_volume_zone()
        return parent
コード例 #2
0
ファイル: helptest.py プロジェクト: zhengzhuang3/TEASER
def building_test2(prj):
    """
    building which is hardcoded for testing
    """
    bldg = Building(parent=prj)

    '''Set some building parameters'''

    bldg.name = "UnitTestBuilding"
    bldg.street_name = "Unit Street 42"
    bldg.city = "46325 Testing Town"
    bldg.year_of_construction = 1988
    bldg.number_of_floors = 1
    bldg.height_of_floors = 3.5

    '''Instantiate a ThermalZone class, with building as parent and set  some
    parameters of the thermal zone'''

    tz = ThermalZone(parent=bldg)
    tz.name = "Living Room"
    tz.area = 140.0
    tz.volume = tz.area * bldg.number_of_floors * bldg.height_of_floors
    tz.infiltration_rate = 0.5

    tz.use_conditions = BoundaryConditions(tz)
    tz.use_conditions.usage = "Living"
    tz.use_conditions.cooling_time = [5, 18]
    tz.use_conditions.heating_time = [5, 18]
    tz.use_conditions.set_temp_heat = 288.15
    tz.use_conditions.set_temp_cool = 298.15
    tz.use_conditions.temp_set_back = 4.0
    tz.use_conditions.min_air_exchange = 0.0
    tz.use_conditions.min_ahu = 0.0
    tz.use_conditions.max_ahu = 2.6
    tz.use_conditions.with_ahu = True
    tz.use_conditions.persons = 3
    tz.use_conditions.machines = 3
    tz.use_conditions.lighting_power = 3
    tz.use_conditions.activity_type_machines = 2
    tz.use_conditions.ratio_conv_rad_machines = 0.5
    tz.use_conditions.profile_machines = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                                          0.2, 0.4, 0.6, 0.8, 0.8, 0.4, 0.6,
                                          0.8, 0.8, 0.4, 0.2, 0.0, 0.0, 0.0,
                                          0.0, 0.0, 0.0]
    tz.use_conditions.profile_persons = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
                                         0.2, 0.4, 0.6, 0.8, 0.8, 0.4, 0.6,
                                         0.8, 0.8, 0.4, 0.2, 0.1, 0.1, 0.1,
                                         0.1, 0.1, 0.1]
    tz.use_conditions.profile_lighting = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
                                          0.2, 0.4, 0.6, 0.8, 0.8, 0.4, 0.6,
                                          0.8, 0.8, 0.4, 0.2, 0.1, 0.1, 0.1,
                                          0.1, 0.1, 0.1]
    tz.use_conditions.use_constant_ach_rate = False
    tz.use_conditions.base_ach = 0.2
    tz.use_conditions.max_user_ach = 1.0
    tz.use_conditions.max_overheating_ach = [3.0, 2.0]
    tz.use_conditions.max_summer_ach = [1.0, 273.15 + 10, 273.15 + 17]
    tz.use_conditions.winter_reduction = [0.2, 273.15, 273.15 + 10]

    out_wall_dict = [["Outer Wall 1", [bldg.year_of_construction, 'heavy',
                                      10.0, 90.0, 0.0]],
                     ["Outer Wall 2", [bldg.year_of_construction, 'heavy',
                                      14.0, 90.0, 90.0]],
                     ["Outer Wall 3", [bldg.year_of_construction, 'heavy',
                                      10.0, 90.0, 180.0]],
                     ["Outer Wall 4", [bldg.year_of_construction, 'heavy',
                                      14.0, 90.0, 270.0]]]
    #import collections
    #out_wall_dict = collections.OrderedDict(sorted(out_wall_dict.items(), key=lambda t: t[0]))
    for value in out_wall_dict:
        '''instantiate OuterWall class'''
        out_wall = OuterWall(parent=tz)
        out_wall.name = value[0]
        out_wall.year_of_construction = value[1][0]
        out_wall.construction_type = value[1][1]
        out_wall.area = value[1][2]
        out_wall.tilt = value[1][3]
        out_wall.orientation = value[1][4]
        out_wall.building_age_group = [1994, 1998]
        out_wall.inner_radiation = 5.0
        out_wall.inner_convection = 2.7
        out_wall.outer_radiation = 5.0
        out_wall.outer_convection = 20.0

        out_wall_layer1 = Layer(out_wall)
        out_wall_layer1.id = 1
        out_wall_layer1.thickness = 5.0
        out_wall_material = Material(out_wall_layer1)
        out_wall_material.name = "material1"
        out_wall_material.density = 5.0
        out_wall_material.thermal_conduc = 4.0
        out_wall_material.heat_capac = 0.48
        out_wall_material.transmittance = 0.0

        out_wall_layer2 = Layer(out_wall)
        out_wall_layer2.id = 2
        out_wall_layer2.thickness = 2.0
        out_wall_material = Material(out_wall_layer2)
        out_wall_material.name = "material"
        out_wall_material.density = 2.0
        out_wall_material.thermal_conduc = 2.0
        out_wall_material.heat_capac = 0.84
        out_wall_material.transmittance = 0.0

    in_wall_dict = [["Inner Wall 1", [bldg.year_of_construction, 'light', 10.0]],
                    ["Inner Wall 2", [bldg.year_of_construction, 'heavy', 14.0]],
                    ["Inner Wall 3", [bldg.year_of_construction, 'light', 10.0]]]

    for value in in_wall_dict:
        '''instantiate OuterWall class'''
        in_wall = InnerWall(parent=tz)
        in_wall.name = value[0]
        in_wall.year_of_construction = value[1][0]
        in_wall.construction_type = value[1][1]
        in_wall.area = value[1][2]
        in_wall.building_age_group = [1994, 1998]
        in_wall.inner_radiation = 5.0
        in_wall.inner_convection = 2.7

        in_wall_layer1 = Layer(in_wall)
        in_wall_layer1.id = 1
        in_wall_layer1.thickness = 5.0
        in_wall_material = Material(in_wall_layer1)
        in_wall_material.name = "material1"
        in_wall_material.density = 5.0
        in_wall_material.thermal_conduc = 4.0
        in_wall_material.heat_capac = 0.48

        in_wall_layer2 = Layer(in_wall)
        in_wall_layer2.id = 2
        in_wall_layer2.thickness = 2.0
        in_wall_material = Material(in_wall_layer2)
        in_wall_material.name = "material"
        in_wall_material.density = 2.0
        in_wall_material.thermal_conduc = 2.0
        in_wall_material.heat_capac = 0.84

    win_dict = [["Window 1", [bldg.year_of_construction,
                             5.0, 90.0, 90.0]],
                ["Window 2", [bldg.year_of_construction,
                             8.0, 90.0, 180.0]],
                ["Window 3", [bldg.year_of_construction,
                             5.0, 90.0, 270.0]]]

    for value in win_dict:
        win = Window(parent=tz)
        win.construction_type = "Window"
        win.name = value[0]
        win.area = value[1][1]
        win.tilt = value[1][2]
        win.orientation = value[1][3]
        win.building_age_group = [1994, 1998]

        win.inner_convection = 1.7
        win.inner_radiation = 5.0
        win.outer_convection = 20.0
        win.outer_radiation = 5.0
        win.g_value = 0.789
        win.a_conv = 0.03
        win.shading_g_total = 1.0
        win.shading_max_irr = 180.0
        win_layer = Layer(parent=win)
        win_layer.id = 1
        win_layer.thickness = 0.024

        win_material = Material(win_layer)
        win_material.name = "GlasWindow"
        win_material.thermal_conduc = 0.067
        win_material.transmittance = 0.9

    roof = Rooftop(parent=tz)
    roof.name = "Roof"
    roof.year_of_construction = bldg.year_of_construction
    roof.construction_type = "heavy"
    roof.area = 140.0

    roof_layer1 = Layer(roof)
    roof_layer1.id = 1
    roof_layer1.thickness = 5.0
    roof_material = Material(roof_layer1)
    roof_material.name = "material1"
    roof_material.density = 5.0
    roof_material.thermal_conduc = 4.0
    roof_material.heat_capac = 0.48

    roof_layer2 = Layer(roof)
    roof_layer2.id = 2
    roof_layer2.thickness = 2.0
    roof_material = Material(roof_layer2)
    roof_material.name = "material"
    roof_material.density = 2.0
    roof_material.thermal_conduc = 2.0
    roof_material.heat_capac = 0.84

    ground = GroundFloor(parent=tz)
    ground.name = "ground"
    ground.year_of_construction = bldg.year_of_construction
    ground.construction_type = "heavy"
    ground.area = 140.0

    ground_layer1 = Layer(ground)
    ground_layer1.id = 1
    ground_layer1.thickness = 5.0
    ground_material = Material(ground_layer1)
    ground_material.name = "material1"
    ground_material.density = 5.0
    ground_material.thermal_conduc = 4.0
    ground_material.heat_capac = 0.48

    ground_layer2 = Layer(ground)
    ground_layer2.id = 2
    ground_layer2.thickness = 2.0
    ground_material = Material(ground_layer2)
    ground_material.name = "material"
    ground_material.density = 2.0
    ground_material.thermal_conduc = 2.0
    ground_material.heat_capac = 0.84

    return bldg
コード例 #3
0
    def generate_archetype(self):
        """Generates a SingleFamilyHouse archetype buildings

        With given values, this function generates an archetype building for
        Tabula Single Family House.
        """
        self.thermal_zones = None
        self._check_year_of_construction()
        # help area for the correct building area setting while using typeBldgs
        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0

        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(parent=self)
            zone.name = key
            zone.area = type_bldg_area * value[0]
            use_cond = UseCond(parent=zone)
            use_cond.load_use_conditions(zone_usage=value[1])
            zone.use_conditions = use_cond

            zone.use_conditions.with_ahu = False
            zone.use_conditions.persons *= zone.area * 0.01
            zone.use_conditions.machines *= zone.area * 0.01

        if self.facade_estimation_factors[self.building_age_group]['ow1'] != 0:
            for key, value in self._outer_wall_names_1.items():
                for zone in self.thermal_zones:
                    outer_wall = OuterWall(zone)
                    outer_wall.load_type_element(
                        year=self.year_of_construction,
                        construction=self._construction_type_1,
                        data_class=self.parent.data)
                    outer_wall.name = key
                    outer_wall.tilt = value[0]
                    outer_wall.orientation = value[1]
                    outer_wall.area = ((self.facade_estimation_factors[
                        self.building_age_group]['ow1'] * type_bldg_area) /
                                       len(self._outer_wall_names_1))

        if self.facade_estimation_factors[self.building_age_group]['ow2'] != 0:
            for key, value in self._outer_wall_names_2.items():
                for zone in self.thermal_zones:
                    outer_wall = OuterWall(zone)
                    outer_wall.load_type_element(
                        year=self.year_of_construction,
                        construction=self._construction_type_2,
                        data_class=self.parent.data)
                    outer_wall.name = key
                    outer_wall.tilt = value[0]
                    outer_wall.orientation = value[1]
                    outer_wall.area = ((self.facade_estimation_factors[
                        self.building_age_group]['ow2'] * type_bldg_area) /
                                       len(self._outer_wall_names_2))

        if self.facade_estimation_factors[
                self.building_age_group]['win1'] != 0:
            for key, value in self.window_names_1.items():
                for zone in self.thermal_zones:
                    window = Window(zone)
                    window.load_type_element(
                        self.year_of_construction,
                        construction=self._construction_type_1,
                        data_class=self.parent.data)
                    window.name = key
                    window.tilt = value[0]
                    window.orientation = value[1]
                    window.area = ((self.facade_estimation_factors[
                        self.building_age_group]['win1'] * type_bldg_area) /
                                   len(self.window_names_1))

        if self.facade_estimation_factors[
                self.building_age_group]['win2'] != 0:
            for key, value in self.window_names_2.items():
                for zone in self.thermal_zones:
                    window = Window(zone)
                    window.load_type_element(
                        self.year_of_construction,
                        construction=self._construction_type_2,
                        data_class=self.parent.data)
                    window.name = key
                    window.tilt = value[0]
                    window.orientation = value[1]
                    window.area = ((self.facade_estimation_factors[
                        self.building_age_group]['win2'] * type_bldg_area) /
                                   len(self.window_names_2))

        if self.facade_estimation_factors[self.building_age_group]['gf1'] != 0:
            for key, value in self.ground_floor_names_1.items():

                for zone in self.thermal_zones:
                    gf = GroundFloor(zone)
                    gf.load_type_element(
                        year=self.year_of_construction,
                        construction=self._construction_type_1,
                        data_class=self.parent.data)
                    gf.name = key
                    gf.tilt = value[0]
                    gf.orientation = value[1]
                    gf.area = ((self.facade_estimation_factors[
                        self.building_age_group]['gf1'] * type_bldg_area) /
                               len(self.ground_floor_names_1))

        if self.facade_estimation_factors[self.building_age_group]['gf2'] != 0:
            for key, value in self.ground_floor_names_2.items():

                for zone in self.thermal_zones:
                    gf = GroundFloor(zone)
                    gf.load_type_element(
                        year=self.year_of_construction,
                        construction=self._construction_type_2,
                        data_class=self.parent.data)
                    gf.name = key
                    gf.tilt = value[0]
                    gf.orientation = value[1]
                    gf.area = ((self.facade_estimation_factors[
                        self.building_age_group]['gf2'] * type_bldg_area) /
                               len(self.ground_floor_names_2))

        if self.facade_estimation_factors[self.building_age_group]['rt1'] != 0:
            for key, value in self.roof_names_1.items():

                for zone in self.thermal_zones:
                    rt = Rooftop(zone)
                    rt.load_type_element(
                        year=self.year_of_construction,
                        construction=self._construction_type_1,
                        data_class=self.parent.data)
                    rt.name = key
                    rt.tilt = value[0]
                    rt.orientation = value[1]
                    rt.area = ((self.facade_estimation_factors[
                        self.building_age_group]['rt1'] * type_bldg_area) /
                               len(self.roof_names_1))

        if self.facade_estimation_factors[self.building_age_group]['rt2'] != 0:
            for key, value in self.roof_names_2.items():

                for zone in self.thermal_zones:
                    rt = Rooftop(zone)
                    rt.load_type_element(
                        year=self.year_of_construction,
                        construction=self._construction_type_2,
                        data_class=self.parent.data)
                    rt.name = key
                    rt.tilt = value[0]
                    rt.orientation = value[1]
                    rt.area = ((self.facade_estimation_factors[
                        self.building_age_group]['rt2'] * type_bldg_area) /
                               len(self.roof_names_2))

        if self.facade_estimation_factors[
                self.building_age_group]['door'] != 0:
            for key, value in self.door_names.items():

                for zone in self.thermal_zones:
                    door = Door(zone)
                    door.load_type_element(
                        year=self.year_of_construction,
                        construction=self._construction_type_1,
                        data_class=self.parent.data)
                    door.name = key
                    door.tilt = value[0]
                    door.orientation = value[1]
                    door.area = ((self.facade_estimation_factors[
                        self.building_age_group]['door'] * type_bldg_area) /
                                 len(self.door_names))

        for key, value in self.inner_wall_names.items():

            for zone in self.thermal_zones:
                inner_wall = InnerWall(zone)
                inner_wall.load_type_element(year=self.year_of_construction,
                                             construction="tabula_standard",
                                             data_class=self.parent.data)
                inner_wall.name = key
                inner_wall.tilt = value[0]
                inner_wall.orientation = value[1]

        if self.number_of_floors > 1:

            for key, value in self.ceiling_names.items():

                for zone in self.thermal_zones:
                    ceiling = Ceiling(zone)
                    ceiling.load_type_element(year=self.year_of_construction,
                                              construction="tabula_standard",
                                              data_class=self.parent.data)
                    ceiling.name = key
                    ceiling.tilt = value[0]
                    ceiling.orientation = value[1]

            for key, value in self.floor_names.items():

                for zone in self.thermal_zones:
                    floor = Floor(zone)
                    floor.load_type_element(year=self.year_of_construction,
                                            construction="tabula_standard",
                                            data_class=self.parent.data)
                    floor.name = key
                    floor.tilt = value[0]
                    floor.orientation = value[1]

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #4
0
def _load_building(prj, pyxb_bld, type, project_bind):
    if type == "Building":
        bldg = Building(prj)

    elif type == "Office":
        bldg = Office(prj)

    elif type == "Institute":

        bldg = Institute(prj)

    elif type == "Institute4":
        bldg = Institute4(prj)

    elif type == "Institute8":
        bldg = Institute8(prj)

    elif type == "Residential":
        bldg = SingleFamilyDwelling(prj)

    bldg.name = pyxb_bld.name
    bldg.street_name = pyxb_bld.street_name
    bldg.city = pyxb_bld.city
    bldg.type_of_building = pyxb_bld.type_of_building
    bldg.year_of_construction = pyxb_bld.year_of_construction
    bldg.year_of_retrofit = pyxb_bld.year_of_retrofit
    bldg.number_of_floors = pyxb_bld.number_of_floors
    bldg.height_of_floors = pyxb_bld.height_of_floors

    if not pyxb_bld.ThermalZone:
        bldg.net_leased_area = pyxb_bld.net_leased_area

    if pyxb_bld.CentralAHU:
        pyxb_ahu = pyxb_bld.CentralAHU
        bldg.central_ahu = BuildingAHU(bldg)

        bldg.central_ahu.heating = pyxb_ahu.heating
        bldg.central_ahu.cooling = pyxb_ahu.cooling
        bldg.central_ahu.dehumidification = pyxb_ahu.dehumidification
        bldg.central_ahu.humidification = pyxb_ahu.humidification
        bldg.central_ahu.heat_recovery = pyxb_ahu.heat_recovery
        bldg.central_ahu.by_pass_dehumidification = \
            pyxb_ahu.by_pass_dehumidification
        bldg.central_ahu.efficiency_recovery = pyxb_ahu.efficiency_recovery

        try:
            if float(project_bind.version) >= 0.5:
                bldg.central_ahu.efficiency_recovery_false = \
                    pyxb_ahu.efficiency_recovery_false
            else:
                bldg.central_ahu.efficiency_recovery_false = \
                    pyxb_ahu.efficiency_revocery_false
        except AttributeError:
            bldg.central_ahu.efficiency_recovery_false = \
                pyxb_ahu.efficiency_revocery_false

        bldg.central_ahu.profile_min_relative_humidity = \
            pyxb_ahu.profile_min_relative_humidity
        bldg.central_ahu.profile_max_relative_humidity = \
            pyxb_ahu.profile_max_relative_humidity
        bldg.central_ahu.profile_v_flow = \
            pyxb_ahu.profile_v_flow
        bldg.central_ahu.profile_temperature = \
            pyxb_ahu.profile_temperature

    for pyxb_zone in pyxb_bld.ThermalZone:

        zone = ThermalZone(bldg)

        zone.name = pyxb_zone.name
        zone.area = pyxb_zone.area
        zone.volume = pyxb_zone.volume
        zone.infiltration_rate = pyxb_zone.infiltration_rate

        zone.use_conditions = BoundaryConditions(zone)

        pyxb_use = pyxb_zone.UseCondition.BoundaryConditions

        zone.use_conditions.typical_length = pyxb_zone.typical_length
        zone.use_conditions.typical_width = pyxb_zone.typical_width

        zone.use_conditions.usage = \
            pyxb_use.usage

        zone.use_conditions.usage_time = \
            pyxb_use.UsageOperationTime.usage_time
        zone.use_conditions.daily_usage_hours = \
            pyxb_use.UsageOperationTime.daily_usage_hours
        zone.use_conditions.yearly_usage_days = \
            pyxb_use.UsageOperationTime.yearly_usage_days
        zone.use_conditions.yearly_usage_hours_day = \
            pyxb_use.UsageOperationTime.yearly_usage_hours_day
        zone.use_conditions.yearly_usage_hours_night = \
            pyxb_use.UsageOperationTime.yearly_usage_hours_night
        zone.use_conditions.daily_operation_ahu_cooling = \
            pyxb_use.UsageOperationTime.daily_operation_ahu_cooling
        zone.use_conditions.yearly_heating_days = \
            pyxb_use.UsageOperationTime.yearly_heating_days
        zone.use_conditions.yearly_ahu_days = \
            pyxb_use.UsageOperationTime.yearly_ahu_days
        zone.use_conditions.yearly_cooling_days = \
            pyxb_use.UsageOperationTime.yearly_cooling_days
        zone.use_conditions.daily_operation_heating = \
            pyxb_use.UsageOperationTime.daily_operation_heating

        try:
            if float(project_bind.version) >= 0.4:
                zone.use_conditions.maintained_illuminance = \
                    pyxb_use.Lighting.maintained_illuminance
            else:
                zone.use_conditions.maintained_illuminance = \
                    pyxb_use.Lighting.maintained_illuminace
        except AttributeError:
            zone.use_conditions.maintained_illuminance = \
                pyxb_use.Lighting.maintained_illuminace

        zone.use_conditions.usage_level_height = \
            pyxb_use.Lighting.usage_level_height
        zone.use_conditions.red_factor_visual = \
            pyxb_use.Lighting.red_factor_visual
        zone.use_conditions.rel_absence = \
            pyxb_use.Lighting.rel_absence
        zone.use_conditions.room_index = \
            pyxb_use.Lighting.room_index
        zone.use_conditions.part_load_factor_lighting = \
            pyxb_use.Lighting.part_load_factor_lighting
        zone.use_conditions.ratio_conv_rad_lighting = \
            pyxb_use.Lighting.ratio_conv_rad_lighting

        zone.use_conditions.set_temp_heat = \
            pyxb_use.RoomClimate.set_temp_heat
        zone.use_conditions.set_temp_cool = \
            pyxb_use.RoomClimate.set_temp_cool
        zone.use_conditions.temp_set_back = \
            pyxb_use.RoomClimate.temp_set_back
        zone.use_conditions.min_temp_heat = \
            pyxb_use.RoomClimate.min_temp_heat
        zone.use_conditions.max_temp_cool = \
            pyxb_use.RoomClimate.max_temp_cool
        zone.use_conditions.rel_humidity = \
            pyxb_use.RoomClimate.rel_humidity
        zone.use_conditions.cooling_time = \
            pyxb_use.RoomClimate.cooling_time
        zone.use_conditions.heating_time = \
            pyxb_use.RoomClimate.heating_time
        zone.use_conditions.min_air_exchange = \
            pyxb_use.RoomClimate.min_air_exchange
        zone.use_conditions.rel_absence_ahu = \
            pyxb_use.RoomClimate.rel_absence_ahu
        zone.use_conditions.part_load_factor_ahu = \
            pyxb_use.RoomClimate.part_load_factor_ahu

        zone.use_conditions.persons = \
            pyxb_use.InternalGains.persons
        zone.use_conditions.profile_persons = \
            pyxb_use.InternalGains.profile_persons
        zone.use_conditions.machines = \
            pyxb_use.InternalGains.machines
        zone.use_conditions.profile_machines = \
            pyxb_use.InternalGains.profile_machines
        zone.use_conditions.lighting_power = \
            pyxb_use.InternalGains.lighting_power
        zone.use_conditions.profile_lighting = \
            pyxb_use.InternalGains.profile_lighting

        zone.use_conditions.min_ahu = \
            pyxb_use.AHU.min_ahu
        zone.use_conditions.max_ahu = \
            pyxb_use.AHU.max_ahu
        zone.use_conditions.with_ahu = \
            pyxb_use.AHU.with_ahu
        zone.use_constant_ach_rate = \
            pyxb_use.AHU.use_constant_ach_rate
        zone.base_ach = \
            pyxb_use.AHU.base_ach
        zone.max_user_ach = \
            pyxb_use.AHU.max_user_ach
        zone.max_overheating_ach = \
            pyxb_use.AHU.max_overheating_ach
        zone.max_summer_ach = \
            pyxb_use.AHU.max_summer_ach
        zone.winter_reduction = \
            pyxb_use.AHU.winter_reduction

        for pyxb_wall in pyxb_zone.OuterWall:
            out_wall = OuterWall(zone)

            set_basic_data_teaser(pyxb_wall, out_wall)
            set_layer_data_teaser(pyxb_wall, out_wall)

        try:
            if float(project_bind.version) >= 0.6:
                for pyxb_wall in pyxb_zone.Door:
                    out_wall = Door(zone)

                    set_basic_data_teaser(pyxb_wall, out_wall)
                    set_layer_data_teaser(pyxb_wall, out_wall)

        except AttributeError:
            pass

        for pyxb_wall in pyxb_zone.Rooftop:
            roof = Rooftop(zone)

            set_basic_data_teaser(pyxb_wall, roof)
            set_layer_data_teaser(pyxb_wall, roof)

            # zone.outer_walls.append(roof)

        for pyxb_wall in pyxb_zone.GroundFloor:
            gr_floor = GroundFloor(zone)

            set_basic_data_teaser(pyxb_wall, gr_floor)
            set_layer_data_teaser(pyxb_wall, gr_floor)

            # zone.outer_walls.append(gr_floor)

        for pyxb_wall in pyxb_zone.InnerWall:
            in_wall = InnerWall(zone)

            set_basic_data_teaser(pyxb_wall, in_wall)
            set_layer_data_teaser(pyxb_wall, in_wall)

            # zone.inner_walls.append(in_wall)

        for pyxb_wall in pyxb_zone.Ceiling:
            ceiling = Ceiling(zone)

            set_basic_data_teaser(pyxb_wall, ceiling)
            set_layer_data_teaser(pyxb_wall, ceiling)

            # zone.inner_walls.append(ceiling)

        for pyxb_wall in pyxb_zone.Floor:
            floor = Floor(zone)

            set_basic_data_teaser(pyxb_wall, floor)
            set_layer_data_teaser(pyxb_wall, floor)

            # zone.inner_walls.append(floor)

        for pyxb_win in pyxb_zone.Window:
            win = Window(zone)

            set_basic_data_teaser(pyxb_win, win)
            set_layer_data_teaser(pyxb_win, win)
コード例 #5
0
def example_create_building():
    """"This function demonstrates generating a building adding all
    information separately"""

    # 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 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.

    prj = Project(load_data=True)
    prj.name = "BuildingExample"

    # Instantiate a Building class and set the Project API as a parent to
    # this building. This will automatically add this building and all its
    # future changes to the project. This is helpful as we can use the data
    # base and API functions (like explained in e2 - e5). We also set some
    # building parameters. Be careful: Dymola does not like whitespaces in
    # names and filenames, thus we will delete them anyway in TEASER.

    from teaser.logic.buildingobjects.building import Building

    bldg = Building(parent=prj)
    bldg.name = "SuperExampleBuilding"
    bldg.street_name = "AwesomeAvenue42"
    bldg.city = "46325FantasticTown"
    bldg.year_of_construction = 2015
    bldg.number_of_floors = 1
    bldg.height_of_floors = 3.5

    # Instantiate a ThermalZone class and set the Building as a parent of it.
    # Set some parameters of the thermal zone. Be careful: Dymola does not
    # like whitespaces in  names and filenames, thus we will delete them
    # anyway in TEASER.

    from teaser.logic.buildingobjects.thermalzone import ThermalZone

    tz = ThermalZone(parent=bldg)
    tz.name = "LivingRoom"
    tz.area = 140.0
    tz.volume = tz.area * bldg.number_of_floors * bldg.height_of_floors
    tz.infiltration_rate = 0.5

    # Instantiate BoundaryConditions and load conditions for `Living`.

    from teaser.logic.buildingobjects.boundaryconditions.boundaryconditions \
        import BoundaryConditions

    tz.use_conditions = BoundaryConditions(parent=tz)
    tz.use_conditions.load_use_conditions("Living", prj.data)

    # Define two building elements reflecting a pitched roof (south = 180° and
    # north = 0°). Setting the the ThermalZone as a parent will automatically
    # assign this element to the thermal zone. We also set names, tilt and
    # coefficients for heat transfer on the inner and outer side of the
    # roofs. If the building has a flat roof, please use -1 as
    # orientation. Please read the docs to get more information on these
    # parameters.

    from teaser.logic.buildingobjects.buildingphysics.rooftop import Rooftop

    roof_south = Rooftop(parent=tz)
    roof_south.name = "Roof_South"
    roof_south.area = 75.0
    roof_south.orientation = 180.0
    roof_south.tilt = 55.0
    roof_south.inner_convection = 1.7
    roof_south.outer_convection = 20.0
    roof_south.inner_radiation = 5.0
    roof_south.outer_radiation = 5.0

    roof_north = Rooftop(parent=tz)
    roof_north.name = "Roof_North"
    roof_north.area = 75.0
    roof_north.orientation = 0.0
    roof_north.tilt = 55.0
    roof_north.inner_convection = 1.7
    roof_north.outer_convection = 20.0
    roof_north.inner_radiation = 5.0
    roof_north.outer_radiation = 5.0

    # To define the wall constructions we need to instantiate Layer and
    # Material objects and set attributes. id indicates the order of wall
    # construction from inside to outside (so 0 is on the inner surface). You
    # need to set this value!

    from teaser.logic.buildingobjects.buildingphysics.layer import Layer

    # First layer south

    layer_s1 = Layer(parent=roof_south, id=0)
    layer_s1.thickness = 0.3

    from teaser.logic.buildingobjects.buildingphysics.material import Material

    material_s1 = Material(layer_s1)
    material_s1.name = "Insulation"
    material_s1.density = 120.0
    material_s1.heat_capac = 0.04
    material_s1.thermal_conduc = 1.0

    # Second layer south

    layer_s2 = Layer(parent=roof_south, id=1)
    layer_s2.thickness = 0.15

    material_s2 = Material(layer_s2)
    material_s2.name = "Tile"
    material_s2.density = 1400.0
    material_s2.heat_capac = 0.6
    material_s2.thermal_conduc = 2.5

    # First layer north

    layer_n1 = Layer(parent=roof_north, id=0)
    layer_n1.thickness = 0.3

    from teaser.logic.buildingobjects.buildingphysics.material import Material

    material_n1 = Material(layer_n1)
    material_n1.name = "Insulation"
    material_n1.density = 120.0
    material_n1.heat_capac = 0.04
    material_n1.thermal_conduc = 1.0

    # Second layer north

    layer_n2 = Layer(parent=roof_north, id=1)
    layer_n2.thickness = 0.15

    material_n2 = Material(layer_n2)
    material_n2.name = "Tile"
    material_n2.density = 1400.0
    material_n2.heat_capac = 0.6
    material_n2.thermal_conduc = 2.5

    # Another option is to use the database for typical wall constructions,
    # but set area, tilt, orientation individually. To simplify code,
    # we save individual information for exterior walls, interior walls into
    # dictionaries.
    # outer walls
    # {'name_of_wall': [area, tilt, orientation]}
    # interior walls
    # {'name_of_wall': [area, tilt, orientation]}

    from teaser.logic.buildingobjects.buildingphysics.outerwall import OuterWall

    out_wall_dict = {"OuterWall_north": [10.0, 90.0, 0.0],
                     "OuterWall_east": [14.0, 90.0, 90.0],
                     "OuterWall_south": [10.0, 90.0, 180.0],
                     "OuterWall_west": [14.0, 90.0, 270.0]}

    # For ground floors the orientation is always -2

    ground_floor_dict = {"GroundFloor": [100.0, 0.0, -2]}

    from teaser.logic.buildingobjects.buildingphysics.innerwall import InnerWall

    in_wall_dict = {"InnerWall1": [10.0],
                    "InnerWall2": [14.0],
                    "InnerWall3": [10.0]}

    for key, value in out_wall_dict.items():
        # Instantiate class, key is the name
        out_wall = OuterWall(parent=tz)
        out_wall.name = key
        # Use load_type_element() function of the building element, and pass
        # over the year of construction of the building and the type of
        # construction (in this case `heavy`).

        out_wall.load_type_element(
            year=bldg.year_of_construction,
            construction='heavy')

        # area, tilt and orientation need to be set individually.

        out_wall.area = value[0]
        out_wall.tilt = value[1]
        out_wall.orientation = value[2]

    # Repeat the procedure for inner walls and ground floors

    for key, value in in_wall_dict.items():

        in_wall = InnerWall(parent=tz)
        in_wall.name = key
        in_wall.load_type_element(
            year=bldg.year_of_construction,
            construction='heavy')
        in_wall.area = value[0]

    from teaser.logic.buildingobjects.buildingphysics.groundfloor import \
        GroundFloor

    for key, value in ground_floor_dict.items():

        ground = GroundFloor(parent=tz)
        ground.name = key
        ground.load_type_element(
            year=bldg.year_of_construction,
            construction='heavy')
        ground.area = value[0]
        ground.tilt = value[1]
        ground.orientation = value[2]

    from teaser.logic.buildingobjects.buildingphysics.window import Window

    win_dict = {"Window_east": [5.0, 90.0, 90.0],
                "Window_south": [8.0, 90.0, 180.0],
                "Window_west": [5.0, 90.0, 270.0]}

    for key, value in win_dict.items():

        win = Window(parent=tz)
        win.name = key
        win.area = value[0]
        win.tilt = value[1]
        win.orientation = value[2]

        # Additional to the already known attributes the window has
        # additional attributes. Window.g_value describes the solar gain
        # through windows, a_conv the convective heat transmission due to
        # absorption of the window on the inner side. shading_g_total and
        # shading_max_irr refers to the shading (solar gain reduction of the
        # shading and shading_max_irr the threshold of irradiance to
        # automatically apply shading).

        win.inner_convection = 1.7
        win.inner_radiation = 5.0
        win.outer_convection = 20.0
        win.outer_radiation = 5.0
        win.g_value = 0.789
        win.a_conv = 0.03
        win.shading_g_total = 0.0
        win.shading_max_irr = 180.0

        # One equivalent layer for windows

        win_layer = Layer(parent=win)
        win_layer.id = 1
        win_layer.thickness = 0.024

        # Material for glass

        win_material = Material(win_layer)
        win_material.name = "GlasWindow"
        win_material.thermal_conduc = 0.067
        win_material.transmittance = 0.9
コード例 #6
0
def example_create_building():
    '''
    Instantiate a Project class (with load_data set to true), instantiate a
    Building class, with the project as a parent. This automatically adds the
    specific building and all its future changes to the project.
    '''
    prj = Project(load_data=True)
    bldg = Building(parent=prj)

    '''Set some building parameters'''

    bldg.name = "SuperExampleBuilding"
    bldg.street_name = "Awesome Avenue 42"
    bldg.city = "46325 Fantastic Town"
    bldg.year_of_construction = 1988
    bldg.number_of_floors = 1
    bldg.height_of_floors = 3.5

    '''Instantiate a ThermalZone class, with building as parent and set  some
    parameters of the thermal zone'''

    tz = ThermalZone(parent=bldg)
    tz.name = "Living Room"
    tz.area = 140.0
    tz.volume = tz.area * bldg.number_of_floors * bldg.height_of_floors
    tz.infiltration_rate = 0.5

    '''Instantiate UseConditions18599 class with thermal zone as parent,
    and load the use conditions for the usage 'Living' '''

    tz.use_conditions = BoundaryConditions(parent=tz)
    tz.use_conditions.load_use_conditions("Living")

    '''Define two elements representing a pitched roof and define Layers and
    Materials explicitly'''

    roof_south = Rooftop(parent=tz)
    roof_south.name = "Roof_South"

    roof_north = Rooftop(parent=tz)
    roof_north.name = "Roof_North"

    '''Set area, orientation and tilt of South Roof'''
    roof_south.area = 75.0
    roof_south.orientation = 180.0
    roof_south.tilt = 55.0

    '''Set coefficient of heat transfer'''
    roof_south.inner_convection = 1.7
    roof_south.outer_convection = 5.0
    roof_south.inner_radiation = 20.0
    roof_south.outer_radiation = 5.0

    '''Set layer and material'''
    layer_1s = Layer(parent=roof_south, id=0) # id indicates the order of
                                              # layer from inside to outside
    layer_1s.thickness = 0.15

    material_1_2 = Material(layer_1s)
    material_1_2.name = "Insulation"
    material_1_2.density = 120.0
    material_1_2.heat_capac = 0.04
    material_1_2.thermal_conduc = 1.0

    layer_2s = Layer(parent=roof_south, id=1)
    layer_2s.thickness = 0.15

    material_1_1 = Material(layer_2s)
    material_1_1.name = "Tile"
    material_1_1.density = 1400.0
    material_1_1.heat_capac = 0.6
    material_1_1.thermal_conduc = 2.5

    '''Set area, orientation and tilt of North Roof'''
    roof_north.area = 75.0
    roof_north.orientation = 0.0
    roof_north.tilt = 55.0

    '''Set coefficient of heat transfer'''
    roof_north.inner_convection = 1.7
    roof_north.outer_convection = 5.0
    roof_north.inner_radiation = 20.0
    roof_north.outer_radiation = 5.0

    '''Set layer and material'''
    layer_1n = Layer(parent=roof_north, id=0)
    layer_1n.thickness = 0.15

    material_1_2 = Material(layer_1n)
    material_1_2.name = "Insulation"
    material_1_2.density = 120.0
    material_1_2.heat_capac = 0.04
    material_1_2.thermal_conduc = 1.0

    layer_2n = Layer(parent=roof_north, id=1)
    layer_2n.thickness = 0.15
    layer_2n.position = 1

    material_1_1 = Material(layer_2n)
    material_1_1.name = "Tile"
    material_1_1.density = 1400.0
    material_1_1.heat_capac = 0.6
    material_1_1.thermal_conduc = 2.5

    '''We save information of the Outer and Inner walls as well as Windows
    in dicts, the key is the name, while the value is a list (if applicable)
    [year of construciton,
     construction type,
     area,
     tilt,
     orientation]
     '''

    out_wall_dict = {"Outer Wall 1": [bldg.year_of_construction, 'heavy',
                                      10.0, 90.0, 0.0],
                     "Outer Wall 2": [bldg.year_of_construction, 'heavy',
                                      14.0, 90.0, 90.0],
                     "Outer Wall 3": [bldg.year_of_construction, 'heavy',
                                      10.0, 90.0, 180.0],
                     "Outer Wall 4": [bldg.year_of_construction, 'heavy',
                                      14.0, 90.0, 270.0]}

    in_wall_dict = {"Inner Wall 1": [bldg.year_of_construction, 'light', 10.0],
                    "Inner Wall 2": [bldg.year_of_construction, 'heavy', 14.0],
                    "Inner Wall 3": [bldg.year_of_construction, 'light', 10.0]}

    win_dict = {"Window 1": [bldg.year_of_construction,
                             5.0, 90.0, 90.0],
                "Window 2": [bldg.year_of_construction,
                             8.0, 90.0, 180.0],
                "Window 3": [bldg.year_of_construction,
                             5.0, 90.0, 270.0]}

    for key, value in out_wall_dict.items():
        '''instantiate OuterWall class'''
        out_wall = OuterWall(parent = tz)
        out_wall.name = key
        '''load typical construction, based on year of construction and
        construction type'''
        out_wall.load_type_element(year=value[0],
                                   construction=value[1])
        out_wall.area = value[2]
        out_wall.tilt = value[3]
        out_wall.orientation = value[4]

    for key, value in in_wall_dict.items():
        '''instantiate InnerWall class'''
        in_wall = InnerWall(parent = tz)
        in_wall.name = key
        '''load typical construction, based on year of construction and
        construction type'''
        in_wall.load_type_element(year=value[0],
                                  construction=value[1])
        in_wall.area = value[2]

    for key, value in win_dict.items():
        '''instantiate Window class'''
        win = Window(parent = tz)
        win.name = key
        win.area = value[1]
        win.tilt = value[2]
        win.orientation = value[3]

        '''
        We know the exact properties of the window, thus we set them instead
        of loading a typical construction
        '''
        win.inner_convection = 1.7
        win.inner_radiation = 5.0
        win.outer_convection = 20.0
        win.outer_radiation = 5.0
        win.g_value = 0.789
        win.a_conv = 0.03
        win.shading_g_total = 1.0
        win.shading_max_irr = 180.0
        '''Instantiate a Layer class, with window as parent, set attributes'''
        win_layer = Layer(parent = win)
        win_layer.id = 1
        win_layer.thickness = 0.024
        '''Instantiate a Material class, with window layer as parent,
        set attributes'''
        win_material = Material(win_layer)
        win_material.name = "GlasWindow"
        win_material.thermal_conduc = 0.067
        win_material.transmittance = 0.9


    '''For a GroundFloor we are using the load_type_element function,
    which needs the year of construction and the construction type ('heavy'
    or 'light')
    '''
    ground = GroundFloor(parent=tz)
    ground.name = "Ground floor"
    ground.load_type_element(bldg.year_of_construction, 'heavy')
    ground.area = 140.0

    '''
    We calculate the RC Values according to AixLib procedure
    '''

    prj.used_library_calc = 'AixLib'
    prj.number_of_elements_calc = 2
    prj.merge_windows_calc = False

    prj.calc_all_buildings()
    '''
    Export the Modelica Record
    '''
    prj.export_aixlib(building_model="MultizoneEquipped",
                      zone_model="ThermalZoneEquipped",
                      corG=True,
                      internal_id=None,
                      path=None)

    '''Or we use Annex60 method with for elements'''
    #prj.calc_all_buildings(number_of_elements=4,
    #                       merge_windows=False,
    #                       used_library='Annex60')
    #prj.export_annex()

    '''
    Save new TEASER XML and cityGML
    '''
    prj.save_project("ExampleProject")
    prj.save_citygml("ExampleCityGML")
コード例 #7
0
    def generate_archetype(self):
        """Generates a SingleFamilyDwelling building.

        With given values, this class generates a archetype building for
        single family dwellings according to TEASER requirements
        """
        # help area for the correct building area setting while using typeBldgs
        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0

        self._number_of_heated_floors = self._est_factor_heated_cellar + \
            self.number_of_floors + self.est_living_area_factor \
            * self._est_factor_heated_attic

        self._living_area_per_floor = type_bldg_area / \
            self._number_of_heated_floors

        self._est_ground_floor_area = self.est_bottom_building_closure * \
            self._living_area_per_floor

        self._est_roof_area = self.est_upper_building_closure * \
            self._est_factor_dormer * self._est_area_per_floor * \
            self._living_area_per_floor

        self._top_floor_area = self._est_area_per_roof * \
            self._living_area_per_floor

        if self._est_roof_area == 0:
            self._est_roof_area = self._top_floor_area

        self._est_facade_area = self._est_facade_to_floor_area * \
            self._living_area_per_floor + self._est_extra_floor_area

        self._est_win_area = self.est_factor_win_area * type_bldg_area

        self._est_cellar_wall_area = self.est_factor_cellar_area * \
            self._est_factor_heated_cellar * self._est_facade_area

        self._est_outer_wall_area = (self._number_of_heated_floors *
                                     self._est_facade_area) - \
            self._est_cellar_wall_area - \
            self._est_win_area

        # self._est_factor_volume = type_bldg_area * 2.5

        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.name = key
            zone.area = type_bldg_area * value[0]
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1], data_class=self.parent.data)

            zone.use_conditions = use_cond
            zone.use_conditions.with_ahu = False
            zone.use_conditions.persons *= zone.area * 0.01
            zone.use_conditions.machines *= zone.area * 0.01

        for key, value in self.outer_wall_names.items():
            # North and South

            if value[1] == 0 or value[1] == 180.0:
                self.outer_area[value[1]] = self._est_outer_wall_area / \
                    self.nr_of_orientation
            # East and West
            elif value[1] == 90 or value[1] == 270:

                self.outer_area[value[1]] = self._est_outer_wall_area / \
                    self.nr_of_orientation

            for zone in self.thermal_zones:
                # create wall and set building elements
                outer_wall = OuterWall(zone)
                outer_wall.load_type_element(
                    year=self.year_of_construction,
                    construction=self.construction_type,
                    data_class=self.parent.data)
                outer_wall.name = key
                outer_wall.tilt = value[0]
                outer_wall.orientation = value[1]

        for key, value in self.window_names.items():

            if value[1] == 0 or value[1] == 180:

                self.window_area[value[1]] = self._est_win_area / \
                    self.nr_of_orientation

            elif value[1] == 90 or value[1] == 270:

                self.window_area[value[1]] = self._est_win_area / \
                    self.nr_of_orientation
            '''
            There is no real classification for windows, so this is a bit hard
            code - will be fixed sometime
            '''
            for zone in self.thermal_zones:
                window = Window(zone)

                window.load_type_element(self.year_of_construction,
                                         "Kunststofffenster, "
                                         "Isolierverglasung",
                                         data_class=self.parent.data)
                window.name = key
                window.tilt = value[0]
                window.orientation = value[1]

        for key, value in self.roof_names.items():

            self.outer_area[value[1]] = self._est_roof_area

            for zone in self.thermal_zones:
                roof = Rooftop(zone)
                roof.load_type_element(year=self.year_of_construction,
                                       construction=self.construction_type,
                                       data_class=self.parent.data)
                roof.name = key
                roof.tilt = value[0]
                roof.orientation = value[1]

        for key, value in self.ground_floor_names.items():

            self.outer_area[value[1]] = self._est_ground_floor_area

            for zone in self.thermal_zones:
                ground_floor = GroundFloor(zone)
                ground_floor.load_type_element(
                    year=self.year_of_construction,
                    construction=self.construction_type,
                    data_class=self.parent.data)
                ground_floor.name = key
                ground_floor.tilt = value[0]
                ground_floor.orientation = value[1]

        for key, value in self.inner_wall_names.items():

            for zone in self.thermal_zones:
                inner_wall = InnerWall(zone)
                inner_wall.load_type_element(
                    year=self.year_of_construction,
                    construction=self.construction_type,
                    data_class=self.parent.data)
                inner_wall.name = key
                inner_wall.tilt = value[0]
                inner_wall.orientation = value[1]
                # zone.inner_walls.append(inner_wall)

        if self.number_of_floors > 1:

            for key, value in self.ceiling_names.items():

                for zone in self.thermal_zones:
                    ceiling = Ceiling(zone)
                    ceiling.load_type_element(
                        year=self.year_of_construction,
                        construction=self.construction_type,
                        data_class=self.parent.data)
                    ceiling.name = key
                    ceiling.tilt = value[0]
                    ceiling.orientation = value[1]
                    # zone.inner_walls.append(ceiling)

            for key, value in self.floor_names.items():

                for zone in self.thermal_zones:
                    floor = Floor(zone)
                    floor.load_type_element(
                        year=self.year_of_construction,
                        construction=self.construction_type,
                        data_class=self.parent.data)
                    floor.name = key
                    floor.tilt = value[0]
                    floor.orientation = value[1]
                    # zone.inner_walls.append(floor)
        else:
            pass

        for key, value in self.outer_area.items():
            self.set_outer_wall_area(value, key)
        for key, value in self.window_area.items():
            self.set_window_area(value, key)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #8
0
    def generate_from_gml(self):
        """Enriches lod1 or lod2 data from CityGML

        Adds Zones, BoundaryConditions, Material settings for walls and
        windows to the geometric representation of CityGML
        """

        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0
        # create zones with their corresponding area, name and usage
        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.area = type_bldg_area * value[0]
            zone.name = key
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1], data_class=self.parent.data)
            zone.use_conditions = use_cond
            zone.use_conditions.with_ahu = False
            zone.use_conditions.persons *= zone.area * 0.01
            zone.use_conditions.machines *= zone.area * 0.01

            for surface in self.gml_surfaces:
                if surface.surface_tilt is not None:
                    if surface.surface_tilt == 90:
                        outer_wall = OuterWall(zone)
                        outer_wall.load_type_element(
                            year=self.year_of_construction,
                            construction=self.construction_type,
                            data_class=self.parent.data)
                        outer_wall.name = surface.name
                        outer_wall.tilt = surface.surface_tilt
                        outer_wall.orientation = surface.surface_orientation

                        window = Window(zone)
                        window.load_type_element(self.year_of_construction,
                                                 "Kunststofffenster, "
                                                 "Isolierverglasung",
                                                 data_class=self.parent.data)
                        window.name = "asd" + str(surface.surface_tilt)
                        window.tilt = surface.surface_tilt
                        window.orientation = surface.surface_orientation

                    elif surface.surface_tilt == 0 and \
                        surface.surface_orientation == \
                            -2:
                        outer_wall = GroundFloor(zone)
                        outer_wall.load_type_element(
                            year=self.year_of_construction,
                            construction=self.construction_type,
                            data_class=self.parent.data)
                        outer_wall.name = surface.name
                        outer_wall.tilt = surface.surface_tilt
                        outer_wall.orientation = surface.surface_orientation

                    else:
                        outer_wall = Rooftop(zone)
                        outer_wall.load_type_element(
                            year=self.year_of_construction,
                            construction=self.construction_type,
                            data_class=self.parent.data)
                        outer_wall.name = surface.name
                        outer_wall.tilt = surface.surface_tilt
                        outer_wall.orientation = surface.surface_orientation

            for key, value in self.inner_wall_names.items():

                for zone in self.thermal_zones:
                    inner_wall = InnerWall(zone)
                    inner_wall.load_type_element(
                        year=self.year_of_construction,
                        construction=self.construction_type,
                        data_class=self.parent.data)
                    inner_wall.name = key
                    inner_wall.tilt = value[0]
                    inner_wall.orientation = value[1]

            if self.number_of_floors > 1:

                for key, value in self.ceiling_names.items():

                    for zone in self.thermal_zones:
                        ceiling = Ceiling(zone)
                        ceiling.load_type_element(
                            year=self.year_of_construction,
                            construction=self.construction_type,
                            data_class=self.parent.data)
                        ceiling.name = key
                        ceiling.tilt = value[0]
                        ceiling.orientation = value[1]

                for key, value in self.floor_names.items():

                    for zone in self.thermal_zones:
                        floor = Floor(zone)
                        floor.load_type_element(
                            year=self.year_of_construction,
                            construction=self.construction_type,
                            data_class=self.parent.data)
                        floor.name = key
                        floor.tilt = value[0]
                        floor.orientation = value[1]
            else:
                pass

        for surface in self.gml_surfaces:
            if surface.surface_tilt is not None:
                if surface.surface_tilt != 0 and surface.surface_orientation\
                        != -2 and surface.surface_orientation != -1:
                    self.set_outer_wall_area(
                        surface.surface_area * (1 - self.est_factor_win_area),
                        surface.surface_orientation)
                else:
                    self.set_outer_wall_area(surface.surface_area,
                                             surface.surface_orientation)
        for surface in self.gml_surfaces:

            if surface.surface_tilt != 0 and surface.surface_orientation != \
                    -2 and surface.surface_orientation != -1:
                self.set_window_area(
                    surface.surface_area * self.est_factor_win_area,
                    surface.surface_orientation)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #9
0
    def generate_archetype(self):
        '''Generates an office building.

        With given values, this class generates a type building according to
        TEASER requirements.

        '''
        #help area for the correct building area setting while using typeBldgs
        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0
        # create zones with their corresponding area, name and usage
        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.area = type_bldg_area * value[0]
            zone.name = key
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1])
            zone.use_conditions = use_cond

            zone.use_conditions.persons = zone.area * 0.01 * \
                zone.use_conditions.persons
            zone.use_conditions.machines = zone.area * 0.01 * \
                zone.use_conditions.machines

            # self.thermal_zones.append(zone)

        # statistical estimation of the facade

        self._est_outer_wall_area = self.est_factor_wall_area * \
                                type_bldg_area ** self.est_exponent_wall
        self._est_win_area = self.est_factor_win_area * \
                             type_bldg_area ** self.est_exponent_win
        self._est_roof_area = (type_bldg_area / self.number_of_floors) * \
                              self.gross_factor
        self._est_floor_area = (type_bldg_area / self.number_of_floors) * \
                               self.gross_factor

        # manipulation of wall according to facade design
        # (received from window_layout)

        self._est_facade_area = self._est_outer_wall_area + self._est_win_area

        if not self.window_layout == 0:
            self._est_outer_wall_area = self._est_facade_area * \
                                        self.corr_factor_wall
            self._est_win_area = self._est_facade_area * self.corr_factor_win
        else:
            pass

        # set the facade area to the four orientations

        for key, value in self.outer_wall_names.items():
            # North and South
            if value[1] == 0 or value[1] == 180:
                self.outer_area[value[1]] = self._est_outer_wall_area * \
                 (self._est_length / (2 * self._est_width + 2 * self._est_length))
            # East and West
            elif value[1] == 90 or value[1] == 270:

                self.outer_area[value[1]] = self._est_outer_wall_area * \
                (self._est_width / (2 * self._est_width + 2 * self._est_length))
            for zone in self.thermal_zones:
                # create wall and set building elements
                outer_wall = OuterWall(zone)
                outer_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                outer_wall.name = key
                outer_wall.tilt = value[0]
                outer_wall.orientation = value[1]

        for key, value in self.window_names.items():

            if value[1] == 0 or value[1] == 180:

                self.window_area[value[1]] = self._est_win_area * \
                (self._est_length / (2 * self._est_width + 2 * self._est_length))

            elif value[1] == 90 or value[1] == 270:

                self.window_area[value[1]] = self._est_win_area * \
                (self._est_width / (2 * self._est_width + 2 * self._est_length))
            '''
            There is no real classification for windows, so this is a bit hard
            code - will be fixed sometime.
            '''
            for zone in self.thermal_zones:
                window = Window(zone)
                window.load_type_element(
                    self.year_of_construction,
                    "Kunststofffenster, Isolierverglasung")
                window.name = key
                window.tilt = value[0]
                window.orientation = value[1]

        for key, value in self.roof_names.items():

            self.outer_area[value[1]] = self._est_roof_area

            for zone in self.thermal_zones:
                roof = Rooftop(zone)
                roof.load_type_element(self.year_of_construction,
                                       self.construction_type)
                roof.name = key
                roof.tilt = value[0]
                roof.orientation = value[1]
                # zone.outer_walls.append(roof)

        for key, value in self.ground_floor_names.items():

            self.outer_area[value[1]] = self._est_floor_area

            for zone in self.thermal_zones:
                ground_floor = GroundFloor(zone)
                ground_floor.load_type_element(self.year_of_construction,
                                               self.construction_type)
                ground_floor.name = key
                ground_floor.tilt = value[0]
                ground_floor.orientation = value[1]
                # zone.outer_walls.append(ground_floor)

        for key, value in self.inner_wall_names.items():

            for zone in self.thermal_zones:
                inner_wall = InnerWall(zone)
                inner_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                inner_wall.name = key
                inner_wall.tilt = value[0]
                inner_wall.orientation = value[1]
                # zone.inner_walls.append(inner_wall)

        if self.number_of_floors > 1:

            for key, value in self.ceiling_names.items():

                for zone in self.thermal_zones:
                    ceiling = Ceiling(zone)
                    ceiling.load_type_element(self.year_of_construction,
                                              self.construction_type)
                    ceiling.name = key
                    ceiling.tilt = value[0]
                    ceiling.orientation = value[1]
                    # zone.inner_walls.append(ceiling)

            for key, value in self.floor_names.items():

                for zone in self.thermal_zones:
                    floor = Floor(zone)
                    floor.load_type_element(self.year_of_construction,
                                            self.construction_type)
                    floor.name = key
                    floor.tilt = value[0]
                    floor.orientation = value[1]
                    # zone.inner_walls.append(floor)
        else:
            pass

        for key, value in self.outer_area.items():
            self.set_outer_wall_area(value, key)
        for key, value in self.window_area.items():
            self.set_window_area(value, key)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #10
0
def from_scratch(
        number_of_elements,
        save=False,
        path=utilities.get_default_path()):
    """This function creates the test room from scratch.

    Notes: The standard defines an solar absorption coefficient for interior
    surfaces of 0.6. We do not consider this, but we could by multiplying
    the solar radiation after the window by 0.6.

    Parameters
    ----------
    number_of_elements: int
        Number of elements of model
    path: str (optional)
        Path where Project should be stored as .teaserXML
    save: bool (optional)
        True if Project should be stored as .teaserXML at path

    Returns
    -------

    prj: Project
        Project that contains the building with the test room

    """
    prj = Project(load_data=True)
    prj.name = "ASHRAE140Verification"

    bldg = Building(parent=prj)
    bldg.name = "TestBuilding"

    tz = ThermalZone(parent=bldg)
    tz.name = "TestRoom900"
    tz.area = 8.0 * 6.0
    tz.volume = tz.area * 2.7
    tz.infiltration_rate = 0.41

    tz.use_conditions = BoundaryConditions(parent=tz)

    roof = Rooftop(parent=tz)
    roof.name = "Roof"
    roof.area = 8.0 * 6.0
    roof.orientation = -1.0
    roof.tilt = 0.0
    roof.inner_convection = 1
    roof.outer_convection = 24.67
    roof.inner_radiation = 5.13
    roof.outer_radiation = 4.63

    layer_r1 = Layer(parent=roof, id=0)
    layer_r1.thickness = 0.01

    material_r1 = Material(layer_r1)
    material_r1.name = "Plasterboard"
    material_r1.density = 950.0
    material_r1.heat_capac = 840.0 / 1000
    material_r1.thermal_conduc = 0.16
    material_r1.ir_emissivity = 0.9

    layer_r2 = Layer(parent=roof, id=1)
    layer_r2.thickness = 0.1118

    material_r2 = Material(layer_r2)
    material_r2.name = "Fiberglass"
    material_r2.density = 12
    material_r2.heat_capac = 840 / 1000
    material_r2.thermal_conduc = 0.04

    layer_r3 = Layer(parent=roof, id=2)
    layer_r3.thickness = 0.019

    material_r3 = Material(layer_r3)
    material_r3.name = "Roofdeck"
    material_r3.density = 530
    material_r3.heat_capac = 900 / 1000
    material_r3.thermal_conduc = 0.14
    material_r3.solar_absorp = 0.6
    material_r3.ir_emissivity = 0.9

    out_wall_north = OuterWall(parent=tz)
    out_wall_north.name = "OuterWallNorth"
    out_wall_north.area = 8.0 * 2.7
    out_wall_north.orientation = 0.0
    out_wall_north.tilt = 90.0
    out_wall_north.inner_convection = 3.16
    out_wall_north.outer_convection = 24.67
    out_wall_north.inner_radiation = 5.13
    out_wall_north.outer_radiation = 4.63

    layer_own1 = Layer(parent=out_wall_north, id=0)
    layer_own1.thickness = 0.1

    material_own1 = Material(layer_own1)
    material_own1.name = "Concrete"
    material_own1.density = 1400.0
    material_own1.heat_capac = 1000 / 1000
    material_own1.thermal_conduc = 0.51
    material_own1.ir_emissivity = 0.9

    layer_own2 = Layer(parent=out_wall_north, id=1)
    layer_own2.thickness = 0.062

    material_own2 = Material(layer_own2)
    material_own2.name = "FoamInsulation"
    material_own2.density = 10
    material_own2.heat_capac = 1400 / 1000
    material_own2.thermal_conduc = 0.04

    layer_own3 = Layer(parent=out_wall_north, id=2)
    layer_own3.thickness = 0.009

    material_own3 = Material(layer_own3)
    material_own3.name = "WoodSiding"
    material_own3.density = 530
    material_own3.heat_capac = 900 / 1000
    material_own3.thermal_conduc = 0.14
    material_own3.solar_absorp = 0.6
    material_own3.ir_emissivity = 0.9

    out_wall_east = OuterWall(parent=tz)
    out_wall_east.name = "OuterWallEast"
    out_wall_east.area = 6.0 * 2.7
    out_wall_east.orientation = 90.0
    out_wall_east.tilt = 90.0
    out_wall_east.inner_convection = 3.16
    out_wall_east.outer_convection = 24.67
    out_wall_east.inner_radiation = 5.13
    out_wall_east.outer_radiation = 4.63

    layer_owe1 = Layer(parent=out_wall_east, id=0)
    layer_owe1.thickness = 0.1

    material_owe1 = Material(layer_owe1)
    material_owe1.name = "Concrete"
    material_owe1.density = 1400.0
    material_owe1.heat_capac = 1000 / 1000
    material_owe1.thermal_conduc = 0.51
    material_owe1.ir_emissivity = 0.9

    layer_owe2 = Layer(parent=out_wall_east, id=1)
    layer_owe2.thickness = 0.062

    material_owe2 = Material(layer_owe2)
    material_owe2.name = "FoamInsulation"
    material_owe2.density = 10
    material_owe2.heat_capac = 1400 / 1000
    material_owe2.thermal_conduc = 0.04

    layer_owe3 = Layer(parent=out_wall_east, id=2)
    layer_owe3.thickness = 0.009

    material_owe3 = Material(layer_owe3)
    material_owe3.name = "WoodSiding"
    material_owe3.density = 530
    material_owe3.heat_capac = 900 / 1000
    material_owe3.thermal_conduc = 0.14
    material_owe3.solar_absorp = 0.6
    material_owe3.ir_emissivity = 0.9

    out_wall_south = OuterWall(parent=tz)
    out_wall_south.name = "OuterWallSouth"
    out_wall_south.area = (8.0 * 2.7) - 2 * (3 * 2)  # minus two windows
    out_wall_south.orientation = 180.0
    out_wall_south.tilt = 90.0
    out_wall_south.inner_convection = 3.16
    out_wall_south.outer_convection = 24.67
    out_wall_south.inner_radiation = 5.13
    out_wall_south.outer_radiation = 4.63

    layer_ows1 = Layer(parent=out_wall_south, id=0)
    layer_ows1.thickness = 0.1

    material_ows1 = Material(layer_ows1)
    material_ows1.name = "Concrete"
    material_ows1.density = 1400.0
    material_ows1.heat_capac = 1000.0 / 1000
    material_ows1.thermal_conduc = 0.51
    material_ows1.ir_emissivity = 0.9

    layer_ows2 = Layer(parent=out_wall_south, id=1)
    layer_ows2.thickness = 0.062

    material_ows2 = Material(layer_ows2)
    material_ows2.name = "FoamInsulation"
    material_ows2.density = 10
    material_ows2.heat_capac = 1400 / 1000
    material_ows2.thermal_conduc = 0.04

    layer_ows3 = Layer(parent=out_wall_south, id=2)
    layer_ows3.thickness = 0.009

    material_ows3 = Material(layer_ows3)
    material_ows3.name = "WoodSiding"
    material_ows3.density = 530
    material_ows3.heat_capac = 900 / 1000
    material_ows3.thermal_conduc = 0.14
    material_ows3.solar_absorp = 0.6
    material_ows3.ir_emissivity = 0.9

    out_wall_west = OuterWall(parent=tz)
    out_wall_west.name = "OuterWallWest"
    out_wall_west.area = 6 * 2.7
    out_wall_west.orientation = 270.0
    out_wall_west.tilt = 90.0
    out_wall_west.inner_convection = 3.16
    out_wall_west.outer_convection = 24.67
    out_wall_west.inner_radiation = 5.13
    out_wall_west.outer_radiation = 4.63

    layer_oww1 = Layer(parent=out_wall_west, id=0)
    layer_oww1.thickness = 0.1

    material_oww1 = Material(layer_oww1)
    material_oww1.name = "Concrete"
    material_oww1.density = 1400.0
    material_oww1.heat_capac = 1000.0 / 1000
    material_oww1.thermal_conduc = 0.51
    material_oww1.ir_emissivity = 0.9

    layer_oww2 = Layer(parent=out_wall_west, id=1)
    layer_oww2.thickness = 0.062

    material_oww2 = Material(layer_oww2)
    material_oww2.name = "FoamInsulation"
    material_oww2.density = 10
    material_oww2.heat_capac = 1400 / 1000
    material_oww2.thermal_conduc = 0.04

    layer_oww3 = Layer(parent=out_wall_west, id=2)
    layer_oww3.thickness = 0.009

    material_oww3 = Material(layer_oww3)
    material_oww3.name = "WoodSiding"
    material_oww3.density = 530
    material_oww3.heat_capac = 900 / 1000
    material_oww3.thermal_conduc = 0.14
    material_oww3.solar_absorp = 0.6
    material_oww3.ir_emissivity = 0.9

    in_wall_floor = Floor(parent=tz)
    in_wall_floor.name = "InnerWallFloor"
    in_wall_floor.area = 6 * 8
    in_wall_floor.orientation = -2.0
    in_wall_floor.tilt = 0.0
    in_wall_floor.inner_convection = 4.13
    in_wall_floor.inner_radiation = 5.13

    layer_iwf1 = Layer(parent=in_wall_floor, id=0)
    layer_iwf1.thickness = 0.025

    material_iwf1 = Material(layer_iwf1)
    material_iwf1.name = "Concrete"
    material_iwf1.density = 1400
    material_iwf1.heat_capac = 1000 / 1000
    material_iwf1.thermal_conduc = 1.13
    material_iwf1.ir_emissivity = 0.9

    layer_iwf2 = Layer(parent=in_wall_floor, id=1)
    layer_iwf2.thickness = 1.007

    material_iwf2 = Material(layer_iwf2)
    material_iwf2.name = "Insulation"
    material_iwf2.density = 0.000000000001  # 0.0001, as small as possible
    material_iwf2.heat_capac = 0.000000000001  # 0.0001, as small as possible
    material_iwf2.thermal_conduc = 0.04

    win_1 = Window(parent=tz)
    win_1.name = "WindowSouthLeft"
    win_1.area = 3 * 2
    win_1.tilt = 90.0
    win_1.orientation = 180.0
    win_1.inner_convection = 3.16
    win_1.inner_radiation = 5.13
    win_1.outer_convection = 16.37
    win_1.outer_radiation = 4.63
    win_1.g_value = 0.789
    win_1.a_conv = 0.03  # for the given U-value extracted from VDI 6007-2/-3

    win_1_layer = Layer(parent=win_1)
    win_1_layer.id = 1
    win_1_layer.thickness = 0.024

    win_1_material = Material(win_1_layer)
    win_1_material.name = "GlasWindow"
    win_1_material.thermal_conduc = 0.15
    win_1_material.transmittance = 0.907
    win_1_material.ir_emissivity = 0.9

    win_2 = Window(parent=tz)
    win_2.name = "WindowSouthRight"
    win_2.area = 3 * 2
    win_2.tilt = 90.0
    win_2.orientation = 180.0
    win_2.inner_convection = 3.16
    win_2.inner_radiation = 5.13
    win_2.outer_convection = 16.37
    win_2.outer_radiation = 4.63
    win_2.g_value = 0.789
    win_2.a_conv = 0.03  # for the given U-value extracted from VDI 6007-2/-3

    win_2_layer = Layer(parent=win_2)
    win_2_layer.id = 1
    win_2_layer.thickness = 0.024

    win_2_material = Material(win_2_layer)
    win_2_material.name = "GlasWindow"
    win_2_material.thermal_conduc = 0.15
    win_2_material.transmittance = 0.907
    win_2_material.ir_emissivity = 0.9

    #  This is a dummy ground floor to export three and four elements models.
    #  Please set values for floor plate in three element and four element
    #  models to default.

    if number_of_elements >= 3:
        out_wall_gf = GroundFloor(parent=tz)
        out_wall_gf.name = "ExtWallGroundFloor"
        out_wall_gf.area = 6 * 8
        out_wall_gf.orientation = -2.0
        out_wall_gf.tilt = 0.0
        out_wall_gf.inner_convection = 4.13
        out_wall_gf.inner_radiation = 5.13

        layer_ofgw1 = Layer(parent=out_wall_gf, id=0)
        layer_ofgw1.thickness = 1.003

        material_ofgw1 = Material(layer_ofgw1)
        material_ofgw1.name = "Insulation"
        material_ofgw1.density = 0.0001  # as small as possible
        material_ofgw1.heat_capac = 0.0001  # as small as possible
        material_ofgw1.thermal_conduc = 0.04

    if save:
        prj.save_project(file_name='ASHRAE140_900', path=path)

    return prj
コード例 #11
0
ファイル: est1a.py プロジェクト: EnEff-BIM/TEASER
    def generate_archetype(self):
        """Generates a residential building.

        With given values, this class generates a type residential
        building according to TEASER requirements.

        """
        # help area for the correct building area setting while using typeBldgs
        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0

        self._est_ground_floor_area = type_bldg_area / self.number_of_floors

        self._est_roof_area = type_bldg_area / self.number_of_floors

        self._est_win_area = self.est_factor_win_area * type_bldg_area * \
                             (1 - self._est_factor_neighbour / 4)

        self._est_outer_wall_area = (self.est_factor_facade_to_volume *
            type_bldg_area *
            self.height_of_floors -
            self._est_ground_floor_area -
            self._est_roof_area -
            self._est_win_area)*(1 - self._est_factor_neighbour / 4)

        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.name = key
            zone.area = type_bldg_area * value[0]
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1])

            zone.use_conditions = use_cond

        for key, value in self.outer_wall_names.items():
            # North and South

            if value[1] == 0 or value[1] == 180.0:
                self.outer_area[value[1]] = self._est_outer_wall_area / \
                                            self.nr_of_orientation
            # East and West
            elif value[1] == 90 or value[1] == 270:

                self.outer_area[value[1]] = self._est_outer_wall_area / \
                                            self.nr_of_orientation

            for zone in self.thermal_zones:
                # create wall and set building elements
                outer_wall = OuterWall(zone)
                outer_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                outer_wall.name = key
                outer_wall.tilt = value[0]
                outer_wall.orientation = value[1]

        for key, value in self.window_names.items():

            if value[1] == 0 or value[1] == 180:

                self.window_area[value[1]] = self._est_win_area / \
                                             self.nr_of_orientation

            elif value[1] == 90 or value[1] == 270:

                self.window_area[value[1]] = self._est_win_area / \
                                             self.nr_of_orientation

            '''
            There is no real classification for windows, so this is a bit hard
            code - will be fixed sometime
            '''
            for zone in self.thermal_zones:
                window = Window(zone)

                window.load_type_element(self.year_of_construction,
                                         "Kunststofffenster, Isolierverglasung"
                                         )
                window.name = key
                window.tilt = value[0]
                window.orientation = value[1]

        for key, value in self.roof_names.items():

            self.outer_area[value[1]] = self._est_roof_area

            for zone in self.thermal_zones:
                roof = Rooftop(zone)
                roof.load_type_element(self.year_of_construction,
                                       self.construction_type)
                roof.name = key
                roof.tilt = value[0]
                roof.orientation = value[1]

        for key, value in self.ground_floor_names.items():

            self.outer_area[value[1]] = self._est_ground_floor_area

            for zone in self.thermal_zones:
                ground_floor = GroundFloor(zone)
                ground_floor.load_type_element(self.year_of_construction,
                                               self.construction_type)
                ground_floor.name = key
                ground_floor.tilt = value[0]
                ground_floor.orientation = value[1]

        for key, value in self.inner_wall_names.items():

            for zone in self.thermal_zones:
                inner_wall = InnerWall(zone)
                inner_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                inner_wall.name = key
                inner_wall.tilt = value[0]
                inner_wall.orientation = value[1]
                # zone.inner_walls.append(inner_wall)

        if self.number_of_floors > 1:

            for key, value in self.ceiling_names.items():

                for zone in self.thermal_zones:
                    ceiling = Ceiling(zone)
                    ceiling.load_type_element(self.year_of_construction,
                                              self.construction_type)
                    ceiling.name = key
                    ceiling.tilt = value[0]
                    ceiling.orientation = value[1]
                    # zone.inner_walls.append(ceiling)

            for key, value in self.floor_names.items():

                for zone in self.thermal_zones:
                    floor = Floor(zone)
                    floor.load_type_element(self.year_of_construction,
                                            self.construction_type)
                    floor.name = key
                    floor.tilt = value[0]
                    floor.orientation = value[1]
                    # zone.inner_walls.append(floor)
        else:
            pass

        for key, value in self.outer_area.items():
            self.set_outer_wall_area(value, key)
        for key, value in self.window_area.items():
            self.set_window_area(value, key)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #12
0
    def generate_from_gml(self):
        """enriches lod1 or lod2 data from citygml

        adds Zones, BoundaryConditions, Material settings for walls and
        windows to the geometric representation of CityGML

        number or height of floors need to be specified
        """

        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0
        # create zones with their corresponding area, name and usage
        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.area = type_bldg_area * value[0]
            zone.name = key
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1])
            zone.use_conditions = use_cond
            zone.use_conditions.with_ahu = False
            zone.use_conditions.persons *= zone.area * 0.01
            zone.use_conditions.machines *= zone.area * 0.01

            for surface in self.gml_surfaces:
                if surface.surface_tilt == 90:
                    outer_wall = OuterWall(zone)
                    outer_wall.load_type_element(self.year_of_construction,
                                                 self.construction_type)
                    outer_wall.name = surface.name
                    outer_wall.tilt = surface.surface_tilt
                    outer_wall.orientation = surface.surface_orientation

                    window = Window(zone)
                    window.load_type_element(self.year_of_construction,
                                            "Kunststofffenster, Isolierverglasung")
                    window.name = "asd"+str(surface.surface_tilt)
                    window.tilt = surface.surface_tilt
                    window.orientation = surface.surface_orientation

                elif surface.surface_tilt == 0 and surface.surface_orientation ==\
                        -2:
                    outer_wall = GroundFloor(zone)
                    outer_wall.load_type_element(self.year_of_construction,
                                                 self.construction_type)
                    outer_wall.name = surface.name
                    outer_wall.tilt = surface.surface_tilt
                    outer_wall.orientation = surface.surface_orientation

                else:
                    outer_wall = Rooftop(zone)
                    outer_wall.load_type_element(self.year_of_construction,
                                                 self.construction_type)
                    outer_wall.name = surface.name
                    outer_wall.tilt = surface.surface_tilt
                    outer_wall.orientation = surface.surface_orientation

            for key, value in self.inner_wall_names.items():

                for zone in self.thermal_zones:
                    inner_wall = InnerWall(zone)
                    inner_wall.load_type_element(self.year_of_construction,
                                                 self.construction_type)
                    inner_wall.name = key
                    inner_wall.tilt = value[0]
                    inner_wall.orientation = value[1]

            if self.number_of_floors > 1:

                for key, value in self.ceiling_names.items():

                    for zone in self.thermal_zones:
                        ceiling = Ceiling(zone)
                        ceiling.load_type_element(self.year_of_construction,
                                                  self.construction_type)
                        ceiling.name = key
                        ceiling.tilt = value[0]
                        ceiling.orientation = value[1]

                for key, value in self.floor_names.items():

                    for zone in self.thermal_zones:
                        floor = Floor(zone)
                        floor.load_type_element(self.year_of_construction,
                                                self.construction_type)
                        floor.name = key
                        floor.tilt = value[0]
                        floor.orientation = value[1]
            else:
                pass

        for surface in self.gml_surfaces:
            self.set_outer_wall_area(surface.surface_area *
                                     (1- self.est_factor_win_area),
                                     surface.surface_orientation)
        for surface in self.gml_surfaces:

            if surface.surface_tilt != 0 and surface.surface_orientation !=\
                    -2 and surface.surface_orientation != -1:
                self.set_window_area(surface.surface_area *
                                     self.est_factor_win_area,
                                     surface.surface_orientation)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #13
0
    def generate_archetype(self):
        '''Generates a residential building.

        With given values, this class generates a type residential
        building according to TEASER requirements
        Berechnungsgrundlagen: IWU, "Kurzverfahren Energieprofil"; 2005.

        '''
        #help area for the correct building area setting while using typeBldgs
        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0

        self._number_of_heated_floors = self._est_factor_heated_cellar + \
                    self.number_of_floors + self.est_living_area_factor\
                     *self._est_factor_heated_attic

        self._living_area_per_floor = type_bldg_area / \
                self._number_of_heated_floors

        self._est_ground_floor_area = self.est_bottom_building_closure * \
                    self._living_area_per_floor

        self._est_roof_area = self.est_upper_building_closure * \
                self._est_factor_dormer * self._est_area_per_floor * \
                self._living_area_per_floor

        self._top_floor_area = self._est_area_per_roof * \
                self._living_area_per_floor

        if self._est_roof_area == 0:
            self._est_roof_area = self._top_floor_area

        self._est_facade_area = self._est_facade_to_floor_area * \
                self._living_area_per_floor + self._est_extra_floor_area

        self._est_win_area = self.est_factor_win_area * type_bldg_area

        self._est_cellar_wall_area = self.est_factor_cellar_area * \
                self._est_factor_heated_cellar * self._est_facade_area

        self._est_outer_wall_area = (self._number_of_heated_floors * \
                self._est_facade_area) - self._est_cellar_wall_area - \
                self._est_win_area

        # self._est_factor_volume = type_bldg_area * 2.5

        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.name = key
            zone.area = type_bldg_area * value[0]
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1])

            zone.use_conditions = use_cond

        for key, value in self.outer_wall_names.items():
            # North and South

            if value[1] == 0 or value[1] == 180.0:
                self.outer_area[value[1]] = self._est_outer_wall_area / \
                        self.nr_of_orientation
            # East and West
            elif value[1] == 90 or value[1] == 270:

                self.outer_area[value[1]] = self._est_outer_wall_area / \
                        self.nr_of_orientation

            for zone in self.thermal_zones:
                # create wall and set building elements
                outer_wall = OuterWall(zone)
                outer_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                outer_wall.name = key
                outer_wall.tilt = value[0]
                outer_wall.orientation = value[1]

        for key, value in self.window_names.items():

            if value[1] == 0 or value[1] == 180:

                self.window_area[value[1]] = self._est_win_area / \
                        self.nr_of_orientation

            elif value[1] == 90 or value[1] == 270:

                self.window_area[value[1]] = self._est_win_area / \
                        self.nr_of_orientation

            '''
            There is no real classification for windows, so this is a bit hard
            code - will be fixed sometime
            '''
            for zone in self.thermal_zones:
                window = Window(zone)

                window.load_type_element(self.year_of_construction,
                                        "Kunststofffenster, Isolierverglasung")
                window.name = key
                window.tilt = value[0]
                window.orientation = value[1]

        for key, value in self.roof_names.items():

            self.outer_area[value[1]] = self._est_roof_area

            for zone in self.thermal_zones:
                roof = Rooftop(zone)
                roof.load_type_element(self.year_of_construction, \
                                       self.construction_type)
                roof.name = key
                roof.tilt = value[0]
                roof.orientation = value[1]

        for key, value in self.ground_floor_names.items():

            self.outer_area[value[1]] = self._est_ground_floor_area

            for zone in self.thermal_zones:
                ground_floor = GroundFloor(zone)
                ground_floor.load_type_element(self.year_of_construction, \
                                               self.construction_type)
                ground_floor.name = key
                ground_floor.tilt = value[0]
                ground_floor.orientation = value[1]

        for key, value in self.inner_wall_names.items():

            for zone in self.thermal_zones:
                inner_wall = InnerWall(zone)
                inner_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                inner_wall.name = key
                inner_wall.tilt = value[0]
                inner_wall.orientation = value[1]
                # zone.inner_walls.append(inner_wall)

        if self.number_of_floors > 1:

            for key, value in self.ceiling_names.items():

                for zone in self.thermal_zones:
                    ceiling = Ceiling(zone)
                    ceiling.load_type_element(self.year_of_construction,
                                              self.construction_type)
                    ceiling.name = key
                    ceiling.tilt = value[0]
                    ceiling.orientation = value[1]
                    # zone.inner_walls.append(ceiling)

            for key, value in self.floor_names.items():

                for zone in self.thermal_zones:
                    floor = Floor(zone)
                    floor.load_type_element(self.year_of_construction,
                                            self.construction_type)
                    floor.name = key
                    floor.tilt = value[0]
                    floor.orientation = value[1]
                    # zone.inner_walls.append(floor)
        else:
            pass

        for key, value in self.outer_area.items():
            self.set_outer_wall_area(value, key)
        for key, value in self.window_area.items():
            self.set_window_area(value, key)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #14
0
ファイル: office.py プロジェクト: RWTH-EBC/TEASER
    def generate_archetype(self):
        '''Generates an office building.

        With given values, this class generates a type building according to
        TEASER requirements.

        '''
        #help area for the correct building area setting while using typeBldgs
        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0
        # create zones with their corresponding area, name and usage
        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.area = type_bldg_area * value[0]
            zone.name = key
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1],
                                         data_class=self.parent.data)
            zone.use_conditions = use_cond

            zone.use_conditions.persons = zone.area * 0.01 * \
                zone.use_conditions.persons
            zone.use_conditions.machines = zone.area * 0.01 * \
                zone.use_conditions.machines

            # self.thermal_zones.append(zone)

        # statistical estimation of the facade

        self._est_outer_wall_area = self.est_factor_wall_area * \
                                type_bldg_area ** self.est_exponent_wall
        self._est_win_area = self.est_factor_win_area * \
                             type_bldg_area ** self.est_exponent_win
        self._est_roof_area = (type_bldg_area / self.number_of_floors) * \
                              self.gross_factor
        self._est_floor_area = (type_bldg_area / self.number_of_floors) * \
                               self.gross_factor

        # manipulation of wall according to facade design
        # (received from window_layout)

        self._est_facade_area = self._est_outer_wall_area + self._est_win_area

        if not self.window_layout == 0:
            self._est_outer_wall_area = self._est_facade_area * \
                                        self.corr_factor_wall
            self._est_win_area = self._est_facade_area * self.corr_factor_win
        else:
            pass

        # set the facade area to the four orientations

        for key, value in self.outer_wall_names.items():
            # North and South
            if value[1] == 0 or value[1] == 180:
                self.outer_area[value[1]] = self._est_outer_wall_area * \
                 (self._est_length / (2 * self._est_width + 2 * self._est_length))
            # East and West
            elif value[1] == 90 or value[1] == 270:

                self.outer_area[value[1]] = self._est_outer_wall_area * \
                (self._est_width / (2 * self._est_width + 2 * self._est_length))
            for zone in self.thermal_zones:
                # create wall and set building elements
                outer_wall = OuterWall(zone)
                outer_wall.load_type_element(
                    year=self.year_of_construction,
                    construction=self.construction_type,
                    data_class=self.parent.data)
                outer_wall.name = key
                outer_wall.tilt = value[0]
                outer_wall.orientation = value[1]

        for key, value in self.window_names.items():

            if value[1] == 0 or value[1] == 180:

                self.window_area[value[1]] = self._est_win_area * \
                (self._est_length / (2 * self._est_width + 2 * self._est_length))

            elif value[1] == 90 or value[1] == 270:

                self.window_area[value[1]] = self._est_win_area * \
                (self._est_width / (2 * self._est_width + 2 * self._est_length))

            '''
            There is no real classification for windows, so this is a bit hard
            code - will be fixed sometime.
            '''
            for zone in self.thermal_zones:
                window = Window(zone)
                window.load_type_element(self.year_of_construction,
                                        "Kunststofffenster, Isolierverglasung",
                                        data_class=self.parent.data)
                window.name = key
                window.tilt = value[0]
                window.orientation = value[1]

        for key, value in self.roof_names.items():

            self.outer_area[value[1]] = self._est_roof_area

            for zone in self.thermal_zones:
                roof = Rooftop(zone)
                roof.load_type_element(
                    year=self.year_of_construction,
                    construction=self.construction_type,
                    data_class=self.parent.data)
                roof.name = key
                roof.tilt = value[0]
                roof.orientation = value[1]
                # zone.outer_walls.append(roof)

        for key, value in self.ground_floor_names.items():

            self.outer_area[value[1]] = self._est_floor_area

            for zone in self.thermal_zones:
                ground_floor = GroundFloor(zone)
                ground_floor.load_type_element(
                    year=self.year_of_construction,
                    construction=self.construction_type,
                    data_class=self.parent.data)
                ground_floor.name = key
                ground_floor.tilt = value[0]
                ground_floor.orientation = value[1]
                # zone.outer_walls.append(ground_floor)

        for key, value in self.inner_wall_names.items():

            for zone in self.thermal_zones:
                inner_wall = InnerWall(zone)
                inner_wall.load_type_element(
                    year=self.year_of_construction,
                    construction=self.construction_type,
                    data_class=self.parent.data)
                inner_wall.name = key
                inner_wall.tilt = value[0]
                inner_wall.orientation = value[1]
                # zone.inner_walls.append(inner_wall)

        if self.number_of_floors > 1:

            for key, value in self.ceiling_names.items():

                for zone in self.thermal_zones:
                    ceiling = Ceiling(zone)
                    ceiling.load_type_element(
                        year=self.year_of_construction,
                        construction=self.construction_type,
                        data_class=self.parent.data)
                    ceiling.name = key
                    ceiling.tilt = value[0]
                    ceiling.orientation = value[1]
                    # zone.inner_walls.append(ceiling)

            for key, value in self.floor_names.items():

                for zone in self.thermal_zones:
                    floor = Floor(zone)
                    floor.load_type_element(
                        year=self.year_of_construction,
                        construction=self.construction_type,
                        data_class=self.parent.data)
                    floor.name = key
                    floor.tilt = value[0]
                    floor.orientation = value[1]
                    # zone.inner_walls.append(floor)
        else:
            pass

        for key, value in self.outer_area.items():
            self.set_outer_wall_area(value, key)
        for key, value in self.window_area.items():
            self.set_window_area(value, key)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()
コード例 #15
0
    def generate_archetype(self):
        """Generates a residential building.

        With given values, this class generates a type residential
        building according to TEASER requirements.

        """
        # help area for the correct building area setting while using typeBldgs
        type_bldg_area = self.net_leased_area
        self.net_leased_area = 0.0

        self._est_ground_floor_area = type_bldg_area / self.number_of_floors

        self._est_roof_area = type_bldg_area / self.number_of_floors

        self._est_win_area = self.est_factor_win_area * type_bldg_area * \
            (1 - self._est_factor_neighbour / 4)

        self._est_outer_wall_area = (self.est_factor_facade_to_volume *
                                     type_bldg_area *
                                     self.height_of_floors -
                                     self._est_ground_floor_area -
                                     self._est_roof_area -
                                     self._est_win_area) *\
            (1 - self._est_factor_neighbour / 4)

        for key, value in self.zone_area_factors.items():
            zone = ThermalZone(self)
            zone.name = key
            zone.area = type_bldg_area * value[0]
            use_cond = UseCond(zone)
            use_cond.load_use_conditions(value[1])

            zone.use_conditions = use_cond

        for key, value in self.outer_wall_names.items():
            # North and South

            if value[1] == 0 or value[1] == 180.0:
                self.outer_area[value[1]] = self._est_outer_wall_area / \
                                            self.nr_of_orientation
            # East and West
            elif value[1] == 90 or value[1] == 270:

                self.outer_area[value[1]] = self._est_outer_wall_area / \
                                            self.nr_of_orientation

            for zone in self.thermal_zones:
                # create wall and set building elements
                outer_wall = OuterWall(zone)
                outer_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                outer_wall.name = key
                outer_wall.tilt = value[0]
                outer_wall.orientation = value[1]

        for key, value in self.window_names.items():

            if value[1] == 0 or value[1] == 180:

                self.window_area[value[1]] = self._est_win_area / \
                                             self.nr_of_orientation

            elif value[1] == 90 or value[1] == 270:

                self.window_area[value[1]] = self._est_win_area / \
                                             self.nr_of_orientation
            '''
            There is no real classification for windows, so this is a bit hard
            code - will be fixed sometime
            '''
            for zone in self.thermal_zones:
                window = Window(zone)

                window.load_type_element(
                    self.year_of_construction,
                    "Kunststofffenster, Isolierverglasung")
                window.name = key
                window.tilt = value[0]
                window.orientation = value[1]

        for key, value in self.roof_names.items():

            self.outer_area[value[1]] = self._est_roof_area

            for zone in self.thermal_zones:
                roof = Rooftop(zone)
                roof.load_type_element(self.year_of_construction,
                                       self.construction_type)
                roof.name = key
                roof.tilt = value[0]
                roof.orientation = value[1]

        for key, value in self.ground_floor_names.items():

            self.outer_area[value[1]] = self._est_ground_floor_area

            for zone in self.thermal_zones:
                ground_floor = GroundFloor(zone)
                ground_floor.load_type_element(self.year_of_construction,
                                               self.construction_type)
                ground_floor.name = key
                ground_floor.tilt = value[0]
                ground_floor.orientation = value[1]

        for key, value in self.inner_wall_names.items():

            for zone in self.thermal_zones:
                inner_wall = InnerWall(zone)
                inner_wall.load_type_element(self.year_of_construction,
                                             self.construction_type)
                inner_wall.name = key
                inner_wall.tilt = value[0]
                inner_wall.orientation = value[1]
                # zone.inner_walls.append(inner_wall)

        if self.number_of_floors > 1:

            for key, value in self.ceiling_names.items():

                for zone in self.thermal_zones:
                    ceiling = Ceiling(zone)
                    ceiling.load_type_element(self.year_of_construction,
                                              self.construction_type)
                    ceiling.name = key
                    ceiling.tilt = value[0]
                    ceiling.orientation = value[1]
                    # zone.inner_walls.append(ceiling)

            for key, value in self.floor_names.items():

                for zone in self.thermal_zones:
                    floor = Floor(zone)
                    floor.load_type_element(self.year_of_construction,
                                            self.construction_type)
                    floor.name = key
                    floor.tilt = value[0]
                    floor.orientation = value[1]
                    # zone.inner_walls.append(floor)
        else:
            pass

        for key, value in self.outer_area.items():
            self.set_outer_wall_area(value, key)
        for key, value in self.window_area.items():
            self.set_window_area(value, key)

        for zone in self.thermal_zones:
            zone.set_inner_wall_area()
            zone.set_volume_zone()