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

Error using ComStock create_typical_building_from_model measure

asked 2024-04-24 18:52:07 -0600

James_BC's avatar

I ran into the following error while using the ComStock create_typical_building_from_model measure with the ashrae_90_1_2016 template. I get the same error with ashrae_90_1_2019. Can anyone suggest where I should look to troubleshoot?

Failed to run workflow. Last Error:
  Found error in state 'OpenStudioMeasures' with message: 'Runner error: Measure '/~ ... /measures/create_typical_building_from_model/measure.rb' reported an error with [SWIG director method error. ArgumentError: comparison of Float with nil failed

Traceback (most recent call last):
:/ruby/2.7.0/gems/openstudio-standards-0.5.0/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.PumpVariableSpeed.rb:138:in `>'
:/ruby/2.7.0/gems/openstudio-standards-0.5.0/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.PumpVariableSpeed.rb:138:in `pump_variable_speed_get_control_type'
:/ruby/2.7.0/gems/openstudio-standards-0.5.0/lib/openstudio-standards/prototypes/common/objects/Prototype.PumpVariableSpeed.rb:31:in `pump_variable_speed_control_type'
:/ruby/2.7.0/gems/openstudio-standards-0.5.0/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:1794:in `block in model_apply_prototype_hvac_assumptions'
:/ruby/2.7.0/gems/openstudio-standards-0.5.0/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:1794:in `each'
:/ruby/2.7.0/gems/openstudio-standards-0.5.0/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:1794:in `model_apply_prototype_hvac_assumptions'
edit retag flag offensive close merge delete

Comments

@James_BC can you share the workflow (.osw file) that produces this error?

ericringold's avatar ericringold  ( 2024-04-25 10:25:30 -0600 )edit

Hi Eric, Sorry, I don't think I can share the osw file publicly. But I think I fixed the source of the problem. I'm still running some simulations to see if they work, but so far so good.

On line 338 of the ComStock ChangeBuildingLocation measure I made this change:

From: climateZones.setClimateZone('ASHRAE', args['climate_zone'].gsub('ASHRAE 169-2006-', ''))

To: climateZones.setClimateZone('ASHRAE', args['climate_zone'].gsub('ASHRAE 169-2013-', ''))

James_BC's avatar James_BC  ( 2024-04-25 11:24:28 -0600 )edit

Thanks, that reminds me there's an open issue for this.

ericringold's avatar ericringold  ( 2024-04-25 11:45:04 -0600 )edit

Thanks Eric, I think my fix in ChangeBuildingLocation worked. I'm no longer getting that error, but my simulation failed at a later step in the workflow. I'll start a new question about it.

James_BC's avatar James_BC  ( 2024-04-25 13:52:03 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2024-04-25 07:13:02 -0600

It fails here: https://github.com/NREL/openstudio-st...

threshold is nil, most likely. Check the run log for openstudio.ashrae_90_1_2016.PumpVariableSpeedyou'll likely find a warn message that explains a bit more what's happening, eg this one https://github.com/NREL/openstudio-st...

edit flag offensive delete link more

Comments

Thanks Julien, I looked in the run.log like you suggested, and I found this error:

[15:02:07.075362 WARN] [openstudio.ashrae_90_1_2019.PumpVariableSpeed] Pump flow control requirement missing for chilled water pumps in climate zone: ASHRAE 169-2006-ASHRAE 169-2013-3C.
[15:02:07.075586 ERROR] [openstudio.measure.OSRunner] SWIG director method error. ArgumentError: comparison of Float with nil failed

This looks like a bug in the openstudio-standards measure: openstudio-standards/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.PumpVariableSpeed.rb

James_BC's avatar James_BC  ( 2024-04-25 09:56:40 -0600 )edit
1

It's expecting ASHRAE 169-2013-3C not ASHRAE 169-2006-ASHRAE 169-2013-3C.

https://github.com/NREL/openstudio-st...

Seems like you need to adjust the climate zone tags in your model.

(Disclaimer: I don't know anything about how Comstock works)

Julien Marrec's avatar Julien Marrec  ( 2024-04-25 09:59:50 -0600 )edit

on line 19, a str is constructed:

climate_zone = "#{climate_zone.institution} 169-#{climate_zone.year}-#{climate_zone.value}"

My guess is somehow the str is coming out wrong and we get: "ASHRAE 169-2006-ASHRAE 169-2013-3C"

Since that doesn't appear in the list of options, we get an error. What do you think?

James_BC's avatar James_BC  ( 2024-04-25 10:00:02 -0600 )edit

Adjust the climate zone tags like I said. The correct value is demonstrated below

m = OpenStudio::Model::Model.new
czs = m.getClimateZones
czs.setClimateZone(ClimateZones::ashraeInstitutionName, 2013, "3C")
puts czs
OS:ClimateZones,
  {f2293dd2-77c1-4f5b-9dcd-600e2c8a457c}, !- Handle
  ASHRAE,                                 !- Climate Zone Institution Name 1
  ANSI/ASHRAE Standard 169,               !- Climate Zone Document Name 1
  2013,                                   !- Climate Zone Document Year 1
  3C;                 !- Climate Zone Value 1
Julien Marrec's avatar Julien Marrec  ( 2024-04-25 10:03:57 -0600 )edit

See:

climate_zone = czs.climateZones[0]
"#{climate_zone.institution} 169-#{climate_zone.year}-#{climate_zone.value}"

=> "ASHRAE 169-2013-3C"

Julien Marrec's avatar Julien Marrec  ( 2024-04-25 10:05:27 -0600 )edit

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2024-04-24 18:52:07 -0600

Seen: 140 times

Last updated: Apr 25