IDF to INP Converter for NREL BCL

For those of you not aware a while back NREL began publishing library components to their BCL Catalog. The Library has grown extensively since the initial rollout. The components for the time being a compatible with EnergyPlus and a supplied IDF definition can be found with the ZIP package for each component. It is truly a blessing to have access to this catalog which contains not only custom items but a huge selection of standards based elements such as ASHRAE 90.1 and 189.1 construction components. Being an EnergyPlus user myself I am pretty content receiving an IDF file, and if you use OpenStudio I believe the API allows for pulling these components directly into your model for immediate use. While certainly an excellent workflow for an EnergyPlus user it became clear to me during recent conversations with one of the USACE divisions that having these components in INP format for use in eQUEST (DOE2.2) would be quite nice for all the existing eQUEST users still fighting the good fight. So, I took some of my recent experience working with file processing in Python and whipped up a fairly decent conversation script for converting BCL construction components from IDF to INP. … Continue reading

Python for Energy Modelers – Part 3 – Simple Post-processing

Last time we looked at scripting the creation of many input files for a parametric study of a building energy concept. Now we will turn to the post-processing side of the energy modeling workflow. Often, a spreadsheet tool like Excel is a first choice for many analysis tasks. This is great for simple cases, but if the number of files or the amount of data is large or complex, Excel will cost you time and lead to errors. This is where you should turn to Python! Let’s look a concrete example, from a project I worked on a few months ago. What we needed to do was generate building load profiles for 3 stock building geometries. We were investigating 8 different internal loads (office, residential, etc.), 5 different insulation types, and various other parameters. After an input file generation script similar to last week’s, I had 384 TRNSYS input files! These were executed all over night, resulting in 384 output files. And extract from one of these output files is below; This file is a typical output file from TRNSYS, a tab-seperated ASCII text file with a single header line. What we have in each row is the time stamp … Continue reading

Python for Energy Modelers – Part 2 – Simple Pre-processing

After a great introduction by Clayton Miller, let’s dig in and see how easy and powerful it is to mix a little Python into your simulation workflow!

Computers are fantastic at performing repetitive tasks, let them handle the boring stuff so you can focus on creating better models and reports. Now think about your simulation tool as an engineer; many simulation tools have one main input file which is executed by the tool, and out come a bunch of results files. We can think of this like a black box model, where we are not so concerned about the inner details. In fact, this model can be generalized to many simulation tools important for energy analysis and building performance design. From personal experience I use this “ASCII text file input – text file output” black box model for EnergyPlus, TRNSYS, and Radiance. Wouldn’t it be nice if we had a general way to modify input files and process our output files automatically? This is the subject of this blog series! Continue reading

Python for Energy Modelers – Part 1

After reading the title for this post – I know what you may be thinking – “Hey, whoa, wait a second. I’m an engineer. The learning curve for programming is too steep. There’s no way I can become proficient without a huge time investment.”

I used to be the same way; fighting my way through excel spreadsheets and even dabbling in a few visual basic macros to help process the data going into and coming out of energy simulation programs. The reality is that there is a better way. Through discussions with a few prominent energy modelers at the Building Simulation 2011 conference in Sydney in November, I decided there just isn’t a ‘nudge’ out there to push more engineers and energy analysts towards basic proficiency in high level programming languages such as Python and Ruby. This post will be the first in a series which will help the average engineer get started with scripting languages, build a few practical skills which are directly applicable to pre and post processing of data for modeling purposes, and go through a couple of these scenarios from start to finish. I have engaged the assistance of energy modeling extraordinaire Marcus Jones to help out with future posts on the simulation scenarios which this stuff can be useful for. Continue reading