First time here? Check out the Help page!

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

Energy Plus EPPY Scripting - Design Day Problem

asked 6 years ago

shashank236's avatar

Hello all, I am working on a python script to simulate a model for multiple orientations and locations simultaneously. (initially focusing on ideal air loads) My approach: 1.) Model the building in sketchup 2.)Import to openstudio 3.)Add the weather file and ddy for the first location and normal building orientation 4.)Run the simulation

Now I have the idf file. Using EPPY and my script I run simulations for various orientations and locations.

Problem: Although EPPY lets me select a weather file while running EP, I don't see an option to specify design day. All my locations end up having the same design data, the one I specified in openstudio. Is there an easy way to modify the dd for each location?

I imagine we could use python to copy design day data for a location from their ddy file to SizingPeriod:DesignDay section of the idf file but this seems very tedious. Any thoughts? Much appreciated.

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
6

answered 6 years ago

santoshphilip's avatar

eppy can read a "weather.ddy" file. (The design days are in the *.ddy file). You can do:

# assuming you have already opened an E+ file called `idf`
ddyidf = IDF("weather.ddy")
designdays = ddyidf.idfobjects["SizingPeriod:DesignDay".upper()]
designday = designdays[0]
print designday # check to see if it happened

# copy a design day into your idf file
idf.copyidfobject(designday)
idf.printidf() # check if it actually copied it in.

Using this, every time you switch the weather file, you can write some code that will insert the Design Days from the corresponding ddy file

Preview: (hide)
link

Comments

Thank you. This works like a charm! Reduced my script length by 20%. bdw thanks for your work on eppy. Great resource. Much appreciated. .

shashank236's avatar shashank236  ( 6 years ago )

@shashank236, glad to know that eppy has been useful. Encourages us to keep improving it. Also, if you write any code using eppy, that may be useful to others, you can contribute it at witheppy

santoshphilip's avatar santoshphilip  ( 6 years ago )
2

answered 6 years ago

I think the eppy solution would be a script that populates the SizingPeriod:DesignDay objects based on the data from the DDY files. Another possible solution using Python is to append the appropriate DDY file that has the same name as the epw file. See:

https://stackoverflow.com/questions/1...

Preview: (hide)
link

Comments

1

The solution @santoshphilip gave is great. That is probably the best way to go.

JasonGlazer's avatar JasonGlazer  ( 6 years ago )

Hi Jason, Thanks for your reply. That was my solution initially. Copying the design day data information from ddy file to idf file after every iteration. Moreover, I had to rename all the ddy files to .txt before copying anything. Although it worked, but the eppy solution seems more elegant and less time consuming.

shashank236's avatar shashank236  ( 6 years ago )
1

answered 6 years ago

updated 6 years ago

See Santosh's answer as that seems like the best way of doing this using EPPY.

This can also be done easily using Modelkit. I just published a demo video on this exact problem.

You would just need to modify your IDF file so that it has no Design Day objects. Then your root file would be just a couple lines, inserting your IDF file and the location parameter. Check out the video, and the subsequent video on rakefiles, and let me know if you have any questions.

Preview: (hide)
link

Comments

1

Hi Eric, Thanks for your reply. Checking out your series on youtube soon.

shashank236's avatar shashank236  ( 6 years ago )

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: 6 years ago

Seen: 812 times

Last updated: Apr 22 '19