2

eppy outputs in ubuntu

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

afshin67's avatar
35
afshin67
asked 2018-04-18 19:50:38 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2018-04-21 08:43:47 -0500
edit flag offensive 0 remove flag 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 -0500) 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 -0500) 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 -0500) 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 -0500) 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 -0500) edit
add a comment see more comments

1 Answer

3

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

santoshphilip's avatar
961
santoshphilip
answered 2018-04-23 10:16:49 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments