From 9034c3375e9125028f7b23e23a1717093592b27f Mon Sep 17 00:00:00 2001 From: Saeed Ranjbar Date: Wed, 9 Aug 2023 19:31:26 -0400 Subject: [PATCH] The generation_system.py is renamed to heat_generation_system.py and the attributes and decorators are modified to encapsulate all the needed attributes for boilers and heat pumps. Another class named electricity_generation_system.py is created to add the attributes and decorators of PV, inverter, and maybe wind turbines in future. The system.py is also modified accordingly --- .idea/misc.xml | 3 + .../electricity_generation_system.py | 159 ++++++++++++++++++ .../energy_systems/generation_system.py | 147 ---------------- .../energy_systems/heat_generation_system.py | 146 ++++++++++++++++ .../data_models/energy_systems/system.py | 28 ++- .../energy_systems/montreal_custom_catalog.py | 2 +- 6 files changed, 329 insertions(+), 156 deletions(-) create mode 100644 hub/catalog_factories/data_models/energy_systems/electricity_generation_system.py delete mode 100644 hub/catalog_factories/data_models/energy_systems/generation_system.py create mode 100644 hub/catalog_factories/data_models/energy_systems/heat_generation_system.py diff --git a/.idea/misc.xml b/.idea/misc.xml index ef318927..0e4465aa 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/hub/catalog_factories/data_models/energy_systems/electricity_generation_system.py b/hub/catalog_factories/data_models/energy_systems/electricity_generation_system.py new file mode 100644 index 00000000..762615a3 --- /dev/null +++ b/hub/catalog_factories/data_models/energy_systems/electricity_generation_system.py @@ -0,0 +1,159 @@ +""" +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 +""" + +from __future__ import annotations +from typing import Union + + +class ElectricityGenerationSystem: + """ + Heat Generation system class + """ + + def __init__(self, model_name, manufacturer, system_type, nominal_power_output, nominal_efficiency, + nominal_ambient_temperature, nominal_cell_temperature, nominal_radiation, + standard_test_condition_cell_temperature, standard_test_condition_maximum_power, width, height, + control_strategy): + self._model_name = model_name + self._name = manufacturer + self._type = system_type + self._nominal_power_output = nominal_power_output + self._nominal_efficiency = nominal_efficiency + self._nominal_ambient_temperature = nominal_ambient_temperature + self._nominal_cell_temperature = nominal_cell_temperature + self._nominal_radiation = nominal_radiation + self._standard_test_condition_cell_temperature = standard_test_condition_cell_temperature + self._standard_test_condition_maximum_power = standard_test_condition_maximum_power + self._width = width + self._height = height + self._control_strategy = control_strategy + + @property + def id(self): + """ + Get system id + :return: float + """ + return self._model_name + + @property + def name(self): + """ + Get name + :return: string + """ + return self._name + + @property + def type(self): + """ + Get type + :return: string + """ + return self._type + + @property + def nominal_power_output(self): + """ + Get nominal_power_output of electricity generation devices or inverters in kW + :return: float + """ + return self._nominal_power_output + + @property + def nominal_efficiency(self): + """ + Get nominal_efficiency of electricity generation devices or inverters + :return: float + """ + return self._nominal_efficiency + + @property + def nominal_ambient_temperature(self): + """ + Get nominal ambient temperature of PV panels in degree Celsius + :return: float + """ + return self._nominal_ambient_temperature + + @property + def nominal_cell_temperature(self): + """ + Get nominal cell temperature of PV panels in degree Celsius + :return: float + """ + return self._nominal_cell_temperature + + @property + def nominal_radiation(self): + """ + Get nominal radiation of PV panels + :return: float + """ + return self._nominal_radiation + + @property + def standard_test_condition_cell_temperature(self): + """ + Get standard test condition cell temperature of PV panels in degree Celsius + :return: float + """ + return self._standard_test_condition_cell_temperature + + @property + def standard_test_condition_maximum_power(self): + """ + Get standard test condition maximum power of PV panels in kW + :return: float + """ + return self._standard_test_condition_maximum_power + + @property + def width(self): + """ + Get PV module width in m + :return: float + """ + return self._width + + @property + def height(self): + """ + Get PV module height in m + :return: float + """ + return self._height + + @property + def control_strategy(self): + """" + Get control_strategy of Inverter from [MPPT, grid_tied, power_factor_control] + :return: string + """ + return self._control_strategy + + def to_dictionary(self): + """Class content to dictionary""" + content = {'Generation component': {'id': self.id, + 'name': self.name, + 'type': self.type, + 'nominal power output [kW]': self.nominal_power_output, + 'nominal efficiency': self.nominal_efficiency, + 'nominal ambient temperature [Celsius]': self.nominal_ambient_temperature, + 'nominal cell temperature [Celsius]': self.nominal_cell_temperature, + 'nominal radiation [W/m2]': self.nominal_radiation, + 'standard test condition cell temperature [Celsius]': + self.standard_test_condition_cell_temperature, + 'standard test condition maximum power [kW]': + self.standard_test_condition_maximum_power, + 'width': self.width, + 'height': self.height, + 'control strategy': self.control_strategy + } + } + return content diff --git a/hub/catalog_factories/data_models/energy_systems/generation_system.py b/hub/catalog_factories/data_models/energy_systems/generation_system.py deleted file mode 100644 index 1728540f..00000000 --- a/hub/catalog_factories/data_models/energy_systems/generation_system.py +++ /dev/null @@ -1,147 +0,0 @@ -""" -Energy System catalog 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 -""" - -from __future__ import annotations -from typing import Union - - -class GenerationSystem: - """ - Generation system class - """ - def __init__(self, system_id, name, system_type, fuel_type, source_types, heat_efficiency, cooling_efficiency, - electricity_efficiency, source_temperature, source_mass_flow, storage, auxiliary_equipment): - - self._system_id = system_id - self._name = name - self._type = system_type - self._fuel_type = fuel_type - self._source_types = source_types - self._heat_efficiency = heat_efficiency - self._cooling_efficiency = cooling_efficiency - self._electricity_efficiency = electricity_efficiency - self._source_temperature = source_temperature - self._source_mass_flow = source_mass_flow - self._storage = storage - self._auxiliary_equipment = auxiliary_equipment - - @property - def id(self): - """ - Get system id - :return: float - """ - return self._system_id - - @property - def name(self): - """ - Get name - :return: string - """ - return self._name - - @property - def type(self): - """ - Get type - :return: string - """ - return self._type - - @property - def fuel_type(self): - """ - Get fuel_type from [renewable, gas, diesel, electricity, wood, coal] - :return: string - """ - return self._fuel_type - - @property - def source_types(self): - """ - Get source_type from [air, water, geothermal, district_heating, grid, on_site_electricity] - :return: [string] - """ - return self._source_types - - @property - def heat_efficiency(self): - """ - Get heat_efficiency - :return: float - """ - return self._heat_efficiency - - @property - def cooling_efficiency(self): - """ - Get cooling_efficiency - :return: float - """ - return self._cooling_efficiency - - @property - def electricity_efficiency(self): - """ - Get electricity_efficiency - :return: float - """ - return self._electricity_efficiency - - @property - def source_temperature(self): - """ - Get source_temperature in degree Celsius - :return: float - """ - return self._source_temperature - - @property - def source_mass_flow(self): - """ - Get source_mass_flow in kg/s - :return: float - """ - return self._source_mass_flow - - @property - def storage(self): - """ - Get boolean storage exists - :return: bool - """ - return self._storage - - @property - def auxiliary_equipment(self) -> Union[None, GenerationSystem]: - """ - Get auxiliary_equipment - :return: GenerationSystem - """ - return self._auxiliary_equipment - - def to_dictionary(self): - """Class content to dictionary""" - _auxiliary_equipment = [] - if self.auxiliary_equipment is not None: - _auxiliary_equipment = self.auxiliary_equipment.to_dictionary() - content = {'Layer': {'id': self.id, - 'name': self.name, - 'type': self.type, - 'fuel type': self.fuel_type, - 'source types': self.source_types, - 'source temperature [Celsius]': self.source_temperature, - 'source mass flow [kg/s]': self.source_mass_flow, - 'heat efficiency': self.heat_efficiency, - 'cooling efficiency': self.cooling_efficiency, - 'electricity efficiency': self.electricity_efficiency, - 'it has storage': self.storage, - 'auxiliary equipment': _auxiliary_equipment - } - } - return content diff --git a/hub/catalog_factories/data_models/energy_systems/heat_generation_system.py b/hub/catalog_factories/data_models/energy_systems/heat_generation_system.py new file mode 100644 index 00000000..002d12a9 --- /dev/null +++ b/hub/catalog_factories/data_models/energy_systems/heat_generation_system.py @@ -0,0 +1,146 @@ +""" +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 +""" + +from __future__ import annotations +from typing import Union + + +class HeatGenerationSystem: + """ + Heat Generation system class + """ + + def __init__(self, model_name, manufacturer, system_type, fuel_type, nominal_thermal_output, modulation_range, + source_types, heat_efficiency, cooling_efficiency, electricity_efficiency, source_temperature, + source_mass_flow): + self._model_name = model_name + self._manufacturer = manufacturer + self._system_type = system_type + self._fuel_type = fuel_type + self._nominal_thermal_output = nominal_thermal_output + self._modulation_range = modulation_range + self._source_types = source_types + self._heat_efficiency = heat_efficiency + self._cooling_efficiency = cooling_efficiency + self._electricity_efficiency = electricity_efficiency + self._source_temperature = source_temperature + self._source_mass_flow = source_mass_flow + + @property + def model_name(self): + """ + Get system id + :return: float + """ + return self._model_name + + @property + def manufacturer(self): + """ + Get name + :return: string + """ + return self._manufacturer + + @property + def system_type(self): + """ + Get type + :return: string + """ + return self._system_type + + @property + def fuel_type(self): + """ + Get fuel_type from [renewable, gas, diesel, electricity, wood, coal, biogas] + :return: string + """ + return self._fuel_type + + @property + def nominal_thermal_output(self): + """ + Get nominal_thermal_output of heat generation devices in kW + :return: float + """ + return self._nominal_thermal_output + + @property + def modulation_range(self): + """ + Get modulation range of heat generation devices + :return: float + """ + return self._modulation_range + + @property + def source_types(self): + """ + Get source_type from [air, water, ground, district_heating, grid, on_site_electricity] + :return: [string] + """ + return self._source_types + + @property + def heat_efficiency(self): + """ + Get heat_efficiency + :return: float + """ + return self._heat_efficiency + + @property + def cooling_efficiency(self): + """ + Get cooling_efficiency + :return: float + """ + return self._cooling_efficiency + + @property + def electricity_efficiency(self): + """ + Get electricity_efficiency + :return: float + """ + return self._electricity_efficiency + + @property + def source_temperature(self): + """ + Get source_temperature in degree Celsius + :return: float + """ + return self._source_temperature + + @property + def source_mass_flow(self): + """ + Get source_mass_flow in kg/s + :return: float + """ + return self._source_mass_flow + + def to_dictionary(self): + """Class content to dictionary""" + content = {'Generation component': {'model name': self.model_name, + 'manufacturer': self.manufacturer, + 'type': self.system_type, + 'fuel type': self.fuel_type, + 'nominal thermal output': self.nominal_thermal_output, + 'modulation_range': self.modulation_range, + 'source types': self.source_types, + 'source temperature [Celsius]': self.source_temperature, + 'source mass flow [kg/s]': self.source_mass_flow, + 'heat efficiency': self.heat_efficiency, + 'cooling efficiency': self.cooling_efficiency, + 'electricity efficiency': self.electricity_efficiency, + } + } + return content diff --git a/hub/catalog_factories/data_models/energy_systems/system.py b/hub/catalog_factories/data_models/energy_systems/system.py index 6059bec7..743c5b56 100644 --- a/hub/catalog_factories/data_models/energy_systems/system.py +++ b/hub/catalog_factories/data_models/energy_systems/system.py @@ -7,7 +7,8 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca from typing import Union -from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem +from hub.catalog_factories.data_models.energy_systems.heat_generation_system import HeatGenerationSystem +from hub.catalog_factories.data_models.energy_systems.electricity_generation_system import ElectricityGenerationSystem from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem @@ -21,7 +22,8 @@ class System: system_id, name, demand_types, - generation_system, + heat_generation_system, + electricity_generation_system, distribution_system, emission_system): @@ -29,7 +31,8 @@ class System: self._system_id = system_id self._name = name self._demand_types = demand_types - self._generation_system = generation_system + self._heat_generation_system = heat_generation_system + self._electricity_generation_system = electricity_generation_system self._distribution_system = distribution_system self._emission_system = emission_system @@ -66,12 +69,20 @@ class System: return self._demand_types @property - def generation_system(self) -> GenerationSystem: + def heat_generation_system(self) -> HeatGenerationSystem: """ - Get generation system - :return: GenerationSystem + Get heat generation system + :return: HeatGenerationSystem """ - return self._generation_system + return self._heat_generation_system + + @property + def electricity_generation_system(self) -> ElectricityGenerationSystem: + """ + Get electricity generation system + :return: ElectricityGenerationSystem + """ + return self._electricity_generation_system @property def distribution_system(self) -> Union[None, DistributionSystem]: @@ -101,7 +112,8 @@ class System: 'name': self.name, 'level of detail': self.lod, 'demand types': self.demand_types, - 'generation system': self.generation_system.to_dictionary(), + 'heat generation system': self.heat_generation_system.to_dictionary(), + 'electricity generation system': self.electricity_generation_system.to_dictionary(), 'distribution system': _distribution_system, 'emission system': _emission_system } diff --git a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py index 91c8d4e4..e190e49a 100644 --- a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py +++ b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py @@ -10,7 +10,7 @@ import xmltodict from hub.catalog_factories.catalog import Catalog from hub.catalog_factories.data_models.energy_systems.system import System from hub.catalog_factories.data_models.energy_systems.content import Content -from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem +from hub.catalog_factories.data_models.energy_systems.heat_generation_system import GenerationSystem from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem from hub.catalog_factories.data_models.energy_systems.archetype import Archetype