Surfaces have now a more human-readable name

This commit is contained in:
Guille Gutierrez 2023-12-07 13:20:21 -05:00
parent eeac9a24a8
commit d592de6759

View File

@ -641,12 +641,12 @@ class Idf:
Fraction_of_Shading_Surface_That_Is_Glazed=0) Fraction_of_Shading_Surface_That_Is_Glazed=0)
def _add_pure_geometry(self, building, zone_name): def _add_pure_geometry(self, building, zone_name):
for surface in building.surfaces: for index, surface in enumerate(building.surfaces):
outside_boundary_condition = 'Outdoors' outside_boundary_condition = 'Outdoors'
sun_exposure = 'SunExposed' sun_exposure = 'SunExposed'
wind_exposure = 'WindExposed' wind_exposure = 'WindExposed'
idf_surface_type = self.idf_surfaces[surface.type] idf_surface_type = self.idf_surfaces[surface.type]
_kwargs = {'Name': f'{surface.name}', _kwargs = {'Name': f'Building_{building.name}_surface_{index}',
'Surface_Type': idf_surface_type, 'Surface_Type': idf_surface_type,
'Zone_Name': zone_name} 'Zone_Name': zone_name}
if surface.type == cte.GROUND: if surface.type == cte.GROUND:
@ -655,7 +655,7 @@ class Idf:
wind_exposure = 'NoWind' wind_exposure = 'NoWind'
if surface.percentage_shared is not None and surface.percentage_shared > 0.5: if surface.percentage_shared is not None and surface.percentage_shared > 0.5:
outside_boundary_condition = 'Surface' outside_boundary_condition = 'Surface'
outside_boundary_condition_object = surface.name outside_boundary_condition_object = f'Building_{building.name}_surface_{index}'
sun_exposure = 'NoSun' sun_exposure = 'NoSun'
wind_exposure = 'NoWind' wind_exposure = 'NoWind'
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object _kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object
@ -680,12 +680,12 @@ class Idf:
def _add_surfaces(self, building, zone_name): def _add_surfaces(self, building, zone_name):
for thermal_zone in building.thermal_zones_from_internal_zones: for thermal_zone in building.thermal_zones_from_internal_zones:
for boundary in thermal_zone.thermal_boundaries: for index, boundary in enumerate(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'
sun_exposure = 'SunExposed' sun_exposure = 'SunExposed'
wind_exposure = 'WindExposed' wind_exposure = 'WindExposed'
_kwargs = {'Name': f'{boundary.parent_surface.name}', _kwargs = {'Name': f'Building_{building.name}_surface_{index}',
'Surface_Type': idf_surface_type, 'Surface_Type': idf_surface_type,
'Zone_Name': zone_name} 'Zone_Name': zone_name}
if boundary.parent_surface.type == cte.GROUND: if boundary.parent_surface.type == cte.GROUND:
@ -694,7 +694,7 @@ class Idf:
wind_exposure = 'NoWind' wind_exposure = 'NoWind'
if boundary.parent_surface.percentage_shared is not None and boundary.parent_surface.percentage_shared > 0.5: if boundary.parent_surface.percentage_shared is not None and boundary.parent_surface.percentage_shared > 0.5:
outside_boundary_condition = 'Surface' outside_boundary_condition = 'Surface'
outside_boundary_condition_object = boundary.parent_surface.name outside_boundary_condition_object = f'Building_{building.name}_surface_{index}'
sun_exposure = 'NoSun' sun_exposure = 'NoSun'
wind_exposure = 'NoWind' wind_exposure = 'NoWind'
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object _kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object