Changed the idf generator to incorporate zone lights and appliances calculation

This commit is contained in:
Oriol Gavalda 2023-12-05 10:43:45 -05:00
parent 35d5293956
commit 92100df406

View File

@ -10,11 +10,12 @@ from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory from hub.imports.weather_factory import WeatherFactory
from hub.exports.energy_building_exports_factory import EnergyBuildingsExportsFactory from hub.exports.energy_building_exports_factory import EnergyBuildingsExportsFactory
from hub.helpers.dictionaries import Dictionaries from hub.helpers.dictionaries import Dictionaries
from hub.imports.results_factory import ResultFactory
sys.path.append('./') sys.path.append('./')
try: try:
file_path = (Path(__file__).parent.parent / 'input_files' / 'selected_building.geojson') file_path = (Path(__file__).parent.parent / 'input_files' / 'selected_building_1724.geojson')
out_path = (Path(__file__).parent.parent / 'out_files') out_path = (Path(__file__).parent.parent / 'out_files')
files = glob.glob(f'{out_path}/*') files = glob.glob(f'{out_path}/*')
@ -45,8 +46,9 @@ try:
area += ground.perimeter_polygon.area area += ground.perimeter_polygon.area
print('exporting:') print('exporting:')
city.name = '1724'
_idf = EnergyBuildingsExportsFactory('idf', city, out_path).export() _idf = EnergyBuildingsExportsFactory('idf', city, out_path).export()
print(_idf)
print(' idf exported...') print(' idf exported...')
_idf.run() _idf.run()
@ -55,14 +57,17 @@ try:
idf_file = str((out_path / f'{city.name}.idf').resolve()) idf_file = str((out_path / f'{city.name}.idf').resolve())
obj_file = str((out_path / f'{city.name}.obj').resolve()) obj_file = str((out_path / f'{city.name}.obj').resolve())
with open((out_path / f'{city.name}_out.csv').resolve()) as f: """with open((out_path / f'{city.name}_out.csv').resolve()) as f:
reader = csv.reader(f, delimiter=',') reader = csv.reader(f, delimiter=',')
for row in reader: for row in reader:
if ':00:00' in row[0]: if ':00:00' in row[0]:
print(f'row: {row[0]}, {row[8]}, {row[9]}') print(f'row: {row[0]}, {row[8]}, {row[9]}')
print(f'info: {idf_file}, {csv_file}, {eso_file}, {area}, {volume}, {obj_file}') print(f'info: {idf_file}, {csv_file}, {eso_file}, {area}, {volume}, {obj_file}')
print('[simulation end]') print('[simulation end]')"""
"""ResultFactory('energy_plus_single_building', city, out_path).enrich()
print('kk')"""
except Exception as ex: except Exception as ex:
print(ex) print(ex)