Archinect

Product Architecture Lab

 

Archived

Oct '11 - Feb '12

 
  • anchor

    Interoperabilities: Grasshopper to EnergyPlus

    By Ben.Silverman
    Nov 12, '11 10:34 AM EST

    I've previously mentioned the interoperability course at PAE in brief, but it deserves a lot more attention. Its a pretty awesome course taught by Jonatan Schumacher and Ben Howes (both PAE alum) that introduces object oriented programming and interoperability via VB.NET.

    When I mention VB.NET to actual computer scientists, they sort of make a bitter beer face. Apparently, in the wider world of computer science, its looked down on a bit, but for our purposes of programming in windows based programs, its been working perfectly. 

    We began the term scripting macros in Catia, using its visual basic editor. This was a great way to start. I've never enjoyed or excelled at programming, but I was immediately able to understand the power of programming in regards to geometry generation. We then transferred our CATvba scripts to VB.NET in SharpDevelop, a free script editor (a great substitute for Microsoft Visual Studio). This was fascinating to me. I could write out instructions in SharpDevelop, press play, sit back and relax and watch hundreds of individually rotated arcs generated and then lofted in Catia.

    All that was just to get us warmed up. Once we established that we could import the object class of an outside program into SharpDevelop, we then got cracking on our first interoperability script. We created a simple program that would send names of geometry from Catia to Excel where they would be filed into a spreadsheet, would then pause and ask the user to rename the geometries, and then would send those names back to Catia and rename the geometries with the new names, all within seconds. Very basic, not the most powerful function, but it was our "Hello World" program for interoperability (I felt like Neil Armstrong for a split second taking on small step for architects on the barren landscape of Excel). We had ushered data from one program to another and back all from SharpDevelop.

    For our midterm we developed proofs of concepts for final projects. Two of my classmates and myself decided to tackle a Grasshopper to EnergyPlus interoperability tool. We spent last spring simulating energy models in IES and it has left us forever scarred. Its drafting system is severely outdated and frustrating, especially after spending all of our other time in advanced geometric software such as Grasshopper and Catia. EnergyPlus is a free energy modeling engine that was developed with a focus on performance and an intentional neglect of user interface. In the documentation for EnergyPlus they make it clear that their intention is for other software developers to create the interfaces (ie. eQuest, OpenStudio), and they have made all the documentation that is necessary to do so available to the public. Thus an opportunity to replace IES as the energy modeler of choice at PAE.

    We decided to use Grasshopper as the modeling environment because it is the ultimate interoperability tool itself. It is the perfect vehicle to relay data, whether it be geometric, numeric, or strings, because behind all the pretty nodes and wires, it is just an object oriented programming solver. In addition it has access to another great interoperability tool in Rhino, for which it is very rare that I come across a file type that it can't open. Its really the perfect match, as evidenced by the intense following of and production in grasshopper by its community.  

    The task is fairly simple. EnergyPlus reads an IDF file (a text file with an .idf file extension), which contains all of the geometry, orientation, materials, location data, energy meters, and so on that are required for the energy model. All we needed to do is format that data into a string and write the text file. The hardest part has been figuring out the user interface. EnergyPlus is a deep program that can provide energy model results as accurate and detailed as they come. The question that keeps popping up is, what variables and results do we make accessible to the user, if we only have one term to work on it. 

    By midterm we had developed a very stringy and messy proof of concept utilizing some VB nodes that took a user generated BRep, formatted and compiled an IDF file, and than initiated an EnergyPlus simulation with a user selected weather file and returned interior and exterior temperatures as well as heating and cooling loads. The real fun however, has just started. For the past two weeks we have been collapsing our messy grasshopper definitions into concise and neatly packaged grasshopper components.

    Its pretty cool to see your custom nodes up on the grasshopper toolbar or pop up as an option when you double click in grasshopper and type for a node. It has also brought the user interface aspect of the project to the forefront. At first we attempted to put as much functionality into each node as we possibly could, but we soon realized that's not the grasshopper way. Grasshopper's success has been in its usability and I think a big part of that is creating very simple building blocks that can be used to realize anyone's imagination rather than large pre-fabricated blocks which limit the user's ability to create their own definitions. Hopefully we can develop a very usable set of components which we can publish on the Grasshopper website.

    Before: midterm proof of concept

    After: custom grasshopper components 



     
    • 4 Comments

    • Jon Sargent

      Hi Ben,

      Cool stuff.  Have you seen the new EnergyPlus Grasshopper components that come with the DIVA for Rhino plug-in?

      http://www.diva-for-rhino.com/download.html

      Download the latest version of DIVA from the link above and give it a whirl.  I'm curious to see what you think.  We'll be adding more functionality over the coming months.  A couple video tutorials here:

      http://wiki.diva-for-rhino.com/Grasshopper_Thermal

      Best,

      Jon

       

       

      Nov 12, 11 1:27 pm  · 
       · 
      Ben.Silverman

      Jon,

      I just watched the tutorial. All of the caveats sound pretty familiar. It has been an interesting challenge, but I think as we've both been able to get over a couple of initial hurdles, its just a matter of time to unlock more functionality.

      How will Viper be interfacing with the other DIVA components? Will the other components be feeding analysis data to Viper or will they just be post-processed together?

      Ben

      Nov 12, 11 6:16 pm  · 
       · 
      Jon Sargent

      Hi Ben,

      There will be an option to feed DAYSIM lighting schedules from the Daylighting components into Viper.  (As you probably know, EnergyPlus's native daylight model isn't great, so this should be a big improvement.)

      Jon

      Nov 13, 11 9:26 am  · 
       · 
      Ben.Silverman

      Jon, 

      I took a deeper look at Viper today. Very cool stuff. There were a few things that really stood out and would be great tricks for any grasshopper component.

      1. The ability to add outputs to your Viper component through the drop down menu is pretty cool (not to forget to mention the drop down menu itself). I was not aware that you could dynamically add inputs and outputs to a component. Does this just involve "if then" statements when registering inputs and outputs. Any pointers towards accomplishing that functionality would be much appreciated. Its a very powerful function from the usability perspective.

      2. The use of branches to rekay data for the construction assembly and window unit component is very clever. I have been wondering if there was a way to get around the limitation of relaying only one type of data per wire in grasshopper. The use of branch paths to identify materials from a database is awesome, and the use of branch paths to create values for costume material properties such as U-value and SHGC for the WU component is even more awesome.

      3.  The use of the IDF editor to generate material and schedule databases is a very efficient solution for generating and organizing the databases to be referenced by the user. 

      Thanks for sharing

      Ben

      Nov 15, 11 10:51 pm  · 
       · 

      Block this user


      Are you sure you want to block this user and hide all related comments throughout the site?

      Archinect


      This is your first comment on Archinect. Your comment will be visible once approved.

    • Back to Entry List...
  • ×Search in:
 

About this Blog

The Product-Architecture Lab at Stevens Institute of Technology is a pioneering graduate program integrating the study of Architecture, Engineering, Product Design, and Interaction. The program focuses on a fusion of design culture and technology through the disciplines of computation, analysis, and advanced production methodologies.

Affiliated with:

Authored by:

  • Ben.Silverman

Other blogs affiliated with Stevens Institute of Technology:

Recent Entries