cogeneration ratio was removed from generation_system.py

pv_generation_system.py is completed by adding an inheritance from the GenerationSystem class
parameter_function.py is renamed to performance_curves.py and an attribute to get the list of target parameters is added to it
system.py is modified by adding energy storage, performance curves, pv to it
This commit is contained in:
Saeed Ranjbar 2023-08-14 20:00:17 -04:00
parent acd7ad2266
commit 3feecac15d
7 changed files with 231 additions and 180 deletions

View File

@ -13,38 +13,36 @@ class DistributionSystem:
Distribution system class Distribution system class
""" """
def __init__(self, model, manufacturer, system_type, supply_temperature, distribution_consumption_fix_flow, def __init__(self, system_id, name, system_type, supply_temperature, distribution_consumption_fix_flow,
distribution_consumption_variable_flow, heat_losses, nominal_heat_output, medium): distribution_consumption_variable_flow, heat_losses):
self._model = model self._system_id = system_id
self._manufacturer = manufacturer self._name = name
self._type = system_type self._type = system_type
self._supply_temperature = supply_temperature self._supply_temperature = supply_temperature
self._distribution_consumption_fix_flow = distribution_consumption_fix_flow self._distribution_consumption_fix_flow = distribution_consumption_fix_flow
self._distribution_consumption_variable_flow = distribution_consumption_variable_flow self._distribution_consumption_variable_flow = distribution_consumption_variable_flow
self._heat_losses = heat_losses self._heat_losses = heat_losses
self._nominal_heat_output = nominal_heat_output
self._medium = medium
@property @property
def model(self): def id(self):
""" """
Get system model Get system id
:return: string :return: float
""" """
return self._model return self._system_id
@property @property
def manufacturer(self): def name(self):
""" """
Get name Get name
:return: string :return: string
""" """
return self._manufacturer return self._name
@property @property
def type(self): def type(self):
""" """
Get type from ['radiator', 'forced air convection', 'radiant floor heating'] Get type from [air, water, refrigerant]
:return: string :return: string
""" """
return self._type return self._type
@ -82,35 +80,17 @@ class DistributionSystem:
""" """
return self._heat_losses return self._heat_losses
@property
def nominal_heat_output(self):
"""
Get the nominal heat output of the heat distribution system in kW
:return: float
"""
return self._nominal_heat_output
@property
def medium(self) -> Material:
"""
Get the heat transfer medium characteristics
:return: Material
"""
return self._medium
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
content = { content = {
'Layer': { 'Layer': {
'model': self.model, 'id': self.id,
'manufacturer': self.manufacturer, 'name': self.name,
'type': self.type, 'type': self.type,
'supply temperature [Celsius]': self.supply_temperature, 'supply temperature [Celsius]': self.supply_temperature,
'distribution consumption if fix flow over peak power [W/W]': self.distribution_consumption_fix_flow, 'distribution consumption if fix flow over peak power [W/W]': self.distribution_consumption_fix_flow,
'distribution consumption if variable flow over peak power [J/J]': self.distribution_consumption_variable_flow, 'distribution consumption if variable flow over peak power [J/J]': self.distribution_consumption_variable_flow,
'heat losses per energy produced [J/J]': self.heat_losses, 'heat losses per energy produced [J/J]': self.heat_losses
'nominal_heat_output': self.nominal_heat_output,
'heat transfer medium': self.medium
} }
} }
return content return content

View File

@ -1,60 +0,0 @@
"""
Energy System catalog emission 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
"""
class EmissionSystem:
"""
Emission system class
"""
def __init__(self, system_id, name, system_type, parasitic_energy_consumption):
self._system_id = system_id
self._name = name
self._type = system_type
self._parasitic_energy_consumption = parasitic_energy_consumption
@property
def id(self):
"""
Get system id
:return: float
"""
return self._system_id
@property
def name(self):
"""
Get name
:return: string
"""
return self._name
@property
def type(self):
"""
Get type
:return: string
"""
return self._type
@property
def parasitic_energy_consumption(self):
"""
Get parasitic_energy_consumption in ratio (J/J)
:return: float
"""
return self._parasitic_energy_consumption
def to_dictionary(self):
"""Class content to dictionary"""
content = {'Layer': {'id': self.id,
'name': self.name,
'type': self.type,
'parasitic energy consumption per energy produced [J/J]': self.parasitic_energy_consumption
}
}
return content

View File

@ -0,0 +1,94 @@
"""
Energy System catalog emission 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.construction.material import Material
class EnergyEmissionSystem:
"""
Emission system class
"""
def __init__(self, model_name, manufacturer, system_type, parasitic_energy_consumption, nominal_heat_output,
nominal_efficiency, medium):
self._system_id = model_name
self._name = manufacturer
self._type = system_type
self._parasitic_energy_consumption = parasitic_energy_consumption
self._nominal_heat_output = nominal_heat_output
self._nominal_efficiency = nominal_efficiency
self._medium = medium
@property
def model_name(self):
"""
Get system id
:return: float
"""
return self._system_id
@property
def manufacturer(self):
"""
Get name
:return: string
"""
return self._name
@property
def type(self):
"""
Get type
:return: string
"""
return self._type
@property
def parasitic_energy_consumption(self):
"""
Get parasitic_energy_consumption in ratio (J/J)
:return: float
"""
return self._parasitic_energy_consumption
@property
def nominal_heat_output(self):
"""
Get the nominal heat output of the emission system in kW
:return: float
"""
return self._nominal_heat_output
@property
def nominal_efficiency(self):
"""
Get the nominal efficiency of the emission system
:return: float
"""
return self._nominal_efficiency
@property
def medium(self) -> Material:
"""
Get the heat transfer characteristics of the heat transfer medium
:return: Material
"""
return self._medium
def to_dictionary(self):
"""Class content to dictionary"""
content = {'Layer': {'id': self.model_name,
'name': self.manufacturer,
'type': self.type,
'parasitic energy consumption per energy produced [J/J]': self.parasitic_energy_consumption,
'nominal heat output [kW]': self.nominal_heat_output,
'nominal efficiency': self.nominal_efficiency,
'heat transfer medium': self.medium
}
}
return content

View File

@ -17,7 +17,7 @@ class GenerationSystem:
def __init__(self, model_name, manufacturer, system_type, fuel_type, nominal_thermal_output, modulation_range, def __init__(self, model_name, manufacturer, system_type, fuel_type, nominal_thermal_output, modulation_range,
source_types, heat_efficiency, cooling_efficiency, electricity_efficiency, source_temperature, source_types, heat_efficiency, cooling_efficiency, electricity_efficiency, source_temperature,
source_mass_flow, nominal_electricity_output, cogeneration_ratio): source_mass_flow, nominal_electricity_output):
self._model_name = model_name self._model_name = model_name
self._manufacturer = manufacturer self._manufacturer = manufacturer
self._system_type = system_type self._system_type = system_type
@ -31,7 +31,6 @@ class GenerationSystem:
self._source_temperature = source_temperature self._source_temperature = source_temperature
self._source_mass_flow = source_mass_flow self._source_mass_flow = source_mass_flow
self._nominal_electricity_output = nominal_electricity_output self._nominal_electricity_output = nominal_electricity_output
self._cogeneration_ratio = cogeneration_ratio
@property @property
def model_name(self): def model_name(self):
@ -137,17 +136,9 @@ class GenerationSystem:
""" """
return self._nominal_electricity_output return self._nominal_electricity_output
@property
def cogeneration_ratio(self):
"""
Get the ratio between the heat output and electricity output of CHP units
:return: float
"""
return self._cogeneration_ratio
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
content = {'Heat Generation component': {'model name': self.model_name, content = {'Energy Generation component': {'model name': self.model_name,
'manufacturer': self.manufacturer, 'manufacturer': self.manufacturer,
'type': self.system_type, 'type': self.system_type,
'fuel type': self.fuel_type, 'fuel type': self.fuel_type,
@ -160,7 +151,6 @@ class GenerationSystem:
'cooling efficiency': self.cooling_efficiency, 'cooling efficiency': self.cooling_efficiency,
'electricity efficiency': self.electricity_efficiency, 'electricity efficiency': self.electricity_efficiency,
'nominal power output [kW]': self.nominal_electricity_output, 'nominal power output [kW]': self.nominal_electricity_output,
'cogeneration ratio': self.cogeneration_ratio,
} }
} }
return content return content

View File

@ -8,15 +8,22 @@ Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
from __future__ import annotations from __future__ import annotations
from typing import Union from typing import Union
from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem
class PvGenerationSystem: class PvGenerationSystem(GenerationSystem):
""" """
Electricity Generation system class Electricity Generation system class
""" """
def __init__(self, nominal_ambient_temperature, nominal_cell_temperature, nominal_radiation, def __init__(self, nominal_ambient_temperature, nominal_cell_temperature, nominal_radiation,
standard_test_condition_cell_temperature, standard_test_condition_maximum_power, width, height): standard_test_condition_cell_temperature, standard_test_condition_maximum_power, width, height,
model_name, manufacturer, electricity_efficiency, nominal_electricity_output):
super(GenerationSystem, self).__init__(model_name=model_name, manufacturer=manufacturer, system_type='pv',
fuel_type='renewable', nominal_thermal_output=None, modulation_range=None,
source_types=None, heat_efficiency=None, cooling_efficiency=None,
electricity_efficiency=electricity_efficiency, source_temperature=None,
source_mass_flow=None, nominal_electricity_output=nominal_electricity_output)
self._nominal_ambient_temperature = nominal_ambient_temperature self._nominal_ambient_temperature = nominal_ambient_temperature
self._nominal_cell_temperature = nominal_cell_temperature self._nominal_cell_temperature = nominal_cell_temperature
self._nominal_radiation = nominal_radiation self._nominal_radiation = nominal_radiation
@ -83,14 +90,18 @@ class PvGenerationSystem:
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
content = {'Electricity Generation component': { content = {'Photovoltaic Module': {
'model name': self.model_name,
'manufacturer': self.manufacturer,
'type': self.system_type,
'fuel type': self.fuel_type,
'electricity efficiency': self.electricity_efficiency,
'nominal power output [kW]': self.nominal_electricity_output,
'nominal ambient temperature [Celsius]': self.nominal_ambient_temperature, 'nominal ambient temperature [Celsius]': self.nominal_ambient_temperature,
'nominal cell temperature [Celsius]': self.nominal_cell_temperature, 'nominal cell temperature [Celsius]': self.nominal_cell_temperature,
'nominal radiation [W/m2]': self.nominal_radiation, 'nominal radiation [W/m2]': self.nominal_radiation,
'standard test condition cell temperature [Celsius]': 'standard test condition cell temperature [Celsius]': self.standard_test_condition_cell_temperature,
self.standard_test_condition_cell_temperature, 'standard test condition maximum power [kW]': self.standard_test_condition_maximum_power,
'standard test condition maximum power [kW]':
self.standard_test_condition_maximum_power,
'width': self.width, 'width': self.width,
'height': self.height, 'height': self.height,
} }

View File

@ -1,41 +1,47 @@
""" """
Energy System catalog equipment Energy System catalog heat generation system
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
""" """
from typing import Union from typing import Union, List
from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem
from hub.catalog_factories.data_models.energy_systems.pv_generation_system import PvGenerationSystem from hub.catalog_factories.data_models.energy_systems.pv_generation_system import PvGenerationSystem
from hub.catalog_factories.data_models.energy_systems.energy_storage_system import EnergyStorageSystem from hub.catalog_factories.data_models.energy_systems.energy_storage_system import EnergyStorageSystem
from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem
from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem from hub.catalog_factories.data_models.energy_systems.performance_curves import PerformanceCurves
from hub.catalog_factories.data_models.energy_systems.energy_emission_system import EnergyEmissionSystem
class System: class System:
""" """
System class System class
""" """
def __init__(self, def __init__(self,
lod, lod,
system_id, system_id,
name, system_configuration,
demand_types, demand_types,
heat_generation_system, generation_systems,
electricity_generation_system, pv_generation_system,
distribution_system, distribution_system,
emission_system): emission_system,
energy_storage_systems,
performance_curves):
self._lod = lod self._lod = lod
self._system_id = system_id self._system_id = system_id
self._name = name self._system_configuration = system_configuration
self._demand_types = demand_types self._demand_types = demand_types
self._heat_generation_system = heat_generation_system
self._electricity_generation_system = electricity_generation_system
self._distribution_system = distribution_system self._distribution_system = distribution_system
self._emission_system = emission_system self._emission_system = emission_system
self._generation_systems = generation_systems
self._pv_generation_system = pv_generation_system
self._energy_storage_systems = energy_storage_systems
self._performance_curves = performance_curves
@property @property
def lod(self): def lod(self):
@ -54,36 +60,37 @@ class System:
return self._system_id return self._system_id
@property @property
def name(self): def system_configuration(self):
""" """
Get name Get the system configuration from ['hp_tes', 'hp_boiler_tes', 'pv_hp', 'pv_battery', 'pv', 'pv_hp_tes',
'pv_hp_battery_tes']
:return: string :return: string
""" """
return self._name return self._system_configuration
@property @property
def demand_types(self): def demand_types(self):
""" """
Get demand able to cover from [heating, cooling, domestic_hot_water, electricity] Get demand able to cover from ['heating', 'cooling', 'domestic_hot_water', 'electricity']
:return: [string] :return: [string]
""" """
return self._demand_types return self._demand_types
@property @property
def heat_generation_system(self) -> GenerationSystem: def generation_systems(self) -> List[GenerationSystem]:
""" """
Get heat generation system Get generation system
:return: HeatGenerationSystem :return: GenerationSystem
""" """
return self._heat_generation_system return self._generation_systems
@property @property
def electricity_generation_system(self) -> PvGenerationSystem: def pv_generation_system(self) -> Union[None, PvGenerationSystem]:
""" """
Get electricity generation system Get pv generation system
:return: ElectricityGenerationSystem :return: ElectricityGenerationSystem
""" """
return self._electricity_generation_system return self._pv_generation_system
@property @property
def distribution_system(self) -> Union[None, DistributionSystem]: def distribution_system(self) -> Union[None, DistributionSystem]:
@ -94,29 +101,58 @@ class System:
return self._distribution_system return self._distribution_system
@property @property
def emission_system(self) -> Union[None, EmissionSystem]: def emission_system(self) -> Union[None, EnergyEmissionSystem]:
""" """
Get emission system Get emission system
:return: EmissionSystem :return: EmissionSystem
""" """
return self._emission_system return self._emission_system
@property
def energy_storage_system(self) -> Union[None, List[EnergyStorageSystem]]:
"""
Get energy storage system
:return: EnergyStorageSystem
"""
return self._energy_storage_systems
@property
def performance_curves(self) -> Union[None, List[PerformanceCurves]]:
"""
Get the list of all performance curves associated with components
:return: PerformanceCurves
"""
return self._performance_curves
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
_generation_systems = []
for _generation in self.generation_systems:
_generation_systems.append(_generation.to_dictionary())
_pv_system = None
if self.pv_generation_system is not None:
_pv_system = self.pv_generation_system.to_dictionary()
_distribution_system = None _distribution_system = None
if self.distribution_system is not None: if self.distribution_system is not None:
_distribution_system = self.distribution_system.to_dictionary() _distribution_system = self.distribution_system.to_dictionary()
_emission_system = None _emission_system = None
if self.emission_system is not None: if self.emission_system is not None:
_emission_system = self.emission_system.to_dictionary() _emission_system = self.emission_system.to_dictionary()
_storage_system = [_storage.to_dictionary() for _storage in
self.energy_storage_system] if self.energy_storage_system is not None else None
_performance_curves = [_curve.to_dictionary() for _curve in
self.performance_curves] if self.performance_curves is not None else None
content = {'Layer': {'id': self.id, content = {'Layer': {'id': self.id,
'name': self.name, 'name': self.system_configuration,
'level of detail': self.lod, 'level of detail': self.lod,
'demand types': self.demand_types, 'demand types': self.demand_types,
'heat generation system': self.heat_generation_system.to_dictionary(), 'Generation system(s)': _generation_systems,
'electricity generation system': self.electricity_generation_system.to_dictionary(), 'electricity generation system': _pv_system,
'distribution system': _distribution_system, 'distribution system': _distribution_system,
'emission system': _emission_system 'emission system': _emission_system,
'energy storage system': _storage_system,
'performance curves': _performance_curves
} }
} }
return content return content

View File

@ -12,7 +12,7 @@ from hub.catalog_factories.data_models.energy_systems.system import System
from hub.catalog_factories.data_models.energy_systems.content import Content from hub.catalog_factories.data_models.energy_systems.content import Content
from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem from hub.catalog_factories.data_models.energy_systems.generation_system import GenerationSystem
from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem from hub.catalog_factories.data_models.energy_systems.distribution_system import DistributionSystem
from hub.catalog_factories.data_models.energy_systems.emission_system import EmissionSystem from hub.catalog_factories.data_models.energy_systems.energy_emission_system import EnergyEmissionSystem
from hub.catalog_factories.data_models.energy_systems.archetype import Archetype from hub.catalog_factories.data_models.energy_systems.archetype import Archetype
@ -114,7 +114,7 @@ class MontrealCustomCatalog(Catalog):
if 'parasitic_consumption' in equipment: if 'parasitic_consumption' in equipment:
parasitic_consumption = float(equipment['parasitic_consumption']['#text']) / 100 parasitic_consumption = float(equipment['parasitic_consumption']['#text']) / 100
emission_system = EmissionSystem(equipment_id, emission_system = EnergyEmissionSystem(equipment_id,
name, name,
equipment_type, equipment_type,
parasitic_consumption) parasitic_consumption)
@ -177,32 +177,32 @@ class MontrealCustomCatalog(Catalog):
_names = {'archetypes': [], 'systems': [], 'generation_equipments': [], 'distribution_equipments': [], _names = {'archetypes': [], 'systems': [], 'generation_equipments': [], 'distribution_equipments': [],
'emission_equipments':[]} 'emission_equipments':[]}
for archetype in self._content.archetypes: for archetype in self._content.archetypes:
_names['archetypes'].append(archetype.name) _names['archetypes'].append(archetype.manufacturer)
for system in self._content.systems: for system in self._content.systems:
_names['systems'].append(system.name) _names['systems'].append(system.manufacturer)
for equipment in self._content.generation_equipments: for equipment in self._content.generation_equipments:
_names['generation_equipments'].append(equipment.name) _names['generation_equipments'].append(equipment.manufacturer)
for equipment in self._content.distribution_equipments: for equipment in self._content.distribution_equipments:
_names['distribution_equipments'].append(equipment.name) _names['distribution_equipments'].append(equipment.manufacturer)
for equipment in self._content.emission_equipments: for equipment in self._content.emission_equipments:
_names['emission_equipments'].append(equipment.name) _names['emission_equipments'].append(equipment.manufacturer)
else: else:
_names = {category: []} _names = {category: []}
if category.lower() == 'archetypes': if category.lower() == 'archetypes':
for archetype in self._content.archetypes: for archetype in self._content.archetypes:
_names[category].append(archetype.name) _names[category].append(archetype.manufacturer)
elif category.lower() == 'systems': elif category.lower() == 'systems':
for system in self._content.systems: for system in self._content.systems:
_names[category].append(system.name) _names[category].append(system.manufacturer)
elif category.lower() == 'generation_equipments': elif category.lower() == 'generation_equipments':
for system in self._content.generation_equipments: for system in self._content.generation_equipments:
_names[category].append(system.name) _names[category].append(system.manufacturer)
elif category.lower() == 'distribution_equipments': elif category.lower() == 'distribution_equipments':
for system in self._content.distribution_equipments: for system in self._content.distribution_equipments:
_names[category].append(system.name) _names[category].append(system.manufacturer)
elif category.lower() == 'emission_equipments': elif category.lower() == 'emission_equipments':
for system in self._content.emission_equipments: for system in self._content.emission_equipments:
_names[category].append(system.name) _names[category].append(system.manufacturer)
else: else:
raise ValueError(f'Unknown category [{category}]') raise ValueError(f'Unknown category [{category}]')
return _names return _names
@ -232,18 +232,18 @@ class MontrealCustomCatalog(Catalog):
:parm: entry name :parm: entry name
""" """
for entry in self._content.archetypes: for entry in self._content.archetypes:
if entry.name.lower() == name.lower(): if entry.manufacturer.lower() == name.lower():
return entry return entry
for entry in self._content.systems: for entry in self._content.systems:
if entry.name.lower() == name.lower(): if entry.manufacturer.lower() == name.lower():
return entry return entry
for entry in self._content.generation_equipments: for entry in self._content.generation_equipments:
if entry.name.lower() == name.lower(): if entry.manufacturer.lower() == name.lower():
return entry return entry
for entry in self._content.distribution_equipments: for entry in self._content.distribution_equipments:
if entry.name.lower() == name.lower(): if entry.manufacturer.lower() == name.lower():
return entry return entry
for entry in self._content.emission_equipments: for entry in self._content.emission_equipments:
if entry.name.lower() == name.lower(): if entry.manufacturer.lower() == name.lower():
return entry return entry
raise IndexError(f"{name} doesn't exists in the catalog") raise IndexError(f"{name} doesn't exists in the catalog")