workshop done

This commit is contained in:
Saeed Ranjbar 2024-07-16 12:47:05 -04:00
parent 938f15dd9b
commit 73a7a12a97
2 changed files with 133 additions and 1 deletions

99
input_files/test.geojson Normal file
View File

@ -0,0 +1,99 @@
{
"project": {
"country": "-",
"city": "Montreal, QC",
"latitude": 45.501899999999999,
"cad_coordinates": [
0.0,
0.0
],
"longitude": -73.567400000000006,
"time_zone": -5.0,
"elevation": 40.0
},
"type": "FeatureCollection",
"mappers": [],
"features": [
{
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-73.564605989280508,
45.497402815070672
],
[
-73.564605997519052,
45.497401799005075
],
[
-73.565175318297236,
45.497402810638292
],
[
-73.565175310058706,
45.497343470350891
],
[
-73.565174572793154,
45.497343470350891
],
[
-73.565174572793154,
45.497253770511335
],
[
-73.565175310058706,
45.497253770511335
],
[
-73.565372486332109,
45.497253758929254
],
[
-73.565371919253579,
45.497208766225164
],
[
-73.565371920284477,
45.497015574816565
],
[
-73.564555294128951,
45.497015276836557
],
[
-73.564555294128951,
45.497253755362053
],
[
-73.564605989280508,
45.497253770511335
],
[
-73.564605989280508,
45.497402815070672
]
]
]
},
"type": "Feature",
"id": "1691",
"properties": {
"footprint_area": 2416.2204562020706,
"floor_height": 3.9999999999999996,
"year_built": 2024,
"detailed_model_filename": "C:\\Users\\umroot\\Downloads\\Group 3\\hb_json\\Building_1691_e4a64903.json",
"type": "Building",
"building_type": "1000",
"number_of_stories": 8,
"name": "Building_1691",
"number_of_stories_above_ground": 8,
"floor_area": 19329.763649616565,
"maximum_roof_height": 31.999999999999996
}
}
]
}

35
main.py
View File

@ -5,9 +5,11 @@ from hub.helpers.dictionaries import Dictionaries
from hub.imports.construction_factory import ConstructionFactory
from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory
import hub.helpers.constants as cte
from hub.imports.energy_systems_factory import EnergySystemsFactory
# Specify the GeoJSON file path
input_files_path = (Path(__file__).parent / 'input_files')
geojson_file_path = input_files_path / 'Lachine_New_Developments.geojson'
geojson_file_path = input_files_path / 'test.geojson'
output_path = (Path(__file__).parent / 'out_files').resolve()
output_path.mkdir(parents=True, exist_ok=True)
# Create city object from GeoJSON file
@ -22,3 +24,34 @@ ConstructionFactory('nrcan', city).enrich()
UsageFactory('nrcan', city).enrich()
WeatherFactory('epw', city).enrich()
energy_plus_workflow(city)
for building in city.buildings:
print(building.heating_demand[cte.YEAR][0] / 3.6e6)
print(building.name)
total_floor_area = 0
for thermal_zone in building.thermal_zones_from_internal_zones:
total_floor_area += thermal_zone.total_floor_area
print(building.heating_demand[cte.YEAR][0] / (3.6e6 * total_floor_area))
building.energy_systems_archetype_name = 'system 1 gas'
print('test')
EnergySystemsFactory('montreal_custom', city).enrich()
print('test')
for building in city.buildings:
energy_systems = building.energy_systems
for energy_system in energy_systems:
generation_units = energy_system.generation_systems
if cte.HEATING in energy_system.demand_types:
for generation_unit in generation_units:
generation_unit.heat_efficiency = 0.96
# for building in city.buildings:
# building.function = cte.COMMERCIAL
#
# ConstructionFactory('nrcan', city).enrich()
# UsageFactory('nrcan', city).enrich()
# energy_plus_workflow(city)
# for building in city.buildings:
# print(building.heating_demand[cte.YEAR][0] / 3.6e6)
# print(building.name)
# total_floor_area = 0
# for thermal_zone in building.thermal_zones_from_internal_zones:
# total_floor_area += thermal_zone.total_floor_area
# print(building.heating_demand[cte.YEAR][0] / (3.6e6 * total_floor_area))