Skip to content

Commit

Permalink
Added Roof Vegatation to OpenStudio
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed May 6, 2017
1 parent 89d0b94 commit b4ecb37
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
51 changes: 50 additions & 1 deletion src/Honeybee_Export To OpenStudio.py
Expand Up @@ -69,7 +69,7 @@

ghenv.Component.Name = "Honeybee_Export To OpenStudio"
ghenv.Component.NickName = 'exportToOpenStudio'
ghenv.Component.Message = 'VER 0.0.61\nAPR_25_2017'
ghenv.Component.Message = 'VER 0.0.61\nMAY_06_2017'
ghenv.Component.IconDisplayMode = ghenv.Component.IconDisplayMode.application
ghenv.Component.Category = "Honeybee"
ghenv.Component.SubCategory = "10 | Energy | Energy"
Expand Down Expand Up @@ -2889,6 +2889,52 @@ def createOSNoMassMaterial(self, HBMaterialName, values, model):

return nomassMaterial

def createOSVegetationMaterial(self, HBMaterialName, values, model):
"""
Material:NoMass
['Height of Plants {m}', 'Leaf Area Index {dimensionless}', 'Leaf Reflectivity {dimensionless}', 'Leaf Emissivity', 'Minimum Stomatal Resistance {s/m}', 'Soil Layer Name', 'Roughness', 'Thickness {m}', 'Conductivity of Dry Soil {W/m-K}', 'Density of Dry Soil {kg/m3}', 'Specific Heat of Dry Soil {J/kg-K}', 'Thermal Absorptance', 'Solar Absorptance', 'Visible Absorptance', 'Saturation Volumetric Moisture Content of the Soil Layer', 'Residual Volumetric Moisture Content of the Soil Layer', 'Initial Volumetric Moisture Content of the Soil Layer', 'Moisture Diffusion Calculation Method']
"""
vegMaterial = ops.RoofVegetation(model)
vegMaterial.setName(HBMaterialName)

plantHeight = values[0]
lai = float(values[1])
lf = float(values[2])
le = float(values[3])
stomatalResis = float(values[4])
soilLayer = values[5]
roughness = values[6]
thickness = float(values[7])
conductivity = float(values[8])
density = float(values[9])
thermalAbsorptance = float(values[10])
solarAbsorptance = float(values[11])
visibleAbsorptance = float(values[12])
saturationVolumetricMoisture = float(values[13])
residualVolumetricMoisture = float(values[14])
initialVolumetricMoisture = float(values[15])
moistureDiffusionMethod = values[16]

vegMaterial.setString(2, plantHeight)
vegMaterial.setLeafAreaIndex(lai)
vegMaterial.setLeafReflectivity(lf)
vegMaterial.setLeafEmissivity(le)
vegMaterial.setMinimumStomatalResistance(stomatalResis)
vegMaterial.setSoilLayerName(soilLayer)
vegMaterial.setRoughness(roughness)
vegMaterial.setThickness(thickness)
vegMaterial.setConductivityofDrySoil(conductivity)
vegMaterial.setDensityofDrySoil(density)
vegMaterial.setThermalAbsorptance(thermalAbsorptance)
vegMaterial.setSolarAbsorptance(solarAbsorptance)
vegMaterial.setVisibleAbsorptance(visibleAbsorptance)
vegMaterial.setSaturationVolumetricMoistureContentoftheSoilLayer(saturationVolumetricMoisture)
vegMaterial.setResidualVolumetricMoistureContentoftheSoilLayer(residualVolumetricMoisture)
vegMaterial.setInitialVolumetricMoistureContentoftheSoilLayer(initialVolumetricMoisture)
vegMaterial.setMoistureDiffusionCalculationMethod(moistureDiffusionMethod)

return vegMaterial

def createOSWindowGasMaterial(self, HBMaterialName, values, model):
"""
WindowMaterial:Gas
Expand Down Expand Up @@ -3027,6 +3073,9 @@ def getOSMaterial(self, HBMaterialName, model):
elif values[0].lower() == "material:nomass":
return self.createOSNoMassMaterial(HBMaterialName, values[1:], model)

elif values[0].lower() == "material:roofvegetation":
return self.createOSVegetationMaterial(HBMaterialName, values[1:], model)

elif values[0].lower() == "material:airgap":
return self.createOSAirGap(HBMaterialName, values[1:], model)

Expand Down
9 changes: 7 additions & 2 deletions src/Honeybee_Honeybee.py
Expand Up @@ -47,7 +47,7 @@

ghenv.Component.Name = "Honeybee_Honeybee"
ghenv.Component.NickName = 'Honeybee'
ghenv.Component.Message = 'VER 0.0.61\nAPR_25_2017'
ghenv.Component.Message = 'VER 0.0.61\nMAY_06_2017'
ghenv.Component.IconDisplayMode = ghenv.Component.IconDisplayMode.icon
ghenv.Component.Category = "Honeybee"
ghenv.Component.SubCategory = "00 | Honeybee"
Expand Down Expand Up @@ -3625,12 +3625,17 @@ def calcEPMaterialUValue(self, materialObj, GHComponent = None):
elif materialType.lower() == "material:nomass":
# Material:NoMass is defined by R-Value and not U-Value
UValueSI = 1 / float(materialObj[2][0])

elif materialType.lower() == "material":
thickness = float(materialObj[2][0])
conductivity = float(materialObj[3][0])
UValueSI = conductivity/thickness

elif materialType.lower() == "material:roofvegetation":
thickness = float(materialObj[8][0])
conductivity = float(materialObj[9][0])
UValueSI = conductivity/thickness

elif materialType.lower() == "material:airgap":
UValueSI = 1 / float(materialObj[1][0])

Expand Down
Binary file modified userObjects/Honeybee_Export To OpenStudio.ghuser
Binary file not shown.
Binary file modified userObjects/Honeybee_Honeybee.ghuser
Binary file not shown.

0 comments on commit b4ecb37

Please sign in to comment.