diff --git a/README.md b/README.md index 89c0927..f538e99 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ The following assumptions are taken: - All buildings have basement but those are not heated - The construction details come from nrel - The usage details come from comnet +- The heated volume is 85% of the total volume, assuming that the rest is occupied by internal walls #### Dependencies diff --git a/monthly_energy_balance.py b/monthly_energy_balance.py index f9300ba..7c63351 100644 --- a/monthly_energy_balance.py +++ b/monthly_energy_balance.py @@ -1,5 +1,5 @@ """ -InselMonthlyEnergyBalance exports models to insel format +Monthly energy balance using Insel workflow SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2022 Concordia CERC group Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca @@ -23,10 +23,10 @@ class MonthlyEnergyBalance: for building in self._city.buildings: building.attic_heated = attic_heated_case building.basement_heated = basement_heated_case - self.sanity_check() - self.workflow() + self._sanity_check() + self._workflow() - def sanity_check(self): + def _sanity_check(self): levels_of_detail = self._city.level_of_detail if levels_of_detail.geometry is None: raise Exception(f'Level of detail of geometry not assigned') @@ -48,7 +48,7 @@ class MonthlyEnergyBalance: if cte.HOUR not in surface.global_irradiance: raise Exception(f'Building {building.name} does not have global irradiance on surfaces assigned') - def workflow(self): + def _workflow(self): for building in self._city.buildings: if cte.MONTH not in building.external_temperature: building.external_temperature[cte.MONTH] = MonthlyValues(). \ @@ -57,7 +57,7 @@ class MonthlyEnergyBalance: for surface in building.surfaces: if surface.type != cte.GROUND: if cte.MONTH not in surface.global_irradiance: - surface.global_irradiance[cte.MONTH] = MonthlyValues().get_total_month(surface.global_irradiance[cte.HOUR]) + surface.global_irradiance[cte.MONTH] = MonthlyValues().get_mean_values(surface.global_irradiance[cte.HOUR]) tmp_path = (Path(__file__).parent / 'tmp').resolve() EnergyBuildingsExportsFactory('insel_monthly_energy_balance', self._city, tmp_path).export() diff --git a/tmp/.gitignore b/tmp/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/tmp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/unittests/test_monthly_energy_balance_workflow.py b/unittests/test_monthly_energy_balance_workflow.py index 6c3db93..5b8c2bd 100644 --- a/unittests/test_monthly_energy_balance_workflow.py +++ b/unittests/test_monthly_energy_balance_workflow.py @@ -81,8 +81,8 @@ class TestMonthlyEnergyBalanceWorkflow(TestCase): for building in city.buildings: building.year_of_construction = 2006 - if building.function is None: - building.function = cte.LARGE_OFFICE + building.function = cte.LARGE_OFFICE + print(building.function) ConstructionFactory(construction_format, city).enrich() UsageFactory(usage_format, city).enrich() diff --git a/unittests/tests_outputs/.gitignore b/unittests/tests_outputs/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/unittests/tests_outputs/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file