Skip to content

Commit

Permalink
Refactor LCA Scope clean branch
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhoehn authored and Fraser Greenroyd committed Apr 15, 2020
1 parent f57a3ab commit 1365163
Show file tree
Hide file tree
Showing 74 changed files with 2,609 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@ public static double EvaluateEnvironmentalProductDeclarationPerObject(IBHoMObjec
}
else if (declaredUnitType == "Mass")
{
//double density = 0;
string epdDensity = environmentalProductDeclaration.Density != null ? environmentalProductDeclaration.Density.ToString() : "";
double density = System.Convert.ToDouble(epdDensity.Substring(0, epdDensity.IndexOf(" "))); //substring required to parse density string. This is temporary until IElementM is integrated.

if (System.Convert.ToDouble(density) != 0)

double density = environmentalProductDeclaration.Density;

if (density != 0 && density != double.NaN)
{
//density = density;
BH.Engine.Reflection.Compute.RecordNote(String.Format("This method is using a density of {0} supplied by the EnvironmentalProductDeclaration to calculate Mass.", density));
}
else if (obj.PropertyValue("Density") == null)
Expand All @@ -94,7 +92,7 @@ public static double EvaluateEnvironmentalProductDeclarationPerObject(IBHoMObjec
{
density = System.Convert.ToDouble(obj.PropertyValue("Density"));
}

double mass = density * volume;

return EvaluateEnvironmentalProductDeclarationByMass(environmentalProductDeclaration, environmentalProductDeclarationField, mass);
Expand All @@ -107,7 +105,7 @@ public static double EvaluateEnvironmentalProductDeclarationPerObject(IBHoMObjec
BH.Engine.Reflection.Compute.RecordError("The EnvironmentalProductDeclaration supplied uses an area based declared unit, so the input object requires an Area property.");
return 0;
}

double area = System.Convert.ToDouble(ar);
if (area <= 0)
{
Expand All @@ -133,7 +131,7 @@ public static double EvaluateEnvironmentalProductDeclarationPerObject(IBHoMObjec
[Description("This method calculates the quantity of a supplied metric per a supplied EPD and mass.")]
[Input("environmentalProductDeclaration", "This is a LifeCycleAssessment.EnvironmentalProductDeclaration with a mass-based declared unit. Please select your desired dataset and supply your material choice to the corresponding BHoM objects.")]
[Input("environmentalProductDeclarationField", "The metric to calculate total quantity for.")]
[Input("mass", "The total mass to calculate the total quantity of the input metric for.",typeof(Mass))]
[Input("mass", "The total mass to calculate the total quantity of the input metric for.", typeof(Mass))]
[Output("quantity", "The total quantity of the desired metric based on the EnvironmentalProductDeclarationField")]
public static double EvaluateEnvironmentalProductDeclarationByMass(IEnvironmentalProductDeclarationData environmentalProductDeclaration = null, EnvironmentalProductDeclarationField environmentalProductDeclarationField = EnvironmentalProductDeclarationField.GlobalWarmingPotential, double mass = 0) //default to globalWarmingPotential evaluation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static EnvironmentalProductDeclaration ToEnvironmentalProductDeclarationD
Description = obj.PropertyValue("Description")?.ToString() ?? "",
DeclaredUnit = obj.PropertyValue("DeclaredUnit")?.ToString() ?? "",
BiogenicEmbodiedCarbon = obj.PropertyValue("BiogenicEmbodiedCarbon") != null ? System.Convert.ToDouble(obj.PropertyValue("BiogenicEmbodiedCarbon")) : double.NaN,
Density = obj.PropertyValue("Density")?.ToString() ?? "",
Density = obj.PropertyValue("Density") != null ? System.Convert.ToDouble(obj.PropertyValue("Density")) : double.NaN,
EndOfLifeTreatment = obj.PropertyValue("EolTreatment")?.ToString() ?? "",
};
return epd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ public static SectorEnvironmentalProductDeclaration ToSectorEnvironmentalProduct
Description = obj.PropertyValue("Description")?.ToString() ?? "",
DeclaredUnit = obj.PropertyValue("DeclaredUnit")?.ToString() ?? "",
BiogenicEmbodiedCarbon = obj.PropertyValue("BiogenicEmbodiedCarbon") != null ? System.Convert.ToDouble(obj.PropertyValue("BiogenicEmbodiedCarbon")) : double.NaN,
Density = obj.PropertyValue("Density")?.ToString() ?? "",
Density = obj.PropertyValue("Density") != null ? System.Convert.ToDouble(obj.PropertyValue("Density")) : double.NaN,
EndOfLifeTreatment = obj.PropertyValue("EolTreatment")?.ToString() ?? "",
//Add publisher
//Add jurisdiction
};
return epd;
}
Expand Down
83 changes: 1 addition & 82 deletions LifeCycleAssessment_Engine/Create/LifeCycleAssessmentScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,68 +46,14 @@ public static partial class Create
[Input("zipCode", "Zip Code is the means of tracking the project's location")]
[Input("biogenicCarbon", "Biogenic Carbon is a true / false that indicates that the project contains materials that originated from a biological source(trees, soil), these materials have the ability sequester / store carbon.")]
[Input("additionalNotes", "Additional notes should convey project design constraints (eg design for seismic activity) that could affect the overall embodied carbon")]
[Input("structuresSlabs", "Structural slabs are inclusive of the above-grade structural floors in a building")]
[Input("structuresCoreWalls", "Structural core walls are inclusive of the above-grade, structural-grade walls surrounding the core (elevators, building services)")]
[Input("structuresBeams", "Structural beams are typically horizontal elements that carry the load of floors, roofs, and ceilings")]
[Input("structuresColumns", "Structural columns are typically vertical elements that carry the load of floors, roofs, and ceilings")]
[Input("enclosuresWalls", "Enclosure walls are inclusive of the opaque exterior wall assemblies of a building")]
[Input("enclosuresCurtainWalls", "Enclosure curtain walls are large sheets of transparent glazing on the building exterior")]
[Input("enclosuresWindows", "Enclosure windows are are openings in the building exterior, which consist of framing and glazing")]
[Input("enclosuresDoors", "Enclosure doors are are openings in the building exterior, which consist of framing and panels")]
[Input("foundationsFootings", "Foundation footings (or pile caps) are mats below the buildings piles that help to distribute the load from the structure above")]
[Input("foundationsPiles", "Foundation piles are structural supports that are driven into the ground below a building to support the building structure")]
[Input("foundationsWalls", "Foundation walls are structural walls built below-grade")]
[Input("foundationsSlabs", "Foundation slabs are structural slabs upon which the building is constructed. This category expects any type of slab, but assumes no construction properties.")]
[Input("mepEquipment", "MEP Equipment is a machine that processes mechanical, electrical or plumbing loads (eg Fan, Electrical Panel, Pump")]
[Input("mepDuctwork", "MEP Ductwork is a material (eg sheet metal) that helps to convey airflow from heating, ventilation or cooling systems")]
[Input("mepGenerators", "MEP Generators are devices that convert mechanical energy to electrical power")]
[Input("mepConduit", "MEP Conduit is a tube used to route electrical wiring")]
[Input("mepWiring", "MEP Wiring is a flexible conductor of electricity")]
[Input("mepLighting", "MEP Lighting is inclusive of all light fixtures")]
[Input("mepPiping", "MEP Piping is a material (eg copper) that helps to convey fluids (eg water, waste) within a building")]
[Input("mepBatteries", "MEP Batties are energy storage devices (eg photovoltaic panels)")]
[Input("tenantImprovementsCeiling", "Tenant Improvement Ceiling is a material that creates an additional upper interior surface in a room")]
[Input("tenantImprovementsFlooring", "Tenant Improvements Flooring is inclusive of the flooring materials placed on top of the structural floor (eg carpet, tile)")]
[Input("tenantImprovementsFinishes", "Tenant Improvements Finishes is inclusive of finishes (eg paint)")]
[Input("tenantImprovementsInteriorGlazing", "Tenant Improvements Interior Glazing is inclusive of windows in the interior of the building")]
[Input("tenantImprovementsFurniture", "Tenant Improvements Furniture includes furnishings (eg tables, chairs, desks)")]
[Input("tenantImprovementsInteriorDoors", "Tenant Improvements Interior Doors includes doors in the interior of the building")]
[Input("tenantImprovementsPartitionWalls", "Tenant Improvements Partition Walls includes walls in the interior of the building")]
[Output("lifeCycleAssessment", "A lifeCycleAssessment object for capturing and comparing additional studies. This object can be passed directly to a database for storage and further study.")]
public static LifeCycleAssessmentScope LifeCycleAssessmentScope(ProjectArea projectArea, ProjectType projectType, LevelOfDevelopment levelOfDevelopment, LifeCycleAssessmentPhases lifeCycleAssessmentPhases, PrimaryStructuralMaterial primaryStructuralMaterial,
string projectName = "",
string contactName = "",
double actualProjectArea = 0,
bool biogenicCarbon = false,
int zipCode = 00000,
string additionalNotes = "",
BHoMObject structuresSlabs = null,
BHoMObject structuresCoreWalls = null,
BHoMObject structuresBeams = null,
BHoMObject structuresColumns = null,
BHoMObject enclosuresWalls = null,
BHoMObject enclosuresCurtainWalls = null,
BHoMObject enclosuresWindows = null,
BHoMObject enclosuresDoors = null,
BHoMObject foundationsFootings = null,
BHoMObject foundationsPiles = null,
BHoMObject foundationsWalls = null,
BHoMObject foundationsSlabs = null,
BHoMObject mepEquipment = null,
BHoMObject mepDuctwork = null,
BHoMObject mepGenerators = null,
BHoMObject mepConduit = null,
BHoMObject mepWiring = null,
BHoMObject mepLighting = null,
BHoMObject mepPiping = null,
BHoMObject mepBatteries = null,
BHoMObject tenantImprovementsCeiling = null,
BHoMObject tenantImprovementsFlooring = null,
BHoMObject tenantImprovementsFinishes = null,
BHoMObject tenantImprovementsInteriorGlazing = null,
BHoMObject tenantImprovementsFurniture = null,
BHoMObject tenantImprovementsInteriorDoors = null,
BHoMObject tenantImprovementsPartitionWalls = null
string additionalNotes = ""
)
{
return new oM.LifeCycleAssessment.LifeCycleAssessmentScope
Expand All @@ -118,33 +64,6 @@ public static LifeCycleAssessmentScope LifeCycleAssessmentScope(ProjectArea proj
BiogenicCarbon = biogenicCarbon,
ZipCode = zipCode,
AdditionalNotes = additionalNotes,
StructuresSlabs = structuresSlabs,
StructuresCoreWalls = structuresCoreWalls,
StructuresBeams = structuresBeams,
StructuresColumns = structuresColumns,
EnclosuresCurtainWalls = enclosuresCurtainWalls,
EnclosuresWalls = enclosuresWalls,
EnclosuresWindows = enclosuresWindows,
EnclosuresDoors = enclosuresDoors,
FoundationsFootings = foundationsFootings,
FoundationsPiles = foundationsPiles,
FoundationsSlabs = foundationsSlabs,
FoundationsWalls = foundationsWalls,
MEPEquipment = mepEquipment,
MEPDuctwork = mepDuctwork,
MEPGenerators = mepGenerators,
MEPConduit = mepConduit,
MEPWiring = mepWiring,
MEPLighting = mepLighting,
MEPPiping = mepPiping,
MEPBatteries = mepBatteries,
TenantImprovementsCeiling = tenantImprovementsCeiling,
TenantImprovementsFlooring = tenantImprovementsFlooring,
TenantImprovementsFinishes = tenantImprovementsFinishes,
TenantImprovementsInteriorGlazing =tenantImprovementsInteriorGlazing,
TenantImprovementsFurniture = tenantImprovementsFurniture,
TenantImprovementsInteriorDoors = tenantImprovementsInteriorDoors,
TenantImprovementsPartitionWalls = tenantImprovementsPartitionWalls
};
}
}
Expand Down
41 changes: 41 additions & 0 deletions LifeCycleAssessment_oM/Elements/EnclosuresCurtainWalls.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2020, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System.Collections.Generic;
using System.ComponentModel;
using BH.oM.Base;
using BH.oM.Geometry;

namespace BH.oM.LifeCycleAssessment
{
[Description("The Life Cycle Assessment Scope object intends to provide a means of reporting all of the project criteria (name, area, type, location) as well as the objects that the study encompassed (structural slabs, foundation walls, etc) along with their properties for the Enviornmental Product Declarations they used (when using SetProperty), their densities and volumes. This object may be used for studies at any stage of development and can serve as a true means of 'apples to apples' comparison when catalogued.")]
public class EnclosuresCurtainWalls : BHoMObject
{
/***************************************************/
/**** Properties ****/
/***************************************************/
public virtual BoundaryRepresentation CurtainWalls { get; set; } = null;
public virtual IEnvironmentalProductDeclarationData Data { get; set; } = null;

/***************************************************/
}
}
41 changes: 41 additions & 0 deletions LifeCycleAssessment_oM/Elements/EnclosuresDoors.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2020, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
*
*
* The BHoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* The BHoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System.Collections.Generic;
using System.ComponentModel;
using BH.oM.Base;
using BH.oM.Geometry;

namespace BH.oM.LifeCycleAssessment
{
[Description("The Life Cycle Assessment Scope object intends to provide a means of reporting all of the project criteria (name, area, type, location) as well as the objects that the study encompassed (structural slabs, foundation walls, etc) along with their properties for the Enviornmental Product Declarations they used (when using SetProperty), their densities and volumes. This object may be used for studies at any stage of development and can serve as a true means of 'apples to apples' comparison when catalogued.")]
public class EnclosuresDoors : BHoMObject
{
/***************************************************/
/**** Properties ****/
/***************************************************/
public virtual BoundaryRepresentation Doors { get; set; } = null;
public virtual IEnvironmentalProductDeclarationData Data { get; set; } = null;

/***************************************************/
}
}
Loading

0 comments on commit 1365163

Please sign in to comment.