Exemplo n.º 1
0
        public static HoneybeeSchema.Energy.IMaterial ToLadybugTools(this Core.IMaterial material, double thickness, bool windowMaterial = false)
        {
            if (material == null)
            {
                return(null);
            }

            if (windowMaterial && material is Core.GasMaterial)
            {
                if (material is Core.GasMaterial)
                {
                    return(ToLadybugTools_EnergyWindowMaterialGas((Core.GasMaterial)material, thickness));
                }

                if (material is Core.TransparentMaterial)
                {
                    return(ToLadybugTools((Core.TransparentMaterial)material, thickness));
                }
            }

            if (material is Core.GasMaterial)
            {
                return(ToLadybugTools((Core.GasMaterial)material));
            }

            if (material is Core.OpaqueMaterial)
            {
                return(ToLadybugTools((Core.OpaqueMaterial)material, thickness));
            }

            return(null);
        }
Exemplo n.º 2
0
        public static Core.MaterialLibrary ToSAM_MaterialLibrary(this TBD.Building building)
        {
            List <TBD.Construction> constructions = building?.Constructions();

            if (constructions == null)
            {
                return(null);
            }

            Core.MaterialLibrary result = new Core.MaterialLibrary(building.name);
            foreach (TBD.Construction construction in constructions)
            {
                if (construction == null)
                {
                    continue;
                }

                List <TBD.material> materials_TBD = construction.Materials();
                if (materials_TBD == null || materials_TBD.Count == 0)
                {
                    continue;
                }

                foreach (TBD.material material_TBD in materials_TBD)
                {
                    if (material_TBD == null)
                    {
                        continue;
                    }

                    if (result.GetMaterial(material_TBD.name) != null)
                    {
                        continue;
                    }

                    Core.IMaterial material = material_TBD.ToSAM();
                    if (material == null)
                    {
                        continue;
                    }

                    result.Add(material);
                }
            }

            return(result);
        }
Exemplo n.º 3
0
        public static Core.IMaterial ToSAM(this TBD.material material)
        {
            if (material == null)
            {
                return(null);
            }

            Core.IMaterial result = null;
            switch ((TBD.MaterialTypes)material.type)
            {
            case TBD.MaterialTypes.tcdGasLayer:
                result = Analytical.Create.GasMaterial(
                    material.name,
                    string.Empty,
                    material.name,
                    material.description,
                    material.width,
                    material.vapourDiffusionFactor,
                    double.NaN);
                break;

            case TBD.MaterialTypes.tcdOpaqueLayer:
                result = Analytical.Create.OpaqueMaterial(
                    material.name,
                    string.Empty,
                    material.name,
                    material.description,
                    material.conductivity,
                    material.specificHeat,
                    material.density,
                    material.width,
                    material.vapourDiffusionFactor,
                    material.externalSolarReflectance,
                    material.internalSolarReflectance,
                    material.externalLightReflectance,
                    material.externalLightReflectance,
                    material.externalEmissivity,
                    material.internalEmissivity,
                    false);
                break;

            case TBD.MaterialTypes.tcdOpaqueMaterial:
                result = Analytical.Create.OpaqueMaterial(
                    material.name,
                    string.Empty,
                    material.name,
                    material.description,
                    material.conductivity,
                    material.specificHeat,
                    material.density,
                    material.width,
                    material.vapourDiffusionFactor,
                    material.externalSolarReflectance,
                    material.internalSolarReflectance,
                    material.externalLightReflectance,
                    material.externalLightReflectance,
                    material.externalEmissivity,
                    material.internalEmissivity,
                    false);
                break;

            case TBD.MaterialTypes.tcdTransparentLayer:
                result = Analytical.Create.TransparentMaterial(
                    material.name,
                    string.Empty,
                    material.name,
                    material.description,
                    material.conductivity,
                    material.width,
                    material.vapourDiffusionFactor,
                    material.solarTransmittance,
                    material.lightTransmittance,
                    material.externalSolarReflectance,
                    material.internalSolarReflectance,
                    material.externalLightReflectance,
                    material.internalLightReflectance,
                    material.externalEmissivity,
                    material.internalEmissivity,
                    material.isBlind == 1);
                break;
            }


            return(result);
        }