Compare commits

..

2 Commits

27 changed files with 563 additions and 1303 deletions

View File

@ -8,7 +8,6 @@ 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'
self._system_type = 'PV system'
self._electricity_efficiency = electricity_efficiency
self._nominal_electricity_output = nominal_electricity_output
self._nominal_ambient_temperature = nominal_ambient_temperature

View File

@ -754,19 +754,17 @@ 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.generic_generation_system.heat_efficiency
coefficient_of_performance = generation_system.heat_efficiency
elif consumption_type == cte.COOLING:
for generation_system in generation_systems:
coefficient_of_performance = generation_system.generic_generation_system.cooling_efficiency
coefficient_of_performance = generation_system.cooling_efficiency
elif consumption_type == cte.ELECTRICITY:
for generation_system in generation_systems:
coefficient_of_performance = generation_system.generic_generation_system.electricity_efficiency
coefficient_of_performance = generation_system.electricity_efficiency
if coefficient_of_performance == 0:
values = [0]*len(demand)
final_energy_consumed = values
@ -797,8 +795,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.generic_generation_system.type == cte.PHOTOVOLTAIC:
_efficiency = energy_system.generation_systems.generic_generation_system.electricity_efficiency
if energy_system.generation_systems[0].system_type == cte.PHOTOVOLTAIC:
_efficiency = energy_system.generation_systems[0].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,7 +62,6 @@ 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:
@ -505,24 +504,6 @@ 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,7 +5,12 @@ Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
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')
class DistributionSystem:
@ -13,20 +18,158 @@ class DistributionSystem:
DistributionSystem class
"""
def __init__(self):
self._generic_distribution_system = None
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
@property
def generic_distribution_system(self) -> GenericDistributionSystem:
def model_name(self):
"""
Get generic_distribution_system
:return: GenericDistributionSystem
Get model name
:return: string
"""
return self._generic_distribution_system
return self._model_name
@generic_distribution_system.setter
def generic_distribution_system(self, value):
@model_name.setter
def model_name(self, value):
"""
Set associated generic_distribution_system
:param value: GenericDistributionSystem
Set model name
:param value: string
"""
self._generic_distribution_system = value
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

View File

@ -1,83 +1,32 @@
"""
Energy System catalog heat generation system
Electrical storage 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 hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
class ElectricalStorageSystem:
"""
Electrical Storage system class
class ElectricalStorageSystem(EnergyStorageSystem):
""""
Electrical Storage System Class
"""
def __init__(self):
self._model_name = None
self._manufacturer = None
self._generic_storage_system = None
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 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 in Watts
Get the rated output power of storage system in Watts
:return: float
"""
return self._rated_output_power
@ -85,15 +34,15 @@ class ElectricalStorageSystem:
@rated_output_power.setter
def rated_output_power(self, value):
"""
Set the rated output power in Watts
:return: float
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
Get the nominal efficiency of the storage system
:return: float
"""
return self._nominal_efficiency
@ -101,8 +50,8 @@ class ElectricalStorageSystem:
@nominal_efficiency.setter
def nominal_efficiency(self, value):
"""
Set the nominal efficiency
:return: float
Set the nominal efficiency of the storage system
:param value: float
"""
self._nominal_efficiency = value
@ -117,8 +66,8 @@ class ElectricalStorageSystem:
@battery_voltage.setter
def battery_voltage(self, value):
"""
Get the battery voltage in Volts
:return: float
Set the battery voltage in Volts
:param value: float
"""
self._battery_voltage = value
@ -134,7 +83,7 @@ class ElectricalStorageSystem:
def depth_of_discharge(self, value):
"""
Set the depth of discharge as a percentage
:return: float
:param value: float
"""
self._depth_of_discharge = value
@ -149,7 +98,7 @@ class ElectricalStorageSystem:
@self_discharge_rate.setter
def self_discharge_rate(self, value):
"""
Get the self discharge rate of battery as a percentage
:return: float
Set the self discharge rate of battery as a percentage
:param value: float
"""
self._self_discharge_rate = value

View File

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

@ -1,18 +1,17 @@
"""
Energy System catalog heat generation system
Energy storage system. Abstract class
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 GenericStorageSystem(ABC):
class EnergyStorageSystem(ABC):
"""
Generic storage System class
Energy storage System class
"""
def __init__(self):
self._type_energy_stored = None

View File

@ -6,13 +6,11 @@ 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.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.generation_system import GenerationSystem
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
@ -21,30 +19,13 @@ class EnergySystem:
EnergySystem class
"""
def __init__(self):
self._name = None
self._demand_types = None
self._name = None
self._generation_systems = None
self._distribution_systems = None
self._emission_systems = None
self._configuration_schema = None
self._connected_city_objects = None
self._control_system = None
self._energy_storage_systems = None
@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 demand_types(self):
@ -62,59 +43,75 @@ class EnergySystem:
"""
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[GenerationSystem]:
"""
Get generation systems
:return: GenerationSystem
:return: [GenerationSystem]
"""
return self._generation_systems
@generation_systems.setter
def generation_systems(self, value):
"""
Set generation system
:param value: GenerationSystem
Set generation systems
:return: [GenerationSystem]
"""
self._generation_systems = value
@property
def distribution_systems(self) -> Union[None, List[DistributionSystem]]:
"""
Get distribution system
:return: DistributionSystem
Get distribution systems
:return: [DistributionSystem]
"""
return self._distribution_systems
@distribution_systems.setter
def distribution_systems(self, value):
"""
Set distribution system
:param value: DistributionSystem
Set distribution systems
:param value: [DistributionSystem]
"""
self._distribution_systems = value
@property
def emission_systems(self) -> Union[None, List[EmissionSystem]]:
def configuration_schema(self) -> Path:
"""
Get emission system
:return: EmissionSystem
Get the schema of the system configuration
:return: Path
"""
return self._emission_systems
return self._configuration_schema
@emission_systems.setter
def emission_systems(self, value):
@configuration_schema.setter
def configuration_schema(self, value):
"""
Set emission system
:param value: EmissionSystem
Set the schema of the system configuration
:param value: Path
"""
self._emission_systems = value
self._configuration_schema = value
@property
def connected_city_objects(self) -> Union[None, List[CityObject]]:
"""
Get list of city objects that are connected to this energy system
:return: List[CityObject]
:return: [CityObject]
"""
return self._connected_city_objects
@ -122,7 +119,7 @@ class EnergySystem:
def connected_city_objects(self, value):
"""
Set list of city objects that are connected to this energy system
:param value: List[CityObject]
:param value: [CityObject]
"""
self._connected_city_objects = value
@ -141,19 +138,3 @@ 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,135 +1,51 @@
"""
Energy generation system definition
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 typing import Union
from abc import ABC
from typing import Union, List
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.distribution_system import DistributionSystem
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
class GenerationSystem:
class GenerationSystem(ABC):
"""
GenerationSystem class
"""
def __init__(self):
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._system_type = None
self._model_name = None
self._manufacturer = None
self._maximum_heat_output = None
self._minimum_heat_output = None
self._maximum_cooling_output = None
self._minimum_cooling_output = None
self._fuel_type = None
self._distribution_systems = None
self._energy_storage_systems = None
@property
def generic_generation_system(self) -> GenericGenerationSystem:
def system_type(self):
"""
Get associated generic_generation_system
:return: GenericGenerationSystem
Get type
:return: string
"""
return self._generic_generation_system
return self._system_type
@generic_generation_system.setter
def generic_generation_system(self, value):
@system_type.setter
def system_type(self, value):
"""
Set associated generic_generation_system
:param value: GenericGenerationSystem
Set type
:param value: string
"""
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
self._system_type = value
@property
def model_name(self):
"""
Get the model name
Get model name
:return: string
"""
return self._model_name
@ -137,15 +53,15 @@ class GenerationSystem:
@model_name.setter
def model_name(self, value):
"""
Set the model name
:return: string
Set model name
:param value: string
"""
self._model_name = value
@property
def manufacturer(self):
"""
Get the manufacturer name
Get manufacturer's name
:return: string
"""
return self._manufacturer
@ -153,72 +69,55 @@ class GenerationSystem:
@manufacturer.setter
def manufacturer(self, value):
"""
Set the manufacturer name
:return: string
Set manufacturer's name
:param value: string
"""
self._manufacturer = value
@property
def maximum_heat_output(self):
def fuel_type(self):
"""
Get maximum heat output in W
:return: float
Get fuel_type from [Renewable, Gas, Diesel, Electricity, Wood, Coal]
:return: string
"""
return self._maximum_heat_output
return self._fuel_type
@maximum_heat_output.setter
def maximum_heat_output(self, value):
@fuel_type.setter
def fuel_type(self, value):
"""
Set maximum heat output in W
:return: float
Set fuel_type from [Renewable, Gas, Diesel, Electricity, Wood, Coal]
:param value: string
"""
self._maximum_heat_output = value
self._fuel_type = value
@property
def minimum_heat_output(self):
def distribution_systems(self) -> Union[None, List[DistributionSystem]]:
"""
Get minimum heat output in W
:return: float
Get distributions systems connected to this generation system
:return: [DistributionSystem]
"""
return self._minimum_heat_output
return self._distribution_systems
@minimum_heat_output.setter
def minimum_heat_output(self, value):
@distribution_systems.setter
def distribution_systems(self, value):
"""
Set minimum heat output in W
:return: float
Set distributions systems connected to this generation system
:param value: [DistributionSystem]
"""
self._minimum_heat_output = value
self._distribution_systems = value
@property
def maximum_cooling_output(self):
def energy_storage_systems(self) -> Union[None, List[EnergyStorageSystem]]:
"""
Get maximum cooling output in W
:return: float
Get energy storage systems connected to this generation system
:return: [EnergyStorageSystem]
"""
return self._maximum_cooling_output
return self._energy_storage_systems
@maximum_cooling_output.setter
def maximum_cooling_output(self, value):
@energy_storage_systems.setter
def energy_storage_systems(self, value):
"""
Set maximum cooling output in W
:return: float
Set energy storage systems connected to this generation system
:param value: [EnergyStorageSystem]
"""
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
self._energy_storage_systems = value

View File

@ -1,174 +0,0 @@
"""
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

@ -1,104 +0,0 @@
"""
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

@ -1,64 +0,0 @@
"""
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

@ -1,104 +0,0 @@
"""
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

@ -1,123 +0,0 @@
"""
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,88 +0,0 @@
"""
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

@ -1,64 +0,0 @@
"""
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

@ -1,32 +0,0 @@
"""
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,5 +1,5 @@
"""
Generic non PV energy generation system
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.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.generation_system import GenerationSystem
from hub.city_model_structure.energy_systems.performance_curve import PerformanceCurves
class GenericNonPvGenerationSystem(GenericGenerationSystem):
class NonPvGenerationSystem(GenerationSystem):
"""
GenericNonPvGenerationSystem class
NonPvGenerationSystem class
"""
def __init__(self):
super().__init__()
@ -42,6 +42,9 @@ class GenericNonPvGenerationSystem(GenericGenerationSystem):
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):
@ -426,3 +429,52 @@ class GenericNonPvGenerationSystem(GenericGenerationSystem):
: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 @@
"""
Generic PV energy generation system
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.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.generation_system import GenerationSystem
class GenericPvGenerationSystem(GenericGenerationSystem):
class PvGenerationSystem(GenerationSystem):
"""
GenericPvGenerationSystem class
PvGenerationSystem class
"""
def __init__(self):
super().__init__()
@ -25,6 +25,7 @@ class GenericPvGenerationSystem(GenericGenerationSystem):
self._cell_temperature_coefficient = None
self._width = None
self._height = None
self._electricity_power = None
@property
def nominal_electricity_output(self):
@ -185,3 +186,19 @@ class GenericPvGenerationSystem(GenericGenerationSystem):
: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,64 +1,32 @@
"""
Energy System catalog heat generation system
Thermal storage 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
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
"""
from __future__ import annotations
from hub.city_model_structure.energy_systems.generic_storage_system import GenericStorageSystem
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
from hub.city_model_structure.building_demand.layer import Layer
class ThermalStorageSystem:
class ThermalStorageSystem(EnergyStorageSystem):
""""
Thermal Storage System Class
"""
def __init__(self):
self._model_name = None
self._manufacturer = None
super().__init__()
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 volume of thermal storage in m3
Get the physical volume of the storage system in cubic meters
:return: float
"""
return self._volume
@ -66,15 +34,15 @@ class ThermalStorageSystem:
@volume.setter
def volume(self, value):
"""
Set the thermal storage volume in m3
:return: float
Set the physical volume of the storage system in cubic meters
:param value: float
"""
self._volume = value
@property
def height(self):
"""
Get the storage height in m
Get the diameter of the storage system in meters
:return: float
"""
return self._height
@ -82,31 +50,31 @@ class ThermalStorageSystem:
@height.setter
def height(self, value):
"""
Set the storage height in m
:return: float
Set the diameter of the storage system in meters
:param value: float
"""
self._height = value
@property
def generic_storage_system(self) -> GenericStorageSystem:
def layers(self) -> [Layer]:
"""
Get associated generic_storage_system
:return: GenericStorageSystem
Get construction layers
:return: [layer]
"""
return self._generic_storage_system
return self._layers
@generic_storage_system.setter
def generic_storage_system(self, value):
@layers.setter
def layers(self, value):
"""
Set associated generic_storage_system
:param value: GenericStorageSystem
Set construction layers
:param value: [layer]
"""
self._generic_storage_system = value
self._layers = value
@property
def maximum_operating_temperature(self):
"""
Get the storage maximum operating temperature in degree Celsius
Get maximum operating temperature of the storage system in degree Celsius
:return: float
"""
return self._maximum_operating_temperature
@ -114,23 +82,7 @@ class ThermalStorageSystem:
@maximum_operating_temperature.setter
def maximum_operating_temperature(self, value):
"""
Set the storage maximum operating temperature in degree Celsius
:return: float
Set maximum operating temperature of the storage system in degree Celsius
:param value: 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,6 +302,7 @@ PHOTOVOLTAIC = 'Photovoltaic'
BOILER = 'Boiler'
HEAT_PUMP = 'Heat Pump'
BASEBOARD = 'Baseboard'
ELECTRICITY_GENERATOR = 'Electricity generator'
CHILLER = 'Chiller'
SENSIBLE = 'sensible'
LATENT = 'Latent'

View File

@ -0,0 +1,31 @@
"""
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,6 +19,7 @@ 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
@ -154,6 +155,13 @@ 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,15 +8,13 @@ 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
@ -36,10 +34,6 @@ 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:
@ -53,16 +47,12 @@ class MontrealCustomEnergySystemParameters:
archetype_name)
continue
_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
if archetype.name not in _generic_energy_systems:
_generic_energy_systems = self._create_generic_systems_list(archetype, _generic_energy_systems)
city.generic_energy_systems = _generic_energy_systems
self._associate_energy_systems(city)
self._assign_energy_systems_to_buildings(city)
@staticmethod
def _search_archetypes(catalog, name):
@ -72,85 +62,88 @@ 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_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]
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]
_generation_system.fuel_type = _fuel_type
_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
_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
@staticmethod
def _associate_energy_systems(city):
energy_systems_connection = city.energy_systems_connection_table
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):
for building in city.buildings:
_building_energy_systems = []
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
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))
_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.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.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 = GenericEnergySystem()
energy_system = EnergySystem()
_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 = GenericGenerationSystem()
_generation_system = GenerationSystem()
_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,6 +9,7 @@ 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
@ -25,6 +26,8 @@ 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):
"""
@ -54,7 +57,6 @@ 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):
@ -78,39 +80,15 @@ 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 = []
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 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]
for building in self._city.buildings:
self.assertLess(0, building.heating_consumption[cte.YEAR][0])