Incorporation of ventilation. Working.

This commit is contained in:
Oriol Gavalda 2023-05-19 11:20:44 -04:00
parent 0747b61294
commit 7b245a69b3
3 changed files with 505 additions and 488 deletions

File diff suppressed because it is too large Load Diff

View File

@ -150,7 +150,6 @@ class Idf:
Solar_Absorptance=layer.material.solar_absorptance, Solar_Absorptance=layer.material.solar_absorptance,
Visible_Absorptance=layer.material.visible_absorptance Visible_Absorptance=layer.material.visible_absorptance
) )
@staticmethod @staticmethod
def _create_infiltration_schedules(thermal_zone): def _create_infiltration_schedules(thermal_zone):
_infiltration_schedules = [] _infiltration_schedules = []
@ -177,6 +176,21 @@ class Idf:
_infiltration_schedules.append(_schedule) _infiltration_schedules.append(_schedule)
return _infiltration_schedules return _infiltration_schedules
@staticmethod
def _create_ventilation_schedules(thermal_zone):
_ventilation_schedules = []
if thermal_zone.thermal_control is None:
return []
for hvac_availability_schedule in thermal_zone.thermal_control.hvac_availability_schedules:
_schedule = Schedule()
_schedule.type = cte.VENTILATION
_schedule.data_type = cte.FRACTION
_schedule.time_step = cte.HOUR
_schedule.time_range = cte.DAY
_schedule.day_types = copy.deepcopy(hvac_availability_schedule.day_types)
_ventilation_schedules = thermal_zone.thermal_control.hvac_availability_schedules
return _ventilation_schedules
@staticmethod @staticmethod
def _create_yearly_values_schedules(schedule_type, values): def _create_yearly_values_schedules(schedule_type, values):
_schedule = Schedule() _schedule = Schedule()
@ -425,19 +439,19 @@ class Idf:
) )
def _add_ventilation(self, thermal_zone, zone_name): def _add_ventilation(self, thermal_zone, zone_name):
# for zone in self._idf.idfobjects["ZONE"]: for zone in self._idf.idfobjects["ZONE"]:
# if zone.Name == f'{zone_name}_infiltration': if zone.Name == f'{zone_name}_ventilation':
# return return
schedule = f'Ventilation schedules {thermal_zone.usage_name}' schedule = f'Ventilation schedules {thermal_zone.usage_name}'
# if schedule not in self._idf.idfobjects[self._HOURLY_SCHEDULE]: if schedule not in self._idf.idfobjects[self._HOURLY_SCHEDULE]:
# return return
# todo: revise ventilation with Pilar # todo: revise ventilation with Pilar
self._idf.newidfobject(self._VENTILATION, self._idf.newidfobject(self._VENTILATION,
Name=f'{zone_name}_ventilation', Name=f'{zone_name}_ventilation',
Zone_or_ZoneList_Name=zone_name, Zone_or_ZoneList_Name=zone_name,
Schedule_Name=schedule, Schedule_Name=schedule,
Design_Flow_Rate_Calculation_Method='Flow/Zone', Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
Flow_Rate_per_Zone_Floor_Area=thermal_zone.infiltration_rate_system_off Flow_Rate_per_Zone_Floor_Area=thermal_zone.mechanical_air_change
) )
def _add_dhw(self, thermal_zone, zone_name): def _add_dhw(self, thermal_zone, zone_name):
@ -496,6 +510,8 @@ class Idf:
if building.name in self._target_buildings or building.name in self._adjacent_buildings: if building.name in self._target_buildings or building.name in self._adjacent_buildings:
_new_schedules = self._create_infiltration_schedules(thermal_zone) _new_schedules = self._create_infiltration_schedules(thermal_zone)
self._add_schedules(usage, 'Infiltration', _new_schedules) self._add_schedules(usage, 'Infiltration', _new_schedules)
_new_schedules2 = self._create_ventilation_schedules(thermal_zone)
self._add_schedules(usage, 'Ventilation', _new_schedules2)
self._add_schedules(usage, 'Occupancy', thermal_zone.occupancy.occupancy_schedules) 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, '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, 'Heating thermostat', thermal_zone.thermal_control.heating_set_point_schedules)

View File

@ -158,6 +158,7 @@ OCCUPANCY = 'Occupancy'
APPLIANCES = 'Appliances' APPLIANCES = 'Appliances'
HVAC_AVAILABILITY = 'HVAC Avail' HVAC_AVAILABILITY = 'HVAC Avail'
INFILTRATION = 'Infiltration' INFILTRATION = 'Infiltration'
VENTILATION = 'Ventilation'
COOLING_SET_POINT = 'ClgSetPt' COOLING_SET_POINT = 'ClgSetPt'
HEATING_SET_POINT = 'HtgSetPt' HEATING_SET_POINT = 'HtgSetPt'
EQUIPMENT = 'Equipment' EQUIPMENT = 'Equipment'