diff --git a/city_model_structure/attributes/thermal_boundary.py b/city_model_structure/attributes/thermal_boundary.py index 1316d24e..cac4c2fc 100644 --- a/city_model_structure/attributes/thermal_boundary.py +++ b/city_model_structure/attributes/thermal_boundary.py @@ -232,7 +232,12 @@ class ThermalBoundary: """ if self._window_area is None: try: - self._window_area = float(self._surface.area) * float(self.window_ratio) + if self.surface.hole_polygons is None: + self._window_area = float(self.surface.perimeter_polygon.area) * float(self.window_ratio) + else: + self._window_area = 0 + for hole_polygon in self.surface.hole_polygons: + self._window_area += hole_polygon.area except TypeError: raise Exception('Window ratio is not defined or invalid surface area') return self._window_area diff --git a/city_model_structure/attributes/thermal_opening.py b/city_model_structure/attributes/thermal_opening.py index 85ca3531..4920ca1f 100644 --- a/city_model_structure/attributes/thermal_opening.py +++ b/city_model_structure/attributes/thermal_opening.py @@ -14,7 +14,7 @@ class ThermalOpening: self._area = None self._openable_ratio = None self._conductivity = None - self._frame_ratio = 0 + self._frame_ratio = None self._g_value = None self._thickness = None self._front_side_solar_transmittance_at_normal_incidence = None @@ -214,4 +214,3 @@ class ThermalOpening: :return: """ self._he = value - diff --git a/city_model_structure/building.py b/city_model_structure/building.py index b134a677..54cb5ae6 100644 --- a/city_model_structure/building.py +++ b/city_model_structure/building.py @@ -35,7 +35,7 @@ class Building(CityObject): self._cooled = None self._average_storey_height = None self._storeys_above_ground = None - self._foot_print = None + self._floor_area = None self._usage_zones = [] self._building_units = [] self._type = 'building' @@ -55,7 +55,7 @@ class Building(CityObject): for t_zones in self._thermal_zones: t_zones.bounded = [ThermalBoundary(s, [t_zones]) for s in t_zones.surfaces] surface_id = 0 - for surface in self._surfaces: + for surface in self.surfaces: surface.lower_corner = self._lower_corner surface.parent(self, surface_id) surface_id += 1 @@ -201,15 +201,6 @@ class Building(CityObject): def _tuple_to_point(xy_tuple): return [xy_tuple[0], xy_tuple[1], 0.0] - # todo, to be implemented - @property - def foot_print(self) -> Surface: - """ - City object foot print surface - :return: Surface - """ - raise NotImplementedError - @property def type(self): """ @@ -351,3 +342,21 @@ class Building(CityObject): storeys.append(storey) storeys.append(rest_mesh) return storeys + + @property + def floor_area(self): + """ + Floor area of the building m2 + :return: float + """ + if self._floor_area is None: + self._floor_area = 0 + for surface in self.surfaces: + if surface.type == 'Ground': + self._floor_area += surface.perimeter_polygon.area + return self._floor_area + + # todo: erase this function, only for rabeehs case + @floor_area.setter + def floor_area(self, value): + self._floor_area = value diff --git a/data/physics/ca_archetypes_reduced.xml b/data/physics/ca_archetypes_reduced.xml index d3d1fe95..dcb9ee43 100644 --- a/data/physics/ca_archetypes_reduced.xml +++ b/data/physics/ca_archetypes_reduced.xml @@ -15,7 +15,7 @@ 90 0.1 0.25 - 0.35 + 0.176 0 @@ -33,14 +33,14 @@ 90 0.1 0.25 - 0.35 + 0.19 0 - 0.11 + 0.13 34 @@ -49,9 +49,9 @@ 3 1 90 - 0.15 - 0.25 - 0.45 + 0.1 + 0.15 + 0.22 0 @@ -67,9 +67,9 @@ 3 1 90 - 0.15 - 0.25 - 0.45 + 0.1 + 0.15 + 0.32 0 @@ -85,9 +85,9 @@ 3 1 90 - 0.15 - 0.25 - 0.45 + 0.1 + 0.15 + 0.4 0 @@ -103,9 +103,9 @@ 3 1 90 - 0.15 - 0.25 - 0.45 + 0.1 + 0.15 + 0.53 0 @@ -121,9 +121,9 @@ 3 1 90 - 0.15 - 0.25 - 0.45 + 0.1 + 0.15 + 0.6 0 @@ -139,9 +139,9 @@ 3 1 90 - 0.15 - 0.25 - 0.45 + 0.1 + 0.15 + 0.6 0 diff --git a/data/physics/ca_constructions_reduced.xml b/data/physics/ca_constructions_reduced.xml index 81ee2a38..cd2ea6ea 100644 --- a/data/physics/ca_constructions_reduced.xml +++ b/data/physics/ca_constructions_reduced.xml @@ -1,182 +1,182 @@ - - 0.46 - 0.5 - 0 - 1.8 - - - 0.52 - 0.5 - 0 + + 0.46 + 0.5 + 0.3 + 1.8 + + + 0.52 + 0.5 + 0.3 2.702 - + - - 0.11 - 0.8 - 0.2 - - - 0.16 - 0.8 - 0.2 - - - 0.19 - 0.8 - 0.2 - - - 0.2 - 0.8 - 0.2 - - - 0.25 - 0.8 - 0.2 - - - 0.26 - 0.8 - 0.2 - - - 0.26 - 0.8 - 0.2 - - - 0.301 - 0.8 - 0.2 - - #wall above grade - - 0.12 - 0.8 - 0.2 - - - 0.29 - 0.8 - 0.2 - - - 0.36 - 0.8 - 0.2 - - - 0.41 - 0.8 - 0.2 - - - 0.55 - 0.8 - 0.2 - - - 0.53 - 0.8 - 0.2 - - - 0.58 - 0.8 - 0.2 - - - 0.66 - 0.8 - 0.2 - - #wall below grade - - 0.335 - 0.8 - 0.2 - - - 0.312 - 0.8 - 0.2 - - - 0.408 - 0.8 - 0.2 - - - 0.510 - 0.8 - 0.2 - - - 0.645 - 0.8 - 0.2 - - - 1.369 - 0.8 - 0.2 - - - 1.449 - 0.8 - 0.2 - - - 2.083 - 0.8 - 0.2 - - #slab on grade - - 0.510 - 0.8 - 0.2 - - - 1.428 - 0.8 - 0.2 - - - 1.428 - 0.8 - 0.2 - - - 1.428 - 0.8 - 0.2 - - - 1.428 - 0.8 - 0.2 - - - 2.66 - 0.8 - 0.2 - - - 2.66 - 0.8 - 0.2 - - - 2.66 - 0.8 - 0.2 - + + 0.14 + 0.7 + 0.3 + + + 0.17 + 0.7 + 0.3 + + + 0.19 + 0.7 + 0.3 + + + 0.2 + 0.7 + 0.3 + + + 0.25 + 0.7 + 0.3 + + + 0.26 + 0.7 + 0.3 + + + 0.26 + 0.7 + 0.3 + + + 0.301 + 0.7 + 0.3 + + #wall above grade + + 0.25 + 0.7 + 0.3 + + + 0.30 + 0.7 + 0.3 + + + 0.32 + 0.7 + 0.3 + + + 0.327 + 0.7 + 0.3 + + + 0.333 + 0.7 + 0.3 + + + 0.36 + 0.7 + 0.3 + + + 0.41 + 0.7 + 0.3 + + + 0.48 + 0.7 + 0.3 + + #wall below grade + + 0.33 + 0.7 + 0.3 + + + 0.6 + 0.7 + 0.3 + + + 0.6 + 0.7 + 0.3 + + + 0.37 + 0.7 + 0.3 + + + 1.16 + 0.7 + 0.3 + + + 0.60 + 0.7 + 0.3 + + + 0.588 + 0.7 + 0.3 + + + 0.588 + 0.7 + 0.3 + + #slab on grade + + 0.3 + 0.7 + 0.3 + + + 0.51 + 0.7 + 0.3 + + + 0.67 + 0.7 + 0.3 + + + 0.85 + 0.7 + 0.3 + + + 1.05 + 0.7 + 0.3 + + + 1.15 + 0.7 + 0.3 + + + 1.24 + 0.7 + 0.3 + + + 1.43 + 0.7 + 0.3 + diff --git a/data/usage/ca_archetypes_reduced.xml b/data/usage/ca_archetypes_reduced.xml index c8687e11..0f1dce65 100644 --- a/data/usage/ca_archetypes_reduced.xml +++ b/data/usage/ca_archetypes_reduced.xml @@ -1,9 +1,8 @@ - Building Usage Library Reduced - Library created by Rabeeh from whatever norm - - Source? + Building Usage Library Reduced + Library created by Rabeeh from whatever norm + Source? residential All residential buildings @@ -22,11 +21,11 @@ 19.5 - 21.0 + 19.0 18.0 - 24.0 + 21.0 0