Title: Improvement of Energy System Parameters Importer

>> To make life easier for people who want to work on energy systems in future, I tried to make my code as generic as possible.
This commit is contained in:
Saeed Ranjbar 2024-02-13 20:05:03 -05:00
parent 087fead489
commit 57a9d24f4c
4 changed files with 37 additions and 1 deletions

View File

@ -90,11 +90,23 @@ class MontrealFutureEnergySystemParameters:
for archetype_generation_system in archetype_system.generation_systems: for archetype_generation_system in archetype_system.generation_systems:
if archetype_generation_system.system_type == 'Photovoltaic': if archetype_generation_system.system_type == 'Photovoltaic':
_generation_system = PvGenerationSystem() _generation_system = PvGenerationSystem()
_generation_system.name = archetype_generation_system.name
_generation_system.model_name = archetype_generation_system.model_name
_generation_system.manufacturer = archetype_generation_system.manufacturer
_type = 'PV system' _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] _fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
_generation_system.fuel_type = _fuel_type _generation_system.fuel_type = _fuel_type
_generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency _generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency
_generation_system.nominal_electricity_output = archetype_generation_system.nominal_electricity_output
_generation_system.nominal_ambient_temperature = archetype_generation_system.nominal_ambient_temperature
_generation_system.nominal_cell_temperature = archetype_generation_system.nominal_cell_temperature
_generation_system.nominal_radiation = archetype_generation_system.nominal_radiation
_generation_system.standard_test_condition_cell_temperature = archetype_generation_system.standard_test_condition_cell_temperature
_generation_system.standard_test_condition_maximum_power = archetype_generation_system.standard_test_condition_maximum_power
_generation_system.cell_temperature_coefficient = archetype_generation_system.cell_temperature_coefficient
_generation_system.width = archetype_generation_system.width
_generation_system.height = archetype_generation_system.height
_generic_storage_system = None _generic_storage_system = None
if archetype_generation_system.energy_storage_systems is not None: if archetype_generation_system.energy_storage_systems is not None:
_generic_storage_system = ElectricalStorageSystem() _generic_storage_system = ElectricalStorageSystem()
@ -102,11 +114,35 @@ class MontrealFutureEnergySystemParameters:
_generation_system.energy_storage_systems = [_generic_storage_system] _generation_system.energy_storage_systems = [_generic_storage_system]
else: else:
_generation_system = NonPvGenerationSystem() _generation_system = NonPvGenerationSystem()
_generation_system.name = archetype_generation_system.name
_generation_system.model_name = archetype_generation_system.model_name
_generation_system.manufacturer = archetype_generation_system.manufacturer
_type = archetype_generation_system.system_type _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().north_america_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type] _fuel_type = Dictionaries().north_america_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
_generation_system.fuel_type = _fuel_type _generation_system.fuel_type = _fuel_type
_generation_system.source_types = archetype_generation_system.source_medium _generation_system.nominal_heat_output = archetype_generation_system.nominal_heat_output
_generation_system.nominal_cooling_output = archetype_generation_system.nominal_cooling_output
_generation_system.maximum_heat_output = archetype_generation_system.maximum_heat_output
_generation_system.minimum_heat_output = archetype_generation_system.minimum_heat_output
_generation_system.maximum_cooling_output = archetype_generation_system.maximum_cooling_output
_generation_system.minimum_cooling_output = archetype_generation_system.minimum_cooling_output
_generation_system.source_temperature = archetype_generation_system.source_temperature
_generation_system.source_mass_flow = archetype_generation_system.source_mass_flow
_generation_system.supply_medium = archetype_generation_system.supply_medium
_generation_system.maximum_heat_supply_temperature = archetype_generation_system.maximum_heat_supply_temperature
_generation_system.maximum_cooling_supply_temperature = archetype_generation_system.maximum_cooling_supply_temperature
_generation_system.minimum_heat_supply_temperature = archetype_generation_system.minimum_heat_supply_temperature
_generation_system.minimum_cooling_supply_temperature = archetype_generation_system.minimum_cooling_supply_temperature
_generation_system.heat_output_curve = archetype_generation_system.heat_output_curve
_generation_system.heat_fuel_consumption_curve = archetype_generation_system.heat_fuel_consumption_curve
_generation_system.heat_efficiency_curve = archetype_generation_system.heat_efficiency_curve
_generation_system.cooling_output_curve = archetype_generation_system.cooling_output_curve
_generation_system.cooling_fuel_consumption_curve = archetype_generation_system.cooling_fuel_consumption_curve
_generation_system.cooling_efficiency_curve = archetype_generation_system.cooling_efficiency_curve
_generation_system.dual_supply_capability = archetype_generation_system.dual_supply_capability
_generation_system.nominal_electricity_output = archetype_generation_system.nominal_electricity_output
_generation_system.source_medium = archetype_generation_system.source_medium
_generation_system.heat_efficiency = archetype_generation_system.heat_efficiency _generation_system.heat_efficiency = archetype_generation_system.heat_efficiency
_generation_system.cooling_efficiency = archetype_generation_system.cooling_efficiency _generation_system.cooling_efficiency = archetype_generation_system.cooling_efficiency
_generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency _generation_system.electricity_efficiency = archetype_generation_system.electricity_efficiency