2021-08-26 13:27:43 -04:00
|
|
|
"""
|
|
|
|
Constant module
|
|
|
|
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-08-26 13:27:43 -04:00
|
|
|
"""
|
|
|
|
|
2021-06-10 10:48:30 -04:00
|
|
|
# universal constants
|
2022-05-19 12:02:13 -04:00
|
|
|
|
2021-05-25 13:34:57 -04:00
|
|
|
KELVIN = 273.15
|
2023-03-24 13:34:37 -04:00
|
|
|
WATER_DENSITY = 1000 # kg/m3
|
|
|
|
WATER_HEAT_CAPACITY = 4182 # J/kgK
|
2024-06-13 15:41:20 -04:00
|
|
|
WATER_THERMAL_CONDUCTIVITY = 0.65 # W/mK
|
2024-04-10 10:27:10 -04:00
|
|
|
NATURAL_GAS_LHV = 36.6e6 # J/m3
|
2023-03-24 13:34:37 -04:00
|
|
|
AIR_DENSITY = 1.293 # kg/m3
|
|
|
|
AIR_HEAT_CAPACITY = 1005.2 # J/kgK
|
2021-06-10 10:48:30 -04:00
|
|
|
|
2021-11-05 10:16:35 -04:00
|
|
|
# converters
|
|
|
|
HOUR_TO_MINUTES = 60
|
2022-05-19 12:02:13 -04:00
|
|
|
MINUTES_TO_SECONDS = 60
|
2023-03-20 11:07:43 -04:00
|
|
|
HOUR_TO_SECONDS = 3600
|
2021-11-05 10:16:35 -04:00
|
|
|
METERS_TO_FEET = 3.28084
|
2021-11-11 17:25:53 -05:00
|
|
|
BTU_H_TO_WATTS = 0.29307107
|
2022-03-17 18:49:44 -04:00
|
|
|
KILO_WATTS_HOUR_TO_JULES = 3600000
|
2023-08-07 16:56:01 -04:00
|
|
|
WATTS_HOUR_TO_JULES = 3600
|
2023-03-20 11:07:43 -04:00
|
|
|
GALLONS_TO_QUBIC_METERS = 0.0037854117954011185
|
2021-11-05 10:16:35 -04:00
|
|
|
|
2021-06-10 10:48:30 -04:00
|
|
|
# time
|
2021-09-01 12:14:48 -04:00
|
|
|
SECOND = 'second'
|
2021-05-25 13:34:57 -04:00
|
|
|
MINUTE = 'minute'
|
|
|
|
HOUR = 'hour'
|
|
|
|
DAY = 'day'
|
|
|
|
WEEK = 'week'
|
|
|
|
MONTH = 'month'
|
|
|
|
YEAR = 'year'
|
2021-06-10 10:48:30 -04:00
|
|
|
|
2021-09-01 12:14:48 -04:00
|
|
|
# day types
|
|
|
|
MONDAY = 'monday'
|
|
|
|
TUESDAY = 'tuesday'
|
|
|
|
WEDNESDAY = 'wednesday'
|
|
|
|
THURSDAY = 'thursday'
|
|
|
|
FRIDAY = 'friday'
|
|
|
|
SATURDAY = 'saturday'
|
|
|
|
SUNDAY = 'sunday'
|
|
|
|
HOLIDAY = 'holiday'
|
|
|
|
WINTER_DESIGN_DAY = 'winter_design_day'
|
|
|
|
SUMMER_DESIGN_DAY = 'summer_design_day'
|
2022-02-17 12:37:14 -05:00
|
|
|
WEEK_DAYS = 'Weekdays'
|
|
|
|
WEEK_ENDS = 'Weekends'
|
|
|
|
ALL_DAYS = 'Alldays'
|
2021-09-01 12:14:48 -04:00
|
|
|
|
2023-09-25 05:19:02 -04:00
|
|
|
JANUARY = 'January'
|
|
|
|
FEBRUARY = 'February'
|
|
|
|
MARCH = 'March'
|
|
|
|
APRIL = 'April'
|
|
|
|
MAY = 'May'
|
|
|
|
JUNE = 'June'
|
|
|
|
JULY = 'July'
|
|
|
|
AUGUST = 'August'
|
|
|
|
SEPTEMBER = 'September'
|
|
|
|
OCTOBER = 'October'
|
|
|
|
NOVEMBER = 'November'
|
|
|
|
DECEMBER = 'December'
|
2023-03-24 13:34:37 -04:00
|
|
|
|
2023-09-25 05:19:02 -04:00
|
|
|
MONTHS = [JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER]
|
2023-08-07 12:32:33 -04:00
|
|
|
|
2023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EDNESDAY: 50,
|
|
|
|
THURSDAY: 50,
|
|
|
|
FRIDAY: 50,
|
|
|
|
SATURDAY: 52,
|
|
|
|
SUNDAY: 52,
|
|
|
|
HOLIDAY: 10}
|
|
|
|
|
|
|
|
DAYS_A_MONTH = {JANUARY: 31,
|
|
|
|
FEBRUARY: 28,
|
|
|
|
MARCH: 31,
|
|
|
|
APRIL: 30,
|
|
|
|
MAY: 31,
|
|
|
|
JUNE: 30,
|
|
|
|
JULY: 31,
|
|
|
|
AUGUST: 31,
|
|
|
|
SEPTEMBER: 30,
|
|
|
|
OCTOBER: 31,
|
|
|
|
NOVEMBER: 30,
|
|
|
|
DECEMBER: 31}
|
2023-03-24 13:34:37 -04:00
|
|
|
|
2021-09-01 12:14:48 -04:00
|
|
|
# data types
|
|
|
|
ANY_NUMBER = 'any_number'
|
|
|
|
FRACTION = 'fraction'
|
|
|
|
ON_OFF = 'on_off'
|
|
|
|
TEMPERATURE = 'temperature'
|
|
|
|
HUMIDITY = 'humidity'
|
|
|
|
CONTROL_TYPE = 'control_type'
|
2022-04-26 18:39:42 -04:00
|
|
|
CONTINUOUS = 'continuous'
|
|
|
|
DISCRETE = 'discrete'
|
|
|
|
CONSTANT = 'constant'
|
2022-05-18 14:52:41 -04:00
|
|
|
INTERNAL_GAINS = 'internal_gains'
|
2021-09-01 12:14:48 -04:00
|
|
|
|
2021-06-10 10:48:30 -04:00
|
|
|
# surface types
|
|
|
|
WALL = 'Wall'
|
|
|
|
GROUND_WALL = 'Ground wall'
|
|
|
|
GROUND = 'Ground'
|
|
|
|
ATTIC_FLOOR = 'Attic floor'
|
|
|
|
ROOF = 'Roof'
|
|
|
|
INTERIOR_SLAB = 'Interior slab'
|
|
|
|
INTERIOR_WALL = 'Interior wall'
|
2021-06-23 09:53:33 -04:00
|
|
|
VIRTUAL_INTERNAL = 'Virtual internal'
|
2021-06-10 10:48:30 -04:00
|
|
|
WINDOW = 'Window'
|
|
|
|
DOOR = 'Door'
|
|
|
|
SKYLIGHT = 'Skylight'
|
|
|
|
|
2022-03-24 16:51:01 -04:00
|
|
|
# functions and usages
|
2022-12-16 07:21:33 -05:00
|
|
|
RESIDENTIAL = 'residential'
|
2022-03-24 16:51:01 -04:00
|
|
|
SINGLE_FAMILY_HOUSE = 'single family house'
|
|
|
|
MULTI_FAMILY_HOUSE = 'multifamily house'
|
2022-12-16 07:21:33 -05:00
|
|
|
ROW_HOUSE = 'row house'
|
2022-03-24 16:51:01 -04:00
|
|
|
MID_RISE_APARTMENT = 'mid rise apartment'
|
|
|
|
HIGH_RISE_APARTMENT = 'high rise apartment'
|
2022-12-16 07:21:33 -05:00
|
|
|
OFFICE_AND_ADMINISTRATION = 'office and administration'
|
2022-03-24 16:51:01 -04:00
|
|
|
SMALL_OFFICE = 'small office'
|
|
|
|
MEDIUM_OFFICE = 'medium office'
|
|
|
|
LARGE_OFFICE = 'large office'
|
2022-12-16 07:21:33 -05:00
|
|
|
COURTHOUSE = 'courthouse'
|
|
|
|
FIRE_STATION = 'fire station'
|
|
|
|
PENITENTIARY = 'penitentiary'
|
|
|
|
POLICE_STATION = 'police station'
|
|
|
|
POST_OFFICE = 'post office'
|
|
|
|
LIBRARY = 'library'
|
|
|
|
EDUCATION = 'education'
|
2022-03-24 16:51:01 -04:00
|
|
|
PRIMARY_SCHOOL = 'primary school'
|
2022-12-16 07:21:33 -05:00
|
|
|
PRIMARY_SCHOOL_WITH_SHOWER = 'school with shower'
|
2022-03-24 16:51:01 -04:00
|
|
|
SECONDARY_SCHOOL = 'secondary school'
|
2022-12-16 07:21:33 -05:00
|
|
|
UNIVERSITY = 'university'
|
|
|
|
LABORATORY_AND_RESEARCH_CENTER = 'laboratory and research centers'
|
2022-03-24 16:51:01 -04:00
|
|
|
STAND_ALONE_RETAIL = 'stand alone retail'
|
2021-06-10 10:48:30 -04:00
|
|
|
HOSPITAL = 'hospital'
|
2022-03-24 16:51:01 -04:00
|
|
|
OUT_PATIENT_HEALTH_CARE = 'out-patient health care'
|
2022-12-16 07:21:33 -05:00
|
|
|
HEALTH_CARE = 'health care'
|
|
|
|
RETIREMENT_HOME_OR_ORPHANAGE = 'retirement home or orphanage'
|
|
|
|
COMMERCIAL = 'commercial'
|
2021-06-10 10:48:30 -04:00
|
|
|
STRIP_MALL = 'strip mall'
|
2022-03-24 16:51:01 -04:00
|
|
|
SUPERMARKET = 'supermarket'
|
|
|
|
RETAIL_SHOP_WITHOUT_REFRIGERATED_FOOD = 'retail shop without refrigerated food'
|
|
|
|
RETAIL_SHOP_WITH_REFRIGERATED_FOOD = 'retail shop with refrigerated food'
|
2022-12-16 07:21:33 -05:00
|
|
|
RESTAURANT = 'restaurant'
|
|
|
|
QUICK_SERVICE_RESTAURANT = 'quick service restaurant'
|
|
|
|
FULL_SERVICE_RESTAURANT = 'full service restaurant'
|
2022-03-24 16:51:01 -04:00
|
|
|
HOTEL = 'hotel'
|
|
|
|
HOTEL_MEDIUM_CLASS = 'hotel medium class'
|
2022-12-16 07:21:33 -05:00
|
|
|
SMALL_HOTEL = 'small hotel'
|
|
|
|
LARGE_HOTEL = 'large hotel'
|
2022-03-24 16:51:01 -04:00
|
|
|
DORMITORY = 'dormitory'
|
|
|
|
EVENT_LOCATION = 'event location'
|
2022-12-16 07:21:33 -05:00
|
|
|
CONVENTION_CENTER = 'convention center'
|
2021-06-10 10:48:30 -04:00
|
|
|
HALL = 'hall'
|
2022-03-24 16:51:01 -04:00
|
|
|
GREEN_HOUSE = 'green house'
|
2022-12-16 07:21:33 -05:00
|
|
|
INDUSTRY = 'industry'
|
|
|
|
WORKSHOP = 'workshop'
|
|
|
|
WAREHOUSE = 'warehouse'
|
|
|
|
WAREHOUSE_REFRIGERATED = 'warehouse refrigerated'
|
|
|
|
SPORTS_LOCATION = 'sports location'
|
|
|
|
SPORTS_ARENA = 'sports arena'
|
|
|
|
GYMNASIUM = 'gymnasium'
|
|
|
|
MOTION_PICTURE_THEATRE = 'motion picture theatre'
|
|
|
|
MUSEUM = 'museum'
|
|
|
|
PERFORMING_ARTS_THEATRE = 'performing arts theatre'
|
|
|
|
TRANSPORTATION = 'transportation'
|
|
|
|
AUTOMOTIVE_FACILITY = 'automotive facility'
|
|
|
|
PARKING_GARAGE = 'parking garage'
|
|
|
|
RELIGIOUS = 'religious'
|
2022-03-24 16:51:01 -04:00
|
|
|
NON_HEATED = 'non-heated'
|
2023-02-24 06:31:28 -05:00
|
|
|
DATACENTER = 'datacenter'
|
2023-08-09 13:52:55 -04:00
|
|
|
FARM = 'farm'
|
2021-11-11 17:25:53 -05:00
|
|
|
|
|
|
|
LIGHTING = 'Lights'
|
|
|
|
OCCUPANCY = 'Occupancy'
|
2022-03-08 19:19:52 -05:00
|
|
|
APPLIANCES = 'Appliances'
|
2021-11-11 17:25:53 -05:00
|
|
|
HVAC_AVAILABILITY = 'HVAC Avail'
|
|
|
|
INFILTRATION = 'Infiltration'
|
2023-05-19 11:20:44 -04:00
|
|
|
VENTILATION = 'Ventilation'
|
2021-11-11 17:25:53 -05:00
|
|
|
COOLING_SET_POINT = 'ClgSetPt'
|
|
|
|
HEATING_SET_POINT = 'HtgSetPt'
|
2022-02-17 12:37:14 -05:00
|
|
|
EQUIPMENT = 'Equipment'
|
|
|
|
ACTIVITY = 'Activity'
|
2022-06-06 13:37:48 -04:00
|
|
|
PEOPLE_ACTIVITY_LEVEL = 'People Activity Level'
|
2023-03-13 14:40:07 -04:00
|
|
|
DOMESTIC_HOT_WATER = 'Domestic Hot Water'
|
2023-05-04 10:39:23 -04:00
|
|
|
HEATING = 'Heating'
|
|
|
|
COOLING = 'Cooling'
|
|
|
|
ELECTRICITY = 'Electricity'
|
|
|
|
RENEWABLE = 'Renewable'
|
|
|
|
WOOD = 'Wood'
|
|
|
|
GAS = 'Gas'
|
|
|
|
DIESEL = 'Diesel'
|
|
|
|
COAL = 'Coal'
|
2024-04-10 10:27:10 -04:00
|
|
|
BIOMASS = 'Biomass'
|
2023-05-04 10:39:23 -04:00
|
|
|
AIR = 'Air'
|
|
|
|
WATER = 'Water'
|
|
|
|
GEOTHERMAL = 'Geothermal'
|
|
|
|
DISTRICT_HEATING_NETWORK = 'District Heating'
|
|
|
|
GRID = 'Grid'
|
|
|
|
ONSITE_ELECTRICITY = 'Onsite Electricity'
|
|
|
|
PHOTOVOLTAIC = 'Photovoltaic'
|
|
|
|
BOILER = 'Boiler'
|
|
|
|
HEAT_PUMP = 'Heat Pump'
|
2023-05-29 11:56:56 -04:00
|
|
|
BASEBOARD = 'Baseboard'
|
2023-10-13 08:23:40 -04:00
|
|
|
ELECTRICITY_GENERATOR = 'Electricity generator'
|
2023-05-29 11:56:56 -04:00
|
|
|
CHILLER = 'Chiller'
|
2023-10-03 13:07:20 -04:00
|
|
|
SENSIBLE = 'sensible'
|
2023-09-28 19:19:32 -04:00
|
|
|
LATENT = 'Latent'
|
|
|
|
LITHIUMION = 'Lithium Ion'
|
|
|
|
NICD = 'NiCd'
|
|
|
|
LEADACID = 'Lead Acid'
|
2022-03-08 19:19:52 -05:00
|
|
|
|
|
|
|
# Geometry
|
|
|
|
EPSILON = 0.0000001
|
|
|
|
|
|
|
|
# HVAC types
|
|
|
|
ONLY_HEATING = 'Heating'
|
|
|
|
ONLY_COOLING = 'Colling'
|
|
|
|
ONLY_VENTILATION = 'Ventilation'
|
|
|
|
HEATING_AND_VENTILATION = 'Heating and ventilation'
|
|
|
|
COOLING_AND_VENTILATION = 'Cooling and ventilation'
|
|
|
|
HEATING_AND_COLLING = 'Heating and cooling'
|
|
|
|
FULL_HVAC = 'Heating and cooling and ventilation'
|
2022-05-19 12:02:13 -04:00
|
|
|
|
|
|
|
# Floats
|
|
|
|
MAX_FLOAT = float('inf')
|
|
|
|
MIN_FLOAT = float('-inf')
|
2023-02-08 13:40:06 -05:00
|
|
|
|
|
|
|
# Tools
|
|
|
|
SRA = 'sra'
|
|
|
|
INSEL_MEB = 'insel meb'
|
2023-03-16 10:06:32 -04:00
|
|
|
|
|
|
|
# Costs units
|
|
|
|
CURRENCY_PER_SQM = 'currency/m2'
|
|
|
|
CURRENCY_PER_CBM = 'currency/m3'
|
|
|
|
CURRENCY_PER_KW = 'currency/kW'
|
|
|
|
CURRENCY_PER_KWH = 'currency/kWh'
|
|
|
|
CURRENCY_PER_MONTH = 'currency/month'
|
|
|
|
CURRENCY_PER_LITRE = 'currency/l'
|
|
|
|
CURRENCY_PER_KG = 'currency/kg'
|
|
|
|
CURRENCY_PER_CBM_PER_HOUR = 'currency/(m3/h)'
|
|
|
|
PERCENTAGE = '%'
|
|
|
|
|
|
|
|
# Costs chapters
|
2023-03-17 10:10:30 -04:00
|
|
|
SUPERSTRUCTURE = 'B_shell'
|
|
|
|
ENVELOPE = 'D_services'
|
|
|
|
ALLOWANCES_OVERHEAD_PROFIT = 'Z_allowances_overhead_profit'
|