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

Daylighting Controls translator should default to space name not zone name #4841

Open
mdahlhausen opened this issue Mar 27, 2023 · 6 comments

Comments

@mdahlhausen
Copy link
Collaborator

Issue overview

This issue was uncovered in openstudio-standards testing, specifically this test.
The model fails in EnergyPlus, because space daylighting objects are binned together into a zone daylighting control. But the daylighting controls in the thermal zone don't share the same enclosure, which throws an error in EnergyPlus.

Current Behavior

The test errors applying daylighting controls to a multi-story multifamily building. This user model has 4 levels of corridor spaces, all stacked on top of each other, that share a thermal zone.
The baseline daylighting control method adds daylight sensors to the space, which looks like this in the .osm:

OS:Daylighting:Control,
  {02c2d90d-4494-4271-b85f-0cd2a9d80e00}, !- Handle
  L1-N_corr Daylt Sensor 1,               !- Name
  {51e9fe26-905f-4282-b172-07bd4e347c4e}, !- Space Name
  -65.1304982249999,                      !- Position X-Coordinate {m}
  -2.667,                                 !- Position Y-Coordinate {m}
  0.762,                                  !- Position Z-Coordinate {m}
  ,                                       !- Psi Rotation Around X-Axis {deg}
  ,                                       !- Theta Rotation Around Y-Axis {deg}
  ,                                       !- Phi Rotation Around Z-Axis {deg}
  375,                                    !- Illuminance Setpoint {lux}
  Stepped,                                !- Lighting Control Type
  0.3,                                    !- Minimum Input Power Fraction for Continuous Dimming Control
  0.2,                                    !- Minimum Light Output Fraction for Continuous Dimming Control
  3,                                      !- Number of Stepped Control Steps
  1,                                      !- Probability Lighting will be Reset When Needed in Manual Stepped Control
  ,                                       !- Number of Daylighting Views
  22;                                     !- Maximum Allowable Discomfort Glare Index

OS:Daylighting:Control,
  {0627b45e-c5cf-4e5f-9382-2a95c4aad47e}, !- Handle
  L1-N_corr Daylt Sensor 2,               !- Name
  {51e9fe26-905f-4282-b172-07bd4e347c4e}, !- Space Name
  -63.7946585443181,                      !- Position X-Coordinate {m}
  -2.667,                                 !- Position Y-Coordinate {m}
  0.762,                                  !- Position Z-Coordinate {m}
  ,                                       !- Psi Rotation Around X-Axis {deg}
  ,                                       !- Theta Rotation Around Y-Axis {deg}
  ,                                       !- Phi Rotation Around Z-Axis {deg}
  375,                                    !- Illuminance Setpoint {lux}
  Stepped,                                !- Lighting Control Type
  0.3,                                    !- Minimum Input Power Fraction for Continuous Dimming Control
  0.2,                                    !- Minimum Light Output Fraction for Continuous Dimming Control
  3,                                      !- Number of Stepped Control Steps
  1,                                      !- Probability Lighting will be Reset When Needed in Manual Stepped Control
  ,                                       !- Number of Daylighting Views
  22;                                     !- Maximum Allowable Discomfort Glare Index

This gets translated to this object in EnergyPlus:

Daylighting:Controls,
  Thermal Zone: L1-N_corr DaylightingControls, !- Name
  Thermal Zone: L1-N_corr,                !- Zone or Space Name
  ,                                       !- Daylighting Method
  ,                                       !- Availability Schedule Name
  Stepped,                                !- Lighting Control Type
  0.3,                                    !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control
  0.2,                                    !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control
  3,                                      !- Number of Stepped Control Steps
  1,                                      !- Probability Lighting will be Reset When Needed in Manual Stepped Control
  L1-N_corr Daylt Sensor 1,               !- Glare Calculation Daylighting Reference Point Name
  -0,                                     !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg}
  22,                                     !- Maximum Allowable Discomfort Glare Index
  ,                                       !- DElight Gridding Resolution {m2}
  L1-N_corr Daylt Sensor 1,               !- Daylighting Reference Point Name 1
  0.135,                                  !- Fraction of Lights Controlled by Reference Point 1
  375,                                    !- Illuminance Setpoint at Reference Point 1 {lux}
  L1-N_corr Daylt Sensor 2,               !- Daylighting Reference Point Name 2
  0.106,                                  !- Fraction of Lights Controlled by Reference Point 2
  375;                                    !- Illuminance Setpoint at Reference Point 2 {lux}

When this run, it hits this error in EnergyPlus:
Daylighting:Controls: invalid Zone or Space Name="THERMAL ZONE: L1-N_CORR" All spaces in the zone must be in the same enclosure for daylighting.

This issue appears similar to #4786

Expected Behavior

Daylight control object should retain its space assignment in EnergyPlus, not its parent thermal zone. Daylight depends on space geometry, and lots of spaces could be part of the same thermal zone.

Steps to Reproduce

  1. Run the above openstudio-standards test in OSv3.5.1 or above.

Possible Solution

I suggest having the default translate each OS:Daylighting:Control object to its own space-level Daylighting:Controls in EnergyPlus.

Details

Environment

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

  • Platform (Operating system, version): Windows
  • Version of OpenStudio (if using an intermediate build, include SHA): OSv3.5.1

Context

This is causing testing errors in App G baseline methods in openstudio-standards.

@mdahlhausen mdahlhausen added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Mar 27, 2023
@tijcolem tijcolem added severity - Normal Bug component - Model severity - Major Bug and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed severity - Normal Bug labels Mar 28, 2023
@jmarrec
Copy link
Collaborator

jmarrec commented Mar 31, 2023

// TODO: JM 2021-10-15: Aren't we having a lot of problems with DaylightingControls? Yes we are!
// Sooooo. Our API prevents us from effectively writing the daylightng objects to a Space because the ThermalZone itself bears the
// Primary/Secondary daylighting control + fraction of lights controlled.
// E+ will yell if you have space enclosures but the Daylighting objects are on Zone-level (also, it currently does not work, IlluminanceMap
// only accepts Zone level, and Daylighting:ReferencePoint should support Space Name but it doesn't)
// So here if the zone has daylighting control, we make an airwall between spaces and convert non airwalls to InternalMass
// another awesome thing is that z.primaryDaylightingControl() || z.secondaryDaylightingControl() || z.illuminanceMap() is probably not safe, since a
// DaylightingControl that isn't directly referenced to a zone might be translated too, because DaylightingControl does reference a space itself

@jmarrec
Copy link
Collaborator

jmarrec commented Mar 31, 2023

Hum actually if I stack two spaces atop each other with daylighting controls in each it works, because the ceiling -> floor does ends up an air boundary construction.
If I replace the cpnstruction in the IDF then I do end up with the E+ fatal.

@jmarrec
Copy link
Collaborator

jmarrec commented Mar 31, 2023

Your roofceiling isn't intersected / matched with the above.

image

here's your Thermal Zone: L1-E_corr zone in isolation

image

@jmarrec
Copy link
Collaborator

jmarrec commented Mar 31, 2023

@mdahlhausen surface intersecting + matching solves the E+ fatal

m = osload('in.osm')
m.getThermalZones.select{|z| z.spaces.size > 0 and z.primaryDaylightingControl.is_initialized}.each do |z|
   OpenStudio::Model::intersectSurfaces(OpenStudio::Model::SpaceVector.new(z.spaces))  
   OpenStudio::Model::matchSurfaces(OpenStudio::Model::SpaceVector.new(z.spaces))  
end
m.save('in_matched.osm', true)
ft = OpenStudio::EnergyPlus::ForwardTranslator.new
w.save('in_matched.idf', true)

Then the simulation works

$ /usr/local/EnergyPlus-22-2-0/energyplus -d out in_matched.idf 
EnergyPlus Starting
EnergyPlus, Version 22.2.0-aa78da9668, YMD=2023.03.31 10:45
Initializing Response Factors
[...]
EnergyPlus Run Time=00hr 00min 12.43sec
EnergyPlus Completed Successfully.

@jmarrec
Copy link
Collaborator

jmarrec commented Mar 31, 2023

I still think we should break API on this object, but probably not as close to the release as we are.

I think the DaylightingControl object is due for an overhaul, we should remove the Fields primary/Secondary Daylignhting Control and Fractions from ThermalZone at least.

Then I'm not yet 100% certain we should completely use the E+ API.

The main differences between E+ and OS:

E+

E+: DaylightingControls, refers a Space or Zone Name, and has an extensible field set:
* Daylighting:ReferencePoint for an (X, Y, Z) coordinate (+ the Zone or Space Name again ...)
* Fraction of lights controlled
* Illuminance setpoint (lux)

OS:

  • DaylightingControl (not plural)
    • It has the X, Y, Z position, and the illuminance setpoint
    • It also has Psi, Theta and Phi, which are for radiance purposes.
    • It attaches to a Space
  • The ThermalZone has a Primary/Secondary daylighting control object name + fraction controlled.

@mdahlhausen
Copy link
Collaborator Author

Thanks @jmarrec. It seems like a lot prm testing models on openstudio-standards were from OS v1.11 and had residual surface matching issues. They only started causing simulation breaking errors in the latest OS/E+ versions, which should fail in my opinion. I agree with you that the daylighting control object needs an re-work, especially given the addition of spaces to EnergyPlus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants