From 841098b615a714bae7e409731b47f6f6be83d351 Mon Sep 17 00:00:00 2001 From: s_ranjbar Date: Fri, 10 May 2024 13:27:29 -0400 Subject: [PATCH] fix: energy storage bug is fixed. --- ...ontreal_custom_energy_system_parameters.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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 348df9fe..4cdb848a 100644 --- a/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py +++ b/hub/imports/energy_systems/montreal_custom_energy_system_parameters.py @@ -107,13 +107,19 @@ class MontrealCustomEnergySystemParameters: _generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency _generic_storage_system = None if archetype_generation_system.energy_storage_systems is not None: - if archetype_generation_system.energy_storage_systems.type_energy_stored == 'electrical': - _generic_storage_system = ElectricalStorageSystem() - _generic_storage_system.type_energy_stored = 'electrical' - else: - _generic_storage_system = ThermalStorageSystem() - _generic_storage_system.type_energy_stored = 'thermal' - _generation_system.energy_storage_systems = [_generic_storage_system] + _storage_systems = [] + for storage_system in archetype_generation_system.energy_storage_systems: + if storage_system.type_energy_stored == 'electrical': + _generic_storage_system = ElectricalStorageSystem() + _generic_storage_system.type_energy_stored = 'electrical' + else: + _generic_storage_system = ThermalStorageSystem() + _generic_storage_system.type_energy_stored = storage_system.type_energy_stored + _generic_storage_system.height = storage_system.height + _generic_storage_system.layers = storage_system.layers + _generic_storage_system.storage_medium = storage_system.storage_medium + _storage_systems.append(_generic_storage_system) + _generation_system.energy_storage_systems = _storage_systems _generation_systems.append(_generation_system) return _generation_systems