Measuring GHI with rtrace in scenes with diffuse irradiance

Hi all,

I have a question regarding the results of rtrace when measuring irradiance. When looking at the results of rtrace, we noticed that we were “missing” some irradiance, in the sense that we were not getting the expected GHI values when measuring at the ground.

It is easy to reproduce the issue. I created a sky using gendaylit, with the G option. The irradiance values are GHI = 1000 W/m2 and DHI = 200 W/m2. I added a flat plane representing the ground to the scene, and then I measured the irradiance values at the center of the plane, with the ray being perfectly perpendicular to the surface.

This is the gendaylit command:
gendaylit -ang 80.0 0.0 -G 800.0 200.0 -g 0.0 -O 1

This is the ground OBJ file:

usemtl terrain_mat
v 0.0000 0.0000 0.0000
v 100.0000 0.0000 0.0000
v 100.0000 100.0000 0.0000
v 0.0000 100.0000 0.0000
f 1 2 3
f 1 3 4

Which we then convert to a rad file using obj2rad -o ground OBJ_FILE. We then use the oconv command to generate the octree.

And this is the rtrace command:
rtrace -i -faa -ab 1 -aa 0.2 -ar 20 -ad 128 -as 64 -h -ov OCT_FILE
50 50 0.01 0 0 -1

We reduced the precision of the rtrace calculation to optimize performance. Our first suspicion was that this decision was the issue, but increasing the precision by tweaking the parameters does not change the result.

Doing this, I expected to get the GHI value of 1000 W/m2. However, I never get that exact value, instead I always get a value which is lower, in the range of 990-998 W/m2. The concern is not regarding the variability; it is regarding the bias. The measured value is always lower than the expected value.

I also wanted to mention that the issue is only apparent when the DHI value is higher than say 30 W/m2. I feel like this should give us some clue regarding the root cause of the difference in results but that is as far as I got.

The context of our efforts is the development of an energy yield calculation for Photovoltaic plants. We started looking into this issue because we noticed that the frontal irradiance values were consistently lower than the results we get from our previous model.

Please let me know if any other information is needed.

Thanks in advance for your answers,

Félix

I’m not sure you can expect perfect accuracy from the normalization procedure in gendaylit. Did you try substituting gensky to see if the agreement was any better? Numerical approximations to the hemispherical integration over the sky are rarely exact. You may have to do your own normalization using rtrace if you need better than 1% accuracy.

Best,
-Greg

Hi Greg,

Many thanks for your quick reply!!

I understand that we cannot expect perfect accuracy. Following your suggestion, we tested the gensky command using these values

gensky -ang 80 0 -R 800 -B 200

But the results are more or less the same, the value is always lower, around 995 W/m2. When we test with 0 BHI and 1000 DHI the error is up to 1% (results of 980 to 1000 W/m2).

I agree that maybe we will have to do our own normalization. Just to make sure I understand your suggestion, I was thinking about using this procedure (flat terrain, sky generated with gendaylit, measurement using rtrace) to calculate the results of rtrace, and calculating a normalization factor which we would then apply in our subsequent calculations.

For example, using the procedure above we get a GHI of 992 measured using rtrace. Therefore, the normalization factor is 1000/992 = 1.008. We then multiply any irradiance result we get from rtrace by that value.

Is that what you were proposing?

Best regards,

Félix

Hi Felix,

I looked into this more closely. In the case of gensky at least, there is a slight inaccuracy in how the solar brightness is computed based on a -R setting. I was using a factor of “6e-6” when it should really be “5.98e-6” for the conversion on line 272 in gensky.c. This is a third of a percentage point of difference. With this correction, I get nearly exact results. The sky normalization is already fairly good.

So, while you did understand my previous suggestion correctly, it may work just as well to test the solar and sky contributions separately and come up with an adjustment for exact results, at least in the case of gensky. I am less familiar with gendaylit.

Cheers,
-Greg

Thanks Greg!! We will investigate the problem as you suggested, by separating the components and studying the results. I will post our results here next week hopefully.

Hi,

I tested the normalization approach, and it seems to work well, at least insofar as correcting the measured DHI. What I did was:

  • For some given meteorological conditions (GHI, DHI, solar position), “measure” the DHI using rtrace on the ground. Generate the sky using the diffuse component only (ignore the direct component of GHI).
  • Calculate the normalization factor as normalization_factor = DHI / measured_DHI
  • Generate a new sky using gendaylit, using the corrected DHI calculated as corrected_DHI = DHI * normalization_factor

If the normalization factor is greater than one, then it means that gendaylit is “under estimating” the diffuse irradiance. Otherwise, it is being over estimated.

With this approach, if we measure the DHI again using the new sky generated in the final step, we get DHI values which are correct. However, if we generate the sky with the beam component too, we still get a GHI value which is below the expected. I’m still investigating this issue.

I wanted to know what the normalization factor values looked like, so I analyzed the results for an entire year at a location in Spain. What I got is that the normalization factor goes from 1.019 to 0.9879, with average 1.00288. Meaning that the DHI is slightly under estimated overall (which matches my previous observations).

Below are some charts I generated, using the results for the whole year. I think that it seems like the normalization factor gets further from 1 when the sun zenith is greater, meaning when the sun is closer to the horizon.

I will now run some more simulations to see if the original problem I observed can be fixed using the normalization factor approach.

I wonder if someone knowledgeable in regard to gendaylit could have a look at this issue as well? Perhaps gendaylit has a flaw similar to what Greg found in gensky.

Thanks Greg for your help!!



1 Like

Hi!! Just wanted to report that we ended up finding a solution good enough for us. The solution is as follows:

  • We start by building a sky, using gendaylit, and a simplified scene like the one I described above.
  • We measure the GHI in 20 locations in the scene, leaving a margin of separation with the edges of the ground.
  • We calculate a GHI normalization factor, defined as measured_ghi / target_ghi, where target_ghi is the GHI value defined in the meteorological data. The measured_ghi value is the average of all previous measruements.
  • We then calculate a corrected diffuse horizontal irradiance, by doing corrected_dhi = dhi + ghi * (ghi_normalization_factor - 1). This way, we increase the DHI by something like 5 W/m2 for example. The normalization factor is usually very close to one.
  • Finally, we rebuild the sky using gendaylit and the corrected_dhi value. If we measure GHI again by repeating the procedure above, we get the correct value (on average).

It was not easy to come up with this procedure, it took a lot of trial and error. The process of measurement in 20 locations was necessary so that the “randomness” of rtrace averages out. When calculating the results of the individual hourly intervals for an entire year, the errors average out and we end up with the correct value.

Thanks Greg for your help!!

1 Like