Merge branch 'main' into feature/cerc_idf

This commit is contained in:
Guille Gutierrez 2024-10-03 13:16:38 +02:00
commit cd7ac9378e
4 changed files with 20 additions and 12 deletions

View File

@ -22,6 +22,7 @@ class EilatCatalog(Catalog):
""" """
Eilat catalog class Eilat catalog class
""" """
def __init__(self, path): def __init__(self, path):
_path_archetypes = Path(path / 'eilat_archetypes.json').resolve() _path_archetypes = Path(path / 'eilat_archetypes.json').resolve()
_path_constructions = (path / 'eilat_constructions.json').resolve() _path_constructions = (path / 'eilat_constructions.json').resolve()
@ -121,8 +122,10 @@ class EilatCatalog(Catalog):
construction_period = archetype['period_of_construction'] construction_period = archetype['period_of_construction']
average_storey_height = archetype['average_storey_height'] average_storey_height = archetype['average_storey_height']
extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_thermal_bridges'] extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_thermal_bridges']
infiltration_rate_for_ventilation_system_off = archetype['infiltration_rate_for_ventilation_system_off'] / cte.HOUR_TO_SECONDS infiltration_rate_for_ventilation_system_off = archetype[
infiltration_rate_for_ventilation_system_on = archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS 'infiltration_rate_for_ventilation_system_off'] / cte.HOUR_TO_SECONDS
infiltration_rate_for_ventilation_system_on = archetype[
'infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
archetype_constructions = [] archetype_constructions = []
for archetype_construction in archetype['constructions']: for archetype_construction in archetype['constructions']:
@ -160,7 +163,9 @@ class EilatCatalog(Catalog):
extra_loses_due_to_thermal_bridges, extra_loses_due_to_thermal_bridges,
None, None,
infiltration_rate_for_ventilation_system_off, infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on)) infiltration_rate_for_ventilation_system_on,
0,
0))
return _catalog_archetypes return _catalog_archetypes
def names(self, category=None): def names(self, category=None):

View File

@ -162,7 +162,9 @@ class NrelCatalog(Catalog):
extra_loses_due_to_thermal_bridges, extra_loses_due_to_thermal_bridges,
indirect_heated_ratio, indirect_heated_ratio,
infiltration_rate_for_ventilation_system_off, infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on)) infiltration_rate_for_ventilation_system_on,
0,
0))
return _catalog_archetypes return _catalog_archetypes
def names(self, category=None): def names(self, category=None):

View File

@ -61,7 +61,7 @@ class EnergyBuildingsExportsFactory:
with open(self._weather_file, 'wb') as epw_file: with open(self._weather_file, 'wb') as epw_file:
epw_file.write(requests.get(url, allow_redirects=True).content) epw_file.write(requests.get(url, allow_redirects=True).content)
return Idf(self._city, self._path, (idf_data_path / 'Minimal.idf'), (idf_data_path / 'Energy+.idd'), return Idf(self._city, self._path, (idf_data_path / 'Minimal.idf'), (idf_data_path / 'Energy+.idd'),
self._weather_path, target_buildings=self._target_buildings) self._weather_file, target_buildings=self._target_buildings)
@property @property
def _cerc_idf(self): def _cerc_idf(self):

View File

@ -24,7 +24,7 @@ class EnergyPlusMultipleBuildings:
csv_output = list(csv.DictReader(csv_file)) csv_output = list(csv.DictReader(csv_file))
for building in self._city.buildings: for building in self._city.buildings:
building_name = building.name building_name = building.name.upper()
buildings_energy_demands[f'Building {building_name} Heating Demand (J)'] = [ buildings_energy_demands[f'Building {building_name} Heating Demand (J)'] = [
float( float(
row[f"{building_name} IDEAL LOADS AIR SYSTEM:Zone Ideal Loads Supply Air Total Heating Energy [J](Hourly)"]) row[f"{building_name} IDEAL LOADS AIR SYSTEM:Zone Ideal Loads Supply Air Total Heating Energy [J](Hourly)"])
@ -36,7 +36,7 @@ class EnergyPlusMultipleBuildings:
for row in csv_output for row in csv_output
] ]
buildings_energy_demands[f'Building {building_name} DHW Demand (W)'] = [ buildings_energy_demands[f'Building {building_name} DHW Demand (W)'] = [
float(row[f"DHW {building.name}:Water Use Equipment Heating Rate [W](Hourly)"]) float(row[f"DHW {building_name}:Water Use Equipment Heating Rate [W](Hourly)"])
for row in csv_output for row in csv_output
] ]
buildings_energy_demands[f'Building {building_name} Appliances (W)'] = [ buildings_energy_demands[f'Building {building_name} Appliances (W)'] = [
@ -58,14 +58,15 @@ class EnergyPlusMultipleBuildings:
if energy_plus_output_file_path.is_file(): if energy_plus_output_file_path.is_file():
building_energy_demands = self._building_energy_demands(energy_plus_output_file_path) building_energy_demands = self._building_energy_demands(energy_plus_output_file_path)
for building in self._city.buildings: for building in self._city.buildings:
building.heating_demand[cte.HOUR] = building_energy_demands[f'Building {building.name} Heating Demand (J)'] building_name = building.name.upper()
building.cooling_demand[cte.HOUR] = building_energy_demands[f'Building {building.name} Cooling Demand (J)'] building.heating_demand[cte.HOUR] = building_energy_demands[f'Building {building_name} Heating Demand (J)']
building.cooling_demand[cte.HOUR] = building_energy_demands[f'Building {building_name} Cooling Demand (J)']
building.domestic_hot_water_heat_demand[cte.HOUR] = \ building.domestic_hot_water_heat_demand[cte.HOUR] = \
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} DHW Demand (W)']] [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} DHW Demand (W)']]
building.appliances_electrical_demand[cte.HOUR] = \ building.appliances_electrical_demand[cte.HOUR] = \
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} Appliances (W)']] [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} Appliances (W)']]
building.lighting_electrical_demand[cte.HOUR] = \ building.lighting_electrical_demand[cte.HOUR] = \
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} Lighting (W)']] [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} Lighting (W)']]
building.heating_demand[cte.MONTH] = MonthlyValues.get_total_month(building.heating_demand[cte.HOUR]) building.heating_demand[cte.MONTH] = MonthlyValues.get_total_month(building.heating_demand[cte.HOUR])
building.cooling_demand[cte.MONTH] = MonthlyValues.get_total_month(building.cooling_demand[cte.HOUR]) building.cooling_demand[cte.MONTH] = MonthlyValues.get_total_month(building.cooling_demand[cte.HOUR])
building.domestic_hot_water_heat_demand[cte.MONTH] = ( building.domestic_hot_water_heat_demand[cte.MONTH] = (