diff --git a/hub/catalog_factories/data_models/energy_systems/archetype.py b/hub/catalog_factories/data_models/energy_systems/archetype.py index 4834b8cc..84bcef9a 100644 --- a/hub/catalog_factories/data_models/energy_systems/archetype.py +++ b/hub/catalog_factories/data_models/energy_systems/archetype.py @@ -1,5 +1,5 @@ """ -Energy System catalog archetype +Energy System catalog archetype, understood as a cluster of energy systems SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2023 Concordia CERC group Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca @@ -15,20 +15,11 @@ class Archetype: """ Archetype class """ - def __init__(self, lod, name, systems): + def __init__(self, name, systems): - self._lod = lod self._name = name self._systems = systems - @property - def lod(self): - """ - Get level of detail of the catalog - :return: string - """ - return self._lod - @property def name(self): """ @@ -53,7 +44,6 @@ class Archetype: content = { 'Archetype': { 'name': self.name, - 'level of detail': self.lod, 'systems': _systems } } diff --git a/hub/catalog_factories/data_models/energy_systems/content.py b/hub/catalog_factories/data_models/energy_systems/content.py index d3fd9068..9aa2927c 100644 --- a/hub/catalog_factories/data_models/energy_systems/content.py +++ b/hub/catalog_factories/data_models/energy_systems/content.py @@ -10,13 +10,11 @@ class Content: """ Content class """ - def __init__(self, archetypes, systems, generations, distributions, emissions, storages): + def __init__(self, archetypes, systems, generations=None, distributions=None): self._archetypes = archetypes self._systems = systems self._generations = generations self._distributions = distributions - self._emissions = emissions - self._storages = storages @property def archetypes(self): @@ -46,20 +44,6 @@ class Content: """ return self._distributions - @property - def emission_equipments(self): - """ - All emission equipments in the catalog - """ - return self._emissions - - @property - def storage_equipments(self): - """ - All storage equipments in the catalog - """ - return self._storages - def to_dictionary(self): """Class content to dictionary""" _archetypes = [] diff --git a/hub/catalog_factories/data_models/energy_systems/distribution_system.py b/hub/catalog_factories/data_models/energy_systems/distribution_system.py index cac9b2b3..b6836086 100644 --- a/hub/catalog_factories/data_models/energy_systems/distribution_system.py +++ b/hub/catalog_factories/data_models/energy_systems/distribution_system.py @@ -6,21 +6,27 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca """ +from typing import Union, List + +from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem + class DistributionSystem: """ Distribution system class """ - def __init__(self, system_id, name, system_type, supply_temperature, distribution_consumption_fix_flow, - distribution_consumption_variable_flow, heat_losses): + def __init__(self, system_id, model_name=None, system_type=None, supply_temperature=None, + distribution_consumption_fix_flow=None, distribution_consumption_variable_flow=None, heat_losses=None, + generation_systems=None): self._system_id = system_id - self._name = name + self._model_name = model_name self._type = system_type self._supply_temperature = supply_temperature self._distribution_consumption_fix_flow = distribution_consumption_fix_flow self._distribution_consumption_variable_flow = distribution_consumption_variable_flow self._heat_losses = heat_losses + self._generation_systems = generation_systems @property def id(self): @@ -31,12 +37,12 @@ class DistributionSystem: return self._system_id @property - def name(self): + def model_name(self): """ - Get name + Get model name :return: string """ - return self._name + return self._model_name @property def type(self): @@ -79,17 +85,29 @@ class DistributionSystem: """ return self._heat_losses + @property + def generation_systems(self) -> Union[None, List[GenerationSystem]]: + """ + Get generation systems connected to the distribution system + :return: [GenerationSystem] + """ + return self._generation_systems + def to_dictionary(self): """Class content to dictionary""" + _generation_systems = [_generation_system.to_dictionary() for _generation_system in + self.generation_systems] if self.generation_systems is not None else None + content = { 'Layer': { 'id': self.id, - 'name': self.name, + 'model name': self.model_name, 'type': self.type, 'supply temperature [Celsius]': self.supply_temperature, 'distribution consumption if fix flow over peak power [W/W]': self.distribution_consumption_fix_flow, 'distribution consumption if variable flow over peak power [J/J]': self.distribution_consumption_variable_flow, - 'heat losses per energy produced [J/J]': self.heat_losses + 'heat losses per energy produced [J/J]': self.heat_losses, + 'generation systems connected': _generation_systems } } return content diff --git a/hub/catalog_factories/data_models/energy_systems/electrical_storage_system.py b/hub/catalog_factories/data_models/energy_systems/electrical_storage_system.py index 6f5d6d14..72e22c0e 100644 --- a/hub/catalog_factories/data_models/energy_systems/electrical_storage_system.py +++ b/hub/catalog_factories/data_models/energy_systems/electrical_storage_system.py @@ -14,10 +14,12 @@ class ElectricalStorageSystem(EnergyStorageSystem): Energy Storage System Class """ - def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio, - rated_output_power, nominal_efficiency, battery_voltage, depth_of_discharge, self_discharge_rate): + def __init__(self, storage_id, model_name=None, manufacturer=None, storage_type=None, + nominal_capacity=None, losses_ratio=None, rated_output_power=None, nominal_efficiency=None, + battery_voltage=None, depth_of_discharge=None, self_discharge_rate=None): - super().__init__(storage_id, name, model_name, manufacturer, nominal_capacity, losses_ratio) + super().__init__(storage_id, model_name, manufacturer, nominal_capacity, losses_ratio) + self._type_energy_stored = 'electrical' self._storage_type = storage_type self._rated_output_power = rated_output_power self._nominal_efficiency = nominal_efficiency @@ -25,10 +27,18 @@ class ElectricalStorageSystem(EnergyStorageSystem): self._depth_of_discharge = depth_of_discharge self._self_discharge_rate = self_discharge_rate + @property + def type_energy_stored(self): + """ + Get type of energy stored from ['electrical', 'thermal'] + :return: string + """ + return self._type_energy_stored + @property def storage_type(self): """ - Get storage type from ['electrical', 'lithium_ion', 'lead_acid', 'NiCd'] + Get storage type from ['lithium_ion', 'lead_acid', 'NiCd'] :return: string """ return self._storage_type @@ -44,7 +54,7 @@ class ElectricalStorageSystem(EnergyStorageSystem): @property def nominal_efficiency(self): """ - Get the nominal efficiency of the storage system + Get the nominal efficiency of the storage system :return: float """ return self._nominal_efficiency @@ -77,7 +87,7 @@ class ElectricalStorageSystem(EnergyStorageSystem): """Class content to dictionary""" content = {'Storage component': { 'storage id': self.id, - 'name': self.name, + 'type of energy stored': self.type_energy_stored, 'model name': self.model_name, 'manufacturer': self.manufacturer, 'storage type': self.storage_type, diff --git a/hub/catalog_factories/data_models/energy_systems/emission_system.py b/hub/catalog_factories/data_models/energy_systems/emission_system.py index 5e9d2865..a8ac91b6 100644 --- a/hub/catalog_factories/data_models/energy_systems/emission_system.py +++ b/hub/catalog_factories/data_models/energy_systems/emission_system.py @@ -10,10 +10,10 @@ class EmissionSystem: """ Emission system class """ - def __init__(self, system_id, name, system_type, parasitic_energy_consumption): + def __init__(self, system_id, model_name=None, system_type=None, parasitic_energy_consumption=None): self._system_id = system_id - self._name = name + self._model_name = model_name self._type = system_type self._parasitic_energy_consumption = parasitic_energy_consumption @@ -26,12 +26,12 @@ class EmissionSystem: return self._system_id @property - def name(self): + def model_name(self): """ - Get name + Get model name :return: string """ - return self._name + return self._model_name @property def type(self): @@ -52,7 +52,7 @@ class EmissionSystem: def to_dictionary(self): """Class content to dictionary""" content = {'Layer': {'id': self.id, - 'name': self.name, + 'model name': self.model_name, 'type': self.type, 'parasitic energy consumption per energy produced [J/J]': self.parasitic_energy_consumption } diff --git a/hub/catalog_factories/data_models/energy_systems/energy_storage_system.py b/hub/catalog_factories/data_models/energy_systems/energy_storage_system.py index a5302cb4..56a5667d 100644 --- a/hub/catalog_factories/data_models/energy_systems/energy_storage_system.py +++ b/hub/catalog_factories/data_models/energy_systems/energy_storage_system.py @@ -14,9 +14,9 @@ class EnergyStorageSystem(ABC): Energy Storage System Abstract Class """ - def __init__(self, storage_id, name, model_name, manufacturer, nominal_capacity, losses_ratio): + def __init__(self, storage_id, model_name=None, manufacturer=None, + nominal_capacity=None, losses_ratio=None): self._storage_id = storage_id - self._name = name self._model_name = model_name self._manufacturer = manufacturer self._nominal_capacity = nominal_capacity @@ -31,12 +31,12 @@ class EnergyStorageSystem(ABC): return self._storage_id @property - def name(self): + def type_energy_stored(self): """ - Get storage name + Get type of energy stored from ['electrical', 'thermal'] :return: string """ - return self._name + raise NotImplementedError @property def model_name(self): diff --git a/hub/catalog_factories/data_models/energy_systems/generation_system.py b/hub/catalog_factories/data_models/energy_systems/generation_system.py index c2fd9a75..3849a039 100644 --- a/hub/catalog_factories/data_models/energy_systems/generation_system.py +++ b/hub/catalog_factories/data_models/energy_systems/generation_system.py @@ -6,53 +6,23 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca """ -from typing import Union -from hub.catalog_factories.data_models.energy_systems.performance_curves import PerformanceCurves +from abc import ABC +from typing import List, Union, TypeVar + +DistributionSystem = TypeVar('DistributionSystem') -class GenerationSystem: +class GenerationSystem(ABC): """ Heat Generation system class """ - def __init__(self, system_id, name, model_name, manufacturer, system_type, fuel_type, nominal_thermal_output, - maximum_heat_output, minimum_heat_output, source_medium, supply_medium, heat_efficiency, - nominal_cooling_output, maximum_cooling_output, minimum_cooling_output, cooling_efficiency, - electricity_efficiency, source_temperature, source_mass_flow, nominal_electricity_output, - maximum_heat_supply_temperature, minimum_heat_supply_temperature, - maximum_cooling_supply_temperature, minimum_cooling_supply_temperature, heat_output_curve, - heat_fuel_consumption_curve, heat_efficiency_curve, cooling_output_curve, cooling_fuel_consumption_curve, - cooling_efficiency_curve): + def __init__(self, system_id, model_name=None, manufacturer=None, fuel_type=None, distribution_systems=None): self._system_id = system_id - self._name = name 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._maximum_heat_output = maximum_heat_output - self._minimum_heat_output = minimum_heat_output - self._heat_efficiency = heat_efficiency - self._nominal_cooling_output = nominal_cooling_output - self._maximum_cooling_output = maximum_cooling_output - self._minimum_cooling_output = minimum_cooling_output - self._cooling_efficiency = cooling_efficiency - self._electricity_efficiency = electricity_efficiency - self._nominal_electricity_output = nominal_electricity_output - self._source_medium = source_medium - self._source_temperature = source_temperature - self._source_mass_flow = source_mass_flow - self._supply_medium = supply_medium - self._maximum_heat_supply_temperature = maximum_heat_supply_temperature - self._minimum_heat_supply_temperature = minimum_heat_supply_temperature - self._maximum_cooling_supply_temperature = maximum_cooling_supply_temperature - self._minimum_cooling_supply_temperature = minimum_cooling_supply_temperature - self._heat_output_curve = heat_output_curve - self._heat_fuel_consumption_curve = heat_fuel_consumption_curve - self._heat_efficiency_curve = heat_efficiency_curve - self._cooling_output_curve = cooling_output_curve - self._cooling_fuel_consumption_curve = cooling_fuel_consumption_curve - self._cooling_efficiency_curve = cooling_efficiency_curve + self._distribution_systems = distribution_systems @property def id(self): @@ -63,12 +33,12 @@ class GenerationSystem: return self._system_id @property - def name(self): + def system_type(self): """ - Get name + Get type :return: string """ - return self._name + raise NotImplementedError @property def model_name(self): @@ -86,14 +56,6 @@ class GenerationSystem: """ return self._manufacturer - @property - def system_type(self): - """ - Get type - :return: string - """ - return self._system_type - @property def fuel_type(self): """ @@ -103,230 +65,13 @@ class GenerationSystem: return self._fuel_type @property - def nominal_thermal_output(self): + def distribution_systems(self) -> Union[None, List[DistributionSystem]]: """ - Get nominal_thermal_output of heat generation devices in kW - :return: float + Get distributions systems connected to this generation system + :return: [DistributionSystems] """ - return self._nominal_thermal_output - - @property - def maximum_heat_output(self): - """ - Get maximum heat output of heat generation devices in W - :return: float - """ - return self._maximum_heat_output - - @property - def minimum_heat_output(self): - """ - Get minimum heat output of heat generation devices in W - :return: float - """ - return self._minimum_heat_output - - @property - def source_medium(self): - """ - Get source_type from [air, water, ground, district_heating, grid, on_site_electricity] - :return: [string] - """ - return self._source_medium - - @property - def supply_medium(self): - """ - Get the supply medium from ['air', 'water'] - :return: string - """ - return self._supply_medium - - @property - def heat_efficiency(self): - """ - Get heat_efficiency - :return: float - """ - return self._heat_efficiency - - @property - def nominal_cooling_output(self): - """ - Get nominal_thermal_output of heat generation devices in kW - :return: float - """ - return self._nominal_cooling_output - - @property - def maximum_cooling_output(self): - """ - Get maximum heat output of heat generation devices in W - :return: float - """ - return self._maximum_cooling_output - - @property - def minimum_cooling_output(self): - """ - Get minimum heat output of heat generation devices in W - :return: float - """ - return self._minimum_cooling_output - - @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 nominal_electricity_output(self): - """ - Get nominal_power_output of electricity generation devices or inverters in kW - :return: float - """ - return self._nominal_electricity_output - - @property - def maximum_heat_supply_temperature(self): - """ - Get the maximum heat supply temperature in degree Celsius - :return: float - """ - return self._minimum_heat_supply_temperature - - @property - def minimum_heat_supply_temperature(self): - """ - Get the minimum heat supply temperature in degree Celsius - :return: float - """ - return self._minimum_heat_supply_temperature - - @property - def maximum_cooling_supply_temperature(self): - """ - Get the maximum cooling supply temperature in degree Celsius - :return: float - """ - return self._maximum_cooling_supply_temperature - - @property - def minimum_cooling_supply_temperature(self): - """ - Get the minimum cooling supply temperature in degree Celsius - :return: float - """ - return self._minimum_cooling_supply_temperature - - @property - def heat_output_curve(self) -> Union[None, PerformanceCurves]: - """ - Get the heat output curve of the heat generation device - :return: PerformanceCurve - """ - return self._heat_output_curve - - @property - def heat_fuel_consumption_curve(self) -> Union[None, PerformanceCurves]: - """ - Get the heating fuel consumption curve of the heat generation device - :return: PerformanceCurve - """ - return self._heat_fuel_consumption_curve - - @property - def heat_efficiency_curve(self) -> Union[None, PerformanceCurves]: - """ - Get the heating efficiency curve of the heat generation device - :return: PerformanceCurve - """ - return self._heat_efficiency_curve - - @property - def cooling_output_curve(self) -> Union[None, PerformanceCurves]: - """ - Get the heat output curve of the heat generation device - :return: PerformanceCurve - """ - return self._cooling_output_curve - - @property - def cooling_fuel_consumption_curve(self) -> Union[None, PerformanceCurves]: - """ - Get the heating fuel consumption curve of the heat generation device - :return: PerformanceCurve - """ - return self._cooling_fuel_consumption_curve - - @property - def cooling_efficiency_curve(self) -> Union[None, PerformanceCurves]: - """ - Get the heating efficiency curve of the heat generation device - :return: PerformanceCurve - """ - return self._cooling_efficiency_curve + return self._distribution_systems def to_dictionary(self): """Class content to dictionary""" - content = {'Energy Generation component': { - 'id': self.id, - 'name': self.name, - 'model name': self.model_name, - 'manufacturer': self.manufacturer, - 'type': self.system_type, - 'fuel type': self.fuel_type, - 'nominal thermal output [W]': self.nominal_thermal_output, - 'maximum heat output [W]': self.maximum_heat_output, - 'minimum heat output [W]': self.minimum_heat_output, - 'source medium': self.source_medium, - 'supply medium': self.supply_medium, - 'source temperature [Celsius]': self.source_temperature, - 'source mass flow [kg/s]': self.source_mass_flow, - 'heat efficiency': self.heat_efficiency, - 'nominal cooling output [W]': self.nominal_cooling_output, - 'maximum cooling output [W]': self.maximum_cooling_output, - 'minimum cooling output [W]': self.minimum_cooling_output, - 'cooling efficiency': self.cooling_efficiency, - 'electricity efficiency': self.electricity_efficiency, - 'nominal power output [W]': self.nominal_electricity_output, - 'maximum heating supply temperature [Celsius]': self.maximum_heat_supply_temperature, - 'minimum heating supply temperature [Celsius]': self.minimum_heat_supply_temperature, - 'maximum cooling supply temperature [Celsius]': self.maximum_cooling_supply_temperature, - 'minimum cooling supply temperature [Celsius]': self.minimum_cooling_supply_temperature, - 'heat output curve': self.heat_output_curve, - 'heat fuel consumption curve': self.heat_fuel_consumption_curve, - 'heat efficiency curve': self.heat_efficiency_curve, - 'cooling output curve': self.cooling_output_curve, - 'cooling fuel consumption curve': self.cooling_fuel_consumption_curve, - 'cooling efficiency curve': self.cooling_efficiency_curve - } - } - return content + raise NotImplementedError diff --git a/hub/catalog_factories/data_models/energy_systems/non_pv_generation_system.py b/hub/catalog_factories/data_models/energy_systems/non_pv_generation_system.py new file mode 100644 index 00000000..b9780df5 --- /dev/null +++ b/hub/catalog_factories/data_models/energy_systems/non_pv_generation_system.py @@ -0,0 +1,294 @@ +""" +Energy System catalog non PV 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 typing import Union +from hub.catalog_factories.data_models.energy_systems.performance_curves import PerformanceCurves +from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem + + +class NonPvGenerationSystem(GenerationSystem): + """ + Non PV Generation system class + """ + + def __init__(self, system_id, system_type, model_name=None, manufacturer=None, fuel_type=None, + nominal_thermal_output=None, maximum_heat_output=None, minimum_heat_output=None, source_medium=None, + supply_medium=None, heat_efficiency=None, nominal_cooling_output=None, maximum_cooling_output=None, + minimum_cooling_output=None, cooling_efficiency=None, electricity_efficiency=None, + source_temperature=None, source_mass_flow=None, nominal_electricity_output=None, + maximum_heat_supply_temperature=None, minimum_heat_supply_temperature=None, + maximum_cooling_supply_temperature=None, minimum_cooling_supply_temperature=None, heat_output_curve=None, + heat_fuel_consumption_curve=None, heat_efficiency_curve=None, cooling_output_curve=None, + cooling_fuel_consumption_curve=None, cooling_efficiency_curve=None): + super().__init__(system_id=system_id, model_name=model_name, manufacturer=manufacturer, fuel_type=fuel_type) + self._system_type = system_type + self._nominal_thermal_output = nominal_thermal_output + self._maximum_heat_output = maximum_heat_output + self._minimum_heat_output = minimum_heat_output + self._heat_efficiency = heat_efficiency + self._nominal_cooling_output = nominal_cooling_output + self._maximum_cooling_output = maximum_cooling_output + self._minimum_cooling_output = minimum_cooling_output + self._cooling_efficiency = cooling_efficiency + self._electricity_efficiency = electricity_efficiency + self._nominal_electricity_output = nominal_electricity_output + self._source_medium = source_medium + self._source_temperature = source_temperature + self._source_mass_flow = source_mass_flow + self._supply_medium = supply_medium + self._maximum_heat_supply_temperature = maximum_heat_supply_temperature + self._minimum_heat_supply_temperature = minimum_heat_supply_temperature + self._maximum_cooling_supply_temperature = maximum_cooling_supply_temperature + self._minimum_cooling_supply_temperature = minimum_cooling_supply_temperature + self._heat_output_curve = heat_output_curve + self._heat_fuel_consumption_curve = heat_fuel_consumption_curve + self._heat_efficiency_curve = heat_efficiency_curve + self._cooling_output_curve = cooling_output_curve + self._cooling_fuel_consumption_curve = cooling_fuel_consumption_curve + self._cooling_efficiency_curve = cooling_efficiency_curve + + @property + def system_type(self): + """ + Get type + :return: string + """ + return self._system_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 maximum_heat_output(self): + """ + Get maximum heat output of heat generation devices in W + :return: float + """ + return self._maximum_heat_output + + @property + def minimum_heat_output(self): + """ + Get minimum heat output of heat generation devices in W + :return: float + """ + return self._minimum_heat_output + + @property + def source_medium(self): + """ + Get source_type from [air, water, ground, district_heating, grid, on_site_electricity] + :return: [string] + """ + return self._source_medium + + @property + def supply_medium(self): + """ + Get the supply medium from ['air', 'water'] + :return: string + """ + return self._supply_medium + + @property + def heat_efficiency(self): + """ + Get heat_efficiency + :return: float + """ + return self._heat_efficiency + + @property + def nominal_cooling_output(self): + """ + Get nominal_thermal_output of heat generation devices in kW + :return: float + """ + return self._nominal_cooling_output + + @property + def maximum_cooling_output(self): + """ + Get maximum heat output of heat generation devices in W + :return: float + """ + return self._maximum_cooling_output + + @property + def minimum_cooling_output(self): + """ + Get minimum heat output of heat generation devices in W + :return: float + """ + return self._minimum_cooling_output + + @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 nominal_electricity_output(self): + """ + Get nominal_power_output of electricity generation devices or inverters in kW + :return: float + """ + return self._nominal_electricity_output + + @property + def maximum_heat_supply_temperature(self): + """ + Get the maximum heat supply temperature in degree Celsius + :return: float + """ + return self._minimum_heat_supply_temperature + + @property + def minimum_heat_supply_temperature(self): + """ + Get the minimum heat supply temperature in degree Celsius + :return: float + """ + return self._minimum_heat_supply_temperature + + @property + def maximum_cooling_supply_temperature(self): + """ + Get the maximum cooling supply temperature in degree Celsius + :return: float + """ + return self._maximum_cooling_supply_temperature + + @property + def minimum_cooling_supply_temperature(self): + """ + Get the minimum cooling supply temperature in degree Celsius + :return: float + """ + return self._minimum_cooling_supply_temperature + + @property + def heat_output_curve(self) -> Union[None, PerformanceCurves]: + """ + Get the heat output curve of the heat generation device + :return: PerformanceCurve + """ + return self._heat_output_curve + + @property + def heat_fuel_consumption_curve(self) -> Union[None, PerformanceCurves]: + """ + Get the heating fuel consumption curve of the heat generation device + :return: PerformanceCurve + """ + return self._heat_fuel_consumption_curve + + @property + def heat_efficiency_curve(self) -> Union[None, PerformanceCurves]: + """ + Get the heating efficiency curve of the heat generation device + :return: PerformanceCurve + """ + return self._heat_efficiency_curve + + @property + def cooling_output_curve(self) -> Union[None, PerformanceCurves]: + """ + Get the heat output curve of the heat generation device + :return: PerformanceCurve + """ + return self._cooling_output_curve + + @property + def cooling_fuel_consumption_curve(self) -> Union[None, PerformanceCurves]: + """ + Get the heating fuel consumption curve of the heat generation device + :return: PerformanceCurve + """ + return self._cooling_fuel_consumption_curve + + @property + def cooling_efficiency_curve(self) -> Union[None, PerformanceCurves]: + """ + Get the heating efficiency curve of the heat generation device + :return: PerformanceCurve + """ + return self._cooling_efficiency_curve + + def to_dictionary(self): + """Class content to dictionary""" + _distribution_systems = [_distribution_system.to_dictionary() for _distribution_system in + self.distribution_systems] if self.distribution_systems is not None else None + content = { + 'Energy Generation component': + { + 'id': self.id, + 'model name': self.model_name, + 'manufacturer': self.manufacturer, + 'type': self.system_type, + 'fuel type': self.fuel_type, + 'nominal thermal output [W]': self.nominal_thermal_output, + 'maximum heat output [W]': self.maximum_heat_output, + 'minimum heat output [W]': self.minimum_heat_output, + 'source medium': self.source_medium, + 'supply medium': self.supply_medium, + 'source temperature [Celsius]': self.source_temperature, + 'source mass flow [kg/s]': self.source_mass_flow, + 'heat efficiency': self.heat_efficiency, + 'nominal cooling output [W]': self.nominal_cooling_output, + 'maximum cooling output [W]': self.maximum_cooling_output, + 'minimum cooling output [W]': self.minimum_cooling_output, + 'cooling efficiency': self.cooling_efficiency, + 'electricity efficiency': self.electricity_efficiency, + 'nominal power output [W]': self.nominal_electricity_output, + 'maximum heating supply temperature [Celsius]': self.maximum_heat_supply_temperature, + 'minimum heating supply temperature [Celsius]': self.minimum_heat_supply_temperature, + 'maximum cooling supply temperature [Celsius]': self.maximum_cooling_supply_temperature, + 'minimum cooling supply temperature [Celsius]': self.minimum_cooling_supply_temperature, + 'heat output curve': self.heat_output_curve, + 'heat fuel consumption curve': self.heat_fuel_consumption_curve, + 'heat efficiency curve': self.heat_efficiency_curve, + 'cooling output curve': self.cooling_output_curve, + 'cooling fuel consumption curve': self.cooling_fuel_consumption_curve, + 'cooling efficiency curve': self.cooling_efficiency_curve, + 'distribution systems connected': _distribution_systems + } + } + return content diff --git a/hub/catalog_factories/data_models/energy_systems/pv_generation_system.py b/hub/catalog_factories/data_models/energy_systems/pv_generation_system.py index ce0e71f1..ce037239 100644 --- a/hub/catalog_factories/data_models/energy_systems/pv_generation_system.py +++ b/hub/catalog_factories/data_models/energy_systems/pv_generation_system.py @@ -14,26 +14,15 @@ class PvGenerationSystem(GenerationSystem): Electricity Generation system class """ - def __init__(self, system_id, name, model_name, manufacturer, electricity_efficiency, - nominal_electricity_output, nominal_ambient_temperature, nominal_cell_temperature, - nominal_radiation, standard_test_condition_cell_temperature, standard_test_condition_maximum_power, - cell_temperature_coefficient, width, height): - super().__init__(system_id=system_id, name=name, model_name=model_name, - manufacturer=manufacturer, system_type='pv', fuel_type='renewable', - nominal_thermal_output=None, maximum_heat_output=None, - minimum_heat_output=None, source_medium=None, - supply_medium=None, heat_efficiency=None, nominal_cooling_output=None, - maximum_cooling_output=None, minimum_cooling_output=None, - cooling_efficiency=None, electricity_efficiency=electricity_efficiency, - source_temperature=None, source_mass_flow=None, - nominal_electricity_output=nominal_electricity_output, - maximum_heat_supply_temperature=None, - minimum_heat_supply_temperature=None, - maximum_cooling_supply_temperature=None, - minimum_cooling_supply_temperature=None, heat_output_curve=None, - heat_fuel_consumption_curve=None, heat_efficiency_curve=None, - cooling_output_curve=None, cooling_fuel_consumption_curve=None, - cooling_efficiency_curve=None) + def __init__(self, system_id, model_name=None, manufacturer=None, electricity_efficiency=None, + nominal_electricity_output=None, nominal_ambient_temperature=None, nominal_cell_temperature=None, + nominal_radiation=None, standard_test_condition_cell_temperature=None, + standard_test_condition_maximum_power=None, cell_temperature_coefficient=None, width=None, height=None): + super().__init__(system_id=system_id, model_name=model_name, + manufacturer=manufacturer, fuel_type='renewable') + self._system_type = 'PV' + self._electricity_efficiency = electricity_efficiency + self._nominal_electricity_output = nominal_electricity_output self._nominal_ambient_temperature = nominal_ambient_temperature self._nominal_cell_temperature = nominal_cell_temperature self._nominal_radiation = nominal_radiation @@ -43,6 +32,30 @@ class PvGenerationSystem(GenerationSystem): self._width = width self._height = height + @property + def system_type(self): + """ + Get type + :return: string + """ + return self._system_type + + @property + def nominal_electricity_output(self): + """ + Get nominal_power_output of electricity generation devices or inverters in kW + :return: float + """ + return self._nominal_electricity_output + + @property + def electricity_efficiency(self): + """ + Get electricity_efficiency + :return: float + """ + return self._electricity_efficiency + @property def nominal_ambient_temperature(self): """ @@ -109,23 +122,27 @@ class PvGenerationSystem(GenerationSystem): def to_dictionary(self): """Class content to dictionary""" - content = {'Energy Generation component': { - 'id': self.id, - 'name': self.name, - 'model name': self.model_name, - 'manufacturer': self.manufacturer, - 'type': self.system_type, - 'fuel type': self.fuel_type, - 'electricity efficiency': self.electricity_efficiency, - 'nominal power output [kW]': self.nominal_electricity_output, - '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, - 'cell temperature coefficient': self.cell_temperature_coefficient, - 'width': self.width, - 'height': self.height, - } + _distribution_systems = [_distribution_system.to_dictionary() for _distribution_system in + self.distribution_systems] if self.distribution_systems is not None else None + content = { + 'Energy Generation component': + { + 'id': self.id, + 'model name': self.model_name, + 'manufacturer': self.manufacturer, + 'type': self.system_type, + 'fuel type': self.fuel_type, + 'electricity efficiency': self.electricity_efficiency, + 'nominal power output [kW]': self.nominal_electricity_output, + '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, + 'cell temperature coefficient': self.cell_temperature_coefficient, + 'width': self.width, + 'height': self.height, + 'distribution systems connected': _distribution_systems + } } 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 30ee9292..3479e0dc 100644 --- a/hub/catalog_factories/data_models/energy_systems/system.py +++ b/hub/catalog_factories/data_models/energy_systems/system.py @@ -1,5 +1,5 @@ """ -Energy System catalog heat generation system +Energy Systems catalog 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 @@ -7,12 +7,10 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca """ from typing import Union, List +from pathlib import Path from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem -from hub.catalog_factories.data_models.energy_systems.thermal_storage_system import ThermalStorageSystem -from hub.catalog_factories.data_models.energy_systems.electrical_storage_system import ElectricalStorageSystem from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem -from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem class System: @@ -21,15 +19,14 @@ class System: """ def __init__(self, - lod, system_id, - name, demand_types, - generation_systems, - distribution_systems, - emission_systems, - energy_storage_systems): - self._lod = lod + name=None, + generation_systems=None, + distribution_systems=None, + emission_systems=None, + energy_storage_systems=None, + configuration_schema=None): self._system_id = system_id self._name = name self._demand_types = demand_types @@ -37,15 +34,7 @@ class System: self._emission_systems = emission_systems self._generation_systems = generation_systems self._energy_storage_systems = energy_storage_systems - # self._configuration = configuration - - @property - def lod(self): - """ - Get level of detail of the catalog - :return: string - """ - return self._lod + self._configuration_schema = configuration_schema @property def id(self): @@ -72,7 +61,7 @@ class System: return self._demand_types @property - def generation_systems(self) -> List[GenerationSystem]: + def generation_systems(self) -> Union[None, List[GenerationSystem]]: """ Get generation systems :return: [GenerationSystem] @@ -88,20 +77,12 @@ class System: return self._distribution_systems @property - def emission_systems(self) -> Union[None, List[EmissionSystem]]: + def configuration_schema(self) -> Path: """ - Get emission systems - :return: [EmissionSystem] + Get system configuration schema + :return: Path """ - return self._emission_systems - - @property - def energy_storage_systems(self) -> Union[None, List[ThermalStorageSystem], List[ElectricalStorageSystem]]: - """ - Get energy storage systems - :return: [EnergyStorageSystem] - """ - return self._energy_storage_systems + return self._configuration_schema def to_dictionary(self): """Class content to dictionary""" @@ -110,19 +91,12 @@ class System: _generation_systems.append(_generation.to_dictionary()) _distribution_systems = [_distribution.to_dictionary() for _distribution in self.distribution_systems] if self.distribution_systems is not None else None - _emission_systems = [_emission.to_dictionary() for _emission in - self.emission_systems] if self.emission_systems is not None else None - _storage_systems = [_storage.to_dictionary() for _storage in - self.energy_storage_systems] if self.energy_storage_systems is not None else None content = {'system': {'id': self.id, 'name': self.name, - 'level of detail': self.lod, 'demand types': self.demand_types, 'generation system(s)': _generation_systems, - 'distribution system(s)': _distribution_systems, - 'emission system(s)': _emission_systems, - 'energy storage system(s)': _storage_systems, + 'distribution system(s)': _distribution_systems } } return content diff --git a/hub/catalog_factories/data_models/energy_systems/thermal_storage_system.py b/hub/catalog_factories/data_models/energy_systems/thermal_storage_system.py index 71b4f931..db10840b 100644 --- a/hub/catalog_factories/data_models/energy_systems/thermal_storage_system.py +++ b/hub/catalog_factories/data_models/energy_systems/thermal_storage_system.py @@ -15,16 +15,26 @@ class ThermalStorageSystem(EnergyStorageSystem): Energy Storage System Class """ - def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio, - volume, height, layers, maximum_operating_temperature): + def __init__(self, storage_id, model_name=None, manufacturer=None, storage_type=None, + nominal_capacity=None, losses_ratio=None, volume=None, height=None, layers=None, + maximum_operating_temperature=None): - super().__init__(storage_id, name, model_name, manufacturer, nominal_capacity, losses_ratio) + super().__init__(storage_id, model_name, manufacturer, nominal_capacity, losses_ratio) + self._type_energy_stored = 'thermal' self._storage_type = storage_type self._volume = volume self._height = height self._layers = layers self._maximum_operating_temperature = maximum_operating_temperature + @property + def type_energy_stored(self): + """ + Get type of energy stored from ['electrical', 'thermal'] + :return: string + """ + return self._type_energy_stored + @property def storage_type(self): """ @@ -72,18 +82,20 @@ class ThermalStorageSystem(EnergyStorageSystem): _layers = [] for _layer in self.layers: _layers.append(_layer.to_dictionary()) - content = {'Storage component': { - 'storage id': self.id, - 'name': self.name, - 'model name': self.model_name, - 'manufacturer': self.manufacturer, - 'storage type': self.storage_type, - 'nominal capacity [J]': self.nominal_capacity, - 'losses-ratio [J/J]': self.losses_ratio, - 'volume [m3]': self.volume, - 'height [m]': self.height, - 'layers': _layers, - 'maximum operating temperature [Celsius]': self.maximum_operating_temperature - } + content = { + 'Storage component': + { + 'storage id': self.id, + 'type of energy stored': self.type_energy_stored, + 'model name': self.model_name, + 'manufacturer': self.manufacturer, + 'storage type': self.storage_type, + 'nominal capacity [J]': self.nominal_capacity, + 'losses-ratio [J/J]': self.losses_ratio, + 'volume [m3]': self.volume, + 'height [m]': self.height, + 'layers': _layers, + 'maximum operating temperature [Celsius]': self.maximum_operating_temperature + } } return content diff --git a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py index ee88b19c..c8ba7011 100644 --- a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py +++ b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py @@ -10,7 +10,8 @@ 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.non_pv_generation_system import NonPvGenerationSystem +from hub.catalog_factories.data_models.energy_systems.pv_generation_system import PvGenerationSystem 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 @@ -29,7 +30,6 @@ class MontrealCustomCatalog(Catalog): self._archetypes = xmltodict.parse(xml.read(), force_list=('system', 'system_cluster', 'equipment', 'demand', 'system_id')) - self._lod = float(self._archetypes['catalog']['@lod']) self._catalog_generation_equipments, self._catalog_storage_equipments = self._load_generation_and_storage_equipments() self._catalog_distribution_equipments = self._load_distribution_equipments() self._catalog_emission_equipments = self._load_emission_equipments() @@ -39,9 +39,7 @@ class MontrealCustomCatalog(Catalog): self._content = Content(self._catalog_archetypes, self._catalog_systems, self._catalog_generation_equipments, - self._catalog_distribution_equipments, - self._catalog_emission_equipments, - None) + self._catalog_distribution_equipments) def _load_generation_and_storage_equipments(self): _equipments = [] @@ -51,7 +49,7 @@ class MontrealCustomCatalog(Catalog): equipment_id = float(equipment['@id']) equipment_type = equipment['@type'] fuel_type = equipment['@fuel_type'] - name = equipment['name'] + model_name = equipment['name'] heating_efficiency = None if 'heating_efficiency' in equipment: heating_efficiency = float(equipment['heating_efficiency']) @@ -61,46 +59,27 @@ class MontrealCustomCatalog(Catalog): electricity_efficiency = None if 'electrical_efficiency' in equipment: electricity_efficiency = float(equipment['electrical_efficiency']) - # todo: this may be optionals instead? - generation_system = GenerationSystem(equipment_id, - name, - None, - None, - equipment_type, - fuel_type, - None, - None, - None, - None, - None, - heating_efficiency, - None, - None, - None, - cooling_efficiency, - electricity_efficiency, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None) + if model_name == 'PV system': + generation_system = PvGenerationSystem(equipment_id, + model_name=model_name, + electricity_efficiency=electricity_efficiency, + ) + else: + generation_system = NonPvGenerationSystem(equipment_id, + model_name=model_name, + system_type=equipment_type, + fuel_type=fuel_type, + heat_efficiency=heating_efficiency, + cooling_efficiency=cooling_efficiency, + electricity_efficiency=electricity_efficiency, + ) _equipments.append(generation_system) storage = literal_eval(equipment['storage'].capitalize()) if storage: if equipment_type == 'electricity generator': - storage_system = ElectricalStorageSystem(equipment_id, None, None, None, 'electrical', None, None, None, None, - None, None, None) + storage_system = ElectricalStorageSystem(equipment_id) else: - storage_system = ThermalStorageSystem(equipment_id, None, None, None, 'thermal', None, None, None, None, None, - None) + storage_system = ThermalStorageSystem(equipment_id) _storages.append(storage_system) return _equipments, _storages @@ -111,7 +90,7 @@ class MontrealCustomCatalog(Catalog): for equipment in equipments: equipment_id = float(equipment['@id']) equipment_type = equipment['@type'] - name = equipment['name'] + model_name = equipment['name'] distribution_heat_losses = None if 'distribution_heat_losses' in equipment: distribution_heat_losses = float(equipment['distribution_heat_losses']['#text']) / 100 @@ -124,12 +103,11 @@ class MontrealCustomCatalog(Catalog): equipment['distribution_consumption_variable_flow']['#text']) / 100 distribution_system = DistributionSystem(equipment_id, - name, - equipment_type, - None, - distribution_consumption_fix_flow, - distribution_consumption_variable_flow, - distribution_heat_losses) + model_name=model_name, + system_type=equipment_type, + distribution_consumption_fix_flow=distribution_consumption_fix_flow, + distribution_consumption_variable_flow=distribution_consumption_variable_flow, + heat_losses=distribution_heat_losses) _equipments.append(distribution_system) return _equipments @@ -140,15 +118,15 @@ class MontrealCustomCatalog(Catalog): for equipment in equipments: equipment_id = float(equipment['@id']) equipment_type = equipment['@type'] - name = equipment['name'] + model_name = equipment['name'] parasitic_consumption = None if 'parasitic_consumption' in equipment: parasitic_consumption = float(equipment['parasitic_consumption']['#text']) / 100 emission_system = EmissionSystem(equipment_id, - name, - equipment_type, - parasitic_consumption) + model_name=model_name, + system_type=equipment_type, + parasitic_energy_consumption=parasitic_consumption) _equipments.append(emission_system) return _equipments @@ -180,14 +158,13 @@ class MontrealCustomCatalog(Catalog): if int(equipment_archetype.id) == int(emission_equipment): _emission_equipments = [equipment_archetype] - _catalog_systems.append(System(self._lod, - system_id, - name, + _catalog_systems.append(System(system_id, demands, - _generation_equipments, - _distribution_equipments, - _emission_equipments, - _storage_equipments)) + name=name, + generation_systems=_generation_equipments, + distribution_systems=_distribution_equipments, + emission_systems=_emission_equipments, + energy_storage_systems=_storage_equipments)) return _catalog_systems def _load_archetypes(self): @@ -201,7 +178,7 @@ class MontrealCustomCatalog(Catalog): for system_archetype in self._catalog_systems: if int(system_archetype.id) == int(system): _systems.append(system_archetype) - _catalog_archetypes.append(Archetype(self._lod, name, _systems)) + _catalog_archetypes.append(Archetype(name, _systems)) return _catalog_archetypes def names(self, category=None): @@ -217,11 +194,9 @@ class MontrealCustomCatalog(Catalog): for system in self._content.systems: _names['systems'].append(system.name) for equipment in self._content.generation_equipments: - _names['generation_equipments'].append(equipment.name) + _names['generation_equipments'].append(equipment.model_name) for equipment in self._content.distribution_equipments: - _names['distribution_equipments'].append(equipment.name) - for equipment in self._content.emission_equipments: - _names['emission_equipments'].append(equipment.name) + _names['distribution_equipments'].append(equipment.model_name) else: _names = {category: []} if category.lower() == 'archetypes': @@ -232,13 +207,10 @@ class MontrealCustomCatalog(Catalog): _names[category].append(system.name) elif category.lower() == 'generation_equipments': for system in self._content.generation_equipments: - _names[category].append(system.name) + _names[category].append(system.model_name) elif category.lower() == 'distribution_equipments': for system in self._content.distribution_equipments: - _names[category].append(system.name) - elif category.lower() == 'emission_equipments': - for system in self._content.emission_equipments: - _names[category].append(system.name) + _names[category].append(system.model_name) else: raise ValueError(f'Unknown category [{category}]') return _names @@ -258,9 +230,6 @@ class MontrealCustomCatalog(Catalog): return self._content.generation_equipments if category.lower() == 'distribution_equipments': return self._content.distribution_equipments - if category.lower() == 'emission_equipments': - return self._content.emission_equipments - raise ValueError(f'Unknown category [{category}]') def get_entry(self, name): """ @@ -274,12 +243,9 @@ class MontrealCustomCatalog(Catalog): if entry.name.lower() == name.lower(): return entry for entry in self._content.generation_equipments: - if entry.name.lower() == name.lower(): + if entry.model_name.lower() == name.lower(): return entry for entry in self._content.distribution_equipments: - if entry.name.lower() == name.lower(): - return entry - for entry in self._content.emission_equipments: - if entry.name.lower() == name.lower(): + if entry.model_name.lower() == name.lower(): return entry raise IndexError(f"{name} doesn't exists in the catalog") diff --git a/hub/catalog_factories/energy_systems/north_america_energy_system_catalog.py b/hub/catalog_factories/energy_systems/north_america_energy_system_catalog.py index 77c4287c..ea78ed97 100644 --- a/hub/catalog_factories/energy_systems/north_america_energy_system_catalog.py +++ b/hub/catalog_factories/energy_systems/north_america_energy_system_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.non_pv_generation_system import NonPvGenerationSystem from hub.catalog_factories.data_models.energy_systems.pv_generation_system import PvGenerationSystem from hub.catalog_factories.data_models.energy_systems.thermal_storage_system import ThermalStorageSystem from hub.catalog_factories.data_models.energy_systems.performance_curves import PerformanceCurves @@ -34,10 +34,7 @@ class NorthAmericaEnergySystemCatalog(Catalog): self._system_archetypes = self._load_archetypes() self._content = Content(self._system_archetypes, self._systems, - self._generation_components, - None, - None, - self._storage_components) + generations=self._generation_components) def _load_generation_components(self): generation_components = [] @@ -47,53 +44,29 @@ class NorthAmericaEnergySystemCatalog(Catalog): templates = self._archetypes['EnergySystemCatalog']['energy_generation_components']['templateGenerationEquipments'] for boiler in boilers: boiler_id = boiler['@generation_id'] - boiler_name = boiler['@name'] + system_type = boiler['@name'] boiler_model_name = boiler['@modelName'] boiler_manufacturer = boiler['@manufacturer'] - system_type = 'boiler' boiler_fuel_type = boiler['@fuel'] boiler_nominal_thermal_output = float(boiler['@installedThermalPower']) boiler_maximum_heat_output = float(boiler['@maximumHeatOutput']) boiler_minimum_heat_output = float(boiler['@minimumHeatOutput']) boiler_heat_efficiency = float(boiler['@nominalEfficiency']) - # todo: this may be optionals instead? - boiler_component = GenerationSystem(boiler_id, - boiler_name, - boiler_model_name, - boiler_manufacturer, - system_type, - boiler_fuel_type, - boiler_nominal_thermal_output, - boiler_maximum_heat_output, - boiler_minimum_heat_output, - None, - None, - boiler_heat_efficiency, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None) + boiler_component = NonPvGenerationSystem(boiler_id, + system_type, + model_name=boiler_model_name, + manufacturer=boiler_manufacturer, + fuel_type=boiler_fuel_type, + nominal_thermal_output=boiler_nominal_thermal_output, + maximum_heat_output=boiler_maximum_heat_output, + minimum_heat_output=boiler_minimum_heat_output, + heat_efficiency=boiler_heat_efficiency) generation_components.append(boiler_component) for heat_pump in heat_pumps: heat_pump_id = heat_pump['@generation_id'] - heat_pump_name = heat_pump['@name'] + system_type = heat_pump['@name'] heat_pump_model_name = heat_pump['@modelName'] heat_pump_manufacturer = heat_pump['@manufacturer'] - system_type = 'heat pump' heat_pump_fuel_type = heat_pump['@fuel'] heat_pump_nominal_thermal_output = float(heat_pump['@installedThermalPower']) heat_pump_maximum_heat_output = float(heat_pump['@maximumHeatOutput']) @@ -111,40 +84,25 @@ class NorthAmericaEnergySystemCatalog(Catalog): coefficients = list(heat_pump['performance_curve']['coefficients'].values()) cop_curve = PerformanceCurves(cop_curve_type, dependant_variable, parameters, coefficients) - heat_pump_component = GenerationSystem(heat_pump_id, - heat_pump_name, - heat_pump_model_name, - heat_pump_manufacturer, - system_type, - heat_pump_fuel_type, - heat_pump_nominal_thermal_output, - heat_pump_maximum_heat_output, - heat_pump_minimum_heat_output, - heat_pump_source_medium, - heat_pump_supply_medium, - heat_pump_nominal_cop, - None, - None, - None, - None, - None, - None, - None, - None, - heat_pump_maximum_heat_supply_temperature, - heat_pump_minimum_heat_supply_temperature, - heat_pump_maximum_cooling_supply_temperature, - heat_pump_minimum_cooling_supply_temperature, - None, - None, - cop_curve, - None, - None, - None) + heat_pump_component = NonPvGenerationSystem(heat_pump_id, + system_type, + model_name=heat_pump_model_name, + manufacturer=heat_pump_manufacturer, + fuel_type=heat_pump_fuel_type, + nominal_thermal_output=heat_pump_nominal_thermal_output, + maximum_heat_output=heat_pump_maximum_heat_output, + minimum_heat_output=heat_pump_minimum_heat_output, + source_medium=heat_pump_source_medium, + supply_medium=heat_pump_supply_medium, + heat_efficiency=heat_pump_nominal_cop, + maximum_heat_supply_temperature=heat_pump_maximum_heat_supply_temperature, + minimum_heat_supply_temperature=heat_pump_minimum_heat_supply_temperature, + maximum_cooling_supply_temperature=heat_pump_maximum_cooling_supply_temperature, + minimum_cooling_supply_temperature=heat_pump_minimum_cooling_supply_temperature, + heat_efficiency_curve=cop_curve) generation_components.append(heat_pump_component) for pv in photovoltaics: pv_id = pv['@generation_id'] - pv_name = pv['@name'] pv_model_name = pv['@modelName'] pv_manufacturer = pv['@manufacturer'] pv_electricity_efficiency = pv['@nominalEfficiency'] @@ -159,19 +117,18 @@ class NorthAmericaEnergySystemCatalog(Catalog): height = float(pv['@height']) pv_component = PvGenerationSystem(pv_id, - pv_name, - pv_model_name, - pv_manufacturer, - pv_electricity_efficiency, - pv_nominal_electricity_output, - nominal_ambient_temperature, - nominal_cell_temperature, - nominal_radiation, - standard_test_condition_cell_temperature, - standard_test_condition_maximum_power, - cell_temperature_coefficient, - width, - height) + model_name=pv_model_name, + manufacturer=pv_manufacturer, + electricity_efficiency=pv_electricity_efficiency, + nominal_electricity_output=pv_nominal_electricity_output, + nominal_ambient_temperature=nominal_ambient_temperature, + nominal_cell_temperature=nominal_cell_temperature, + nominal_radiation=nominal_radiation, + standard_test_condition_cell_temperature=standard_test_condition_cell_temperature, + standard_test_condition_maximum_power=standard_test_condition_maximum_power, + cell_temperature_coefficient=cell_temperature_coefficient, + width=width, + height=height) generation_components.append(pv_component) for template in templates: system_id = template['@generation_id'] @@ -294,7 +251,7 @@ class NorthAmericaEnergySystemCatalog(Catalog): insulation_layer = Layer(None, 'insulation', insulation_material, thickness) thickness = float(tes['physical_characteristics']['@tankThickness']) / 100 # from cm to m tank_layer = Layer(None, 'tank', tank_material, thickness) -# the convention is from outside to inside + # the convention is from outside to inside layers = [insulation_layer, tank_layer] storage_component = ThermalStorageSystem(storage_id, name, @@ -324,7 +281,7 @@ class NorthAmericaEnergySystemCatalog(Catalog): insulation_layer = Layer(None, 'insulation', insulation_material, thickness) thickness = float(template['physical_characteristics']['@tankThickness']) / 100 # from cm to m tank_layer = Layer(None, 'tank', tank_material, thickness) -# the convention is from outside to inside + # the convention is from outside to inside layers = [insulation_layer, tank_layer] storage_component = ThermalStorageSystem(storage_id, name, diff --git a/tests/test_systems_catalog.py b/tests/test_systems_catalog.py index f24808f3..4d37d965 100644 --- a/tests/test_systems_catalog.py +++ b/tests/test_systems_catalog.py @@ -23,8 +23,6 @@ class TestSystemsCatalog(TestCase): self.assertEqual(7, len(generation_equipments['generation_equipments'])) distribution_equipments = catalog.names('distribution_equipments') self.assertEqual(8, len(distribution_equipments['distribution_equipments'])) - emission_equipments = catalog.names('emission_equipments') - self.assertEqual(3, len(emission_equipments['emission_equipments'])) with self.assertRaises(ValueError): catalog.names('unknown')