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

OpenStudio: Editing and Removing HVAC

asked 2017-03-10 17:11:11 -0500

cnutt's avatar

updated 2017-08-05 07:41:59 -0500

Is there a script, a measure, or a trick to quickly removing HVAC equipment from a model? I tried removing it through text editing the OSM but it caused an error in OS.

I'm working on a mulitfamily building with 161 dwelling units and about 100 dwelling unit thermal zones. For my baseline I've added the PTHP directly to Zone Equipment rather than using an air loop. To delete all of them I went through and clicked each and hit the X button to delete it, but that was very time consuming as there was about a 2 second pause between each click while the PC worked on it. Any tips on a quicker way to do this in the future?

Is there a way to copy the PTHP (or other equipment) in the library? I'd like to create some of my own equipment templates.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2017-03-13 08:29:01 -0500

I'm not aware of a measure on the BCL that does this. There is a method called removeEquipment in the OSlib_HVAC.rb module that's included in the /resources folder of some BCL measures, e.g. the AEDG measures.

If you're using the API outside of formal measures the code below will remove all HVAC systems. If you'd like a formal measure to do this, I've created a one and committed it to the UnmetHours OpenStudio Measures GitHub repository.

# get model objects
air_loops = model.getAirLoopHVACs
plant_loops = model.getPlantLoops
zones = model.getThermalZones

# do stuff
plant_loops.each do |plant_loop|
  plant_loop.remove
end

air_loops.each do |air_loop|
  air_loop.remove
end

zones.each do |zone|

  zone.equipment.each do |zone_equipment|
    zone_equipment.remove
  end

end
edit flag offensive delete link more

Comments

As a follow-up to this question, has anyone come up with a way of removing HVAC that is not attached to a thermal zone (and any dependents such as plant loops that also then don't have dependents)?

I see a lot of remove all/replace HVAC measures on the BCL; is that the preferred/easier way?

Liam's avatar Liam  ( 2017-08-13 08:41:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

1 follower

Stats

Asked: 2017-03-10 17:11:11 -0500

Seen: 655 times

Last updated: Mar 13 '17