separated storage class in three, one abstract

This commit is contained in:
Pilar Monsalvete 2023-08-29 12:22:06 -04:00
parent 5d4813f2f6
commit 6ac63adaaf
3 changed files with 174 additions and 102 deletions

View File

@ -0,0 +1,84 @@
"""
Energy System catalog electrical storage 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.energy_systems.energy_storage_system import EnergyStorageSystem
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):
super().__init__(storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio)
self._rated_output_power = rated_output_power
self._nominal_efficiency = nominal_efficiency
self._battery_voltage = battery_voltage
self._depth_of_discharge = depth_of_discharge
self._self_discharge_rate = self_discharge_rate
@property
def rated_output_power(self):
"""
Get the rated output power of storage system in kW
:return: float
"""
return self._rated_output_power
@property
def nominal_efficiency(self):
"""
Get the nominal efficiency of the storage system
:return: float
"""
return self._nominal_efficiency
@property
def battery_voltage(self):
"""
Get the battery voltage in Volt
:return: float
"""
return self._battery_voltage
@property
def depth_of_discharge(self):
"""
Get the depth of discharge as a percentage
:return: float
"""
return self._depth_of_discharge
@property
def self_discharge_rate(self):
"""
Get the self discharge rate of battery as a percentage
:return: float
"""
return self._self_discharge_rate
def to_dictionary(self):
"""Class content 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,
'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
}
}
return content

View File

@ -6,32 +6,22 @@ Project Coder Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from __future__ import annotations
from hub.catalog_factories.data_models.construction.layer import Layer
from abc import ABC
class EnergyStorageSystem:
class EnergyStorageSystem(ABC):
""""
Energy Storage System Class
"""
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):
def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio):
self._storage_id = storage_id
self._name = name
self._model_name = model_name
self._manufacturer = manufacturer
self._storage_type = storage_type
self._physical_volume = volume
self._rated_output_power = rated_output_power
self._nominal_efficiency = nominal_efficiency
self._battery_voltage = battery_voltage
self._depth_of_discharge = depth_of_discharge
self._self_discharge_rate = self_discharge_rate
self._height = height
self._layers = layers
self._maximum_operating_temperature = maximum_operating_temperature
self._nominal_capacity = nominal_capacity
self._losses_ratio = losses_ratio
@property
def id(self):
@ -68,103 +58,23 @@ class EnergyStorageSystem:
@property
def storage_type(self):
"""
Get storage type from ['lithium_ion', 'sensible', 'latent']
Get storage type from ['electricity', 'thermal', 'chemical', 'lithium_ion', 'sensible', 'latent']
:return: string
"""
return self._storage_type
@property
def physical_volume(self):
def nominal_capacity(self):
"""
Get the physical volume of the storage system in cubic meters
Get the nominal capacity of the storage system in Jules
:return: float
"""
return self._physical_volume
return self._nominal_capacity
@property
def rated_output_power(self):
def losses_ratio(self):
"""
Get the rated output power of storage system in kW
Get the losses-ratio of storage system in Jules lost / Jules stored
:return: float
"""
return self._rated_output_power
@property
def nominal_efficiency(self):
"""
Get the nominal efficiency of the storage system
:return: float
"""
return self._nominal_efficiency
@property
def battery_voltage(self):
"""
Get the battery voltage in Volt
:return: float
"""
return self._battery_voltage
@property
def depth_of_discharge(self):
"""
Get the depth of discharge as a percentage
:return: float
"""
return self._depth_of_discharge
@property
def self_discharge_rate(self):
"""
Get the self discharge rate of battery as a percentage
:return: float
"""
return self._self_discharge_rate
@property
def height(self):
"""
Get the diameter of the storage system in meters
:return: float
"""
return self._height
@property
def layers(self) -> [Layer]:
"""
Get construction layers
:return: [layer]
"""
return self._layers
@property
def maximum_operating_temperature(self):
"""
Get maximum operating temperature of the storage system in degree Celsius
:return: float
"""
return self._maximum_operating_temperature
def to_dictionary(self):
"""Class content to dictionary"""
_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,
'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
return self._losses_ratio

View File

@ -0,0 +1,78 @@
"""
Energy System catalog thermal storage 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.energy_systems.energy_storage_system import EnergyStorageSystem
from hub.catalog_factories.data_models.construction.layer import Layer
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):
super().__init__(storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio)
self._physical_volume = volume
self._height = height
self._layers = layers
self._maximum_operating_temperature = maximum_operating_temperature
@property
def physical_volume(self):
"""
Get the physical volume of the storage system in cubic meters
:return: float
"""
return self._physical_volume
@property
def height(self):
"""
Get the diameter of the storage system in meters
:return: float
"""
return self._height
@property
def layers(self) -> [Layer]:
"""
Get construction layers
:return: [layer]
"""
return self._layers
@property
def maximum_operating_temperature(self):
"""
Get maximum operating temperature of the storage system in degree Celsius
:return: float
"""
return self._maximum_operating_temperature
def to_dictionary(self):
"""Class content to dictionary"""
_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,
'physical volume [m3]': self.physical_volume,
'height [m]': self.height,
'layers': _layers,
'maximum operating temperature [Celsius]': self.maximum_operating_temperature
}
}
return content