1

AddDaylightSensors.rb error

When trying to use this script in the OpenStudio application as an "add measure now," I get the error that my spaces "has no exterior natural lighting. No sensor will be added." However, the spaces have a thermal zone, and have outdoor boundary conditions, so I'm not sure what qualifies as having exterior natural lighting. Here is a snippet of the code from the github site, but I can't interpret it, thanks for the help!

https://github.com/NREL/OpenStudio-an...

 #eliminate spaces that don't have exterior natural lighting
  has_ext_nat_light = false
  space.surfaces.each do |surface|
    next if not surface.outsideBoundaryCondition == "Outdoors"
    surface.subSurfaces.each do |sub_surface|
      next if sub_surface.subSurfaceType == "Door"
      next if sub_surface.subSurfaceType == "OverheadDoor"
      has_ext_nat_light = true
    end
  end
  if has_ext_nat_light == false
    runner.registerWarning("Space '#{space.name}' has no exterior natural lighting. No sensor will be added.")
   next
  end
jdunn's avatar
225
jdunn
asked 2014-10-28 22:03:38 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2015-07-27 11:56:44 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

This measure doesn't add in any windows, it only adds dayligt sensors. It first loops throu surfaces looking for surfaces with an exterior boundary condition. Then it loops through any subsurfaces that the surface has and if it has a sub-surface that isn't a door or overhead door sets this flag to true. "has_ext_nat_light = true". If one or more surface in a space is true for this it will add a sensor.

It was a basic proof of concept measure. We have office and school AEDG measures that are more advanced. They add fenestration as well as shading surfaces, light shelves, skylights, and daylighting controls. It removes your existing objects, and adds objects based on the 50% AEDG guidelines. To use this you need to use our templates or manually flag the building type and space types so the measure knows about the function of each space. This applies a more advanced logic on placing the sensor than the other measure.

David Goldwasser's avatar
20.4k
David Goldwasser
answered 2014-10-28 22:40:10 -0500, updated 2014-10-29 08:33:18 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks David for the prompt reply! I was indeed trying to run the measure before running the set window to wall area measure, so that totally makes sense. Even though this measure isn't as powerful as the AEDG ones, it is still very useful in automating the addition of daylight sensors in large models. Keep up the great work and thanks for your help!

jdunn's avatar jdunn (2014-10-29 09:03:44 -0500) edit

David -

One additional thing I noticed -- while the measure adds the control sensor, it does not connect the thermal zone and the daylight control together. The thermal zone in OS has a field for "Primary Daylighting Control Name," which gets autopopulated as long as you add the daylight control after you specify the thermal zone. With the measure, however, I noticed that it does not modify this field.

I know you mentioned that it was a "proof of concept" measure, so this might not have been in the scope of the script. However, adding this functionality would provide great value.

jdunn's avatar jdunn (2014-11-03 09:59:14 -0500) edit
add a comment see more comments