correct call in add zone

This commit is contained in:
Guille 2020-10-22 07:55:40 -04:00
parent 027bea5c2f
commit b306ecbd3b

View File

@ -9,42 +9,42 @@ from pathlib import Path
class IdfHelper: class IdfHelper:
def __init__(self, idf_file_path, idd_file_path, epw_file_path, eso_file_path):
self._idd_file_path = str(idd_file_path)
self._idf_file_path = str(idf_file_path)
self._epw_file_path = str(epw_file_path)
self._eso_file_path = str(eso_file_path)
IDF.setiddname(self._idd_file_path)
self._idf = IDF(self._idf_file_path)
self._idf.epw = epw_file_path
self._eso_file_path = str((Path.cwd() / 'eplusout.eso').resolve())
def add_zone(self, building_name):
IDF.newidfobject('ZONE', Name=building_name, Ceiling_Height='autocalculate', Volume='autocalculate',
Floor_Area='autocalculate', Part_of_Total_Floor_Area='yes',)
def add_surface(self, surface, building_name):
self._idf.newidfobject('BUILDINGSURFACE:DETAILED', Name=surface.name, Surface_Type=surface.type,
Zone_Name=building_name,)
# Why is this thing here?
# self.wall.setcoords(surface.points_list.toList())
def run(self, window_ratio=0.35): def __init__(self, idf_file_path, idd_file_path, epw_file_path, eso_file_path):
self._idf.set_default_constructions() self._idd_file_path = str(idd_file_path)
self._idf.intersect_match() self._idf_file_path = str(idf_file_path)
self._idf.set_wwr(window_ratio) self._epw_file_path = str(epw_file_path)
self._idf.translate_to_origin() self._eso_file_path = str(eso_file_path)
self._idf.view_model() IDF.setiddname(self._idd_file_path)
self._idf.newidfobject("HVACTEMPLATE:THERMOSTAT", Name="Zone Stat", Constant_Heating_Setpoint=20, self._idf = IDF(self._idf_file_path)
Constant_Cooling_Setpoint=24,) self._idf.epw = epw_file_path
for zone in self._idf.idfobjects["ZONE"]: self._eso_file_path = str((Path.cwd() / 'eplusout.eso').resolve())
self._idf.newidfobject("HVACTEMPLATE:ZONE:IDEALLOADSAIRSYSTEM", Zone_Name=zone.Name,
Template_Thermostat_Name='', Outdoor_Air_Method="DetailedSpecification",) def add_zone(self, building_name):
# Run self._idf.newidfobject(key='ZONE', Name=building_name, Ceiling_Height='autocalculate', Volume='autocalculate',
self._idf.run() Floor_Area='autocalculate', Part_of_Total_Floor_Area='yes', )
dd, data = esoreader.read(self._eso_file_path)
list_values = [v for v in data.values()] def add_surface(self, surface, building_name):
heating = [(float(x)) / 3600000.0 for x in list_values[0]] self._idf.newidfobject('BUILDINGSURFACE:DETAILED', Name=surface.name, Surface_Type=surface.type,
cooling = [(float(x)) / 3600000.0 for x in list_values[1]] Zone_Name=building_name, )
return heating, cooling # Why is this thing here?
# self.wall.setcoords(surface.points_list.toList())
def run(self, window_ratio=0.35):
self._idf.set_default_constructions()
self._idf.intersect_match()
self._idf.set_wwr(window_ratio)
self._idf.translate_to_origin()
self._idf.view_model()
self._idf.newidfobject("HVACTEMPLATE:THERMOSTAT", Name="Zone Stat", Constant_Heating_Setpoint=20,
Constant_Cooling_Setpoint=24, )
for zone in self._idf.idfobjects["ZONE"]:
self._idf.newidfobject("HVACTEMPLATE:ZONE:IDEALLOADSAIRSYSTEM", Zone_Name=zone.Name,
Template_Thermostat_Name='', Outdoor_Air_Method="DetailedSpecification", )
# Run
self._idf.run()
dd, data = esoreader.read(self._eso_file_path)
list_values = [v for v in data.values()]
heating = [(float(x)) / 3600000.0 for x in list_values[0]]
cooling = [(float(x)) / 3600000.0 for x in list_values[1]]
return heating, cooling