Correction of problem with a factor of maintenance values.

This commit is contained in:
Oriol Gavalda 2023-08-01 16:16:41 -04:00
parent e56319ecd3
commit 7f539b1ca5
3 changed files with 25 additions and 24 deletions

View File

@ -1,10 +1,10 @@
from pathlib import Path from pathlib import Path
import numpy_financial as npf import numpy_financial as npf
import pandas as pd import pandas as pd
from printing_results import * from costs.printing_results import *
from Individualplot import * from costs.Individualplot import *
from LCC_calculation_scenarios import * from costs.LCC_calculation_scenarios import *
from life_cycle_costs import LifeCycleCosts from costs.life_cycle_costs import LifeCycleCosts
from hub.helpers import constants as cte from hub.helpers import constants as cte
from hub.helpers.dictionaries import Dictionaries from hub.helpers.dictionaries import Dictionaries
@ -126,8 +126,6 @@ def LCC_calculation_scenarios(city, catalog, retrofitting_scenario, valuepareto,
) )
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

@ -33,10 +33,10 @@ from costs import RETROFITTING_YEAR_CONSTRUCTION
from results import Results from results import Results
file_path = (Path(__file__).parent.parent / 'input_files' / 'eilat.geojson') file_path = (Path(__file__).parent.parent / 'input_files' / 'levis_v2.geojson')
weather_format = 'epw' weather_format = 'epw'
construction_format = 'eilat' construction_format = 'nrcan'
usage_format = 'eilat' usage_format = 'nrcan'
energy_systems_format = 'montreal_custom' energy_systems_format = 'montreal_custom'
out_path = (Path(__file__).parent.parent / 'out_files') out_path = (Path(__file__).parent.parent / 'out_files')
@ -46,14 +46,12 @@ tmp_folder = (Path(__file__).parent / 'tmp')
print('[simulation start]') print('[simulation start]')
city_original = GeometryFactory('geojson', city_original = GeometryFactory('geojson',
path=file_path, path=file_path,
height_field='heightmax', height_field='citygml_me',
year_of_construction_field='ANNEE_CONS', year_of_construction_field='ANNEE_CONS',
function_field='CODE_UTILI', function_field='CODE_UTILI',
function_to_hub=Dictionaries().eilat_function_to_hub_function).city function_to_hub=Dictionaries().montreal_function_to_hub_function).city
print(f'city created from {file_path}') print(f'city created from {file_path}')
WeatherFactory(weather_format, city_original).enrich()
print('enrich weather... done')
ConstructionFactory(construction_format, city_original).enrich() ConstructionFactory(construction_format, city_original).enrich()
print('enrich constructions... done') print('enrich constructions... done')
UsageFactory(usage_format, city_original).enrich() UsageFactory(usage_format, city_original).enrich()
@ -70,7 +68,7 @@ catalog = CostsCatalogFactory('montreal_custom').catalog
city = city_original.copy city = city_original.copy
total_floor_area = 0 total_floor_area = 0
retrofitting_scenario = CURRENT_STATUS retrofitting_scenario = SYSTEM_RETROFIT_AND_PV
if retrofitting_scenario == SYSTEM_RETROFIT_AND_PV: if retrofitting_scenario == SYSTEM_RETROFIT_AND_PV:
print(f'retrofitting 1') print(f'retrofitting 1')

View File

@ -156,11 +156,15 @@ class LifeCycleCosts:
capital_cost_other_hvac_ahu = peak_cooling * chapter.item('D3080_other_hvac_ahu').initial_investment[0] capital_cost_other_hvac_ahu = peak_cooling * chapter.item('D3080_other_hvac_ahu').initial_investment[0]
capital_cost_lighting = total_floor_area * chapter.item('D5020_lighting_and_branch_wiring').initial_investment[0] capital_cost_lighting = total_floor_area * chapter.item('D5020_lighting_and_branch_wiring').initial_investment[0]
self._yearly_capital_costs.loc[0, 'D3020_heat_generating_systems'] = capital_cost_heating_equipment * (1-PERCENTAGE_CREDIT) self._yearly_capital_costs.loc[0, 'D3020_heat_generating_systems'] = capital_cost_heating_equipment * \
self._yearly_capital_costs.loc[0, 'D3030_cooling_generation_systems'] = capital_cost_cooling_equipment * (1-PERCENTAGE_CREDIT) (1-PERCENTAGE_CREDIT)
self._yearly_capital_costs.loc[0, 'D3040_distribution_systems'] = capital_cost_distribution_equipment * (1-PERCENTAGE_CREDIT) self._yearly_capital_costs.loc[0, 'D3030_cooling_generation_systems'] = capital_cost_cooling_equipment * \
(1-PERCENTAGE_CREDIT)
self._yearly_capital_costs.loc[0, 'D3040_distribution_systems'] = capital_cost_distribution_equipment * \
(1-PERCENTAGE_CREDIT)
self._yearly_capital_costs.loc[0, 'D3080_other_hvac_ahu'] = capital_cost_other_hvac_ahu * (1-PERCENTAGE_CREDIT) self._yearly_capital_costs.loc[0, 'D3080_other_hvac_ahu'] = capital_cost_other_hvac_ahu * (1-PERCENTAGE_CREDIT)
self._yearly_capital_costs.loc[0, 'D5020_lighting_and_branch_wiring'] = capital_cost_lighting * (1-PERCENTAGE_CREDIT) self._yearly_capital_costs.loc[0, 'D5020_lighting_and_branch_wiring'] = capital_cost_lighting * \
(1-PERCENTAGE_CREDIT)
for year in range(1, self._number_of_years): for year in range(1, self._number_of_years):
chapter = chapters.chapter('D_services') chapter = chapters.chapter('D_services')
@ -219,7 +223,8 @@ class LifeCycleCosts:
capital_cost_heating_equipment + capital_cost_heating_equipment +
capital_cost_cooling_equipment + capital_cost_cooling_equipment +
capital_cost_distribution_equipment + capital_cost_distribution_equipment +
capital_cost_other_hvac_ahu + capital_cost_lighting capital_cost_other_hvac_ahu +
capital_cost_lighting
) )
self._yearly_capital_incomes.loc[0, 'Subsidies construction'] = ( self._yearly_capital_incomes.loc[0, 'Subsidies construction'] = (
@ -349,11 +354,11 @@ class LifeCycleCosts:
roof_area += roof.solid_polygon.area roof_area += roof.solid_polygon.area
surface_pv = roof_area * 0.5 surface_pv = roof_area * 0.5
peak_heating = building.heating_peak_load[cte.YEAR][0]/1000 peak_heating = building.heating_peak_load[cte.YEAR][0]
peak_cooling = building.heating_peak_load[cte.YEAR][0]/1000 peak_cooling = building.heating_peak_load[cte.YEAR][0]
#todo: check the values for maintenance
maintenance_heating_0 = peak_heating * archetype.operational_cost.maintenance_heating maintenance_heating_0 = peak_heating * archetype.operational_cost.maintenance_heating*0.5
maintenance_cooling_0 = peak_cooling * archetype.operational_cost.maintenance_cooling maintenance_cooling_0 = peak_cooling * archetype.operational_cost.maintenance_cooling*0.5
maintenance_pv_0 = surface_pv * archetype.operational_cost.maintenance_pv maintenance_pv_0 = surface_pv * archetype.operational_cost.maintenance_pv
for year in range(1, self._number_of_years + 1): for year in range(1, self._number_of_years + 1):