Esempio n. 1
0
    def _internalmassconstruction(self):
        """Group internal walls into a ThermalMass object for this Zone"""

        oc = []
        for surface in self.zonesurfaces(exclude=["WINDOWSHADINGCONTROL"]):
            # for surf_type in self.idf.idd_index['ref2names'][
            # 'AllHeatTranSurfNames']:
            if surface.key.upper() == "INTERNALMASS":
                oc.append(OpaqueConstruction.from_epbunch(surface))
                self.InternalMassExposedPerFloorArea = (
                    float(surface.Surface_Area) / self.area
                )
        if not oc:
            # Todo: Create Equivalent InternalMassConstruction from
            #  partitions. For now, creating dummy InternalMass

            mat = self.idf.add_object(
                ep_object="Material".upper(),
                Name="Wood 6inch",
                Roughness="MediumSmooth",
                Thickness=0.15,
                Conductivity=0.12,
                Density=540,
                Specific_Heat=1210,
                Thermal_Absorptance=0.7,
                Visible_Absorptance=0.7,
            )

            cons = self.idf.add_object(
                ep_object="Construction".upper(),
                save=False,
                Name="InteriorFurnishings",
                Outside_Layer="Wood 6inch",
            )

            internal_mass = "{}_InternalMass".format(self.Name)
            cons.Name = internal_mass + "_construction"
            new_epbunch = self.idf.add_object(
                ep_object="InternalMass".upper(),
                save=False,
                Name=internal_mass,
                Construction_Name=cons.Name,
                Zone_or_ZoneList_Name=self.Name,
                Surface_Area=1,
            )

            oc.append(OpaqueConstruction.from_epbunch(new_epbunch, idf=self.idf))
            self.InternalMassExposedPerFloorArea = 0

        if self.InternalMassExposedPerFloorArea is None:
            self.InternalMassExposedPerFloorArea = 0

        from operator import add

        return functools.reduce(add, oc)
Esempio n. 2
0
 def _do_slab(surf):
     """
     Args:
         surf (EpBunch):
     """
     log(
         'surface "%s" assigned as a Slab' % surf.Name,
         lg.DEBUG,
         name=surf.theidf.name,
     )
     oc = OpaqueConstruction.from_epbunch(
         surf.theidf.getobject("Construction".upper(), surf.Construction_Name)
     )
     oc.area = surf.area
     oc.Surface_Type = "Slab"
     return oc
Esempio n. 3
0
 def _do_basement(surf):
     """
     Args:
         surf (EpBunch):
     """
     log(
         'surface "%s" ignored because basement facades are not supported'
         % surf.Name,
         lg.WARNING,
         name=surf.theidf.name,
     )
     oc = OpaqueConstruction.from_epbunch(
         surf.theidf.getobject("Construction".upper(), surf.Construction_Name)
     )
     oc.area = surf.area
     oc.Surface_Type = "Facade"
     return oc
Esempio n. 4
0
 def _do_partition(surf):
     """
     Args:
         surf (EpBunch):
     """
     the_construction = surf.theidf.getobject(
         "Construction".upper(), surf.Construction_Name
     )
     if the_construction:
         oc = OpaqueConstruction.from_epbunch(the_construction)
         oc.area = surf.area
         oc.Surface_Type = "Partition"
         log(
             'surface "%s" assigned as a Partition' % surf.Name,
             lg.DEBUG,
             name=surf.theidf.name,
         )
         return oc
     else:
         # we might be in a situation where the construction does not exist in the
         # file. For example, this can happen when the construction is defined as
         # "Air Wall", which is a construction type internal to EnergyPlus.
         return None
Esempio n. 5
0
    def from_zone(cls, zone):
        """
        Args:
            zone (Zone):
        """
        name = zone.Name + "_ZoneConstructionSet"
        # dispatch surfaces
        facade, ground, partition, roof, slab = [], [], [], [], []
        zonesurfaces = zone._zonesurfaces
        for surf in zonesurfaces:
            for disp_surf in surface_dispatcher(surf, zone):
                if disp_surf:
                    if disp_surf.Surface_Type == "Facade":
                        facade.append(disp_surf)
                    elif disp_surf.Surface_Type == "Ground":
                        ground.append(disp_surf)
                    elif disp_surf.Surface_Type == "Partition":
                        partition.append(disp_surf)
                    elif disp_surf.Surface_Type == "Roof":
                        roof.append(disp_surf)
                    elif disp_surf.Surface_Type == "Slab":
                        slab.append(disp_surf)
                    else:
                        msg = (
                            'Surface Type "{}" is not known, this method is not'
                            " implemented".format(disp_surf.Surface_Type)
                        )
                        raise NotImplementedError(msg)

        # Returning a set() for each groups of Constructions.

        facades = set(facade)
        if facades:
            facade = reduce(OpaqueConstruction.combine, facades)
        else:
            facade = OpaqueConstruction.generic(idf=zone.idf)
        grounds = set(ground)
        if grounds:
            ground = reduce(OpaqueConstruction.combine, grounds)
        else:
            ground = OpaqueConstruction.generic(idf=zone.idf)
        partitions = set(partition)
        if partitions:
            partition = reduce(OpaqueConstruction.combine, partitions)
        else:
            partition = OpaqueConstruction.generic(idf=zone.idf)
        roofs = set(roof)
        if roofs:
            roof = reduce(OpaqueConstruction.combine, roofs)
        else:
            roof = OpaqueConstruction.generic(idf=zone.idf)
        slabs = set(slab)
        if slabs:
            slab = reduce(OpaqueConstruction.combine, slabs)
        else:
            slab = OpaqueConstruction.generic(idf=zone.idf)

        z_set = cls(
            Facade=facade,
            Ground=ground,
            Partition=partition,
            Roof=roof,
            Slab=slab,
            Name=name,
            zone=zone,
            idf=zone.idf,
            Category=zone.idf.building_name(use_idfname=True),
        )
        return z_set