diff --git a/city_model_structure/building_demand/thermal_boundary.py b/city_model_structure/building_demand/thermal_boundary.py index 9bbd5943..cf5ede7c 100644 --- a/city_model_structure/building_demand/thermal_boundary.py +++ b/city_model_structure/building_demand/thermal_boundary.py @@ -9,6 +9,7 @@ Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concord import uuid from typing import List, Union, TypeVar from helpers.configuration_helper import ConfigurationHelper as ch +import helpers.constants as cte from city_model_structure.building_demand.layer import Layer from city_model_structure.building_demand.thermal_opening import ThermalOpening from city_model_structure.building_demand.thermal_zone import ThermalZone @@ -213,7 +214,10 @@ class ThermalBoundary: if self._u_value is None: h_i = self.hi h_e = self.he - r_value = 1.0/h_i + 1.0/h_e + if self.type == cte.GROUND: + r_value = 1.0 / h_i + else: + r_value = 1.0/h_i + 1.0/h_e try: for layer in self.layers: if layer.material.no_mass: diff --git a/city_model_structure/building_demand/thermal_zone.py b/city_model_structure/building_demand/thermal_zone.py index 417a6b39..1e66402e 100644 --- a/city_model_structure/building_demand/thermal_zone.py +++ b/city_model_structure/building_demand/thermal_zone.py @@ -52,26 +52,26 @@ class ThermalZone: self._appliances = None self._internal_gains = None self._thermal_control = None - self._usage_zones = None + self._usages = None @property def usage_zones(self): # example 70-office_30-residential if self._usage_from_parent: - self._usage_zones = copy.deepcopy(self._parent_internal_zone.usage_zones) + self._usages = copy.deepcopy(self._parent_internal_zone.usage_zones) else: values = self._usage.split('_') usages = [] for value in values: usages.append(value.split('-')) - self._usage_zones = [] - for parent_usage_zone in self._parent_internal_zone.usage_zones: + self._usages = [] + for parent_usage in self._parent_internal_zone.usage_zones: for value in usages: - if parent_usage_zone.usage == value[1]: - new_usage_zone = copy.deepcopy(parent_usage_zone) - new_usage_zone.percentage = float(value[0])/100 - self._usage_zones.append(new_usage_zone) - return self._usage_zones + if parent_usage.usage == value[1]: + new_usage = copy.deepcopy(parent_usage) + new_usage.percentage = float(value[0])/100 + self._usages.append(new_usage) + return self._usages @property def id(self): @@ -102,7 +102,7 @@ class ThermalZone: @property def additional_thermal_bridge_u_value(self) -> Union[None, float]: """ - Get thermal zone additional thermal bridge u value W/m2K + Get thermal zone additional thermal bridge u value per footprint area W/m2K :return: None or float """ return self._additional_thermal_bridge_u_value @@ -110,7 +110,7 @@ class ThermalZone: @additional_thermal_bridge_u_value.setter def additional_thermal_bridge_u_value(self, value): """ - Set thermal zone additional thermal bridge u value W/m2K + Set thermal zone additional thermal bridge u value per footprint area W/m2K :param value: float """ if value is not None: