added ground values from epw file

This commit is contained in:
Pilar Monsalvete 2023-03-24 10:40:57 -04:00
parent f7df10cd50
commit 12d742ce73
3 changed files with 13 additions and 17 deletions

View File

@ -6,10 +6,7 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import helpers.constants as cte
AIR_DENSITY = 1.293 # kg/m3
AIR_HEAT_CAPACITY = 1005.2 # J/kgK
import hub.helpers.constants as cte
class LoadsCalculation:
@ -44,12 +41,12 @@ class LoadsCalculation:
@staticmethod
def _get_load_ventilation(thermal_zone, internal_temperature, ambient_temperature):
load_renovation_sensible = 0
for usage in thermal_zone.usage_zones:
load_renovation_sensible += AIR_DENSITY * AIR_HEAT_CAPACITY * usage.mechanical_air_change \
for usage in thermal_zone.usages:
load_renovation_sensible += cte.AIR_DENSITY * cte.AIR_HEAT_CAPACITY * usage.mechanical_air_change \
* thermal_zone.volume / cte.HOUR_TO_MINUTES / cte.MINUTES_TO_SECONDS \
* (internal_temperature - ambient_temperature)
load_infiltration_sensible = AIR_DENSITY * AIR_HEAT_CAPACITY * float(thermal_zone.infiltration_rate_system_off) \
load_infiltration_sensible = cte.AIR_DENSITY * cte.AIR_HEAT_CAPACITY * thermal_zone.infiltration_rate_system_off \
* thermal_zone.volume / cte.HOUR_TO_MINUTES / cte.MINUTES_TO_SECONDS \
* (internal_temperature - ambient_temperature)

View File

@ -7,7 +7,7 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
from pathlib import Path
import helpers.constants as cte
import hub.helpers.constants as cte
from loads_calculation import LoadsCalculation
@ -47,13 +47,12 @@ class PeakLoads:
def _workflow(self):
for building in self._city.buildings:
ambient_temperature = building.external_temperature[cte.HOUR][self._weather_format]
ground_temperature = 0
ground_temperature = building.ground_temperature[cte.YEAR]['2'][0]
heating_ambient_temperature = 100
cooling_ambient_temperature = -100
heating_calculation_hour = -1
cooling_calculation_hour = -1
for hour, temperature in enumerate(ambient_temperature):
ground_temperature += temperature / 8760
if temperature < heating_ambient_temperature:
heating_ambient_temperature = temperature
heating_calculation_hour = hour

View File

@ -8,12 +8,12 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
from pathlib import Path
from unittest import TestCase
import pandas as pd
import helpers.constants as cte
import hub.helpers.constants as cte
from helpers.monthly_values import MonthlyValues
from imports.geometry_factory import GeometryFactory
from imports.construction_factory import ConstructionFactory
from imports.usage_factory import UsageFactory
from imports.weather_factory import WeatherFactory
from hub.imports.geometry_factory import GeometryFactory
from hub.imports.construction_factory import ConstructionFactory
from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory
from peak_loads import PeakLoads
@ -96,7 +96,7 @@ class TestPeakLoadsWorkflow(TestCase):
weather_file = 'CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw'
weather_format = 'epw'
irradiance_format = 'sra'
construction_format = 'nrel'
usage_format = 'comnet'
construction_format = 'nrcan'
usage_format = 'nrcan'
self._enrich_city(city, weather_file, weather_format, irradiance_format, construction_format, usage_format)
PeakLoads(city, outputs_path, weather_format, irradiance_format)