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

OpenStudio Version Discrepancies Errors

asked 2016-05-10 13:45:08 -0500

Cole.S gravatar image

updated 2017-08-05 07:59:15 -0500

I have recently successfully run an OpenStudio measure without any errors, but until today, the measure does not successfully run. The error I am receiving is new, and judging by the general description, it appears to pertain to a version discrepancy. I believe I updated OpenStudio to 1.11.0 after successfully running the measure, but didn't realize the updating would cause problems. Needless to say, I'm not really sure how to tackle the issue, so any help would be great.

To clarify, several lines of code were written to clone a unit heater from an osm file (MTH150.osm). The code is:

        heater_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/resources/MTH150.osm")
        heater_inputmodel=translator.loadModel(heater_path)
        translator = OpenStudio::OSVersion::VersionTranslator.new
        heater_inputmodel=heater_inputmodel.get
        heater_in_zone=heater_inputmodel.getZoneHVACUnitHeaters[0]

        # Clone Unit Heater and Add To Thermal Zone
        heater_clone = heater_in_zone.clone(model).to_ZoneHVACUnitHeater.get
        heater_clone.addToThermalZone(thermalZones[0])

Portions of the error message can be seen by the attachment. Again, I have not had any problems with running the measure before and am not certain of how to approach the problem.

image description

edit retag flag offensive close merge delete

Comments

How are you running your tests? It appears that the Ruby you are using to run your tests is pointing to an old OpenStudio install (1.10.1) but your model is 1.11.0.

macumber gravatar image macumber  ( 2016-05-10 13:54:48 -0500 )edit

I'm running them on a git shell. I've gone through the Gemfile, Gemfile.lock, and Rakefile for the specific repository that the measure is located in but can't seem to locate specific lines of code that point to an older version of OpenStudio. Does that make sense?

Cole.S gravatar image Cole.S  ( 2016-05-10 13:58:18 -0500 )edit

I personally have a 'openstudio.rb' file in my Ruby install under '\lib\ruby\site_ruby' that points to the version of OpenStudio to use. You should talk to whoever set you up to begin with to see if they remember.

macumber gravatar image macumber  ( 2016-05-10 15:13:17 -0500 )edit

I just now saw your comment, but you are right. I revised that file and no errors seem to be occurring. Thanks for the help!

Cole.S gravatar image Cole.S  ( 2016-05-12 11:43:52 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-05-10 20:16:45 -0500

updated 2016-05-10 20:17:40 -0500

My first thought is that the measure isn't doing version translation on the osm file in the resources folder beofre it loads it. If you are now opening it as a 1.11.1 model it could behave unexpectedly.

Here is an example of how to load a model with version translation.

# load  model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + "/resources/example_model.osm")
model = translator.loadModel(path)
if not model.empty?
  model = model.get
end

Is this measure on BCL, if so can you provide a link, Thanks.

edit flag offensive delete link more

Comments

Hi David,

I believe the translation was completed in a similar way to what you describe above, except the variable 'translator' was defined in previous lines. Anyways, the measure isn't on BCL, but I will send you an email of the folder.

Cole.S gravatar image Cole.S  ( 2016-05-11 07:11:08 -0500 )edit

I used your original zip file, and the test ran fine on my machine with 1.11.0 using the "MHT150" value for the "heater_name" argument. It seems like the translator is doing what it should. Looking at the image showing the error from your in the original message it seems like the Git Shell that you are trying to run the test from is still pointing to OpenStudio 1.10.1 while the file it is trying to Open is 1.11.0

Since the OSM file isn't just used for a test, but also for running the measure, I would update the min version in the XML from 1.7.0 to 1.11.0 (if this is shared with others).

David Goldwasser gravatar image David Goldwasser  ( 2016-05-16 12:40:09 -0500 )edit
1

answered 2016-05-12 10:30:42 -0500

Cole.S gravatar image

updated 2016-05-16 12:27:26 -0500

I think I may have temporarily resolved the problem. The issue boiled down to which version the MTH150.osm file was saved as. For instance, when I originally ran the measure (successfully), the MTH150 was saved with version identifier 1.10.1, but I must have edited some things in the GUI and it must have saved as 1.11.0. The errors occurred because there are several differences between versions 1.10.1 and 1.11.0 when considering the object 'OS:Sizing:Zone.' The attached document shows the differences in their definitions. As far as the error message is concerned, I'm assuming that there is a handle defined somewhere that points to version 1.10.1 instead of 1.11.0, and because 1.11.0 defines the OS:Sizing:Zone object differently, then the error was struck. Due to the error being struck, it pretty much nullified the entire MTH150.osm file, and when attempted to be retrieved in the measure, the measure failed. I resolved this issue by just defining a new unit heater in version 1.10.1.

However, the issue remains that there is a version discrepancy, and at some point, I probably need to use only 1.11.0. Unfortunately, I'm not really sure what to fix to resolve the core issue. Any help would be great!

image description

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2016-05-10 13:45:08 -0500

Seen: 105 times

Last updated: May 16 '16