Compare commits
29 Commits
63d1e8af2d
...
df2d7a3054
Author | SHA1 | Date | |
---|---|---|---|
df2d7a3054 | |||
47810737fa | |||
99535a979c | |||
9986552ec1 | |||
d1719b50ed | |||
5e01f4eb7f | |||
d38150ac2d | |||
5e5129ecd7 | |||
3905f228dc | |||
33049441f0 | |||
70dd9f7c6a | |||
0ce392ea06 | |||
|
4b6a942324 | ||
2495046c44 | |||
4738de0d8c | |||
e220bf2c0d | |||
a45cf02b28 | |||
ef62e2531f | |||
|
cd34435a9f | ||
|
15b96fe154 | ||
|
54a6e6b2db | ||
|
a7375f0b53 | ||
|
725746fbcb | ||
ec320a2e1c | |||
8a68118503 | |||
a3ec3c7e19 | |||
|
ace666553a | ||
c4636c2c3c | |||
4a01ac51d8 |
|
@ -22,6 +22,7 @@ class EilatCatalog(Catalog):
|
|||
"""
|
||||
Eilat catalog class
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
_path_archetypes = Path(path / 'eilat_archetypes.json').resolve()
|
||||
_path_constructions = (path / 'eilat_constructions.json').resolve()
|
||||
|
@ -121,8 +122,10 @@ class EilatCatalog(Catalog):
|
|||
construction_period = archetype['period_of_construction']
|
||||
average_storey_height = archetype['average_storey_height']
|
||||
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_on = archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
|
||||
infiltration_rate_for_ventilation_system_off = archetype[
|
||||
'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 = []
|
||||
for archetype_construction in archetype['constructions']:
|
||||
|
@ -160,7 +163,9 @@ class EilatCatalog(Catalog):
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
None,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on))
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
0,
|
||||
0))
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
|
|
|
@ -128,6 +128,12 @@ class NrcanCatalog(Catalog):
|
|||
infiltration_rate_for_ventilation_system_on = (
|
||||
archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
|
||||
)
|
||||
infiltration_rate_area_for_ventilation_system_off = (
|
||||
archetype['infiltration_rate_area_for_ventilation_system_off'] * 1
|
||||
)
|
||||
infiltration_rate_area_for_ventilation_system_on = (
|
||||
archetype['infiltration_rate_area_for_ventilation_system_on'] * 1
|
||||
)
|
||||
|
||||
archetype_constructions = []
|
||||
for archetype_construction in archetype['constructions']:
|
||||
|
@ -153,7 +159,6 @@ class NrcanCatalog(Catalog):
|
|||
_window)
|
||||
archetype_constructions.append(_construction)
|
||||
break
|
||||
|
||||
_catalog_archetypes.append(Archetype(archetype_id,
|
||||
name,
|
||||
function,
|
||||
|
@ -165,7 +170,10 @@ class NrcanCatalog(Catalog):
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
None,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on))
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
infiltration_rate_area_for_ventilation_system_off,
|
||||
infiltration_rate_area_for_ventilation_system_on
|
||||
))
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
|
|
|
@ -162,7 +162,9 @@ class NrelCatalog(Catalog):
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
indirect_heated_ratio,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on))
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
0,
|
||||
0))
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
|
|
|
@ -23,7 +23,10 @@ class Archetype:
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
indirect_heated_ratio,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on):
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
infiltration_rate_area_for_ventilation_system_off,
|
||||
infiltration_rate_area_for_ventilation_system_on
|
||||
):
|
||||
self._id = archetype_id
|
||||
self._name = name
|
||||
self._function = function
|
||||
|
@ -36,6 +39,8 @@ class Archetype:
|
|||
self._indirect_heated_ratio = indirect_heated_ratio
|
||||
self._infiltration_rate_for_ventilation_system_off = infiltration_rate_for_ventilation_system_off
|
||||
self._infiltration_rate_for_ventilation_system_on = infiltration_rate_for_ventilation_system_on
|
||||
self._infiltration_rate_area_for_ventilation_system_off = infiltration_rate_area_for_ventilation_system_off
|
||||
self._infiltration_rate_area_for_ventilation_system_on = infiltration_rate_area_for_ventilation_system_on
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
|
@ -133,6 +138,22 @@ class Archetype:
|
|||
"""
|
||||
return self._infiltration_rate_for_ventilation_system_on
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_off(self):
|
||||
"""
|
||||
Get archetype infiltration rate for ventilation system off in m3/sm2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_area_for_ventilation_system_off
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_on(self):
|
||||
"""
|
||||
Get archetype infiltration rate for ventilation system on in m3/sm2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_for_ventilation_system_on
|
||||
|
||||
def to_dictionary(self):
|
||||
"""Class content to dictionary"""
|
||||
_constructions = []
|
||||
|
@ -149,6 +170,8 @@ class Archetype:
|
|||
'indirect heated ratio': self.indirect_heated_ratio,
|
||||
'infiltration rate for ventilation off [1/s]': self.infiltration_rate_for_ventilation_system_off,
|
||||
'infiltration rate for ventilation on [1/s]': self.infiltration_rate_for_ventilation_system_on,
|
||||
'infiltration rate area for ventilation off [m3/sm2]': self.infiltration_rate_area_for_ventilation_system_off,
|
||||
'infiltration rate area for ventilation on [m3/sm2]': self.infiltration_rate_area_for_ventilation_system_on,
|
||||
'constructions': _constructions
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ class Surface:
|
|||
@property
|
||||
def global_irradiance(self) -> dict:
|
||||
"""
|
||||
Get global irradiance on surface in J/m2
|
||||
Get global irradiance on surface in W/m2
|
||||
:return: dict
|
||||
"""
|
||||
return self._global_irradiance
|
||||
|
@ -188,7 +188,7 @@ class Surface:
|
|||
@global_irradiance.setter
|
||||
def global_irradiance(self, value):
|
||||
"""
|
||||
Set global irradiance on surface in J/m2
|
||||
Set global irradiance on surface in W/m2
|
||||
:param value: dict
|
||||
"""
|
||||
self._global_irradiance = value
|
||||
|
@ -390,7 +390,7 @@ class Surface:
|
|||
@property
|
||||
def global_irradiance_tilted(self) -> dict:
|
||||
"""
|
||||
Get global irradiance on a tilted surface in J/m2
|
||||
Get global irradiance on a tilted surface in W/m2
|
||||
:return: dict
|
||||
"""
|
||||
return self._global_irradiance_tilted
|
||||
|
@ -398,7 +398,7 @@ class Surface:
|
|||
@global_irradiance_tilted.setter
|
||||
def global_irradiance_tilted(self, value):
|
||||
"""
|
||||
Set global irradiance on a tilted surface in J/m2
|
||||
Set global irradiance on a tilted surface in W/m2
|
||||
:param value: dict
|
||||
"""
|
||||
self._global_irradiance_tilted = value
|
||||
|
|
|
@ -20,6 +20,8 @@ class ThermalArchetype:
|
|||
self._indirect_heated_ratio = None
|
||||
self._infiltration_rate_for_ventilation_system_off = None
|
||||
self._infiltration_rate_for_ventilation_system_on = None
|
||||
self._infiltration_rate_area_for_ventilation_system_off=None
|
||||
self._infiltration_rate_area_for_ventilation_system_on=None
|
||||
|
||||
@property
|
||||
def constructions(self) -> [Construction]:
|
||||
|
@ -132,3 +134,35 @@ class ThermalArchetype:
|
|||
:param value: float
|
||||
"""
|
||||
self._infiltration_rate_for_ventilation_system_on = value
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_off(self):
|
||||
"""
|
||||
Get infiltration rate for ventilation system off in l/s/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_for_ventilation_system_off
|
||||
|
||||
@infiltration_rate_area_for_ventilation_system_off.setter
|
||||
def infiltration_rate_area_for_ventilation_system_off(self, value):
|
||||
"""
|
||||
Set infiltration rate for ventilation system off in l/s/m2
|
||||
:param value: float
|
||||
"""
|
||||
self._infiltration_rate_for_ventilation_system_off = value
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_on(self):
|
||||
"""
|
||||
Get infiltration rate for ventilation system on in l/s/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_for_ventilation_system_on
|
||||
|
||||
@infiltration_rate_area_for_ventilation_system_on.setter
|
||||
def infiltration_rate_area_for_ventilation_system_on(self, value):
|
||||
"""
|
||||
Set infiltration rate for ventilation system on in l/s/m2
|
||||
:param value: float
|
||||
"""
|
||||
self._infiltration_rate_for_ventilation_system_on = value
|
||||
|
|
|
@ -44,6 +44,8 @@ class ThermalZone:
|
|||
self._indirectly_heated_area_ratio = None
|
||||
self._infiltration_rate_system_on = None
|
||||
self._infiltration_rate_system_off = None
|
||||
self._infiltration_rate_area_system_on = None
|
||||
self._infiltration_rate_area_system_off = None
|
||||
self._volume = volume
|
||||
self._ordinate_number = None
|
||||
self._view_factors_matrix = None
|
||||
|
@ -166,6 +168,24 @@ class ThermalZone:
|
|||
self._infiltration_rate_system_off = self._parent_internal_zone.thermal_archetype.infiltration_rate_for_ventilation_system_off
|
||||
return self._infiltration_rate_system_off
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_system_on(self):
|
||||
"""
|
||||
Get thermal zone infiltration rate system on in air changes per second (1/s)
|
||||
:return: None or float
|
||||
"""
|
||||
self._infiltration_rate_area_system_on = self._parent_internal_zone.thermal_archetype.infiltration_rate_area_for_ventilation_system_on
|
||||
return self._infiltration_rate_area_system_on
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_system_off(self):
|
||||
"""
|
||||
Get thermal zone infiltration rate system off in air changes per second (1/s)
|
||||
:return: None or float
|
||||
"""
|
||||
self._infiltration_rate_area_system_off = self._parent_internal_zone.thermal_archetype.infiltration_rate_area_for_ventilation_system_off
|
||||
return self._infiltration_rate_area_system_off
|
||||
|
||||
@property
|
||||
def volume(self):
|
||||
"""
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,6 +7,9 @@ Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concord
|
|||
Oriol Gavalda Torrellas oriol.gavalda@concordia.ca
|
||||
"""
|
||||
import copy
|
||||
import datetime
|
||||
import glob
|
||||
import os
|
||||
from pathlib import Path
|
||||
from geomeppy import IDF
|
||||
import hub.helpers.constants as cte
|
||||
|
@ -275,11 +278,12 @@ class Idf:
|
|||
_kwargs[f'Field_{counter + 2}'] = 'Until: 24:00,0.0'
|
||||
self._idf.newidfobject(self._COMPACT_SCHEDULE, **_kwargs)
|
||||
|
||||
def _write_schedules_file(self, usage, schedule):
|
||||
file_name = str((Path(self._output_path) / f'{schedule.type} schedules {usage}.csv').resolve())
|
||||
with open(file_name, 'w', encoding='utf8') as file:
|
||||
for value in schedule.values:
|
||||
file.write(f'{str(value)},\n')
|
||||
def _write_schedules_file(self, schedule, usage):
|
||||
file_name = str((Path(self._output_path) / f'{schedule.type} schedules {usage.replace("/","_")}.csv').resolve())
|
||||
if not Path(file_name).exists():
|
||||
with open(file_name, 'w', encoding='utf8') as file:
|
||||
for value in schedule.values:
|
||||
file.write(f'{str(value)},\n')
|
||||
return Path(file_name).name
|
||||
|
||||
def _add_file_schedule(self, usage, schedule, file_name):
|
||||
|
@ -304,7 +308,7 @@ class Idf:
|
|||
for schedule in self._idf.idfobjects[self._FILE_SCHEDULE]:
|
||||
if schedule.Name == f'{schedule_type} schedules {usage}':
|
||||
return
|
||||
file_name = self._write_schedules_file(usage, new_schedules[0])
|
||||
file_name = self._write_schedules_file(new_schedules[0], usage)
|
||||
self._add_file_schedule(usage, new_schedules[0], file_name)
|
||||
return
|
||||
|
||||
|
@ -327,6 +331,7 @@ class Idf:
|
|||
for material in self._idf.idfobjects[self._MATERIAL]:
|
||||
if material.Name == "DefaultMaterial":
|
||||
return
|
||||
|
||||
self._idf.set_default_constructions()
|
||||
return
|
||||
for layer in thermal_boundary.layers:
|
||||
|
@ -388,9 +393,9 @@ class Idf:
|
|||
thermostat = self._add_thermostat(thermal_zone)
|
||||
self._idf.newidfobject(self._IDEAL_LOAD_AIR_SYSTEM,
|
||||
Zone_Name=zone_name,
|
||||
System_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage_name}',
|
||||
Heating_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage_name}',
|
||||
Cooling_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage_name}',
|
||||
System_Availability_Schedule_Name=f'Thermostat_availability schedules {thermal_zone.usage_name}',
|
||||
Heating_Availability_Schedule_Name=f'Thermostat_availability schedules {thermal_zone.usage_name}',
|
||||
Cooling_Availability_Schedule_Name=f'Thermostat_availability schedules {thermal_zone.usage_name}',
|
||||
Template_Thermostat_Name=thermostat.Name)
|
||||
|
||||
def _add_occupancy(self, thermal_zone, zone_name):
|
||||
|
@ -450,7 +455,7 @@ class Idf:
|
|||
)
|
||||
|
||||
def _add_infiltration(self, thermal_zone, zone_name):
|
||||
schedule = f'Infiltration schedules {thermal_zone.usage_name}'
|
||||
schedule = f'INF_CONST schedules {thermal_zone.usage_name}'
|
||||
_infiltration = thermal_zone.infiltration_rate_system_off * cte.HOUR_TO_SECONDS
|
||||
self._idf.newidfobject(self._INFILTRATION,
|
||||
Name=f'{zone_name}_infiltration',
|
||||
|
@ -460,6 +465,17 @@ class Idf:
|
|||
Air_Changes_per_Hour=_infiltration
|
||||
)
|
||||
|
||||
def _add_infiltration_surface(self, thermal_zone, zone_name):
|
||||
schedule = f'INF_CONST schedules {thermal_zone.usage_name}'
|
||||
_infiltration = thermal_zone.infiltration_rate_area_system_off*1
|
||||
self._idf.newidfobject(self._INFILTRATION,
|
||||
Name=f'{zone_name}_infiltration',
|
||||
Zone_or_ZoneList_or_Space_or_SpaceList_Name=zone_name,
|
||||
Schedule_Name=schedule,
|
||||
Design_Flow_Rate_Calculation_Method='Flow/ExteriorWallArea',
|
||||
Flow_Rate_per_Exterior_Surface_Area=_infiltration
|
||||
)
|
||||
|
||||
def _add_ventilation(self, thermal_zone, zone_name):
|
||||
schedule = f'Ventilation schedules {thermal_zone.usage_name}'
|
||||
_air_change = thermal_zone.mechanical_air_change * cte.HOUR_TO_SECONDS
|
||||
|
@ -471,7 +487,7 @@ class Idf:
|
|||
Air_Changes_per_Hour=_air_change
|
||||
)
|
||||
|
||||
def _add_dhw(self, thermal_zone, zone_name):
|
||||
def _add_dhw(self, thermal_zone, zone_name, usage):
|
||||
peak_flow_rate = thermal_zone.domestic_hot_water.peak_flow * thermal_zone.total_floor_area
|
||||
self._idf.newidfobject(self._DHW,
|
||||
Name=f'DHW {zone_name}',
|
||||
|
@ -479,7 +495,7 @@ class Idf:
|
|||
Flow_Rate_Fraction_Schedule_Name=f'DHW_prof schedules {thermal_zone.usage_name}',
|
||||
Target_Temperature_Schedule_Name=f'DHW_temp schedules {thermal_zone.usage_name}',
|
||||
Hot_Water_Supply_Temperature_Schedule_Name=f'DHW_temp schedules {thermal_zone.usage_name}',
|
||||
Cold_Water_Supply_Temperature_Schedule_Name=f'cold_temp schedules {zone_name}',
|
||||
Cold_Water_Supply_Temperature_Schedule_Name=f'cold_temp schedules {usage}',
|
||||
EndUse_Subcategory=f'DHW {zone_name}',
|
||||
Zone_Name=zone_name
|
||||
)
|
||||
|
@ -513,19 +529,25 @@ class Idf:
|
|||
self._rename_building(self._city.name)
|
||||
self._lod = self._city.level_of_detail.geometry
|
||||
for building in self._city.buildings:
|
||||
is_target = building.name in self._target_buildings or building.name in self._adjacent_buildings
|
||||
for internal_zone in building.internal_zones:
|
||||
if internal_zone.thermal_zones_from_internal_zones is None:
|
||||
self._target_buildings.remove(building.name)
|
||||
self._target_buildings.remoidf_surface_typeve(building.name)
|
||||
is_target = False
|
||||
continue
|
||||
for thermal_zone in internal_zone.thermal_zones_from_internal_zones:
|
||||
|
||||
for thermal_boundary in thermal_zone.thermal_boundaries:
|
||||
self._add_construction(thermal_boundary)
|
||||
if thermal_boundary.parent_surface.vegetation is not None:
|
||||
self._add_vegetation_material(thermal_boundary.parent_surface.vegetation)
|
||||
for thermal_opening in thermal_boundary.thermal_openings:
|
||||
self._add_window_construction_and_material(thermal_opening)
|
||||
usage = thermal_zone.usage_name
|
||||
if building.name in self._target_buildings or building.name in self._adjacent_buildings:
|
||||
|
||||
if is_target:
|
||||
start = datetime.datetime.now()
|
||||
service_temperature = thermal_zone.domestic_hot_water.service_temperature
|
||||
usage = thermal_zone.usage_name
|
||||
_new_schedules = self._create_infiltration_schedules(thermal_zone)
|
||||
self._add_schedules(usage, 'Infiltration', _new_schedules)
|
||||
_new_schedules = self._create_ventilation_schedules(thermal_zone)
|
||||
|
@ -537,12 +559,14 @@ class Idf:
|
|||
self._add_schedules(usage, 'Lighting', thermal_zone.lighting.schedules)
|
||||
self._add_schedules(usage, 'Appliance', thermal_zone.appliances.schedules)
|
||||
self._add_schedules(usage, 'DHW_prof', thermal_zone.domestic_hot_water.schedules)
|
||||
_new_schedules = self._create_yearly_values_schedules('cold_temp',
|
||||
building.cold_water_temperature[cte.HOUR])
|
||||
self._add_schedules(building.name, 'cold_temp', _new_schedules)
|
||||
value = thermal_zone.domestic_hot_water.service_temperature
|
||||
_new_schedules = self._create_constant_value_schedules('DHW_temp', value)
|
||||
_new_schedules = self._create_yearly_values_schedules('cold_temp', building.cold_water_temperature[cte.HOUR])
|
||||
self._add_schedules(usage, 'cold_temp', _new_schedules)
|
||||
_new_schedules = self._create_constant_value_schedules('DHW_temp', service_temperature)
|
||||
self._add_schedules(usage, 'DHW_temp', _new_schedules)
|
||||
_new_schedules = self._create_constant_value_schedules('INF_CONST', 1)
|
||||
self._add_schedules(usage, 'INF_CONST', _new_schedules)
|
||||
_new_schedules = self._create_constant_value_schedules('Thermostat_availability', 1)
|
||||
self._add_schedules(usage, 'Thermostat_availability', _new_schedules)
|
||||
_occ = thermal_zone.occupancy
|
||||
if _occ.occupancy_density == 0:
|
||||
_total_heat = 0
|
||||
|
@ -553,16 +577,18 @@ class Idf:
|
|||
self._add_schedules(usage, 'Activity Level', _new_schedules)
|
||||
self._add_zone(thermal_zone, building.name)
|
||||
self._add_heating_system(thermal_zone, building.name)
|
||||
self._add_infiltration(thermal_zone, building.name)
|
||||
self._add_infiltration_surface(thermal_zone, building.name)
|
||||
self._add_ventilation(thermal_zone, building.name)
|
||||
self._add_occupancy(thermal_zone, building.name)
|
||||
self._add_lighting(thermal_zone, building.name)
|
||||
self._add_appliances(thermal_zone, building.name)
|
||||
self._add_dhw(thermal_zone, building.name)
|
||||
self._add_dhw(thermal_zone, building.name, usage)
|
||||
if self._export_type == "Surfaces":
|
||||
if building.name in self._target_buildings or building.name in self._adjacent_buildings:
|
||||
if is_target:
|
||||
if building.thermal_zones_from_internal_zones is not None:
|
||||
start = datetime.datetime.now()
|
||||
self._add_surfaces(building, building.name)
|
||||
print(f'add surfaces {datetime.datetime.now() - start}')
|
||||
else:
|
||||
self._add_pure_geometry(building, building.name)
|
||||
else:
|
||||
|
@ -600,6 +626,18 @@ class Idf:
|
|||
Reporting_Frequency="Hourly",
|
||||
)
|
||||
|
||||
self._idf.newidfobject(
|
||||
"OUTPUT:VARIABLE",
|
||||
Variable_Name="Zone Air Temperature",
|
||||
Reporting_Frequency="Hourly",
|
||||
)
|
||||
|
||||
self._idf.newidfobject(
|
||||
"OUTPUT:VARIABLE",
|
||||
Variable_Name="Zone Air Relative Humidity",
|
||||
Reporting_Frequency="Hourly",
|
||||
)
|
||||
|
||||
# post-process to erase windows associated to adiabatic walls
|
||||
windows_list = []
|
||||
for window in self._idf.idfobjects[self._WINDOW]:
|
||||
|
|
|
@ -20,9 +20,10 @@ class EnergyBuildingsExportsFactory:
|
|||
"""
|
||||
Energy Buildings exports factory class
|
||||
"""
|
||||
def __init__(self, handler, city, path, custom_insel_block='d18599', target_buildings=None):
|
||||
def __init__(self, handler, city, path, custom_insel_block='d18599', target_buildings=None, weather_file=None):
|
||||
self._city = city
|
||||
self._export_type = '_' + handler.lower()
|
||||
self._weather_file = weather_file
|
||||
validate_import_export_type(EnergyBuildingsExportsFactory, handler)
|
||||
if isinstance(path, str):
|
||||
path = Path(path)
|
||||
|
@ -53,12 +54,13 @@ class EnergyBuildingsExportsFactory:
|
|||
"""
|
||||
idf_data_path = (Path(__file__).parent / './building_energy/idf_files/').resolve()
|
||||
url = wh().epw_file(self._city.region_code)
|
||||
weather_path = (Path(__file__).parent.parent / f'data/weather/epw/{url.rsplit("/", 1)[1]}').resolve()
|
||||
if not weather_path.exists():
|
||||
with open(weather_path, 'wb') as epw_file:
|
||||
if self._weather_file is None:
|
||||
self._weather_file = (Path(__file__).parent.parent / f'data/weather/epw/{url.rsplit("/", 1)[1]}').resolve()
|
||||
if not self._weather_file.exists():
|
||||
with open(self._weather_file, 'wb') as epw_file:
|
||||
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'), weather_path,
|
||||
target_buildings=self._target_buildings)
|
||||
return Idf(self._city, self._path, (idf_data_path / 'Minimal.idf'), (idf_data_path / 'Energy+.idd'),
|
||||
self._weather_file, target_buildings=self._target_buildings)
|
||||
|
||||
@property
|
||||
def _insel_monthly_energy_balance(self):
|
||||
|
|
|
@ -25,6 +25,7 @@ KILO_WATTS_HOUR_TO_JULES = 3600000
|
|||
WATTS_HOUR_TO_JULES = 3600
|
||||
GALLONS_TO_QUBIC_METERS = 0.0037854117954011185
|
||||
|
||||
|
||||
# time
|
||||
SECOND = 'second'
|
||||
MINUTE = 'minute'
|
||||
|
|
|
@ -79,6 +79,8 @@ class NrcanPhysicsParameters:
|
|||
thermal_archetype.indirect_heated_ratio = 0
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_on = catalog_archetype.infiltration_rate_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_off = catalog_archetype.infiltration_rate_for_ventilation_system_off
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_on = catalog_archetype.infiltration_rate_area_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_off = catalog_archetype.infiltration_rate_area_for_ventilation_system_off
|
||||
_constructions = []
|
||||
for catalog_construction in catalog_archetype.constructions:
|
||||
construction = Construction()
|
||||
|
|
|
@ -24,7 +24,7 @@ class EnergyPlusMultipleBuildings:
|
|||
csv_output = list(csv.DictReader(csv_file))
|
||||
|
||||
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)'] = [
|
||||
float(
|
||||
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
|
||||
]
|
||||
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
|
||||
]
|
||||
buildings_energy_demands[f'Building {building_name} Appliances (W)'] = [
|
||||
|
@ -58,14 +58,15 @@ class EnergyPlusMultipleBuildings:
|
|||
if energy_plus_output_file_path.is_file():
|
||||
building_energy_demands = self._building_energy_demands(energy_plus_output_file_path)
|
||||
for building in self._city.buildings:
|
||||
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_name = building.name.upper()
|
||||
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] = \
|
||||
[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] = \
|
||||
[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] = \
|
||||
[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.cooling_demand[cte.MONTH] = MonthlyValues.get_total_month(building.cooling_demand[cte.HOUR])
|
||||
building.domestic_hot_water_heat_demand[cte.MONTH] = (
|
||||
|
|
|
@ -34,7 +34,7 @@ class SimplifiedRadiosityAlgorithm:
|
|||
for key in self._results:
|
||||
_irradiance = {}
|
||||
header_name = key.split(':')
|
||||
result = [x * cte.WATTS_HOUR_TO_JULES for x in self._results[key]]
|
||||
result = [x for x in self._results[key]]
|
||||
city_object_name = header_name[1]
|
||||
building = self._city.city_object(city_object_name)
|
||||
surface_id = header_name[2]
|
||||
|
|
0
hub/imports/weather/EPWCLEANER
Normal file
0
hub/imports/weather/EPWCLEANER
Normal file
|
@ -1,4 +1,4 @@
|
|||
"""
|
||||
Hub version number
|
||||
"""
|
||||
__version__ = '0.2.0.8'
|
||||
__version__ = '0.2.0.10'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
xmltodict
|
||||
numpy
|
||||
numpy==1.26.4
|
||||
trimesh[all]
|
||||
pyproj
|
||||
pandas
|
||||
|
@ -24,4 +24,5 @@ triangle
|
|||
psycopg2-binary
|
||||
Pillow
|
||||
pathlib
|
||||
sqlalchemy_utils
|
||||
sqlalchemy_utils
|
||||
build
|
142
texttest
142
texttest
|
@ -1,142 +0,0 @@
|
|||
ZoneControl:Thermostat,
|
||||
Room_180_7ad8616b Thermostat, !- Name
|
||||
Room_180_7ad8616b, !- Zone or ZoneList Name
|
||||
Room_180_7ad8616b Thermostat Schedule, !- Control Type Schedule Name
|
||||
ThermostatSetpoint:DualSetpoint, !- Control 1 Object Type
|
||||
LargeOffice Building_Setpoint 26, !- Control 1 Name
|
||||
, !- Control 2 Object Type
|
||||
, !- Control 2 Name
|
||||
, !- Control 3 Object Type
|
||||
, !- Control 3 Name
|
||||
, !- Control 4 Object Type
|
||||
, !- Control 4 Name
|
||||
0; !- Temperature Difference Between Cutout And Setpoint {deltaC}
|
||||
|
||||
Schedule:Compact,
|
||||
Room_180_7ad8616b Thermostat Schedule, !- Name
|
||||
Room_180_7ad8616b Thermostat Schedule Type Limits, !- Schedule Type Limits Name
|
||||
Through: 12/31, !- Field 1
|
||||
For: AllDays, !- Field 2
|
||||
Until: 24:00, !- Field 3
|
||||
4; !- Field 4
|
||||
|
||||
ScheduleTypeLimits,
|
||||
Room_180_7ad8616b Thermostat Schedule Type Limits, !- Name
|
||||
0, !- Lower Limit Value {BasedOnField A3}
|
||||
4, !- Upper Limit Value {BasedOnField A3}
|
||||
DISCRETE; !- Numeric Type
|
||||
|
||||
ThermostatSetpoint:DualSetpoint,
|
||||
LargeOffice Building_Setpoint 26, !- Name
|
||||
LargeOffice Building_Setpoint_HtgSetp Schedule, !- Heating Setpoint Temperature Schedule Name
|
||||
LargeOffice Building_Setpoint_ClgSetp Schedule; !- Cooling Setpoint Temperature Schedule Name
|
||||
|
||||
ZoneHVAC:EquipmentConnections,
|
||||
Room_180_7ad8616b, !- Zone Name
|
||||
Room_180_7ad8616b Equipment List, !- Zone Conditioning Equipment List Name
|
||||
Room_180_7ad8616b Inlet Node List, !- Zone Air Inlet Node or NodeList Name
|
||||
, !- Zone Air Exhaust Node or NodeList Name
|
||||
Node 27, !- Zone Air Node Name
|
||||
Room_180_7ad8616b Return Node List; !- Zone Return Air Node or NodeList Name
|
||||
|
||||
NodeList,
|
||||
Room_180_7ad8616b Inlet Node List, !- Name
|
||||
Node 305; !- Node Name 1
|
||||
|
||||
NodeList,
|
||||
Room_180_7ad8616b Return Node List, !- Name
|
||||
Node 308; !- Node Name 1
|
||||
|
||||
ZoneHVAC:Baseboard:Convective:Electric,
|
||||
Elec Baseboard 1, !- Name
|
||||
Always On Discrete hvac_library, !- Availability Schedule Name
|
||||
, !- Heating Design Capacity Method
|
||||
Autosize, !- Heating Design Capacity {W}
|
||||
, !- Heating Design Capacity Per Floor Area {W/m2}
|
||||
, !- Fraction of Autosized Heating Design Capacity
|
||||
1; !- Efficiency
|
||||
|
||||
AirTerminal:SingleDuct:ConstantVolume:NoReheat,
|
||||
Diffuser 21, !- Name
|
||||
Always On Discrete hvac_library, !- Availability Schedule Name
|
||||
Node 307, !- Air Inlet Node Name
|
||||
Node 305, !- Air Outlet Node Name
|
||||
AutoSize; !- Maximum Air Flow Rate {m3/s}
|
||||
|
||||
ZoneHVAC:AirDistributionUnit,
|
||||
ADU Diffuser 21, !- Name
|
||||
Node 305, !- Air Distribution Unit Outlet Node Name
|
||||
AirTerminal:SingleDuct:ConstantVolume:NoReheat, !- Air Terminal Object Type
|
||||
Diffuser 21; !- Air Terminal Name
|
||||
|
||||
ZoneHVAC:EquipmentList,
|
||||
Room_180_7ad8616b Equipment List, !- Name
|
||||
SequentialLoad, !- Load Distribution Scheme
|
||||
ZoneHVAC:Baseboard:Convective:Electric, !- Zone Equipment Object Type 1
|
||||
Elec Baseboard 1, !- Zone Equipment Name 1
|
||||
1, !- Zone Equipment Cooling Sequence 1
|
||||
1, !- Zone Equipment Heating or No-Load Sequence 1
|
||||
, !- Zone Equipment Sequential Cooling Fraction Schedule Name 1
|
||||
, !- Zone Equipment Sequential Heating Fraction Schedule Name 1
|
||||
ZoneHVAC:AirDistributionUnit, !- Zone Equipment Object Type 2
|
||||
ADU Diffuser 21, !- Zone Equipment Name 2
|
||||
2, !- Zone Equipment Cooling Sequence 2
|
||||
2, !- Zone Equipment Heating or No-Load Sequence 2
|
||||
, !- Zone Equipment Sequential Cooling Fraction Schedule Name 2
|
||||
; !- Zone Equipment Sequential Heating Fraction Schedule Name 2
|
||||
|
||||
Sizing:Zone,
|
||||
Room_180_7ad8616b, !- Zone or ZoneList Name
|
||||
SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method
|
||||
14, !- Zone Cooling Design Supply Air Temperature {C}
|
||||
11.11, !- Zone Cooling Design Supply Air Temperature Difference {deltaC}
|
||||
SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method
|
||||
40, !- Zone Heating Design Supply Air Temperature {C}
|
||||
11.11, !- Zone Heating Design Supply Air Temperature Difference {deltaC}
|
||||
0.0085, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
0.008, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
Room_180_7ad8616b DSOA Space List, !- Design Specification Outdoor Air Object Name
|
||||
, !- Zone Heating Sizing Factor
|
||||
, !- Zone Cooling Sizing Factor
|
||||
DesignDay, !- Cooling Design Air Flow Method
|
||||
0, !- Cooling Design Air Flow Rate {m3/s}
|
||||
0.000762, !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2}
|
||||
0, !- Cooling Minimum Air Flow {m3/s}
|
||||
0, !- Cooling Minimum Air Flow Fraction
|
||||
DesignDay, !- Heating Design Air Flow Method
|
||||
0, !- Heating Design Air Flow Rate {m3/s}
|
||||
0.002032, !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2}
|
||||
0.1415762, !- Heating Maximum Air Flow {m3/s}
|
||||
0.3, !- Heating Maximum Air Flow Fraction
|
||||
, !- Design Specification Zone Air Distribution Object Name
|
||||
No, !- Account for Dedicated Outdoor Air System
|
||||
, !- Dedicated Outdoor Air System Control Strategy
|
||||
, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C}
|
||||
, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C}
|
||||
Sensible Load Only No Latent Load, !- Zone Load Sizing Method
|
||||
HumidityRatioDifference, !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method
|
||||
, !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
0.005, !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir}
|
||||
HumidityRatioDifference, !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method
|
||||
, !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
0.005; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir}
|
||||
|
||||
DesignSpecification:OutdoorAir:SpaceList,
|
||||
Room_180_7ad8616b DSOA Space List, !- Name
|
||||
Room_180_7ad8616b_Space, !- Space Name 1
|
||||
MidriseApartment Apartment Ventilation; !- Space Design Specification Outdoor Air Object Name 1
|
||||
|
||||
Zone,
|
||||
Room_181_3a411b5d, !- Name
|
||||
, !- Direction of Relative North {deg}
|
||||
0, !- X Origin {m}
|
||||
0, !- Y Origin {m}
|
||||
0, !- Z Origin {m}
|
||||
, !- Type
|
||||
1, !- Multiplier
|
||||
4, !- Ceiling Height {m}
|
||||
291.62935408288, !- Volume {m3}
|
||||
, !- Floor Area {m2}
|
||||
, !- Zone Inside Convection Algorithm
|
||||
, !- Zone Outside Convection Algorithm
|
||||
Yes; !- Part of Total Floor Area
|
Loading…
Reference in New Issue
Block a user