From e20a700deba4d68be5a4f040601c168cf846d8a3 Mon Sep 17 00:00:00 2001 From: Saeed Ranjbar Date: Thu, 17 Aug 2023 18:48:48 -0400 Subject: [PATCH] emission_system.py is rolled back to original performance_curves.py is imported in generation_system.py The order of arguments in pv_generation_system.py is fixed Modulation range is replaced with maximum and minimum heat output in generation_system.py maximum,minimum, and nominal cooling output are also added to generation_system.py --- .../energy_systems/emission_system.py | 60 ++++++ .../energy_systems/energy_emission_system.py | 94 --------- .../energy_systems/energy_storage_system.py | 55 ++++-- .../energy_systems/generation_system.py | 182 ++++++++++++++++-- .../energy_systems/performance_curves.py | 14 +- .../energy_systems/pv_generation_system.py | 23 ++- .../data_models/energy_systems/system.py | 4 +- .../energy_systems/montreal_custom_catalog.py | 16 +- .../north_america_energy_system_catalog.py | 19 +- hub/data/energy_systems/Tools4CitiesESMF.xml | 73 ++++--- ...ontreal_custom_energy_system_parameters.py | 2 +- 11 files changed, 353 insertions(+), 189 deletions(-) create mode 100644 hub/catalog_factories/data_models/energy_systems/emission_system.py delete mode 100644 hub/catalog_factories/data_models/energy_systems/energy_emission_system.py diff --git a/hub/catalog_factories/data_models/energy_systems/emission_system.py b/hub/catalog_factories/data_models/energy_systems/emission_system.py new file mode 100644 index 00000000..5e9d2865 --- /dev/null +++ b/hub/catalog_factories/data_models/energy_systems/emission_system.py @@ -0,0 +1,60 @@ +""" +Energy System catalog emission 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 +""" + + +class EmissionSystem: + """ + Emission system class + """ + def __init__(self, system_id, name, system_type, parasitic_energy_consumption): + + self._system_id = system_id + self._name = name + self._type = system_type + self._parasitic_energy_consumption = parasitic_energy_consumption + + @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 parasitic_energy_consumption(self): + """ + Get parasitic_energy_consumption in ratio (J/J) + :return: float + """ + return self._parasitic_energy_consumption + + def to_dictionary(self): + """Class content to dictionary""" + content = {'Layer': {'id': self.id, + 'name': self.name, + 'type': self.type, + 'parasitic energy consumption per energy produced [J/J]': self.parasitic_energy_consumption + } + } + return content diff --git a/hub/catalog_factories/data_models/energy_systems/energy_emission_system.py b/hub/catalog_factories/data_models/energy_systems/energy_emission_system.py deleted file mode 100644 index 171a8fda..00000000 --- a/hub/catalog_factories/data_models/energy_systems/energy_emission_system.py +++ /dev/null @@ -1,94 +0,0 @@ -""" -Energy System catalog emission 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.catalog_factories.data_models.construction.material import Material - - -class EnergyEmissionSystem: - """ - Emission system class - """ - def __init__(self, model_name, manufacturer, system_type, parasitic_energy_consumption, nominal_heat_output, - nominal_efficiency, medium): - - self._system_id = model_name - self._name = manufacturer - self._type = system_type - self._parasitic_energy_consumption = parasitic_energy_consumption - self._nominal_heat_output = nominal_heat_output - self._nominal_efficiency = nominal_efficiency - self._medium = medium - - @property - def model_name(self): - """ - Get system id - :return: float - """ - return self._system_id - - @property - def manufacturer(self): - """ - Get name - :return: string - """ - return self._name - - @property - def type(self): - """ - Get type - :return: string - """ - return self._type - - @property - def parasitic_energy_consumption(self): - """ - Get parasitic_energy_consumption in ratio (J/J) - :return: float - """ - return self._parasitic_energy_consumption - - @property - def nominal_heat_output(self): - """ - Get the nominal heat output of the emission system in kW - :return: float - """ - return self._nominal_heat_output - - @property - def nominal_efficiency(self): - """ - Get the nominal efficiency of the emission system - :return: float - """ - return self._nominal_efficiency - - @property - def medium(self) -> Material: - """ - Get the heat transfer characteristics of the heat transfer medium - :return: Material - """ - return self._medium - - def to_dictionary(self): - """Class content to dictionary""" - content = {'Layer': {'id': self.model_name, - 'name': self.manufacturer, - 'type': self.type, - 'parasitic energy consumption per energy produced [J/J]': self.parasitic_energy_consumption, - 'nominal heat output [kW]': self.nominal_heat_output, - 'nominal efficiency': self.nominal_efficiency, - 'heat transfer medium': self.medium - } - } - return content 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 52812ca1..f898af34 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 @@ -7,8 +7,6 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca """ from __future__ import annotations -from typing import Union -from hub.catalog_factories.data_models.construction.material import Material from hub.catalog_factories.data_models.construction.layer import Layer @@ -17,9 +15,11 @@ class EnergyStorageSystem: Energy Storage System Class """ - def __init__(self, model_name, manufacturer, storage_type, volume, rated_output_power, + def __init__(self, storage_id, name, model_name, manufacturer, storage_type, volume, rated_output_power, nominal_efficiency, battery_voltage, depth_of_discharge, self_discharge_rate, height, layers, maximum_operating_temperature): + self._storage_id = storage_id + self._name = name self._model_name = model_name self._manufacturer = manufacturer self._storage_type = storage_type @@ -33,6 +33,22 @@ class EnergyStorageSystem: self._layers = layers self._maximum_operating_temperature = maximum_operating_temperature + @property + def stroage_id(self): + """ + Get storage id + :return: string + """ + return self._storage_id + + @property + def name(self): + """ + Get storage name + :return: string + """ + return self._name + @property def model_name(self): """ @@ -134,18 +150,21 @@ class EnergyStorageSystem: _layers = [] for _layer in self.layers: _layers.append(_layer.to_dictionary()) - content = {'Storage component': {'model name': self.model_name, - 'manufacturer': self.manufacturer, - 'storage type': self.storage_type, - 'physical volume [m3]': self.physical_volume, - 'rated power [kW]': self.rated_output_power, - 'nominal efficiency': self.nominal_efficiency, - 'battery voltage [V]': self.battery_voltage, - 'depth of discharge': self.depth_of_discharge, - 'self discharge rate': self.self_discharge_rate, - 'height [m]': self.height, - 'layers': _layers, - 'maximum operating temperature [Celsius]': self.maximum_operating_temperature - } - } - return content \ No newline at end of file + content = {'Storage component': { + 'storage id': self.stroage_id, + 'name': self.name, + 'model name': self.model_name, + 'manufacturer': self.manufacturer, + 'storage type': self.storage_type, + 'physical volume [m3]': self.physical_volume, + 'rated power [kW]': self.rated_output_power, + 'nominal efficiency': self.nominal_efficiency, + 'battery voltage [V]': self.battery_voltage, + 'depth of discharge': self.depth_of_discharge, + 'self discharge rate': self.self_discharge_rate, + 'height [m]': self.height, + 'layers': _layers, + 'maximum operating temperature [Celsius]': self.maximum_operating_temperature + } + } + 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 index 11560500..7fdc3130 100644 --- a/hub/catalog_factories/data_models/energy_systems/generation_system.py +++ b/hub/catalog_factories/data_models/energy_systems/generation_system.py @@ -8,6 +8,7 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca from __future__ import annotations from typing import Union +from hub.catalog_factories.data_models.energy_systems.performance_curves import PerformanceCurves class GenerationSystem: @@ -15,20 +16,29 @@ class GenerationSystem: Heat Generation system class """ - def __init__(self, model_name, manufacturer, system_type, fuel_type, nominal_thermal_output, modulation_range, - source_types, supply_medium, heat_efficiency, cooling_efficiency, electricity_efficiency, - source_temperature, source_mass_flow, nominal_electricity_output, maximum_heating_supply_temperature, - minimum_heating_supply_temperature, maximum_cooling_supply_temperature, - minimum_cooling_supply_temperature): + 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_heating_supply_temperature, minimum_heating_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, storage, auxiliary_equipment): + 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._modulation_range = modulation_range - self._source_types = source_types + self._maximum_heat_output = maximum_heat_output + self._minimum_heat_output = minimum_heat_output + self._source_medium = source_medium self._supply_medium = supply_medium 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._source_temperature = source_temperature @@ -38,6 +48,31 @@ class GenerationSystem: self._minimum_heating_supply_temperature = minimum_heating_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._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 model_name(self): @@ -80,20 +115,28 @@ class GenerationSystem: return self._nominal_thermal_output @property - def modulation_range(self): + def maximum_heat_output(self): """ - Get modulation range of heat generation devices + Get maximum heat output of heat generation devices in W :return: float """ - return self._modulation_range + return self._maximum_heat_output @property - def source_types(self): + 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_types + return self._source_medium @property def supply_medium(self): @@ -111,6 +154,30 @@ class GenerationSystem: """ 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): """ @@ -183,27 +250,108 @@ class GenerationSystem: """ 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 + + @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 = {'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': self.nominal_thermal_output, - 'modulation_range': self.modulation_range, - 'source types': self.source_types, + '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 [kW]': self.nominal_electricity_output, + 'nominal power output [W]': self.nominal_electricity_output, 'maximum heating supply temperature [Celsius]': self.maximum_heating_supply_temperature, 'minimum heating supply temperature [Celsius]': self.minimum_heating_supply_temperature, 'maximum cooling supply temperature [Celsius]': self.maximum_cooling_supply_temperature, - 'minimum cooling supply temperature [Celsius]': self.minimum_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, + 'it has storage': self.storage, + 'auxiliary equipment': _auxiliary_equipment } } return content diff --git a/hub/catalog_factories/data_models/energy_systems/performance_curves.py b/hub/catalog_factories/data_models/energy_systems/performance_curves.py index 44301bec..fb9b74ff 100644 --- a/hub/catalog_factories/data_models/energy_systems/performance_curves.py +++ b/hub/catalog_factories/data_models/energy_systems/performance_curves.py @@ -7,7 +7,7 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca """ from __future__ import annotations -from typing import Union + class PerformanceCurves: @@ -15,13 +15,13 @@ class PerformanceCurves: Parameter function class """ - def __init__(self, type, parameters, coefficients): - self._type = type + def __init__(self, curve_type, parameters, coefficients): + self._curve_type = curve_type self._parameters = parameters self._coefficients = coefficients @property - def type(self): + def curve_type(self): """ The type of the fit function from the following Linear =>>> y = a*x + b @@ -33,7 +33,7 @@ class PerformanceCurves: Get the type of function from ['linear', 'exponential', 'polynomial', 'power', 'second degree multivariable'] :return: string """ - return self._type + return self._curve_type @property def parameters(self): @@ -46,7 +46,7 @@ class PerformanceCurves: @property def coefficients(self): """ - Get the coefficients of the functions as list + Get the coefficients of the functions as list of ['a', 'b', 'c', 'd', 'e', 'f'] :return: [coefficients] """ return self._coefficients @@ -54,7 +54,7 @@ class PerformanceCurves: def to_dictionary(self): """Class content to dictionary""" content = {'Parameter Function': { - 'type': self.type, + 'curve type': self.curve_type, 'parameters': self.parameters, 'coefficients': self.coefficients, } 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 650694d2..5c03c3f3 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 @@ -7,7 +7,6 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca """ from __future__ import annotations -from typing import Union from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem @@ -16,20 +15,26 @@ class PvGenerationSystem(GenerationSystem): Electricity Generation system class """ - def __init__(self, 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, manufacturer, electricity_efficiency, - nominal_electricity_output): - super(PvGenerationSystem, self).__init__(model_name=model_name, manufacturer=manufacturer, system_type='pv', - fuel_type='renewable', nominal_thermal_output=None, modulation_range=None, - source_types=None,supply_medium=None, heat_efficiency=None, + 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(PvGenerationSystem, self).__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_heating_supply_temperature=None, minimum_heating_supply_temperature=None, maximum_cooling_supply_temperature=None, - minimum_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, storage=None, auxiliary_equipment=None) self._nominal_ambient_temperature = nominal_ambient_temperature self._nominal_cell_temperature = nominal_cell_temperature self._nominal_radiation = nominal_radiation diff --git a/hub/catalog_factories/data_models/energy_systems/system.py b/hub/catalog_factories/data_models/energy_systems/system.py index b22251f8..299b82c7 100644 --- a/hub/catalog_factories/data_models/energy_systems/system.py +++ b/hub/catalog_factories/data_models/energy_systems/system.py @@ -13,7 +13,7 @@ from hub.catalog_factories.data_models.energy_systems.pv_generation_system impor from hub.catalog_factories.data_models.energy_systems.energy_storage_system import EnergyStorageSystem from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem from hub.catalog_factories.data_models.energy_systems.performance_curves import PerformanceCurves -from hub.catalog_factories.data_models.energy_systems.energy_emission_system import EnergyEmissionSystem +from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem class System: @@ -101,7 +101,7 @@ class System: return self._distribution_system @property - def emission_system(self) -> Union[None, EnergyEmissionSystem]: + def emission_system(self) -> Union[None, EmissionSystem]: """ Get emission system :return: EmissionSystem diff --git a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py index bea78b0d..87b9d4ab 100644 --- a/hub/catalog_factories/energy_systems/montreal_custom_catalog.py +++ b/hub/catalog_factories/energy_systems/montreal_custom_catalog.py @@ -12,7 +12,7 @@ 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.distribution_system import DistributionSystem -from hub.catalog_factories.data_models.energy_systems.energy_emission_system import EnergyEmissionSystem +from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem from hub.catalog_factories.data_models.energy_systems.archetype import Archetype @@ -20,6 +20,7 @@ class MontrealCustomCatalog(Catalog): """ Montreal custom energy systems catalog class """ + def __init__(self, path): path = str(path / 'montreal_custom_systems.xml') with open(path, 'r', encoding='utf-8') as xml: @@ -90,7 +91,8 @@ class MontrealCustomCatalog(Catalog): distribution_consumption_fix_flow = float(equipment['distribution_consumption_fix_flow']['#text']) / 100 distribution_consumption_variable_flow = None if 'distribution_consumption_variable_flow' in equipment: - distribution_consumption_variable_flow = float(equipment['distribution_consumption_variable_flow']['#text']) / 100 + distribution_consumption_variable_flow = float( + equipment['distribution_consumption_variable_flow']['#text']) / 100 distribution_system = DistributionSystem(equipment_id, name, @@ -114,10 +116,10 @@ class MontrealCustomCatalog(Catalog): if 'parasitic_consumption' in equipment: parasitic_consumption = float(equipment['parasitic_consumption']['#text']) / 100 - emission_system = EnergyEmissionSystem(equipment_id, - name, - equipment_type, - parasitic_consumption) + emission_system = EmissionSystem(equipment_id, + name, + equipment_type, + parasitic_consumption) _equipments.append(emission_system) return _equipments @@ -175,7 +177,7 @@ class MontrealCustomCatalog(Catalog): """ if category is None: _names = {'archetypes': [], 'systems': [], 'generation_equipments': [], 'distribution_equipments': [], - 'emission_equipments':[]} + 'emission_equipments': []} for archetype in self._content.archetypes: _names['archetypes'].append(archetype.manufacturer) for system in self._content.systems: 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 e3a54197..cd84a6b3 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 @@ -14,7 +14,7 @@ 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.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.energy_emission_system import EnergyEmissionSystem +from hub.catalog_factories.data_models.energy_systems.emission_system import EnergyEmissionSystem from hub.catalog_factories.data_models.energy_systems.energy_storage_system import EnergyStorageSystem from hub.catalog_factories.data_models.energy_systems.performance_curves import PerformanceCurves from hub.catalog_factories.data_models.energy_systems.archetype import Archetype @@ -199,10 +199,15 @@ class NorthAmericaEnergySystemCatalog(Catalog): catalog_systems = self._archetypes['encomp:EnergySystemCatalog']['energysystemconfiguration'] for catalog_system in catalog_systems: system_configuration = catalog_system['@configurationName'] + demands = catalog_system['demands'] + demand_types = [] + for demand in demands: + name = demand['@name'] + demand_types.append(name) energy_system = System(None, None, system_configuration, - None, + demand_types, None, None, None, @@ -241,3 +246,13 @@ class NorthAmericaEnergySystemCatalog(Catalog): if _material is None: raise ValueError(f'Material not found in catalog [{material_name}]') + + def _load_demands(self): + demands = [] + _demands = self._archetypes['encomp:EnergySystemCatalog']['energydemand'] + for _demand in _demands: + demand_type = _demand['@name'] + demands.append(demand_type) + return demands + + # def _search_demands(self, config_name): diff --git a/hub/data/energy_systems/Tools4CitiesESMF.xml b/hub/data/energy_systems/Tools4CitiesESMF.xml index ef96db92..0270f61c 100644 --- a/hub/data/energy_systems/Tools4CitiesESMF.xml +++ b/hub/data/energy_systems/Tools4CitiesESMF.xml @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - - - - - + + + + + - - - - - - - - - + + + + + + + + + @@ -49,11 +49,20 @@ - + + + + + + + + + + - + diff --git a/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py b/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py index 9b3f7a61..3982221b 100644 --- a/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py +++ b/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py @@ -92,7 +92,7 @@ class MontrealCustomEnergySystemParameters: _type] _fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_equipment.fuel_type] _generation_system.fuel_type = _fuel_type - _generation_system.source_types = archetype_generation_equipment.source_types + _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