NREL / openstudio-model-articulation-gem

Other
7 stars 9 forks source link

radiance_measure requires glare sensor #93

Open Ski90Moo opened 2 years ago

Ski90Moo commented 2 years ago

I am not sure if this is an issue, but it appears that the radiance_measure requires a glare sensor to properly execute. If the OpenStudio model does not have a glare sensor installed, it will run radiance, but it seems the information is never passed to EnergyPlus for simulation.

jmarrec commented 2 years ago

https://github.com/NREL/openstudio-model-articulation-gem/blob/e3046799fb66cb9ef15bfe97729f43865e87b18b/lib/measures/radiance_measure/measure.rb#L1320

To work with the case where there are none, looks like it should be

-          t_radGlareSensorViews[space_name].each do |sensor, v|
+          t_radGlareSensorViews[space_name]&.each do |sensor, v|

or the same construct as this one:

https://github.com/NREL/openstudio-model-articulation-gem/blob/e3046799fb66cb9ef15bfe97729f43865e87b18b/lib/measures/radiance_measure/measure.rb#L1282-L1283

or move that inside that block that starts on L1282 actually

Ski90Moo commented 2 years ago

https://github.com/NREL/openstudio-model-articulation-gem/blob/e3046799fb66cb9ef15bfe97729f43865e87b18b/lib/measures/radiance_measure/measure.rb#L1320

To work with the case where there are none, looks like it should be

-          t_radGlareSensorViews[space_name].each do |sensor, v|
+          t_radGlareSensorViews[space_name]&.each do |sensor, v|

This seems to work. It allows radiance to run without a glare sensor.