Break down the building component to three pluse one classes

This commit is contained in:
Alireza Adli 2024-07-18 14:16:00 -04:00
parent 0c0736bd9f
commit 98723af190
5 changed files with 89 additions and 34 deletions

View File

@ -1,6 +1,7 @@
"""
building_component module
Returns the summarize of envelope and energy systems
Returns the summarize of openings,
envelopes and energy systems material emissions
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2024 Concordia CERC group
Code contributors: Alireza Adli alireza.adli@concordia.ca
@ -9,43 +10,25 @@ Mohammad Reza Seyedabadi mohammad.seyedabadi@mail.concordia.ca
class BuildingComponent:
def __init__(
self, opening_material_emission, opening_surface,
envelope_material_emission, envelope_thickness, envelope_surface):
self._opening_material_emission = opening_material_emission
self._opening_surface = opening_surface
self._envelope_material_emission = envelope_material_emission
self._envelope_thickness = envelope_thickness
self._envelope_surface = envelope_surface
def __init__(self, opening_emission,
envelope_emission, energy_systems_material_emission=0):
self._opening_emission = opening_emission
self._envelope_emission = envelope_emission
self._energy_systems_material_emission = energy_systems_material_emission
@property
def opening_material_emission(self):
return self._opening_material_emission
@property
def opening_surface(self):
return self._opening_surface
@property
def envelope_material_emission(self):
return self._envelope_material_emission
@property
def envelope_thickness(self):
return self._envelope_thickness
@property
def envelope_surface(self):
return self._envelope_surface
def opening_emission(self):
return self._opening_material_emission * self._opening_surface
return self._opening_emission
@property
def envelope_emission(self):
return self._envelope_material_emission * \
self.envelope_thickness * \
self._envelope_surface
return self._envelope_emission
@property
def energy_systems_material_emission(self):
return self._energy_systems_material_emission
def component_emission(self):
return self.opening_emission() + self.envelope_emission()
return self._opening_emission + self._envelope_emission + \
self._energy_systems_material_emission

View File

@ -0,0 +1,13 @@
"""
energy_systems_material_emission module
Returns the summarize of emission of energy systems material.
The returned value will be used to calculate the building component emission.
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
"""
class EnergySystemsMaterialEmission:
pass

View File

@ -0,0 +1,34 @@
"""
envelope_emission module
Returns the summarize of envelope's surfaces emissions
The returned value will be used to calculate the building component emission.
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
"""
class EnvelopeEmission:
def __init__(self, envelope_material_emission,
envelope_thickness, envelope_surface):
self._envelope_material_emission = envelope_material_emission
self._envelope_thickness = envelope_thickness
self._envelope_surface = envelope_surface
@property
def envelope_material_emission(self):
return self._envelope_material_emission
@property
def envelope_thickness(self):
return self._envelope_thickness
@property
def envelope_surface(self):
return self._envelope_surface
def envelope_emission(self):
return self._envelope_material_emission * \
self.envelope_thickness * \
self._envelope_surface

View File

@ -0,0 +1,26 @@
"""
opening_emission module
Returns the summarize of all surfaces openings' emissions
The returned value will be used to calculate the building component emission.
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
"""
class OpeningEmission:
def __init__(self, opening_material_emission, opening_surface):
self._opening_material_emission = opening_material_emission
self._opening_surface = opening_surface
@property
def opening_material_emission(self):
return self._opening_material_emission
@property
def opening_surface(self):
return self._opening_surface
def opening_emission(self):
return self._opening_material_emission * self._opening_surface

View File

@ -51,4 +51,3 @@ class Vehicle:
def total_vehicle_emission(self):
""":return: float"""
return self._fuel_consumption_rate * self._carbon_emission_factor