added associated_thermal_boundaries to Surface

This commit is contained in:
Pilar 2022-11-08 16:28:07 -05:00
parent 96afcee56e
commit f5fe1fd4d9
4 changed files with 24 additions and 5 deletions

View File

@ -66,7 +66,9 @@ class Storey:
windows_areas = []
for hole in surface.holes_polygons:
windows_areas.append(hole.area)
self._thermal_boundaries.append(ThermalBoundary(surface, surface.solid_polygon.area, windows_areas))
new_thermal_boundary = ThermalBoundary(surface, surface.solid_polygon.area, windows_areas)
surface.associated_thermal_boundaries.append(new_thermal_boundary)
self._thermal_boundaries.append(new_thermal_boundary)
return self._thermal_boundaries
@property

View File

@ -30,6 +30,7 @@ class Surface:
self._id = None
self._azimuth = None
self._inclination = None
self._area = None
self._lower_corner = None
self._upper_corner = None
self._shared_surfaces = []
@ -38,7 +39,7 @@ class Surface:
self._holes_polygons = holes_polygons
self._solid_polygon = solid_polygon
self._inverse = None
self._associated_thermal_boundaries = None
self._associated_thermal_boundaries = []
self._vegetation = None
# todo: create self._associated_thermal_boundaries and bring the vegetation here instead of in thermal_boundary
@ -147,6 +148,15 @@ class Surface:
self._upper_corner = [self._max_coord('x'), self._max_coord('y'), self._max_coord('z')]
return self._upper_corner
@property
def perimeter_area(self):
"""
Get perimeter surface area in square meters (opaque + transparent)
:return: float
"""
self._area = self.perimeter_polygon.area
return self._area
@property
def azimuth(self):
"""
@ -309,3 +319,11 @@ class Surface:
:return: None or [ThermalBoundary]
"""
return self._associated_thermal_boundaries
@associated_thermal_boundaries.setter
def associated_thermal_boundaries(self, value):
"""
Set the list of thermal boundaries that has this surface as external face
:param value: None or [ThermalBoundary]
"""
self._associated_thermal_boundaries = value

View File

@ -99,7 +99,7 @@ class StoreysGeneration:
polygon = Polygon(coordinates)
ceiling = Surface(polygon, polygon, surface_type=cte.INTERIOR_SLAB)
surfaces_child.append(ceiling)
volume = ceiling.area_above_ground * height
volume = ceiling.perimeter_area * height
total_volume += volume
storeys.append(Storey(name, surfaces_child, neighbours, volume, self._internal_zone, self._floor_area))
name = 'storey_' + str(number_of_storeys - 1)

View File

@ -92,8 +92,7 @@ class TestGeometryFactory(TestCase):
self.assertIsNone(surface.swr, 'surface swr is not none')
self.assertIsNotNone(surface.lower_corner, 'surface envelope_lower_corner is none')
self.assertIsNotNone(surface.upper_corner, 'surface envelope_upper_corner is none')
self.assertIsNotNone(surface.area_below_ground, 'surface area_below_ground is none')
self.assertIsNotNone(surface.area_above_ground, 'surface area_above_ground is none')
self.assertIsNotNone(surface.perimeter_area, 'surface area_above_ground is none')
self.assertIsNotNone(surface.azimuth, 'surface azimuth is none')
self.assertIsNotNone(surface.type, 'surface type is none')
self.assertIsNotNone(surface.inclination, 'surface inclination is none')