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

Automatic simulating EnergyPlus with different occupancy schedule

asked 2015-09-09 05:48:36 -0500

nancynanxiaodan's avatar

updated 2015-09-09 09:31:39 -0500

Dear all,

my question here is about automatic simulating EnergyPlus with different occupancy schedule.

I am looking at a community level of dwellings, I need many (over 100 dwellings) energy performances of the dwellings which are the outputs of the EnergyPlus with different occupancy schedules. The occupancy schedules are generated from my database, and according to different occupancy schedules, there will be corresponding heating schedules which will give different heat demand.

In other words, I need to achieve that give a certain occupancy schedule and heating schedule, run EnergyPlus once and store the results in database, and then give another occupancy schedule and heating schedule, and then run EnergyPlus again and store the results in database. However, I couldnt do it manually, change the schedules one by one by myself, because I am looking at a community level which at least has hundreds of dwellings.

I am wondering if there any software tool could achieve my purpose, otherwise, is it possible to write my own codes to achieve my purpose.

Please give my some advise! Really appreciate your help.

edit retag flag offensive close merge delete

Comments

I dont think that you need co-simulation unless there is more to your scenario.

David Goldwasser's avatar David Goldwasser  ( 2015-09-09 09:06:57 -0500 )edit

5 Answers

Sort by ยป oldest newest most voted
8

answered 2015-09-11 10:44:11 -0500

I'd suggest using the parametric capability of OpenStudio Server. You could write a measure to apply your schedule changes to the models and then run the analysis on Amazon EC2. All the graphical analysis capabilities of OS-Server would be available for you to analyze your results (parallel coordinate plot, scatter plots, etc) as the model results get stored in a mongo database. You can also download a csv or R dataframe of the entire results to do custom plots or analysis offline.

A user guide for OS-server lives here. There are also several examples in the github repo.

This approach will also work on existing E+ models using E+ measures, so having a seed OpenStudio model is not necessary (you just wont get access to the model userscript functionality of OS).

edit flag offensive delete link more

Comments

Hey Brian, thanks for your answer! I am wondering if i am using openStudio server, should i re-create all HVAC system in detail? Coz, what I have now is quite complex which I really dont want to create new hvac system in OpenStudio again.

The occupancy schedules are generated from my other modelling, when you say 'You could write a measure to apply your schedule changes to the models and then run the analysis on Amazon EC2' Is this including all schedules or I should change the schedules manually? Thanks

nancynanxiaodan's avatar nancynanxiaodan  ( 2015-09-11 12:27:27 -0500 )edit

You can still use OS-server with your original IDF. Set the seed model to be the EmptySeedModel.osm that is in the /seed directory. Then use the InjectOsmGeometryIntoAnExternalIdf measure that is in the /measures directory and give it the path to your IDF and set the Merge Geometry argument to FALSE. This will essentially skip all the OS functionality and insert your IDF into the workflow. From this point on, you can use an E+ measure to change/replace the schedules you want. The trick will be to parameterize the measure with an argument that will change the schedules the way you want.

BrianLBall's avatar BrianLBall  ( 2015-09-11 13:35:01 -0500 )edit

Once you parameterize the measure with the argument that changes the schedules the way you want, you can turn that measure argument into a variable in the OS-spreadsheet and then apply an algorithm (like sampling, or full factorial design) to run all the combinations you are looking for.

An example would be to make a 'choice' argument that is the name of the schedule you want to add to the model. Write the measure so that it takes that 'choice' name, and applies the schedule changes correctly to the model. Then you can give a discrete list of choice values to the spreadsheet to run.

BrianLBall's avatar BrianLBall  ( 2015-09-11 13:42:01 -0500 )edit

@nancynanxiaodan the most straight forward approach for changing out schedules would be to pre-load the possible schedules into your IDF file. The the measure will just swap out schedule assignments based on user arguments. You could keep the schedules in separate IDF files or generate them on the fly from a CSV file, but unless there is a reason not to, just put them in your original IDF.

I don't know if we have an EnergyPlus measure that does exactly what you want, but I can try to put some sample code together in another comment later this afternoon.

David Goldwasser's avatar David Goldwasser  ( 2015-09-11 13:59:59 -0500 )edit

arg_string would be user argument. "orig" would be contained in name of schedules in seed idf.

# change people schedules
people = workspace.getObjectsByType("People".to_IddObjectType)
people.each do |object|
  orig_sch = object.getString(2).get
  object.setString(2,orig_sch.gsub('orig',arg_string))
end
# change heating schedules
thermostats = workspace.getObjectsByType("ThermostatSetpoint:DualSetpoint".to_IddObjectType)
thermostats.each do |object|
  orig_sch = object.getString(1)
  object.setString(1,orig_sch.gsub('orig',arg_string))
end
David Goldwasser's avatar David Goldwasser  ( 2015-09-11 14:28:19 -0500 )edit
5

answered 2015-09-09 13:41:25 -0500

updated 2015-09-09 18:22:22 -0500

It sounds like something you could do pretty easily with a CSV file with all of your schedules in, a Schedule:File object in your IDF, and either jEPlus, a Python script, or a Parametric:SetValueForRun object.

Depending on how powerful your computer is, how many different occupancy schedules you want to simulate, and how quickly you need the results you could either run this on your own machine, on the Ensim ENSIMS platform if you use jEPlus, AWS or other cloud system, or on a server cluster at your university if they make one available (Raven at Cardiff, Legion at UCL, etc.).

Eppy is another option that I'll happily promote. If you decide to use it and have any trouble then ask another question here. I'm working on some code that handles schedules at the moment so might be able to help out.

edit flag offensive delete link more

Comments

Dear Jamie, thanks for your help here. I've looked at the Eppy which seems pretty easy to understand its capability from the web. From my understanding that what Eppy's capability is that it could easily make change of the IDF file. May I ask that if all the occupancy schedules are loaded in the IDF file, could EnergyPlus simulate them all at the same time? Or what it will do is change schedule and run the simulation and then change the schedule again, and then run the simulation again, and repeat the process to end. And about the Raven at my university, could be used for it. Thanks very much.

nancynanxiaodan's avatar nancynanxiaodan  ( 2015-09-16 13:29:35 -0500 )edit
4

answered 2015-09-09 09:31:03 -0500

Sounds like you just need a parametric tool. You could try OpenStudio's PAT. Or if you already have the IDF file and don't want to re-create the HVAC in OpenStudio, you could try jEPlus+EA or APIDAE Factors.

edit flag offensive delete link more
3

answered 2015-09-09 09:50:00 -0500

If you are looking for a solution using the Python programming language, you can try using Eppy along with sqlite3.

edit flag offensive delete link more
0

answered 2015-09-11 12:55:04 -0500

nancynanxiaodan's avatar

Thanks all for your answers, I will have a detailed search on your suggestion and then choose one to solve my problem.

Thank you all very much!

edit flag offensive delete link more

Comments

were you able to import your occupancy schedules into your idf file? I'm looking to do the same and looking for any help.

divsood04's avatar divsood04  ( 2022-02-25 06:36:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

3 followers

Stats

Asked: 2015-09-09 05:48:36 -0500

Seen: 1,432 times

Last updated: Sep 11 '15