diff --git a/cerc_costs.egg-info/PKG-INFO b/cerc_costs.egg-info/PKG-INFO index cbfe54b..5e62c0a 100644 --- a/cerc_costs.egg-info/PKG-INFO +++ b/cerc_costs.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cerc-costs -Version: 0.1.0.0 +Version: 0.1.0.2 Summary: CERC costs contains the basic cost calculation per CERC-Hub building Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Programming Language :: Python diff --git a/cerc_costs.egg-info/SOURCES.txt b/cerc_costs.egg-info/SOURCES.txt index 9cc7c29..6271666 100644 --- a/cerc_costs.egg-info/SOURCES.txt +++ b/cerc_costs.egg-info/SOURCES.txt @@ -1,3 +1,4 @@ +README.md pyproject.toml requirements.txt setup.py @@ -14,6 +15,7 @@ costs/constants.py costs/cost.py costs/cost_base.py costs/end_of_life_costs.py +costs/peak_load.py costs/total_maintenance_costs.py costs/total_operational_costs.py costs/total_operational_incomes.py diff --git a/costs/capital_costs.py b/costs/capital_costs.py index 3dc7933..6add872 100644 --- a/costs/capital_costs.py +++ b/costs/capital_costs.py @@ -81,16 +81,15 @@ class CapitalCosts(CostBase): capital_cost_other_hvac_ahu = 0 capital_cost_lighting = 0 - for internal_zone in self._building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: - for thermal_boundary in thermal_zone.thermal_boundaries: - if thermal_boundary.type == 'Ground': - surface_ground += thermal_boundary.opaque_area - elif thermal_boundary.type == 'Roof': - surface_roof += thermal_boundary.opaque_area - elif thermal_boundary.type == 'Wall': - surface_opaque += thermal_boundary.opaque_area * (1 - thermal_boundary.window_ratio) - surface_transparent += thermal_boundary.opaque_area * thermal_boundary.window_ratio + for thermal_zone in self._building.thermal_zones: + for thermal_boundary in thermal_zone.thermal_boundaries: + if thermal_boundary.type == 'Ground': + surface_ground += thermal_boundary.opaque_area + elif thermal_boundary.type == 'Roof': + surface_roof += thermal_boundary.opaque_area + elif thermal_boundary.type == 'Wall': + surface_opaque += thermal_boundary.opaque_area * (1 - thermal_boundary.window_ratio) + surface_transparent += thermal_boundary.opaque_area * thermal_boundary.window_ratio peak_heating = self._building.heating_peak_load[cte.YEAR][0] / 1000 peak_cooling = self._building.cooling_peak_load[cte.YEAR][0] / 1000 diff --git a/costs/cost.py b/costs/cost.py index 027c184..8be3685 100644 --- a/costs/cost.py +++ b/costs/cost.py @@ -94,8 +94,6 @@ class Cost: df_end_of_life_costs = global_end_of_life_costs['End_of_life_costs'] df_operational_costs = ( - global_operational_costs['Fixed_costs_electricity_peak'] + - global_operational_costs['Fixed_costs_electricity_monthly'] + global_operational_costs['Fixed_costs_electricity_peak'] + global_operational_costs['Fixed_costs_electricity_monthly'] + global_operational_costs['Variable_costs_electricity'] + diff --git a/costs/cost_base.py b/costs/cost_base.py index e6aeb13..7ffdd26 100644 --- a/costs/cost_base.py +++ b/costs/cost_base.py @@ -19,9 +19,8 @@ class CostBase: self._building = building self._configuration = configuration self._total_floor_area = 0 - for internal_zone in building.internal_zones: - for thermal_zone in internal_zone.thermal_zones: - self._total_floor_area += thermal_zone.total_floor_area + for thermal_zone in building.thermal_zones: + self._total_floor_area += thermal_zone.total_floor_area self._archetype = None self._capital_costs_chapter = None for archetype in self._configuration.costs_catalog.entries().archetypes: diff --git a/costs/peak_load.py b/costs/peak_load.py index b45a085..fc22799 100644 --- a/costs/peak_load.py +++ b/costs/peak_load.py @@ -34,19 +34,8 @@ class PeakLoad: if demand_type == cte.COOLING: cooling = 1 if cte.MONTH in self._building.heating_peak_load.keys() and cte.MONTH in self._building.cooling_peak_load.keys(): - peak_lighting = 0 - peak_appliances = 0 - for thermal_zone in self._building.internal_zones[0].thermal_zones: - lighting = thermal_zone.lighting - for schedule in lighting.schedules: - peak = max(schedule.values) * lighting.density * thermal_zone.total_floor_area - if peak > peak_lighting: - peak_lighting = peak - appliances = thermal_zone.appliances - for schedule in appliances.schedules: - peak = max(schedule.values) * appliances.density * thermal_zone.total_floor_area - if peak > peak_appliances: - peak_appliances = peak + peak_lighting = self._building.lighting_peak_load[cte.YEAR][0] + peak_appliances = self._building.appliances_peak_load[cte.YEAR][0] monthly_electricity_peak = [0.9 * peak_lighting + 0.7 * peak_appliances] * 12 conditioning_peak = [] for i, value in enumerate(self._building.heating_peak_load[cte.MONTH]): @@ -57,9 +46,8 @@ class PeakLoad: monthly_electricity_peak[i] += 0.8 * conditioning_peak[i] electricity_peak_load_results = pd.DataFrame( monthly_electricity_peak, - columns=[f'{self._building.name} electricity peak load W'] + columns=[f'electricity peak load W'] ) else: - electricity_peak_load_results = pd.DataFrame(array, columns=[f'{self._building.name} electricity peak load W']) - + electricity_peak_load_results = pd.DataFrame(array, columns=[f'electricity peak load W']) return electricity_peak_load_results diff --git a/costs/total_operational_costs.py b/costs/total_operational_costs.py index ee076f6..17cd70e 100644 --- a/costs/total_operational_costs.py +++ b/costs/total_operational_costs.py @@ -85,8 +85,12 @@ class TotalOperationalCosts(CostBase): self._yearly_operational_costs.at[year, 'Fixed_costs_electricity_monthly'] = ( monthly_electricity_cost_year_0 * price_increase_peak_electricity ) + if not isinstance(variable_electricity_cost_year_0, pd.DataFrame): + variable_costs_electricity = variable_electricity_cost_year_0 * price_increase_electricity + else: + variable_costs_electricity = float(variable_electricity_cost_year_0.iloc[0] * price_increase_electricity) self._yearly_operational_costs.at[year, 'Variable_costs_electricity'] = ( - float(variable_electricity_cost_year_0.iloc[0] * price_increase_electricity) + variable_costs_electricity ) self._yearly_operational_costs.at[year, 'Fixed_costs_gas'] = fixed_gas_cost_year_0 * price_increase_gas self._yearly_operational_costs.at[year, 'Variable_costs_gas'] = ( diff --git a/dist/cerc-costs-0.1.0.0.tar.gz b/dist/cerc-costs-0.1.0.0.tar.gz deleted file mode 100644 index 44bda90..0000000 Binary files a/dist/cerc-costs-0.1.0.0.tar.gz and /dev/null differ diff --git a/dist/cerc_costs-0.1.0.0-py3-none-any.whl b/dist/cerc_costs-0.1.0.0-py3-none-any.whl deleted file mode 100644 index c5a2175..0000000 Binary files a/dist/cerc_costs-0.1.0.0-py3-none-any.whl and /dev/null differ