From a20b45205f3da9e9dbda229738ca5fd451464c14 Mon Sep 17 00:00:00 2001 From: s_ranjbar Date: Wed, 27 Nov 2024 18:35:29 +0100 Subject: [PATCH] feat: installed_capacity attribute added to PvGeneration class and implemented in the code --- .../energy_systems/pv_generation_system.py | 34 +++++-------------- pv_assessment/pv_system_assessment.py | 5 +++ 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/hub/city_model_structure/energy_systems/pv_generation_system.py b/hub/city_model_structure/energy_systems/pv_generation_system.py index f6567c98..66ca7196 100644 --- a/hub/city_model_structure/energy_systems/pv_generation_system.py +++ b/hub/city_model_structure/energy_systems/pv_generation_system.py @@ -28,9 +28,7 @@ class PvGenerationSystem(GenerationSystem): self._height = None self._electricity_power_output = {} self._tilt_angle = None - self._surface_azimuth = None - self._solar_altitude_angle = None - self._solar_azimuth_angle = None + self._installed_capacity = None @property def nominal_electricity_output(self): @@ -225,33 +223,17 @@ class PvGenerationSystem(GenerationSystem): self._electricity_power_output = value @property - def tilt_angle(self): + def installed_capacity(self): """ - Get tilt angle of PV system in degrees + Get the total installed nominal capacity in W :return: float """ - return self._tilt_angle + return self._installed_capacity - @tilt_angle.setter - def tilt_angle(self, value): + @installed_capacity.setter + def installed_capacity(self, value): """ - Set PV system tilt angle in degrees + Set the total installed nominal capacity in W :param value: float """ - self._tilt_angle = value - - @property - def surface_azimuth(self): - """ - Get surface azimuth angle of PV system in degrees. 0 is North - :return: float - """ - return self._surface_azimuth - - @surface_azimuth.setter - def surface_azimuth(self, value): - """ - Set PV system tilt angle in degrees - :param value: float - """ - self._surface_azimuth = value + self._installed_capacity = value diff --git a/pv_assessment/pv_system_assessment.py b/pv_assessment/pv_system_assessment.py index de83b4fd..72e1a3ae 100644 --- a/pv_assessment/pv_system_assessment.py +++ b/pv_assessment/pv_system_assessment.py @@ -188,6 +188,11 @@ class PvSystemAssessment: archetype_name = '_'.join(system_archetype_name.lower().split()) if 'grid_tied' in archetype_name: self.results = self.grid_tied_system() + for energy_system in self.building.energy_systems: + for generation_system in energy_system.generation_systems: + if generation_system.system_type == cte.PHOTOVOLTAIC: + generation_system.installed_capacity = (self.results['rooftop_panels'] * + float(generation_system.standard_test_condition_maximum_power)) hourly_pv_output = self.results['total_hourly_pv_system_output_W'] self.building.pv_generation[cte.HOUR] = hourly_pv_output self.building.pv_generation[cte.MONTH] = MonthlyValues.get_total_month(hourly_pv_output)