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

combine several zones into a floor/ story

asked 2024-10-22 06:30:12 -0600

RobinCris's avatar

updated 2024-10-22 08:14:55 -0600

I use openStudio 1.1.0 to read energy IDF files version 9.4. I need to support from this version forward for my clients.

The Clients use this version to check my work.

In Open studio, I need them to be able to isolate one floor and look if I modeled the zones of this floor correctly.

For that, if I understand correctly, open studio use stories (and let the user to show only selected stories) For me, I create the IDF file by hand. my app write the code I need. But I do not know how to say in the code which zone belong to which story... it is just zones. What zone property do I need to give a zone to tell open studio that it belong to the 1st story?

Do I need to combine zones into a list or zoneGroup? What am I missing? I do not use multiplier in my code.

Please advice

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2024-10-24 08:09:30 -0600

updated 2024-10-25 09:36:24 -0600

The BuildingStory class is unique to OpenStudio. It's indeed very handy for managing spaces in a model (e.g. placeholder for common default construction sets), for GUI visualization (as per your client requirements), etc. Yet it is neither forward translated to an IDF model, nor reverse translated from an IDF model. To the best of my knowledge, there's nothing one can add to an IDF file that will trigger new BuildingStory instances during reverse translation.


As suggested here and elsewhere, a limited number of IDF objects get reverse translated. How does one figure out which IDF objects get reverse translated (and how)? By exploring OpenStudio's ReverseTranslator.cpp (starting from Line 254). For instance, you alluded to ZoneList objects (Line 1032). Going over the actual code and comments (Line 40), one understands this is reverse translated as a SpaceType. Not what you're (initially) after ... (see EDIT below).


You could instead add BuildingStory instances to the reverse translated OSM model/file. Since you appear to be coding a solution (towards generating IDF files), it shouldn't be that challenging to interact with the generated OSM model using the SDK/API. Here's a Ruby example (Line 44) of reverse translating an IDF, and then accessing the generated OSM model.

An EnergyPlus Zone gets reverse translated (Line 33) as both an OpenStudio ThermalZone and Space. Only the latter can be linked to a BuildingStory. As you already seem to know which zones should be grouped under which building story, it should boil down to:

  • adding to the generated OSM model as many BuildingStory instances as needed
  • looping through each OSM space to identify its unique thermal zone
  • assigning each space's building story as required (see setBuildingStory)

That should do the trick. There are other ways of doing something similar. This neat example (Line 62) sorts spaces vs building stories based on the Z-axis values of floor vertices - a more general solution, IMO.


EDIT: As you seem quite comfortable with ZoneLists, here's a Ruby script example that populates an OSM with BuildingStory instances from newly-created SpaceType instances (resulting from reverse translating an IDF holding ZoneList objects). Adapt the files/directories as needed.

file = File.join(__dir__, "files/idfs/test.idf")
path = OpenStudio::Path.new(file)
workspace = OpenStudio::Workspace.load(path)
raise("Empty Workspace?") if workspace.empty?
workspace = workspace.get

rt = OpenStudio::EnergyPlus::ReverseTranslator.new
model = rt.translateWorkspace(workspace)

raise("Existing Building Stories?") unless model.getBuildingStorys.empty?

model.getSpaceTypes.each do |type|
  name  = type.nameString
  story = OpenStudio::Model::BuildingStory.new(model)
  story.setName("#{name} STORY")

  type.spaces.each { |space| space.setBuildingStory(story) }
end

file2 = File.join(__dir__, "files/osms/test.osm")
model.save(file2, true)

Tested it on IDFs. Works on my end. If this works for you, great!


EDIT 2: Here's a hack that offers what you're after, strictly using the OpenStudio Application. The following screenshots are based on an imported IDF of the US Warehouse Prototype. An OSM version of the model holds a single ... (more)

edit flag offensive delete link more

Comments

@Denis Bourgeois

I could not ask for a more specific and helpful answer. Thank you.

So if I understand correctly, one way I can address this, is by giving my clients OSM model, and in my generating IDF file will put all the zones from the same floor to a dedicate zoneList... And when I load (import) the idf file into that OSM model, it will translate it into BuildingStory. Did i understand you correctly?

I never done it before, it is new for me but it does not sound two complicate.

RobinCris's avatar RobinCris  ( 2024-10-24 09:49:50 -0600 )edit

I edited my initial answer. Possibly a more straightforward solution:

  • import your IDF using the OpenStudio Application
  • apply the fixes suggested in the EDIT 2
  • send the fixed OSM to your client (strictly for 3D visualization/interaction)

Forget ZoneLists if this GUI-based solution works for you.

Denis Bourgeois's avatar Denis Bourgeois  ( 2024-10-24 11:22:37 -0600 )edit

I am an automation logic writer. I can't make my client work so much to separate each zone to the right story list that he need to generate as well. I liked your you first solution. (if it will work) because I use automation to generate my IDF file, I have the logic that say which zone belong to what story. So I can create the right ZoneList easily. And from what I ynderstand from you, I can write a rb script that scan the file and create a story for each ZoneList. Did I get it right??

RobinCris's avatar RobinCris  ( 2024-10-24 16:13:29 -0600 )edit

"I can't make my client work so much" ... never suggested your client should do anything of the sort. I've been suggesting you do the work (whether by hand using the OpenStudio Application, or programmatically using the SDK/API).

Denis Bourgeois's avatar Denis Bourgeois  ( 2024-10-24 17:13:15 -0600 )edit

"from what I understand from you, I can write a rb script that scan the file and create a story for each ZoneList. Did I get it right". Sorta. The rb script is indeed there to alter the reverse translated OSM. But it doesn't matter if it's altered using ZoneLists (see EDIT) or some other data structure. I reiterate that there is no established way to dump one or more ZoneList objects in an IDF and somehow have BuildingStory instances automatically pop up in an OSM after reverse translation.

Denis Bourgeois's avatar Denis Bourgeois  ( 2024-10-24 17:17:38 -0600 )edit

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2024-10-22 06:30:12 -0600

Seen: 210 times

Last updated: Oct 25