Example #1
0
        public static global::OpenStudio.ElectricEquipment ToOSMEquipmentGain(this BH.oM.Environment.SpaceCriteria.Equipment equipGain, global::OpenStudio.Model modelReference, global::OpenStudio.Space space)
        {
            // TODO: remove static instance below for input of profile object instead!
            global::OpenStudio.ScheduleConstant equipmentSchedule = ToOSMScheduleConstantsAlwaysOn(modelReference);

            ElectricEquipmentDefinition EquipmentDefinition = new ElectricEquipmentDefinition(modelReference);

            EquipmentDefinition.setDesignLevel(equipGain.Sensible);
            // TODO: Include additional methods to calculate equipment load here based on alternative metrics
            ElectricEquipment equipmentGain = new ElectricEquipment(EquipmentDefinition);

            equipmentGain.setSpace(space);
            equipmentGain.setSchedule(equipmentSchedule);
            return(equipmentGain);
        }
Example #2
0
        public static BHE.Equipment FromTAS(this TBD.Emitter tbdEmitter)
        {
            if (tbdEmitter == null)
            {
                return(null);
            }

            BHE.Equipment emitter = new BHE.Equipment();
            emitter.Name            = tbdEmitter.name;
            emitter.RadiantFraction = tbdEmitter.radiantProportion;


            TASDescription tasData = new TASDescription();

            tasData.Description = tbdEmitter.description.RemoveBrackets();
            emitter.Fragments.Add(tasData);

            return(emitter);
        }
Example #3
0
        public static TBD.Emitter ToTAS(this BHE.Equipment emitter, TBD.Emitter tbdEmitter)
        {
            //TODO:Gain list (Heating and Cooling factors) are not pushed. The View Coefficient, Radiant Proportion, Temperatures are pushed. Capacity Compensation is not pushed.

            if (emitter == null)
            {
                return(tbdEmitter);
            }

            tbdEmitter.name = emitter.Name;
            tbdEmitter.radiantProportion = (float)emitter.RadiantFraction;

            TASDescription tasFragment = emitter.FindFragment <TASDescription>(typeof(TASDescription));

            if (tasFragment != null)
            {
                tbdEmitter.description = tasFragment.Description;
            }

            return(tbdEmitter);
        }
Example #4
0
        public static List <BHE.IGain> FromTAS(this TBD.InternalGain tbdInternalGain)
        {
            if (tbdInternalGain == null)
            {
                return(null);
            }

            List <BHE.IGain> gains = new List <BHE.IGain>();

            TASInternalGainData tasData = new TASInternalGainData();

            tasData.ActivityID        = System.Convert.ToInt32(tbdInternalGain.activityID);
            tasData.DomesticHotWater  = System.Convert.ToDouble(tbdInternalGain.domesticHotWater);
            tasData.TargetIlluminance = System.Convert.ToDouble(tbdInternalGain.targetIlluminance);

            TASDescription tASDescription = new TASDescription();

            tASDescription.Description = tbdInternalGain.description.RemoveBrackets();

            //Lighting
            BHE.Lighting lightGain = new BHE.Lighting();
            lightGain.Name            = "L " + tbdInternalGain.name;
            lightGain.RadiantFraction = tbdInternalGain.lightingRadProp;

            TBD.profile tbdProfile = tbdInternalGain.GetProfile((int)TBD.Profiles.ticLG);
            BHE.Profile aProfile   = tbdProfile.FromTAS();
            lightGain.Profile = aProfile;
            lightGain.Fragments.Add(tasData);
            lightGain.Fragments.Add(tASDescription);
            gains.Add(lightGain);

            //Occupancy
            BHE.People occupantGain = new BHE.People();
            occupantGain.Name = "O " + tbdInternalGain.name;
            tbdProfile        = tbdInternalGain.GetProfile((int)TBD.Profiles.ticOSG);
            //curent limitation it works if we use hourly or yearl profile apprach with 0-1 values and factor as max
            occupantGain.Sensible = tbdProfile.factor;                                                         //Unit W/m2 sensible gain
            TBD.profile tbdProfileLat = tbdInternalGain.GetProfile((int)TBD.Profiles.ticOLG);
            occupantGain.Latent = tbdProfileLat.factor;                                                        //Unit W/m2 latent gain
            double aPeopleDesity = (occupantGain.Sensible + occupantGain.Latent) / tbdInternalGain.personGain; //Unit people/m2

            aProfile = tbdProfile.FromTAS();

            for (int i = 0; i < aProfile.HourlyValues.Count; i++)
            {
                aProfile.HourlyValues[i] = aProfile.HourlyValues[i] * aPeopleDesity;
            }

            occupantGain.RadiantFraction = tbdInternalGain.occupantRadProp;

            occupantGain.Profile = aProfile;
            occupantGain.Fragments.Add(tasData);
            occupantGain.Fragments.Add(tASDescription);
            gains.Add(occupantGain);

            //Equipment
            BHE.Equipment equipGain = new BHE.Equipment();
            equipGain.Name            = "Equipment " + tbdInternalGain.name;
            equipGain.RadiantFraction = tbdInternalGain.equipmentRadProp;

            tbdProfile        = tbdInternalGain.GetProfile((int)TBD.Profiles.ticESG);
            aProfile          = tbdProfile.FromTAS();
            equipGain.Profile = aProfile;

            equipGain.Fragments.Add(tasData);
            equipGain.Fragments.Add(tASDescription);
            gains.Add(equipGain);


            //Pollutant
            BHE.Pollutant pollGain = new BHE.Pollutant();
            pollGain.Name = "P " + tbdInternalGain.name;

            tbdProfile       = tbdInternalGain.GetProfile((int)TBD.Profiles.ticCOG);
            aProfile         = tbdProfile.FromTAS();
            pollGain.Profile = aProfile;

            pollGain.Fragments.Add(tasData);
            pollGain.Fragments.Add(tASDescription);
            gains.Add(pollGain);

            //Infiltration
            BHE.Infiltration infGain = new BHE.Infiltration();
            infGain.Name = "I " + tbdInternalGain.name;

            tbdProfile      = tbdInternalGain.GetProfile((int)TBD.Profiles.ticI);
            aProfile        = tbdProfile.FromTAS();
            infGain.Profile = aProfile;

            infGain.Fragments.Add(tasData);
            infGain.Fragments.Add(tASDescription);
            gains.Add(infGain);


            //tbdInternalGain.freshAirRate; //ToDo: Figure this one out later...

            return(gains);
        }