Compare commits

...

2 Commits

2 changed files with 301 additions and 0 deletions

131
hub_api/mockup/building.py Normal file
View File

@ -0,0 +1,131 @@
"""
Mockup Building module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from properties import *
class Building:
"""
Building class
"""
def __init__(self,
function,
volume,
area,
total_heating_area,
wall_area,
windows_area,
roof_area,
solar_collectors_area_reduction_factor,
heating_consumption,
cooling_consumption,
domestic_hot_water_consumption,
lighting_electrical_demand,
appliances_electrical_demand,
heating_peak_load,
cooling_peak_load,
onsite_electrical_production,
catalog_energy_systems):
self._function = function
self._area = area
self._volume = volume
self._total_heating_area = total_heating_area
self._wall_area = wall_area
self._windows_area = windows_area
self._roof_area = roof_area
self._solar_collectors_area_reduction_factor = solar_collectors_area_reduction_factor
self._heating_consumption = heating_consumption
self._cooling_consumption = cooling_consumption
self._domestic_hot_water_consumption = domestic_hot_water_consumption
self._lighting_electrical_demand = lighting_electrical_demand
self._appliances_electrical_demand = appliances_electrical_demand
self._heating_peak_load = heating_peak_load
self._cooling_peak_load = cooling_peak_load
self._onsite_electrical_production = onsite_electrical_production
self._catalog_energy_systems = catalog_energy_systems
@property
def function(self):
return self._function
@property
def volume(self):
return self._volume
@property
def thermal_zones(self):
ground = ThermalBoundary()
ground.type = 'Ground'
ground.opaque_area = self._area
roof = ThermalBoundary()
roof.type = 'Roof'
roof.opaque_area = self._roof_area
wall = ThermalBoundary()
wall.type = 'Wall'
wall.opaque_area = self._wall_area
wall.window_ratio = self._windows_area / (self._windows_area + self._wall_area)
thermal_zone = ThermalZone()
thermal_zone.total_floor_area = self._total_heating_area
thermal_zone.thermal_boundaries = [roof, wall, ground]
return [thermal_zone]
@property
def roofs(self):
polygon = Polygon()
polygon.area = self._roof_area
roof = Roof()
roof.solid_polygon = polygon
roof.solar_collectors_area_reduction_factor = self._solar_collectors_area_reduction_factor
return [roof]
@property
def heating_consumption(self):
return self._heating_consumption
@property
def cooling_consumption(self):
return self._cooling_consumption
@property
def domestic_hot_water_consumption(self):
return self._domestic_hot_water_consumption
@property
def lighting_electrical_demand(self):
return self._lighting_electrical_demand
@property
def appliances_electrical_demand(self):
return self._appliances_electrical_demand
@property
def heating_peak_load(self):
return self._heating_peak_load
@property
def cooling_peak_load(self):
return self._cooling_peak_load
@property
def onsite_electrical_production(self):
return self._onsite_electrical_production
@property
def energy_systems(self):
_energy_systems = []
for value in self._catalog_energy_systems:
demands = value[0]
fuel_type = value[1]
generic_generation_system = GenericGenerationSystem()
generic_generation_system.fuel_type = fuel_type
generation_system = GenerationSystem()
generation_system.generic_generation_system = generic_generation_system
energy_system = EnergySystem()
energy_system.generation_system = generation_system
energy_system.demand_types = demands
_energy_systems.append(energy_system)
return _energy_systems

View File

@ -0,0 +1,170 @@
"""
Properties module to be used by mockup building
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
class EnergySystem:
"""
EnergySystem class
"""
def __init__(self):
self._generation_system = None
self._demand_types = None
@property
def generation_system(self):
return self._generation_system
@generation_system.setter
def generation_system(self, value):
self._generation_system = value
@property
def demand_types(self):
return self._demand_types
@demand_types.setter
def demand_types(self, value):
self._demand_types = value
class GenerationSystem:
"""
GenerationSystem class
"""
def __init__(self):
self._generic_generation_system = None
@property
def generic_generation_system(self):
return self._generic_generation_system
@generic_generation_system.setter
def generic_generation_system(self, value):
self._generic_generation_system = value
class GenericGenerationSystem:
"""
GenericGenerationSystem class
"""
def __init__(self):
self._fuel_type = None
@property
def fuel_type(self):
return self._fuel_type
@fuel_type.setter
def fuel_type(self, value):
self._fuel_type = value
class ThermalZone:
"""
ThermalZone class
"""
def __init__(self):
self._thermal_boundaries = None
self._total_floor_area = None
@property
def thermal_boundaries(self):
return self._thermal_boundaries
@thermal_boundaries.setter
def thermal_boundaries(self, value):
self._thermal_boundaries = value
@property
def total_floor_area(self):
return self._total_floor_area
@total_floor_area.setter
def total_floor_area(self, value):
self._total_floor_area = value
class ThermalBoundary:
"""
ThermalBoundary class
"""
def __init__(self):
self._type = None
self._opaque_area = None
self._window_ratio = None
@property
def type(self):
return self._type
@type.setter
def type(self, value):
self._type = value
@property
def opaque_area(self):
return self._opaque_area
@opaque_area.setter
def opaque_area(self, value):
self._opaque_area = value
@property
def window_ratio(self):
return self._window_ratio
@window_ratio.setter
def window_ratio(self, value):
self._window_ratio = value
class Roof:
"""
Roof class
"""
def __init__(self):
self._solid_polygon = None
self._solar_collectors_area_reduction_factor = None
@property
def solid_polygon(self):
return self._solid_polygon
@solid_polygon.setter
def solid_polygon(self, value):
self._solid_polygon = value
@property
def solar_collectors_area_reduction_factor(self):
return self._solar_collectors_area_reduction_factor
@solar_collectors_area_reduction_factor.setter
def solar_collectors_area_reduction_factor(self, value):
self._solar_collectors_area_reduction_factor = value
class Polygon:
"""
Polygon class
"""
def __init__(self):
self._area = None
@property
def area(self):
return self._area
@area.setter
def area(self, value):
self._area = value