From d8c0644709b95111a50ff22a2518ea5811fe4ce4 Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Tue, 8 Aug 2023 15:40:39 -0400 Subject: [PATCH] checked units --- costs/total_operational_costs.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/costs/total_operational_costs.py b/costs/total_operational_costs.py index 6fca214..4623ed5 100644 --- a/costs/total_operational_costs.py +++ b/costs/total_operational_costs.py @@ -20,6 +20,7 @@ class TotalOperationalCosts(CostBase): """ End of life costs class """ + def __init__(self, building: Building, configuration: Configuration): super().__init__(building, configuration) self._yearly_operational_costs = pd.DataFrame( @@ -48,11 +49,12 @@ class TotalOperationalCosts(CostBase): variable_gas_cost_year_0 = 0 electricity_heating = 0 domestic_hot_water_electricity = 0 + # todo: each fuel has different units that have to be processed if self._configuration.fuel_type == 1: fixed_gas_cost_year_0 = archetype.operational_cost.fuels[1].fixed_monthly * 12 * factor_residential variable_gas_cost_year_0 = ( - (building.heating_consumption[cte.YEAR][0] + building.domestic_hot_water_consumption[cte.YEAR][0]) / 1000 * - archetype.operational_cost.fuels[1].variable[0] + (building.heating_consumption[cte.YEAR][0] + building.domestic_hot_water_consumption[cte.YEAR][0]) + / 1000 * cte.WATTS_HOUR_TO_JULES * archetype.operational_cost.fuels[1].variable[0] ) if self._configuration.fuel_type == 0: electricity_heating = building.heating_consumption[cte.YEAR][0] / 1000 @@ -70,8 +72,9 @@ class TotalOperationalCosts(CostBase): # todo: change when peak electricity demand is coded. Careful with factor residential peak_electricity_load = PeakLoad(building).electricity_peak_load peak_load_value = peak_electricity_load.max(axis=1) - peak_electricity_demand = peak_load_value[1]/1000 # self._peak_electricity_demand adapted to kW - variable_electricity_cost_year_0 = total_electricity_consumption * archetype.operational_cost.fuels[0].variable[0] + peak_electricity_demand = peak_load_value[1] / 1000 # self._peak_electricity_demand adapted to kW + variable_electricity_cost_year_0 = \ + total_electricity_consumption * cte.WATTS_HOUR_TO_JULES * archetype.operational_cost.fuels[0].variable[0] peak_electricity_cost_year_0 = peak_electricity_demand * archetype.operational_cost.fuels[0].fixed_power * 12 monthly_electricity_cost_year_0 = archetype.operational_cost.fuels[0].fixed_monthly * 12 * factor_residential