small bug found

This commit is contained in:
Pilar 2022-11-21 14:58:32 -05:00
parent c1f2ff5c4b
commit 87d95a14e6
2 changed files with 16 additions and 12 deletions

View File

@ -9,6 +9,7 @@ Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concord
import uuid import uuid
from typing import List, Union, TypeVar from typing import List, Union, TypeVar
from helpers.configuration_helper import ConfigurationHelper as ch 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.layer import Layer
from city_model_structure.building_demand.thermal_opening import ThermalOpening from city_model_structure.building_demand.thermal_opening import ThermalOpening
from city_model_structure.building_demand.thermal_zone import ThermalZone from city_model_structure.building_demand.thermal_zone import ThermalZone
@ -213,7 +214,10 @@ class ThermalBoundary:
if self._u_value is None: if self._u_value is None:
h_i = self.hi h_i = self.hi
h_e = self.he 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: try:
for layer in self.layers: for layer in self.layers:
if layer.material.no_mass: if layer.material.no_mass:

View File

@ -52,26 +52,26 @@ class ThermalZone:
self._appliances = None self._appliances = None
self._internal_gains = None self._internal_gains = None
self._thermal_control = None self._thermal_control = None
self._usage_zones = None self._usages = None
@property @property
def usage_zones(self): def usage_zones(self):
# example 70-office_30-residential # example 70-office_30-residential
if self._usage_from_parent: 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: else:
values = self._usage.split('_') values = self._usage.split('_')
usages = [] usages = []
for value in values: for value in values:
usages.append(value.split('-')) usages.append(value.split('-'))
self._usage_zones = [] self._usages = []
for parent_usage_zone in self._parent_internal_zone.usage_zones: for parent_usage in self._parent_internal_zone.usage_zones:
for value in usages: for value in usages:
if parent_usage_zone.usage == value[1]: if parent_usage.usage == value[1]:
new_usage_zone = copy.deepcopy(parent_usage_zone) new_usage = copy.deepcopy(parent_usage)
new_usage_zone.percentage = float(value[0])/100 new_usage.percentage = float(value[0])/100
self._usage_zones.append(new_usage_zone) self._usages.append(new_usage)
return self._usage_zones return self._usages
@property @property
def id(self): def id(self):
@ -102,7 +102,7 @@ class ThermalZone:
@property @property
def additional_thermal_bridge_u_value(self) -> Union[None, float]: 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: None or float
""" """
return self._additional_thermal_bridge_u_value return self._additional_thermal_bridge_u_value
@ -110,7 +110,7 @@ class ThermalZone:
@additional_thermal_bridge_u_value.setter @additional_thermal_bridge_u_value.setter
def additional_thermal_bridge_u_value(self, value): 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 :param value: float
""" """
if value is not None: if value is not None: