diff --git a/hub/catalog_factories/construction/nrel_catalog.py b/hub/catalog_factories/construction/nrel_catalog.py index bf1374af..c9235cfe 100644 --- a/hub/catalog_factories/construction/nrel_catalog.py +++ b/hub/catalog_factories/construction/nrel_catalog.py @@ -40,7 +40,7 @@ class NrelCatalog(Catalog): _catalog_windows = [] windows = self._constructions['library']['windows']['window'] for window in windows: - frame_ratio = window['frame_ratio']['#text'] + frame_ratio = float(window['frame_ratio']['#text']) g_value = window['shgc'] overall_u_value = float(window['conductivity']['#text']) / float(window['thickness']['#text']) name = window['@name'] @@ -54,9 +54,9 @@ class NrelCatalog(Catalog): for material in materials: material_id = material['@id'] name = material['@name'] - solar_absorptance = material['solar_absorptance']['#text'] - thermal_absorptance = material['thermal_absorptance']['#text'] - visible_absorptance = material['visible_absorptance']['#text'] + solar_absorptance = float(material['solar_absorptance']['#text']) + thermal_absorptance = float(material['thermal_absorptance']['#text']) + visible_absorptance = float(material['visible_absorptance']['#text']) no_mass = False thermal_resistance = None, conductivity = None, @@ -64,11 +64,11 @@ class NrelCatalog(Catalog): specific_heat = None if 'no_mass' in material and material['no_mass'] == 'true': no_mass = True - thermal_resistance = material['thermal_resistance']['#text'] + thermal_resistance = float(material['thermal_resistance']['#text']) else: - conductivity = material['conductivity']['#text'] - density = material['density']['#text'] - specific_heat = material['specific_heat']['#text'] + conductivity = float(material['conductivity']['#text']) + density = float(material['density']['#text']) + specific_heat = float(material['specific_heat']['#text']) _material = Material(material_id, name, solar_absorptance, @@ -96,7 +96,7 @@ class NrelCatalog(Catalog): material_id = layer['material'][0] thickness = 0 if 'thickness' in layer: - thickness = layer['thickness']['#text'] + thickness = float(layer['thickness']['#text']) for material in self._catalog_materials: if str(material_id) == str(material.id): layers.append(Layer(layer_id, layer_name, material, thickness)) @@ -114,18 +114,20 @@ class NrelCatalog(Catalog): climate_zone = archetype['@climate_zone'] construction_period = \ ConstructionHelper().reference_standard_to_construction_period[archetype['@reference_standard']] - average_storey_height = archetype['average_storey_height']['#text'] - thermal_capacity = str(float(archetype['thermal_capacity']['#text']) * 1000) - extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_to_thermal_bridges']['#text'] - indirect_heated_ratio = archetype['indirect_heated_ratio']['#text'] - infiltration_rate_for_ventilation_system_off = archetype['infiltration_rate_for_ventilation_system_off']['#text'] - infiltration_rate_for_ventilation_system_on = archetype['infiltration_rate_for_ventilation_system_on']['#text'] + average_storey_height = float(archetype['average_storey_height']['#text']) + thermal_capacity = float(archetype['thermal_capacity']['#text']) * 1000 + extra_loses_due_to_thermal_bridges = float(archetype['extra_loses_due_to_thermal_bridges']['#text']) + indirect_heated_ratio = float(archetype['indirect_heated_ratio']['#text']) + infiltration_rate_for_ventilation_system_off = \ + float(archetype['infiltration_rate_for_ventilation_system_off']['#text']) + infiltration_rate_for_ventilation_system_on = \ + float(archetype['infiltration_rate_for_ventilation_system_on']['#text']) archetype_constructions = [] for archetype_construction in archetype['constructions']['construction']: for construction in self._catalog_constructions: if construction.id == archetype_construction['@id']: - window_ratio = archetype_construction['window_ratio']['#text'] + window_ratio = float(archetype_construction['window_ratio']['#text']) window_id = archetype_construction['window'] _construction = None _window = None diff --git a/hub/exports/building_energy/idf.py b/hub/exports/building_energy/idf.py index 330fc20b..b4a63a7d 100644 --- a/hub/exports/building_energy/idf.py +++ b/hub/exports/building_energy/idf.py @@ -130,10 +130,7 @@ class Idf: self._idf.newidfobject(self._MATERIAL_NOMASS, Name=layer.material.name, Roughness=self._ROUGHNESS, - Thermal_Resistance=layer.material.thermal_resistance, - Thermal_Absorptance=layer.material.thermal_absorptance, - Solar_Absorptance=layer.material.solar_absorptance, - Visible_Absorptance=layer.material.visible_absorptance + Thermal_Resistance=layer.material.thermal_resistance ) else: self._idf.newidfobject(self._MATERIAL, diff --git a/hub/imports/construction/nrcan_physics_parameters.py b/hub/imports/construction/nrcan_physics_parameters.py index 77240a81..349f3950 100644 --- a/hub/imports/construction/nrcan_physics_parameters.py +++ b/hub/imports/construction/nrcan_physics_parameters.py @@ -51,7 +51,7 @@ class NrcanPhysicsParameters: for thermal_zone in internal_zone.thermal_zones: thermal_zone.total_floor_area = thermal_zone.footprint_area else: - number_of_storeys = int(float(building.eave_height) / float(building.average_storey_height)) + number_of_storeys = int(building.eave_height / building.average_storey_height) thermal_zone = building.internal_zones[0].thermal_zones[0] thermal_zone.total_floor_area = thermal_zone.footprint_area * number_of_storeys else: @@ -69,7 +69,7 @@ class NrcanPhysicsParameters: nrcan_archetypes = nrcan_catalog.entries('archetypes') for building_archetype in nrcan_archetypes: construction_period_limits = building_archetype.construction_period.split('_') - if int(construction_period_limits[0]) <= int(year_of_construction) < int(construction_period_limits[1]): + if int(construction_period_limits[0]) <= year_of_construction < int(construction_period_limits[1]): if (str(function) == str(building_archetype.function)) and \ (climate_zone == str(building_archetype.climate_zone)): return building_archetype @@ -135,12 +135,12 @@ class NrcanPhysicsParameters: # The agreement is that the layers are defined from outside to inside external_layer = construction_archetype.layers[0] external_surface = thermal_boundary.parent_surface - external_surface.short_wave_reflectance = 1 - float(external_layer.material.solar_absorptance) - external_surface.long_wave_emittance = 1 - float(external_layer.material.solar_absorptance) + external_surface.short_wave_reflectance = 1 - external_layer.material.solar_absorptance + external_surface.long_wave_emittance = 1 - external_layer.material.solar_absorptance internal_layer = construction_archetype.layers[len(construction_archetype.layers) - 1] internal_surface = thermal_boundary.internal_surface - internal_surface.short_wave_reflectance = 1 - float(internal_layer.material.solar_absorptance) - internal_surface.long_wave_emittance = 1 - float(internal_layer.material.solar_absorptance) + internal_surface.short_wave_reflectance = 1 - internal_layer.material.solar_absorptance + internal_surface.long_wave_emittance = 1 - internal_layer.material.solar_absorptance for thermal_opening in thermal_boundary.thermal_openings: if construction_archetype.window is not None: diff --git a/hub/imports/construction/nrel_physics_parameters.py b/hub/imports/construction/nrel_physics_parameters.py index 6de4771a..e1e3fa06 100644 --- a/hub/imports/construction/nrel_physics_parameters.py +++ b/hub/imports/construction/nrel_physics_parameters.py @@ -58,7 +58,7 @@ class NrelPhysicsParameters: for thermal_zone in internal_zone.thermal_zones: thermal_zone.total_floor_area = thermal_zone.footprint_area else: - number_of_storeys = int(float(building.eave_height) / float(building.average_storey_height)) + number_of_storeys = int(building.eave_height / building.average_storey_height) thermal_zone = building.internal_zones[0].thermal_zones[0] thermal_zone.total_floor_area = thermal_zone.footprint_area * number_of_storeys else: @@ -78,7 +78,7 @@ class NrelPhysicsParameters: construction_period_limits = building_archetype.construction_period.split(' - ') if construction_period_limits[1] == 'PRESENT': construction_period_limits[1] = 3000 - if int(construction_period_limits[0]) <= int(year_of_construction) < int(construction_period_limits[1]): + if int(construction_period_limits[0]) <= year_of_constructionF < int(construction_period_limits[1]): if (str(function) == str(building_archetype.function)) and \ (climate_zone == str(building_archetype.climate_zone)): return building_archetype @@ -130,12 +130,12 @@ class NrelPhysicsParameters: # The agreement is that the layers are defined from outside to inside external_layer = construction_archetype.layers[0] external_surface = thermal_boundary.parent_surface - external_surface.short_wave_reflectance = 1 - float(external_layer.material.solar_absorptance) - external_surface.long_wave_emittance = 1 - float(external_layer.material.solar_absorptance) + external_surface.short_wave_reflectance = 1 - external_layer.material.solar_absorptance + external_surface.long_wave_emittance = 1 - external_layer.material.solar_absorptance internal_layer = construction_archetype.layers[len(construction_archetype.layers) - 1] internal_surface = thermal_boundary.internal_surface - internal_surface.short_wave_reflectance = 1 - float(internal_layer.material.solar_absorptance) - internal_surface.long_wave_emittance = 1 - float(internal_layer.material.solar_absorptance) + internal_surface.short_wave_reflectance = 1 - internal_layer.material.solar_absorptance + internal_surface.long_wave_emittance = 1 - internal_layer.material.solar_absorptance for thermal_opening in thermal_boundary.thermal_openings: if construction_archetype.window is not None: