用于辐射计算的遮罩算法 [英] Shading mask algorithm for radiation calculations

查看:170
本文介绍了用于辐射计算的遮罩算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个软件(Ruby-Sketchup)来计算步行者在城市发展中的辐射(太阳,天空和周围的建筑物).最终目标是能够创建一个轮廓图,以显示总辐射水平.对于总辐射,我指的是短波(光)和长波(热). (为您提供一个想法: http://www.iaacblog.com/maa2011-2012-digitaltools/files/2012/01/Insolation-Analysis-All-Year.jpg )

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)

我知道有几种现有的软件可以执行此操作,但是我需要编写自己的软件,因为此计算只是更复杂的工作流程的一部分.

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   

以上方法是蛮力的,但这是我唯一能想到的方法.计算时间随精度的四次方(Dx,Dy,Dazimth,Dtilt)而增加.我知道像radiance这样的软件会使用Montecarlo方法来减少射线数量.

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?

谢谢

n条光线 此刻,我以恒定的方位角和倾斜步长细分天空.这会导致不规则的立体角.还有其他细分部门(例如Tregenza)可保持恒定的立体角.

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.

回答Spektre的重大问题

Response to the great questions from Spektre

  1. 时间范围.我一年中的每个小时都运行一次模拟.天气数据是从epw天气文件中提取的.它每小时包含太阳高度和方位角,直射辐射,漫射辐射,阴天(对于大气长波漫射).我的算法分别计算荫罩,然后使用该荫罩计算一年中每个小时在表面(和典型行人)上的辐射.在第二步中,我添加了实际辐射.在第一步中,我只是收集有关各种曲面的几何形状和属性的信息.

  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.

太阳路径.不,我不知道.参见第1点

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

包括建筑物的反射吗?目前暂不,但我计划将其作为基于天空视图因子的整体漫反射短波反射包括在内.我现在只考虑地面的短波反射.

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.

包括建筑物的散热?绝对没错.这就是我自己编写此代码的原因.在迪拜,这是关键,因为建筑表面变得非常非常热.

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.

表面反照率?是的,我愿意.在Skethcup中,我为每个表面都关联了一个字典,在该字典中,我包括了所有表面特性:温度,发射率等.目前温度是固定的(如果未指定环境温度),但我计划在将来进行,以将其与已经计算出所有表面温度的建筑物动态热模拟结果结合起来.

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.

地图分辨率.分辨率由用户选择,网格由算法生成.在规模方面,我将其用于总体规划.规模从100mx100m到2000mx2000m.我通常倾向于使用2m的最小分辨率.限制是内存和仿真时间.我还可以选择使用更精细的网格细化特定区域:例如有餐厅或其他便利设施的区域.

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.

帧速率.我不需要制作动画.结果被导出到VTK文件中,并在Paraview中可视化并在那里进行动画处理,以在演示过程中炫耀:-)

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 :-)

热和轻.是的.短波和长波分开处理.请参阅第4点.地理定位仅用于选择正确的天气文件.我没有计算所有的辐射分量.我需要的天气文件有测量数据.它们不是很好,但目前已经足够好了. https://www.lucidchart.com/documents/查看/5ca88b92-9a21-40a8-aa3a-0ff7a5968142/0

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

推荐答案

可见光

对于相对平坦的全局基础地面光照贴图,我将使用投影阴影纹理技术代替光线跟踪角度积分.它的速度更快,结果几乎相同.这在非平坦的地面上将不起作用(许多较大的凹凸会投射较大的阴影,并且还会将有效的光吸收区域更改为各向异性).城市地区通常足够平坦(倾斜度无关紧要),因此技术如下:

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. 相机和视口

地面地图是目标屏幕,因此将视点设置为朝着太阳方向向上的地下视点.分辨率至少是您的地图分辨率,并且没有透视投影.

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.

渲染光照贴图第一遍

首先使用全辐射(直接+漫射)(浅蓝色)清除地图,然后渲染建筑物/对象,但仅使用漫辐射(阴影).这将使底图在洋红色渲染目标中没有反射和/或柔和阴影

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

第二次渲染光照图

现在您需要添加建筑物表面(墙壁)反射,以获取建筑物中面向太阳或足够加热的每个室外表面,并将反射点计算到光照贴图上,然后将反射直接渲染到贴图上

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

在这部分中,您可以为顶点添加光线跟踪,以使其更加精确,还可以包括多个反射(在这种情况下,别忘了添加散射)

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)

项目目标屏幕到目标辐射图

只需将洋红色渲染目标图像投影到地平面(绿色).只是简单的线性仿射变换...

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

后处理

您可以通过模糊/平滑光照贴图来添加柔和阴影.为了使其更加精确,可以将信息添加到每个像素(如果是阴影或墙壁).实际的墙只是距离地面0m高度的像素,因此您可以直接使用Z缓冲区值.模糊程度取决于空气的散射特性,并且地面高度0m处的粗像素完全不模糊

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.我忘记了IR的反照率,可见光对于许多材料(尤其是铝和一些壁画)而言是非常不同的

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

这篇关于用于辐射计算的遮罩算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆