From 4c23a112a1d2af04e299e92f3e81c33f337a8554 Mon Sep 17 00:00:00 2001 From: Pilar Date: Thu, 18 Nov 2021 13:07:48 -0500 Subject: [PATCH] Added 1 to fit with the length needed by FAST_READD --- helpers/simulation_parameters.py | 2 +- .../thermal_demand_dynamic_simulation.py | 17 +++++++++++++++-- main.py | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/helpers/simulation_parameters.py b/helpers/simulation_parameters.py index fba4548..5402cee 100644 --- a/helpers/simulation_parameters.py +++ b/helpers/simulation_parameters.py @@ -23,5 +23,5 @@ class SimulationParameters: heating_power = '100000000' inside_emissivity = '0.9' - alpha_coefficient = '0.3' + alpha_coefficient = '1' radiative_coefficient = '2.25' diff --git a/insel/templates/thermal_demand_dynamic_simulation.py b/insel/templates/thermal_demand_dynamic_simulation.py index ef88cad..88bbbca 100644 --- a/insel/templates/thermal_demand_dynamic_simulation.py +++ b/insel/templates/thermal_demand_dynamic_simulation.py @@ -36,13 +36,20 @@ class ThermalDemandDynamicSimulation: file += "%email: pilar.monsalvete@concordia.ca\n" for thermal_zone in self._building.thermal_zones: + total_area = 0 + for thermal_boundary in thermal_zone.thermal_boundaries: + total_area += thermal_boundary.area + for thermal_opening in thermal_boundary.thermal_openings: + total_area += thermal_opening.area for thermal_boundary in thermal_zone.thermal_boundaries: thermal_boundary.inside_emissivity = self._simulation_parameters.inside_emissivity - thermal_boundary.alpha_coefficient = self._simulation_parameters.alpha_coefficient + thermal_boundary.alpha_coefficient = str(float(self._simulation_parameters.alpha_coefficient) \ + * thermal_boundary.area / total_area) thermal_boundary.radiative_coefficient = self._simulation_parameters.radiative_coefficient for thermal_opening in thermal_boundary.thermal_openings: thermal_opening.inside_emissivity = self._simulation_parameters.inside_emissivity - thermal_opening.alpha_coefficient = self._simulation_parameters.alpha_coefficient + thermal_opening.alpha_coefficient = str(float(self._simulation_parameters.alpha_coefficient) \ + * thermal_opening.area / total_area) thermal_opening.radiative_coefficient = self._simulation_parameters.radiative_coefficient # insel template @@ -121,6 +128,9 @@ class ThermalDemandDynamicSimulation: else: n_records += 2 inputs = [f"{n_hoy}.1"] + # todo: this length depends on the OS, so it has to be modified. + # The idea is to erase all carriage return from the file in the block and, therefore, + # the length here will be n_records * 13 - 1 parameters = [f"{n_records * 13 + 1} %[RecLen]", f"'{weather_path}' %[FileName]", f"',' %[Separator]"] @@ -131,6 +141,9 @@ class ThermalDemandDynamicSimulation: n_ig = i_block n_records = number_usage_zones * 6 inputs = [f"{n_hoy}.1"] + # todo: this length depends on the OS, so it has to be modified. + # The idea is to erase all carriage return from the file in the block and, therefore, + # the length here will be n_records * 13 - 1 parameters = [f"{n_records * 13 + 1} %[RecLen]", f"'{ig_path}' %[FileName]", f"',' %[Separator]"] diff --git a/main.py b/main.py index e33d65d..04760f5 100644 --- a/main.py +++ b/main.py @@ -10,6 +10,7 @@ from imports.geometry_factory import GeometryFactory from imports.geometry.helpers.geometry_helper import GeometryHelper from city_model_structure.city import City + name_gml = 'one_building_in_kelowna.gml' function_format = 'hft' construction_format = 'nrel'