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

Recommendation on translating Openstudio measures to run independently of Openstudio

asked 2018-11-09 14:12:03 -0600

mldichter's avatar

updated 2018-11-11 10:21:06 -0600

Background: My project is to simulate common building types in California modified by openstudio measures and brute force search for the most cost effective ZNE building technology combinations. At this point, the openstudio measures have been written and we're ready to start the brute force search of the simulations. However, in order to use the algorithmic analysis in the Parametric Analysis Tool, I need to get some form of openstudio-server up and running. (Please correct me if I'm wrong in any way and there's an easier way to use the algorithmic analysis in PAT.)

The problem I have run into is all the instructions I've found for installing openstudio-server are extremely technical, outdated, incomplete, or non-existent. (To be fair, I haven't tried the installation instructions using Amazon AWS, but those instructions went way over my head. The people on this project are engineers after all, not computer scientists.)

To the developers: I know projects can run out of money or go over budget or etc. So does anyone recommend I start considering modifying all my measures to run independently of openstudio and side step that problem entirely?

To the users: Have any of you users of PAT successfully setup up PAT, openstudio-server, etc to use the algorithmic analysis to smartly explore all your measure combinations?


It's gonna suck to implement the algorithmic analysis of PAT without PAT or Openstudio, but beggars can't be choosers and we need to get our project done.

Thank you for any advice you can give.

Cheers,
        Mitchal

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
0

answered 2018-11-13 16:04:09 -0600

mldichter's avatar

updated 2018-12-12 16:24:37 -0600

I have changed my accepted answer to this one. @mdahlhausen's code is definitely the way to go!

https://github.com/UnmetHours/openstu...

The "ruby -v" check was unnecessary since openstudio can run the rb files.

I did have to add to the PATH variable on Windows with the bin directory inside of the openstudio directory.

The template files run fine, and then you can modify the generate_workflows.rb file to run the measures and combinations that you want. It's well commented and isn't too difficult to modify the examples.


POST SCRIPT
I ended up bypassing openstudio entirely. I made some functions to parse idf text files, write idf text files, and manipulated all the objects by having an array of arrays, each of which represented an object and all its fields. It took a while to translate all the measures I had written, mostly changing the index I would access field elements with, but it's all working. I found one of the changes from energyplus 8.9 to 9.0 was removing one of the fields of the Boiler:HotWater object, which is why adding a bunch of objects with workspace.addObjects() didn't add any objects.

From there, I'm just using for loops to iterate through measure parameter combinations, and write out all the idf files to simulate into an energyplus run group file. Then it's just one click and come back later.

The OpenStudio CLI script by @mdahlhausen worked by the way, and I based my organization and functions on his and what they outputted, but the problems I was having with workspace.addObject(), workspace.addObjects(), Fan:SystemModel on a Branch object, and not easily being able to change the idd file for Openstudio, I finally bit the bullet and got the ruby measures to run directly on the idf files rather than Openstudio.

edit flag offensive delete link more
5

answered 2018-11-10 10:39:10 -0600

Phylroy Lopez's avatar

updated 2018-11-10 10:39:47 -0600

Hey There,

The workflow that @mdahlhausen @David Goldwasser are awesome and I may try them out here and their documentation is definite the way to go. But I thought I'd post the email that I gave to my CO-OP student on how to start/stop AWS from PAT. It may be what you need. I've added a few steps / links so set up your AWS account. Note: These instructions have been used Nov 10, 2018 using PAT 2.6.0

Set up your AWS Account

You only have to do this once to get your Access Key ID and Secret Access Key. Think of this as your username and password that you will give to PAT to access AWS. After you have set up your AWS account..it takes us about 10 minutes to spin up a cluster on Amazon. Usually enough time to get a cup of coffee.

1) Create an AWS Account. This will give you some free hours to play with. You will need to enter a credit card after you exhaust the trial. https://aws.amazon.com/free/

2) To find your Access Key and Secret Access Key:

  • Log in to your AWS Management Console here
  • Click on your user name at the top right of the page.
  • Click on the Security Credentials link from the drop-down menu.
  • Expand the "Access keys (access key ID and secret access key)" horizontal tab.
  • Click "Create New Access Key"
  • Click "Download Key File". This will contain the user credentials that you will use in PAT 2.6

Start AWS from PAT

  • Launch PAT
  • Go to the Run tab (The button on the left with the "play" button)
  • Select "Run On the Cloud" on the top
  • Enter a name that you wish for the Analysis in "Analysis Name"
  • Choose the AMI Name version of OpenStudio you wish to use. I like to use 2.6.0 until 2.7.0 is stable. So you may select that.
  • Click 'New Cluster' and name your cluster setting name whatever you wish.
  • Select C3.8XLarge for server instance type. This is a pretty decent for runs.
  • Select C3.8XLarge for worker instance type.
  • Enter in how many workers you want..This is subjective on how fast you want your cluster to be and how much you want to spend an hour. Each C3.8XLarge is ~1.70$/hour
  • Under AWS UserID put your name for example I just put my first name down. This is used as an identifier, but rarely used.
  • Under the AWS Credentials, click new and enter any name to identify your aws account, the Access Key, and the Secret Access key that you downloaded in the previous section.
  • Click Start Cluster and wait a few minutes for the server status to turn from blue to green.. when it is started you can click the view server to view the server webpage. Now you can start to run workflows with measures and view progress by refreshing the web ...
(more)
edit flag offensive delete link more

Comments

@Phylroy Lopez Thanks for the instructions, but it's not economical for us to use AWS. The reason is rather silly, but the number of person hours required to add anything to the budget for the project grant and get approval is a significant investment. We only go through that bureaucracy if we have no other options.

A less silly reason is part of the project is to release the openstudio measures so other researchers can apply the same process to their own building models. In that respect, we want to make using the measures easy, which is a disadvantage of AWS for HVAC engineers.

mldichter's avatar mldichter  ( 2018-11-13 13:18:54 -0600 )edit
1

answered 2018-11-14 00:43:54 -0600

[moved from comment] If standing up a server for PAT is confusing, you may want to instead try the OpenStudio CLI template I posted to the unmet hours Github repository: https://github.com/UnmetHours/openstu.... I've used it for the sort of parametric combinations you are doing in your project.

edit flag offensive delete link more
1

answered 2018-11-09 16:46:30 -0600

updated 2018-11-09 17:21:55 -0600

If by running OpenStudio measures independently of OpenStudio you mean independently of OpenStudio Server, there is always the option of calling the Command Line Interface directly, but you lose the scalability, queue management, and sampling algorithms that come with OpenStudio Server. You would also need to write a script to alter copies of a template OSW to sweep the parameter space. Since the OSW is structured as a JSON file so it can be edited without a custom API.

As an example of a simple OSW parametric run you can look at the BESTEST-GSR repository that we use for our BESTEST workflow. This runs OSW's on multiple cores, and creates a summary CSV from simulation results.

As far as server deployment documentation if you want to give that another try, the wiki on openstudio-sever github page is a good place to look. I will say that the vast majority of users who run algorithmic PAT analyses, use the EC2 functionality built into with PAT. You can save internal development time, but then have to pay Amazon for that service.

edit flag offensive delete link more

Comments

@David Goldwasser By "running OpenStudio measures independently of OpenStudio", I mean unistalling Openstudio, creating a parser for the idf text files, modifying the ruby files to modify the idf text files directly, automatically creating a directory structure for the the different measure combinations applied to the base idf, and a script to explore the directory structure running energyplus on each idf file.

mldichter's avatar mldichter  ( 2018-11-09 16:54:27 -0600 )edit

@David Goldwasser Those instructions look comprehensive, so I'm confident they contain everything I need to setup openstudio-server, but at the same time WAY over my head. We are HVAC engineers, not computer scientists.

I suppose that answers my question. We'll bypass openstudio entirely and only use energyplus with another program to generate all the idf files. We've done something similar in the past, but it was rudimentary find and replace inside the idf files. This will require more work, but I think I'm capable.

I will accept your answer. Thanks for your input.

mldichter's avatar mldichter  ( 2018-11-09 17:00:03 -0600 )edit

@mldichter if standing up a server for PAT is confusing, you may want to instead try the OpenStudio CLI template I posted to the unmet hours Github repository: https://github.com/UnmetHours/openstudio-scripts/tree/master/OpenStudio_CLI_Template. I've used it for the sort of parametric combinations you are doing in your project.

mdahlhausen's avatar mdahlhausen  ( 2018-11-09 19:16:44 -0600 )edit

@mdahlhausen This looks like just what I need. Thanks for pointing this out! I'll try it out on Monday.

mldichter's avatar mldichter  ( 2018-11-09 21:27:42 -0600 )edit

@mdahlhausen This is exactly what I needed! I got a little stuck at first, but generate_workflows.rb has everything on my wish list, and then some. The three ruby files are well commented, have examples, don't completely stop if one run fails, consolidate all the results, etc. And it was easy to set up!! I definitely couldn't have made it myself, but I can definitely modify the examples to do what I need. Thanks!!!

mldichter's avatar mldichter  ( 2018-11-13 15:57:24 -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

3 followers

Stats

Asked: 2018-11-09 14:12:03 -0600

Seen: 479 times

Last updated: Dec 12 '18