diff --git a/hub/exports/building_energy/insel/insel_monthly_energy_balance.py b/hub/exports/building_energy/insel/insel_monthly_energy_balance.py index f136509a..e724c445 100644 --- a/hub/exports/building_energy/insel/insel_monthly_energy_balance.py +++ b/hub/exports/building_energy/insel/insel_monthly_energy_balance.py @@ -13,14 +13,14 @@ from hub.imports.weather.helpers.weather import Weather import hub.helpers.constants as cte _CONSTRUCTION_CODE = { - cte.WALL: '1', - cte.GROUND: '2', - cte.ROOF: '3', - cte.INTERIOR_WALL: '5', - cte.GROUND_WALL: '6', - cte.ATTIC_FLOOR: '7', - cte.INTERIOR_SLAB: '8' - } + cte.WALL: '1', + cte.GROUND: '2', + cte.ROOF: '3', + cte.INTERIOR_WALL: '5', + cte.GROUND_WALL: '6', + cte.ATTIC_FLOOR: '7', + cte.INTERIOR_SLAB: '8' +} class InselMonthlyEnergyBalance(Insel): @@ -35,8 +35,10 @@ class InselMonthlyEnergyBalance(Insel): self._insel_files_paths.append(building.name + '.insel') file_name_out = building.name + '.out' output_path = Path(self._path / file_name_out).resolve() - self._contents.append(self.generate_meb_template(building, output_path, self._radiation_calculation_method, - self._weather_format)) + if building.internal_zones is not None: + self._contents.append( + self.generate_meb_template(building, output_path, self._radiation_calculation_method,self._weather_format) + ) self._export() def _export(self): @@ -86,7 +88,7 @@ class InselMonthlyEnergyBalance(Insel): total_internal_gain = 0 for ig in usage.internal_gains: total_internal_gain += float(ig.average_internal_gain) * \ - (float(ig.convective_fraction) + float(ig.radiative_fraction)) + (float(ig.convective_fraction) + float(ig.radiative_fraction)) parameters.append(f'{total_internal_gain} % BP(12) #2 Internal gains of zone {i + 1}') parameters.append(f'{usage.thermal_control.mean_heating_set_point} % BP(13) #3 Heating setpoint temperature ' f'zone {i + 1} (degree Celsius)')