complete the data model for the construction catalog

This commit is contained in:
Guille Gutierrez 2022-04-08 10:45:33 -04:00
parent 0592f2ce04
commit 6299cdfe48
4 changed files with 303 additions and 10 deletions

View File

@ -6,5 +6,105 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
class Archetype: class Archetype:
def __init__(self): def __init__(self, archetype_id,
pass function,
construction_period,
constructions,
average_storey_height,
number_of_storeys,
thermal_capacity,
extra_loses_due_to_thermal_bridges,
indirect_heated_ratio,
infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on):
self._id = archetype_id
self._function = function
self._construction_period = construction_period
self._constructions = constructions
self._average_storey_height = average_storey_height
self._number_of_storeys = number_of_storeys
self._thermal_capacity = thermal_capacity
self._extra_loses_due_to_thermal_bridges = extra_loses_due_to_thermal_bridges
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_on = infiltration_rate_for_ventilation_system_on
@property
def id(self):
"""
Get archetype id
:return: int
"""
return self._id
def function(self):
"""
Get archetype function
:return: str
"""
return self._function
@property
def construction_period(self):
"""
Get archetype construction period
:return: str
"""
return self._construction_period
@property
def average_storey_height(self):
"""
Get archetype average storey height
:return: float
"""
return self._average_storey_height
@property
def number_of_storeys(self):
"""
Get archetype number of storeys
:return: int
"""
return self._number_of_storeys
@property
def thermal_capacity(self):
"""
Get archetype thermal capacity
:return: int
"""
return self._thermal_capacity
@property
def extra_loses_due_to_thermal_bridges(self):
"""
Get archetype extra loses due to thermal bridges
:return: int
"""
return self._extra_loses_due_to_thermal_bridges
@property
def indirect_heated_ratio(self):
"""
Get archetype indirect heat ratio
:return: float
"""
return self._indirect_heated_ratio
@property
def infiltration_rate_for_ventilation_system_off(self):
"""
Get archetype infiltration rate for ventilation system off
:return: float
"""
return self._infiltration_rate_for_ventilation_system_off
@property
def infiltration_rate_for_ventilation_system_on(self):
"""
Get archetype infiltration rate for ventilation system on
:return: float
"""
return self._infiltration_rate_for_ventilation_system_on

View File

@ -1,10 +1,63 @@
""" """
Construction catalog contruction Construction catalog construction
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
class Construction: class Construction:
def __init__(self): def __init__(self, construction_id, construction_type, name, layers, window_ratio=None, window=None):
pass self._id = construction_id
self._type = construction_type
self._name = name
self._layers = layers
self._window_ratio = window_ratio
self._window = window
@property
def id(self):
"""
Get construction id
:return: int
"""
return self._id
@property
def type(self):
"""
Get construction type
:return: str
"""
return self._type
@property
def name(self):
"""
Get construction name
:return: str
"""
return self._name
@property
def layers(self):
"""
Get construction layers
:return: [layer]
"""
return self._layers
@property
def window_ratio(self):
"""
Get construction window ratio (only when used as archetype construction)
:return: (0..1) or None
"""
return self._window_ratio
@property
def window(self):
"""
Get construction window (only when used as archetype construction)
:return: window or None
"""
return self._window

View File

@ -0,0 +1,45 @@
"""
Construction catalog layer
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Layer:
def __init__(self, layer_id, name, material, thickness):
self._id = layer_id
self._name = name
self._material = material
self._thickness = thickness
@property
def id(self):
"""
Get layer id
:return: int
"""
return self._id
@property
def name(self):
"""
Get layer name
:return: str
"""
return self._name
@property
def material(self):
"""
Get layer material
:return: Material
"""
return self._material
@property
def thickness(self):
"""
Get layer thickness in meters
:return: None or float
"""
return self._thickness

View File

@ -5,9 +5,104 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
from city_model_structure.building_demand.material import Material as LibsMaterial class Material:
def __init__(self, material_id,
name,
solar_absorptance,
thermal_absorptance,
visible_absorptance,
no_mass=False,
thermal_resistance=None,
conductivity=None,
density=None,
specific_heat=None):
self._id = material_id
self._name = name
self._solar_absorptance = solar_absorptance
self._thermal_absorptance = thermal_absorptance
self._visible_absorptance = visible_absorptance
self._no_mass = no_mass
self._thermal_resistance = thermal_resistance
self._conductivity = conductivity
self._density = density
self._specific_heat = specific_heat
class Material(LibsMaterial): @property
def __init__(self): def id(self):
# Inherit normal material directly if needed additional transformations will be done to this class """
super().__init__() Get material id
:return: int
"""
return self._id
@property
def name(self):
"""
Get material name
:return: str
"""
return self._name
@property
def conductivity(self):
"""
Get material conductivity in W/mK
:return: None or float
"""
return self._conductivity
@property
def specific_heat(self):
"""
Get material conductivity in J/kgK
:return: None or float
"""
return self._specific_heat
@property
def density(self):
"""
Get material density in kg/m3
:return: None or float
"""
return self._density
@property
def solar_absorptance(self):
"""
Get material solar absorptance
:return: None or float
"""
return self._solar_absorptance
@property
def thermal_absorptance(self):
"""
Get material thermal absorptance
:return: None or float
"""
return self._thermal_absorptance
@property
def visible_absorptance(self):
"""
Get material visible absorptance
:return: None or float
"""
return self._visible_absorptance
@property
def no_mass(self):
"""
Get material no mass flag
:return: None or Boolean
"""
return self._no_mass
@property
def thermal_resistance(self):
"""
Get material thermal resistance in m2K/W
:return: None or float
"""
return self._thermal_resistance