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

DOE 2.1E Batch run single location multiple file

asked 2017-03-21 09:41:24 -0600

hj630's avatar

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-03-21 18:08:09 -0600

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.

edit flag offensive delete link more

Comments

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

hj630's avatar hj630  ( 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.

aaron's avatar aaron  ( 2017-03-23 08:16:05 -0600 )edit

What is exent in the code above!

Rajeev's avatar Rajeev  ( 2024-08-28 23:07:51 -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

1 follower

Stats

Asked: 2017-03-21 09:41:24 -0600

Seen: 466 times

Last updated: Mar 21 '17