first version

This commit is contained in:
Pilar Monsalvete 2023-06-13 11:00:41 -04:00
parent 780e356989
commit 07dcffca87
4 changed files with 2830 additions and 0 deletions

View File

@ -1,2 +1,3 @@
# summerschool_building_simulation # summerschool_building_simulation
This project contains a workflow that takes geometry information from a geojson file and uses Hub to run Energy Plus and obtain the heating, cooling and dhw demands of the buildings.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,294 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": 12,
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-73.57945149010348,
45.49793915473101
],
[
-73.57945502047383,
45.497935600591106
],
[
-73.57945748913181,
45.49793681276347
],
[
-73.57945995778985,
45.49793802493576
],
[
-73.57946108986009,
45.49793688584562
],
[
-73.57946222064952,
45.49793574585649
],
[
-73.57946503164756,
45.497932909392325
],
[
-73.5794800321942,
45.497917804072586
],
[
-73.57949503273288,
45.49790269875081
],
[
-73.57950823165471,
45.49788939886833
],
[
-73.57952143057031,
45.497876098984314
],
[
-73.57952481016481,
45.49787269972034
],
[
-73.57952818975889,
45.49786930045622
],
[
-73.57963374256275,
45.49776298233438
],
[
-73.57963739684415,
45.497759299424665
],
[
-73.57956562282082,
45.49772405755894
],
[
-73.5795624921933,
45.497722521006246
],
[
-73.57955974509859,
45.4977252944393
],
[
-73.57953557695755,
45.497749634054365
],
[
-73.5795114087957,
45.497773973664174
],
[
-73.57945076790263,
45.49783505227953
],
[
-73.57939012687844,
45.49789613086214
],
[
-73.57938759058709,
45.49789868818189
],
[
-73.57938505429556,
45.49790124550157
],
[
-73.57941717242674,
45.49791701633786
],
[
-73.5794136407655,
45.497920563278754
],
[
-73.57943256542505,
45.497929854507255
],
[
-73.57944202776348,
45.49793450461953
],
[
-73.57945149010348,
45.49793915473101
]
]
]
},
"properties": {
"OBJECTID_12": 12,
"gml_id": 1340982,
"gml_parent": "fme-gen-5fa2a82b-c38e-4bf0-9e8f-10a47b9f64f7",
"citygml_ta": "http://www.opengis.net/citygml/building/2.0",
"citygml_fe": "cityObjectMember",
"citygml__1": " ",
"citygml__2": " ",
"gml_descri": " ",
"gml_name": " ",
"citygml_cr": " ",
"citygml_te": " ",
"externalRe": " ",
"external_1": " ",
"external_2": " ",
"citygml_ge": " ",
"citygml_re": " ",
"citygml__3": " ",
"citygml_ap": " ",
"citygml_cl": " ",
"citygml__4": " ",
"citygml_fu": " ",
"citygml__5": " ",
"citygml_us": " ",
"citygml__6": " ",
"citygml_ye": " ",
"citygml__7": " ",
"citygml_ro": " ",
"citygml__8": " ",
"citygml_me": 19.113,
"citygml__9": "#m",
"citygml_st": " ",
"citygml_10": " ",
"citygml_11": " ",
"citygml_12": " ",
"citygml_13": " ",
"citygml_14": " ",
"citygml_ou": " ",
"citygml_in": " ",
"citygml_bo": " ",
"citygml_le": " ",
"citygml_15": " ",
"citygml_co": " ",
"citygml_ad": " ",
"Volume": "2931.350",
"parcelle": " ",
"OBJECTID": 1056,
"gml_id_1": "384b2b1c-2e25-4f6a-b082-d272dba3453f",
"gml_pare_1": 1340982,
"citygml_16": "http://www.opengis.net/citygml/building/2.0",
"citygml_17": "boundedBy",
"citygml_18": " ",
"citygml_19": " ",
"gml_desc_1": " ",
"gml_name_1": " ",
"citygml_20": " ",
"citygml_21": " ",
"external_3": " ",
"external_4": " ",
"external_5": " ",
"citygml_22": " ",
"citygml_23": " ",
"citygml_24": " ",
"citygml_25": " ",
"citygml_26": " ",
"citygml_op": " ",
"Area": 191.404,
"FID_": 0,
"Join_Count": 2,
"TARGET_FID": 1058,
"gml_id_12": 1340982,
"gml_pare_2": "fme-gen-5fa2a82b-c38e-4bf0-9e8f-10a47b9f64f7",
"citygml_27": "http://www.opengis.net/citygml/building/2.0",
"citygml_28": "cityObjectMember",
"citygml_29": " ",
"citygml_30": " ",
"gml_desc_2": " ",
"gml_name_2": " ",
"citygml_31": " ",
"citygml_32": " ",
"external_6": " ",
"external_7": " ",
"external_8": " ",
"citygml_33": " ",
"citygml_34": " ",
"citygml_35": " ",
"citygml_36": " ",
"citygml_37": " ",
"citygml_38": " ",
"citygml_39": " ",
"citygml_40": " ",
"citygml_41": " ",
"citygml_42": " ",
"citygml_43": " ",
"citygml_44": " ",
"citygml_45": " ",
"citygml_46": " ",
"citygml_47": 19.113,
"citygml_48": "#m",
"citygml_49": " ",
"citygml_50": " ",
"citygml_51": " ",
"citygml_52": " ",
"citygml_53": " ",
"citygml_54": " ",
"citygml_55": " ",
"citygml_56": " ",
"citygml_57": " ",
"citygml_58": " ",
"citygml_59": " ",
"citygml_60": " ",
"citygml_61": " ",
"Volume_1": "2931.350",
"Field": 0,
"Field1": 0,
"OBJECTID_1": 1056,
"gml_id_12_": "384b2b1c-2e25-4f6a-b082-d272dba3453f",
"gml_pare_3": 1340982,
"citygml_62": "http://www.opengis.net/citygml/building/2.0",
"citygml_63": "boundedBy",
"citygml_64": " ",
"citygml_65": " ",
"gml_desc_3": " ",
"gml_name_3": " ",
"citygml_66": " ",
"citygml_67": " ",
"external_9": " ",
"externa_10": " ",
"externa_11": " ",
"citygml_68": " ",
"citygml_69": " ",
"citygml_70": " ",
"citygml_71": " ",
"citygml_72": " ",
"citygml_73": " ",
"Area_1": 191.404,
"cityGML_hi": 0,
"Z_Min": 46.1162,
"Z_Max": 64.399,
"Shape_Leng": 63.6906066955,
"ID_UEV": "01036804",
"CIVIQUE_DE": " 2170",
"CIVIQUE_FI": " 2170",
"NOM_RUE": "rue Bishop (MTL)",
"MUNICIPALI": 50,
"ETAGE_HORS": 3,
"NOMBRE_LOG": 1,
"ANNEE_CONS": 1900,
"CODE_UTILI": 6000,
"LIBELLE_UT": "Immeuble à bureaux",
"CATEGORIE_": "Régulier",
"MATRICULE8": "9839-57-7770-3-000-0000",
"SUPERFICIE": 259,
"SUPERFIC_1": 490,
"NO_ARROND_": "REM19",
"Shape_Le_1": 0.00093336765858,
"Shape_Ar_1": 3.0845126501e-8,
"Z_Min_1": null,
"Z_Max_1": null,
"Shape_Length": 63.69060669550123,
"Shape_Area": 174.69050030775531
}
}
]
}

62
main.py Normal file
View File

@ -0,0 +1,62 @@
import glob
import sys
import os
from pathlib import Path
from hub.imports.geometry_factory import GeometryFactory
from hub.imports.construction_factory import ConstructionFactory
from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory
from hub.exports.energy_building_exports_factory import EnergyBuildingsExportsFactory
from hub.helpers.dictionaries import Dictionaries
sys.path.append('./')
try:
file_path = (Path(__file__).parent / 'data' / 'summerschool_all_buildings.geojson')
out_path = (Path(__file__).parent / 'out_files')
files = glob.glob(f'{out_path}/*')
for file in files:
if file != '.gitignore':
os.remove(file)
print('[simulation start]')
city = GeometryFactory('geojson',
path=file_path,
height_field='citygml_me',
year_of_construction_field='ANNEE_CONS',
function_field='CODE_UTILI',
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
for building in city.buildings:
building.year_of_construction = 2022
print(f'city created from {file_path}')
ConstructionFactory('nrcan', city).enrich()
print('enrich constructions... done')
UsageFactory('nrcan', city).enrich()
print('enrich usage... done')
WeatherFactory('epw', city).enrich()
print('enrich weather... done')
for b in city.buildings:
print(b.name, b.function, b.year_of_construction, b.floor_area, b.storeys_above_ground)
print('exporting:')
_idf = EnergyBuildingsExportsFactory('idf', city, out_path).export()
print(' idf exported...')
_idf.run()
csv_file = str((out_path / f'{city.name}_out.csv').resolve())
eso_file = str((out_path / f'{city.name}_out.eso').resolve())
idf_file = str((out_path / f'{city.name}.idf').resolve())
print(f'info: {idf_file}, {csv_file}, {eso_file}')
print('[simulation end]')
except Exception as ex:
print(ex)
print('error: ', ex)
print('[simulation abort]')
sys.stdout.flush()