added_new_functions_to_dictionaries #48
|
@ -14,6 +14,7 @@ class Construction:
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._type = None
|
self._type = None
|
||||||
|
self._name = None
|
||||||
self._layers = None
|
self._layers = None
|
||||||
self._window_ratio = None
|
self._window_ratio = None
|
||||||
self._window_frame_ratio = None
|
self._window_frame_ratio = None
|
||||||
|
@ -37,6 +38,22 @@ class Construction:
|
||||||
"""
|
"""
|
||||||
self._type = value
|
self._type = value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""
|
||||||
|
Get construction name
|
||||||
|
:return: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, value):
|
||||||
|
"""
|
||||||
|
Set construction name
|
||||||
|
:param value: str
|
||||||
|
"""
|
||||||
|
self._name = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def layers(self) -> [Layer]:
|
def layers(self) -> [Layer]:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -130,6 +130,7 @@ class InternalZone:
|
||||||
for hole in surface.holes_polygons:
|
for hole in surface.holes_polygons:
|
||||||
windows_areas.append(hole.area)
|
windows_areas.append(hole.area)
|
||||||
_thermal_boundary = ThermalBoundary(surface, surface.solid_polygon.area, windows_areas)
|
_thermal_boundary = ThermalBoundary(surface, surface.solid_polygon.area, windows_areas)
|
||||||
|
surface.associated_thermal_boundaries = [_thermal_boundary]
|
||||||
_thermal_boundaries.append(_thermal_boundary)
|
_thermal_boundaries.append(_thermal_boundary)
|
||||||
_number_of_storeys = int(self.volume / self.area / self.thermal_archetype.average_storey_height)
|
_number_of_storeys = int(self.volume / self.area / self.thermal_archetype.average_storey_height)
|
||||||
_thermal_zone = ThermalZone(_thermal_boundaries, self, self.volume, self.area, _number_of_storeys)
|
_thermal_zone = ThermalZone(_thermal_boundaries, self, self.volume, self.area, _number_of_storeys)
|
||||||
|
|
|
@ -256,6 +256,19 @@ class ThermalBoundary:
|
||||||
raise TypeError('Constructions layers are not initialized') from TypeError
|
raise TypeError('Constructions layers are not initialized') from TypeError
|
||||||
return self._u_value
|
return self._u_value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def construction_name(self):
|
||||||
|
"""
|
||||||
|
Get construction name
|
||||||
|
:return: str
|
||||||
|
"""
|
||||||
|
if self._construction_archetype is not None:
|
||||||
|
self._construction_name = self._construction_archetype.name
|
||||||
|
else:
|
||||||
|
logging.error('Construction name not defined\n')
|
||||||
|
raise ValueError('Construction name not defined')
|
||||||
|
return self._construction_name
|
||||||
|
|
||||||
@u_value.setter
|
@u_value.setter
|
||||||
def u_value(self, value):
|
def u_value(self, value):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -148,28 +148,28 @@ class Idf:
|
||||||
|
|
||||||
def _add_material(self, layer):
|
def _add_material(self, layer):
|
||||||
for material in self._idf.idfobjects[self._MATERIAL]:
|
for material in self._idf.idfobjects[self._MATERIAL]:
|
||||||
if material.Name == layer.material.name:
|
if material.Name == layer.name:
|
||||||
return
|
return
|
||||||
for material in self._idf.idfobjects[self._MATERIAL_NOMASS]:
|
for material in self._idf.idfobjects[self._MATERIAL_NOMASS]:
|
||||||
if material.Name == layer.material.name:
|
if material.Name == layer.name:
|
||||||
return
|
return
|
||||||
if layer.material.no_mass:
|
if layer.no_mass:
|
||||||
self._idf.newidfobject(self._MATERIAL_NOMASS,
|
self._idf.newidfobject(self._MATERIAL_NOMASS,
|
||||||
Name=layer.material.name,
|
Name=layer.name,
|
||||||
Roughness=self._ROUGHNESS,
|
Roughness=self._ROUGHNESS,
|
||||||
Thermal_Resistance=layer.material.thermal_resistance
|
Thermal_Resistance=layer.thermal_resistance
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self._idf.newidfobject(self._MATERIAL,
|
self._idf.newidfobject(self._MATERIAL,
|
||||||
Name=layer.material.name,
|
Name=layer.name,
|
||||||
Roughness=self._ROUGHNESS,
|
Roughness=self._ROUGHNESS,
|
||||||
Thickness=layer.thickness,
|
Thickness=layer.thickness,
|
||||||
Conductivity=layer.material.conductivity,
|
Conductivity=layer.conductivity,
|
||||||
Density=layer.material.density,
|
Density=layer.density,
|
||||||
Specific_Heat=layer.material.specific_heat,
|
Specific_Heat=layer.specific_heat,
|
||||||
Thermal_Absorptance=layer.material.thermal_absorptance,
|
Thermal_Absorptance=layer.thermal_absorptance,
|
||||||
Solar_Absorptance=layer.material.solar_absorptance,
|
Solar_Absorptance=layer.solar_absorptance,
|
||||||
Visible_Absorptance=layer.material.visible_absorptance
|
Visible_Absorptance=layer.visible_absorptance
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -338,11 +338,11 @@ class Idf:
|
||||||
_kwargs = {'Name': vegetation_name,
|
_kwargs = {'Name': vegetation_name,
|
||||||
'Outside_Layer': thermal_boundary.parent_surface.vegetation.name}
|
'Outside_Layer': thermal_boundary.parent_surface.vegetation.name}
|
||||||
for i in range(0, len(layers) - 1):
|
for i in range(0, len(layers) - 1):
|
||||||
_kwargs[f'Layer_{i + 2}'] = layers[i].material.name
|
_kwargs[f'Layer_{i + 2}'] = layers[i].name
|
||||||
else:
|
else:
|
||||||
_kwargs = {'Name': thermal_boundary.construction_name, 'Outside_Layer': layers[0].material.name}
|
_kwargs = {'Name': thermal_boundary.construction_name, 'Outside_Layer': layers[0].name}
|
||||||
for i in range(1, len(layers) - 1):
|
for i in range(1, len(layers) - 1):
|
||||||
_kwargs[f'Layer_{i + 1}'] = layers[i].material.name
|
_kwargs[f'Layer_{i + 1}'] = layers[i].name
|
||||||
self._idf.newidfobject(self._CONSTRUCTION, **_kwargs)
|
self._idf.newidfobject(self._CONSTRUCTION, **_kwargs)
|
||||||
|
|
||||||
def _add_window_construction_and_material(self, thermal_opening):
|
def _add_window_construction_and_material(self, thermal_opening):
|
||||||
|
@ -512,12 +512,12 @@ class Idf:
|
||||||
self._rename_building(self._city.name)
|
self._rename_building(self._city.name)
|
||||||
self._lod = self._city.level_of_detail.geometry
|
self._lod = self._city.level_of_detail.geometry
|
||||||
for building in self._city.buildings:
|
for building in self._city.buildings:
|
||||||
print('building name', building.name)
|
|
||||||
for internal_zone in building.internal_zones:
|
for internal_zone in building.internal_zones:
|
||||||
if internal_zone.thermal_zones_from_internal_zones is None:
|
if internal_zone.thermal_zones_from_internal_zones is None:
|
||||||
continue
|
continue
|
||||||
for thermal_zone in internal_zone.thermal_zones_from_internal_zones:
|
for thermal_zone in internal_zone.thermal_zones_from_internal_zones:
|
||||||
for thermal_boundary in thermal_zone.thermal_boundaries:
|
for thermal_boundary in thermal_zone.thermal_boundaries:
|
||||||
|
|
||||||
self._add_construction(thermal_boundary)
|
self._add_construction(thermal_boundary)
|
||||||
if thermal_boundary.parent_surface.vegetation is not None:
|
if thermal_boundary.parent_surface.vegetation is not None:
|
||||||
self._add_vegetation_material(thermal_boundary.parent_surface.vegetation)
|
self._add_vegetation_material(thermal_boundary.parent_surface.vegetation)
|
||||||
|
@ -560,7 +560,7 @@ class Idf:
|
||||||
self._add_dhw(thermal_zone, building.name)
|
self._add_dhw(thermal_zone, building.name)
|
||||||
if self._export_type == "Surfaces":
|
if self._export_type == "Surfaces":
|
||||||
if building.name in self._target_buildings or building.name in self._adjacent_buildings:
|
if building.name in self._target_buildings or building.name in self._adjacent_buildings:
|
||||||
if building.internal_zones[0].thermal_zones_from_internal_zones is not None:
|
if building.thermal_zones_from_internal_zones is not None:
|
||||||
self._add_surfaces(building, building.name)
|
self._add_surfaces(building, building.name)
|
||||||
else:
|
else:
|
||||||
self._add_pure_geometry(building, building.name)
|
self._add_pure_geometry(building, building.name)
|
||||||
|
@ -569,6 +569,7 @@ class Idf:
|
||||||
else:
|
else:
|
||||||
self._add_block(building)
|
self._add_block(building)
|
||||||
|
|
||||||
|
print('BBBBBBBBBB')
|
||||||
self._idf.newidfobject(
|
self._idf.newidfobject(
|
||||||
"OUTPUT:VARIABLE",
|
"OUTPUT:VARIABLE",
|
||||||
Variable_Name="Zone Ideal Loads Supply Air Total Heating Energy",
|
Variable_Name="Zone Ideal Loads Supply Air Total Heating Energy",
|
||||||
|
@ -677,8 +678,7 @@ class Idf:
|
||||||
self._idf.set_wwr(wwr)
|
self._idf.set_wwr(wwr)
|
||||||
|
|
||||||
def _add_surfaces(self, building, zone_name):
|
def _add_surfaces(self, building, zone_name):
|
||||||
for internal_zone in building.internal_zones:
|
for thermal_zone in building.thermal_zones_from_internal_zones:
|
||||||
for thermal_zone in internal_zone.thermal_zones_from_internal_zones:
|
|
||||||
for boundary in thermal_zone.thermal_boundaries:
|
for boundary in thermal_zone.thermal_boundaries:
|
||||||
idf_surface_type = self.idf_surfaces[boundary.parent_surface.type]
|
idf_surface_type = self.idf_surfaces[boundary.parent_surface.type]
|
||||||
outside_boundary_condition = 'Outdoors'
|
outside_boundary_condition = 'Outdoors'
|
||||||
|
@ -723,7 +723,11 @@ class Idf:
|
||||||
wwr = 0
|
wwr = 0
|
||||||
for surface in building.surfaces:
|
for surface in building.surfaces:
|
||||||
if surface.type == cte.WALL:
|
if surface.type == cte.WALL:
|
||||||
|
print(surface)
|
||||||
|
print(surface.associated_thermal_boundaries)
|
||||||
|
print(surface.associated_thermal_boundaries[0].window_ratio)
|
||||||
wwr = surface.associated_thermal_boundaries[0].window_ratio
|
wwr = surface.associated_thermal_boundaries[0].window_ratio
|
||||||
|
print(wwr)
|
||||||
self._idf.set_wwr(wwr, construction='window_construction_1')
|
self._idf.set_wwr(wwr, construction='window_construction_1')
|
||||||
|
|
||||||
def _add_windows_by_vertices(self, boundary):
|
def _add_windows_by_vertices(self, boundary):
|
||||||
|
|
|
@ -16,7 +16,9 @@ class HubFunctionToEilatConstructionFunction:
|
||||||
self._dictionary = {
|
self._dictionary = {
|
||||||
cte.RESIDENTIAL: 'Residential_building',
|
cte.RESIDENTIAL: 'Residential_building',
|
||||||
cte.HOTEL: 'Residential_building',
|
cte.HOTEL: 'Residential_building',
|
||||||
cte.DORMITORY: 'Residential_building'
|
cte.DORMITORY: 'Residential_building',
|
||||||
|
cte.DATACENTER: 'n/a',
|
||||||
|
cte.FARM: 'n/a'
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -73,7 +73,9 @@ class HubFunctionToMontrealCustomCostsFunction:
|
||||||
cte.AUTOMOTIVE_FACILITY: 'non-residential',
|
cte.AUTOMOTIVE_FACILITY: 'non-residential',
|
||||||
cte.PARKING_GARAGE: 'non-residential',
|
cte.PARKING_GARAGE: 'non-residential',
|
||||||
cte.RELIGIOUS: 'non-residential',
|
cte.RELIGIOUS: 'non-residential',
|
||||||
cte.NON_HEATED: 'non-residential'
|
cte.NON_HEATED: 'non-residential',
|
||||||
|
cte.DATACENTER: 'n/a',
|
||||||
|
cte.FARM: 'n/a'
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -72,7 +72,9 @@ class HubFunctionToNrcanConstructionFunction:
|
||||||
cte.AUTOMOTIVE_FACILITY: 'n/a',
|
cte.AUTOMOTIVE_FACILITY: 'n/a',
|
||||||
cte.PARKING_GARAGE: 'n/a',
|
cte.PARKING_GARAGE: 'n/a',
|
||||||
cte.RELIGIOUS: 'n/a',
|
cte.RELIGIOUS: 'n/a',
|
||||||
cte.NON_HEATED: 'n/a'
|
cte.NON_HEATED: 'n/a',
|
||||||
|
cte.DATACENTER: 'n/a',
|
||||||
|
cte.FARM: 'n/a'
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -73,7 +73,9 @@ class HubFunctionToNrelConstructionFunction:
|
||||||
cte.AUTOMOTIVE_FACILITY: 'n/a',
|
cte.AUTOMOTIVE_FACILITY: 'n/a',
|
||||||
cte.PARKING_GARAGE: 'n/a',
|
cte.PARKING_GARAGE: 'n/a',
|
||||||
cte.RELIGIOUS: 'n/a',
|
cte.RELIGIOUS: 'n/a',
|
||||||
cte.NON_HEATED: 'n/a'
|
cte.NON_HEATED: 'n/a',
|
||||||
|
cte.DATACENTER: 'n/a',
|
||||||
|
cte.FARM: 'n/a'
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -76,7 +76,6 @@ class HubUsageToNrcanUsage:
|
||||||
cte.NON_HEATED: 'n/a',
|
cte.NON_HEATED: 'n/a',
|
||||||
cte.DATACENTER: 'n/a',
|
cte.DATACENTER: 'n/a',
|
||||||
cte.FARM: 'n/a'
|
cte.FARM: 'n/a'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -71,6 +71,7 @@ class EilatPhysicsParameters:
|
||||||
for catalog_construction in catalog_archetype.constructions:
|
for catalog_construction in catalog_archetype.constructions:
|
||||||
construction = Construction()
|
construction = Construction()
|
||||||
construction.type = catalog_construction.type
|
construction.type = catalog_construction.type
|
||||||
|
construction.name = catalog_construction.name
|
||||||
if catalog_construction.window_ratio is not None:
|
if catalog_construction.window_ratio is not None:
|
||||||
for _orientation in catalog_construction.window_ratio:
|
for _orientation in catalog_construction.window_ratio:
|
||||||
if catalog_construction.window_ratio[_orientation] is None:
|
if catalog_construction.window_ratio[_orientation] is None:
|
||||||
|
|
|
@ -71,6 +71,7 @@ class NrcanPhysicsParameters:
|
||||||
for catalog_construction in catalog_archetype.constructions:
|
for catalog_construction in catalog_archetype.constructions:
|
||||||
construction = Construction()
|
construction = Construction()
|
||||||
construction.type = catalog_construction.type
|
construction.type = catalog_construction.type
|
||||||
|
construction.name = catalog_construction.name
|
||||||
if catalog_construction.window_ratio is not None:
|
if catalog_construction.window_ratio is not None:
|
||||||
for _orientation in catalog_construction.window_ratio:
|
for _orientation in catalog_construction.window_ratio:
|
||||||
if catalog_construction.window_ratio[_orientation] is None:
|
if catalog_construction.window_ratio[_orientation] is None:
|
||||||
|
|
|
@ -73,6 +73,7 @@ class NrelPhysicsParameters:
|
||||||
for catalog_construction in catalog_archetype.constructions:
|
for catalog_construction in catalog_archetype.constructions:
|
||||||
construction = Construction()
|
construction = Construction()
|
||||||
construction.type = catalog_construction.type
|
construction.type = catalog_construction.type
|
||||||
|
construction.name = catalog_construction.name
|
||||||
if catalog_construction.window_ratio is not None:
|
if catalog_construction.window_ratio is not None:
|
||||||
construction.window_ratio = {'north': catalog_construction.window_ratio,
|
construction.window_ratio = {'north': catalog_construction.window_ratio,
|
||||||
'east': catalog_construction.window_ratio,
|
'east': catalog_construction.window_ratio,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user