Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page

# DOE 2.1E Batch run single location multiple file

Hi, I'm new to DOE 2 (been using E+) and the new company has a project need to be finished in DOE 2.1E. So I need to run multiple files using the same weather data. I have seen post talking about the opposite but couldnt find any for my scenario. I guess it shouldnt be too much different but still want to know what will be the simpliest way to do that and save output file according to the name of the input file. Basically I want the script to run all input file in the folder and output the results in the same folder but use the input file name so it wont overwrite. I know this might be really easy for folks with experience with this, but for me its completely new because i dont have too much experience with command line. Thanks

edit retag close merge delete

Sort by » oldest newest most voted

The simplest way to run several batch runs is to just sequentially hard-code the DOE2 batch command for every run you want. For example, if you just had 3 files located in a folder named c:\inp_files, you could use a .bat file like the following.

c:\\doe21e\doe21e.bat c:\\inp_files\\building1 TN_Memphis_International
c:\\doe21e\doe21e.bat c:\\inp_files\\building2 TN_Memphis_International
c:\\doe21e\doe21e.bat c:\\inp_files\\building3 TN_Memphis_International


The output files will be named the same as the input files but with a .sim extension by default. To do specifically what you've asked, which is to run all inp files in a particular folder, you could use the following.

:: Script to runs DOE2.1E simulations for all .inp files
:: located in the inp_dir folder
:: Do not include spaces in inp file names
:: weather file must be in c:\\doe21e\weather\packed folder

set inp_dir=c:\\inp_files
set doe_cmd=c:\\doe21e\\doe21e.bat exent
set weather=TN_Memphis_International

:: Run simulations for each inp file in folder
for /r  %inp_dir%  %%f in ( *.inp) do (
call %doe_cmd% %%~pf%%~nf %weather%
)


Just change inp_dir to the folder that you want and weather to the weather file that you want. This may look a little ugly because it uses some Windows command jargon, but you can accomplish a similar result that will look cleaner with other languages like Python or Java if you are familiar with them.

more

Thanks this is great. One more question, if I want to output hourly data into csv format, is there a way to do it? Thanks a lot

( 2017-03-22 08:49:23 -0600 )edit

There's an option to create a formatted hourly report file. See this for more details. It isn't csv, but it can just as easily be imported into Excel.

( 2017-03-23 08:16:05 -0600 )edit