Correct catalog for infiltration area

This commit is contained in:
Guille Gutierrez 2024-02-16 07:12:20 +01:00
parent 2d0fd3eb0c
commit 2be27590d3
8 changed files with 572 additions and 9 deletions

View File

@ -113,6 +113,7 @@ class NrcanCatalog(Catalog):
def _load_archetypes(self): def _load_archetypes(self):
_catalog_archetypes = [] _catalog_archetypes = []
archetypes = self._archetypes['archetypes'] archetypes = self._archetypes['archetypes']
for archetype in archetypes: for archetype in archetypes:
archetype_id = f'{archetype["function"]}_{archetype["period_of_construction"]}_{archetype["climate_zone"]}' archetype_id = f'{archetype["function"]}_{archetype["period_of_construction"]}_{archetype["climate_zone"]}'
function = archetype['function'] function = archetype['function']
@ -128,6 +129,12 @@ class NrcanCatalog(Catalog):
infiltration_rate_for_ventilation_system_on = ( infiltration_rate_for_ventilation_system_on = (
archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
) )
infiltration_rate_area_for_ventilation_system_on = (
archetype['infiltration_rate_area_for_ventilation_system_on']
)
infiltration_rate_area_for_ventilation_system_off = (
archetype['infiltration_rate_area_for_ventilation_system_off']
)
archetype_constructions = [] archetype_constructions = []
for archetype_construction in archetype['constructions']: for archetype_construction in archetype['constructions']:
@ -165,7 +172,10 @@ class NrcanCatalog(Catalog):
extra_loses_due_to_thermal_bridges, extra_loses_due_to_thermal_bridges,
None, None,
infiltration_rate_for_ventilation_system_off, infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on)) infiltration_rate_for_ventilation_system_on,
infiltration_rate_area_for_ventilation_system_off,
infiltration_rate_area_for_ventilation_system_on
))
return _catalog_archetypes return _catalog_archetypes
def names(self, category=None): def names(self, category=None):

View File

@ -23,7 +23,9 @@ class Archetype:
extra_loses_due_to_thermal_bridges, extra_loses_due_to_thermal_bridges,
indirect_heated_ratio, indirect_heated_ratio,
infiltration_rate_for_ventilation_system_off, infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on): infiltration_rate_for_ventilation_system_on,
infiltration_rate_area_for_ventilation_system_off = 0,
infiltration_rate_area_for_ventilation_system_on = 0):
self._id = archetype_id self._id = archetype_id
self._name = name self._name = name
self._function = function self._function = function
@ -36,6 +38,8 @@ class Archetype:
self._indirect_heated_ratio = indirect_heated_ratio self._indirect_heated_ratio = indirect_heated_ratio
self._infiltration_rate_for_ventilation_system_off = infiltration_rate_for_ventilation_system_off self._infiltration_rate_for_ventilation_system_off = infiltration_rate_for_ventilation_system_off
self._infiltration_rate_for_ventilation_system_on = infiltration_rate_for_ventilation_system_on self._infiltration_rate_for_ventilation_system_on = infiltration_rate_for_ventilation_system_on
self._infiltration_rate_area_for_ventilation_system_off = infiltration_rate_area_for_ventilation_system_off
self._infiltration_rate_area_for_ventilation_system_on = infiltration_rate_area_for_ventilation_system_on
@property @property
def id(self): def id(self):
@ -133,6 +137,23 @@ class Archetype:
""" """
return self._infiltration_rate_for_ventilation_system_on return self._infiltration_rate_for_ventilation_system_on
@property
def infiltration_rate_area_for_ventilation_system_off(self):
"""
Get archetype infiltration rate area for ventilation system off
:return: float
"""
return self._infiltration_rate_area_for_ventilation_system_off
@property
def infiltration_rate_area_for_ventilation_system_on(self):
"""
Get archetype infiltration rate area for ventilation system on
:return: float
"""
return self._infiltration_rate_area_for_ventilation_system_on
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
_constructions = [] _constructions = []
@ -149,6 +170,8 @@ class Archetype:
'indirect heated ratio': self.indirect_heated_ratio, 'indirect heated ratio': self.indirect_heated_ratio,
'infiltration rate for ventilation off [1/s]': self.infiltration_rate_for_ventilation_system_off, 'infiltration rate for ventilation off [1/s]': self.infiltration_rate_for_ventilation_system_off,
'infiltration rate for ventilation on [1/s]': self.infiltration_rate_for_ventilation_system_on, 'infiltration rate for ventilation on [1/s]': self.infiltration_rate_for_ventilation_system_on,
'infiltration rate area for ventilation off': self.infiltration_rate_area_for_ventilation_system_off,
'infiltration rate area for ventilation on': self.infiltration_rate_area_for_ventilation_system_on,
'constructions': _constructions 'constructions': _constructions
} }
} }

View File

@ -20,8 +20,8 @@ class ThermalArchetype:
self._indirect_heated_ratio = None self._indirect_heated_ratio = None
self._infiltration_rate_for_ventilation_system_off = None self._infiltration_rate_for_ventilation_system_off = None
self._infiltration_rate_for_ventilation_system_on = None self._infiltration_rate_for_ventilation_system_on = None
self._infiltration_rate_area_for_ventilation_system_off = None self._infiltration_rate_area_for_ventilation_system_off = 0
self._infiltration_rate_area_for_ventilation_system_on = None self._infiltration_rate_area_for_ventilation_system_on = 0
@property @property
def constructions(self) -> [Construction]: def constructions(self) -> [Construction]:

File diff suppressed because it is too large Load Diff

View File

@ -73,6 +73,4 @@ class EnergyBuildingsExportsFactory:
Export the city given to the class using the given export type handler Export the city given to the class using the given export type handler
:return: None :return: None
""" """
# return getattr(self, self._export_type, lambda: None) return getattr(self, self._export_type, lambda: None)
return InselMonthlyEnergyBalance(self._city, self._path, self._custom_insel_block)

View File

@ -58,7 +58,8 @@ class ConstructionHelper:
'Boucherville': '6', 'Boucherville': '6',
'Mascouche': '6', 'Mascouche': '6',
'Saint-Leonard': '6', 'Saint-Leonard': '6',
'La Prairie': '6' 'La Prairie': '6',
'Summerland': '6'
} }
_reference_city_to_israel_climate_zone = { _reference_city_to_israel_climate_zone = {

View File

@ -67,6 +67,8 @@ class NrcanPhysicsParameters:
thermal_archetype.indirect_heated_ratio = 0 thermal_archetype.indirect_heated_ratio = 0
thermal_archetype.infiltration_rate_for_ventilation_system_on = catalog_archetype.infiltration_rate_for_ventilation_system_on thermal_archetype.infiltration_rate_for_ventilation_system_on = catalog_archetype.infiltration_rate_for_ventilation_system_on
thermal_archetype.infiltration_rate_for_ventilation_system_off = catalog_archetype.infiltration_rate_for_ventilation_system_off thermal_archetype.infiltration_rate_for_ventilation_system_off = catalog_archetype.infiltration_rate_for_ventilation_system_off
thermal_archetype.infiltration_rate_area_for_ventilation_system_on = catalog_archetype.infiltration_rate_area_for_ventilation_system_on
thermal_archetype.infiltration_rate_area_for_ventilation_system_off = catalog_archetype.infiltration_rate_area_for_ventilation_system_off
_constructions = [] _constructions = []
for catalog_construction in catalog_archetype.constructions: for catalog_construction in catalog_archetype.constructions:
construction = Construction() construction = Construction()

View File

@ -69,6 +69,7 @@ class TestExports(TestCase):
""" """
city = self._get_citygml('one_building_in_kelowna.gml') city = self._get_citygml('one_building_in_kelowna.gml')
WeatherFactory('epw', city).enrich() WeatherFactory('epw', city).enrich()
ConstructionFactory('nrcan', city).enrich()
for building in city.buildings: for building in city.buildings:
building.external_temperature[cte.MONTH] = MonthlyValues().\ building.external_temperature[cte.MONTH] = MonthlyValues().\
get_mean_values(building.external_temperature[cte.HOUR]) get_mean_values(building.external_temperature[cte.HOUR])