fix: create_generation_system
This commit is contained in:
parent
f8267386cb
commit
38fcd9f95a
|
@ -86,7 +86,8 @@ class MontrealCustomEnergySystemParameters:
|
|||
if archetype_generation_system.system_type == 'Photovoltaic':
|
||||
_generation_system = PvGenerationSystem()
|
||||
_type = 'PV system'
|
||||
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[_type]
|
||||
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[
|
||||
_type]
|
||||
_fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
|
||||
_generation_system.fuel_type = _fuel_type
|
||||
_generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency
|
||||
|
@ -98,7 +99,8 @@ class MontrealCustomEnergySystemParameters:
|
|||
else:
|
||||
_generation_system = NonPvGenerationSystem()
|
||||
_type = archetype_generation_system.system_type
|
||||
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[_type]
|
||||
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[
|
||||
_type]
|
||||
_fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
|
||||
_generation_system.fuel_type = _fuel_type
|
||||
_generation_system.source_types = archetype_generation_system.source_medium
|
||||
|
@ -107,13 +109,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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user