Compare commits

..

No commits in common. "3f649fd020324269ac8ba5002a6597110d56d43f" and "1a7ad201351b814a501f8b41022ce47a78a606b3" have entirely different histories.

27 changed files with 1303 additions and 563 deletions

View File

@ -8,6 +8,7 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
from typing import Union, List, TypeVar
#from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem
from hub.catalog_factories.data_models.energy_systems.energy_storage_system import EnergyStorageSystem
from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem

View File

@ -22,7 +22,7 @@ class PvGenerationSystem(GenerationSystem):
super().__init__(system_id=system_id, model_name=model_name,
manufacturer=manufacturer, fuel_type='renewable', distribution_systems=distribution_systems,
energy_storage_systems=energy_storage_systems)
self._system_type = 'PV system'
self._system_type = 'PV'
self._electricity_efficiency = electricity_efficiency
self._nominal_electricity_output = nominal_electricity_output
self._nominal_ambient_temperature = nominal_ambient_temperature

View File

@ -754,17 +754,19 @@ class Building(CityObject):
return None
for energy_system in self.energy_systems:
generation_systems = energy_system.generation_systems
print(generation_systems)
print(type(generation_systems))
for demand_type in energy_system.demand_types:
if demand_type.lower() == consumption_type.lower():
if consumption_type in (cte.HEATING, cte.DOMESTIC_HOT_WATER):
for generation_system in generation_systems:
coefficient_of_performance = generation_system.heat_efficiency
coefficient_of_performance = generation_system.generic_generation_system.heat_efficiency
elif consumption_type == cte.COOLING:
for generation_system in generation_systems:
coefficient_of_performance = generation_system.cooling_efficiency
coefficient_of_performance = generation_system.generic_generation_system.cooling_efficiency
elif consumption_type == cte.ELECTRICITY:
for generation_system in generation_systems:
coefficient_of_performance = generation_system.electricity_efficiency
coefficient_of_performance = generation_system.generic_generation_system.electricity_efficiency
if coefficient_of_performance == 0:
values = [0]*len(demand)
final_energy_consumed = values
@ -795,8 +797,8 @@ class Building(CityObject):
if self.energy_systems is None:
return self._onsite_electrical_production
for energy_system in self.energy_systems:
if energy_system.generation_systems[0].system_type == cte.PHOTOVOLTAIC:
_efficiency = energy_system.generation_systems[0].electricity_efficiency
if energy_system.generation_systems.generic_generation_system.type == cte.PHOTOVOLTAIC:
_efficiency = energy_system.generation_systems.generic_generation_system.electricity_efficiency
self._onsite_electrical_production = {}
for _key in self.roofs[0].global_irradiance.keys():
_results = [0 for _ in range(0, len(self.roofs[0].global_irradiance[_key]))]

View File

@ -62,6 +62,7 @@ class City:
self._level_of_detail = LevelOfDetail()
self._city_objects_dictionary = {}
self._city_objects_alias_dictionary = {}
self._energy_systems_connection_table = None
self._generic_energy_systems = None
def _get_location(self) -> Location:
@ -504,6 +505,24 @@ class City:
"""
return self._level_of_detail
@property
def energy_systems_connection_table(self) -> Union[None, DataFrame]:
"""
Get energy systems connection table which includes at least two columns: energy_system_type and associated_building
and may also include dimensioned_energy_system and connection_building_to_dimensioned_energy_system
:return: DataFrame
"""
return self._energy_systems_connection_table
@energy_systems_connection_table.setter
def energy_systems_connection_table(self, value):
"""
Set energy systems connection table which includes at least two columns: energy_system_type and associated_building
and may also include dimensioned_energy_system and connection_building_to_dimensioned_energy_system
:param value: DataFrame
"""
self._energy_systems_connection_table = value
@property
def generic_energy_systems(self) -> dict:
"""

View File

@ -5,12 +5,7 @@ Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import Union, List, TypeVar
from hub.city_model_structure.energy_systems.emission_system import EmissionSystem
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
GenerationSystem = TypeVar('GenerationSystem')
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
class DistributionSystem:
@ -18,158 +13,20 @@ class DistributionSystem:
DistributionSystem class
"""
def __init__(self):
self._model_name = None
self._type = None
self._supply_temperature = None
self._distribution_consumption_fix_flow = None
self._distribution_consumption_variable_flow = None
self._heat_losses = None
self._generation_systems = None
self._energy_storage_systems = None
self._emission_systems = None
self._generic_distribution_system = None
@property
def model_name(self):
def generic_distribution_system(self) -> GenericDistributionSystem:
"""
Get model name
:return: string
Get generic_distribution_system
:return: GenericDistributionSystem
"""
return self._model_name
return self._generic_distribution_system
@model_name.setter
def model_name(self, value):
@generic_distribution_system.setter
def generic_distribution_system(self, value):
"""
Set model name
:param value: string
Set associated generic_distribution_system
:param value: GenericDistributionSystem
"""
self._model_name = value
@property
def type(self):
"""
Get type from [air, water, refrigerant]
:return: string
"""
return self._type
@type.setter
def type(self, value):
"""
Set type from [air, water, refrigerant]
:param value: string
"""
self._type = value
@property
def supply_temperature(self):
"""
Get supply_temperature in degree Celsius
:return: float
"""
return self._supply_temperature
@supply_temperature.setter
def supply_temperature(self, value):
"""
Set supply_temperature in degree Celsius
:param value: float
"""
self._supply_temperature = value
@property
def distribution_consumption_fix_flow(self):
"""
Get distribution_consumption if the pump or fan work at fix mass or volume flow in ratio over peak power (W/W)
:return: float
"""
return self._distribution_consumption_fix_flow
@distribution_consumption_fix_flow.setter
def distribution_consumption_fix_flow(self, value):
"""
Set distribution_consumption if the pump or fan work at fix mass or volume flow in ratio over peak power (W/W)
:return: float
"""
self._distribution_consumption_fix_flow = value
@property
def distribution_consumption_variable_flow(self):
"""
Get distribution_consumption if the pump or fan work at variable mass or volume flow in ratio
over energy produced (J/J)
:return: float
"""
return self._distribution_consumption_variable_flow
@distribution_consumption_variable_flow.setter
def distribution_consumption_variable_flow(self, value):
"""
Set distribution_consumption if the pump or fan work at variable mass or volume flow in ratio
over energy produced (J/J)
:return: float
"""
self._distribution_consumption_variable_flow = value
@property
def heat_losses(self):
"""
Get heat_losses in ratio over energy produced
:return: float
"""
return self._heat_losses
@heat_losses.setter
def heat_losses(self, value):
"""
Set heat_losses in ratio over energy produced
:param value: float
"""
self._heat_losses = value
@property
def generation_systems(self) -> Union[None, List[GenerationSystem]]:
"""
Get generation systems connected to the distribution system
:return: [GenerationSystem]
"""
return self._generation_systems
@generation_systems.setter
def generation_systems(self, value):
"""
Set generation systems connected to the distribution system
:param value: [GenerationSystem]
"""
self._generation_systems = value
@property
def energy_storage_systems(self) -> Union[None, List[EnergyStorageSystem]]:
"""
Get energy storage systems connected to this distribution system
:return: [EnergyStorageSystem]
"""
return self._energy_storage_systems
@energy_storage_systems.setter
def energy_storage_systems(self, value):
"""
Set energy storage systems connected to this distribution system
:param value: [EnergyStorageSystem]
"""
self._energy_storage_systems = value
@property
def emission_systems(self) -> Union[None, List[EmissionSystem]]:
"""
Get energy emission systems connected to this distribution system
:return: [EmissionSystem]
"""
return self._emission_systems
@emission_systems.setter
def emission_systems(self, value):
"""
Set energy emission systems connected to this distribution system
:param value: [EmissionSystem]
"""
self._emission_systems = value
self._generic_distribution_system = value

View File

@ -1,32 +1,83 @@
"""
Electrical storage system
Energy System catalog heat generation system
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
from __future__ import annotations
from hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
class ElectricalStorageSystem(EnergyStorageSystem):
""""
Electrical Storage System Class
class ElectricalStorageSystem:
"""
Electrical Storage system class
"""
def __init__(self):
super().__init__()
self._model_name = None
self._manufacturer = None
self._generic_storage_system = None
self._rated_output_power = None
self._nominal_efficiency = None
self._battery_voltage = None
self._depth_of_discharge = None
self._self_discharge_rate = None
@property
def model_name(self):
"""
Get the model name
:return: string
"""
return self._model_name
@model_name.setter
def model_name(self, value):
"""
Set the model name
:return: string
"""
self._model_name = value
@property
def manufacturer(self):
"""
Get the manufacturer name
:return: string
"""
return self._manufacturer
@manufacturer.setter
def manufacturer(self, value):
"""
Set the manufacturer name
:return: string
"""
self._manufacturer = value
@property
def generic_storage_system(self) -> GenericStorageSystem:
"""
Get associated generic_storage_system
:return: GenericStorageSystem
"""
return self._generic_storage_system
@generic_storage_system.setter
def generic_storage_system(self, value):
"""
Set associated generic_storage_system
:param value: GenericStorageSystem
"""
self._generic_storage_system = value
@property
def rated_output_power(self):
"""
Get the rated output power of storage system in Watts
Get the rated output power in Watts
:return: float
"""
return self._rated_output_power
@ -34,15 +85,15 @@ class ElectricalStorageSystem(EnergyStorageSystem):
@rated_output_power.setter
def rated_output_power(self, value):
"""
Set the rated output power of storage system in Watts
:param value: float
Set the rated output power in Watts
:return: float
"""
self._rated_output_power = value
@property
def nominal_efficiency(self):
"""
Get the nominal efficiency of the storage system
Get the nominal efficiency
:return: float
"""
return self._nominal_efficiency
@ -50,8 +101,8 @@ class ElectricalStorageSystem(EnergyStorageSystem):
@nominal_efficiency.setter
def nominal_efficiency(self, value):
"""
Set the nominal efficiency of the storage system
:param value: float
Set the nominal efficiency
:return: float
"""
self._nominal_efficiency = value
@ -66,8 +117,8 @@ class ElectricalStorageSystem(EnergyStorageSystem):
@battery_voltage.setter
def battery_voltage(self, value):
"""
Set the battery voltage in Volts
:param value: float
Get the battery voltage in Volts
:return: float
"""
self._battery_voltage = value
@ -83,7 +134,7 @@ class ElectricalStorageSystem(EnergyStorageSystem):
def depth_of_discharge(self, value):
"""
Set the depth of discharge as a percentage
:param value: float
:return: float
"""
self._depth_of_discharge = value
@ -98,7 +149,7 @@ class ElectricalStorageSystem(EnergyStorageSystem):
@self_discharge_rate.setter
def self_discharge_rate(self, value):
"""
Set the self discharge rate of battery as a percentage
:param value: float
Get the self discharge rate of battery as a percentage
:return: float
"""
self._self_discharge_rate = value

View File

@ -1,64 +1,32 @@
"""
Emission system module
Energy emission system definition
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 hub.city_model_structure.energy_systems.generic_emission_system import GenericEmissionSystem
class EmissionSystem:
"""
EmissionSystem class
"""
def __init__(self):
self._model_name = None
self._type = None
self._parasitic_energy_consumption = None
self._generic_emission_system = None
@property
def model_name(self):
def generic_emission_system(self) -> GenericEmissionSystem:
"""
Get model name
:return: string
Get associated generic_emission_system
:return: GenericEmissionSystem
"""
return self._model_name
return self._generic_emission_system
@model_name.setter
def model_name(self, value):
@generic_emission_system.setter
def generic_emission_system(self, value):
"""
Set model name
:param value: string
Set associated
:param value: GenericEmissionSystem
"""
self._model_name = value
@property
def type(self):
"""
Get type
:return: string
"""
return self._type
@type.setter
def type(self, value):
"""
Set type
:param value: string
"""
self._type = value
@property
def parasitic_energy_consumption(self):
"""
Get parasitic_energy_consumption in ratio (W/W)
:return: float
"""
return self._parasitic_energy_consumption
@parasitic_energy_consumption.setter
def parasitic_energy_consumption(self, value):
"""
Set parasitic_energy_consumption in ratio (W/W)
:param value: float
"""
self._parasitic_energy_consumption = value
self._generic_emission_system = value

View File

@ -6,11 +6,13 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import Union, List
from pathlib import Path
from hub.city_model_structure.energy_systems.distribution_system import DistributionSystem
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
from hub.city_model_structure.energy_systems.control_system import ControlSystem
from hub.city_model_structure.energy_systems.thermal_storage_system import ThermalStorageSystem
from hub.city_model_structure.energy_systems.electrical_storage_system import ElectricalStorageSystem
from hub.city_model_structure.city_object import CityObject
@ -19,29 +21,14 @@ class EnergySystem:
EnergySystem class
"""
def __init__(self):
self._demand_types = None
self._name = None
self._demand_types = None
self._generation_systems = None
self._distribution_systems = None
self._configuration_schema = None
self._emission_systems = None
self._connected_city_objects = None
self._control_system = None
@property
def demand_types(self):
"""
Get demand able to cover from [Heating, Cooling, Domestic Hot Water, Electricity]
:return: [string]
"""
return self._demand_types
@demand_types.setter
def demand_types(self, value):
"""
Set demand able to cover from [Heating, Cooling, Domestic Hot Water, Electricity]
:param value: [string]
"""
self._demand_types = value
self._energy_storage_systems = None
@property
def name(self):
@ -59,59 +46,75 @@ class EnergySystem:
"""
self._name = value
@property
def demand_types(self):
"""
Get demand able to cover from [Heating, Cooling, Domestic Hot Water, Electricity]
:return: [string]
"""
return self._demand_types
@demand_types.setter
def demand_types(self, value):
"""
Set demand able to cover from [Heating, Cooling, Domestic Hot Water, Electricity]
:param value: [string]
"""
self._demand_types = value
@property
def generation_systems(self) -> List[GenerationSystem]:
"""
Get generation systems
:return: [GenerationSystem]
:return: GenerationSystem
"""
return self._generation_systems
@generation_systems.setter
def generation_systems(self, value):
"""
Set generation systems
:return: [GenerationSystem]
Set generation system
:param value: GenerationSystem
"""
self._generation_systems = value
@property
def distribution_systems(self) -> Union[None, List[DistributionSystem]]:
"""
Get distribution systems
:return: [DistributionSystem]
Get distribution system
:return: DistributionSystem
"""
return self._distribution_systems
@distribution_systems.setter
def distribution_systems(self, value):
"""
Set distribution systems
:param value: [DistributionSystem]
Set distribution system
:param value: DistributionSystem
"""
self._distribution_systems = value
@property
def configuration_schema(self) -> Path:
def emission_systems(self) -> Union[None, List[EmissionSystem]]:
"""
Get the schema of the system configuration
:return: Path
Get emission system
:return: EmissionSystem
"""
return self._configuration_schema
return self._emission_systems
@configuration_schema.setter
def configuration_schema(self, value):
@emission_systems.setter
def emission_systems(self, value):
"""
Set the schema of the system configuration
:param value: Path
Set emission system
:param value: EmissionSystem
"""
self._configuration_schema = value
self._emission_systems = value
@property
def connected_city_objects(self) -> Union[None, List[CityObject]]:
"""
Get list of city objects that are connected to this energy system
:return: [CityObject]
:return: List[CityObject]
"""
return self._connected_city_objects
@ -119,7 +122,7 @@ class EnergySystem:
def connected_city_objects(self, value):
"""
Set list of city objects that are connected to this energy system
:param value: [CityObject]
:param value: List[CityObject]
"""
self._connected_city_objects = value
@ -138,3 +141,19 @@ class EnergySystem:
:param value: ControlSystem
"""
self._control_system = value
@property
def energy_storage_systems(self) -> Union[None, List[ThermalStorageSystem], List[ElectricalStorageSystem]]:
"""
Get energy storage systems
:return: [EnergyStorageSystem]
"""
return self._energy_storage_systems
@energy_storage_systems.setter
def energy_storage_systems(self, value):
"""
Set storage system
:param value: [EnergyStorageSystem]
"""
self._energy_storage_systems = value

View File

@ -1,51 +1,135 @@
"""
Energy generation system (abstract class)
Energy generation system definition
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
"""
from __future__ import annotations
from abc import ABC
from typing import Union, List
from typing import Union
from hub.city_model_structure.energy_systems.distribution_system import DistributionSystem
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
class GenerationSystem(ABC):
class GenerationSystem:
"""
GenerationSystem class
"""
def __init__(self):
self._system_type = None
self._heat_power = None
self._cooling_power = None
self._electricity_power = None
self._storage_capacity = None
self._generic_generation_system = None
self._auxiliary_equipment = None
self._model_name = None
self._manufacturer = None
self._fuel_type = None
self._distribution_systems = None
self._energy_storage_systems = None
self._maximum_heat_output = None
self._minimum_heat_output = None
self._maximum_cooling_output = None
self._minimum_cooling_output = None
@property
def system_type(self):
def generic_generation_system(self) -> GenericGenerationSystem:
"""
Get type
:return: string
Get associated generic_generation_system
:return: GenericGenerationSystem
"""
return self._system_type
return self._generic_generation_system
@system_type.setter
def system_type(self, value):
@generic_generation_system.setter
def generic_generation_system(self, value):
"""
Set type
:param value: string
Set associated generic_generation_system
:param value: GenericGenerationSystem
"""
self._system_type = value
self._generic_generation_system = value
@property
def heat_power(self):
"""
Get heat_power in W
:return: float
"""
return self._heat_power
@heat_power.setter
def heat_power(self, value):
"""
Set heat_power in W
:param value: float
"""
self._heat_power = value
@property
def cooling_power(self):
"""
Get cooling_power in W
:return: float
"""
return self._cooling_power
@cooling_power.setter
def cooling_power(self, value):
"""
Set cooling_power in W
:param value: float
"""
self._cooling_power = value
@property
def electricity_power(self):
"""
Get electricity_power in W
:return: float
"""
return self._electricity_power
@electricity_power.setter
def electricity_power(self, value):
"""
Set electricity_power in W
:param value: float
"""
self._electricity_power = value
@property
def storage_capacity(self):
"""
Get storage_capacity in J
:return: float
"""
return self._storage_capacity
@storage_capacity.setter
def storage_capacity(self, value):
"""
Set storage_capacity in J
:param value: float
"""
self._storage_capacity = value
@property
def auxiliary_equipment(self) -> Union[None, GenerationSystem]:
"""
Get auxiliary_equipment
:return: GenerationSystem
"""
return self._auxiliary_equipment
@auxiliary_equipment.setter
def auxiliary_equipment(self, value):
"""
Set auxiliary_equipment
:param value: GenerationSystem
"""
self._auxiliary_equipment = value
@property
def model_name(self):
"""
Get model name
Get the model name
:return: string
"""
return self._model_name
@ -53,15 +137,15 @@ class GenerationSystem(ABC):
@model_name.setter
def model_name(self, value):
"""
Set model name
:param value: string
Set the model name
:return: string
"""
self._model_name = value
@property
def manufacturer(self):
"""
Get manufacturer's name
Get the manufacturer name
:return: string
"""
return self._manufacturer
@ -69,55 +153,72 @@ class GenerationSystem(ABC):
@manufacturer.setter
def manufacturer(self, value):
"""
Set manufacturer's name
:param value: string
Set the manufacturer name
:return: string
"""
self._manufacturer = value
@property
def fuel_type(self):
def maximum_heat_output(self):
"""
Get fuel_type from [Renewable, Gas, Diesel, Electricity, Wood, Coal]
:return: string
Get maximum heat output in W
:return: float
"""
return self._fuel_type
return self._maximum_heat_output
@fuel_type.setter
def fuel_type(self, value):
@maximum_heat_output.setter
def maximum_heat_output(self, value):
"""
Set fuel_type from [Renewable, Gas, Diesel, Electricity, Wood, Coal]
:param value: string
Set maximum heat output in W
:return: float
"""
self._fuel_type = value
self._maximum_heat_output = value
@property
def distribution_systems(self) -> Union[None, List[DistributionSystem]]:
def minimum_heat_output(self):
"""
Get distributions systems connected to this generation system
:return: [DistributionSystem]
Get minimum heat output in W
:return: float
"""
return self._distribution_systems
return self._minimum_heat_output
@distribution_systems.setter
def distribution_systems(self, value):
@minimum_heat_output.setter
def minimum_heat_output(self, value):
"""
Set distributions systems connected to this generation system
:param value: [DistributionSystem]
Set minimum heat output in W
:return: float
"""
self._distribution_systems = value
self._minimum_heat_output = value
@property
def energy_storage_systems(self) -> Union[None, List[EnergyStorageSystem]]:
def maximum_cooling_output(self):
"""
Get energy storage systems connected to this generation system
:return: [EnergyStorageSystem]
Get maximum cooling output in W
:return: float
"""
return self._energy_storage_systems
return self._maximum_cooling_output
@energy_storage_systems.setter
def energy_storage_systems(self, value):
@maximum_cooling_output.setter
def maximum_cooling_output(self, value):
"""
Set energy storage systems connected to this generation system
:param value: [EnergyStorageSystem]
Set maximum cooling output in W
:return: float
"""
self._energy_storage_systems = value
self._maximum_cooling_output = value
@property
def minimum_cooling_output(self):
"""
Get minimum cooling output in W
:return: float
"""
return self._minimum_cooling_output
@minimum_cooling_output.setter
def minimum_cooling_output(self, value):
"""
Set minimum cooling output in W
:return: float
"""
self._minimum_cooling_output = value

View File

@ -0,0 +1,174 @@
"""
Generic energy distribution system definition
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 typing import Union, List
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.generic_emission_system import GenericEmissionSystem
from hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
class GenericDistributionSystem:
"""
GenericDistributionSystem class
"""
def __init__(self):
self._model_name = None
self._type = None
self._supply_temperature = None
self._distribution_consumption_fix_flow = None
self._distribution_consumption_variable_flow = None
self._heat_losses = None
self._generic_generation_systems = None
self._generic_storage_systems = None
self._generic_emission_systems = None
@property
def model_name(self):
"""
Get model name
:return: string
"""
return self._model_name
@model_name.setter
def model_name(self, value):
"""
Set model name
:param value: string
"""
self._model_name = value
@property
def type(self):
"""
Get type from [air, water, refrigerant]
:return: string
"""
return self._type
@type.setter
def type(self, value):
"""
Set type from [air, water, refrigerant]
:param value: string
"""
self._type = value
@property
def supply_temperature(self):
"""
Get supply_temperature in degree Celsius
:return: float
"""
return self._supply_temperature
@supply_temperature.setter
def supply_temperature(self, value):
"""
Set supply_temperature in degree Celsius
:param value: float
"""
self._supply_temperature = value
@property
def distribution_consumption_fix_flow(self):
"""
Get distribution_consumption if the pump or fan work at fix mass or volume flow in ratio over peak power (W/W)
:return: float
"""
return self._distribution_consumption_fix_flow
@distribution_consumption_fix_flow.setter
def distribution_consumption_fix_flow(self, value):
"""
Set distribution_consumption if the pump or fan work at fix mass or volume flow in ratio over peak power (W/W)
:return: float
"""
self._distribution_consumption_fix_flow = value
@property
def distribution_consumption_variable_flow(self):
"""
Get distribution_consumption if the pump or fan work at variable mass or volume flow in ratio
over energy produced (J/J)
:return: float
"""
return self._distribution_consumption_variable_flow
@distribution_consumption_variable_flow.setter
def distribution_consumption_variable_flow(self, value):
"""
Set distribution_consumption if the pump or fan work at variable mass or volume flow in ratio
over energy produced (J/J)
:return: float
"""
self._distribution_consumption_variable_flow = value
@property
def heat_losses(self):
"""
Get heat_losses in ratio over energy produced
:return: float
"""
return self._heat_losses
@heat_losses.setter
def heat_losses(self, value):
"""
Set heat_losses in ratio over energy produced
:param value: float
"""
self._heat_losses = value
@property
def generic_generation_systems(self) -> Union[None, List[GenericGenerationSystem]]:
"""
Get generation systems connected to the distribution system
:return: [generic_generation_systems]
"""
return self._generic_generation_systems
@generic_generation_systems.setter
def generic_generation_systems(self, value):
"""
Set generation systems connected to the distribution system
:param value: [generic_generation_systems]
"""
self._generic_generation_systems = value
@property
def generic_storage_systems(self) -> Union[None, List[GenericStorageSystem]]:
"""
Get energy storage systems connected to this distribution system
:return: [GenericStorageSystem]
"""
return self._generic_storage_systems
@generic_storage_systems.setter
def generic_storage_systems(self, value):
"""
Set energy storage systems connected to this distribution system
:param value: [GenericStorageSystem]
"""
self._generic_storage_systems = value
@property
def generic_emission_systems(self) -> Union[None, List[GenericEmissionSystem]]:
"""
Get energy emission systems connected to this distribution system
:return: [GenericEmissionSystem]
"""
return self._generic_emission_systems
@generic_emission_systems.setter
def generic_emission_systems(self, value):
"""
Set energy emission systems connected to this distribution system
:param value: [GenericEmissionSystem]
"""
self._generic_emission_systems = value

View File

@ -0,0 +1,104 @@
"""
Generic electrical storage system
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
"""
from hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
class GenericElectricalStorageSystem(GenericStorageSystem):
""""
Generic Electrical Storage System Class
"""
def __init__(self):
super().__init__()
self._rated_output_power = None
self._nominal_efficiency = None
self._battery_voltage = None
self._depth_of_discharge = None
self._self_discharge_rate = None
@property
def rated_output_power(self):
"""
Get the rated output power of storage system in Watts
:return: float
"""
return self._rated_output_power
@rated_output_power.setter
def rated_output_power(self, value):
"""
Set the rated output power of storage system in Watts
:param value: float
"""
self._rated_output_power = value
@property
def nominal_efficiency(self):
"""
Get the nominal efficiency of the storage system
:return: float
"""
return self._nominal_efficiency
@nominal_efficiency.setter
def nominal_efficiency(self, value):
"""
Set the nominal efficiency of the storage system
:param value: float
"""
self._nominal_efficiency = value
@property
def battery_voltage(self):
"""
Get the battery voltage in Volts
:return: float
"""
return self._battery_voltage
@battery_voltage.setter
def battery_voltage(self, value):
"""
Set the battery voltage in Volts
:param value: float
"""
self._battery_voltage = value
@property
def depth_of_discharge(self):
"""
Get the depth of discharge as a percentage
:return: float
"""
return self._depth_of_discharge
@depth_of_discharge.setter
def depth_of_discharge(self, value):
"""
Set the depth of discharge as a percentage
:param value: float
"""
self._depth_of_discharge = value
@property
def self_discharge_rate(self):
"""
Get the self discharge rate of battery as a percentage
:return: float
"""
return self._self_discharge_rate
@self_discharge_rate.setter
def self_discharge_rate(self, value):
"""
Set the self discharge rate of battery as a percentage
:param value: float
"""
self._self_discharge_rate = value

View File

@ -0,0 +1,64 @@
"""
Generic energy emission system 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
"""
class GenericEmissionSystem:
"""
GenericEmissionSystem class
"""
def __init__(self):
self._model_name = None
self._type = None
self._parasitic_energy_consumption = None
@property
def model_name(self):
"""
Get model name
:return: string
"""
return self._model_name
@model_name.setter
def model_name(self, value):
"""
Set model name
:param value: string
"""
self._model_name = value
@property
def type(self):
"""
Get type
:return: string
"""
return self._type
@type.setter
def type(self, value):
"""
Set type
:param value: string
"""
self._type = value
@property
def parasitic_energy_consumption(self):
"""
Get parasitic_energy_consumption in ratio (W/W)
:return: float
"""
return self._parasitic_energy_consumption
@parasitic_energy_consumption.setter
def parasitic_energy_consumption(self, value):
"""
Set parasitic_energy_consumption in ratio (W/W)
:param value: float
"""
self._parasitic_energy_consumption = value

View File

@ -0,0 +1,104 @@
"""
Generic energy system definition
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 typing import Union, List
from pathlib import Path
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
class GenericEnergySystem:
"""
GenericEnergySystem class
"""
def __init__(self):
self._demand_types = None
self._name = None
self._generation_systems = None
self._distribution_systems = None
self._configuration_schema = None
@property
def demand_types(self):
"""
Get demand able to cover from [Heating, Cooling, Domestic Hot Water, Electricity]
:return: [string]
"""
return self._demand_types
@demand_types.setter
def demand_types(self, value):
"""
Set demand able to cover from [Heating, Cooling, Domestic Hot Water, Electricity]
:param value: [string]
"""
self._demand_types = value
@property
def name(self):
"""
Get energy system name
:return: str
"""
return self._name
@name.setter
def name(self, value):
"""
Set energy system name
:param value:
"""
self._name = value
@property
def generation_systems(self) -> List[GenericGenerationSystem]:
"""
Get generation systems
:return: [GenerationSystem]
"""
return self._generation_systems
@generation_systems.setter
def generation_systems(self, value):
"""
Set generation systems
:return: [GenerationSystem]
"""
self._generation_systems = value
@property
def distribution_systems(self) -> Union[None, List[GenericDistributionSystem]]:
"""
Get distribution systems
:return: [DistributionSystem]
"""
return self._distribution_systems
@distribution_systems.setter
def distribution_systems(self, value):
"""
Set distribution systems
:param value: [DistributionSystem]
"""
self._distribution_systems = value
@property
def configuration_schema(self) -> Path:
"""
Get the schema of the system configuration
:return: Path
"""
return self._configuration_schema
@configuration_schema.setter
def configuration_schema(self, value):
"""
Set the schema of the system configuration
:param value: Path
"""
self._configuration_schema = value

View File

@ -0,0 +1,123 @@
"""
Generic energy generation system (abstract class)
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
"""
from __future__ import annotations
from abc import ABC
from typing import Union, List
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
from hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
class GenericGenerationSystem(ABC):
"""
GenericGenerationSystem class
"""
def __init__(self):
self._system_type = None
self._model_name = None
self._manufacturer = None
self._fuel_type = None
self._generic_distribution_systems = None
self._generic_storage_systems = None
@property
def system_type(self):
"""
Get type
:return: string
"""
return self._system_type
@system_type.setter
def system_type(self, value):
"""
Set type
:param value: string
"""
self._system_type = value
@property
def model_name(self):
"""
Get model name
:return: string
"""
return self._model_name
@model_name.setter
def model_name(self, value):
"""
Set model name
:param value: string
"""
self._model_name = value
@property
def manufacturer(self):
"""
Get manufacturer's name
:return: string
"""
return self._manufacturer
@manufacturer.setter
def manufacturer(self, value):
"""
Set manufacturer's name
:param value: string
"""
self._manufacturer = value
@property
def fuel_type(self):
"""
Get fuel_type from [Renewable, Gas, Diesel, Electricity, Wood, Coal]
:return: string
"""
return self._fuel_type
@fuel_type.setter
def fuel_type(self, value):
"""
Set fuel_type from [Renewable, Gas, Diesel, Electricity, Wood, Coal]
:param value: string
"""
self._fuel_type = value
@property
def generic_distribution_systems(self) -> Union[None, List[GenericDistributionSystem]]:
"""
Get distributions systems connected to this generation system
:return: [GenericDistributionSystem]
"""
return self._generic_distribution_systems
@generic_distribution_systems.setter
def generic_distribution_systems(self, value):
"""
Set distributions systems connected to this generation system
:param value: [GenericDistributionSystem]
"""
self._generic_distribution_systems = value
@property
def generic_storage_systems(self) -> Union[None, List[GenericStorageSystem]]:
"""
Get energy storage systems connected to this generation system
:return: [GenericStorageSystem]
"""
return self._generic_storage_systems
@generic_storage_systems.setter
def generic_storage_systems(self, value):
"""
Set energy storage systems connected to this generation system
:param value: [GenericStorageSystem]
"""
self._generic_storage_systems = value

View File

@ -1,5 +1,5 @@
"""
Non PV energy generation system
Generic non PV energy generation system
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
@ -8,13 +8,13 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
from typing import Union
from hub.city_model_structure.energy_systems.generation_system import GenerationSystem
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.performance_curve import PerformanceCurves
class NonPvGenerationSystem(GenerationSystem):
class GenericNonPvGenerationSystem(GenericGenerationSystem):
"""
NonPvGenerationSystem class
GenericNonPvGenerationSystem class
"""
def __init__(self):
super().__init__()
@ -42,9 +42,6 @@ class NonPvGenerationSystem(GenerationSystem):
self._cooling_output_curve = None
self._cooling_fuel_consumption_curve = None
self._cooling_efficiency_curve = None
self._heat_power = None
self._cooling_power = None
self._electricity_power = None
@property
def nominal_heat_output(self):
@ -429,52 +426,3 @@ class NonPvGenerationSystem(GenerationSystem):
:return: PerformanceCurve
"""
self._cooling_efficiency_curve = value
@property
def heat_power(self):
"""
Get heat_power in W
:return: float
"""
return self._heat_power
@heat_power.setter
def heat_power(self, value):
"""
Set heat_power in W
:param value: float
"""
self._heat_power = value
@property
def cooling_power(self):
"""
Get cooling_power in W
:return: float
"""
return self._cooling_power
@cooling_power.setter
def cooling_power(self, value):
"""
Set cooling_power in W
:param value: float
"""
self._cooling_power = value
@property
def electricity_power(self):
"""
Get electricity_power in W
:return: float
"""
return self._electricity_power
@electricity_power.setter
def electricity_power(self, value):
"""
Set electricity_power in W
:param value: float
"""
self._electricity_power = value

View File

@ -1,17 +1,17 @@
"""
PV energy generation system
Generic PV energy generation system
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
"""
from hub.city_model_structure.energy_systems.generation_system import GenerationSystem
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
class PvGenerationSystem(GenerationSystem):
class GenericPvGenerationSystem(GenericGenerationSystem):
"""
PvGenerationSystem class
GenericPvGenerationSystem class
"""
def __init__(self):
super().__init__()
@ -25,7 +25,6 @@ class PvGenerationSystem(GenerationSystem):
self._cell_temperature_coefficient = None
self._width = None
self._height = None
self._electricity_power = None
@property
def nominal_electricity_output(self):
@ -186,19 +185,3 @@ class PvGenerationSystem(GenerationSystem):
:param value: float
"""
self._height = value
@property
def electricity_power(self):
"""
Get electricity_power in W
:return: float
"""
return self._electricity_power
@electricity_power.setter
def electricity_power(self, value):
"""
Set electricity_power in W
:param value: float
"""
self._electricity_power = value

View File

@ -1,17 +1,18 @@
"""
Energy storage system. Abstract class
Energy System catalog heat generation system
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from __future__ import annotations
from abc import ABC
class EnergyStorageSystem(ABC):
class GenericStorageSystem(ABC):
"""
Energy storage System class
Generic storage System class
"""
def __init__(self):
self._type_energy_stored = None

View File

@ -0,0 +1,88 @@
"""
Generic thermal storage system
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
"""
from hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
from hub.city_model_structure.building_demand.layer import Layer
class GenericThermalStorageSystem(GenericStorageSystem):
""""
Generic Thermal Storage System Class
"""
def __init__(self):
super().__init__()
self._volume = None
self._height = None
self._layers = None
self._maximum_operating_temperature = None
@property
def volume(self):
"""
Get the physical volume of the storage system in cubic meters
:return: float
"""
return self._volume
@volume.setter
def volume(self, value):
"""
Set the physical volume of the storage system in cubic meters
:param value: float
"""
self._volume = value
@property
def height(self):
"""
Get the diameter of the storage system in meters
:return: float
"""
return self._height
@height.setter
def height(self, value):
"""
Set the diameter of the storage system in meters
:param value: float
"""
self._height = value
@property
def layers(self) -> [Layer]:
"""
Get construction layers
:return: [layer]
"""
return self._layers
@layers.setter
def layers(self, value):
"""
Set construction layers
:param value: [layer]
"""
self._layers = value
@property
def maximum_operating_temperature(self):
"""
Get maximum operating temperature of the storage system in degree Celsius
:return: float
"""
return self._maximum_operating_temperature
@maximum_operating_temperature.setter
def maximum_operating_temperature(self, value):
"""
Set maximum operating temperature of the storage system in degree Celsius
:param value: float
"""
self._maximum_operating_temperature = value

View File

@ -0,0 +1,64 @@
"""
heat_pump module defines a heat pump
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Peter Yefi peteryefi@gmail.com
"""
from typing import List
from pandas.core.series import Series
class HeatPump:
"""
HeatPump class
"""
def __init__(self):
self._model = None
self._hp_monthly_fossil_consumption = None
self._hp_monthly_electricity_demand = None
@property
def model(self) -> str:
"""
Get model name
:return: str
"""
return self._model
@model.setter
def model(self, value):
"""
Set model (name, indicated in capacity)
:param value: str
"""
if self._model is None:
self._model = value
@property
def hp_monthly_fossil_consumption(self) -> List:
"""
Fossil fuel consumption that results from insel simulation
":return: []
:return:
"""
return self._hp_monthly_fossil_consumption
@hp_monthly_fossil_consumption.setter
def hp_monthly_fossil_consumption(self, value):
if isinstance(value, Series):
self._hp_monthly_fossil_consumption = value
@property
def hp_monthly_electricity_demand(self) -> List:
"""
Electricity demand that results from insel simulation
":return: []
:return:
"""
return self._hp_monthly_electricity_demand
@hp_monthly_electricity_demand.setter
def hp_monthly_electricity_demand(self, value):
if isinstance(value, Series):
self._hp_monthly_electricity_demand = value

View File

@ -0,0 +1,32 @@
"""
HvacTerminalUnit module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import Union
class HvacTerminalUnit:
"""
HvacTerminalUnit class
"""
def __init__(self):
self._type = None
@property
def type(self) -> Union[None, str]:
"""
Get type of hvac terminal unit defined for a thermal zone
:return: None or str
"""
return self._type
@type.setter
def type(self, value):
"""
Set type of hvac terminal unit defined for a thermal zone
:param value: str
"""
if value is not None:
self._type = str(value)

View File

@ -1,32 +1,64 @@
"""
Thermal storage system
Energy System catalog heat generation system
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
Project Coder Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
from __future__ import annotations
from hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
from hub.city_model_structure.building_demand.layer import Layer
class ThermalStorageSystem(EnergyStorageSystem):
""""
Thermal Storage System Class
"""
class ThermalStorageSystem:
def __init__(self):
super().__init__()
self._model_name = None
self._manufacturer = None
self._volume = None
self._height = None
self._layers = None
self._maximum_operating_temperature = None
self._generic_storage_system = None
@property
def model_name(self):
"""
Get the model name
:return: string
"""
return self._model_name
@model_name.setter
def model_name(self, value):
"""
Set the model name
:return: string
"""
self._model_name = value
@property
def manufacturer(self):
"""
Get the manufacturer name
:return: string
"""
return self._manufacturer
@manufacturer.setter
def manufacturer(self, value):
"""
Set the manufacturer name
:return: string
"""
self._manufacturer = value
@property
def volume(self):
"""
Get the physical volume of the storage system in cubic meters
Get the volume of thermal storage in m3
:return: float
"""
return self._volume
@ -34,15 +66,15 @@ class ThermalStorageSystem(EnergyStorageSystem):
@volume.setter
def volume(self, value):
"""
Set the physical volume of the storage system in cubic meters
:param value: float
Set the thermal storage volume in m3
:return: float
"""
self._volume = value
@property
def height(self):
"""
Get the diameter of the storage system in meters
Get the storage height in m
:return: float
"""
return self._height
@ -50,31 +82,31 @@ class ThermalStorageSystem(EnergyStorageSystem):
@height.setter
def height(self, value):
"""
Set the diameter of the storage system in meters
:param value: float
Set the storage height in m
:return: float
"""
self._height = value
@property
def layers(self) -> [Layer]:
def generic_storage_system(self) -> GenericStorageSystem:
"""
Get construction layers
:return: [layer]
Get associated generic_storage_system
:return: GenericStorageSystem
"""
return self._layers
return self._generic_storage_system
@layers.setter
def layers(self, value):
@generic_storage_system.setter
def generic_storage_system(self, value):
"""
Set construction layers
:param value: [layer]
Set associated generic_storage_system
:param value: GenericStorageSystem
"""
self._layers = value
self._generic_storage_system = value
@property
def maximum_operating_temperature(self):
"""
Get maximum operating temperature of the storage system in degree Celsius
Get the storage maximum operating temperature in degree Celsius
:return: float
"""
return self._maximum_operating_temperature
@ -82,7 +114,23 @@ class ThermalStorageSystem(EnergyStorageSystem):
@maximum_operating_temperature.setter
def maximum_operating_temperature(self, value):
"""
Set maximum operating temperature of the storage system in degree Celsius
:param value: float
Set the storage maximum operating temperature in degree Celsius
:return: float
"""
self._maximum_operating_temperature = value
@property
def layers(self) -> [Layer]:
"""
Get the storage system layers
:return: Layer
"""
return self._layers
@layers.setter
def layers(self, value):
"""
Set the storage system layers
:return: Layer
"""
self._layers = value

View File

@ -302,7 +302,6 @@ PHOTOVOLTAIC = 'Photovoltaic'
BOILER = 'Boiler'
HEAT_PUMP = 'Heat Pump'
BASEBOARD = 'Baseboard'
ELECTRICITY_GENERATOR = 'Electricity generator'
CHILLER = 'Chiller'
SENSIBLE = 'sensible'
LATENT = 'Latent'

View File

@ -1,31 +0,0 @@
"""
Dictionaries module for Montreal system to hub energy generation system
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 hub.helpers.constants as cte
class MontrealGenerationSystemToHubEnergyGenerationSystem:
"""
Montreal's generation system to hub energy generation system class
"""
def __init__(self):
self._dictionary = {
'boiler': cte.BOILER,
'furnace': cte.BASEBOARD,
'cooler': cte.CHILLER,
'electricity generator': cte.ELECTRICITY_GENERATOR,
'PV system': cte.PHOTOVOLTAIC,
'heat pump': cte.HEAT_PUMP
}
@property
def dictionary(self) -> dict:
"""
Get the dictionary
:return: {}
"""
return self._dictionary

View File

@ -19,7 +19,6 @@ from hub.helpers.data.hub_usage_to_hft_usage import HubUsageToHftUsage
from hub.helpers.data.hub_usage_to_nrcan_usage import HubUsageToNrcanUsage
from hub.helpers.data.hub_usage_to_eilat_usage import HubUsageToEilatUsage
from hub.helpers.data.montreal_system_to_hub_energy_generation_system import MontrealSystemToHubEnergyGenerationSystem
from hub.helpers.data.montreal_generation_system_to_hub_energy_generation_system import MontrealGenerationSystemToHubEnergyGenerationSystem
from hub.helpers.data.montreal_demand_type_to_hub_energy_demand_type import MontrealDemandTypeToHubEnergyDemandType
from hub.helpers.data.hub_function_to_montreal_custom_costs_function import HubFunctionToMontrealCustomCostsFunction
from hub.helpers.data.north_america_demand_type_to_hub_energy_demand_type import NorthAmericaDemandTypeToHubEnergyDemandType
@ -155,13 +154,6 @@ class Dictionaries:
"""
return MontrealCustomFuelToHubFuel().dictionary
@property
def montreal_generation_system_to_hub_energy_generation_system(self):
"""
Get montreal custom generation system names to hub energy system names, transformation dictionary
"""
return MontrealGenerationSystemToHubEnergyGenerationSystem().dictionary
@property
def north_america_demand_type_to_hub_energy_demand_type(self):
"""

View File

@ -8,13 +8,15 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
import logging
import copy
from pandas import DataFrame
from hub.catalog_factories.energy_systems_catalog_factory import EnergySystemsCatalogFactory
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
from hub.city_model_structure.energy_systems.generic_energy_system import GenericEnergySystem
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
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.non_pv_generation_system import NonPvGenerationSystem
from hub.city_model_structure.energy_systems.pv_generation_system import PvGenerationSystem
from hub.city_model_structure.energy_systems.electrical_storage_system import ElectricalStorageSystem
from hub.city_model_structure.energy_systems.thermal_storage_system import ThermalStorageSystem
from hub.city_model_structure.energy_systems.emission_system import EmissionSystem
from hub.helpers.dictionaries import Dictionaries
@ -34,6 +36,10 @@ class MontrealCustomEnergySystemParameters:
"""
city = self._city
montreal_custom_catalog = EnergySystemsCatalogFactory('montreal_custom').catalog
if city.energy_systems_connection_table is None:
_energy_systems_connection_table = DataFrame(columns=['Energy System Type', 'Building'])
else:
_energy_systems_connection_table = city.energy_systems_connection_table
if city.generic_energy_systems is None:
_generic_energy_systems = {}
else:
@ -47,12 +53,16 @@ class MontrealCustomEnergySystemParameters:
archetype_name)
continue
if archetype.name not in _generic_energy_systems:
_generic_energy_systems = self._create_generic_systems_list(archetype, _generic_energy_systems)
_energy_systems_connection_table, _generic_energy_systems = self._create_generic_systems(
archetype,
building,
_energy_systems_connection_table,
_generic_energy_systems
)
city.energy_systems_connection_table = _energy_systems_connection_table
city.generic_energy_systems = _generic_energy_systems
self._assign_energy_systems_to_buildings(city)
self._associate_energy_systems(city)
@staticmethod
def _search_archetypes(catalog, name):
@ -62,88 +72,85 @@ class MontrealCustomEnergySystemParameters:
return building_archetype
raise KeyError('archetype not found')
def _create_generic_systems_list(self, archetype, _generic_energy_systems):
building_systems = []
for archetype_system in archetype.systems:
energy_system = EnergySystem()
_hub_demand_types = []
for demand_type in archetype_system.demand_types:
_hub_demand_types.append(Dictionaries().montreal_demand_type_to_hub_energy_demand_type[demand_type])
energy_system.name = archetype_system.name
energy_system.demand_types = _hub_demand_types
energy_system.generation_systems = self._create_generation_systems(archetype_system)
energy_system.distribution_systems = self._create_distribution_systems(archetype_system)
building_systems.append(energy_system)
_generic_energy_systems[archetype.name] = building_systems
return _generic_energy_systems
@staticmethod
def _create_generation_systems(archetype_system):
_generation_systems = []
for archetype_generation_system in archetype_system.generation_systems:
if archetype_generation_system.system_type == 'PV system':
_generation_system = PvGenerationSystem()
_type = 'PV system'
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[_type]
_fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
def _create_generic_systems(archetype, building,
_energy_systems_connection_table, _generic_energy_systems):
data = [archetype.name, building.name]
_energy_systems_connection_table.loc[len(_energy_systems_connection_table)] = data
if archetype.name not in _generic_energy_systems:
building_systems = []
for system in archetype.systems:
energy_system = GenericEnergySystem()
_hub_demand_types = []
for demand_type in system.demand_types:
_hub_demand_types.append(Dictionaries().montreal_demand_type_to_hub_energy_demand_type[demand_type])
energy_system.name = system.name
energy_system.demand_types = _hub_demand_types
_generation_system = GenericGenerationSystem()
archetype_generation_equipment = system.generation_systems
_type = system.name
_generation_system.type = Dictionaries().montreal_system_to_hub_energy_generation_system[
_type]
_fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_equipment.fuel_type]
_generation_system.fuel_type = _fuel_type
_generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency
_generic_storage_system = None
if archetype_generation_system.energy_storage_systems is not None:
_generic_storage_system = ElectricalStorageSystem()
_generic_storage_system.type_energy_stored = 'electrical'
_generation_system.energy_storage_systems = [_generic_storage_system]
else:
_generation_system = NonPvGenerationSystem()
_type = archetype_generation_system.system_type
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[_type]
_fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
_generation_system.fuel_type = _fuel_type
_generation_system.source_types = archetype_generation_system.source_medium
_generation_system.heat_efficiency = archetype_generation_system.heat_efficiency
_generation_system.cooling_efficiency = archetype_generation_system.cooling_efficiency
_generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency
_generic_storage_system = None
if archetype_generation_system.energy_storage_systems is not None:
if archetype_generation_system.energy_storage_systems.type_energy_stored == 'electrical':
_generic_storage_system = ElectricalStorageSystem()
_generic_storage_system.type_energy_stored = 'electrical'
else:
_generic_storage_system = ThermalStorageSystem()
_generic_storage_system.type_energy_stored = 'thermal'
_generation_system.energy_storage_systems = [_generic_storage_system]
_generation_systems.append(_generation_system)
return _generation_systems
_generation_system.source_types = archetype_generation_equipment.source_medium
_generation_system.heat_efficiency = archetype_generation_equipment.heat_efficiency
_generation_system.cooling_efficiency = archetype_generation_equipment.cooling_efficiency
_generation_system.electricity_efficiency = archetype_generation_equipment.electricity_efficiency
_generation_system.source_temperature = archetype_generation_equipment.source_temperature
_generation_system.source_mass_flow = archetype_generation_equipment.source_mass_flow
_generation_system.storage = archetype_generation_equipment.storage
_generation_system.auxiliary_equipment = None
energy_system.generation_systems = _generation_system
_distribution_system = GenericDistributionSystem()
archetype_distribution_equipment = system.distribution_systems
_distribution_system.type = archetype_distribution_equipment.type
_distribution_system.supply_temperature = archetype_distribution_equipment.supply_temperature
_distribution_system.distribution_consumption_fix_flow = \
archetype_distribution_equipment.distribution_consumption_fix_flow
_distribution_system.distribution_consumption_variable_flow = \
archetype_distribution_equipment.distribution_consumption_variable_flow
_distribution_system.heat_losses = archetype_distribution_equipment.heat_losses
energy_system.distribution_systems = _distribution_system
building_systems.append(energy_system)
_generic_energy_systems[archetype.name] = building_systems
return _energy_systems_connection_table, _generic_energy_systems
@staticmethod
def _create_distribution_systems(archetype_system):
_distribution_systems = []
for archetype_distribution_system in archetype_system.distribution_systems:
_distribution_system = DistributionSystem()
_distribution_system.type = archetype_distribution_system.type
_distribution_system.distribution_consumption_fix_flow = \
archetype_distribution_system.distribution_consumption_fix_flow
_distribution_system.distribution_consumption_variable_flow = \
archetype_distribution_system.distribution_consumption_variable_flow
_distribution_system.heat_losses = archetype_distribution_system.heat_losses
_emission_system = None
if archetype_distribution_system.emission_systems is not None:
_emission_system = EmissionSystem()
_distribution_system.emission_systems = [_emission_system]
_distribution_systems.append(_distribution_system)
return _distribution_systems
@staticmethod
def _assign_energy_systems_to_buildings(city):
def _associate_energy_systems(city):
energy_systems_connection = city.energy_systems_connection_table
for building in city.buildings:
_building_energy_systems = []
energy_systems_cluster_name = building.energy_systems_archetype_name
if str(energy_systems_cluster_name) == 'nan':
break
_generic_building_energy_systems = city.generic_energy_systems[energy_systems_cluster_name]
for _generic_building_energy_system in _generic_building_energy_systems:
_building_energy_systems.append(copy.deepcopy(_generic_building_energy_system))
energy_systems = energy_systems_connection['Energy System Type'][
energy_systems_connection['Building'] == building.name]
for energy_system in energy_systems:
if str(energy_system) == 'nan':
break
_generic_building_energy_systems = city.generic_energy_systems[energy_system]
for _generic_building_energy_system in _generic_building_energy_systems:
_building_energy_equipment = EnergySystem()
_building_energy_equipment.name = _generic_building_energy_system.name
_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_systems)
_building_emission_system = EmissionSystem()
_building_emission_system.generic_emission_system = \
copy.deepcopy(_generic_building_energy_system.emission_systems)
_building_generation_system = GenerationSystem()
_building_generation_system.generic_generation_system = \
copy.deepcopy(_generic_building_energy_system.generation_systems)
_building_energy_equipment.generation_systems = _building_generation_system
_building_energy_equipment.distribution_systems = _building_distribution_system
_building_energy_equipment.emission_systems = _building_emission_system
_building_energy_systems.append(_building_energy_equipment)
building.energy_systems = _building_energy_systems

View File

@ -16,8 +16,8 @@ from hub.city_model_structure.energy_systems.distribution_system import Distribu
from hub.city_model_structure.energy_systems.emission_system import EmissionSystem
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.energy_system import EnergySystem
from hub.city_model_structure.energy_systems.generation_system import GenerationSystem
from hub.city_model_structure.energy_systems.generic_energy_system import GenericEnergySystem
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.thermal_storage_system import ThermalStorageSystem
from hub.helpers.dictionaries import Dictionaries
@ -79,7 +79,7 @@ class NorthAmericaCustomEnergySystemParameters:
data = [archetype.name, building.name]
_energy_systems_connection_table.loc[len(_energy_systems_connection_table)] = data
for system in archetype.systems:
energy_system = EnergySystem()
energy_system = GenericEnergySystem()
_hub_demand_types = []
demand_types = system.demand_types
if isinstance(demand_types, str):
@ -91,7 +91,7 @@ class NorthAmericaCustomEnergySystemParameters:
archetype_generation_equipments = system.generation_systems
_generation_systems = []
for archetype_generation_equipment in archetype_generation_equipments:
_generation_system = GenerationSystem()
_generation_system = GenericGenerationSystem()
_type = archetype_generation_equipment.name
_generation_system.type = Dictionaries().north_america_system_to_hub_energy_generation_system[_type]
_fuel_type = Dictionaries().north_america_custom_fuel_to_hub_fuel[archetype_generation_equipment.fuel_type]

View File

@ -9,7 +9,6 @@ import subprocess
from pathlib import Path
from unittest import TestCase
import copy
from typing import cast
import hub.helpers.constants as cte
from hub.exports.energy_building_exports_factory import EnergyBuildingsExportsFactory
@ -26,8 +25,6 @@ from hub.city_model_structure.energy_systems.generation_system import Generation
from hub.city_model_structure.energy_systems.distribution_system import DistributionSystem
from hub.city_model_structure.energy_systems.emission_system import EmissionSystem
from hub.city_model_structure.energy_systems.thermal_storage_system import ThermalStorageSystem
from hub.city_model_structure.energy_systems.non_pv_generation_system import NonPvGenerationSystem
class TestSystemsFactory(TestCase):
"""
@ -57,6 +54,7 @@ class TestSystemsFactory(TestCase):
building.energy_systems_archetype_name = 'system 1 gas'
EnergySystemsFactory('montreal_custom', self._city).enrich()
self.assertEqual(17, len(self._city.energy_systems_connection_table))
self.assertEqual(1, len(self._city.generic_energy_systems))
def test_montreal_custom_system_results(self):
@ -80,15 +78,39 @@ class TestSystemsFactory(TestCase):
building.energy_systems_archetype_name = 'system 1 gas pv'
EnergySystemsFactory('montreal_custom', self._city).enrich()
# Need to assign energy systems to buildings:
energy_systems_connection = self._city.energy_systems_connection_table
for building in self._city.buildings:
_building_energy_systems = []
for energy_system in building.energy_systems:
if cte.HEATING in energy_system.demand_types:
_generation_system = cast(NonPvGenerationSystem, energy_system.generation_systems[0])
_generation_system.heat_power = building.heating_peak_load[cte.YEAR][0]
if cte.COOLING in energy_system.demand_types:
_generation_system = cast(NonPvGenerationSystem, energy_system.generation_systems[0])
_generation_system.cooling_power = building.cooling_peak_load[cte.YEAR][0]
energy_systems = energy_systems_connection['Energy System Type'][
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_systems)
)
_building_emission_system = EmissionSystem()
_building_emission_system.generic_emission_system = (
copy.deepcopy(_generic_building_energy_system.emission_systems)
)
_building_generation_system = GenerationSystem()
_building_generation_system.generic_generation_system = (
copy.deepcopy(_generic_building_energy_system.generation_systems)
)
if cte.HEATING in _building_energy_equipment.demand_types:
_building_generation_system.heat_power = building.heating_peak_load[cte.YEAR][0]
if cte.COOLING in _building_energy_equipment.demand_types:
_building_generation_system.cooling_power = building.cooling_peak_load[cte.YEAR][0]
_building_energy_equipment.generation_systems = _building_generation_system
_building_energy_equipment.distribution_systems = _building_distribution_system
_building_energy_equipment.emission_systems = _building_emission_system
_building_energy_systems.append(_building_energy_equipment)
building.energy_systems = _building_energy_systems
for building in self._city.buildings:
self.assertLess(0, building.heating_consumption[cte.YEAR][0])