2024-07-15 15:06:44 -04:00
|
|
|
"""
|
2024-07-16 16:29:33 -04:00
|
|
|
lca_carbon_workflow module
|
2024-07-15 15:06:44 -04:00
|
|
|
Returns the summarize of envelope and energy systems
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2024 Concordia CERC group
|
|
|
|
Code contributors: Alireza Adli alireza.adli@concordia.ca
|
|
|
|
Mohammad Reza Seyedabadi mohammad.seyedabadi@mail.concordia.ca
|
|
|
|
"""
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
from hub.imports.geometry_factory import GeometryFactory
|
|
|
|
from hub.imports.construction_factory import ConstructionFactory
|
|
|
|
from hub.helpers.dictionaries import Dictionaries
|
|
|
|
|
|
|
|
|
|
|
|
class LCACarbonWorkflow:
|
2024-07-16 10:25:31 -04:00
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
city_path,
|
|
|
|
catalogue_path,
|
|
|
|
catalogue='nrcan',
|
|
|
|
building_parameters=('height', 'year_of_construction', 'function')):
|
|
|
|
self.file_path = (Path(__file__).parent / 'input_files' / city_path)
|
|
|
|
self.catalogue_path = (Path(__file__).parent / 'input_files' / catalogue_path)
|
|
|
|
self.out_path = (Path(__file__).parent / 'out_files')
|
|
|
|
self.handler = catalogue
|
|
|
|
self.height, self.year_of_construction, self.function = \
|
|
|
|
building_parameters
|
2024-07-15 15:06:44 -04:00
|
|
|
|
|
|
|
print('[simulation start]')
|
|
|
|
|
2024-07-16 10:25:31 -04:00
|
|
|
self.city = GeometryFactory(
|
|
|
|
'geojson',
|
|
|
|
path=self.file_path,
|
|
|
|
height_field=self.height,
|
|
|
|
year_of_construction_field=self.year_of_construction,
|
|
|
|
function_field=self.function,
|
|
|
|
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
|
|
|
|
print(f'city created from {self.file_path}')
|
|
|
|
ConstructionFactory(self.handler, self.city).enrich()
|
2024-07-15 15:06:44 -04:00
|
|
|
|
2024-07-16 16:29:33 -04:00
|
|
|
@staticmethod
|
|
|
|
def calculate_opening_emission(building):
|
|
|
|
surface_emission = []
|
|
|
|
for surface in building.surfaces:
|
|
|
|
if surface.window_ratio == 0:
|
|
|
|
opening_surface = 0
|
|
|
|
opening_material_emission = 0
|
|
|
|
else:
|
|
|
|
opening_surface = 0
|
|
|
|
opening_material_emission = 0
|
|
|
|
for opening in surface.associated_thermal_boundaries.thermal_openings:
|
|
|
|
opening_surface += opening.area
|
|
|
|
opening_material_emission =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# def calculate_emission(self):
|
|
|
|
# emitted_carbon = []
|
|
|
|
# for building in self.city.buildings:
|
|
|
|
# return len(building.surfaces)
|