Esempio n. 1
0
        public static TSD.tsdSurfaceArray? ToTASSurfaceType(this BHR.ProfileResultType resultType)
        {
            switch (resultType)
            {
            case BHR.ProfileResultType.TemperatureResultant:      //= Internal temperature?
                return(TSD.tsdSurfaceArray.intTemp);

            case BHR.ProfileResultType.TemperatureExternal:
                return(TSD.tsdSurfaceArray.extTemp);

            case BHR.ProfileResultType.GainInternalSolar:
                return(TSD.tsdSurfaceArray.intSolarGain);

            case BHR.ProfileResultType.GainSolar:                   //= External Solar Gain?
                return(TSD.tsdSurfaceArray.extSolarGain);

            case BHR.ProfileResultType.ApertureFlowIn:
                return(TSD.tsdSurfaceArray.apertureFlowIn);

            case BHR.ProfileResultType.ApertureFlowOut:
                return(TSD.tsdSurfaceArray.apertureFlowOut);

            case BHR.ProfileResultType.CondensationInternal:
                return(TSD.tsdSurfaceArray.intCondensation);

            case BHR.ProfileResultType.CondensationExternal:
                return(TSD.tsdSurfaceArray.extCondensation);

            case BHR.ProfileResultType.ConductionInternal:
                return(TSD.tsdSurfaceArray.intConduction);

            case BHR.ProfileResultType.ConductionExternal:
                return(TSD.tsdSurfaceArray.extConduction);

            case BHR.ProfileResultType.ApertureOpening:
                return(TSD.tsdSurfaceArray.apertureOpening);

            case BHR.ProfileResultType.LongWaveInternal:
                return(TSD.tsdSurfaceArray.intLongWave);

            case BHR.ProfileResultType.LongWaveExternal:
                return(TSD.tsdSurfaceArray.extLongWave);

            case BHR.ProfileResultType.ConvectionInternal:
                return(TSD.tsdSurfaceArray.intConvection);

            case BHR.ProfileResultType.ConvectionExternal:
                return(TSD.tsdSurfaceArray.extConvection);

            case BHR.ProfileResultType.CondensationInterstitial:
                return(TSD.tsdSurfaceArray.interCondensation);

            default:
                return(null);
            }
        }
Esempio n. 2
0
        public static TSD.tsdBuildingArray? ToTASBuildingType(this BHR.ProfileResultType resultType)
        {
            switch (resultType)
            {
            case BHR.ProfileResultType.HumidityExternal:
                return(TSD.tsdBuildingArray.externalHumidity);

            case BHR.ProfileResultType.TemperatureExternal:
                return(TSD.tsdBuildingArray.externalTemperature);

            case BHR.ProfileResultType.RadiationGlobal:
                return(TSD.tsdBuildingArray.globalRadiation);

            case BHR.ProfileResultType.RadiationDiffuse:
                return(TSD.tsdBuildingArray.diffuseRadiation);

            case BHR.ProfileResultType.WindSpeed:
                return(TSD.tsdBuildingArray.windSpeed);

            case BHR.ProfileResultType.WindDirection:
                return(TSD.tsdBuildingArray.windDirection);

            case BHR.ProfileResultType.LoadHeating:
                return(TSD.tsdBuildingArray.heatingProfile);

            case BHR.ProfileResultType.LoadCooling:
                return(TSD.tsdBuildingArray.coolingProfile);

            case BHR.ProfileResultType.LoadLatentAddition:
                return(TSD.tsdBuildingArray.additionProfile);

            case BHR.ProfileResultType.LoadLatentRemoval:
                return(TSD.tsdBuildingArray.removalProfile);

            case BHR.ProfileResultType.CloudCover:
                return(TSD.tsdBuildingArray.cloudCover);

            default:
                return(null);
            }
        }
Esempio n. 3
0
        public static TSD.tsdZoneArray? ToTASSpaceType(this BHR.ProfileResultType resultType)
        {
            switch (resultType)
            {
            case BHR.ProfileResultType.TemperatureDryBulb:
                return(TSD.tsdZoneArray.dryBulbTemp);

            case BHR.ProfileResultType.TemperatureMeanRadiant:
                return(TSD.tsdZoneArray.MRTemp);

            case BHR.ProfileResultType.TemperatureResultant:
                return(TSD.tsdZoneArray.resultantTemp);

            case BHR.ProfileResultType.LoadSensible:
                return(TSD.tsdZoneArray.sensibleLoad);

            case BHR.ProfileResultType.LoadHeating:
                return(TSD.tsdZoneArray.heatingLoad);

            case BHR.ProfileResultType.LoadCooling:
                return(TSD.tsdZoneArray.coolingLoad);

            case BHR.ProfileResultType.GainSolar:
                return(TSD.tsdZoneArray.solarGain);

            case BHR.ProfileResultType.GainLighting:
                return(TSD.tsdZoneArray.lightingGain);

            case BHR.ProfileResultType.GainInfiltrationVentilation:
                return(TSD.tsdZoneArray.infVentGain);

            case BHR.ProfileResultType.GainAirMovement:
                return(TSD.tsdZoneArray.airMovementGain);

            case BHR.ProfileResultType.HeatTransferBuilding:
                return(TSD.tsdZoneArray.buildingHeatTransfer);

            case BHR.ProfileResultType.ConductionExternalOpaque:
                return(TSD.tsdZoneArray.externalConductionOpaque);

            case BHR.ProfileResultType.ConductionExternalGlazing:
                return(TSD.tsdZoneArray.externalConductionGlazing);

            case BHR.ProfileResultType.GainOccupantSensible:
                return(TSD.tsdZoneArray.occupantSensibleGain);

            case BHR.ProfileResultType.GainEquipmentSensible:
                return(TSD.tsdZoneArray.equipmentSensibleGain);

            case BHR.ProfileResultType.HumidityRatio:
                return(TSD.tsdZoneArray.humidityRatio);

            case BHR.ProfileResultType.HumidityRelative:
                return(TSD.tsdZoneArray.relativeHumidity);

            case BHR.ProfileResultType.GainOccupancyLatent:
                return(TSD.tsdZoneArray.occupancyLatentGain);

            case BHR.ProfileResultType.GainEquipmentLatent:
                return(TSD.tsdZoneArray.equipmentLatentGain);

            case BHR.ProfileResultType.LoadLatent:
                return(TSD.tsdZoneArray.latentLoad);

            case BHR.ProfileResultType.LoadLatentRemoval:
                return(TSD.tsdZoneArray.latentRemovalLoad);

            case BHR.ProfileResultType.LoadLatentAddition:
                return(TSD.tsdZoneArray.latentAdditionLoad);

            case BHR.ProfileResultType.PressureVapour:
                return(TSD.tsdZoneArray.vapourPressure);

            case BHR.ProfileResultType.Pollutant:
                return(TSD.tsdZoneArray.pollutant);

            case BHR.ProfileResultType.PressureRelative:
                return(TSD.tsdZoneArray.pressure);

            case BHR.ProfileResultType.Infiltration:
                return(TSD.tsdZoneArray.infiltration);

            case BHR.ProfileResultType.Ventilation:
                return(TSD.tsdZoneArray.ventilation);

            case BHR.ProfileResultType.ApertureFlowIn:              //-For zone ApertureFlowIn?
                return(TSD.tsdZoneArray.zoneApertureFlowIn);

            case BHR.ProfileResultType.ApertureFlowOut:             //-For zone ApertureFlowOut?
                return(TSD.tsdZoneArray.zoneApertureFlowOut);

            case BHR.ProfileResultType.IZAMIn:
                return(TSD.tsdZoneArray.izamIn);

            case BHR.ProfileResultType.IZAMOut:
                return(TSD.tsdZoneArray.izamOut);

            default:
                return(null);
            }
        }
Esempio n. 4
0
        public static BHR.SimulationResult FromTAS(this TSD.SurfaceData tsdData, BHR.ProfileResultUnit unitType, BHR.ProfileResultType resultType, int hour, int day)
        {
            TSD.tsdSurfaceArray?srfType = resultType.ToTASSurfaceType();
            if (srfType == null)
            {
                BH.Engine.Base.Compute.RecordError("That Result Type is not valid for Building Element results - please choose a different result type");
                return(null);
            }

            List <double> results = new List <double>();

            switch (unitType)
            {
            case BHR.ProfileResultUnit.Yearly:
                object yearRes = tsdData.GetAnnualSurfaceResult((int)srfType.Value);
                results = ToDoubleList(yearRes);
                break;

            case BHR.ProfileResultUnit.Daily:
                if (day < 1 || day > 365)
                {
                    BH.Engine.Base.Compute.RecordError("Please set a day between 1 and 365 inclusive");
                    return(null);
                }
                object dayRes = tsdData.GetDailySurfaceResult(day, (int)srfType.Value);
                results = ToDoubleList(dayRes);
                break;

            case BHR.ProfileResultUnit.Hourly:
                if (hour < 1 || hour > 24)
                {
                    BH.Engine.Base.Compute.RecordError("Please set an hour between 1 and 24 inclusive");
                    return(null);
                }
                results.Add(tsdData.GetHourlySurfaceResult(hour, (int)srfType.Value));
                break;

            default:
                BH.Engine.Base.Compute.RecordError("That unit type is not valid for pulling results from TAS TSD. Please select a different result unit type");
                return(null);
            }

            BHR.SimulationResult result = new BHR.SimulationResult();
            result.SimulationResultType = BHR.SimulationResultType.SpaceResult;
            result.SimulationResults.Add(new BHR.ProfileResult {
                Name = tsdData.BEName, Type = resultType, Unit = unitType, Results = results
            });

            return(result);
        }