NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
496 stars 190 forks source link

Wrong OS:Daylighting:Control rotation angle translated #3216

Closed eringold closed 4 years ago

eringold commented 6 years ago

OpenStudio only translates the OS:Daylighting:Control input 'theta rotation around the Y-Axis' (the other rotations are ignored), and sets that value to the Daylighting:ReferencePoint input "Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis". This happens here: https://github.com/NREL/OpenStudio/blob/develop/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateThermalZone.cpp#L457-L469

In OpenStudio, 'rotation around the Y-axis' (the zone north axis) is rotation in the vertical plane. This can be seen in Sketchup if you place a daylighting control object and change the theta value. The expected Daylighting:ReferencePoint EnergyPlus input, however, is "the angle, measured clockwise in the horizontal plane, between the zone y-axis and the occupant view direction." (ref: https://bigladdersoftware.com/epx/docs/8-9/input-output-reference/group-daylighting.html#field-glare-calculation-azimuth-angle-of-view-direction-clockwise-from-zone-y-axis).

In aircraft terms, for a body facing north, EnergyPlus is expecting the yaw angle, but OpenStudio is translating the roll angle.

To reflect the expected input, OpenStudio should be translating the phiRotationAroundZAxis value.

joseph-robertson commented 4 years ago

Edit to the link above:

https://github.com/NREL/OpenStudio/blob/2fe43e38d04570310be30725a8c6d175853fa1fe/src/energyplus/ForwardTranslator/ForwardTranslateThermalZone.cpp#L474-L478

joseph-robertson commented 4 years ago

Another potential issue:

https://github.com/NREL/OpenStudio/blob/2fe43e38d04570310be30725a8c6d175853fa1fe/src/energyplus/ForwardTranslator/ForwardTranslateThermalZone.cpp#L475

This is converting rad to deg. But isn't primaryDaylightingControl->thetaRotationAroundYAxis() already in degrees?

jmarrec commented 4 years ago

@eringold @joseph-robertson

I am not certain the proposed fix is correct. These are Euler angles. Note that I haven't checked in Sketchup so I could be wrong (I'll try to boot windows later)

Perhaps it should actually be phiRotationAroundZAxis - 90°?

Here's a superb Pinta (opensource linux paint) drawing, in red is what I think OpenStudio does (Phi), and in Blue (Phi') is what I think EnergyPlus might be looking for:

image

eringold commented 4 years ago

@jmarrec This is what Sketchup shows for a Theta rotation - the daylight object is rotated in the XZ plane, about the Y axis:

OS_3216_1

My interpretation of the relevant EnergyPlus input is that it should receive what Sketchup shows as the Phi rotation - in the XY plane, about the Z axis:

OS_3216_2

jmarrec commented 4 years ago

Cool, thanks!

joseph-robertson commented 4 years ago

Where did we land on this?

@jmarrec

jmarrec commented 4 years ago

@joseph-robertson I don't know where @macumber 's comments went, but I have a trace in my email client, and he confirmed that your fix is good and so did @eringold. So I'm good with that. I approved the PR (which I cannot merge).