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

"Air Wall Zone Mixing" measure not removed completely (OpenStudio)

asked 2021-07-29 19:31:55 -0500

bchoi's avatar

updated 2021-07-31 10:47:40 -0500

Hello! I am using OpenStudio and would like to know how to remove a measure completely. I applied the "Air Wall Zone Mixing" measure between two zones that had air walls defined. I then removed the air walls but still see the zone mixing ongoing - I could see this in Data Viewer. I even deleted the measure from the local library but the zone mixing continues. Is there any way to remove this measure completely? Thank you so much!

image description

edit retag flag offensive close merge delete

Comments

Did you apply the measure in apply measures now or in your workflow? Also when you say you removed the air walls, do you mean after you ran the measure you changed the air walls to a different construction? Back when this measure was written there was no dynamic link to the air walls and zone mixing, just determined at the time the measure ran. Might have to clean up your model another way if you don't have old copy. But now OpenStudio has Air Boundary Construction construction type that has option to add in air exchange based on newer EnergyPlus feature to do that.

David Goldwasser's avatar David Goldwasser  ( 2021-07-30 18:14:07 -0500 )edit

@David Goldwasser I used Apply Measure Now. And yes, I changed the Air Boundary Construction to a different construction after running the measure, but it looks like the measure got stuck. I wasn't aware at the time that the measure wasn't needed when using the Air Boundary Construction. Other than removing the measure from my local library, which did not work, what other clean up methods are there? Thank you.

bchoi's avatar bchoi  ( 2021-07-30 18:38:00 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2021-08-01 23:15:03 -0500

updated 2021-08-02 15:31:10 -0500

If you make a new measure, and then change everything within and including the initial and final condition to this you can clean it up. Optionally you can clean up unnecessary measure arguments, but it shouldn’t break anything if you leave them three.

# report initial condition of model
runner.registerInitialCondition("The building started with #{model.getZoneMixings.size} Zone Mixing Objects.")  

# remove the objects
model.getZoneMixings.each do |zone_mixing|
  zone_mixing.remove
end

# report final condition of model
runner.registerFinalCondition("The building finished with #{model.getZoneMixings.size} Zone Mixing Objects.")
edit flag offensive delete link more

Comments

Hi @David Goldwasser, thank you for your answer! I made a copy of the Air Wall Zone Mixing measure and simply added the "# remove the objects" part right before "# report final condition of model", but I got an error message saying "undefined method `each' for 4:Integer." What could I say instead of "each"? Thank you.

bchoi's avatar bchoi  ( 2021-08-02 14:10:58 -0500 )edit
1

There is an error in @David Goldwasser's code. You should remove the .size method from the each statement. I believe the correct code should be:

remove the objects

model.getZoneMixings.each do |zone_mixing|

zone_mixing.remove

end

model.getZoneMixings returns an array of zone mixings objects. If you call the size method on that array, you get an Integer (like 4). You cannot enumerate/iterate through an Integer, hence when you call .each do |zone_mixing|, an error is thrown with statement "undefined method `each' for 4:Integer." You must call .each on array type, not an integer type.

sashadf1's avatar sashadf1  ( 2021-08-02 15:06:22 -0500 )edit

@David Goldwasser can you correct your solution?

sashadf1's avatar sashadf1  ( 2021-08-02 15:13:33 -0500 )edit

@sashadf1 thanks for pointed that out. I copied and pasted without looking carefully or testing. I updated the answer.

David Goldwasser's avatar David Goldwasser  ( 2021-08-02 15:31:54 -0500 )edit

It worked! Thank you so much both, @sashadf1 and @David Goldwasser

bchoi's avatar bchoi  ( 2021-08-02 16:03:43 -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: 2021-07-29 19:31:55 -0500

Seen: 208 times

Last updated: Aug 02 '21