Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS:ShadingControl with multiple subsurfaces in different zones creates dupicate WindowShadingControl objects #5317

Open
eringold opened this issue Dec 12, 2024 · 0 comments
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed

Comments

@eringold
Copy link
Contributor

eringold commented Dec 12, 2024

Issue overview

Assigning the same ShadingControl object to windows in different zones results in multiple WindowShadingControl idf objects that reference just one Zone Name, all with the same collection of windows.

Current Behavior

MCVE:

require 'openstudio'

include OpenStudio::Model

model = Model.new

# create a couple zones with spaces and windows 
windows = []

length, width, height = [3.0] * 3

2.times do |i|
  floor_vertices = [
    OpenStudio::Point3d.new((i * width),0,0),
    OpenStudio::Point3d.new((i * width),length, 0),
    OpenStudio::Point3d.new(width + (i * width),length,0),
    OpenStudio::Point3d.new(width + (i * width),0,0)
  ]

  space = Space.fromFloorPrint(floor_vertices, height, model, "Space #{i}").get

  south_wall = space.surfaces.select {|s| s.outwardNormal.y.abs > 0.9}.min_by {|s| s.vertices.map(&:y).min }

  window_vertices = [
    OpenStudio::Point3d.new((i * width) + (width / 2) - 1, 0, 1),
    OpenStudio::Point3d.new((i * width) + (width / 2) + 1, 0, 1),
    OpenStudio::Point3d.new((i * width) + (width / 2) + 1, 0, 2),
    OpenStudio::Point3d.new((i * width) + (width / 2) - 1, 0, 2)
  ]
  
  window = SubSurface.new(window_vertices, model)
  window.setSubSurfaceType('FixedWindow')
  window.setSurface(south_wall)
  windows << window

  tz = ThermalZone.new(model)
  space.setThermalZone(tz)
  
end

model.getThermalZones.each do |tz| 
  puts tz.name
  tz.spaces.first.surfaces.each {|s| s.subSurfaces.each {|w| puts w.name}}
end
# =>
# Thermal Zone 1
# Sub Surface 1
# Thermal Zone 2
# Sub Surface 2

# add shading control
shading_mat = Blind.new(model)
shading_control = ShadingControl.new(shading_mat)

# control both windows
windows.each {|w| w.addShadingControl(shading_control)}

ft = OpenStudio::EnergyPlus::ForwardTranslator.new
idf = ft.translateModel(model)
# => 
# [openstudio.model.ShadingControl] <0> For Object of type 'OS:ShadingControl' and named 'Shading Control 2', SubSurface already exists.
# [openstudio.energyplus.ForwardTranslator] <0> Object of type 'OS:ShadingControl' and named 'Shading Control 1' controls SubSurfaces in multiple zones
# [openstudio.energyplus.ForwardTranslator] <0> Object of type 'OS:ShadingControl' and named 'Shading Control 2' controls SubSurfaces in multiple zones

idf.getObjectsByType('WindowShadingControl').each do |o| 
  puts o.getString(1)
  o.extensibleGroups.each do |g|
    puts g.getString(0)
  end
end
# =>
# Thermal Zone 1
# Sub Surface 1
# Sub Surface 2
# Thermal Zone 1
# Sub Surface 1
# Sub Surface 2

Expected Behavior

Per EnergyPlus I/O Reference:

Field: Zone Name
Name of the zone where this shading control is used.
Field: Fenestration Surface Name
The name of a FenestrationSurface:Detailed, Window, or GlazedDoor object controlled by this WindowShadingControl. This field can be repeated to apply the same shading control to more than one fenestration surface. When Multiple Surface Control Type is set to Sequential, the order of the Fenestration Surface Names is the order that the shades will be deployed. The object is extensible so additional fields of fenestration surface names can be added to the object. All of the fenestration surfaces must be either in the zone specified in the Zone Name field or in an adjacent zone connected by an interior window.

Note: despite the bolded section, EnergyPlus will run just fine with multiple WindowShadingControls where the referenced Zone doesn't contain the FenestrationSurface, and appears to apply the shading to all surfaces (maybe it only cares if shading is connected to a daylighting control?).

I think where windows in different zones are added to the same ShadingControl object, OpenStudio should make one WindowShadingControl per zone (with Zone Name field set accordingly), and only that zone's windows as the Fenestration Surface Name(s).

Possible Solution

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): Windows 11
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.9.0
@eringold eringold added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed
Projects
None yet
Development

No branches or pull requests

1 participant