URBANopt fails when certain HVAC templates are used in Dragonfly (Ruby gem activation + Prototype.hvac_systems error)

Hi Chris @chris and others,

I’m working on a Dragonfly + URBANopt workflow to simulate a 300m × 300m residential block using district heating. I noticed that the URBANopt simulation runs successfully when no HVAC system is assigned (i.e., exporting a geometry-only model without HVAC).
However, when I assign certain HVAC templates, the simulation fails during the OpenStudio model conversion step, even though the same model runs normally when other HVAC templates are selected.

For example, the model runs successfully with:

  • DOAS with fan coil chiller with gas unit heaters

However, when I switch to other HVAC types (such as PSZ-AC with baseboard district hot water), DF Run URBANopt returns an error indicating that uo cannot execute or the workflow stops during OSM-to-IDF conversion. The same building geometry, schedule, and scenario settings are used—only the HVAC template is different.

Environment

Item Version
OS Windows 10
Rhino / Grasshopper Rhino 8
Ladybug Tools 1.9.0
URBANopt CLI 1.0.1
OpenStudio CLI 3.9.0

According to the Solution exception, I checked the run.log files. Hier ist one of the log files contents:

Error Log

[20:09:22.932201 ERROR] [ruby] Error activating gem :/ruby/gems/3.2.0/specifications/matrix-0.4.2.gemspec
[20:09:22.933227 ERROR] [ruby] Error activating gem :/ruby/3.2.0/specifications/rake-13.2.1.gemspec
[20:09:22.934782 ERROR] [ruby] Error activating gem :/ruby/3.2.0/specifications/ast-2.4.2.gemspec
[20:09:22.939392 ERROR] [ruby] Error activating gem :/ruby/3.2.0/specifications/openstudio-extension-0.8.2.gemspec
[20:09:34.503881 ERROR] [openstudio.measure.OSRunner] SWIG director method error. NoMethodError: undefined method `empty?' for nil:NilClass

Traceback (most recent call last):
C:/Users/zmy49/simulation/TestModel/.bundle/install/ruby/3.2.0/gems/openstudio-standards-0.7.1/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb:6896:in `model_add_hvac_system'
C:/Users/zmy49/simulation/TestModel/.bundle/install/ruby/3.2.0/gems/honeybee-openstudio-2.38.19/lib/to_openstudio/hvac/Model.hvac.rb:414:in `add_cbecs_hvac_system'
C:/Users/zmy49/simulation/TestModel/.bundle/install/ruby/3.2.0/gems/honeybee-openstudio-2.38.19/lib/to_openstudio/hvac/template.rb:92:in `to_openstudio'
C:/Users/zmy49/simulation/TestModel/.bundle/install/ruby/3.2.0/gems/honeybee-openstudio-2.38.19/lib/to_openstudio/model.rb:604:in `block in create_hvacs'
C:/Users/zmy49/simulation/TestModel/.bundle/install/ruby/3.2.0/gems/honeybee-openstudio-2.38.19/lib/to_openstudio/model.rb:577:in `each_value'
C:/Users/zmy49/simulation/TestModel/.bundle/install/ruby/3.2.0/gems/honeybee-openstudio-2.38.19/lib/to_openstudio/model.rb:577:in `create_hvacs'
C:/Users/zmy49/simulation/TestModel/.bundle/install/ruby/3.2.0/gems/honeybee-openstudio-2.38.19/lib/to_openstudio/model.rb:209:in `create_openstudio_objects'
C:/Program Files/ladybug_tools/resources/measures/honeybee_openstudio_gem/lib/measures/from_honeybee_model/measure.rb:116:in `run'
2 Likes

Thanks for reporting, @Sophie .

This seems like a bug related to the fact that the URBANopt component is still using the old Ruby translator for the creation of OSMs while components like the “Model To OSM” component uses a new Python translator.

I’ll investigate shortly and I should be able to push a fix to unblock you. But, once this is done, I probably need to just bite the bullet and convert the URBANopt component over to using the new Python translator.

1 Like

Thanks a lot, Chris! Really appreciate the quick clarification.

I will wait for your fix and I’m happy to test any pre-release version if needed.
Looking forward to the updated URBANopt workflow with the new Python translator — it will definitely improve stability for district thermal and block-scale simulation workflows.

Thanks again for the support!

1 Like