Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
4

Custom BSDF file script

asked 2016-11-14 18:36:04 -0600

Determinant's avatar

updated 2017-08-28 16:13:56 -0600

The current Radiance measure has a few different built-in BSDF choices but I need to write a script that can take a any arbitrary user-specified BSDF XML file and run it in the Radiance engine of OpenStudio.

My planned approach is that the user-specified BSDF files would be made outside of OpenStudio (genBSDF). I would then rewrite the RadianceMeasure's measure.rb. Specifically in calculateDaylightCoeffecients I'd rewrite mapping.rad to look at a different BSDF XML (e.g. replace "blinds.xml" with "my_slats.xml" in mapping.rad). I would also of course rewrite the measure interface to ask which BSDF file the user wanted to use.

This seems workable even though I think this is kind of a work-around because on first inspection it looks like the usual BSDF files (blinds.xml, etc.) may actually be hard-coded into the OpenStudio to Radiance translation program.

Does anyone foresee any problems in using this approach?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-11-15 11:38:40 -0600

Yes! This is cool, good on ya for taking this on. You are correct, the BSDF assignments (and the control algorithms) are hard coded into the Radiance forward translation step. This was in the interest of expedience, as we did not have time to build the interface required to facilitate user-specified BSDFs. There is a very basic mapping done, based on the shading control chosen by the user, here in WindowGroup.cpp.

The easiest way to use your own BSDFs would be to add a loop that rewrites mapping.rad sometime after the translation but before all the Radiance simulation crap happens. Actually I'd just do it right before calculateDaylightCoeffecients. Were you to embark on this today, I'd recommend you just hack this, and simply rewrite mapping.rad using full path(s) to the BSDF(s) you want to use. OpenStudio 2.0's API will have much better support for accessing files and assigning and referencing them in measures. At that point, I think the right answer would be to change the measure interface to allow users to specify the BSDFs in the GUI.

Speaking of hacks, you had also asked about the purpose of the air.bsdf file in your earlier comment. This is basically a unit matrix that passes all the flux through the window interface, unaltered. It's used for calculating the illuminance for a window group's "shades up" condition. This way we only have to compute one 3-phase pair of daylight coefficients per (shaded) window group. We sacrifice a bit of accuracy (the perfectly specular transmission is being smeared out to the 145 Klems hemispherical subdivisions) in the interest of speed and conservation of disk space. For windows with no shades, we simply do a "single phase" daylight coefficient calc for flux at the points of interest (with the actual glazing in the windows). The best solution for shaded windows is to use the 5-phase methodology but that comes with its own issues and challenges in the context of a GUI and what we were trying (and funded) to do. So, the basic workflow is dumbed down a bit and it is what it is. The beauty is it's all there in the repository and you are welcome to improve it. I look forward to seeing what you come up with! Please let us know if you have more questions as you get into it.

edit flag offensive delete link more

Comments

2

Thanks Mr. Keitel. This is very very helpful and I will keep you informed of the progress (and problems of course)...more to come.

Determinant's avatar Determinant  ( 2016-11-15 18:05:02 -0600 )edit

+1 for "Mr. Keitel".

rpg777's avatar rpg777  ( 2016-11-16 16:09:15 -0600 )edit

That was my rationale for the +1. What happens when you change your photo, though?

__AmirRoth__'s avatar __AmirRoth__  ( 2016-11-16 16:37:18 -0600 )edit

Determinant is a very strong name, also. Very matrix-y.

__AmirRoth__'s avatar __AmirRoth__  ( 2016-11-16 16:38:15 -0600 )edit

How close is the 5-phase implementation? Also, one of the measures I'm exploring will be automated shades, so it would be nice to have windows partially covered...is this possible with these tools? feature coming soon?

Determinant's avatar Determinant  ( 2016-12-14 18:45:39 -0600 )edit
1

Five-phase in OpenStudio? That is not close at all; that work is not started, nor is it funded. Partially-covered windows are possible now, but you'd have to subdivide the window into as many discrete steps as you wanted for the shades to be deployed. Then you'd simply have a separate shading control on each slice of window. The sensor is automatically placed at the center of the largest polygon in a given window group, so bear that in mind. You could also have different setpoints for each window portion's control, which could be fun.

rpg777's avatar rpg777  ( 2016-12-15 13:26:32 -0600 )edit

Also keep in mind that if you finely subdivide the window you will create exponential growth in the number of datasets and thus the amount of time for the calculations and storage required.

rpg777's avatar rpg777  ( 2016-12-15 13:28:05 -0600 )edit

Thanks. So as I understand it. You mean to create a separate window for each step of closed blind, then control those as you would any other. My next questions: I'm also looking at electrochromics. Any hints on how I might approach modifying this? I'd like to change OS/Radiance's built-in on/off transmittance. Also, is the DGP in OS the enhanced simplified or just simplified?

Let me know if my questions warrant a different format than this forum.

Determinant's avatar Determinant  ( 2016-12-27 16:57:29 -0600 )edit

Also, what adaptive angles are chosen when "Number of Daylighting Views" is incremented? How can I access this in OS (i.e. not in the Sketchup plugin)?

Determinant's avatar Determinant  ( 2016-12-27 17:15:18 -0600 )edit

I think it would be more helpful if these last two comments were re-posted as actual questions...

rpg777's avatar rpg777  ( 2017-01-09 12:05:16 -0600 )edit

Got it. Some of this just got put on hold so will post if/when it becomes relevant again. In the meanwhile have other question(s) that I will post.

Determinant's avatar Determinant  ( 2017-01-09 14:23:06 -0600 )edit

Hi, I'm joining this conversation as my question is related. These replies are from one year ago, so I'm asking for an update: is the use of custom user defined BSDF (created with LBNL-WINDOW or genBSDF) already implemented in Open Studio? And also any hint of the possibility of image generation for dynamic glare analysis (sorry if I'm out-of-date, I stopped using OS for a while), thank you!

basdav's avatar basdav  ( 2018-06-21 02:33:10 -0600 )edit

No change. There is zero funding for daylighting/Radiance-related development in OpenStudio.

rpg777's avatar rpg777  ( 2018-06-21 11:33:17 -0600 )edit

@basdav@rpg777 I did make a version for user-specified BSDFs. You can also swap a window's construction and frame/divider and change the construction and frame/divider parameters (VT, depth, etc.). I have other mods planned as well. I was about to upload to the BCL but the "official" test procedures were throwing me test-procedure-type errors (not errors in the Radiance measure mods) so I haven't moved forward. I can send it to you if you like.

Determinant's avatar Determinant  ( 2018-06-21 13:55:32 -0600 )edit

Awesome, @Determinant! Yes let's talk offline about your test issues. robert.guglielmetti [at] nrel [dot] gov

rpg777's avatar rpg777  ( 2018-06-21 14:31:37 -0600 )edit

@rpg777@Determinant Thank you for your replies! well..I'd like to have a look to it as well if possible, thank you! miinchaca [at] gmail

basdav's avatar basdav  ( 2018-06-21 22:06:20 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2016-11-14 18:36:04 -0600

Seen: 424 times

Last updated: Nov 15 '16