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!
@macumber should be able to go into more details, but I can say that a specific version of OpenStudio is only capable of doing forward translation to IDF for a specific version of EnergyPlus. OpenStudio 1.7 writes to EnergyPlus 8.2. OpenStudio 1.8 will write to EnergyPlus 8.3. In the past when people want to use a newer EnergyPlus that isn't yet supported I have suggested using EnergyPlus's version translation tool then EP Launch. While I have not done it I've been told there should be a way to access it from ruby.
Thanks David, that helps too.