Adding materials and construction

This commit is contained in:
Soroush 2020-11-11 19:39:51 -05:00
parent 62e561824b
commit ad9b40be48
2 changed files with 29 additions and 1 deletions

View File

@ -9,3 +9,4 @@ time_scale = {
'month': 'month',
'year': 'year'
}
roughness="MediumRough"

View File

@ -7,7 +7,7 @@ from geomeppy import IDF
import os
import esoreader
from pathlib import Path
import helpers
class IdfHelper:
_THERMOSTAT = 'HVACTEMPLATE:THERMOSTAT'
@ -31,6 +31,33 @@ class IdfHelper:
self._idf = IDF(self._idf_file_path, self._epw_file_path)
self._idf.epw = self._epw_file_path
def add_material(self, layer):
materials = self._idf.newidfobject("MATERIAL".upper())
materials.Name = layer.material.name
materials.Roughness = helpers.roughness
materials.Thickness = layer.thickness
materials.Conductivity = layer.material.conductivity
materials.Density = layer.material.density
materials.Specific_Heat = layer.material.specific_heat
materials.Thermal_Absorptance = layer.material.thermal_absorptance
materials.Solar_Absorptance = layer.material.solar_absorptance
materials.Visible_Absorptance = layer.material.visible_absorptance
def add_construction(self, thermal_boundary):
for boundary in thermal_boundary:
for layer in boundary:
if len(layer) == 2:
self._idf.newidfobject("CONSTRUCTION", Name=boundary.construction_name,
Outside_Layer=layer[0].material.name, Layer_2=layer[1].material.name)
elif len(layer) == 3:
self._idf.newidfobject("CONSTRUCTION", Name=boundary.construction_name,
Outside_Layer=layer[0].material.name, Layer_2=layer[1].material.name, Layer_3=layer[2].material.name)
elif len(layer) == 4:
self._idf.newidfobject("CONSTRUCTION", Name=boundary.construction_name,
Outside_Layer=layer[0].material.name, Layer_2=layer[1].material.name, Layer_3=layer[2].material.name, Layer_4=layer[3].material.name)
else:
print("Could not find the true construction")
def add_heating_system(self, building):
for usage_zone in building.usage_zones:
thermostat_name = f'Thermostat {building.name}'