added more results to the list

This commit is contained in:
Pilar Monsalvete 2023-05-29 14:58:51 -04:00
parent 1cb4050ae4
commit 1f2bd09ac7
2 changed files with 58 additions and 3 deletions

View File

@ -43,7 +43,7 @@ try:
UsageFactory(usage_format, city).enrich() UsageFactory(usage_format, city).enrich()
print('enrich usage... done') print('enrich usage... done')
for building in city.buildings: for building in city.buildings:
building.energy_systems_archetype_name = 'system 1 gas' building.energy_systems_archetype_name = 'system 1 gas pv'
EnergySystemsFactory(energy_systems_format, city).enrich() EnergySystemsFactory(energy_systems_format, city).enrich()
print('enrich systems... done') print('enrich systems... done')

View File

@ -57,12 +57,64 @@ class Results:
heating_peak_load_results = building.heating_peak_load[cte.MONTH] heating_peak_load_results = building.heating_peak_load[cte.MONTH]
else: else:
heating_peak_load_results = pd.DataFrame(array, columns=[f'{building.name} heating peak load W']) heating_peak_load_results = pd.DataFrame(array, columns=[f'{building.name} heating peak load W'])
if cte.MONTH in building.cooling_peak_load.keys(): if cte.MONTH in building.cooling_peak_load.keys():
cooling_peak_load_results = building.cooling_peak_load[cte.MONTH] cooling_peak_load_results = building.cooling_peak_load[cte.MONTH]
else: else:
cooling_peak_load_results = pd.DataFrame(array, columns=[f'{building.name} cooling peak load W']) cooling_peak_load_results = pd.DataFrame(array, columns=[f'{building.name} cooling peak load W'])
if cte.MONTH in building.onsite_electrical_production.keys():
monthly_onsite_electrical_production = building.onsite_electrical_production[cte.MONTH]
onsite_electrical_production = pd.DataFrame(monthly_onsite_electrical_production,
columns=[f'{building.name} onsite electrical production Wh'])
else:
onsite_electrical_production = pd.DataFrame(array, columns=[f'{building.name} onsite electrical production Wh'])
heating = 0
cooling = 0
for system in building.energy_systems:
for demand_type in system.demand_types:
if demand_type == cte.HEATING:
heating = 1
if demand_type == cte.COOLING:
cooling = 1
if cte.MONTH in building.heating_peak_load.keys() and cte.MONTH in building.cooling_peak_load.keys():
peak_lighting = 0
peak_appliances = 0
for thermal_zone in building.internal_zones[0].thermal_zones:
lighting = thermal_zone.lighting
for schedule in lighting.schedules:
for value in schedule.values:
if value * lighting.density * thermal_zone.total_floor_area > peak_lighting:
peak_lighting = value * lighting.density * thermal_zone.total_floor_area
appliances = thermal_zone.appliances
for schedule in appliances.schedules:
for value in schedule.values:
if value * appliances.density * thermal_zone.total_floor_area > peak_appliances:
peak_appliances = value * appliances.density * thermal_zone.total_floor_area
monthly_electricity_peak = [0.9 * peak_lighting + 0.7 * peak_appliances]*12
conditioning_peak = []
for i, value in enumerate(building.heating_peak_load[cte.MONTH]['heating peak loads']):
if cooling * building.cooling_peak_load[cte.MONTH]['cooling peak loads'][i] > heating * value:
conditioning_peak.append(cooling * building.cooling_peak_load[cte.MONTH]['cooling peak loads'][i])
else:
conditioning_peak.append(heating * value)
monthly_electricity_peak[i] += 0.8 * conditioning_peak[i]
electricity_peak_load_results = pd.DataFrame(monthly_electricity_peak
, columns=[f'{building.name} electricity peak load W'])
else:
electricity_peak_load_results = pd.DataFrame(array, columns=[f'{building.name} electricity peak load W'])
if cte.MONTH in building.distribution_systems_electrical_consumption.keys():
extra_electrical_consumption = pd.DataFrame(building.distribution_systems_electrical_consumption[cte.MONTH],
columns=[
f'{building.name} electrical consumption for distribution Wh'])
else:
extra_electrical_consumption = pd.DataFrame(array,
columns=[
f'{building.name} electrical consumption for distribution Wh'])
if print_results is None: if print_results is None:
print_results = heating_results print_results = heating_results
else: else:
@ -76,7 +128,10 @@ class Results:
cooling_consumption_results, cooling_consumption_results,
dhw_consumption_results, dhw_consumption_results,
heating_peak_load_results, heating_peak_load_results,
cooling_peak_load_results], axis='columns') cooling_peak_load_results,
electricity_peak_load_results,
onsite_electrical_production,
extra_electrical_consumption], axis='columns')
file += '\n' file += '\n'
file += f'name: {building.name}\n' file += f'name: {building.name}\n'
file += f'year of construction: {building.year_of_construction}\n' file += f'year of construction: {building.year_of_construction}\n'