2021-05-26 18:17:23 -04:00
|
|
|
"""
|
|
|
|
Construction helper
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
2021-05-26 18:17:23 -04:00
|
|
|
"""
|
2022-12-16 07:21:33 -05:00
|
|
|
|
2021-06-10 10:48:30 -04:00
|
|
|
from helpers import constants as cte
|
2021-05-26 18:17:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ConstructionHelper:
|
2021-08-26 13:27:43 -04:00
|
|
|
"""
|
|
|
|
Construction helper
|
|
|
|
"""
|
2021-05-26 18:17:23 -04:00
|
|
|
# NREL
|
2022-03-17 18:49:44 -04:00
|
|
|
_nrel_standards = {
|
2021-05-26 18:17:23 -04:00
|
|
|
'ASHRAE Std189': 1,
|
|
|
|
'ASHRAE 90.1_2004': 2
|
|
|
|
}
|
2022-03-17 18:49:44 -04:00
|
|
|
_reference_city_to_nrel_climate_zone = {
|
2021-05-26 18:17:23 -04:00
|
|
|
'Miami': 'ASHRAE_2004:1A',
|
|
|
|
'Houston': 'ASHRAE_2004:2A',
|
|
|
|
'Phoenix': 'ASHRAE_2004:2B',
|
|
|
|
'Atlanta': 'ASHRAE_2004:3A',
|
|
|
|
'Los Angeles': 'ASHRAE_2004:3B',
|
|
|
|
'Las Vegas': 'ASHRAE_2004:3B',
|
|
|
|
'San Francisco': 'ASHRAE_2004:3C',
|
|
|
|
'Baltimore': 'ASHRAE_2004:4A',
|
|
|
|
'Albuquerque': 'ASHRAE_2004:4B',
|
|
|
|
'Seattle': 'ASHRAE_2004:4C',
|
|
|
|
'Chicago': 'ASHRAE_2004:5A',
|
|
|
|
'Boulder': 'ASHRAE_2004:5B',
|
|
|
|
'Minneapolis': 'ASHRAE_2004:6A',
|
|
|
|
'Helena': 'ASHRAE_2004:6B',
|
|
|
|
'Duluth': 'ASHRAE_2004:7A',
|
|
|
|
'Fairbanks': 'ASHRAE_2004:8A'
|
|
|
|
}
|
2021-06-10 10:48:30 -04:00
|
|
|
nrel_window_types = [cte.WINDOW, cte.DOOR, cte.SKYLIGHT]
|
2022-03-17 18:49:44 -04:00
|
|
|
|
2021-05-26 18:17:23 -04:00
|
|
|
nrel_construction_types = {
|
2021-06-10 10:48:30 -04:00
|
|
|
cte.WALL: 'exterior wall',
|
|
|
|
cte.INTERIOR_WALL: 'interior wall',
|
|
|
|
cte.GROUND_WALL: 'ground wall',
|
|
|
|
cte.GROUND: 'exterior slab',
|
|
|
|
cte.ATTIC_FLOOR: 'attic floor',
|
|
|
|
cte.INTERIOR_SLAB: 'interior slab',
|
|
|
|
cte.ROOF: 'roof'
|
2021-05-26 18:17:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def yoc_to_nrel_standard(year_of_construction):
|
|
|
|
"""
|
|
|
|
Year of construction to NREL standard
|
|
|
|
:param year_of_construction: int
|
|
|
|
:return: str
|
|
|
|
"""
|
|
|
|
if int(year_of_construction) < 2009:
|
|
|
|
standard = 'ASHRAE 90.1_2004'
|
|
|
|
else:
|
|
|
|
standard = 'ASHRAE 189.1_2009'
|
|
|
|
return standard
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def city_to_reference_city(city):
|
|
|
|
"""
|
|
|
|
City name to reference city
|
|
|
|
:param city: str
|
|
|
|
:return: str
|
|
|
|
"""
|
2022-11-09 11:42:06 -05:00
|
|
|
# todo: Dummy function that needs to be implemented
|
2021-05-26 18:17:23 -04:00
|
|
|
reference_city = 'Baltimore'
|
|
|
|
if city is not None:
|
|
|
|
reference_city = 'Baltimore'
|
|
|
|
return reference_city
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def city_to_nrel_climate_zone(city):
|
|
|
|
"""
|
|
|
|
City name to NREL climate zone
|
|
|
|
:param city: str
|
|
|
|
:return: str
|
|
|
|
"""
|
|
|
|
reference_city = ConstructionHelper.city_to_reference_city(city)
|
2022-12-16 07:21:33 -05:00
|
|
|
return ConstructionHelper._reference_city_to_nrel_climate_zone[reference_city]
|