All the attributes related to the material and insulation of the tank are substituted with one attribute called "layers"

This commit is contained in:
Saeed Ranjbar 2023-08-13 20:43:05 -04:00
parent 012076492f
commit 231e4a17f2

View File

@ -18,9 +18,8 @@ class EnergyStorageSystem:
""" """
def __init__(self, model_name, manufacturer, storage_type, volume, rated_output_power, def __init__(self, model_name, manufacturer, storage_type, volume, rated_output_power,
nominal_efficiency, battery_voltage, depth_of_discharge, self_discharge_rate, diameter, nominal_efficiency, battery_voltage, depth_of_discharge, self_discharge_rate, diameter, layers
storage_material, storage_thickness, material_conductivity, insulation_material, insulation_thickness, , maximum_operating_temperature):
insulation_conductivity, maximum_operating_temperature):
self._model_name = model_name self._model_name = model_name
self._manufacturer = manufacturer self._manufacturer = manufacturer
self._storage_type = storage_type self._storage_type = storage_type
@ -31,12 +30,7 @@ class EnergyStorageSystem:
self._depth_of_discharge = depth_of_discharge self._depth_of_discharge = depth_of_discharge
self._self_discharge_rate = self_discharge_rate self._self_discharge_rate = self_discharge_rate
self._diameter = diameter self._diameter = diameter
self._storage_material = storage_material self._layers = layers
self._storage_thickness = storage_thickness
self._material_conductivity = material_conductivity
self._insulation_material = insulation_material
self._insulation_thickness = insulation_thickness
self._insulation_conductivity = insulation_conductivity
self._maximum_operating_temperature = maximum_operating_temperature self._maximum_operating_temperature = maximum_operating_temperature
@property @property
@ -120,52 +114,12 @@ class EnergyStorageSystem:
return self._diameter return self._diameter
@property @property
def storage_material(self): def layers(self) -> [Layer]:
""" """
Get the name of the storage system material Get construction layers
:return: string :return: [layer]
""" """
return self._storage_material return self._layers
@property
def storage_thickness(self):
"""
Get the thickness of the storage system in meters
:return: float
"""
return self._storage_thickness
@property
def material_conductivity(self):
"""
Get the thermal conductivity of the storage system material in W/(m.K)
:return: float
"""
return self._material_conductivity
@property
def insulation_material(self):
"""
Get the name of the material used as insulation
:return: string
"""
return self._insulation_material
@property
def insulation_thickness(self):
"""
Get the thickness of the insulation used for the storage system in meters
:return: float
"""
return self._storage_thickness
@property
def insulation_conductivity(self):
"""
Get the thickness of the insulation used for the storage system in W/(m.K)
:return: float
"""
return self._insulation_conductivity
@property @property
def maximum_operating_temperature(self): def maximum_operating_temperature(self):
@ -177,6 +131,9 @@ class EnergyStorageSystem:
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
_layers = []
for _layer in self.layers:
_layers.append(_layer.to_dictionary())
content = {'Storage component': {'model name': self.model_name, content = {'Storage component': {'model name': self.model_name,
'manufacturer': self.manufacturer, 'manufacturer': self.manufacturer,
'storage type': self.storage_type, 'storage type': self.storage_type,
@ -187,12 +144,7 @@ class EnergyStorageSystem:
'depth of discharge': self.depth_of_discharge, 'depth of discharge': self.depth_of_discharge,
'self discharge rate': self.self_discharge_rate, 'self discharge rate': self.self_discharge_rate,
'diameter [m]': self.diameter, 'diameter [m]': self.diameter,
'storage material': self.storage_material, 'layers': _layers,
'storage thickness [m]': self.storage_thickness,
'storage material thermal conductivity [W/m.K]': self.material_conductivity,
'insulation material': self.insulation_material,
'insulation thickness[m]': self.insulation_thickness,
'insulation thermal conductivity [W/m.K]': self.insulation_conductivity,
'maximum operating temperature [Celsius]': self.maximum_operating_temperature 'maximum operating temperature [Celsius]': self.maximum_operating_temperature
} }
} }