1

I am working on a software (Ruby - Sketchup) to calculate the radiation (sun, sky and surrounding buildings) within urban development at pedestrian level. The final goal is to be able to create a contour map that shows the level of total radiation. With total radiation I mean shortwave (light) and longwave(heat). (To give you an idea: http://www.iaacblog.com/maa2011-2012-digitaltools/files/2012/01/Insolation-Analysis-All-Year.jpg)

example

I know there are several existing software that do this, but I need to write my own as this calculation is only part of a more complex workflow.

The (obvious) pseudo code is the following:

Select and mesh surface for analysis
From each point of the mesh
  Cast n (see below) rays in the upper hemisphere (precalculated)
    For each ray check whether it is in shade
      If in shade => Extract properties from intersected surface
      If not in shade => Flag it
    loop
  loop
loop   

The approach above is brute force, but it is the only I can think of. The calculation time increases with the fourth power of the accuracy (Dx,Dy,Dazimth, Dtilt). I know that software like radiance use a Montecarlo approach to reduce the number of rays.

As you can imagine, the accuracy of the calculation for a specific point of the mesh is strongly dependent by the accuracy of the skydome subdivision. Similarly the accuracy on the surface depends on the coarseness of the mesh.

I was thinking to a different approach using adaptive refinement based on the results of the calculations. The refinement could work for the surface analyzed and the skydome. If the results between two adjacent points differ more than a threshold value, than a refinement will be performed. This is usually done in fluid simulation, but I could not find anything about light simulation.

Also i wonder whether there are are algorithms, from computer graphics for example, that would allow to minimize the number of calculations. For example: check the maximum height of the surroundings so to exclude certain part of the skydome for certain points.

I don't need extreme accuracy as I am not doing rendering. My priority is speed at this moment.

Any suggestion on the approach?

Thanks

n rays At the moment I subdivide the sky by constant azimuth and tilt steps; this causes irregular solid angles. There are other subdivisions (e.g. Tregenza) that maintain a constant solid angle.

EDIT: Response to the great questions from Spektre

  1. Time frame. I run one simulation for each hour of the year. The weather data is extracted from an epw weather file. It contains, for each hour, solar altitude and azimuth, direct radiation, diffuse radiation, cloudiness (for atmospheric longwave diffuse). My algorithm calculates the shadow mask separately then it uses this shadow mask to calculate the radiation on the surface (and on a typical pedestrian) for each hour of the year. It is in this second step that I add the actual radiation. In the the first step I just gather information on the geometry and properties of the various surfaces.

  2. Sun paths. No, i don't. See point 1

  3. Include reflection from buildings? Not at the moment, but I plan to include it as an overall diffuse shortwave reflection based on sky view factor. I consider only shortwave reflection from the ground now.

  4. Include heat dissipation from buildings? Absolutely yes. That is the reason why I wrote this code myself. Here in Dubai this is key as building surfaces gets very, very hot.

  5. Surfaces albedo? Yes, I do. In Skethcup I have associated a dictionary to every surface and in this dictionary I include all the surface properties: temperature, emissivity, etc.. At the moment the temperatures are fixed (ambient temperature if not assigned), but I plan, in the future, to combine this with the results from a building dynamic thermal simulation that already calculates all the surfaces temperatures.

  6. Map resolution. The resolution is chosen by the user and the mesh generated by the algorithm. In terms of scale, I use this for masterplans. The scale goes from 100mx100m up to 2000mx2000m. I usually tend to use a minimum resolution of 2m. The limit is the memory and the simulation time. I also have the option to refine specific areas with a much finer mesh: for example areas where there are restaurants or other amenities.

  7. Framerate. I do not need to make an animation. Results are exported in a VTK file and visualized in Paraview and animated there just to show off during presentations :-)

  8. Heat and light. Yes. Shortwave and longwave are handled separately. See point 4. The geolocalization is only used to select the correct weather file. I do not calculate all the radiation components. The weather files I need have measured data. They are not great, but good enough for now. https://www.lucidchart.com/documents/view/5ca88b92-9a21-40a8-aa3a-0ff7a5968142/0

Spektre
  • 49,595
  • 11
  • 110
  • 380
Rojj
  • 1,170
  • 1
  • 12
  • 32
  • Well, its not very clear what you're asking. But, you have a hemisphere that casts a shadow and you want to know for all point if they are within the shadow ? – Kshitij Banerjee Sep 08 '14 at 07:18
  • I am trying to do a bit more than that. I am calculating total radiation on the ground. Something like this [link](http://www.iaacblog.com/maa2011-2012-digitaltools/files/2011/12/Ecotect.jpg) – Rojj Sep 08 '14 at 07:25
  • I'd say a more efficient way would be to, cast the boundaries of the dome on the ground/objects . (By casting i mean projection.) The boundary of the dome on the ground/object will also be continuous - and all points within it are in shade.. – Kshitij Banerjee Sep 08 '14 at 07:28
  • hmm... Not sure I understand. Don't I need a direction to make a projection? I need to calculate the radiation generated by the whole dome, from every direction. Some of these directions could be in shade and in that case I calculate the thermal radiation from the surface. – Rojj Sep 08 '14 at 08:23
  • Well, you anyways cast n-rays from every point, im assuming to create the all directions effect... So you can chose n directions of your source, say the positions of the sun etc.. calculate n cast boundaries and then do your calculation.. The optimization will come from the fact that you are only processing the boundaries of the dome.. and not every point on the dome for each ray cast as earlier. – Kshitij Banerjee Sep 08 '14 at 09:08
  • Maybe I do not get what you mean with boundaries of the dome. My understanding is that I should project the surface where I want to calculate the radiation on the dome (grey in this [picture](https://www.dropbox.com/s/zs7o0gvlklr1ltv/projections.PNG?dl=0)) for each direction. For each direction this projections generates a boundary on the dome and of course only the directions within this boundary should be considered. I guess this projection should be clipped? – Rojj Sep 08 '14 at 11:08
  • there are ways to huge simplification of the complexity with very low accuracy loss but first you need add more info like: 1. what is the time frame are you doing map for: single shot or integration of radiation per some time (hour,day,year...)? 2. do you consider different Sun's path on the sky due to season change in Earth's axis tilt relative to Sun 3. do you also include reflections of light from buildings. 4. do you include heat dissipation from buildings ? 5. do yo have albedo values for all of the objects in the area. What is the resolution of your map? what is the target framerate? – Spektre Sep 18 '14 at 08:04
  • Also do you handle heat and light separately ? (in mine opinion they should be because they behave differently), what about weather (there are sunny days count for geo locations out there or use cloudiness percentage) try to edit your question add what you can and comment me by adding @spektre to comment – Spektre Sep 18 '14 at 08:08
  • @Rojj added answer some of the points are pretty extensive and could cover entire books but I tried to keep it as simple as I could hope did not forget something. the whole thing can be done by software or by any 3D rendering API like GL or DX. No ray tracing needed at all the complexity is almost the same as preview rendering of your target area for viewing. Sorry for the lack of info on IR part but I am not skilled/confident enough in that area as I would like to ... – Spektre Sep 18 '14 at 12:15

1 Answers1

1

visible light

for relatively flat global base ground light map I would use projection shadow texture techniques instead of ray tracing angular integration. It is way faster with almost the same result. This will not work on non flat grounds (many bigger bumps which cast bigger shadows and also change active light absorbtion area to anisotropic). Urban areas are usually flat enough (inclination does not matter) so the technique is as follows:

  1. camera and viewport

    the ground map is a target screen so set the viewpoint to underground looking towards Sun direction upwards. Resolution is at least your map resolution and there is no perspective projection.

    shadow/light map rendering

  2. rendering light map 1st pass

    first clear map with the full radiation (direct+diffuse) (light blue) then render buildings/objects but with diffuse radiation only (shadow). This will make the base map without reflections and or soft shadows in the Magenta rendering target

  3. rendering light map 2nd pass

    now you need to add building faces (walls) reflections for that I would take every outdoor face of the building facing Sun or heated enough and compute reflection points onto light map and render reflection directly to map

    reflections

    in tis parts you can add ray tracing for vertexes only to make it more precise and also for including multiple reflections (bu in that case do not forget to add scattering)

  4. project target screen to destination radiation map

    just project the Magenta rendering target image to ground plane (green). It is only simple linear affine transform ...

  5. post processing

    you can add soft shadows by blurring/smoothing the light map. To make it more precise you can add info to each pixel if it is shadow or wall. Actual walls are just pixels that are at 0m height above ground so you can use Z-buffer values directly for this. Level of blurring depends on the scattering properties of the air and of coarse pixels at 0m ground height are not blurred at all

IR

this can be done in similar way but temperature behaves a bit differently so I would make several layers of the scene in few altitudes above ground forming a volume render and then post process the energy transfers between pixels and layers. Also do not forget to add the cooling effect of green plants and water vaporisation.

I do not have enough experience in this field to make more suggestions I am more used to temperature maps for very high temperature variances in specific conditions and material not the outdoor conditions.

PS. I forgot albedo for IR and visible light is very different for many materials especially aluminium and some wall paintings

Spektre
  • 49,595
  • 11
  • 110
  • 380
  • Thanks a lot for taking the time to do this. After a first read it seems that it is not considering the radiation from the part of the sky that are not in the view. Are they lumped in the diffuse radiation? The IR is quite key as I calculate the radiation also at night. The radiation towards the sky is good for cooling. I am using the radiation map as one of the components of a 'comfort map'. In another software I run a CFD simulation to calculate the local air speed. I then combine the two maps to generate a very detailed comfort index that takes into account the morphology of the area. – Rojj Sep 18 '14 at 14:44
  • I don't think I can avoid to consider the whole skydome. Radiance for example uses first a coarse skydome subdivision and then it refines it in those sectors that show a big change. – Rojj Sep 18 '14 at 14:50
  • @Rojj yes the diffuse radiation should include the whole skydome light. It should be almost constant on the same altitude above ground at the same time. The differences are only in parts near bigger buildings. If you do proper soft shadows (like in bullet 5) then the outcome should be very similar. If you need to be more precise then you need to go to volumetric rendering also for Atmospheric scattering (ray casting is not enough for IR but in that case you need to include also local weather like winds dust etc else there is no accuracy boost) – Spektre Sep 18 '14 at 18:05