From 8ec399947c2a2695a578cf5d3b5b5b0b6073ec56 Mon Sep 17 00:00:00 2001 From: Pilar Date: Tue, 16 Mar 2021 13:43:59 -0400 Subject: [PATCH] erased many classes created by Sanam but never used. Modified some classes to adapt to EnergyADE --- .../attributes/domestic_hot_water.py | 53 ----------------- .../attributes/electric_appliances.py | 26 -------- city_model_structure/attributes/facility.py | 59 ------------------- city_model_structure/attributes/household.py | 31 ---------- city_model_structure/attributes/hvac.py | 36 ----------- city_model_structure/attributes/lighting.py | 30 ---------- city_model_structure/attributes/occupants.py | 28 ++------- .../attributes/thermal_boundary.py | 17 +++--- .../attributes/thermal_opening.py | 15 ++++- city_model_structure/attributes/usage_zone.py | 56 +++++++++++++----- 10 files changed, 70 insertions(+), 281 deletions(-) delete mode 100644 city_model_structure/attributes/domestic_hot_water.py delete mode 100644 city_model_structure/attributes/electric_appliances.py delete mode 100644 city_model_structure/attributes/facility.py delete mode 100644 city_model_structure/attributes/household.py delete mode 100644 city_model_structure/attributes/hvac.py delete mode 100644 city_model_structure/attributes/lighting.py diff --git a/city_model_structure/attributes/domestic_hot_water.py b/city_model_structure/attributes/domestic_hot_water.py deleted file mode 100644 index ab8f8cca..00000000 --- a/city_model_structure/attributes/domestic_hot_water.py +++ /dev/null @@ -1,53 +0,0 @@ -""" -Building module -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2020 Project Author Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" -from city_model_structure.attributes.facility import Facility - - -class DomesticHotWater(Facility): - """ - Domestic Hot Water facilities class - """ - - def __init__(self, number_of_baths, number_of_showers, number_of_basin, water_storage_volume, operation_schedules, - convective_fraction, latent_fraction, radiant_fraction, total_value_of_heat_dissipation): - super().__init__(operation_schedules, convective_fraction, latent_fraction, radiant_fraction, - total_value_of_heat_dissipation) - self._number_of_baths = number_of_baths - self._number_of_showers = number_of_showers - self._number_of_basin = number_of_basin - self._water_storage_volume = water_storage_volume - - @property - def number_of_baths(self): - """ - Get number of baths of a building unit - :return: number of baths - """ - return self._number_of_baths - - @property - def number_of_showers(self): - """ - Get number of showers of a building unit - :return: number of showers - """ - return self._number_of_showers - - @property - def number_of_basin(self): - """ - Get number of wash basins of a building unit - :return: number of wash basins - """ - return self._number_of_basin - - @property - def water_storage_volume(self): - """ - Get the volume of water storage - :return: volume of water storage - """ - return self._water_storage_volume diff --git a/city_model_structure/attributes/electric_appliances.py b/city_model_structure/attributes/electric_appliances.py deleted file mode 100644 index 0c60986c..00000000 --- a/city_model_structure/attributes/electric_appliances.py +++ /dev/null @@ -1,26 +0,0 @@ -""" -Building module -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2020 Project Author Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" -from city_model_structure.attributes.facility import Facility - - -class ElectricAppliances(Facility): - """ - Electric appliance facilities class - """ - - def __init__(self, appliance_electric_power, operation_schedules, convective_fraction, latent_fraction, - radiant_fraction, total_value_of_heat_dissipation): - super().__init__(operation_schedules, convective_fraction, latent_fraction, radiant_fraction, - total_value_of_heat_dissipation) - self._appliance_electric_power = appliance_electric_power - - @property - def appliance_electric_power(self): - """ - Get appliances electric power - :return: appliances electric power - """ - return self._appliance_electric_power diff --git a/city_model_structure/attributes/facility.py b/city_model_structure/attributes/facility.py deleted file mode 100644 index 186d8dfe..00000000 --- a/city_model_structure/attributes/facility.py +++ /dev/null @@ -1,59 +0,0 @@ -""" -Building module -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2020 Project Author Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" - - -class Facility: - """ - facilities class - """ - - def __init__(self, operation_schedules, convective_fraction, latent_fraction, - radiant_fraction, total_value_of_heat_dissipation): - self._operation_schedules = operation_schedules - self._convective_fraction = convective_fraction - self._latent_fraction = latent_fraction - self._radiant_fraction = radiant_fraction - self._total_value_of_heat_dissipation = total_value_of_heat_dissipation - - @property - def operation_schedules(self): - """ - Get operation schedules of the facilities - :return: operation schedules - """ - return self._operation_schedules - - @property - def convective_fraction(self): - """ - Get convective fraction value - :return: convective fraction - """ - return self._convective_fraction - - @property - def latent_fraction(self): - """ - Get latent fraction value - :return: latent fraction - """ - return self._latent_fraction - - @property - def radiant_fraction(self): - """ - Get radiant fraction value - :return: radiant fraction - """ - return self._radiant_fraction - - @property - def total_value_of_heat_dissipation(self): - """ - Get heat dissipation value - :return: heat dissipation - """ - return self._total_value_of_heat_dissipation diff --git a/city_model_structure/attributes/household.py b/city_model_structure/attributes/household.py deleted file mode 100644 index ef1fe3e2..00000000 --- a/city_model_structure/attributes/household.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -Building module -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2020 Project Author Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" - - -class Household: - """ - Household class - """ - - def __init__(self, resident_type, household_type): - self._resident_type = resident_type - self._household_type = household_type - - @property - def resident_type(self): - """ - Get resident type - :return: resident type - """ - return self._resident_type - - @property - def household_type(self): - """ - Get household type - :return: household type - """ - return self._household_type \ No newline at end of file diff --git a/city_model_structure/attributes/hvac.py b/city_model_structure/attributes/hvac.py deleted file mode 100644 index ea9dce9f..00000000 --- a/city_model_structure/attributes/hvac.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -Building module -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2020 Project Author Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" -from city_model_structure.attributes.facility import Facility - - -class Hvac(Facility): - """ - HVAC facilities class - """ - - def __init__(self, temperature_setpoints, hvac_schedules, operation_schedules, convective_fraction, latent_fraction, - radiant_fraction, total_value_of_heat_dissipation): - super().__init__(operation_schedules, convective_fraction, latent_fraction, radiant_fraction, - total_value_of_heat_dissipation) - self._temperature_setpoints = temperature_setpoints - self._hvac_schedules = hvac_schedules - - @property - def temperature_setpoints(self): - """ - Get temperature setpoints - :return: temperature setpoints - """ - return self._temperature_setpoints - - @property - def hvac_schedules(self): - """ - Get HVAC schedules - :return: HVAC schedules - """ - return self._hvac_schedules - diff --git a/city_model_structure/attributes/lighting.py b/city_model_structure/attributes/lighting.py deleted file mode 100644 index 2913edb8..00000000 --- a/city_model_structure/attributes/lighting.py +++ /dev/null @@ -1,30 +0,0 @@ -""" -Building module -SPDX - License - Identifier: LGPL - 3.0 - or -later -Copyright © 2020 Project Author Sanam Dabirian sanam.dabirian@mail.concordia.ca -""" -from city_model_structure.attributes.facility import Facility - - -class Lighting(Facility): - """ - Lighting facilities class - """ - - def __init__(self, electric_power, operation_schedules, convective_fraction, latent_fraction, radiant_fraction, - total_value_of_heat_dissipation): - super().__init__(operation_schedules, convective_fraction, latent_fraction, radiant_fraction, - total_value_of_heat_dissipation) - """ - Constructor - """ - - self._electric_power = electric_power - - @property - def electric_power(self): - """ - Get lighting electric power - :return: lighting electric power - """ - return self._electric_power diff --git a/city_model_structure/attributes/occupants.py b/city_model_structure/attributes/occupants.py index a27f8ae2..bdc7263e 100644 --- a/city_model_structure/attributes/occupants.py +++ b/city_model_structure/attributes/occupants.py @@ -5,8 +5,10 @@ Copyright © 2020 Project Author Sanam Dabirian sanam.dabirian@mail.concordia.ca Contributors Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca """ +from typing import TypeVar import calendar as cal -from city_model_structure.attributes.usage_zone import UsageZone + +UsageZone = TypeVar('UsageZone') class Occupants: @@ -19,11 +21,10 @@ class Occupants: Constructor """ - self._internal_heat_gain = None self._heat_dissipation = None self._occupancy_rate = None self._occupant_type = None - self._occupant_zone = None + self._usage_zone = None self._occupant_schedule = None self._number_of_occupants = None self._arrival_time = None @@ -33,23 +34,6 @@ class Occupants: self._pd_of_meetings_duration = None self._complete_year_schedule = None - @property - def internal_heat_gain(self): - """ - Get internal heat gain of occupants in W/person - :return: float - """ - return self._internal_heat_gain - - @internal_heat_gain.setter - def internal_heat_gain(self, value): - """ - Set internal heat gain of occupants in W/person - :param value: float - :return: - """ - self._internal_heat_gain = value - @property def heat_dissipation(self): """ @@ -102,12 +86,12 @@ class Occupants: self._occupant_type = value @property - def occupant_zone(self) -> UsageZone: + def usage_zone(self) -> UsageZone: """ Get the zone an occupant is in :return: UsageZone """ - return self._occupant_zone + return self._usage_zone @property def occupant_schedule(self): diff --git a/city_model_structure/attributes/thermal_boundary.py b/city_model_structure/attributes/thermal_boundary.py index e505b541..3f8e280d 100644 --- a/city_model_structure/attributes/thermal_boundary.py +++ b/city_model_structure/attributes/thermal_boundary.py @@ -10,6 +10,7 @@ from city_model_structure.attributes.thermal_opening import ThermalOpening from city_model_structure.attributes.surface import Surface ThermalZone = TypeVar('ThermalZone') +Polygon = TypeVar('Polygon') class ThermalBoundary: @@ -32,13 +33,7 @@ class ThermalBoundary: self._he = None self._window_ratio = None self._refurbishment_measure = None - - # todo: to discuss with @Guille: 1. emissivity is a function of absorptance - # 2. pg 17: fraction and surface -> NO - self._emissivity = None - - # todo: @Guille - self._polygon = None + self._surface_geometry = None @property def surface(self) -> Surface: @@ -302,3 +297,11 @@ class ThermalBoundary: :return: """ self._he = value + + @property + def surface_geometry(self) -> Polygon: + """ + Get the polygon that defines the thermal boundary + :return: Polygon + """ + return self._surface_geometry diff --git a/city_model_structure/attributes/thermal_opening.py b/city_model_structure/attributes/thermal_opening.py index 23eabde6..05c6732f 100644 --- a/city_model_structure/attributes/thermal_opening.py +++ b/city_model_structure/attributes/thermal_opening.py @@ -4,6 +4,9 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Contributors Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca """ +from typing import TypeVar + +Polygon = TypeVar('Polygon') class ThermalOpening: @@ -22,9 +25,7 @@ class ThermalOpening: self._overall_u_value = None self._hi = None self._he = None - - # todo: discuss with @Guille - self._polygon = None + self._surface_geometry = None @property def area(self): @@ -217,3 +218,11 @@ class ThermalOpening: :return: """ self._he = value + + @property + def surface_geometry(self) -> Polygon: + """ + Get the polygon that defines the thermal opening + :return: Polygon + """ + return self._surface_geometry diff --git a/city_model_structure/attributes/usage_zone.py b/city_model_structure/attributes/usage_zone.py index df4ac0ba..648dd935 100644 --- a/city_model_structure/attributes/usage_zone.py +++ b/city_model_structure/attributes/usage_zone.py @@ -4,10 +4,12 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es Contributors Guille Gutierrez guillermo.gutierrezmorote@concordia.ca """ -from typing import List -from city_model_structure.attributes.internal_gains import InternalGains -from city_model_structure.attributes.lighting import Lighting -from city_model_structure.attributes.occupants import Occupants +from typing import List, TypeVar + +InternalGains = TypeVar('InternalGains') +Lighting = TypeVar('Lighting') +Occupants = TypeVar('Occupants') +Polyhedron = TypeVar('Polyhedron') class UsageZone: @@ -31,6 +33,8 @@ class UsageZone: self._lights = None self._heating_schedule = None self._cooling_schedule = None + self._ventilation_schedule = None + self._volume_geometry = None @property def lights(self) -> List[Lighting]: @@ -175,24 +179,24 @@ class UsageZone: @property def occupants(self) -> [Occupants]: """ - Get occupancy data - :return: [Occupancy] + Get occupants data + :return: [Occupants] """ return self._occupants @occupants.setter def occupants(self, values): """ - Set occupancy - :param values: [Occupancy] + Set occupants data + :param values: [Occupants] """ self._occupants = values @property def heating_schedule(self): """ - Get heating schedule: list of 0, 1 that define whether the heating system is OFF or ON - :return: dict{DtaFrame(int)} + Get heating schedule: list of 0, 1 that define whether the heating system should be OFF or ON + :return: dict{DataFrame(int)} """ return self._heating_schedule @@ -200,15 +204,15 @@ class UsageZone: def heating_schedule(self, values): """ heating schedule - :param values: dict{DtaFrame(int)} + :param values: dict{DataFrame(int)} """ self._heating_schedule = values @property def cooling_schedule(self): """ - Get cooling schedule: list of 0, 1 that define whether the heating system is OFF or ON - :return: dict{DtaFrame(int)} + Get cooling schedule: list of 0, 1 that define whether the cooling system should be OFF or ON + :return: dict{DataFrame(int)} """ return self._cooling_schedule @@ -216,10 +220,26 @@ class UsageZone: def cooling_schedule(self, values): """ cooling schedule - :param values: dict{DtaFrame(int)} + :param values: dict{DataFrame(int)} """ self._cooling_schedule = values + @property + def ventilation_schedule(self): + """ + Get ventilation schedule: list of 0, 1 that define whether the ventilation system should be OFF or ON + :return: dict{DataFrame(int)} + """ + return self._ventilation_schedule + + @ventilation_schedule.setter + def ventilation_schedule(self, values): + """ + ventilation_schedule schedule + :param values: dict{DataFrame(int)} + """ + self._ventilation_schedule = values + @property def occupancy_density(self): """ @@ -283,3 +303,11 @@ class UsageZone: :param values: float """ self._electrical_app_average_consumption_sqm_year = values + + @property + def volume_geometry(self) -> Polyhedron: + """ + Get the polyhedron defined by the thermal zone + :return: Polyhedron + """ + return self._volume_geometry