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

Increase 5 phase sun positions for ms windows

asked 2018-07-03 08:51:44 -0600

john.everist's avatar

updated 2018-07-03 10:16:47 -0600

Hello community

I'd like to better understand the direct solar component (CdsSun) in the 5 phase calculation. I doing this partly for interest and partly to see if there is a work around for MS Windows users to improve the sun position accuracy - limited to 145 sun positions questions the worth of making a 5 phase analysis.

My first question is:

Following Andrew McNeil's 5 phase tutorial, the script makes 5185 sun patches. When I look at the sunpatch file, all suns use the same material being "void light solar 0 0 3 1e6 1e6 1e6". If all suns use the same material how is impact of cloud cover (from the EPW file) factored in the intensity of the suns' and how is aresuns' intensity factored relative to its height in the sky? Is a correction happening via the reinhart.cal argument in rcontrib?

My second question is:

I was thinking that rather than use rcontrib, I could I produce the direct sun component (CdsSun) for the 5 phases separately using rpict. I could write a python script that renders the suns direct contribution for 8760 hours of the year then continue the standard 5 phase methodology. My first thoughts are that (providing the script cleans up after itself) this feasible and would take a similar amount of time. I can make sun only perez skies via genskymtx. Am I being naive here?

Finally - a suggestion for development. Do the radiance developers know you can easily increase the number of sun positions on windows 10 machines to 1297 (MF:3) via the command "_setmaxstudio". If you inbed this function (with appropriate syntax) in the rcontrib.exe script you can reset the maximum number open files to 2048. I've done it and it seems to work ok.

image description

Thanks for any comments / help

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2018-07-05 06:46:39 -0600

updated 2018-07-05 06:58:45 -0600

I was surprised that this works, but the Ubuntu 16.04 available as a free download through the Windows 10 app store actually manages to run Radiance commands (including the ones in the tutorial). Below is a screenshot of the Sky coefficients example from the tutorial (https://github.com/sariths/radTutoria...).

image description Based on the terminal commands alone, it seems that you can increase the number of file descriptors (I did not test this on a simulation).

image description

I built Radiance from source and found that some of the binaries that compile normally on a standard Ubuntu machine did not compile on the Windows version.


If you absolutely have to run the Five-Phase Method with 5000+ suns on a Windows OS, you can tweak the rcontrib command to work with modifier-lists instead of the multiplying factor and cal file. This ....

vwrays -vf views/eastBlinds.vf -x 400 -y 400 -pj 0.7 -ff | rcontrib -w- -i -ab 1 -ad 256 -lw 1.0e-3 -dc 1 -dt 0 -dj 0 -ffc -n 16 `vwrays -vf views/eastBlinds.vf -x 400 -y 400 -d` -o matrices/cds/hdrIllSpace/eastBlindsM6%04d.hdr -e MF:6 -f reinhart.cal -b rbin -bn Nrbins -m solar octrees/sunCoefficients.oct

..will be replaced by something like...

vwrays -vf views/eastBlinds.vf -x 400 -y 400 -pj 0.7 -ff  | \
    rcontrib -w- -i -ab 1 -ad 256 -lw 1.0e-3 -dc 1 -dt 0 -dj 0 -ffc -n 16 `vwrays -vf views/eastBlinds.vf -x 400 -y 400 -d` -o matrices/cds/hdrIllSpace/eastBlindsM6%04d.hdr -M solar_modifier_list_r6.txt octrees/sunCoefficients.oct

That way you can run the calculation with 512 or 1024 suns at a time and then renumber the files in the way dctimestep expects them to be. There are several intermediate steps that need to be tweaked to make this work, and the end result will likely be inefficient compared to the current one. The most obvious bottleneck being that even if you make this work, you'd still be running rcontrib on a single thread. Conversely if you run multiple instances of rcontrib on different threads (through Python Perl, Ruby etc), you'd still be only able to open 512 or 1024 files at a time.

This..

I was thinking that rather than use rcontrib, I could I produce the direct sun component (CdsSun) for the 5 phases separately using rpict. I could write a python script that renders the suns direct contribution for 8760 hours of the year then continue the standard 5 phase methodology. My first thoughts are that (providing the script cleans up after itself) this feasible and would take a similar amount of time. I can make sun only perez skies via genskymtx. Am I being naive here?

..might be worth testing. You'd have to parse through the 8760 hours in the wea file first and pass on the location details and direct normal radiation values to create an rpict image for each hour (that also means generating an octree ... (more)

edit flag offensive delete link more

Comments

Thankyou sarith, there is plenty for me to explore in your response. I’ll post an update if i find anything meaningful.

john.everist's avatar john.everist  ( 2018-07-05 07:16:50 -0600 )edit
1

answered 2018-07-03 10:41:32 -0600

I highly recommend you read Sarith Subramaniam's tutorial. In it, he covers many of these issues.

Thanks for the heads up on _setmaxstdio (NOT _setmaxstudio!). Given that is an environment-specific -- and in this case, an OS-specific -- instruction, the Radiance developer is unlikely to build this into the programs that could benefit from it. Even on *nix systems, many users have to set ulimit themselves to facilitate >3-phase operations. It's more of a user- or system-level setup thing. But this tip is definitely helpful for those on Windows10!

You may also want to post this on the newish Radiance Discourse Forum.

edit flag offensive delete link more

Comments

1

Actually, _setmaxstdio is used in rcontrib on Windows, in rcmain.c line 184 to be exact.

Nathaniel Jones's avatar Nathaniel Jones  ( 2018-07-03 11:20:30 -0600 )edit

I stand corrected. Thanks!

rpg777's avatar rpg777  ( 2018-07-03 11:41:25 -0600 )edit

Thanks for the pointer rpg777, sarith’s tutorial is a very fine document - its how i learnt the matrix method. It doesnt go to the detail i was curious for however.

john.everist's avatar john.everist  ( 2018-07-04 02:06:58 -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

1 follower

Stats

Asked: 2018-07-03 08:51:44 -0600

Seen: 385 times

Last updated: Jul 05 '18