public static double GetEvaluationValue(this IEnvironmentalProductDeclarationData epd, EnvironmentalProductDeclarationField field)
        {
            if (epd == null)
            {
                return(double.NaN);
            }

            switch (field)
            {
            case EnvironmentalProductDeclarationField.AcidificationPotential:
                return(epd.AcidificationPotential);

            case EnvironmentalProductDeclarationField.DepletionOfAbioticResourcesFossilFuels:
                return(epd.DepletionOfAbioticResourcesFossilFuels);

            case EnvironmentalProductDeclarationField.EutrophicationPotential:
                return(epd.EutrophicationPotential);

            case EnvironmentalProductDeclarationField.GlobalWarmingPotential:
                return(epd.GlobalWarmingPotential);

            case EnvironmentalProductDeclarationField.OzoneDepletionPotential:
                return(epd.OzoneDepletionPotential);

            case EnvironmentalProductDeclarationField.PhotochemicalOzoneCreationPotential:
                return(epd.PhotochemicalOzoneCreationPotential);

            default:
                return(double.NaN);
            }
        }
Exemple #2
0
 public static QuantityType GetFragmentQuantityType(this IEnvironmentalProductDeclarationData epd)
 {
     if (epd == null)
     {
         BH.Engine.Reflection.Compute.RecordError("The input object must have a Volume property for this method to work.");
     }
     return(epd.QuantityType);
 }
        /***************************************************/
        /**** Constructors                              ****/
        /***************************************************/

        public GlobalWarmingPotentialResult(IComparable objectId,
                                            IComparable resultCase,
                                            double timeStep,
                                            ObjectScope scope,
                                            ObjectCategory category,
                                            IEnvironmentalProductDeclarationData environmentalProductDeclaration,
                                            double globalWarmingPotential) : base(objectId, resultCase, timeStep, scope, category, environmentalProductDeclaration)
        {
            GlobalWarmingPotential = globalWarmingPotential;
        }
 public static string MaterialEndOfLifeTreatment(IEnvironmentalProductDeclarationData epd)
 {
     if (epd.EndOfLifeTreatment == null)
     {
         BH.Engine.Reflection.Compute.RecordError("The EPD does not contain any EndOfLife data.");
         return(null);
     }
     else
     {
         return(epd.EndOfLifeTreatment);
     }
 }
Exemple #5
0
        /***************************************************/
        /**** Constructors                              ****/
        /***************************************************/

        protected LifeCycleAssessmentElementResult(IComparable objectId,
                                                   IComparable resultCase,
                                                   double timeStep,
                                                   ObjectScope scope,
                                                   ObjectCategory category,
                                                   IEnvironmentalProductDeclarationData environmentalProductDeclaration)
        {
            ObjectId   = objectId;
            ResultCase = resultCase;
            TimeStep   = timeStep;
            Scope      = scope;
            Category   = category;
            EnvironmentalProductDeclaration = environmentalProductDeclaration;
        }
        public static double GetQuantityTypeValue(this IEnvironmentalProductDeclarationData epd)
        {
            if (epd == null)
            {
                BH.Engine.Reflection.Compute.RecordWarning("The Environmental Product Declaration QuantityTypeValue could not be assessed. Returning default value of 1.");
                return(1);
            }
            else
            {
                double qtv = epd.QuantityTypeValue;

                return(qtv);
            }
        }
        public static double GetFragmentDensity(this IEnvironmentalProductDeclarationData epd)
        {
            if (epd == null || epd.Density <= 0 || epd.Density == double.NaN)
            {
                BH.Engine.Reflection.Compute.RecordWarning("The Environmental Product Declaration Material Fragment does not contain a valid density.");
                return(0);
            }
            else
            {
                object density = 0.0;
                density = System.Convert.ToDouble(epd.PropertyValue("Density"));

                return(System.Convert.ToDouble(density));
            }
        }
Exemple #8
0
        public static double DepletionOfAbioticResources(IElementM elementM, IEnvironmentalProductDeclarationData epd)
        {
            QuantityType qt = epd.QuantityType;

            if (qt != QuantityType.Mass)
            {
                Reflection.Compute.RecordError("This method only works with Mass-based QuantityType EPDs. Please provide a different EPD.");
                return(double.NaN);
            }
            else
            {
                double volume  = elementM.ISolidVolume();
                double density = epd.Density;
                double depletionOfAbioticResources = System.Convert.ToDouble(epd.DepletionOfAbioticResources);

                if (volume <= 0 || volume == double.NaN)
                {
                    Reflection.Compute.RecordError("Volume cannot be calculated from object " + ((IBHoMObject)elementM).BHoM_Guid);
                    return(double.NaN);
                }

                if (density <= 0 || density == double.NaN)
                {
                    Reflection.Compute.RecordError("EPD does not contain a value for Density");
                    return(double.NaN);
                }

                if (depletionOfAbioticResources <= 0 || depletionOfAbioticResources == double.NaN)
                {
                    Reflection.Compute.RecordError("EPD does not contain a value for DepletionOfAbioticResources");
                    return(double.NaN);
                }

                return(volume * density * depletionOfAbioticResources);
            }
            /***************************************************/
        }
Exemple #9
0
        public static double EvaluateReferenceValue(double referenceValue, IEnvironmentalProductDeclarationData epd, EnvironmentalProductDeclarationField field)
        {
            if (epd == null)
            {
                BH.Engine.Reflection.Compute.RecordError("No EPD provided. Please provide a reference EPD.");
            }

            double epdValue = Query.GetEvaluationValue(epd, field);

            if (referenceValue <= 0)
            {
                BH.Engine.Reflection.Compute.RecordError("No evaluation value was found within the EPD. Please try another.");
            }

            double qtValue = epd.QuantityTypeValue;

            string qt = System.Convert.ToString(Query.GetFragmentQuantityType(epd));

            BH.Engine.Reflection.Compute.RecordNote($"Result is created by multiplying the ReferenceValue of {referenceValue} by the units of {qt} QuantityType extracted from " + epd.Name + " divided by {qtValue}.");

            double result = (referenceValue * epdValue) / qtValue;

            return(result);
        }