lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb in openstudio-standards-0.2.12 vs lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb in openstudio-standards-0.2.13.rc3

- old
+ new

@@ -90,53 +90,63 @@ # If the supply air fan operating mode schedule is always off (to follow load), # and the zone requires ventilation, override it to follow the zone occupancy schedule def zone_hvac_component_occupancy_ventilation_control(zone_hvac_component) ventilation = false # Zone HVAC operating schedule if providing ventilation + # Zone HVAC components return an OptionalSchedule object for supplyAirFanOperatingModeSchedule + # except for ZoneHVACTerminalUnitVariableRefrigerantFlow which returns a Schedule + existing_sch = nil if zone_hvac_component.to_ZoneHVACFourPipeFanCoil.is_initialized zone_hvac_component = zone_hvac_component.to_ZoneHVACFourPipeFanCoil.get if zone_hvac_component.maximumOutdoorAirFlowRate.is_initialized oa_rate = zone_hvac_component.maximumOutdoorAirFlowRate.get ventilation = true if oa_rate > 0.0 end ventilation = true if zone_hvac_component.isMaximumOutdoorAirFlowRateAutosized + fan_op_sch = zone_hvac_component.supplyAirFanOperatingModeSchedule + existing_sch = fan_op_sch.get if fan_op_sch.is_initialized elsif zone_hvac_component.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized zone_hvac_component = zone_hvac_component.to_ZoneHVACPackagedTerminalAirConditioner.get if zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.is_initialized oa_rate = zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.get ventilation = true if oa_rate > 0.0 end ventilation = true if zone_hvac_component.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized + fan_op_sch = zone_hvac_component.supplyAirFanOperatingModeSchedule + existing_sch = fan_op_sch.get if fan_op_sch.is_initialized elsif zone_hvac_component.to_ZoneHVACPackagedTerminalHeatPump.is_initialized zone_hvac_component = zone_hvac_component.to_ZoneHVACPackagedTerminalHeatPump.get if zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.is_initialized oa_rate = zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.get ventilation = true if oa_rate > 0.0 end ventilation = true if zone_hvac_component.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized + fan_op_sch = zone_hvac_component.supplyAirFanOperatingModeSchedule + existing_sch = fan_op_sch.get if fan_op_sch.is_initialized elsif zone_hvac_component.to_ZoneHVACTerminalUnitVariableRefrigerantFlow.is_initialized zone_hvac_component = zone_hvac_component.to_ZoneHVACTerminalUnitVariableRefrigerantFlow.get if zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.is_initialized oa_rate = zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.get ventilation = true if oa_rate > 0.0 end ventilation = true if zone_hvac_component.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized + existing_sch = zone_hvac_component.supplyAirFanOperatingModeSchedule elsif zone_hvac_component.to_ZoneHVACWaterToAirHeatPump.is_initialized zone_hvac_component = zone_hvac_component.to_ZoneHVACWaterToAirHeatPump.get if zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.is_initialized oa_rate = zone_hvac_component.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded.get ventilation = true if oa_rate > 0.0 end ventilation = true if zone_hvac_component.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized + fan_op_sch = zone_hvac_component.supplyAirFanOperatingModeSchedule + existing_sch = fan_op_sch.get if fan_op_sch.is_initialized end return false unless ventilation # if supply air fan operating schedule is always off, # override to provide ventilation during occupied hours - existing_sch = zone_hvac_component.supplyAirFanOperatingModeSchedule - if existing_sch.is_initialized - existing_sch = existing_sch.get + unless existing_sch.nil? if existing_sch.name.is_initialized OpenStudio.logFree(OpenStudio::Info, 'openstudio.Standards.ZoneHVACComponent', "#{zone_hvac_component.name} has ventilation, and schedule is set to always on; keeping always on schedule.") return false if existing_sch.name.get.to_s.downcase.include? 'always on discrete' end end @@ -154,11 +164,10 @@ # Apply all standard required controls to the zone equipment # # @return [Bool] returns true if successful, false if not def zone_hvac_component_apply_standard_controls(zone_hvac_component) - # Vestibule heating control if zone_hvac_component_vestibule_heating_control_required?(zone_hvac_component) zone_hvac_component_apply_vestibule_heating_control(zone_hvac_component) end @@ -179,11 +188,10 @@ # Turns off vestibule heating below 45F # # @return [Bool] returns true if successful, false if not def zone_hvac_component_apply_vestibule_heating_control(zone_hvac_component) - # Ensure that the equipment is assigned to a thermal zone if zone_hvac_component.thermalZone.empty? OpenStudio.logFree(OpenStudio::Warn, 'openstudio.model.ZoneHVACComponent', "For #{zone_hvac_component.name}: equipment is not assigned to a thermal zone, cannot apply vestibule heating control.") return true end @@ -195,12 +203,10 @@ zone_hvac_component.to_ZoneHVACUnitHeater.get elsif zone_hvac_component.to_ZoneHVACPackagedTerminalAirConditioner.is_initialized zone_hvac_component.to_ZoneHVACPackagedTerminalAirConditioner.get elsif zone_hvac_component.to_ZoneHVACPackagedTerminalHeatPump.is_initialized zone_hvac_component.to_ZoneHVACPackagedTerminalHeatPump.get - else - nil end # Do nothing for other types of zone HVAC equipment if zone_hvac.nil? return true @@ -256,12 +262,12 @@ oat_db_c_sen = nil if zone_hvac_component.model.getEnergyManagementSystemSensorByName('OATVestibule').is_initialized oat_db_c_sen = zone_hvac_component.model.getEnergyManagementSystemSensorByName('OATVestibule').get else oat_db_c_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Site Outdoor Air Drybulb Temperature') - oat_db_c_sen.setName("OATVestibule") - oat_db_c_sen.setKeyName("Environment") + oat_db_c_sen.setName('OATVestibule') + oat_db_c_sen.setKeyName('Environment') end # Actuators avail_sch_act = OpenStudio::Model::EnergyManagementSystemActuator.new(avail_sch, 'Schedule:Constant', 'Schedule Value') avail_sch_act.setName("#{equip_name_clean}VestHtgAvailSch") @@ -285,7 +291,6 @@ OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.ZoneHVACComponent', "For #{zone_hvac_component.name}: Vestibule heating control applied, heating disabled below #{htg_lim_f} F.") return true end - end