some changes in code to be reviewed by Saeed

This commit is contained in:
Pilar Monsalvete 2023-08-28 10:18:18 -04:00
parent 43e5bb7310
commit 5d4813f2f6
9 changed files with 40 additions and 34 deletions

View File

@ -6,8 +6,6 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
""" """
from hub.catalog_factories.data_models.construction.material import Material
class DistributionSystem: class DistributionSystem:
""" """

View File

@ -2,8 +2,8 @@
Energy System catalog heat generation system 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 Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from __future__ import annotations from __future__ import annotations

View File

@ -20,7 +20,7 @@ class GenerationSystem:
maximum_heat_output, minimum_heat_output, source_medium, supply_medium, heat_efficiency, maximum_heat_output, minimum_heat_output, source_medium, supply_medium, heat_efficiency,
nominal_cooling_output, maximum_cooling_output, minimum_cooling_output, cooling_efficiency, nominal_cooling_output, maximum_cooling_output, minimum_cooling_output, cooling_efficiency,
electricity_efficiency, source_temperature, source_mass_flow, nominal_electricity_output, electricity_efficiency, source_temperature, source_mass_flow, nominal_electricity_output,
maximum_heating_supply_temperature, minimum_heating_supply_temperature, maximum_heat_supply_temperature, minimum_heat_supply_temperature,
maximum_cooling_supply_temperature, minimum_cooling_supply_temperature, heat_output_curve, maximum_cooling_supply_temperature, minimum_cooling_supply_temperature, heat_output_curve,
heat_fuel_consumption_curve, heat_efficiency_curve, cooling_output_curve, cooling_fuel_consumption_curve, heat_fuel_consumption_curve, heat_efficiency_curve, cooling_output_curve, cooling_fuel_consumption_curve,
cooling_efficiency_curve, storage, auxiliary_equipment): cooling_efficiency_curve, storage, auxiliary_equipment):
@ -33,19 +33,19 @@ class GenerationSystem:
self._nominal_thermal_output = nominal_thermal_output self._nominal_thermal_output = nominal_thermal_output
self._maximum_heat_output = maximum_heat_output self._maximum_heat_output = maximum_heat_output
self._minimum_heat_output = minimum_heat_output self._minimum_heat_output = minimum_heat_output
self._source_medium = source_medium
self._supply_medium = supply_medium
self._heat_efficiency = heat_efficiency self._heat_efficiency = heat_efficiency
self._nominal_cooling_output = nominal_cooling_output self._nominal_cooling_output = nominal_cooling_output
self._maximum_cooling_output = maximum_cooling_output self._maximum_cooling_output = maximum_cooling_output
self._minimum_cooling_output = minimum_cooling_output self._minimum_cooling_output = minimum_cooling_output
self._cooling_efficiency = cooling_efficiency self._cooling_efficiency = cooling_efficiency
self._electricity_efficiency = electricity_efficiency self._electricity_efficiency = electricity_efficiency
self._nominal_electricity_output = nominal_electricity_output
self._source_medium = source_medium
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._supply_medium = supply_medium
self._maximum_heating_supply_temperature = maximum_heating_supply_temperature self._maximum_heat_supply_temperature = maximum_heat_supply_temperature
self._minimum_heating_supply_temperature = minimum_heating_supply_temperature self._minimum_heat_supply_temperature = minimum_heat_supply_temperature
self._maximum_cooling_supply_temperature = maximum_cooling_supply_temperature self._maximum_cooling_supply_temperature = maximum_cooling_supply_temperature
self._minimum_cooling_supply_temperature = minimum_cooling_supply_temperature self._minimum_cooling_supply_temperature = minimum_cooling_supply_temperature
self._heat_output_curve = heat_output_curve self._heat_output_curve = heat_output_curve
@ -218,20 +218,20 @@ class GenerationSystem:
return self._nominal_electricity_output return self._nominal_electricity_output
@property @property
def maximum_heating_supply_temperature(self): def maximum_heat_supply_temperature(self):
""" """
Get the maximum heating supply temperature in degree Celsius Get the maximum heat supply temperature in degree Celsius
:return: float :return: float
""" """
return self._minimum_heating_supply_temperature return self._minimum_heat_supply_temperature
@property @property
def minimum_heating_supply_temperature(self): def minimum_heat_supply_temperature(self):
""" """
Get the minimum heating supply temperature in degree Celsius Get the minimum heat supply temperature in degree Celsius
:return: float :return: float
""" """
return self._minimum_heating_supply_temperature return self._minimum_heat_supply_temperature
@property @property
def maximum_cooling_supply_temperature(self): def maximum_cooling_supply_temperature(self):
@ -339,8 +339,8 @@ 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 [W]': self.nominal_electricity_output, 'nominal power output [W]': self.nominal_electricity_output,
'maximum heating supply temperature [Celsius]': self.maximum_heating_supply_temperature, 'maximum heating supply temperature [Celsius]': self.maximum_heat_supply_temperature,
'minimum heating supply temperature [Celsius]': self.minimum_heating_supply_temperature, 'minimum heating supply temperature [Celsius]': self.minimum_heat_supply_temperature,
'maximum cooling supply temperature [Celsius]': self.maximum_cooling_supply_temperature, 'maximum cooling supply temperature [Celsius]': self.maximum_cooling_supply_temperature,
'minimum cooling supply temperature [Celsius]': self.minimum_cooling_supply_temperature, 'minimum cooling supply temperature [Celsius]': self.minimum_cooling_supply_temperature,
'heat output curve': self.heat_output_curve, 'heat output curve': self.heat_output_curve,

View File

@ -2,14 +2,13 @@
Energy System catalog heat generation system 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 Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from __future__ import annotations from __future__ import annotations
class PerformanceCurves: class PerformanceCurves:
""" """
Parameter function class Parameter function class
@ -28,17 +27,25 @@ class PerformanceCurves:
Exponential =>>> y = a*(b**x) Exponential =>>> y = a*(b**x)
Polynomial =>>> y = a*(x**2) + b*x + c Polynomial =>>> y = a*(x**2) + b*x + c
Power =>>> y = a*(x**b) Power =>>> y = a*(x**b)
Second degree multivariable =>>> y = a*(x**2) + b*x + c*x*y + d*y + e*(y**2) + f Second degree multivariable =>>> y = a*(x**2) + b*x + c*x*z + d*z + e*(z**2) + f
Get the type of function from ['linear', 'exponential', 'polynomial', 'power', 'second degree multivariable'] Get the type of function from ['linear', 'exponential', 'polynomial', 'power', 'second degree multivariable']
:return: string :return: string
""" """
return self._curve_type return self._curve_type
@property
def function(self):
"""
y (e.g. COP in COP = a*source temperature**2... )
"""
return self._function
@property @property
def parameters(self): def parameters(self):
""" """
Get the list of parameters involved in fitting process as ['y', 'x', 'z'] Get the list of parameters involved in fitting process as ['x', 'z'] (e.g. [source temperature, supply temperature]
in COP=)
:return: string :return: string
""" """
return self._parameters return self._parameters

View File

@ -2,8 +2,8 @@
Energy System catalog heat generation system 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 Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from __future__ import annotations from __future__ import annotations
@ -28,8 +28,8 @@ class PvGenerationSystem(GenerationSystem):
cooling_efficiency=None, electricity_efficiency=electricity_efficiency, cooling_efficiency=None, electricity_efficiency=electricity_efficiency,
source_temperature=None, source_mass_flow=None, source_temperature=None, source_mass_flow=None,
nominal_electricity_output=nominal_electricity_output, nominal_electricity_output=nominal_electricity_output,
maximum_heating_supply_temperature=None, maximum_heat_supply_temperature=None,
minimum_heating_supply_temperature=None, minimum_heat_supply_temperature=None,
maximum_cooling_supply_temperature=None, maximum_cooling_supply_temperature=None,
minimum_cooling_supply_temperature=None, heat_output_curve=None, minimum_cooling_supply_temperature=None, heat_output_curve=None,
heat_fuel_consumption_curve=None, heat_efficiency_curve=None, heat_fuel_consumption_curve=None, heat_efficiency_curve=None,

View File

@ -36,6 +36,7 @@ class System:
self._emission_system = emission_system self._emission_system = emission_system
self._generation_systems = generation_systems self._generation_systems = generation_systems
self._energy_storage_systems = energy_storage_systems self._energy_storage_systems = energy_storage_systems
self._configuration = configuration
@property @property
def lod(self): def lod(self):

View File

@ -2,8 +2,8 @@
North america energy system catalog North america energy system catalog
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Project Coder Saeed Ranjbar saeed.ranjbar@concordia.ca
Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<EnergySystemCatalog> <EnergySystemCatalog>
<schemas_path>./schemas/</schemas_path>
<medias> <medias>
<media media_id="1" media_name="Water" density="981.0" heatCapacity="4180.0" evaporationTemperature="100.0"/> <media media_id="1" media_name="Water" density="981.0" heatCapacity="4180.0" evaporationTemperature="100.0"/>
</medias> </medias>
@ -129,7 +130,7 @@
</components> </components>
</system> </system>
<system id="6"> <system id="6">
<name>Water Source Heat Pump with Electrical Boiler and thermal storage</name> <name>Water Source Heat Pump with Electrical Boiler and thermal storage</name>\
<demands> <demands>
<demand>heating</demand> <demand>heating</demand>
<demand>domestic_hot_water</demand> <demand>domestic_hot_water</demand>
@ -201,4 +202,3 @@
<demand demand_id="4" name="cooling"/> <demand demand_id="4" name="cooling"/>
</energy_demands> </energy_demands>
</EnergySystemCatalog> </EnergySystemCatalog>

View File

@ -35,8 +35,8 @@ class TestSystemsCatalog(TestCase):
with self.assertRaises(IndexError): with self.assertRaises(IndexError):
catalog.get_entry('unknown') catalog.get_entry('unknown')
# def test_north_america_systems_catalog(self): def test_north_america_systems_catalog(self):
# catalog = EnergySystemsCatalogFactory('north_america').catalog catalog = EnergySystemsCatalogFactory('north_america').catalog
def test_montreal_catalog(self): def test_montreal_catalog(self):
catalog = EnergySystemsCatalogFactory('montreal_custom').catalog catalog = EnergySystemsCatalogFactory('montreal_custom').catalog