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

Revision history [back]

Use find_energyplus to find (highest)available version of EnergyPlus

Hi I'm working on a project that use the RunOSM library to run osm files through EnergyPlus. What I want to do is to search for the highest version of EnergyPlus installed in the user's machine and use it to run osm model. So I guess would need to change the code within the RunOSM class.

The original code of finding EnergyPlus in the RunOSM is:

ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,3)

Which will store the path information of the EnergyPlus Version 8.3 in hash ep_hash. However, in case the user only has EnergyPlus 8.2 installed, EnergyPlus would be found and reports error.

Here is what I did to replace the line above:

ep_hash = Hash.new
while ep_hash[:energyplus_exe].nil?
  ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,idx)
  idx -= 1
  break if idx < 0 
end

So that it will search for the highest version of EnergyPlus while still capable to run with lower versions.

This seems to work in term of finding other version of EnergyPlus, while still reports error says certain job "did not finish successfully" when I run RunOSM in my main program, I figured I might need to modify the find_energyplus code developed by NREL or is there any other more elegant way for this without touching the source code?

Thanks!

Use find_energyplus to find Find and run with (highest)available version of EnergyPlus

Hi I'm working on a project that use the RunOSM library to run osm files through EnergyPlus. What I want to do is to search for the highest version of EnergyPlus installed in the user's machine and use it to run osm model. So I guess would need to change the code within the RunOSM class.

The original code of finding EnergyPlus in the RunOSM is:

ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,3)

Which will store the path information of the EnergyPlus Version 8.3 in hash ep_hash. However, in case the user only has EnergyPlus 8.2 installed, EnergyPlus would be found and reports error.

Here is what I did to replace the line above:

ep_hash = Hash.new
while ep_hash[:energyplus_exe].nil?
  ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,idx)
  idx -= 1
  break if idx < 0 
end

So that it will search for the highest version of EnergyPlus while still capable to run with lower versions.

This seems to work in term of finding other version of EnergyPlus, while still reports error says certain job "did not finish successfully" when I run RunOSM in my main program, I figured I might need to modify the find_energyplus code developed by NREL or is there any other more elegant way for this without touching the source code?

Thanks!

Find and run with (highest)available version of EnergyPlus

Hi I'm working on a project that use the RunOSM library to run osm files through EnergyPlus. What I want to do is to search for the highest version of EnergyPlus installed in the user's machine and use it to run osm model. So I guess would need to change the code within the RunOSM class.

The original code of finding EnergyPlus in the RunOSM is:

ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,3)

Which will store the path information of the EnergyPlus Version 8.3 in hash ep_hash. However, in case the user only has EnergyPlus 8.2 installed, EnergyPlus would be found and reports error.

Here is what I did to replace the line above:

idx = 3
ep_hash = Hash.new
while ep_hash[:energyplus_exe].nil?
  ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,idx)
  idx -= 1
  break if idx < 0 0
  ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,idx)
  idx -= 1    
end

So that it will search for the highest version of EnergyPlus while still capable to run with lower versions.

This seems to work in term of finding other version of EnergyPlus, while still reports error says certain job "did not finish successfully" when I run RunOSM in my main program, I figured I might need to modify the find_energyplus code developed by NREL or is there any other more elegant way for this without touching the source code?

Thanks!

Find and run with (highest)available version of EnergyPlus

Hi I'm working on a project that use the RunOSM library to run osm files through EnergyPlus. What I want to do is to search for the highest version of EnergyPlus installed in the user's machine and use it to run osm model. So I guess would need to change the code within the RunOSM class.

The original code of finding EnergyPlus in the RunOSM is:

ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,3)

Which will store the path information of the EnergyPlus Version 8.3 in hash ep_hash. However, in case the user only has EnergyPlus 8.2 installed, EnergyPlus would be found and reports error.

Here is what I did to replace the line above:

idx = 3
ep_hash = Hash.new
while ep_hash[:energyplus_exe].nil?
  break if idx < 0
  ep_hash = OpenStudio::EnergyPlus::find_energyplus(8,idx)
  idx -= 1    
end

So that it will search for the highest version of EnergyPlus while still capable to run with lower versions.

This seems to work in term of finding other version of EnergyPlus, while still reports error says certain job "did not finish successfully" when I run RunOSM in my main program, I figured I might need to modify the find_energyplus code developed by NREL or is there any other more elegant way for this without touching the source code?

Thanks!