Optical Surface Properties Behaviour

Dear experts,

I am simulating a WLS slab: optical photons enter the volume, get downshifted and travel in the slab trapped mainly by total internal reflection. I would like to implement a way to have 1-2% of the photon boundary interactions being simple transmission (not TIR or Frenel/Snell) to take into account surface imperfections.

I tried to define a “G4OpticalSurface” (dielectric_dielectric,unified, polished): as far I as I understood from the documentation and explanations I found in this forum, what I need is REFLECTIVITY=0.99 and TRANSMITTANCE=0.01 so that no photon gets absorbed, 1% goes straight through (no change in momentum direction) and 99% are treated the same as with no OpticalSurface (the surface is transparent and the dielectic_dielectric processes take place).

This is not the result I get, though. What I observe is that If I set REFELCTIVITY=0.99 almost all photons are (specularly) reflected at the surface while I would expect most of them being refracted. If I set TRANSMITTANCE=1 and REFLECTION=0 I see refractions (same result as no OpticalSurface). I tried both with “G4LogicalSkinSurface” and “G4LogicalBorderSurface” (inwards and/or outwards the WLS slab) and I never obtain the behaivuor I want. Here are some tests:

1 - no optical surface: behaves as expected

2 - skin surface: photons are reflected and cannot get into the WLS slab

3 - border surface inwards (world volume → WLS slab): same as 1

4 - border surface outwards: photons that get inside (as 1) get downshifted and remain almost completely trapped until they are absorbed

5 - skin surface with REFLECTIVITY=0 and TRANSMITTANCE=1: photons are still refracted not transmitted (result similar to 1)

6 - skin surface with REFLECTIVITY=TRANSMITTANCE=0.1: I would expect all the photons to get absorbed at the surface but I obtain this. A photon has a low probability to get in and then is trapped while most of them are specularly reflected

(I have pictures for all cases but I can only upload one)

All the materials have their refractive inex defined and assigned to their MPT (I can see that from a dump), with all other needed properties (absorption, Rayleigh, etc…).
Am I missing something?

Thank you,

_Geant4 Version:_11.0.3
_Operating System:_ubuntu 20.04
_Compiler/Version:_GNU 9.4.0
_CMake Version:_3.16.3

Now I can upload all the pictures:

1 - no optical surface

3 - border surface inwards (same as 2, typo in previous post)

4 - border surface outwards

5 - skin surface REFLECTIVITY=0 and TRANSMITTANCE=1

6 - skin surface REFLECTIVITY=TRANSMITTANCE=0.01 (not 0.1, typo in the previous post)

As I understand it, setting a reflectivity of a border surface sets the reflectivity of the surface. So if you have 0.99 reflectivity, 99% of your photons will be reflected.

I am not sure if there is a way to implement what you are describing, which is essentially have 99% of your photons reflect/refract based on index of refraction, but then have 1% simply transmit through. I’m also not sure what real world behavior you would be modeling, as if you have two materials with different indicies of refraction, your photon would not travel through without refracting

Thank you for the reply.
If what you wrote is the intended behaviour, the documentation is wrong, as it also appears from the tests I made.

From the User’s guide:

“It is possible to specify that a given fraction of photons are absorbed at the surface, or transmitted without change in direction or polarization. This is applicable for dielectric_dielectric interfaces that are not backpainted. The material properties REFLECTIVITY and TRANSMITTANCE are used. By default, REFLECTIVITY equals 1 and TRANSMITTANCE equals 0. At a surface interaction, a random number is chosen. If the random number is greater than the sum of the values of REFLECTIVITY and TRANSMITTANCE at the photon energy, the photon is absorbed. Otherwise, if the random number is greater than the REFLECTIVITY value, the photon is transmitted. Otherwise, the usual calculation of scattering takes place.”

I also found this expaination in topics in this forum

Could this have been changed at some point or am I doing something wrong?

What I want to model are surface imperfections: if a photon is trapped by total internal reflection, it will propagate until it is absorbed. In reality the surfaces persent imperfections that cause a fraction of the trapped photons to escape even if they are over the critical angle. If the light guide has a large enough area this effect could be significant.

I see now what you are saying and what that previous post is saying. So if your reflectivity is 0 and transmission is 1, you would expect 100% of photons to travel through without refracting or reflecting. Have you been able to see this behavior? If not, I would guess that it is either that your boundary skin or wrapped skin is applied incorrectly, perhaps try swapping the volumes to see if you get the expected behavior (100% transmission, no refraction)

This is incorrect. REFLECTIVITY is poorly named. Instead we should have ABSORPTIVITY as 1-REFLECTIVITY. It sounds like you don’t want absorption, so REFLECTIVITY should be left at its default value of 1.0.

TRANSMITTANCE indeed means the photons enter the new material with no change in direction.

The remainder are (might be?) treated the same as with no OpticalSurface, if there are no other surface parameters specified.

It is difficult to see what is going on with the plots. I would suggest trying the combinations of parameters with extended example OpNovice2, with macro boundary.mac (edit as appropriate). It will give you a table with number of interaction types at the end of the run, and plots of number of photons vs. direction. Also, coming in Geant4 version 11.2, the photons can be killed when incident on the second surface, which enables producing helpful pictures of the tracks. If you get to it before the release. post back here and I can post the changes to the code to enable this.

Ok, thank you for the explaination.

What I previously understood was that the random number [0,1] was compared with REFLECTIVITY+TRANSMISSION+ABSORPTIVITY where ABSORPTIVITY=1-(REFLECTIVITY+TRANSMISSION) so that only 1 random number was extracted. In any case I think this is what is written in the guide.

So what really happens is: a random number [0,1] is extracted, if it is higher than REFLECTIVITY, the photon gets absorbed; then another random number is extracted and if it is lower than TRANSMITTANCE the photon goes through the surface without interacting.
Do I get it right, now?

If so, I can try to see if I get the behaviour I expect, also on the OpNovice2 example to exclude problems in my code.

I run some tests on OpNovice2 boundary.mac as you suggested and I get the same problem: as long as TRANSMITTANCE is 0 all works as expected, if TRANSMITTANCE!=0, it breaks.

You can see the problem just setting TRANSMITTANCE to 0 in boundary.mac.
With 0.1 you get in output almost only Fresnel reflections while, just changing it to 0 you get almost only Fresnel refractions, as expected.

Example for:

in boundary.mac (original file):

/opnovice2/surfaceProperty TRANSMITTANCE 0.000002 0.1 0.000008 0.1


Surface events (on +X surface, maximum one per photon) this run:
# of primary particles:         1e+04
OpAbsorption before surface:        3
Total # of surface events:       9997
Unaccounted for:                    0

Surface events by process:
  Transmission:                   980
  Fresnel refraction:             798
  Fresnel reflection:            7178
  Absorption:                     947
  Detection:                       94
 Sum:                            9997
 Unaccounted for:                   0

in boundary.mac (only change from original file):

/opnovice2/surfaceProperty TRANSMITTANCE 0.000002 0.0 0.000008 0.0


Surface events (on +X surface, maximum one per photon) this run:
# of primary particles:         1e+04
OpAbsorption before surface:        6
Total # of surface events:       9994
Unaccounted for:                    0

Surface events by process:
  Fresnel refraction:            7464
  Lambertian reflection:          361
  Lobe reflection:                 46
  Spike reflection:                52
  Backscattering:                  42
  Absorption:                    1810
  Detection:                      219
 Sum:                            9994
 Unaccounted for:                   0

Thanks for running this test!

I suspect there is a bug with TRANSMITTANCE. I don’t know exactly what it is supposed to do, but it appears from the first part of the code that a given fraction of particles are transmitted without change in direction. Maybe, for many particles, it averages out. That part seems to make sense.

However, later, the probability of Fresnel reflection and refraction are calculated. If TRANSMITTANCE is 0, this is based on electrodynamics. If transmittance is non-zero, however, the ratio of Fresnel refraction to Fresnel reflection is simply TRANSMITTANCE. This makes no sense to me.

You could try changing the code here:


1199       if(fTransmittance > 0.)
1200         transCoeff = fTransmittance;
1201       else if(cost1 != 0.0)
1202         transCoeff = s2 / s1;
1203       else
1204         transCoeff = 0.0;


if(cost1 != 0.0)
      transCoeff = s2 / s1;
      transCoeff = 0.0;

I hesitate to change this in the repository, because it’s been like that for 10 years and no one has complained. You could file a bug report.

Also, as you note, my explanation of how absorption/transmission/Fresnel is chosen was incorrect. The part of the Book for Application Developers you quoted is correct, as far as I know, and aside from the above. Post back if it’s not clear.

Thank you very much!

Now both OpNovice2 and my code work as I would expect, so that I can try to simulate surface imperfections.

i.e. in OpNovice2, if I set a refractive index high enough to have Total Internal Reflections only, with TRANSMISSION=0.01 and REFLECTIVITY=0.99, I get ~9900 TIRs and 100 Transmissions.

I will try to file a bug report, in case someone else is intrested in this feature.

p.s. Other then problems/bugs what would be the proper place to propose/ask for changes? I am also using the dichroic_dielectic surface and it is quite annoying to set up and use