separated distribution consumption in fix and variable flows

This commit is contained in:
Pilar Monsalvete 2023-05-19 12:23:06 -04:00
parent e4f22c29f2
commit bb279c39eb
8 changed files with 52590 additions and 2650 deletions

View File

@ -7,12 +7,13 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
class DistributionSystem:
def __init__(self, system_type, supply_temperature, distribution_consumption,
heat_losses):
def __init__(self, system_type, supply_temperature, distribution_consumption_fix_flow,
distribution_consumption_variable_flow, heat_losses):
self._type = system_type
self._supply_temperature = supply_temperature
self._distribution_consumption = distribution_consumption
self._distribution_consumption_fix_flow = distribution_consumption_fix_flow
self._distribution_consumption_variable_flow = distribution_consumption_variable_flow
self._heat_losses = heat_losses
@property
@ -32,12 +33,21 @@ class DistributionSystem:
return self._supply_temperature
@property
def distribution_consumption(self):
def distribution_consumption_fix_flow(self):
"""
Get distribution_consumption (pump of fan) in ratio over energy produced
Get distribution_consumption if the pump or fan work at fix mass or volume flow in ratio over peak power (W/W)
:return: float
"""
return self._distribution_consumption
return self._distribution_consumption_fix_flow
@property
def distribution_consumption_variable_flow(self):
"""
Get distribution_consumption if the pump or fan work at variable mass or volume flow in ratio
over energy produced (Wh/Wh)
:return: float
"""
return self._distribution_consumption_variable_flow
@property
def heat_losses(self):

View File

@ -22,7 +22,7 @@ class EmissionSystem:
@property
def parasitic_energy_consumption(self):
"""
Get parasitic_energy_consumption in ratio (W/W)
Get parasitic_energy_consumption in ratio (Wh/Wh)
:return: float
"""
return self._parasitic_energy_consumption

View File

@ -19,43 +19,46 @@ class MontrealCustomCatalog(Catalog):
def __init__(self, path):
path = str(path / 'montreal_custom_systems.xml')
with open(path) as xml:
self._archetypes = xmltodict.parse(xml.read(), force_list=('equipment', 'system', 'demand', 'equipment_id'))
self._archetypes = xmltodict.parse(xml.read(), force_list=('system', 'system_cluster', 'demand', 'system_id'))
self._lod = float(self._archetypes['catalog']['@lod'])
self._catalog_equipments = self._load_equipments()
self._catalog_systems = self._load_systems()
self._catalog_archetypes = self._load_archetypes()
# store the full catalog data model in self._content
self._content = Content(self._catalog_archetypes,
self._catalog_equipments)
self._catalog_systems)
def _load_equipments(self):
_catalog_equipments = []
equipments = self._archetypes['catalog']['equipments']['equipment']
for equipment in equipments:
equipment_id = float(equipment['@id'])
equipment_type = equipment['@type']
fuel_type = equipment['@fuel_type']
name = equipment['name']
demands = equipment['demands']['demand']
def _load_systems(self):
_catalog_systems = []
systems = self._archetypes['catalog']['systems']['system']
for system in systems:
system_id = float(system['@id'])
system_type = system['@type']
fuel_type = system['@fuel_type']
name = system['name']
demands = system['demands']['demand']
heating_efficiency = None
if 'heating_efficiency' in equipment:
heating_efficiency = float(equipment['heating_efficiency'])
if 'heating_efficiency' in system:
heating_efficiency = float(system['heating_efficiency'])
cooling_efficiency = None
if 'cooling_efficiency' in equipment:
cooling_efficiency = float(equipment['cooling_efficiency'])
if 'cooling_efficiency' in system:
cooling_efficiency = float(system['cooling_efficiency'])
electricity_efficiency = None
if 'electricity_efficiency' in equipment:
electricity_efficiency = float(equipment['electricity_efficiency'])
if 'electricity_efficiency' in system:
electricity_efficiency = float(system['electricity_efficiency'])
distribution_heat_losses = None
if 'distribution_heat_losses' in equipment:
distribution_heat_losses = float(equipment['distribution_heat_losses']['#text']) / 100
distribution_consumption = None
if 'distribution_consumption' in equipment:
distribution_consumption = float(equipment['distribution_consumption']['#text']) / 100
storage = eval(equipment['storage'].capitalize())
generation_system = GenerationSystem(equipment_type,
if 'distribution_heat_losses' in system:
distribution_heat_losses = float(system['distribution_heat_losses']['#text']) / 100
distribution_consumption_fix_flow = None
if 'distribution_consumption_fix_flow' in system:
distribution_consumption_fix_flow = float(system['distribution_consumption_fix_flow']['#text']) / 100
distribution_consumption_variable_flow = None
if 'distribution_consumption_variable_flow' in system:
distribution_consumption_variable_flow = float(system['distribution_consumption_variable_flow']['#text']) / 100
storage = eval(system['storage'].capitalize())
generation_system = GenerationSystem(system_type,
fuel_type,
None,
heating_efficiency,
@ -67,29 +70,30 @@ class MontrealCustomCatalog(Catalog):
None)
distribution_system = DistributionSystem(None,
None,
distribution_consumption,
distribution_consumption_fix_flow,
distribution_consumption_variable_flow,
distribution_heat_losses)
_catalog_equipments.append(Equipment(self._lod,
equipment_id,
name,
demands,
generation_system,
distribution_system,
None))
return _catalog_equipments
_catalog_systems.append(Equipment(self._lod,
system_id,
name,
demands,
generation_system,
distribution_system,
None))
return _catalog_systems
def _load_archetypes(self):
_catalog_archetypes = []
systems = self._archetypes['catalog']['systems']['system']
for system in systems:
name = system['@name']
system_equipments = system['equipments']['equipment_id']
_equipments = []
for system_equipment in system_equipments:
for equipment in self._catalog_equipments:
if int(equipment.id) == int(system_equipment):
_equipments.append(equipment)
_catalog_archetypes.append(Archetype(self._lod, name, _equipments))
system_clusters = self._archetypes['catalog']['system_clusters']['system_cluster']
for system_cluster in system_clusters:
name = system_cluster['@name']
systems = system_cluster['systems']['system_id']
_systems = []
for system in systems:
for system_archetype in self._catalog_systems:
if int(system_archetype.id) == int(system):
_systems.append(system_archetype)
_catalog_archetypes.append(Archetype(self._lod, name, _systems))
return _catalog_archetypes
def names(self, category=None):
@ -98,19 +102,19 @@ class MontrealCustomCatalog(Catalog):
:parm: optional category filter
"""
if category is None:
_names = {'archetypes': [], 'equipments': []}
_names = {'archetypes': [], 'systems': []}
for archetype in self._content.archetypes:
_names['archetypes'].append(archetype.name)
for equipment in self._content.equipments:
_names['equipments'].append(equipment.name)
for system in self._content.equipments:
_names['systems'].append(system.name)
else:
_names = {category: []}
if category.lower() == 'archetypes':
for archetype in self._content.archetypes:
_names[category].append(archetype.name)
elif category.lower() == 'equipments':
for equipment in self._content.equipments:
_names[category].append(equipment.name)
elif category.lower() == 'systems':
for system in self._content.equipments:
_names[category].append(system.name)
else:
raise ValueError(f'Unknown category [{category}]')
return _names
@ -125,7 +129,7 @@ class MontrealCustomCatalog(Catalog):
else:
if category.lower() == 'archetypes':
return self._content.archetypes
elif category.lower() == 'equipments':
elif category.lower() == 'systems':
return self._content.equipments
else:
raise ValueError(f'Unknown category [{category}]')

View File

@ -13,7 +13,8 @@ class GenericDistributionSystem:
def __init__(self):
self._type = None
self._supply_temperature = None
self._distribution_consumption = None
self._distribution_consumption_fix_flow = None
self._distribution_consumption_variable_flow = None
self._heat_losses = None
@property
@ -49,20 +50,38 @@ class GenericDistributionSystem:
self._supply_temperature = value
@property
def distribution_consumption(self):
def distribution_consumption_fix_flow(self):
"""
Get distribution_consumption (pump of fan) in ratio over energy produced
Get distribution_consumption if the pump or fan work at fix mass or volume flow in ratio over peak power (W/W)
:return: float
"""
return self._distribution_consumption
return self._distribution_consumption_fix_flow
@distribution_consumption.setter
def distribution_consumption(self, value):
@distribution_consumption_fix_flow.setter
def distribution_consumption_fix_flow(self, value):
"""
Set distribution_consumption (pump of fan) in ratio over energy produced
:param value: float
Set distribution_consumption if the pump or fan work at fix mass or volume flow in ratio over peak power (W/W)
:return: float
"""
self._distribution_consumption = value
self._distribution_consumption_fix_flow = value
@property
def distribution_consumption_variable_flow(self):
"""
Get distribution_consumption if the pump or fan work at variable mass or volume flow in ratio
over energy produced (Wh/Wh)
:return: float
"""
return self._distribution_consumption_variable_flow
@distribution_consumption_variable_flow.setter
def distribution_consumption_variable_flow(self, value):
"""
Set distribution_consumption if the pump or fan work at variable mass or volume flow in ratio
over energy produced (Wh/Wh)
:return: float
"""
self._distribution_consumption_variable_flow = value
@property
def heat_losses(self):

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<catalog lod="1">
<equipments>
<equipment id="1" type="boiler" fuel_type="gas">
<systems>
<system id="1" type="boiler" fuel_type="gas">
<name>Fuel-fired water boiler with baseboards</name>
<demands>
<demand>heating</demand>
@ -8,10 +8,11 @@
</demands>
<heating_efficiency>0.85</heating_efficiency>
<distribution_heat_losses units="%">10</distribution_heat_losses>
<distribution_consumption units="%">2</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="2" type="boiler" fuel_type="electricity">
</system>
<system id="2" type="boiler" fuel_type="electricity">
<name>Electrical resistance water boiler</name>
<demands>
<demand>heating</demand>
@ -19,10 +20,11 @@
</demands>
<heating_efficiency>1</heating_efficiency>
<distribution_heat_losses units="%">10</distribution_heat_losses>
<distribution_consumption units="%">2</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>true</storage>
</equipment>
<equipment id="3" type="furnace" fuel_type="gas">
</system>
<system id="3" type="furnace" fuel_type="gas">
<name>Fuel-fired furnace and fuel boiler for acs</name>
<demands>
<demand>heating</demand>
@ -30,10 +32,11 @@
</demands>
<heating_efficiency>0.85</heating_efficiency>
<distribution_heat_losses units="%">25</distribution_heat_losses>
<distribution_consumption units="%">100000</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="4" type="furnace" fuel_type="electricity">
</system>
<system id="4" type="furnace" fuel_type="electricity">
<name>Electrical resistance furnace and electrical boiler for acs</name>
<demands>
<demand>heating</demand>
@ -41,10 +44,11 @@
</demands>
<heating_efficiency>1</heating_efficiency>
<distribution_heat_losses units="%">25</distribution_heat_losses>
<distribution_consumption units="%">100000</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="5" type="baseboard" fuel_type="gas">
</system>
<system id="5" type="baseboard" fuel_type="gas">
<name>Baseboards: hydronic with fuel boiler</name>
<demands>
<demand>heating</demand>
@ -52,10 +56,11 @@
</demands>
<heating_efficiency>0.85</heating_efficiency>
<distribution_heat_losses units="%">10</distribution_heat_losses>
<distribution_consumption units="%">2</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="6" type="baseboard" fuel_type="electricity">
</system>
<system id="6" type="baseboard" fuel_type="electricity">
<name>Electrical baseboards and electrical boiler for acs</name>
<demands>
<demand>heating</demand>
@ -63,163 +68,167 @@
</demands>
<heating_efficiency>1</heating_efficiency>
<distribution_heat_losses units="%">0</distribution_heat_losses>
<distribution_consumption units="%">0</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="7" type="cooler" fuel_type="electricity">
</system>
<system id="7" type="cooler" fuel_type="electricity">
<name>Air cooled DX with external condenser</name>
<demands>
<demand>cooling</demand>
</demands>
<cooling_efficiency>3.23</cooling_efficiency>
<distribution_heat_losses units="%">0</distribution_heat_losses>
<distribution_consumption units="%">100000</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="8" type="cooler" fuel_type="electricity">
</system>
<system id="8" type="cooler" fuel_type="electricity">
<name>Water cooled, water chiller</name>
<demands>
<demand>cooling</demand>
</demands>
<cooling_efficiency>3.23</cooling_efficiency>
<distribution_heat_losses units="%">10</distribution_heat_losses>
<distribution_consumption units="%">5</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="9" type="cooler" fuel_type="electricity">
</system>
<system id="9" type="cooler" fuel_type="electricity">
<name>Air cooled DX</name>
<demands>
<demand>cooling</demand>
</demands>
<cooling_efficiency>3.23</cooling_efficiency>
<distribution_heat_losses units="%">0</distribution_heat_losses>
<distribution_consumption units="%">100000</distribution_consumption>
<distribution_consumption_fix_flow units="%">1000000000</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">1000000000</distribution_consumption_variable_flow>
<storage>false</storage>
</equipment>
<equipment id="10" type="electricity generator" fuel_type="renewable">
</system>
<system id="10" type="electricity generator" fuel_type="renewable">
<name>PV system</name>
<demands>
<demand>electricity</demand>
</demands>
<electrical_efficiency>0.22</electrical_efficiency>
<storage>true</storage>
</equipment>
</equipments>
<systems>
<system name="system 1 gas">
<equipments>
<equipment_id>1</equipment_id>
<equipment_id>7</equipment_id>
</equipments>
</system>
<system name="system 1 gas pv">
<equipments>
<equipment_id>1</equipment_id>
<equipment_id>7</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 1 electricity">
<equipments>
<equipment_id>2</equipment_id>
<equipment_id>7</equipment_id>
</equipments>
</system>
<system name="system 1 electricity pv">
<equipments>
<equipment_id>2</equipment_id>
<equipment_id>7</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 2 gas">
<equipments>
<equipment_id>1</equipment_id>
<equipment_id>8</equipment_id>
</equipments>
</system>
<system name="system 2 gas pv">
<equipments>
<equipment_id>1</equipment_id>
<equipment_id>8</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 2 electricity">
<equipments>
<equipment_id>2</equipment_id>
<equipment_id>8</equipment_id>
</equipments>
</system>
<system name="system 2 electricity pv">
<equipments>
<equipment_id>2</equipment_id>
<equipment_id>8</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 3 and 4 gas">
<equipments>
<equipment_id>3</equipment_id>
<equipment_id>4</equipment_id>
</equipments>
</system>
<system name="system 3 and 4 gas pv">
<equipments>
<equipment_id>3</equipment_id>
<equipment_id>4</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 3 and 4 electricity">
<equipments>
<equipment_id>4</equipment_id>
<equipment_id>4</equipment_id>
</equipments>
</system>
<system name="system 3 and 4 electricity pv">
<equipments>
<equipment_id>4</equipment_id>
<equipment_id>4</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 5">
<equipments>
<equipment_id>8</equipment_id>
</equipments>
</system>
<system name="system 5 pv">
<equipments>
<equipment_id>8</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 6 gas">
<equipments>
<equipment_id>5</equipment_id>
<equipment_id>8</equipment_id>
</equipments>
</system>
<system name="system 6 gas pv">
<equipments>
<equipment_id>5</equipment_id>
<equipment_id>8</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
<system name="system 6 electricity">
<equipments>
<equipment_id>6</equipment_id>
<equipment_id>8</equipment_id>
</equipments>
</system>
<system name="system 6 electricity pv">
<equipments>
<equipment_id>6</equipment_id>
<equipment_id>8</equipment_id>
<equipment_id>10</equipment_id>
</equipments>
</system>
</systems>
<system_clusters>
<system_cluster name="system 1 gas">
<systems>
<system_id>1</system_id>
<system_id>7</system_id>
</systems>
</system_cluster>
<system_cluster name="system 1 gas pv">
<systems>
<system_id>1</system_id>
<system_id>7</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 1 electricity">
<systems>
<system_id>2</system_id>
<system_id>7</system_id>
</systems>
</system_cluster>
<system_cluster name="system 1 electricity pv">
<systems>
<system_id>2</system_id>
<system_id>7</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 2 gas">
<systems>
<system_id>1</system_id>
<system_id>8</system_id>
</systems>
</system_cluster>
<system_cluster name="system 2 gas pv">
<systems>
<system_id>1</system_id>
<system_id>8</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 2 electricity">
<systems>
<system_id>2</system_id>
<system_id>8</system_id>
</systems>
</system_cluster>
<system_cluster name="system 2 electricity pv">
<systems>
<system_id>2</system_id>
<system_id>8</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 3 and 4 gas">
<systems>
<system_id>3</system_id>
<system_id>4</system_id>
</systems>
</system_cluster>
<system_cluster name="system 3 and 4 gas pv">
<systems>
<system_id>3</system_id>
<system_id>4</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 3 and 4 electricity">
<systems>
<system_id>4</system_id>
<system_id>4</system_id>
</systems>
</system_cluster>
<system_cluster name="system 3 and 4 electricity pv">
<systems>
<system_id>4</system_id>
<system_id>4</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 5">
<systems>
<system_id>8</system_id>
</systems>
</system_cluster>
<system_cluster name="system 5 pv">
<systems>
<system_id>8</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 6 gas">
<systems>
<system_id>5</system_id>
<system_id>8</system_id>
</systems>
</system_cluster>
<system_cluster name="system 6 gas pv">
<systems>
<system_id>5</system_id>
<system_id>8</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
<system_cluster name="system 6 electricity">
<systems>
<system_id>6</system_id>
<system_id>8</system_id>
</systems>
</system_cluster>
<system_cluster name="system 6 electricity pv">
<systems>
<system_id>6</system_id>
<system_id>8</system_id>
<system_id>10</system_id>
</systems>
</system_cluster>
</system_clusters>
</catalog>

View File

@ -41,7 +41,6 @@ class MontrealCustomEnergySystemParameters:
_generic_energy_systems = city.generic_energy_systems
for building in city.buildings:
archetype_name = f'{building.energy_systems_archetype_name}_lod1.0'
# archetype_name = building.energy_systems_archetype_name
try:
archetype = self._search_archetypes(montreal_custom_catalog, archetype_name)
except KeyError:
@ -81,7 +80,10 @@ class MontrealCustomEnergySystemParameters:
archetype_distribution_equipment = equipment.distribution_system
_distribution_system.type = archetype_distribution_equipment.type
_distribution_system.supply_temperature = archetype_distribution_equipment.supply_temperature
_distribution_system.distribution_consumption = archetype_distribution_equipment.distribution_consumption
_distribution_system.distribution_consumption_fix_flow = \
archetype_distribution_equipment.distribution_consumption_fix_flow
_distribution_system.distribution_consumption_variable_flow = \
archetype_distribution_equipment.distribution_consumption_variable_flow
_distribution_system.heat_losses = archetype_distribution_equipment.heat_losses
energy_system.distribution_system = _distribution_system