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