Skip to content

Commit

Permalink
fix(hvac): Use variable fans when modeling DOAS with DCV
Browse files Browse the repository at this point in the history
Resolves #329
  • Loading branch information
chriswmackey committed Dec 17, 2024
1 parent 8b2927b commit 9080147
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 33 deletions.
48 changes: 24 additions & 24 deletions lib/to_openstudio/hvac/Model.hvac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OpenStudio::Model::Model
# Adds the HVAC system as derived from the combinations of CBECS 2012 MAINHT and MAINCL fields.
# Mapping between combinations and HVAC systems per http://www.nrel.gov/docs/fy08osti/41956.pdf
# Table C-31
def add_cbecs_hvac_system(standard, system_type, zones)
def add_cbecs_hvac_system(standard, system_type, zones, doas_type)
# the 'zones' argument includes zones that have heating, cooling, or both
# if the HVAC system type serves a single zone, handle zones with only heating separately by adding unit heaters
# applies to system types PTAC, PTHP, PSZ-AC, and Window AC
Expand Down Expand Up @@ -95,146 +95,146 @@ def add_cbecs_hvac_system(standard, system_type, zones)
standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

when 'DOAS_FCU_Chiller_Boiler'
standard.model_add_hvac_system(self, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
zone_equipment_ventilation: false)

when 'DOAS_FCU_Chiller_ASHP'
standard.model_add_hvac_system(self, 'DOAS', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
zone_equipment_ventilation: false)

when 'DOAS_FCU_Chiller_DHW'
standard.model_add_hvac_system(self, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
zone_equipment_ventilation: false)

when 'DOAS_FCU_Chiller_ElectricBaseboard'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'Electricity', zones,
air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
zone_equipment_ventilation: false)
standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

when 'DOAS_FCU_Chiller_GasHeaters'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'Electricity', zones,
air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
zone_equipment_ventilation: false)
standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

when 'DOAS_FCU_Chiller'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'Electricity', zones,
air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
zone_equipment_ventilation: false)

when 'DOAS_FCU_ACChiller_Boiler'
standard.model_add_hvac_system(self, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled')
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled',
zone_equipment_ventilation: false)

when 'DOAS_FCU_ACChiller_ASHP'
standard.model_add_hvac_system(self, 'DOAS', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled')
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled',
zone_equipment_ventilation: false)

when 'DOAS_FCU_ACChiller_DHW'
standard.model_add_hvac_system(self, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled')
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled',
zone_equipment_ventilation: false)

when 'DOAS_FCU_ACChiller_ElectricBaseboard'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled', air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled',
zone_equipment_ventilation: false)
standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

when 'DOAS_FCU_ACChiller_GasHeaters'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled', air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled',
zone_equipment_ventilation: false)
standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

when 'DOAS_FCU_ACChiller'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled', air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
chilled_water_loop_cooling_type: 'AirCooled',
zone_equipment_ventilation: false)

when 'DOAS_FCU_DCW_Boiler'
standard.model_add_hvac_system(self, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones,
zone_equipment_ventilation: false)

when 'DOAS_FCU_DCW_ASHP'
standard.model_add_hvac_system(self, 'DOAS', ht = 'AirSourceHeatPump', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'AirSourceHeatPump', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'DistrictCooling', zones,
zone_equipment_ventilation: false)

when 'DOAS_FCU_DCW_DHW'
standard.model_add_hvac_system(self, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones,
zone_equipment_ventilation: false)

when 'DOAS_FCU_DCW_ElectricBaseboard'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'DistrictCooling', zones,
air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
zone_equipment_ventilation: false)
standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

when 'DOAS_FCU_DCW_GasHeaters'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'DistrictCooling', zones,
air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
zone_equipment_ventilation: false)
standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

when 'DOAS_FCU_DCW'
standard.model_add_hvac_system(self, 'DOAS', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
standard.model_add_hvac_system(self, doas_type, ht = nil, znht = nil, cl = 'DistrictCooling', zones,
air_loop_heating_type: nil)
standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
zone_equipment_ventilation: false)

when 'DOAS_VRF'
standard.model_add_hvac_system(self, 'DOAS', ht = 'Electricity', znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = 'Electricity', znht = nil, cl = 'Electricity', zones,
air_loop_heating_type: 'DX',
air_loop_cooling_type: 'DX')
standard.model_add_hvac_system(self, 'VRF', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)

when 'DOAS_WSHP_FluidCooler_Boiler'
standard.model_add_hvac_system(self, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, 'Water Source Heat Pumps', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
heat_pump_loop_cooling_type: 'FluidCooler',
zone_equipment_ventilation: false)

when 'DOAS_WSHP_CoolingTower_Boiler'
standard.model_add_hvac_system(self, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
standard.model_add_hvac_system(self, 'Water Source Heat Pumps', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
heat_pump_loop_cooling_type: 'CoolingTower',
zone_equipment_ventilation: false)

when 'DOAS_WSHP_GSHP'
standard.model_add_hvac_system(self, 'DOAS', ht = 'Electricity', znht = nil, cl = 'Electricity', zones,
standard.model_add_hvac_system(self, doas_type, ht = 'Electricity', znht = nil, cl = 'Electricity', zones,
air_loop_heating_type: 'DX',
air_loop_cooling_type: 'DX')
standard.model_add_hvac_system(self, 'Ground Source Heat Pumps', ht = 'Electricity', znht = nil, cl = 'Electricity', zones,
zone_equipment_ventilation: false)

when 'DOAS_WSHP_DCW_DHW'
standard.model_add_hvac_system(self, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, doas_type, ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)
standard.model_add_hvac_system(self, 'Water Source Heat Pumps', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones,
zone_equipment_ventilation: false)

Expand Down
24 changes: 15 additions & 9 deletions lib/to_openstudio/hvac/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ def to_openstudio(openstudio_model, room_ids)
end

# create the HVAC system
doas_type = 'DOAS'
if @hash[:demand_controlled_ventilation]
doas_type = 'DOAS with DCV'
end
if equipment_type.to_s.include? 'Radiant'
os_hvac = openstudio_model.add_radiant_hvac_system(standard, equipment_type.to_s, zones, @hash)
else
os_hvac = openstudio_model.add_cbecs_hvac_system(standard, equipment_type, zones)
os_hvac = openstudio_model.add_cbecs_hvac_system(standard, equipment_type, zones, doas_type)
end

# Get the air loops and assign the display name to the air loop name if it exists
Expand Down Expand Up @@ -258,14 +262,16 @@ def to_openstudio(openstudio_model, room_ids)

# assign demand controlled ventilation if there's an air loop
if @hash[:demand_controlled_ventilation] && !os_air_loops.empty?
os_air_loops.each do |os_air_loop|
oasys = os_air_loop.airLoopHVACOutdoorAirSystem
unless oasys.empty?
os_oasys = oasys.get
oactrl = os_oasys.getControllerOutdoorAir
vent_ctrl = oactrl.controllerMechanicalVentilation
vent_ctrl.setDemandControlledVentilationNoFail(true)
oactrl.resetMinimumFractionofOutdoorAirSchedule
if !equipment_type.to_s.include? 'DOAS'
os_air_loops.each do |os_air_loop|
oasys = os_air_loop.airLoopHVACOutdoorAirSystem
unless oasys.empty?
os_oasys = oasys.get
oactrl = os_oasys.getControllerOutdoorAir
vent_ctrl = oactrl.controllerMechanicalVentilation
vent_ctrl.setDemandControlledVentilationNoFail(true)
oactrl.resetMinimumFractionofOutdoorAirSchedule
end
end
end
end
Expand Down

0 comments on commit 9080147

Please # to comment.