peak load per month
This commit is contained in:
parent
12d742ce73
commit
d3aef403b1
|
@ -10,6 +10,8 @@ from pathlib import Path
|
||||||
import hub.helpers.constants as cte
|
import hub.helpers.constants as cte
|
||||||
from loads_calculation import LoadsCalculation
|
from loads_calculation import LoadsCalculation
|
||||||
|
|
||||||
|
_MONTH_STARTING_HOUR = [0, 744, 1416, 2160, 2880, 3624, 4344, 5088, 5832, 6552, 7296, 8016]
|
||||||
|
|
||||||
|
|
||||||
class PeakLoads:
|
class PeakLoads:
|
||||||
def __init__(self, city, path, weather_format, irradiance_format):
|
def __init__(self, city, path, weather_format, irradiance_format):
|
||||||
|
@ -17,7 +19,7 @@ class PeakLoads:
|
||||||
self._path = path
|
self._path = path
|
||||||
self._weather_format = weather_format
|
self._weather_format = weather_format
|
||||||
self._irradiance_format = irradiance_format
|
self._irradiance_format = irradiance_format
|
||||||
self._results = []
|
self._results = {}
|
||||||
|
|
||||||
self._sanity_check()
|
self._sanity_check()
|
||||||
self._workflow()
|
self._workflow()
|
||||||
|
@ -46,36 +48,53 @@ class PeakLoads:
|
||||||
|
|
||||||
def _workflow(self):
|
def _workflow(self):
|
||||||
for building in self._city.buildings:
|
for building in self._city.buildings:
|
||||||
|
monthly_heating_loads = []
|
||||||
|
monthly_cooling_loads = []
|
||||||
ambient_temperature = building.external_temperature[cte.HOUR][self._weather_format]
|
ambient_temperature = building.external_temperature[cte.HOUR][self._weather_format]
|
||||||
ground_temperature = building.ground_temperature[cte.YEAR]['2'][0]
|
for month in range(0, 12):
|
||||||
heating_ambient_temperature = 100
|
ground_temperature = building.ground_temperature[cte.MONTH]['2'][month]
|
||||||
cooling_ambient_temperature = -100
|
heating_ambient_temperature = 100
|
||||||
heating_calculation_hour = -1
|
cooling_ambient_temperature = -100
|
||||||
cooling_calculation_hour = -1
|
heating_calculation_hour = -1
|
||||||
for hour, temperature in enumerate(ambient_temperature):
|
cooling_calculation_hour = -1
|
||||||
if temperature < heating_ambient_temperature:
|
start_hour = _MONTH_STARTING_HOUR[month]
|
||||||
heating_ambient_temperature = temperature
|
end_hour = 8760
|
||||||
heating_calculation_hour = hour
|
if month < 11:
|
||||||
if temperature > cooling_ambient_temperature:
|
end_hour = _MONTH_STARTING_HOUR[month + 1]
|
||||||
cooling_ambient_temperature = temperature
|
for hour in range(start_hour, end_hour):
|
||||||
cooling_calculation_hour = hour
|
temperature = ambient_temperature[hour]
|
||||||
|
if temperature < heating_ambient_temperature:
|
||||||
|
heating_ambient_temperature = temperature
|
||||||
|
heating_calculation_hour = hour
|
||||||
|
if temperature > cooling_ambient_temperature:
|
||||||
|
cooling_ambient_temperature = temperature
|
||||||
|
cooling_calculation_hour = hour
|
||||||
|
|
||||||
loads = LoadsCalculation(building)
|
loads = LoadsCalculation(building)
|
||||||
heating_load_transmitted = loads.get_heating_transmitted_load(heating_ambient_temperature, ground_temperature)
|
heating_load_transmitted = loads.get_heating_transmitted_load(heating_ambient_temperature, ground_temperature)
|
||||||
heating_load_ventilation_sensible = loads.get_heating_ventilation_load_sensible(heating_ambient_temperature)
|
heating_load_ventilation_sensible = loads.get_heating_ventilation_load_sensible(heating_ambient_temperature)
|
||||||
heating_load_ventilation_latent = 0
|
heating_load_ventilation_latent = 0
|
||||||
heating_load = heating_load_transmitted + heating_load_ventilation_sensible + heating_load_ventilation_latent
|
heating_load = heating_load_transmitted + heating_load_ventilation_sensible + heating_load_ventilation_latent
|
||||||
|
|
||||||
cooling_load_transmitted = loads.get_cooling_transmitted_load(cooling_ambient_temperature, ground_temperature)
|
cooling_load_transmitted = loads.get_cooling_transmitted_load(cooling_ambient_temperature, ground_temperature)
|
||||||
cooling_load_renovation_sensible = loads.get_cooling_ventilation_load_sensible(cooling_ambient_temperature)
|
cooling_load_renovation_sensible = loads.get_cooling_ventilation_load_sensible(cooling_ambient_temperature)
|
||||||
cooling_load_internal_gains_sensible = loads.get_internal_load_sensible()
|
cooling_load_internal_gains_sensible = loads.get_internal_load_sensible()
|
||||||
cooling_load_radiation = loads.get_radiation_load(self._irradiance_format, cooling_calculation_hour)
|
cooling_load_radiation = loads.get_radiation_load(self._irradiance_format, cooling_calculation_hour)
|
||||||
cooling_load_sensible = cooling_load_transmitted + cooling_load_renovation_sensible - cooling_load_radiation \
|
cooling_load_sensible = cooling_load_transmitted + cooling_load_renovation_sensible - cooling_load_radiation \
|
||||||
- cooling_load_internal_gains_sensible
|
- cooling_load_internal_gains_sensible
|
||||||
|
|
||||||
cooling_load_latent = 0
|
cooling_load_latent = 0
|
||||||
cooling_load = cooling_load_sensible + cooling_load_latent
|
cooling_load = cooling_load_sensible + cooling_load_latent
|
||||||
self._results.append([building.name, heating_load, cooling_load])
|
if heating_load < 0:
|
||||||
|
heating_load = 0
|
||||||
|
if cooling_load > 0:
|
||||||
|
cooling_load = 0
|
||||||
|
monthly_heating_loads.append(heating_load)
|
||||||
|
monthly_cooling_loads.append(cooling_load)
|
||||||
|
|
||||||
|
self._results[building.name] = {'monthly heating peak load': monthly_heating_loads,
|
||||||
|
'monthly cooling peak load': monthly_cooling_loads}
|
||||||
|
print(self._results)
|
||||||
self._print_results()
|
self._print_results()
|
||||||
|
|
||||||
def _print_results(self):
|
def _print_results(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user