NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
497 stars 190 forks source link

Open Studio crashes when importing DOE IDF files #2978

Closed wathaifi closed 6 years ago

wathaifi commented 6 years ago

I downloaded Miami model file from DOE website https://www.energycodes.gov/sites/default/files/documents/ASHRAE901_OfficeMedium_STD2013.zip

Next I used IDF Version Updater to update the file to v8.8. When I opened the updated file with IDF Editor, and did a Validity Check I got prompted for an error. The error was the ULC object, the object field was highlighted, so I choose UpperLeftCorner to fix the error. Every time I try to import this IDF file, Open Studio crashes. It happens with other files for other US cities under the above link. Please help.

jmarrec commented 6 years ago

Initially reported on unmethours here

jmarrec commented 6 years ago

Which file exactly is giving you an error @wathaifi?

I just tried with ASHRAE90.1_OfficeMedium_STD2013_Chicago.idf and it appears to work when I load it with the bindings (haven't tried in sketchup, on linux right now...)

jmarrec commented 6 years ago

Ok I see the GeometryRules error you're talking about:

[1] Downloads(main)> OpenStudio::Logger.instance.standardOutLogger.setLogLevel(OpenStudio::Info)
=> nil
[2] Downloads(main)> path = 'ASHRAE90.1_OfficeMedium_STD2013_Chicago.idf'
=> "ASHRAE90.1_OfficeMedium_STD2013_Chicago.idf"
[3] Downloads(main)> idf = OpenStudio::IdfFile::load(OpenStudio::Path.new(path), "EnergyPlus".to_IddFileType)
=> #<OpenStudio::OptionalIdfFile:0x000000085f6470 @__swigtype__="_p_boost__optionalT_openstudio__IdfFile_t">
[4] Downloads(main)> workspace = OpenStudio::Workspace.new(idf.get, "Draft".to_StrictnessLevel)
[utilities.idf.IdfObject] <-1> Field 9, 'Plant Loop Volume', of an object of type PlantLoop has 'autosize' as its value even though it is autocalculable.
[utilities.idf.IdfObject] <-1> Field 9, 'Plant Loop Volume', of an object of type PlantLoop has 'autosize' as its value even though it is autocalculable.
[utilities.idf.Workspace] <-1> Unable to add objects to Workspace. The validity report is: 
The collection is INVALID at strictness level 'Draft', because of the errors:
Field      level data error of type DataType          .
Error is in an object of type 'GlobalGeometryRules', named '', in field 0.
Additional information about the error type: field-level data is of an incorrect type.
=> #<OpenStudio::Workspace:0x000000086ee6c0 @__swigtype__="_p_openstudio__Workspace">

Look at geometry rules, and fix it:

[5] Downloads(main)> geo = idf.get.getObjectsByType("GlobalGeometryRules".to_IddObjectType)[0]
=> #<OpenStudio::IdfObject:0x000000088c6ba0 @__swigtype__="_p_openstudio__IdfObject">
[6] Downloads(main)> puts geo
GlobalGeometryRules,
  ULC,                                    !- Starting Vertex Position
  Counterclockwise,                       !- Vertex Entry Direction
  Relative;                               !- Coordinate System

=> nil
[7] Downloads(main)> geo.setString(0, "UpperLeftCorner")
=> true
[8] Downloads(main)> workspace = OpenStudio::Workspace.new(idf.get, "Draft".to_StrictnessLevel)
[utilities.idf.IdfObject] <-1> Field 9, 'Plant Loop Volume', of an object of type PlantLoop has 'autosize' as its value even though it is autocalculable.
=> #<OpenStudio::Workspace:0x000000087b6be8 @__swigtype__="_p_openstudio__Workspace">
jmarrec commented 6 years ago

As far as crashing the OpenStudio plugin, should try in Sketchup...

macumber commented 6 years ago

I saw translation errors when updating the file to E+ 8.8 using IdfEditor, did you also see these? E+ Version Translation errors would be an E+ issue.

ASHRAE90.1_OfficeMedium_STD2013_Chicago.VCpErr.txt

macumber commented 6 years ago

It seems the IdfEditor version translate button does not use the IDFVersionUpdater cumulative update feature. Here is the fully version translated file with corrected GlobalGeometryRules

ASHRAE90.1_OfficeMedium_STD2013_Chicago.idf.txt

The import is crashing at this line https://github.com/NREL/OpenStudio/blob/develop/openstudiocore/src/energyplus/ReverseTranslator/ReverseTranslateEnergyManagementSystemOutputVariable.cpp#L94

It looks like it is recursively calling translateAndMapWorkspaceObject with itself. @brianlball FYI

wathaifi commented 6 years ago

I'm not an expert user so cant really go into the files and change code to fix the issue. I need to know whats causing the problem as a start. Is there something wrong with IDF Version Updater, IDF Editor, OS? or is it the DOE files or the method I'm using. Do I gather from your comments that its OS? I'll try to answer some questions in the overview below:

It was a while back when I tried to work with these models and got errors, there are few hundred of them posted on DOE website, I tried some, few worked and many didn't. I'm using Miami medium office as an example, its one of those that caused the crash , just to see whats the main cause of this, other files created other errors.

I tried again today with the Chicago medium office IDF file, same issue ...

1- I used IDF Version Updater to update files from V8.0 to 8.8 The Audit file shows error incidents for each step in version transition 0 to 1, 1 to 2; etc. They all so seem OK, except 6 to 7 which shows multiple errors similar to this: Warning Object=AirTerminal:SingleDuct:VAV:Reheat, name=Core_bottom VAV Box Component, entered with less than minimum number of fields.

2- I imported the updated IDF file into OS and I got this error

The collection is INVALID at strictness level 'Draft', because of the errors: Field level data error of type DataType . Error is in an object of type 'GlobalGeometryRules', named '', in field 0. Additional information about the error type: field-level data is of an incorrect type.

3- I used IDF Editor and did a Validity Check and got this error: Invalid choice: ULC (GlobalGeometryRule // ULC // Starting Vertex Position)

I went to the Filed: Starting Vortex Position, to fix the error, the Object ULC was highlighted, I clicked on that object and choose "Upper Left Corner" from the menu, my assumption was that in a previous version ULC was used in the code and in the newer version this is replaced by "Upper Left Corner".

I did validity check again and there were no other errors

I saved the file after having corrected the error

4- I tried to import the file into OS, it crached

5- I tried to import the file into Sketchup it crashed

macumber commented 6 years ago

Your fix to the GlobalGeometryRule object is correct. After fixing that, there is a bug in the OpenStudio import of IDF to OSM related to translating EMS code. We will fix the crash related to EMS import.

Looks like you got what you need from the "Create DOE Prototype Building" measure so that is good.

wathaifi commented 6 years ago

Good to finally know the actual cause of the problem, and yes, Create DOE Prototype Building was great, I'm able to export the geometry easily. The plan is to use DesignBuilder to work with the geometry I export, in retrospect, I'm thinking that had I learned OS rather than DB, I could've continued to work with OS to do the modeling also, since the Measure produces the whole model including HVAC. The way I will be doing it, after the gbXML export, is that I have to build HVAC models first, then start to work with the models. Not sure if that is harder or learning to work with OS is harder