Demo - Running an EnergyPlus Simulation

To run an EnergyPlus simulation we need:

  • the directory on the local machine where EnergyPlus is installed.

  • the filepath of an EnergyPlus input file (either an .idf or an .epJSON file).

  • the filepath of an EnergyPlus weather file (an .epw file).

  • the directory on the local machine where the simulation results will be stored.

Using these four pieces of information, the runsim function can now run an EnergyPlus simulation.

1>>> from eprun import runsim
2>>> result=runsim(ep_dir=r'C:\EnergyPlusV9-6-0',
3>>>               input_filepath='1ZoneUncontrolled.idf',
4>>>               epw_filepath='USA_CO_Golden-NREL.724666_TMY3.epw',
5>>>               sim_dir='simulation_results')
6>>> print(type(result))
7<class 'eprun.epresult.EPResult'>

The runsim function calls the energyplus.exe application in the EnergyPlus install directory using the subprocess.run method from the Python Standard Library.

The runsim function returns a EPResult object instance. This object contains links to the EnergyPlus results files generated by the simulation, as well as the returncode and stdout results of the subprocess.run call.

The next section describes the EPResult object in more detail.

Further resources