Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Power not conserved in ray-tracing simulation

Please login with a confirmed email address before reporting spam

Hello,
It seems that ray-tracing simulations made with the COMSOL Ray Optics Module violate the conservation of energy... Can anyone tell me if I have made any errors or wrong assumptions in setting up the model, or if this is a bug of the software?

I have made a simple model (mph files attached) to illustrate what I mean.

The geometry is as follows :

1 solid circle on a workplane
1 block (not solid, only the surface) enclosing the circle and a small volume around it.

The circle was set up as an Inlet boundary, with total power 1W.
The surfaces of the block were set up as a Wall boundary, with ray condition Freeze. A Deposited Ray Power attribute was then added to the Wall.

The ray-tracing study was computed, and the value of the Deposited Ray Power accumulator was integrated over all surfaces, yielding a total power of 1W. In this simple case (straight-line propagation from Inlet boundary to Wall boundary), energy is conserved.

I now make a small change to the geometry : A small solid block is created in front of the Inlet boundary. This block is attributed a material (N-BK7 optical glass) and the extinction coefficient of the material is set to zero, ensuring perfect internal transmission.

This time, after computing the ray-tracing study, the total power integrated over all surfaces is 0.951W! About 5% of the optical power has disappeared from the simulation.

How to explain this behavior? Can anyone suggest a fix? I am using the ray-tracing module to calculate optical detection efficiency, so accurate intensity and power values are critical to my application.

Regards,
Louis Haeberle
MSc Student (Physics)
Sherbrooke University


7 Replies Last Post Nov 28, 2016, 2:22 p.m. EST
Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 7, 2016, 12:30 p.m. EST
Hi Louis, when you introduce the glass, you get reflections as well as refraction. This means that secondary rays are released at the material discontinuity boundaries. There is a setting in the Geometrical Optics interface called "Maximum number of secondary rays". The default is 500. This needs to be increased in your model to say, 4000. You also need to solve for a longer time period because the secondary rays may take more time to reach the walls, say range(0,0.003,0.3). If I make these changes in your model then the computed power is 0.99984.

Dan
Hi Louis, when you introduce the glass, you get reflections as well as refraction. This means that secondary rays are released at the material discontinuity boundaries. There is a setting in the Geometrical Optics interface called "Maximum number of secondary rays". The default is 500. This needs to be increased in your model to say, 4000. You also need to solve for a longer time period because the secondary rays may take more time to reach the walls, say range(0,0.003,0.3). If I make these changes in your model then the computed power is 0.99984. Dan

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 7, 2016, 1:53 p.m. EST
Thank you very much Dan!

Is there a rule of thumb to estimate how much secondary rays should be released to reach an arbitrary accuracy for the value of power?

I am also not certain of the reason power is lost, even though your fix does work. Why does splitting the intensity into a greater number of secondary rays increase the accuracy?

Regards,

Louis Haeberle
MSc Student (Physics)
Sherbrooke University
Thank you very much Dan! Is there a rule of thumb to estimate how much secondary rays should be released to reach an arbitrary accuracy for the value of power? I am also not certain of the reason power is lost, even though your fix does work. Why does splitting the intensity into a greater number of secondary rays increase the accuracy? Regards, Louis Haeberle MSc Student (Physics) Sherbrooke University

Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 7, 2016, 2:00 p.m. EST
Hi Louis, there's no perfect rule of thumb to how many secondary rays might be released. Generally speaking, if you release 100 rays and expect them to encounter 5 material discontinuities then that number would need to be 500 for only single reflections. Significantly more may be needed if you need to include multiple reflections. It really depends on exactly what you're interested in.

When a ray hits a material discontinuity, part of the energy is carried by the refracted ray (the primary rays) and part by the reflected (the secondary rays). The amount of energy carried by the reflected and refracted rays comes from the Fresnel equations. If all the secondary rays have been used up, then the reflected rays stop being released into the modeling domain. Their contribution to the overall power balance is hence lost.

Dan
Hi Louis, there's no perfect rule of thumb to how many secondary rays might be released. Generally speaking, if you release 100 rays and expect them to encounter 5 material discontinuities then that number would need to be 500 for only single reflections. Significantly more may be needed if you need to include multiple reflections. It really depends on exactly what you're interested in. When a ray hits a material discontinuity, part of the energy is carried by the refracted ray (the primary rays) and part by the reflected (the secondary rays). The amount of energy carried by the reflected and refracted rays comes from the Fresnel equations. If all the secondary rays have been used up, then the reflected rays stop being released into the modeling domain. Their contribution to the overall power balance is hence lost. Dan

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 7, 2016, 2:31 p.m. EST
Okay, I understand. So the "Maximum Number of Secondary Rays" setting is the limit for the total number of secondary rays released for all reflections during the whole simulation? For example, if I am modelling an optical resonant cavity where I expect many reflections, I should increase this setting by several orders of magnitude, correct? (Assuming of course that I have enough RAM to solve for all these secondary rays)

Regards,

Louis Haeberle
MSc Student (Physics)
Sherbrooke University
Okay, I understand. So the "Maximum Number of Secondary Rays" setting is the limit for the total number of secondary rays released for all reflections during the whole simulation? For example, if I am modelling an optical resonant cavity where I expect many reflections, I should increase this setting by several orders of magnitude, correct? (Assuming of course that I have enough RAM to solve for all these secondary rays) Regards, Louis Haeberle MSc Student (Physics) Sherbrooke University

Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 7, 2016, 3:56 p.m. EST

Okay, I understand. So the "Maximum Number of Secondary Rays" setting is the limit for the total number of secondary rays released for all reflections during the whole simulation?

Correct.


For example, if I am modelling an optical resonant cavity where I expect many reflections, I should increase this setting by several orders of magnitude, correct? (Assuming of course that I have enough RAM to solve for all these secondary rays)

Also correct. Once nice feature is the "Threshold intensity" setting in the Material Discontinuity feature. From the User's Guide:
"Enter a Threshold intensity Ith (SI unit: W/m^2). The default is 1·10-3 W/m^2. If the interaction of a ray with a material discontinuity would create a reflected ray of intensity less than the threshold intensity, the release of this reflected ray is suppressed. This prevents an arbitrarily large number of degrees of freedom from being used to model the propagation of rays of exponentially decreasing intensity. When a nonzero threshold intensity is specified, some small decreases in the total energy of the system may be observed if the release of low-intensity secondary rays is suppressed."

Dan
[QUOTE] Okay, I understand. So the "Maximum Number of Secondary Rays" setting is the limit for the total number of secondary rays released for all reflections during the whole simulation? [/QUOTE] Correct. [QUOTE] For example, if I am modelling an optical resonant cavity where I expect many reflections, I should increase this setting by several orders of magnitude, correct? (Assuming of course that I have enough RAM to solve for all these secondary rays) [/QUOTE] Also correct. Once nice feature is the "Threshold intensity" setting in the Material Discontinuity feature. From the User's Guide: "Enter a Threshold intensity Ith (SI unit: W/m^2). The default is 1·10-3 W/m^2. If the interaction of a ray with a material discontinuity would create a reflected ray of intensity less than the threshold intensity, the release of this reflected ray is suppressed. This prevents an arbitrarily large number of degrees of freedom from being used to model the propagation of rays of exponentially decreasing intensity. When a nonzero threshold intensity is specified, some small decreases in the total energy of the system may be observed if the release of low-intensity secondary rays is suppressed." Dan

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 7, 2016, 5:31 p.m. EST
Thank you very much for your help Dan, this information was extremely useful!

Regards,
Louis Haeberle
MSc Student (Physics)
Sherbrooke University
Thank you very much for your help Dan, this information was extremely useful! Regards, Louis Haeberle MSc Student (Physics) Sherbrooke University

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Nov 28, 2016, 2:22 p.m. EST
I am having a similar (opposite actually) problem where I get 1.015 watts out when I put 1 watt in. Do you know anything that could cause this? I was thinking it might be related to a rounding error, but this seems unreasonable.
I am having a similar (opposite actually) problem where I get 1.015 watts out when I put 1 watt in. Do you know anything that could cause this? I was thinking it might be related to a rounding error, but this seems unreasonable.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.