public static string ToOSM(this BHM.Roughness roughness) { switch (roughness) { case BHM.Roughness.MediumRough: return("MediumRough"); case BHM.Roughness.MediumSmooth: return("MediumSmooth"); case BHM.Roughness.Rough: return("Rough"); case BHM.Roughness.Smooth: return("Smooth"); case BHM.Roughness.VeryRough: return("VeryRough"); case BHM.Roughness.VerySmooth: return("VerySmooth"); default: return(""); } }
public static BH.oM.Adapters.EnergyPlus.Roughness ToEnergyPlus(this BHM.Roughness roughness) { switch (roughness) { case BHM.Roughness.VerySmooth: return(BH.oM.Adapters.EnergyPlus.Roughness.VerySmooth); case BHM.Roughness.Smooth: return(BH.oM.Adapters.EnergyPlus.Roughness.Smooth); case BHM.Roughness.MediumSmooth: return(BH.oM.Adapters.EnergyPlus.Roughness.MediumSmooth); case BHM.Roughness.MediumRough: return(BH.oM.Adapters.EnergyPlus.Roughness.MediumRough); case BHM.Roughness.Rough: return(BH.oM.Adapters.EnergyPlus.Roughness.Rough); case BHM.Roughness.VeryRough: return(BH.oM.Adapters.EnergyPlus.Roughness.VeryRough); case BHM.Roughness.Undefined: return(BH.oM.Adapters.EnergyPlus.Roughness.MediumRough); default: return(BH.oM.Adapters.EnergyPlus.Roughness.MediumRough); } }
public static global::OpenStudio.OpaqueMaterial ToOSMOpaqueMaterial(this BHM.Material material, BHEM.Roughness roughness, double thickness, global::OpenStudio.Model modelReference) { BHEM.SolidMaterial matProp = material.Properties.Where(x => x.GetType() == typeof(BHEM.SolidMaterial)).FirstOrDefault() as BHEM.SolidMaterial; StandardOpaqueMaterial osmMaterial = new StandardOpaqueMaterial(modelReference); osmMaterial.setName(material.Name); osmMaterial.setRoughness(roughness.ToOSM()); osmMaterial.setThickness(thickness); if (matProp != null) { osmMaterial.setConductivity(matProp.Conductivity); osmMaterial.setDensity(matProp.Density); osmMaterial.setSpecificHeat(matProp.SpecificHeat); osmMaterial.setThermalAbsorptance(1 - matProp.EmissivityExternal); //ToDo Review for external and internal as appropriate at some point osmMaterial.setSolarAbsorptance(1 - matProp.SolarReflectanceExternal); //ToDo Review for external and internal as appropriate at some point osmMaterial.setVisibleAbsorptance(1 - matProp.LightReflectanceExternal); //ToDo Review for external and internal as appropriate at some point } return(osmMaterial); }