forced_u_value_change

This commit is contained in:
Mohamed_Osman 2024-09-17 00:37:42 -04:00 committed by s_ranjbar
parent 47401f2e30
commit 20b6167245
2 changed files with 18 additions and 15 deletions

View File

@ -12,22 +12,22 @@ class RetrofitFactory:
self._apply_retrofit_to_building(building, wall_u_value, roof_u_value, ground_u_value) self._apply_retrofit_to_building(building, wall_u_value, roof_u_value, ground_u_value)
def _apply_retrofit_to_building(self, building: Building, wall_u_value, roof_u_value, ground_u_value): def _apply_retrofit_to_building(self, building: Building, wall_u_value, roof_u_value, ground_u_value):
for internal_zone in building.internal_zones: # for internal_zone in building.internal_zones:
print(internal_zone.id) # print(internal_zone.id)
for thermal_zone in internal_zone.thermal_zones_from_internal_zones: for thermal_zone in building.thermal_zones_from_internal_zones:
for thermal_boundary in thermal_zone.thermal_boundaries: for thermal_boundary in thermal_zone.thermal_boundaries:
if wall_u_value and thermal_boundary.type == cte.WALL: if wall_u_value and thermal_boundary.type == cte.WALL:
print(thermal_boundary.u_value) print(thermal_boundary.u_value)
thermal_boundary.u_value = wall_u_value thermal_boundary.u_value = wall_u_value
print(thermal_boundary.u_value) print(thermal_boundary.u_value)
elif roof_u_value and thermal_boundary.type == cte.ROOF: elif roof_u_value and thermal_boundary.type == cte.ROOF:
print("roof", thermal_boundary.u_value) print("roof", thermal_boundary.u_value)
thermal_boundary.u_value = roof_u_value thermal_boundary.u_value = roof_u_value
print("roof", thermal_boundary.u_value) print("roof", thermal_boundary.u_value)
elif ground_u_value and thermal_boundary.type == cte.GROUND: elif ground_u_value and thermal_boundary.type == cte.GROUND:
thermal_boundary.u_value = ground_u_value thermal_boundary.u_value = ground_u_value
print("ground", thermal_boundary.u_value) print("ground", thermal_boundary.u_value)
def enrich(self): def enrich(self):
# This method can be expanded to include different retrofit strategies # This method can be expanded to include different retrofit strategies

View File

@ -6,6 +6,7 @@ from hub.helpers.dictionaries import Dictionaries
from hub.imports.construction_factory import ConstructionFactory from hub.imports.construction_factory import ConstructionFactory
from hub.imports.usage_factory import UsageFactory from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory from hub.imports.weather_factory import WeatherFactory
from hub.imports.retrofit_factory import RetrofitFactory
# Specify the GeoJSON file path # Specify the GeoJSON file path
input_files_path = (Path(__file__).parent / 'input_files') input_files_path = (Path(__file__).parent / 'input_files')
input_files_path.mkdir(parents=True, exist_ok=True) input_files_path.mkdir(parents=True, exist_ok=True)
@ -23,6 +24,8 @@ city = GeometryFactory('geojson',
# Enrich city data # Enrich city data
ConstructionFactory('cerc', city).enrich() ConstructionFactory('cerc', city).enrich()
UsageFactory('cerc', city).enrich() UsageFactory('cerc', city).enrich()
RetrofitFactory('basic', city).enrich()
WeatherFactory('epw', city).enrich() WeatherFactory('epw', city).enrich()
energy_plus_workflow(city) energy_plus_workflow(city)