It would be great if we could run EnergyPlus directly from our IDF wouldn’t it?
Well here’s how we can.
In [2]:
# you would normaly install eppy by doing
# python setup.py install
# or
# pip install eppy
# or
# easy_install eppy
# if you have not done so, uncomment the following three lines
import sys
# pathnameto_eppy = 'c:/eppy'
pathnameto_eppy = '../'
sys.path.append(pathnameto_eppy)
In [3]:
from eppy.modeleditor import IDF
iddfile = "/Applications/EnergyPlus-8-3-0/Energy+.idd"
IDF.setiddname(iddfile)
In [4]:
idfname = "/Applications/EnergyPlus-8-3-0/ExampleFiles/BasicsFiles/Exercise1A.idf"
epwfile = "/Applications/EnergyPlus-8-3-0/WeatherData/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw"
idf = IDF(idfname, epwfile)
idf.run()
if you are in a terminal, you will see something like this::
It’s as simple as that to run using the EnergyPlus defaults, but all the EnergyPlus command line interface options are also supported.
To get a description of the options available, as well as the defaults you can call the Python built-in help function on the IDF.run method and it will print a full description of the options to the console.
In [5]:
help(idf.run)
Note: idf.run() works for E+ version >= 8.3
One of the great things about Eppy is that it allows you to set up a lot of jobs really easily. However, it can be slow running a lot of EnergyPlus simulations, so it’s pretty important that we can make the most of the processing power you have available by running on multiple CPUs.
Again this is as simple as you’d hope it would be.
You first need to create your jobs as a list of lists in the form::
The example here just creates 4 identical jobs apart from the output_directory the results are saved in, but you would obviously want to make each job different.
Then run the jobs on the required number of CPUs using runIDFs...
... and your results will all be in the output_directory you specified.