chek units from libraries and storing classes
This commit is contained in:
parent
5c93b64cd3
commit
c3e06b5fa7
|
@ -3,9 +3,10 @@
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/venv2" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv38" />
|
<excludeFolder url="file://$MODULE_DIR$/venv38" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.7 (libs)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.7 (venv)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
|
@ -18,7 +18,7 @@ class InternalGains:
|
||||||
@property
|
@property
|
||||||
def average_internal_gain(self):
|
def average_internal_gain(self):
|
||||||
"""
|
"""
|
||||||
Get internal gains average internal gain in w/m2
|
Get internal gains average internal gain in W/m2
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._average_internal_gain
|
return self._average_internal_gain
|
||||||
|
@ -26,7 +26,7 @@ class InternalGains:
|
||||||
@average_internal_gain.setter
|
@average_internal_gain.setter
|
||||||
def average_internal_gain(self, value):
|
def average_internal_gain(self, value):
|
||||||
"""
|
"""
|
||||||
Set internal gains average internal gain in w/m2
|
Set internal gains average internal gain in W/m2
|
||||||
:param value: float
|
:param value: float
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -23,16 +23,16 @@ class Material:
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""
|
"""
|
||||||
Get material conductivity in W/mK
|
Get material name
|
||||||
:return: float
|
:return: string
|
||||||
"""
|
"""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(self, value):
|
def name(self, value):
|
||||||
"""
|
"""
|
||||||
Set material conductivity in W/mK
|
Set material name
|
||||||
:param value: float
|
:param value: string
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self._name = value
|
self._name = value
|
||||||
|
|
|
@ -31,7 +31,6 @@ class Polyhedron:
|
||||||
self._min_y = None
|
self._min_y = None
|
||||||
self._min_x = None
|
self._min_x = None
|
||||||
self._geometry = GeometryHelper(delta=5.0, area_delta=0.01)
|
self._geometry = GeometryHelper(delta=5.0, area_delta=0.01)
|
||||||
print(f'[{self._geometry._area_delta} {self._geometry._delta}]')
|
|
||||||
|
|
||||||
def _position_of(self, point, face):
|
def _position_of(self, point, face):
|
||||||
vertices = self.vertices
|
vertices = self.vertices
|
||||||
|
|
|
@ -227,7 +227,7 @@ class ThermalBoundary:
|
||||||
@property
|
@property
|
||||||
def u_value(self):
|
def u_value(self):
|
||||||
"""
|
"""
|
||||||
Thermal boundary u value in W/m2K
|
Get thermal boundary U-value in W/m2K
|
||||||
internal and external convective coefficient in W/m2K values, can be configured at configuration.ini
|
internal and external convective coefficient in W/m2K values, can be configured at configuration.ini
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
|
@ -248,6 +248,10 @@ class ThermalBoundary:
|
||||||
|
|
||||||
@u_value.setter
|
@u_value.setter
|
||||||
def u_value(self, value):
|
def u_value(self, value):
|
||||||
|
"""
|
||||||
|
Set thermal boundary U-value in W/m2K
|
||||||
|
:param value: float
|
||||||
|
"""
|
||||||
self._u_value = value
|
self._u_value = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -82,7 +82,7 @@ class ThermalOpening:
|
||||||
@property
|
@property
|
||||||
def g_value(self):
|
def g_value(self):
|
||||||
"""
|
"""
|
||||||
Get thermal opening g value
|
Get thermal opening g-value
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._g_value
|
return self._g_value
|
||||||
|
@ -90,7 +90,7 @@ class ThermalOpening:
|
||||||
@g_value.setter
|
@g_value.setter
|
||||||
def g_value(self, value):
|
def g_value(self, value):
|
||||||
"""
|
"""
|
||||||
Set thermal opening g value
|
Set thermal opening g-value
|
||||||
:param value:
|
:param value:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
@ -157,7 +157,7 @@ class ThermalOpening:
|
||||||
@property
|
@property
|
||||||
def overall_u_value(self):
|
def overall_u_value(self):
|
||||||
"""
|
"""
|
||||||
Get thermal opening overall u value in W/m2K
|
Get thermal opening overall U-value in W/m2K
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._overall_u_value
|
return self._overall_u_value
|
||||||
|
@ -165,7 +165,7 @@ class ThermalOpening:
|
||||||
@overall_u_value.setter
|
@overall_u_value.setter
|
||||||
def overall_u_value(self, value):
|
def overall_u_value(self, value):
|
||||||
"""
|
"""
|
||||||
Get thermal opening overall u value in W/m2K
|
Get thermal opening overall U-value in W/m2K
|
||||||
:param value: float
|
:param value: float
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -48,7 +48,7 @@ class ThermalZone:
|
||||||
@property
|
@property
|
||||||
def floor_area(self):
|
def floor_area(self):
|
||||||
"""
|
"""
|
||||||
Get thermal zone floor area in square meters
|
Get thermal zone floor area in m2
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
if self._floor_area is None:
|
if self._floor_area is None:
|
||||||
|
@ -104,7 +104,7 @@ class ThermalZone:
|
||||||
@property
|
@property
|
||||||
def effective_thermal_capacity(self):
|
def effective_thermal_capacity(self):
|
||||||
"""
|
"""
|
||||||
Get thermal zone effective thermal capacity
|
Get thermal zone effective thermal capacity in J/m2K
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._effective_thermal_capacity
|
return self._effective_thermal_capacity
|
||||||
|
@ -112,7 +112,7 @@ class ThermalZone:
|
||||||
@effective_thermal_capacity.setter
|
@effective_thermal_capacity.setter
|
||||||
def effective_thermal_capacity(self, value):
|
def effective_thermal_capacity(self, value):
|
||||||
"""
|
"""
|
||||||
Set thermal zone effective thermal capacity
|
Set thermal zone effective thermal capacity in J/m2K
|
||||||
:param value: float
|
:param value: float
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
@ -138,7 +138,7 @@ class ThermalZone:
|
||||||
@property
|
@property
|
||||||
def infiltration_rate_system_on(self):
|
def infiltration_rate_system_on(self):
|
||||||
"""
|
"""
|
||||||
Get thermal zone infiltration rate system on in air changes per hour
|
Get thermal zone infiltration rate system on in air changes per hour (ACH)
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._infiltration_rate_system_on
|
return self._infiltration_rate_system_on
|
||||||
|
@ -146,7 +146,7 @@ class ThermalZone:
|
||||||
@infiltration_rate_system_on.setter
|
@infiltration_rate_system_on.setter
|
||||||
def infiltration_rate_system_on(self, value):
|
def infiltration_rate_system_on(self, value):
|
||||||
"""
|
"""
|
||||||
Set thermal zone infiltration rate system on in air changes per hour
|
Set thermal zone infiltration rate system on in air changes per hour (ACH)
|
||||||
:param value: float
|
:param value: float
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
@ -155,7 +155,7 @@ class ThermalZone:
|
||||||
@property
|
@property
|
||||||
def infiltration_rate_system_off(self):
|
def infiltration_rate_system_off(self):
|
||||||
"""
|
"""
|
||||||
Get thermal zone infiltration rate system off in air changes per hour
|
Get thermal zone infiltration rate system off in air changes per hour (ACH)
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._infiltration_rate_system_off
|
return self._infiltration_rate_system_off
|
||||||
|
@ -163,7 +163,7 @@ class ThermalZone:
|
||||||
@infiltration_rate_system_off.setter
|
@infiltration_rate_system_off.setter
|
||||||
def infiltration_rate_system_off(self, value):
|
def infiltration_rate_system_off(self, value):
|
||||||
"""
|
"""
|
||||||
Set thermal zone infiltration rate system on in air changes per hour
|
Set thermal zone infiltration rate system on in air changes per hour (ACH)
|
||||||
:param value: float
|
:param value: float
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -143,7 +143,7 @@ class UsageZone:
|
||||||
@property
|
@property
|
||||||
def mechanical_air_change(self):
|
def mechanical_air_change(self):
|
||||||
"""
|
"""
|
||||||
Set usage zone mechanical air change in air change per hour
|
Set usage zone mechanical air change in air change per hour (ACH)
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._mechanical_air_change
|
return self._mechanical_air_change
|
||||||
|
@ -151,7 +151,7 @@ class UsageZone:
|
||||||
@mechanical_air_change.setter
|
@mechanical_air_change.setter
|
||||||
def mechanical_air_change(self, value):
|
def mechanical_air_change(self, value):
|
||||||
"""
|
"""
|
||||||
Get usage zone mechanical air change in air change per hour
|
Get usage zone mechanical air change in air change per hour (ACH)
|
||||||
:param value: float
|
:param value: float
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
|
@ -241,7 +241,7 @@ class UsageZone:
|
||||||
@property
|
@property
|
||||||
def dhw_average_volume_pers_day(self):
|
def dhw_average_volume_pers_day(self):
|
||||||
"""
|
"""
|
||||||
Get average DHW consumption in liters per person per day
|
Get average DHW consumption in m3 per person per day
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._dhw_average_volume_pers_day
|
return self._dhw_average_volume_pers_day
|
||||||
|
@ -249,7 +249,7 @@ class UsageZone:
|
||||||
@dhw_average_volume_pers_day.setter
|
@dhw_average_volume_pers_day.setter
|
||||||
def dhw_average_volume_pers_day(self, values):
|
def dhw_average_volume_pers_day(self, values):
|
||||||
"""
|
"""
|
||||||
average DHW consumption in liters per person per day
|
average DHW consumption in m3 per person per day
|
||||||
:param values: float
|
:param values: float
|
||||||
"""
|
"""
|
||||||
self._dhw_average_volume_pers_day = values
|
self._dhw_average_volume_pers_day = values
|
||||||
|
@ -273,7 +273,7 @@ class UsageZone:
|
||||||
@property
|
@property
|
||||||
def electrical_app_average_consumption_sqm_year(self):
|
def electrical_app_average_consumption_sqm_year(self):
|
||||||
"""
|
"""
|
||||||
Get average consumption of electrical appliances in kiloWatts hour per m2 and year (kWh/m2yr)
|
Get average consumption of electrical appliances in Joules hour per m2 and year (J/m2yr)
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._electrical_app_average_consumption_sqm_year
|
return self._electrical_app_average_consumption_sqm_year
|
||||||
|
@ -281,7 +281,7 @@ class UsageZone:
|
||||||
@electrical_app_average_consumption_sqm_year.setter
|
@electrical_app_average_consumption_sqm_year.setter
|
||||||
def electrical_app_average_consumption_sqm_year(self, values):
|
def electrical_app_average_consumption_sqm_year(self, values):
|
||||||
"""
|
"""
|
||||||
average consumption of electrical appliances in kiloWatts hour per m2 and year (kWh/m2yr)
|
average consumption of electrical appliances in Joules per m2 and year (J/m2yr)
|
||||||
:param values: float
|
:param values: float
|
||||||
"""
|
"""
|
||||||
self._electrical_app_average_consumption_sqm_year = values
|
self._electrical_app_average_consumption_sqm_year = values
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
"""
|
||||||
|
NrelBuildingArchetype stores construction information by building archetypes
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||||
|
"""
|
||||||
from typing import List
|
from typing import List
|
||||||
from factories.physics_feeders.data_classes.nrel_thermal_boundary_archetype import NrelThermalBoundaryArchetype
|
from factories.physics_feeders.data_classes.nrel_thermal_boundary_archetype import NrelThermalBoundaryArchetype
|
||||||
|
|
||||||
|
@ -22,59 +27,71 @@ class NrelBuildingArchetype:
|
||||||
@property
|
@property
|
||||||
def archetype_keys(self) -> {}:
|
def archetype_keys(self) -> {}:
|
||||||
"""
|
"""
|
||||||
|
Get keys that define the archetype
|
||||||
:return: dictionary
|
:return: dictionary
|
||||||
"""
|
"""
|
||||||
return self._archetype_keys
|
return self._archetype_keys
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def average_storey_height(self):
|
def average_storey_height(self):
|
||||||
|
"""
|
||||||
|
Get archetype's building storey height in meters
|
||||||
|
:return: float
|
||||||
|
"""
|
||||||
return self._average_storey_height
|
return self._average_storey_height
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def storeys_above_ground(self):
|
def storeys_above_ground(self):
|
||||||
|
"""
|
||||||
|
Get archetype's building storey height in meters
|
||||||
|
:return: float
|
||||||
|
"""
|
||||||
return self._storeys_above_ground
|
return self._storeys_above_ground
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def effective_thermal_capacity(self):
|
def effective_thermal_capacity(self):
|
||||||
"""
|
"""
|
||||||
|
Get archetype's effective thermal capacity in J/m2K
|
||||||
:return:
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._effective_thermal_capacity
|
return self._effective_thermal_capacity
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_thermal_bridge_u_value(self):
|
def additional_thermal_bridge_u_value(self):
|
||||||
"""
|
"""
|
||||||
|
Get archetype's additional U value due to thermal bridges in W/m2K
|
||||||
:return:
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._additional_thermal_bridge_u_value
|
return self._additional_thermal_bridge_u_value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def indirectly_heated_area_ratio(self):
|
def indirectly_heated_area_ratio(self):
|
||||||
"""
|
"""
|
||||||
|
Get archetype's indirectly heated area ratio
|
||||||
:return:
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._indirectly_heated_area_ratio
|
return self._indirectly_heated_area_ratio
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def infiltration_rate_system_off(self):
|
def infiltration_rate_system_off(self):
|
||||||
"""
|
"""
|
||||||
|
Get archetype's infiltration rate when conditioning systems OFF in air changes per hour (ACH)
|
||||||
:return:
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._infiltration_rate_system_off
|
return self._infiltration_rate_system_off
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def infiltration_rate_system_on(self):
|
def infiltration_rate_system_on(self):
|
||||||
"""
|
"""
|
||||||
|
Get archetype's infiltration rate when conditioning systems ON in air changes per hour (ACH)
|
||||||
:return:
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._infiltration_rate_system_on
|
return self._infiltration_rate_system_on
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def thermal_boundary_archetypes(self) -> List[NrelThermalBoundaryArchetype]:
|
def thermal_boundary_archetypes(self) -> List[NrelThermalBoundaryArchetype]:
|
||||||
|
"""
|
||||||
|
Get thermal boundary archetypes associated to the building archetype
|
||||||
|
:return: list of boundary archetypes
|
||||||
|
"""
|
||||||
return self._thermal_boundary_archetypes
|
return self._thermal_boundary_archetypes
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
"""
|
||||||
|
NrelLayerArchetype stores layer and materials information, complementing the NrelBuildingArchetype class
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class NrelLayerArchetype:
|
class NrelLayerArchetype:
|
||||||
"""
|
"""
|
||||||
NrelLayerArchetype class
|
NrelLayerArchetype class
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
"""
|
||||||
|
NrelThermalBoundaryArchetype stores thermal boundaries information, complementing the NrelBuildingArchetype class
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||||
|
"""
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from factories.physics_feeders.data_classes.nrel_layer_archetype import NrelLayerArchetype
|
from factories.physics_feeders.data_classes.nrel_layer_archetype import NrelLayerArchetype
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
"""
|
||||||
|
NrelThermalOpeningArchetype stores thermal openings information, complementing the NrelBuildingArchetype class
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class NrelThermalOpeningArchetype:
|
class NrelThermalOpeningArchetype:
|
||||||
"""
|
"""
|
||||||
NrelThermalOpeningArchetype class
|
NrelThermalOpeningArchetype class
|
||||||
|
|
|
@ -4,6 +4,7 @@ and enriches the city with archetypes and materials
|
||||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||||
"""
|
"""
|
||||||
|
import sys
|
||||||
import xmltodict
|
import xmltodict
|
||||||
|
|
||||||
from factories.physics_feeders.data_classes.nrel_building_achetype import NrelBuildingArchetype as nba
|
from factories.physics_feeders.data_classes.nrel_building_achetype import NrelBuildingArchetype as nba
|
||||||
|
@ -35,12 +36,28 @@ class NrelPhysicsInterface:
|
||||||
if key[0] == '@':
|
if key[0] == '@':
|
||||||
archetype_keys[key] = value
|
archetype_keys[key] = value
|
||||||
average_storey_height = archetype['average_storey_height']['#text']
|
average_storey_height = archetype['average_storey_height']['#text']
|
||||||
|
units = archetype['average_storey_height']['@units']
|
||||||
|
if units != 'm':
|
||||||
|
raise Exception(f'average storey height units = {units}, expected meters')
|
||||||
storeys_above_ground = archetype['number_of_storeys']['#text']
|
storeys_above_ground = archetype['number_of_storeys']['#text']
|
||||||
effective_thermal_capacity = archetype['thermal_capacity']['#text']
|
effective_thermal_capacity = float(archetype['thermal_capacity']['#text'])*1000
|
||||||
|
units = archetype['thermal_capacity']['@units']
|
||||||
|
if units != 'kJ/K m2':
|
||||||
|
raise Exception(f'thermal capacity units = {units}, expected kJ/K m2')
|
||||||
additional_thermal_bridge_u_value = archetype['extra_loses_due_to_thermal_bridges']['#text']
|
additional_thermal_bridge_u_value = archetype['extra_loses_due_to_thermal_bridges']['#text']
|
||||||
|
units = archetype['extra_loses_due_to_thermal_bridges']['@units']
|
||||||
|
if units != 'W/K m2':
|
||||||
|
raise Exception(f'extra loses due to thermal bridges units = {units}, expected W/K m2')
|
||||||
indirectly_heated_area_ratio = archetype['indirect_heated_ratio']['#text']
|
indirectly_heated_area_ratio = archetype['indirect_heated_ratio']['#text']
|
||||||
|
# todo: check how infiltration rate is used in the model
|
||||||
infiltration_rate_system_off = archetype['infiltration_rate_for_ventilation_system_off']['#text']
|
infiltration_rate_system_off = archetype['infiltration_rate_for_ventilation_system_off']['#text']
|
||||||
|
units = archetype['infiltration_rate_for_ventilation_system_off']['@units']
|
||||||
|
if units != 'ACH':
|
||||||
|
raise Exception(f'infiltration rate for ventilation when system off units = {units}, expected ACH')
|
||||||
infiltration_rate_system_on = archetype['infiltration_rate_for_ventilation_system_on']['#text']
|
infiltration_rate_system_on = archetype['infiltration_rate_for_ventilation_system_on']['#text']
|
||||||
|
units = archetype['infiltration_rate_for_ventilation_system_on']['@units']
|
||||||
|
if units != 'ACH':
|
||||||
|
raise Exception(f'infiltration rate for ventilation when system on units = {units}, expected ACH')
|
||||||
|
|
||||||
thermal_boundary_archetypes = []
|
thermal_boundary_archetypes = []
|
||||||
for construction in archetype['constructions']['construction']:
|
for construction in archetype['constructions']['construction']:
|
||||||
|
@ -60,13 +77,28 @@ class NrelPhysicsInterface:
|
||||||
no_mass = 'no_mass' in material_lib
|
no_mass = 'no_mass' in material_lib
|
||||||
if no_mass:
|
if no_mass:
|
||||||
thermal_resistance = material_lib['thermal_resistance']['#text']
|
thermal_resistance = material_lib['thermal_resistance']['#text']
|
||||||
|
units = material_lib['thermal_resistance']['@units']
|
||||||
|
if units != 'm2 K/W':
|
||||||
|
raise Exception(f'thermal resistance units = {units}, expected m2 K/W')
|
||||||
layer = nla(name, solar_absorptance, thermal_absorptance, visible_absorptance, no_mass=no_mass,
|
layer = nla(name, solar_absorptance, thermal_absorptance, visible_absorptance, no_mass=no_mass,
|
||||||
thermal_resistance=thermal_resistance)
|
thermal_resistance=thermal_resistance)
|
||||||
else:
|
else:
|
||||||
thickness = current_layer['thickness']['#text']
|
thickness = current_layer['thickness']['#text']
|
||||||
|
units = current_layer['thickness']['@units']
|
||||||
|
if units != 'm':
|
||||||
|
raise Exception(f'thickness units = {units}, expected m')
|
||||||
conductivity = material_lib['conductivity']['#text']
|
conductivity = material_lib['conductivity']['#text']
|
||||||
|
units = material_lib['conductivity']['@units']
|
||||||
|
if units != 'W/m K':
|
||||||
|
raise Exception(f'conductivity units = {units}, expected W/m K')
|
||||||
specific_heat = material_lib['specific_heat']['#text']
|
specific_heat = material_lib['specific_heat']['#text']
|
||||||
|
units = material_lib['specific_heat']['@units']
|
||||||
|
if units != 'J/kg K':
|
||||||
|
raise Exception(f'specific_heat units = {units}, expected J/kg K')
|
||||||
density = material_lib['density']['#text']
|
density = material_lib['density']['#text']
|
||||||
|
units = material_lib['density']['@units']
|
||||||
|
if units != 'kg/m3':
|
||||||
|
raise Exception(f'density units = {units}, expected kg/m3')
|
||||||
layer = nla(name, solar_absorptance, thermal_absorptance, visible_absorptance, thickness=thickness,
|
layer = nla(name, solar_absorptance, thermal_absorptance, visible_absorptance, thickness=thickness,
|
||||||
conductivity=conductivity, specific_heat=specific_heat, density=density)
|
conductivity=conductivity, specific_heat=specific_heat, density=density)
|
||||||
layers.append(layer)
|
layers.append(layer)
|
||||||
|
@ -79,7 +111,13 @@ class NrelPhysicsInterface:
|
||||||
frame_ratio = w_lib['frame_ratio']['#text']
|
frame_ratio = w_lib['frame_ratio']['#text']
|
||||||
if 'conductivity' in w_lib:
|
if 'conductivity' in w_lib:
|
||||||
conductivity = w_lib['conductivity']['#text']
|
conductivity = w_lib['conductivity']['#text']
|
||||||
|
units = w_lib['conductivity']['@units']
|
||||||
|
if units != 'W/m K':
|
||||||
|
raise Exception(f'conductivity units = {units}, expected W/m K')
|
||||||
thickness = w_lib['thickness']['#text']
|
thickness = w_lib['thickness']['#text']
|
||||||
|
units = w_lib['thickness']['@units']
|
||||||
|
if units != 'm':
|
||||||
|
raise Exception(f'thickness units = {units}, expected m')
|
||||||
g_value = w_lib['solar_transmittance_at_normal_incidence']['#text']
|
g_value = w_lib['solar_transmittance_at_normal_incidence']['#text']
|
||||||
back_side_solar_transmittance_at_normal_incidence = \
|
back_side_solar_transmittance_at_normal_incidence = \
|
||||||
w_lib['back_side_solar_transmittance_at_normal_incidence']['#text']
|
w_lib['back_side_solar_transmittance_at_normal_incidence']['#text']
|
||||||
|
@ -92,6 +130,9 @@ class NrelPhysicsInterface:
|
||||||
front_side_solar_transmittance_at_normal_incidence)
|
front_side_solar_transmittance_at_normal_incidence)
|
||||||
else:
|
else:
|
||||||
overall_u_value = w_lib['overall_u_value']['#text']
|
overall_u_value = w_lib['overall_u_value']['#text']
|
||||||
|
units = w_lib['overall_u_value']['@units']
|
||||||
|
if units != 'W/m2 K':
|
||||||
|
raise Exception(f'overall U-value units = {units}, expected W/m2 K')
|
||||||
g_value = w_lib['g_value']
|
g_value = w_lib['g_value']
|
||||||
thermal_opening = ntoa(frame_ratio=frame_ratio, g_value=g_value, overall_u_value=overall_u_value)
|
thermal_opening = ntoa(frame_ratio=frame_ratio, g_value=g_value, overall_u_value=overall_u_value)
|
||||||
|
|
||||||
|
@ -105,6 +146,9 @@ class NrelPhysicsInterface:
|
||||||
else:
|
else:
|
||||||
if 'overall_u_value' in c_lib:
|
if 'overall_u_value' in c_lib:
|
||||||
overall_u_value = c_lib['overall_u_value']['#text']
|
overall_u_value = c_lib['overall_u_value']['#text']
|
||||||
|
units = c_lib['overall_u_value']['@units']
|
||||||
|
if units != 'W/m2 K':
|
||||||
|
raise Exception(f'overall U-value units = {units}, expected W/m2 K')
|
||||||
outside_solar_absorptance = c_lib['outside_solar_absorptance']['#text']
|
outside_solar_absorptance = c_lib['outside_solar_absorptance']['#text']
|
||||||
thermal_boundary_archetype = ntba(construction_type, window_ratio, construction_name, layers,
|
thermal_boundary_archetype = ntba(construction_type, window_ratio, construction_name, layers,
|
||||||
thermal_opening, outside_solar_absorptance=outside_solar_absorptance,
|
thermal_opening, outside_solar_absorptance=outside_solar_absorptance,
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
"""
|
||||||
|
HftInternalGainsArchetype stores internal gains information, complementing the HftUsageZoneArchetype class
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
class HftInternalGainsArchetype:
|
class HftInternalGainsArchetype:
|
||||||
"""
|
"""
|
||||||
HftInternalGainsArchetype class
|
HftInternalGainsArchetype class
|
||||||
|
@ -12,7 +19,7 @@ class HftInternalGainsArchetype:
|
||||||
@property
|
@property
|
||||||
def average_internal_gain(self):
|
def average_internal_gain(self):
|
||||||
"""
|
"""
|
||||||
Get internal gains average internal gain in w/m2
|
Get internal gains average internal gain in W/m2
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._average_internal_gain
|
return self._average_internal_gain
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
"""
|
||||||
|
HftUsageZoneArchetype stores usage information by building archetypes
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
||||||
|
"""
|
||||||
from typing import List
|
from typing import List
|
||||||
from factories.usage_feeders.data_classes.hft_internal_gains_archetype import HftInternalGainsArchetype
|
from factories.usage_feeders.data_classes.hft_internal_gains_archetype import HftInternalGainsArchetype
|
||||||
|
|
||||||
|
@ -77,7 +82,7 @@ class HftUsageZoneArchetype:
|
||||||
@property
|
@property
|
||||||
def mechanical_air_change(self):
|
def mechanical_air_change(self):
|
||||||
"""
|
"""
|
||||||
Set usage zone mechanical air change in air change per hour
|
Set usage zone mechanical air change in air change per hour (ACH)
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._mechanical_air_change
|
return self._mechanical_air_change
|
||||||
|
@ -117,7 +122,7 @@ class HftUsageZoneArchetype:
|
||||||
@property
|
@property
|
||||||
def dhw_average_volume_pers_day(self):
|
def dhw_average_volume_pers_day(self):
|
||||||
"""
|
"""
|
||||||
Get average DHW consumption in liters per person per day
|
Get average DHW consumption in m3 per person per day
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._dhw_average_volume_pers_day
|
return self._dhw_average_volume_pers_day
|
||||||
|
@ -133,7 +138,7 @@ class HftUsageZoneArchetype:
|
||||||
@property
|
@property
|
||||||
def electrical_app_average_consumption_sqm_year(self):
|
def electrical_app_average_consumption_sqm_year(self):
|
||||||
"""
|
"""
|
||||||
Get average consumption of electrical appliances in kiloWatts hour per m2 and year (kWh/m2yr)
|
Get average consumption of electrical appliances in Joules per m2 and year (J/m2yr)
|
||||||
:return: float
|
:return: float
|
||||||
"""
|
"""
|
||||||
return self._electrical_app_average_consumption_sqm_year
|
return self._electrical_app_average_consumption_sqm_year
|
||||||
|
|
|
@ -42,13 +42,16 @@ class HftUsageInterface:
|
||||||
dhw_average_volume_pers_day = None
|
dhw_average_volume_pers_day = None
|
||||||
dhw_preparation_temperature = None
|
dhw_preparation_temperature = None
|
||||||
if 'domestic_hot_water' in zone_usage_type['endUses']:
|
if 'domestic_hot_water' in zone_usage_type['endUses']:
|
||||||
dhw_average_volume_pers_day = zone_usage_type['endUses']['domestic_hot_water']['averageVolumePerPersAndDay']
|
# liters to cubic meters
|
||||||
|
dhw_average_volume_pers_day = float(
|
||||||
|
zone_usage_type['endUses']['domestic_hot_water']['averageVolumePerPersAndDay'])/1000
|
||||||
dhw_preparation_temperature = zone_usage_type['endUses']['domestic_hot_water']['preparationTemperature']
|
dhw_preparation_temperature = zone_usage_type['endUses']['domestic_hot_water']['preparationTemperature']
|
||||||
electrical_app_average_consumption_sqm_year = None
|
electrical_app_average_consumption_sqm_year = None
|
||||||
if 'all_electrical_appliances' in zone_usage_type['endUses']:
|
if 'all_electrical_appliances' in zone_usage_type['endUses']:
|
||||||
if 'averageConsumptionPerSqmAndYear' in zone_usage_type['endUses']['all_electrical_appliances']:
|
if 'averageConsumptionPerSqmAndYear' in zone_usage_type['endUses']['all_electrical_appliances']:
|
||||||
|
# kWh to J
|
||||||
electrical_app_average_consumption_sqm_year = \
|
electrical_app_average_consumption_sqm_year = \
|
||||||
zone_usage_type['endUses']['all_electrical_appliances']['averageConsumptionPerSqmAndYear']
|
float(zone_usage_type['endUses']['all_electrical_appliances']['averageConsumptionPerSqmAndYear'])/3.6
|
||||||
|
|
||||||
# todo: for internal_gain in usage_zone_variant['occupancy']['internGains']:????????????????
|
# todo: for internal_gain in usage_zone_variant['occupancy']['internGains']:????????????????
|
||||||
# There are no more internal gains? How is it saved when more than one???
|
# There are no more internal gains? How is it saved when more than one???
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
xmltodict~=0.12.0
|
xmltodict~=0.12.0
|
||||||
numpy~=1.19.0
|
numpy~=1.19.0
|
||||||
open3d~=0.10.0.0
|
|
||||||
trimesh~=3.7.0
|
trimesh~=3.7.0
|
||||||
pyproj~=2.6.1.post1
|
pyproj~=2.6.1.post1
|
||||||
pyny3d~=0.2
|
pyny3d~=0.2
|
||||||
|
@ -56,3 +55,4 @@ geomeppy~=0.11.8
|
||||||
pyglet~=1.5.8
|
pyglet~=1.5.8
|
||||||
networkx~=2.5
|
networkx~=2.5
|
||||||
xlrd~=1.2.0
|
xlrd~=1.2.0
|
||||||
|
open3d~=0.11.2
|
Loading…
Reference in New Issue
Block a user