View factors : create a differential surface from CAD file

Hello,

I’m a total newbie to radiance. My goal here is to calculate the view factor between the outer surface a sensor (a radiometric cavity) and its immediate environment (the radiation shield and front aperture surrounding it) in order to later calculate the impact of the radiative exchange on the thermal equilibrium of the sensor in question.
I think I have understood how to convert the different shapes from .obj files exported by my CAD software to .rad files, attribute them different materials to make sure to calculate the view factor from one piece to another, with anything else acting as an obstruction and then, build the octree representing the scene.

Now I understand that -rcontrib is used to calculate the view factor between a (series of) differential surface(s) and another surface; which means that I must turn the radiometer into a set of differential surfaces (cloud of “oriented” points - list of x y z vx vy vz). Is there a way to easily do that ? A format to export your CAD file into, or a plug-in ? A tutorial to guide me to ? I welcome any help.

Thanks in advance
Julien

Hi Julien,

Welcome to the forum. You are asking an advanced question out of the gate, so the answer I’m about to give might be confusing. It might even be wrong, or at least wrong for your purpose, which I don’t fully understand.

It seems the tool that could be most useful is rfluxmtx, which is a kind of front-end to rcontrib. If you give it a set of “receiver” surfaces, it can generate a matrix of coefficients between some angular sampling of each receiver, which may be “u” for “uniform” in your case, and a single sender surface, also with a possible angular sampling. The rfluxmtx tool does the sample generation over receiver surfaces for you, simplifying the problem.

If you can describe your situation more completely, maybe include a JPEG figure or the like, I might be more helpful.

Best,
-Greg

Hi Greg,
Thank you for your answer. To describe the situation more completely, I’m a physicist specialised in sunlight irradiance measurements : these measurements are mostly done via “electrical substitution radiometers” : a black cavity kept at a steady temperature by means of electrical heating with a servo (a thermostat if you prefer), it’s geometry and coating make sure almost no light entering it escapes ; when light enters the cavity, it substitutes to part of the electrical heating and the difference in electrical heating needed to keep the temperature constant with or without light directly gives how much optical power, and thus irradiance, entered the cavity.

This supposes of course that the only parameters that change in the thermal equilibrium of the cavity are the incoming of (sun)light or not, and the electrical heating power, and that the heat exchanged between the cavity and its immediate surounding, by conduction or by radiation, is at least constant. This is typically achieved by surrounding the cavity by a “thermal shield” that is kept at a steady temperature by its own controlled electrical heating (usually a few degrees lower). That usually works perfectly well and we never have to try understanding the magnitude of the radiative and conductive heat exchanges between the cavity itself and its surrounding environment : they are constant and that’s all that matters.

Unfortunately, we launched a CubeSat (a small, cheap, test satellite with minimalistic design) three years ago, inequiped with a radiometer to measure the sun irradiance, and the heating wire supposed to keep the thermal shield of the radiometer was short-circuited, rendering it unusable. So we are able to measure the temperature of the shield surrounding the cavity , but we can’t keep it steady - the heating system of the cavity works like a charms and keeps its own temperature very steady on the other hand.

Now if we still want to be able to extract the incoming light from the data of the satellite, we have to evaluate how much heat is exchanged between the cavity and the shield surrounding it, which includes a radiative contribution, which demands that we know the viewfactor from the cavity to the shield (and also the precision apperture in front of the cavity that is a separete piece).

As you’ll see on the picture herewith, this is a bit more complex than cylinder to concentric cylinder, and our attemps for an analytic resolution failed (they resulted in non-physical results when we calculate the thermal equilibrium inside of the cavity). So what I’m trying to do now is to calculate the view factor between several pieces of the contraction (cavity to shield, cavity to apperture) that are at different temperature and each will have their own contributions to the thermal equilibrium of the cavity, whence my need to know the different view factors. These pieces have been modeled by the mechanical engineer of our team in .stp files that I have been able to convert them in .obj, and then to create .rad files for Radiance.

I discovered Radiance via several scientific publications that evaluated its ability to calculate the view factor via rcontrib and considered it better than radiosity based method when there are obstructions to take into account, but a scientific publication is not a tutorial. I do realise that what I’m asking is not a usual and probably an advanced question, but apparently, it’s doable, I’m just not entirely sure how it is to be done.

So, here is my more complete description of y situation. Sorry if it was long to read or too much information and I hope this helps clarify my question. In the meantime, I’ll read more in details about rfluxmtx.

Thanks again,
-Julien

Wow, Julien. Sounds like Real Science going on, here. I appreciate the complexity and difficulty of your challenge. It’s almost as if you want a set of evenly-spaced positions across your surface for form-factor calculation. The rfluxmtx is designed to compute flux transfer between hemispheres, so may not be suitable for this purpose after all.

The person who has the most experience with bending Radiance to do view-factor calculations is @sarith Perhaps you have read his (our) recent paper on the topic? My contributions were minor – he is definitely the brains on this one.

Is the temperature of your surrounding shield constant over its surface, or does that vary as well (or do you not have data)? If all you need is to know how much “shield” is visible from each point on the outside of your cavity, then it might just be a matter of counting ray intersections with rtrace. You would just need a method to generate randomly distributed rays from the outer cavity surfaces. I guess that’s the tricky part.

-Greg

Hi @JulAmd , this appears doable. As Greg mentioned, the tricky part might be to generate the rays on the cavity. However, here are a few open-source command line tools built around Radiance that could be leveraged for this purpose.
I think rcontrib is perhaps more suited for this task as we explained in the paper. I would have to look at your rad geometry file before I can propose anything definitive. If the actual geometry is not sharable, you can create a similar use-case and share that.

Regards,
Sarith

PS: Feel free to mail me sarith(at)rhrk(dot)uni-kl(dot)de in case you’d prefer to discuss this outside the forum.

Hi Julien,

If you are comfortable with Python, perhaps give frads a try. We have a function to calculate view factors that uses rfluxmtx on the backend.

Something like this might work:

import frads as fr

cavity_primitives = fr.unpack_primitives("cavity.rad")
shield_primitives = fr.unpack_primitives("shield.rad")
view_factors = fr.surfaces_view_factor(cavity_primitives, shield_primitives)
vf_cs = 0
for vfs in view_factors.values():
    vf_cs += sum(vfs.values())

Note that the cavity and shield surface normal should point inwards.

Hi @sarith , thank you for your answer. I have already read the paper that you and @Greg_Ward mention and it has been the most helpful source for my problem. This is precisely in generating the rays that I struggle.

I can share the design, we’re a public research institute and this is not our most secret bit of project ! You can find it on my public document carrier https://mail.meteo.be/home/[email protected]/Public/Radiance or on my own OneDrive : https://1drv.ms/u/s!Ai-U65tKi7UJiL5QBWjTOnu8LVFy-w?e=Cjem7s

Thanks again for the answer.
Julien

Hi Taoning,

That seems very interesting – do you use rfluxmtx on one sender surface at a time in your view factor calculation? I know that rfluxmtx normally finds an “average surface normal” for a collection of sender surfaces, which would tend to underestimate the view factor in this case. You must be doing something different.

-Greg

Yes, we assume the surface are already broken down into individual primitives and we just loop through each one. We also take into account the rest of the sender surfaces and flip the surface normal. When computing the view factor for one primitive, the “environment” is always the receiving surface plus the rest of the sender surfaces.

1 Like

Hi Taoning, I’m trying to implement your solution but I have two questions whose answers I can’t find in the doc :

  • How do you take obstructions into account, there are a two other pieces in my setup and some obstructions are gonna take place. Is there a way to import an octree that describes the whole scene ?
  • frads assumes that the surface is already broken down into primitives, says you. Based on what does it do that and more specifically, do I need to do it manually ?

Thank you for your contribution. My python is very basic but that’ll be a good excuse to lean a bit more into that language !

Julien

You need to include your obstruction inside your shield.rad. This means that you will calculate view factors to obstructions as well. You should name your identifiers properly so that you can easily separate them out later. For example, in your shield.rad file, you should have something like this (the material here doesn’t matter but we do need it):

void plastic mat1
0
0
5 .4 .4 .4 0 0

mat1 polygon shield1
0
0
 ...

mat1 polygon shield2
0
0
 ...

mat1 polygon obstruction1
0
0
 ...

In your cavity.rad file, you have something like this:

mat1 polygon cavity1
0
0
 ...

mat1 polygon cavity2
0
0
 ...

These individual polygons should corresponds to polygons in your CAD file and obj2rad should take care of that for you.

You resulting view_factors will be a dictionary like this:

{"cavity1":{"shield1":0.03, "shield2":0.05, "obstruction1":0.01...}, "cavity2": {"shield1":...}...}

You can then remove “obstruction” values by filtering the name:
{key: {k:v for k,v in val.items() if key.startswith("shield")} for key, val in view_factors.items()}

If your surface normals are not what need to be, their value will likely be zero.

Hopefully this helps.