modifications in demo_occupancy_parameters.py and added new Rabeeh xml files

This commit is contained in:
pilar 2020-12-14 19:11:56 -05:00
parent 43c32bfceb
commit ad67c4273b
5 changed files with 379 additions and 17 deletions

View File

@ -217,7 +217,6 @@ class Surface:
Surface area in square meters Surface area in square meters
:return: float :return: float
""" """
# New method to calculate area
if self._area is None: if self._area is None:
alpha = 0 alpha = 0
vec_1 = self.points[1] - self.points[0] vec_1 = self.points[1] - self.points[0]
@ -228,9 +227,8 @@ class Surface:
area = 0 area = 0
print('Warning: the area of a line or point cannot be calculated. Area = 0') print('Warning: the area of a line or point cannot be calculated. Area = 0')
else: else:
# todo: Guilleeeee!!!! points_2d = np.array(self.rotate_surface_to_horizontal())
points_2d = self.rotate_surface_to_horizontal(self) polygon_2d = pn.Polygon(points_2d)
polygon_2d = pn.Polygon(np.array(points_2d))
area = 0 area = 0
for i in range(0, len(polygon_2d.points)-1): for i in range(0, len(polygon_2d.points)-1):
point = polygon_2d.points[i] point = polygon_2d.points[i]
@ -242,20 +240,19 @@ class Surface:
self._area = abs(area) self._area = abs(area)
return self._area return self._area
@staticmethod def rotate_surface_to_horizontal(self):
def rotate_surface_to_horizontal(surface):
z_vector = [0, 0, 1] z_vector = [0, 0, 1]
normal_vector = surface.normal normal_vector = self.normal
points_2d = [] points_2d = []
x = normal_vector[0] x = normal_vector[0]
y = normal_vector[1] y = normal_vector[1]
if x == 0 and y == 0: if x == 0 and y == 0:
# Already horizontal # Already horizontal
for point in surface.points: for point in self.points:
points_2d.append([point[0], point[1], 0]) points_2d.append([point[0], point[1], 0])
else: else:
alpha = surface.angle_between_vectors(normal_vector, z_vector) alpha = self.angle_between_vectors(normal_vector, z_vector)
rotation_line = np.cross(normal_vector, z_vector) rotation_line = np.cross(normal_vector, z_vector)
third_axis = np.cross(normal_vector, rotation_line) third_axis = np.cross(normal_vector, rotation_line)
w_1 = rotation_line / np.linalg.norm(rotation_line) w_1 = rotation_line / np.linalg.norm(rotation_line)
@ -271,7 +268,7 @@ class Surface:
if rotation_base_matrix is None: if rotation_base_matrix is None:
print('Error processing rotation base matrix') print('Error processing rotation base matrix')
else: else:
for point in surface.points: for point in self.points:
new_point = np.matmul(rotation_base_matrix, point) new_point = np.matmul(rotation_base_matrix, point)
points_2d.append(new_point) points_2d.append(new_point)
return points_2d return points_2d

View File

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<archetypes reference_library_building_type="us_library" >
<archetype id="1" function="residential" yearOfConstruction="2011-2020">
<constructions>
<construction id="1" type="roof" >
</construction>
<construction id="1" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>1</window>
</construction>
<construction id="1" type="basement_wall" >
</construction>
<construction id="1" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">3.57</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="2" function="residential" yearOfConstruction="2001-2010">
<constructions>
<construction id="2" type="roof" >
</construction>
<construction id="2" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>2</window>
</construction>
<construction id="2" type="basement_wall" >
</construction>
<construction id="2" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">3.57</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="3" function="residential" yearOfConstruction="1996-2000">
<constructions>
<construction id="3" type="roof" >
</construction>
<construction id="3" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>2</window>
</construction>
<construction id="3" type="basement_wall" >
</construction>
<construction id="3" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">4.55</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="4" function="residential" yearOfConstruction="1984-1995">
<constructions>
<construction id="4" type="roof" >
</construction>
<construction id="4" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>2</window>
</construction>
<construction id="4" type="basement_wall" >
</construction>
<construction id="4" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">4.55</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="5" function="residential" yearOfConstruction="1978-1983">
<constructions>
<construction id="5" type="roof" >
</construction>
<construction id="5" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>2</window>
</construction>
<construction id="5" type="basement_wall" >
</construction>
<construction id="5" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">4.55</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="6" function="residential" yearOfConstruction="1961-1977">
<constructions>
<construction id="6" type="roof" >
</construction>
<construction id="6" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>2</window>
</construction>
<construction id="6" type="basement_wall" >
</construction>
<construction id="6" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">4.55</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="7" function="residential" yearOfConstruction="1946-1960">
<constructions>
<construction id="7" type="roof" >
</construction>
<construction id="7" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>2</window>
</construction>
<construction id="7" type="basement_wall" >
</construction>
<construction id="7" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">4.55</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="8" function="residential" yearOfConstruction="1900-1945">
<constructions>
<construction id="8" type="roof" >
</construction>
<construction id="8" type="wall" >
<window_ratio units="-">0.11</window_ratio>
<window>2</window>
</construction>
<construction id="8" type="basement_wall" >
</construction>
<construction id="8" type="floor" >
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">4.55</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
</archetypes>

View File

@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<library name="us_library">
<windows>
<window type="window" id="1" name="global">
<shgc>0.46</shgc> OR <g_value>0.5</g_value>
<frame_ratio units="-">0</frame_ratio>
<overall_uvalue units="W/m2 K">0.555</overall_uvalue>
</window>
<window type="window" id="2" name="global">
<shgc>0.52</shgc> OR <g_value>0.5</g_value>
<frame_ratio units="-">0</frame_ratio>
<overall_uvalue units="W/m2 K">2.702</overall_uvalue>
</window>
</windows>
<constructions>
#ceiling under attic
<construction type="roof" id="1" name="ceiling under attic_post 2010">
<overall_uvalue units="W/m2 K">0.115</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="2" name="ceiling under attic_2001-2010">
<overall_uvalue units="W/m2 K">0.157</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="3" name="ceiling under attic_1996-2000">
<overall_uvalue units="W/m2 K">0.185</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="4" name="ceiling under attic_1984-1995">
<overall_uvalue units="W/m2 K">0.199</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="5" name="ceiling under attic_1978-1983">
<overall_uvalue units="W/m2 K">0.245</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="6" name="ceiling under attic_1961-1977">
<overall_uvalue units="W/m2 K">0.225</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="7" name="ceiling under attic_1946-1960">
<overall_uvalue units="W/m2 K">0.259</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="8" name="ceiling under attic_before 1946">
<overall_uvalue units="W/m2 K">0.301</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
#wall above grade
<construction type="wall" id="1" name="wall above grade_post 2010">
<overall_uvalue units="W/m2 K">0.324</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="wall" id="2" name="wall above grade_2001-2010">
<overall_uvalue units="W/m2 K">0.285</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="wall" id="3" name="wall above grade_1996-2000">
<overall_uvalue units="W/m2 K">0.355</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="wall" id="4" name="wall above grade_1984-1995">
<overall_uvalue units="W/m2 K">0.411</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="wall" id="5" name="wall above grade_1978-1983">
<overall_uvalue units="W/m2 K">0.546</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="wall" id="6" name="wall above grade_1961-1977">
<overall_uvalue units="W/m2 K">0.432</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="wall" id="7" name="wall above grade_1946-1960">
<overall_uvalue units="W/m2 K">0.579</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="wall" id="8" name="wall above grade_before 1946">
<overall_uvalue units="W/m2 K">0.664</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
#wall below grade
<construction type="basement_wall" id="1" name="wall below grade_post 2010">
<overall_uvalue units="W/m2 K">0.335</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="basement_wall" id="2" name="wall below grade_2001-2010">
<overall_uvalue units="W/m2 K">0.312</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="basement_wall" id="3" name="wall below grade_1996-2000">
<overall_uvalue units="W/m2 K">0.408</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="basement_wall" id="4" name="wall below grade_1984-1995">
<overall_uvalue units="W/m2 K">0.510</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="basement_wall" id="5" name="wall below grade_1978-1983">
<overall_uvalue units="W/m2 K">0.645</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="basement_wall" id="6" name="wall below grade_1961-1977">
<overall_uvalue units="W/m2 K">1.204</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="basement_wall" id="7" name="wall below grade_1946-1960">
<overall_uvalue units="W/m2 K">1.449</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="basement_wall" id="8" name="wall below grade_before 1946">
<overall_uvalue units="W/m2 K">2.083</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
#slab on grade
<construction type="floor" id="1" name="slab on grade_post 2010">
<overall_uvalue units="W/m2 K">0.510</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="floor" id="2" name="slab on grade_2001-2010">
<overall_uvalue units="W/m2 K">1.428</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="floor" id="3" name="slab on grade_1996-2000">
<overall_uvalue units="W/m2 K">1.428</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="floor" id="4" name="slab on grade_1984-1995">
<overall_uvalue units="W/m2 K">1.428</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="floor" id="5" name="slab on grade_1978-1983">
<overall_uvalue units="W/m2 K">1.428</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="floor" id="6" name="slab on grade_1961-1977">
<overall_uvalue units="W/m2 K">3.333</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="floor" id="7" name="slab on grade_1946-1960">
<overall_uvalue units="W/m2 K">5</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="floor" id="8" name="slab on grade_before 1946">
<overall_uvalue units="W/m2 K">5</overall_uvalue>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance> OR <shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
</constructions>
</library>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<buildingUsageLibrary>
<name>Building Usage Library Reduced</name>
<description>Library created by Rabeeh from whatever norm
</description>
<source>Source?</source>
<zoneUsageType>
<id>residential</id>
<description>All residential buildings</description>
<occupancy>
<occupancyDensity>0.03</occupancyDensity>
<usageDaysPerYear>365</usageDaysPerYear>
<usageHoursPerDay>12</usageHoursPerDay>
<internGains>
<description>Persons and home appliances</description>
<averageInternGainPerSqm>4.2</averageInternGainPerSqm>
<convectiveFraction>0.3999999999999999</convectiveFraction>
<radiantFraction>0.5000000000000001</radiantFraction>
<latentFraction>0.10000000000000009</latentFraction>
</internGains>
</occupancy>
<appliance units="kWh/day">19.5</appliance>
<endUses>
<space_heating>
<heatingSetPointTemperature>21.0</heatingSetPointTemperature>
<heatingSetBackTemperature>18.0</heatingSetBackTemperature>
</space_heating>
<space_cooling>
<coolingSetPointTemperature>25.0</coolingSetPointTemperature>
</space_cooling>
<ventilation>
<mechanicalAirChangeRate>0</mechanicalAirChangeRate>
</ventilation>
</endUses>
</zoneUsageType>
</buildingUsageLibrary>

View File

@ -6,6 +6,7 @@ contributors Pilar Monsalvete pilar_monsalvete@yahoo.es
""" """
import pandas as pd import pandas as pd
from factories.occupancy_feeders.helpers.occupancy_helper import OccupancyHelper from factories.occupancy_feeders.helpers.occupancy_helper import OccupancyHelper
from enum import Enum
class DemoOccupancyParameters: class DemoOccupancyParameters:
@ -20,16 +21,19 @@ class DemoOccupancyParameters:
occupancy = pd.read_excel(xls, sheet_name=OccupancyHelper.pluto_occupancy_function(building.function), occupancy = pd.read_excel(xls, sheet_name=OccupancyHelper.pluto_occupancy_function(building.function),
skiprows=[0, 1, 2, 3], nrows=39, usecols="A:AA") skiprows=[0, 1, 2, 3], nrows=39, usecols="A:AA")
# todo: should we save the data type? How? # todo: should we save the data type? How?
for index in range(0, 13): number_of_schedule_types = 13
schedules_per_schedule_type = 3
day_types = dict({'week_day': 0, 'saturday': 1, 'sunday': 2})
for schedule_types in range(0, number_of_schedule_types):
data = pd.DataFrame() data = pd.DataFrame()
columns_names = [] columns_names = []
name = '' name = ''
for i in range(0, 3): for schedule_day in range(0, schedules_per_schedule_type):
row = occupancy.iloc[3*index + i] row_cells = occupancy.iloc[schedules_per_schedule_type*schedule_types + schedule_day]
if i == 0: if schedule_day == day_types['week_day']:
name = row[0] name = row_cells[0]
columns_names.append(row[2]) columns_names.append(row_cells[2])
data1 = row[3:] data1 = row_cells[schedules_per_schedule_type:]
data = pd.concat([data, data1], axis=1) data = pd.concat([data, data1], axis=1)
data.columns = columns_names data.columns = columns_names
schedules[name] = data schedules[name] = data