This commit is contained in:
Guille Gutierrez 2023-03-22 16:23:43 -04:00
parent 81a59d4246
commit 9d51d4f8ba
5 changed files with 391 additions and 546 deletions

File diff suppressed because it is too large Load Diff

View File

@ -336,6 +336,26 @@ class Idf:
Activity_Level_Schedule_Name=f'Activity Level schedules {thermal_zone.usage_name}'
)
def _add_lighting(self, thermal_zone, zone_name):
fraction_radiant = thermal_zone.lighting.radiative_fraction
fraction_visible = 1
method = 'Watts/Area'
watts_per_zone_floor_area = thermal_zone.lighting.density
fraction_replaceable = 1
subcategory = f'ELECTRIC EQUIPMENT#{zone_name}#GeneralLights'
self._idf.newidfobject(self._LIGHTS,
Name=f'{zone_name}_lights',
Zone_or_ZoneList_Name=zone_name,
Schedule_Name=f'Lighting schedules {thermal_zone.usage_name}',
Design_Level_Calculation_Method=method,
Watts_per_Zone_Floor_Area=watts_per_zone_floor_area,
Fraction_Radiant=fraction_radiant,
Fraction_Visible=fraction_visible,
Fraction_Replaceable=fraction_replaceable,
EndUse_Subcategory=subcategory
)
def _add_infiltration(self, thermal_zone, zone_name):
for zone in self._idf.idfobjects["ZONE"]:
if zone.Name == f'{zone_name}_infiltration':
@ -388,16 +408,20 @@ class Idf:
usage = thermal_zone.usage_name
if building.name in self._target_buildings or building.name in self._adjacent_buildings:
self._add_infiltration_schedules(thermal_zone)
self._add_schedules(usage, 'Occupancy', thermal_zone.occupancy.occupancy_schedules)
self._add_schedules(usage, 'HVAC AVAIL', thermal_zone.thermal_control.hvac_availability_schedules)
self._add_schedules(usage, 'Heating thermostat', thermal_zone.thermal_control.heating_set_point_schedules)
self._add_schedules(usage, 'Cooling thermostat', thermal_zone.thermal_control.cooling_set_point_schedules)
self._add_schedules(usage, 'Lighting', thermal_zone.lighting.schedules)
self._add_people_activity_level_schedules(thermal_zone)
self._add_zone(thermal_zone, building.name)
self._add_heating_system(thermal_zone, building.name)
self._add_infiltration(thermal_zone, building.name)
self._add_occupancy(thermal_zone, building.name)
self._add_lighting(thermal_zone, building.name)
if self._export_type == "Surfaces":
if building.name in self._target_buildings or building.name in self._adjacent_buildings:
self._add_surfaces(building, building.name)
@ -420,6 +444,7 @@ class Idf:
Variable_Name="Zone Ideal Loads Supply Air Total Cooling Energy",
Reporting_Frequency="Hourly",
)
self._idf.match()
try:
self._idf.intersect_match()

View File

@ -4,7 +4,6 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import datetime
import math
import sys
from hub.hub_logger import logger
@ -23,6 +22,7 @@ class NrcanPhysicsParameters:
NrcanPhysicsParameters class
"""
def __init__(self, city, base_path, divide_in_storeys=False):
# create a thread pool with 8 threads
self._city = city
self._path = base_path
self._divide_in_storeys = divide_in_storeys
@ -67,6 +67,7 @@ class NrcanPhysicsParameters:
for internal_zone in building.internal_zones:
for thermal_zone in internal_zone.thermal_zones:
thermal_zone.total_floor_area = thermal_zone.footprint_area
for internal_zone in building.internal_zones:
self._assign_values(internal_zone.thermal_zones, archetype)
for thermal_zone in internal_zone.thermal_zones:

View File

@ -100,13 +100,14 @@ class TestExports(TestCase):
"""
export to IDF
"""
city = self._get_citygml('EV_GM_MB_LoD2.gml')
city = self._get_citygml('FZK_Haus_LoD_2.gml')
self._city = GeometryFactory('citygml', path=file_path).city
for building in city.buildings:
building.year_of_construction = 2006
if building.function is None:
building.function = 'large office'
ConstructionFactory('nrel', city).enrich()
UsageFactory('comnet', city).enrich()
ConstructionFactory('nrcan', city).enrich()
UsageFactory('nrcan', city).enrich()
try:
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
EnergyBuildingsExportsFactory('idf', city, self._output_path,

View File

@ -1,4 +1,2 @@
# Ignore everything in this directory
.gitignore
# Except this file
!.gitignore