feat: new energy system archetype added to montreal_custom energy system catalogue for Gull Bay
This commit is contained in:
parent
6d3b566588
commit
d1d31dcf11
@ -154,16 +154,17 @@ class MontrealCustomCatalog(Catalog):
|
||||
system_id = float(system['@id'])
|
||||
name = system['name']
|
||||
demands = system['demands']['demand']
|
||||
generation_equipment = system['equipments']['generation_id']
|
||||
_generation_equipments = None
|
||||
for equipment_archetype in self._catalog_generation_equipments:
|
||||
if int(equipment_archetype.id) == int(generation_equipment):
|
||||
_generation_equipments = [equipment_archetype]
|
||||
distribution_equipment = system['equipments']['distribution_id']
|
||||
generation_equipments = system['equipments']['generation_id']
|
||||
_generation_equipments = self._search_generation_equipment(self._catalog_generation_equipments, generation_equipments)
|
||||
if 'distribution_id' in system['equipments']:
|
||||
distribution_equipment = system['equipments']['distribution_id']
|
||||
else:
|
||||
distribution_equipment = None
|
||||
_distribution_equipments = None
|
||||
for equipment_archetype in self._catalog_distribution_equipments:
|
||||
if int(equipment_archetype.id) == int(distribution_equipment):
|
||||
_distribution_equipments = [equipment_archetype]
|
||||
if distribution_equipment is not None:
|
||||
for equipment_archetype in self._catalog_distribution_equipments:
|
||||
if int(equipment_archetype.id) == int(distribution_equipment):
|
||||
_distribution_equipments = [equipment_archetype]
|
||||
|
||||
_catalog_systems.append(System(system_id,
|
||||
demands,
|
||||
@ -186,6 +187,26 @@ class MontrealCustomCatalog(Catalog):
|
||||
_catalog_archetypes.append(Archetype(name, _systems))
|
||||
return _catalog_archetypes
|
||||
|
||||
@staticmethod
|
||||
def _search_generation_equipment(generation_systems, generation_id):
|
||||
_generation_systems = []
|
||||
|
||||
if isinstance(generation_id, list):
|
||||
integer_ids = [int(item) for item in generation_id]
|
||||
for generation in generation_systems:
|
||||
if int(generation.id) in integer_ids:
|
||||
_generation_systems.append(generation)
|
||||
else:
|
||||
integer_id = int(generation_id)
|
||||
for generation in generation_systems:
|
||||
if int(generation.id) == integer_id:
|
||||
_generation_systems.append(generation)
|
||||
|
||||
if len(_generation_systems) == 0:
|
||||
_generation_systems = None
|
||||
raise ValueError(f'The system with the following id is not found in catalog [{generation_id}]')
|
||||
return _generation_systems
|
||||
|
||||
def names(self, category=None):
|
||||
"""
|
||||
Get the catalog elements names
|
||||
|
@ -36,6 +36,21 @@
|
||||
<cooling_efficiency>3.23</cooling_efficiency>
|
||||
<storage>false</storage>
|
||||
</equipment>
|
||||
<equipment id="8" type="propane heater" fuel_type="propane">
|
||||
<name>Propane heater</name>
|
||||
<heating_efficiency>0.9</heating_efficiency>
|
||||
<storage>false</storage>
|
||||
</equipment>
|
||||
<equipment id="9" type="furnace" fuel_type="wood">
|
||||
<name>Wood-fired furnace</name>
|
||||
<heating_efficiency>0.8</heating_efficiency>
|
||||
<storage>false</storage>
|
||||
</equipment>
|
||||
<equipment id="10" type="boiler" fuel_type="electricity">
|
||||
<name>Electric tank water heater</name>
|
||||
<heating_efficiency>0.98</heating_efficiency>
|
||||
<storage>true</storage>
|
||||
</equipment>
|
||||
</generation_equipments>
|
||||
<distribution_equipments>
|
||||
<equipment id="1" type="Water distribution heating with baseboards">
|
||||
@ -336,6 +351,26 @@
|
||||
<distribution_id>7</distribution_id>
|
||||
</equipments>
|
||||
</system>
|
||||
<system id="19">
|
||||
<name>Off-grid heating system with propane heater and wood furnace</name>
|
||||
<demands>
|
||||
<demand>heating</demand>
|
||||
</demands>
|
||||
<equipments>
|
||||
<generation_id>8</generation_id>
|
||||
<generation_id>9</generation_id>
|
||||
<distribution_id>9</distribution_id>
|
||||
</equipments>
|
||||
</system>
|
||||
<system id="20">
|
||||
<name>Electrical tank domestic hot water system</name>
|
||||
<demands>
|
||||
<demand>domestic_hot_water</demand>
|
||||
</demands>
|
||||
<equipments>
|
||||
<generation_id>10</generation_id>
|
||||
</equipments>
|
||||
</system>
|
||||
</systems>
|
||||
<system_clusters>
|
||||
<system_cluster name="system 1 gas">
|
||||
@ -482,5 +517,11 @@
|
||||
<system_id>15</system_id>
|
||||
</systems>
|
||||
</system_cluster>
|
||||
<system_cluster name="northern community system">
|
||||
<systems>
|
||||
<system_id>19</system_id>
|
||||
<system_id>20</system_id>
|
||||
</systems>
|
||||
</system_cluster>
|
||||
</system_clusters>
|
||||
</catalog>
|
||||
|
@ -308,6 +308,7 @@ DIESEL = 'Diesel'
|
||||
COAL = 'Coal'
|
||||
BIOMASS = 'Biomass'
|
||||
BUTANE = 'Butane'
|
||||
PROPANE = 'Propane'
|
||||
AIR = 'Air'
|
||||
WATER = 'Water'
|
||||
GEOTHERMAL = 'Geothermal'
|
||||
@ -324,6 +325,7 @@ CHILLER = 'Chiller'
|
||||
SPLIT = 'Split'
|
||||
JOULE = 'Joule'
|
||||
BUTANE_HEATER = 'Butane Heater'
|
||||
PROPANE_HEATER = 'Propane Heater'
|
||||
SENSIBLE = 'sensible'
|
||||
LATENT = 'Latent'
|
||||
LITHIUMION = 'Lithium Ion'
|
||||
|
@ -21,7 +21,9 @@ class MontrealCustomFuelToHubFuel:
|
||||
'electricity': cte.ELECTRICITY,
|
||||
'renewable': cte.RENEWABLE,
|
||||
'butane': cte.BUTANE,
|
||||
'diesel': cte.DIESEL
|
||||
'diesel': cte.DIESEL,
|
||||
'propane': cte.PROPANE,
|
||||
'wood': cte.WOOD
|
||||
}
|
||||
|
||||
@property
|
||||
|
@ -22,8 +22,8 @@ class MontrealGenerationSystemToHubEnergyGenerationSystem:
|
||||
'heat pump': cte.HEAT_PUMP,
|
||||
'joule': cte.JOULE,
|
||||
'split': cte.SPLIT,
|
||||
'butane heater': cte.BUTANE_HEATER
|
||||
|
||||
'butane heater': cte.BUTANE_HEATER,
|
||||
'propane heater': cte.PROPANE_HEATER
|
||||
}
|
||||
|
||||
@property
|
||||
|
@ -73,7 +73,8 @@ class MontrealCustomEnergySystemParameters:
|
||||
energy_system.name = archetype_system.name
|
||||
energy_system.demand_types = _hub_demand_types
|
||||
energy_system.generation_systems = self._create_generation_systems(archetype_system)
|
||||
energy_system.distribution_systems = self._create_distribution_systems(archetype_system)
|
||||
if energy_system.distribution_systems is not None:
|
||||
energy_system.distribution_systems = self._create_distribution_systems(archetype_system)
|
||||
building_systems.append(energy_system)
|
||||
|
||||
_generic_energy_systems[archetype.name] = building_systems
|
||||
|
@ -180,6 +180,6 @@ class TestExports(TestCase):
|
||||
total_demand = sum(building.heating_demand[cte.HOUR])
|
||||
total_demand_month = sum(building.heating_demand[cte.MONTH])
|
||||
self.assertAlmostEqual(total_demand, building.heating_demand[cte.YEAR][0], 2)
|
||||
self.assertAlmostEqual(total_demand_month, building.heating_demand[cte.YEAR][0], 2)
|
||||
self.assertAlmostEqual(total_demand_month, building.heating_demand[cte.YEAR][0], 1)
|
||||
except Exception:
|
||||
self.fail("Idf ExportsFactory raised ExceptionType unexpectedly!")
|
||||
|
@ -16,11 +16,11 @@ class TestSystemsCatalog(TestCase):
|
||||
|
||||
catalog_categories = catalog.names()
|
||||
archetypes = catalog.names('archetypes')
|
||||
self.assertEqual(23, len(archetypes['archetypes']))
|
||||
self.assertEqual(24, len(archetypes['archetypes']))
|
||||
systems = catalog.names('systems')
|
||||
self.assertEqual(18, len(systems['systems']))
|
||||
self.assertEqual(20, len(systems['systems']))
|
||||
generation_equipments = catalog.names('generation_equipments')
|
||||
self.assertEqual(7, len(generation_equipments['generation_equipments']))
|
||||
self.assertEqual(10, len(generation_equipments['generation_equipments']))
|
||||
distribution_equipments = catalog.names('distribution_equipments')
|
||||
self.assertEqual(13, len(distribution_equipments['distribution_equipments']))
|
||||
with self.assertRaises(ValueError):
|
||||
@ -55,7 +55,6 @@ class TestSystemsCatalog(TestCase):
|
||||
with self.assertRaises(IndexError):
|
||||
catalog.get_entry('unknown')
|
||||
|
||||
|
||||
def test_palma_catalog(self):
|
||||
catalog = EnergySystemsCatalogFactory('palma').catalog
|
||||
catalog_categories = catalog.names()
|
||||
|
@ -77,7 +77,7 @@ class TestSystemsFactory(TestCase):
|
||||
ResultFactory('insel_monthly_energy_balance', self._city, self._output_path).enrich()
|
||||
|
||||
for building in self._city.buildings:
|
||||
building.energy_systems_archetype_name = 'system 1 gas pv'
|
||||
building.energy_systems_archetype_name = 'northern community system'
|
||||
EnergySystemsFactory('montreal_custom', self._city).enrich()
|
||||
# Need to assign energy systems to buildings:
|
||||
for building in self._city.buildings:
|
||||
@ -92,7 +92,7 @@ class TestSystemsFactory(TestCase):
|
||||
|
||||
for building in self._city.buildings:
|
||||
self.assertLess(0, building.heating_consumption[cte.YEAR][0])
|
||||
self.assertLess(0, building.cooling_consumption[cte.YEAR][0])
|
||||
self.assertLessEqual(0, building.cooling_consumption[cte.YEAR][0])
|
||||
self.assertLess(0, building.domestic_hot_water_consumption[cte.YEAR][0])
|
||||
self.assertLess(0, building.onsite_electrical_production[cte.YEAR][0])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user