added electrical demand for lighting and appliances to the workflow
This commit is contained in:
parent
36e534452d
commit
6727ee3a35
|
@ -13,6 +13,15 @@ from helpers.monthly_values import MonthlyValues
|
||||||
from exports.energy_building_exports_factory import EnergyBuildingsExportsFactory
|
from exports.energy_building_exports_factory import EnergyBuildingsExportsFactory
|
||||||
from insel.monthly_demand_calculation import MonthlyDemandCalculation
|
from insel.monthly_demand_calculation import MonthlyDemandCalculation
|
||||||
|
|
||||||
|
_DAYS_A_MONTH = {cte.MONDAY: [5, 4, 4, 5, 4, 4, 5, 4, 4, 5, 4, 5],
|
||||||
|
cte.TUESDAY: [5, 4, 4, 4, 5, 4, 5, 4, 4, 5, 4, 4],
|
||||||
|
cte.WEDNESDAY: [5, 4, 4, 4, 5, 4, 4, 5, 4, 5, 4, 4],
|
||||||
|
cte.THURSDAY: [4, 4, 5, 4, 5, 4, 4, 5, 4, 4, 5, 4],
|
||||||
|
cte.FRIDAY: [4, 4, 5, 4, 4, 5, 4, 5, 4, 4, 5, 4],
|
||||||
|
cte.SATURDAY: [4, 4, 5, 4, 4, 5, 4, 4, 5, 4, 4, 5],
|
||||||
|
cte.SUNDAY: [4, 4, 4, 5, 4, 4, 5, 4, 5, 4, 4, 5],
|
||||||
|
cte.HOLIDAY: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}
|
||||||
|
|
||||||
|
|
||||||
class MonthlyEnergyBalance:
|
class MonthlyEnergyBalance:
|
||||||
def __init__(self, city, path, attic_heated_case, basement_heated_case, weather_format):
|
def __init__(self, city, path, attic_heated_case, basement_heated_case, weather_format):
|
||||||
|
@ -64,6 +73,9 @@ class MonthlyEnergyBalance:
|
||||||
insel = MonthlyDemandCalculation(self._city, tmp_path, self._weather_format)
|
insel = MonthlyDemandCalculation(self._city, tmp_path, self._weather_format)
|
||||||
insel.run()
|
insel.run()
|
||||||
insel.results()
|
insel.results()
|
||||||
|
|
||||||
|
self._dhw_demand()
|
||||||
|
self._electrical_demand()
|
||||||
self._print_results()
|
self._print_results()
|
||||||
|
|
||||||
def _print_results(self):
|
def _print_results(self):
|
||||||
|
@ -76,7 +88,8 @@ class MonthlyEnergyBalance:
|
||||||
print_results = heating_results
|
print_results = heating_results
|
||||||
else:
|
else:
|
||||||
print_results = pd.concat([print_results, heating_results], axis='columns')
|
print_results = pd.concat([print_results, heating_results], axis='columns')
|
||||||
print_results = pd.concat([print_results, cooling_results], axis='columns')
|
print_results = pd.concat([print_results, cooling_results, building.lighting_electrical_demand,
|
||||||
|
building.appliances_electrical_demand], axis='columns')
|
||||||
file += '\n'
|
file += '\n'
|
||||||
file += 'name: ' + building.name + '\n'
|
file += 'name: ' + building.name + '\n'
|
||||||
file += 'year of construction: ' + str(building.year_of_construction) + '\n'
|
file += 'year of construction: ' + str(building.year_of_construction) + '\n'
|
||||||
|
@ -91,3 +104,38 @@ class MonthlyEnergyBalance:
|
||||||
full_path_metadata = Path(self._path / 'metadata.csv').resolve()
|
full_path_metadata = Path(self._path / 'metadata.csv').resolve()
|
||||||
with open(full_path_metadata, 'w') as metadata_file:
|
with open(full_path_metadata, 'w') as metadata_file:
|
||||||
metadata_file.write(file)
|
metadata_file.write(file)
|
||||||
|
|
||||||
|
def _dhw_demand(self):
|
||||||
|
for building in self._city.buildings:
|
||||||
|
domestic_hot_water_demand = 0
|
||||||
|
|
||||||
|
def _electrical_demand(self):
|
||||||
|
for building in self._city.buildings:
|
||||||
|
lighting_demand = []
|
||||||
|
appliances_demand = []
|
||||||
|
thermal_zone = building.internal_zones[0].thermal_zones[0]
|
||||||
|
area = thermal_zone.total_floor_area
|
||||||
|
|
||||||
|
for month in range(0, 12):
|
||||||
|
total_lighting = 0
|
||||||
|
for schedule in thermal_zone.lighting.schedules:
|
||||||
|
total_day = 0
|
||||||
|
for value in schedule.values:
|
||||||
|
total_day += value
|
||||||
|
for day_type in schedule.day_types:
|
||||||
|
total_lighting += total_day * _DAYS_A_MONTH[day_type][month] * thermal_zone.lighting.density
|
||||||
|
lighting_demand.append(total_lighting * area)
|
||||||
|
|
||||||
|
total_appliances = 0
|
||||||
|
for schedule in thermal_zone.appliances.schedules:
|
||||||
|
total_day = 0
|
||||||
|
for value in schedule.values:
|
||||||
|
total_day += value
|
||||||
|
for day_type in schedule.day_types:
|
||||||
|
total_appliances += total_day * _DAYS_A_MONTH[day_type][month] * thermal_zone.appliances.density
|
||||||
|
appliances_demand.append(total_appliances * area)
|
||||||
|
|
||||||
|
building.lighting_electrical_demand = pd.DataFrame(lighting_demand,
|
||||||
|
columns=[f'{building.name} lighting electrical demand Wh'])
|
||||||
|
building.appliances_electrical_demand = pd.DataFrame(appliances_demand,
|
||||||
|
columns=[f'{building.name} appliances electrical demand Wh'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user