cost completed

This commit is contained in:
Guille Gutierrez 2023-08-01 16:41:04 -04:00
parent ea666afb02
commit 7548441c82
9 changed files with 23 additions and 33 deletions

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: cerc-costs 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 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: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Programming Language :: Python Classifier: Programming Language :: Python

View File

@ -1,3 +1,4 @@
README.md
pyproject.toml pyproject.toml
requirements.txt requirements.txt
setup.py setup.py
@ -14,6 +15,7 @@ costs/constants.py
costs/cost.py costs/cost.py
costs/cost_base.py costs/cost_base.py
costs/end_of_life_costs.py costs/end_of_life_costs.py
costs/peak_load.py
costs/total_maintenance_costs.py costs/total_maintenance_costs.py
costs/total_operational_costs.py costs/total_operational_costs.py
costs/total_operational_incomes.py costs/total_operational_incomes.py

View File

@ -81,16 +81,15 @@ class CapitalCosts(CostBase):
capital_cost_other_hvac_ahu = 0 capital_cost_other_hvac_ahu = 0
capital_cost_lighting = 0 capital_cost_lighting = 0
for internal_zone in self._building.internal_zones: for thermal_zone in self._building.thermal_zones:
for thermal_zone in internal_zone.thermal_zones: for thermal_boundary in thermal_zone.thermal_boundaries:
for thermal_boundary in thermal_zone.thermal_boundaries: if thermal_boundary.type == 'Ground':
if thermal_boundary.type == 'Ground': surface_ground += thermal_boundary.opaque_area
surface_ground += thermal_boundary.opaque_area elif thermal_boundary.type == 'Roof':
elif thermal_boundary.type == 'Roof': surface_roof += thermal_boundary.opaque_area
surface_roof += thermal_boundary.opaque_area elif thermal_boundary.type == 'Wall':
elif thermal_boundary.type == 'Wall': surface_opaque += thermal_boundary.opaque_area * (1 - thermal_boundary.window_ratio)
surface_opaque += thermal_boundary.opaque_area * (1 - thermal_boundary.window_ratio) surface_transparent += thermal_boundary.opaque_area * 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_heating = self._building.heating_peak_load[cte.YEAR][0] / 1000
peak_cooling = self._building.cooling_peak_load[cte.YEAR][0] / 1000 peak_cooling = self._building.cooling_peak_load[cte.YEAR][0] / 1000

View File

@ -94,8 +94,6 @@ class Cost:
df_end_of_life_costs = global_end_of_life_costs['End_of_life_costs'] df_end_of_life_costs = global_end_of_life_costs['End_of_life_costs']
df_operational_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_peak'] +
global_operational_costs['Fixed_costs_electricity_monthly'] + global_operational_costs['Fixed_costs_electricity_monthly'] +
global_operational_costs['Variable_costs_electricity'] + global_operational_costs['Variable_costs_electricity'] +

View File

@ -19,9 +19,8 @@ class CostBase:
self._building = building self._building = building
self._configuration = configuration self._configuration = configuration
self._total_floor_area = 0 self._total_floor_area = 0
for internal_zone in building.internal_zones: for thermal_zone in building.thermal_zones:
for thermal_zone in internal_zone.thermal_zones: self._total_floor_area += thermal_zone.total_floor_area
self._total_floor_area += thermal_zone.total_floor_area
self._archetype = None self._archetype = None
self._capital_costs_chapter = None self._capital_costs_chapter = None
for archetype in self._configuration.costs_catalog.entries().archetypes: for archetype in self._configuration.costs_catalog.entries().archetypes:

View File

@ -34,19 +34,8 @@ class PeakLoad:
if demand_type == cte.COOLING: if demand_type == cte.COOLING:
cooling = 1 cooling = 1
if cte.MONTH in self._building.heating_peak_load.keys() and cte.MONTH in self._building.cooling_peak_load.keys(): if cte.MONTH in self._building.heating_peak_load.keys() and cte.MONTH in self._building.cooling_peak_load.keys():
peak_lighting = 0 peak_lighting = self._building.lighting_peak_load[cte.YEAR][0]
peak_appliances = 0 peak_appliances = self._building.appliances_peak_load[cte.YEAR][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
monthly_electricity_peak = [0.9 * peak_lighting + 0.7 * peak_appliances] * 12 monthly_electricity_peak = [0.9 * peak_lighting + 0.7 * peak_appliances] * 12
conditioning_peak = [] conditioning_peak = []
for i, value in enumerate(self._building.heating_peak_load[cte.MONTH]): 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] monthly_electricity_peak[i] += 0.8 * conditioning_peak[i]
electricity_peak_load_results = pd.DataFrame( electricity_peak_load_results = pd.DataFrame(
monthly_electricity_peak, monthly_electricity_peak,
columns=[f'{self._building.name} electricity peak load W'] columns=[f'electricity peak load W']
) )
else: 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 return electricity_peak_load_results

View File

@ -85,8 +85,12 @@ class TotalOperationalCosts(CostBase):
self._yearly_operational_costs.at[year, 'Fixed_costs_electricity_monthly'] = ( self._yearly_operational_costs.at[year, 'Fixed_costs_electricity_monthly'] = (
monthly_electricity_cost_year_0 * price_increase_peak_electricity 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'] = ( 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, 'Fixed_costs_gas'] = fixed_gas_cost_year_0 * price_increase_gas
self._yearly_operational_costs.at[year, 'Variable_costs_gas'] = ( self._yearly_operational_costs.at[year, 'Variable_costs_gas'] = (

Binary file not shown.

Binary file not shown.