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

eppy outputs in ubuntu

asked 2018-04-18 19:50:38 -0600

afshin67's avatar

updated 2018-04-21 08:43:47 -0600

I use this example from eppy documentation to run a simulation:

iddfile = "/usr/local/EnergyPlus-8-9-0/Energy+.idd"
IDF.setiddname(iddfile)

idfname = "/usr/local/EnergyPlus-8-9-0/ExampleFiles/BasicsFiles/Exercise1A.idf"
epwfile = "/usr/local/EnergyPlus-8-9-0/WeatherData/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"
idf = IDF(idfname, epwfile)
idf.run()

The document says that I should get an output like:

Processing Data Dictionary
Processing Input File
Initializing Simulation
Reporting Surfaces
Beginning Primary Simulation
Initializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
Warming up {5}
Warming up {6}
Starting Simulation at 07/21 for CHICAGO_IL_USA COOLING .4% CONDITIONS DB=>MWB
Initializing New Environment Parameters
Warming up {1}
Warming up {2}
Warming up {3}
Warming up {4}
Warming up {5}
Warming up {6}
Starting Simulation at 01/21 for CHICAGO_IL_USA HEATING 99.6% CONDITIONS
Writing final SQL reports
EnergyPlus Run Time=00hr 00min  0.24sec

,however, I get nothing in the python. Only I see these new files in the directory that I run the python script: eplusout.audit eplusout.bnd eplusout.dxf eplusout.eio eplusout.end eplusout.err eplusout.eso eplusout.mdd eplusout.mtd eplusout.mtr eplusout.rdd eplusout.shd. These files include a lot different outputs, but the point is that I could not find any standard way of reading these files through eppy. In the documentation, there is a section Reading outputs from E+ which explains how one can use htmlreader to extract the output of E+ simulations. However, there is no html file among the generated files. I can read those files manually through f.read() function in python, but I thought probably I am missing a point and there should a way to get the output of the idf.run() directly in python. I would appreciate any help and comment.

Thanks, Afshin

edit retag flag offensive close merge delete

Comments

Add the following objects to your IDF file

OutputControl:Table:Style,
HTML;                    !- Column Separator

Output:Table:SummaryReports,
AllSummary;              !- Report 1 Name

See if you get the HTML report

santoshphilip's avatar santoshphilip  ( 2018-04-19 10:15:10 -0600 )edit

@santoshphilip Thanks for the suggestion. I tried newobject = idf.newidfobject("OutputControl".upper()), but it gives me ValueError: 'OUTPUTCONTROL' is not in list. It seems that my idd file does not have it. Do you know a idd which includes it?

afshin67's avatar afshin67  ( 2018-04-19 13:00:12 -0600 )edit

Additionally, is there any way to get a given output in return of calling idf.run()? not by reading some result file,

afshin67's avatar afshin67  ( 2018-04-19 13:01:18 -0600 )edit

I made my first comment without testing. I'll look to see how to make it work.

Regarding your second comment about getting an output directly after idf.run(). You can probably do it by writing your own function

def runandgetresult(idf):
    """untested code"""
    idf.run() # I think this line waits until the run is complete
    htmltablename = functiontomakethename(idf)
    htables = readhtml.titletable(open(htmltablename, 'r'))
    return htables[0]

if your code is useful, I'll add it to eppy

santoshphilip's avatar santoshphilip  ( 2018-04-19 15:49:12 -0600 )edit

I added the objects using: idf.idfobjects['OUTPUTCONTROL:TABLE:STYLE'] = 'HTML; !- Column Separator'idf.idfobjects['OUTPUT:TABLE:SUMMARYREPORTS']= 'AllSummary; !- Report 1 Name', but it complains about CalledProcessError: Command '[u'/usr/local/EnergyPlus-8-9-0/energyplus', u'--output-directory', u'/home/afshin', u'--weather', '/usr/local/EnergyPlus-8-9-0/WeatherData/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw', u'/home/afshin/in.idf']' returned non-zero exit status 1. I am trying to figure out the problem with the route.

afshin67's avatar afshin67  ( 2018-04-19 15:52:33 -0600 )edit

About the function, I am kind of confused. let me re-paraphrase it, does E+ write the outputs in the html file or whatever format, or you get them on the fly and write them on those file? If it is the latter case, why not just returning them in a dictionary and make it available in the python level?

afshin67's avatar afshin67  ( 2018-04-19 15:57:31 -0600 )edit

I am agreeing with you. I can see that it would be a useful functionality. I am suggesting that you write a function that does what you are describing. To clarify:

  • idf.run() is a python wrapper around the EnergyPlus command line interface
  • it will run the IDF file and produce the output files
  • Note that run() give you access to all the parameters of the command line interface. See middle of this page

unmethours is not letting me write more. Open an issue in eppy issues

santoshphilip's avatar santoshphilip  ( 2018-04-19 17:25:19 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-04-23 10:16:49 -0600

santoshphilip's avatar

Generating the HTML file

To generate an html input file, your IDF file has to have the objects that will generate the HTML file. Add these two objects to your IDF file, and it will generate the HTML file.

Output:Table:SummaryReports,
    AllSummary;              !- Report 1 Name
OutputControl:Table:Style,
    HTML,                    !- Column Separator
    None;                    !- Unit Conversion

Reading Energyplus outputs thru eppy or python.

  • Eppy has functions to read the HTML file. It is documented here
  • EnergyPlus will also generate csv files

if you are using eppy to generate the csv files you have to do

idf.run(readvars=True)

Note: some of the earlier version of EnergyPlus will not run with readvars=True. It will run on EnergyPlus-8-9-0

edit flag offensive delete link more

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: 2018-04-18 19:50:38 -0600

Seen: 638 times

Last updated: Apr 23 '18