""" EnergySystemsDimensioning enriches the city buildings energy systems with the parameters related to the systems dimensioning SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2023 Concordia CERC group Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca """ import copy import hub.helpers.constants as cte from hub.city_model_structure.energy_systems.energy_system import EnergySystem from hub.city_model_structure.energy_systems.generation_system import GenerationSystem from hub.city_model_structure.energy_systems.distribution_system import DistributionSystem from hub.city_model_structure.energy_systems.emission_system import EmissionSystem class EnergySystemsDimensioning: """ EnergySystemsDimensioning class """ def __init__(self, city): self._city = city def enrich(self): energy_systems_connection = self._city.energy_systems_connection_table for building in self._city.buildings: _building_energy_systems = [] energy_systems = energy_systems_connection['Energy System Type'] \ .where(energy_systems_connection['Building'] == building.name) for energy_system in energy_systems: _generic_building_energy_systems = self._city.generic_energy_systems[energy_system] for _generic_building_energy_system in _generic_building_energy_systems: _building_energy_equipment = EnergySystem() _building_energy_equipment.demand_types = _generic_building_energy_system.demand_types _building_distribution_system = DistributionSystem() _building_distribution_system.generic_distribution_system = \ copy.deepcopy(_generic_building_energy_system.distribution_system) _building_emission_system = EmissionSystem() _building_emission_system.generic_emission_system = \ copy.deepcopy(_generic_building_energy_system.emission_system) _building_generation_system = GenerationSystem() _building_generation_system.generic_generation_system = \ copy.deepcopy(_generic_building_energy_system.generation_system) if cte.HEATING in _building_energy_equipment.demand_types: _building_generation_system.heat_power = building.heating_peak_load[cte.YEAR]['heating peak loads'][0] if cte.COOLING in _building_energy_equipment.demand_types: _building_generation_system.cooling_power = building.cooling_peak_load[cte.YEAR]['cooling peak loads'][0] _building_energy_equipment.generation_system = _building_generation_system _building_energy_equipment.distribution_system = _building_distribution_system _building_energy_equipment.emission_system = _building_emission_system _building_energy_systems.append(_building_energy_equipment) building.energy_systems = _building_energy_systems