Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page

# Revision history [back]

### Replace Terminal Unit Meausure

I have the following to remove all PIU reheat boxes and replace them with VAV reheat boxes. The variable airLoop is defined from do loop with mode.getAirLoopHVACs.each.

thermalZones = airLoop.thermalZones
thermalZones.each do |thermalZone|
originalTerminal = thermalZone.airLoopHVACTerminal.get.to_AirTerminalSingleDuctParallelPIUReheat
if not originalTerminal.empty?
originalTerminal = originalTerminal.get
reheatLoop = originalTerminal.reheatCoil.plantLoop.get
originalTerminal.remove
reheatCoil = OpenStudio::Model::CoilHeatingWater.new(model, model.alwaysOnDiscreteSchedule)

It performs the desired task, but the OS:Connection objects aren't created and the terminal units don't appear in the loop graphics in the HVAC tab. I don't think addEquipment is the correct method to use but I'm not to grab the correct thermal zone inlet node in order to use the addToNode method. Anyone see what I'm missing here? Additionally, if there is something non-nonsensical or extraneous that I'm doing, please don't hesitate to let me know.