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.

Undefined value found: NaN or Inf found when solving linear system using SOR

Please login with a confirmed email address before reporting spam

HI ,

In the file attached, I want to calculate the electric field distribution at the aperture of a parabolic mirror. The whole geometry contains a piece of diamond with a parabolic face and a flat face. Above the flat face there is a layer of air where the "perfectly matched layer" condition is adopted. The parabolic face is coated with some perfectly conducting meterial and made into a mirror. A dipole emitter is located at the centre of the flat face . When I ran the the calculation, an error massage poped up saying "Undefined value found: NaN or Inf found when solving linear system using SOR", but I cannot figure out which value is undefined. Any help is appreciated.

Cheers



2 Replies Last Post Feb 26, 2018, 9:49 a.m. EST
Magnus Olsson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Sep 28, 2017, 8:27 a.m. EDT

Dear Chao Li,

A short explanation:

In order to solve wave propagation models, a mesh density corresponding to about 10 linear elements per wavelength is required (or 5 2nd order elements per wavelength). An unresolved model will solve when you use a direct solver but the results will be useless due to the poor accuracy. According to the Nyquist–Shannon sampling theorem, you need at least two samples per wavelength in order to capture any information and in practice a lot more. The iterative solver with default discretization order for the Electromagnetic Waves, Frequency Domain interface (that is 2nd order elements), requires more than 2 elements per wavelength in order to converge. Otherwise you are likely to get the mesages you report or at least the solver will not converge.

What can be done?

Activate the "Physics-Controlled Mesh" in the settings for the main node of the Electromagnetic Waves, Frequency Domain interface, and make sure that the mesh node is set to use "Physics-controlled mesh" for "Sequence type". Then you will get a mesh that will resolve the wavelength properly. However, for this problem, you get about 4.5 million elements that will be rather memory intense to solve so unless you have "a lot of RAM". I would recommend that you cut the geometry down to 1/4 (first quadrant in the xy-plane) and apply a Perfect Magnetic Conductor outer boundary condition at y=0 and the default Perfect Electric Conductor at x=0. Even then I think you may need quite a lot of RAM to solve the model.

Best regards, Magnus

-------------------
Magnus
Dear Chao Li, A short explanation: In order to solve wave propagation models, a mesh density corresponding to about 10 linear elements per wavelength is required (or 5 2nd order elements per wavelength). An unresolved model will solve when you use a direct solver but the results will be useless due to the poor accuracy. According to the Nyquist–Shannon sampling theorem, you need at least two samples per wavelength in order to capture any information and in practice a lot more. The iterative solver with default discretization order for the Electromagnetic Waves, Frequency Domain interface (that is 2nd order elements), requires more than 2 elements per wavelength in order to converge. Otherwise you are likely to get the mesages you report or at least the solver will not converge. What can be done? Activate the "Physics-Controlled Mesh" in the settings for the main node of the Electromagnetic Waves, Frequency Domain interface, and make sure that the mesh node is set to use "Physics-controlled mesh" for "Sequence type". Then you will get a mesh that will resolve the wavelength properly. However, for this problem, you get about 4.5 million elements that will be rather memory intense to solve so unless you have "a lot of RAM". I would recommend that you cut the geometry down to 1/4 (first quadrant in the xy-plane) and apply a Perfect Magnetic Conductor outer boundary condition at y=0 and the default Perfect Electric Conductor at x=0. Even then I think you may need quite a lot of RAM to solve the model. Best regards, Magnus

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Feb 26, 2018, 9:49 a.m. EST

Hi Magnus,

I activate the "Physics-Controlled Mesh" in the settings for the main node of the Electromagnetic Waves, Frequency Domain interface, choose the wavelength for maximum mesh element size control parameter and minimum vacuum wavelength is lambda/6. Now when I click mesh with "Physics-controlled mesh" for "Sequence type" I got this error:

"Failed to set mesh size automatically. Expand mesh tree node to review error for details."

When I expand a mesh tree node I got this: "Size cannot be defined automatically for this node as material properties are configured by either variables or functions. Set the maximum element size to 0.2 wavelengths or smaller and rebuild the mesh."

I am trying to compute a plasmonic structure (3D model waveoptics) for a wavelength of 633 nm.

Could you please guide me what I can do/try next?

Hi Magnus, I activate the "Physics-Controlled Mesh" in the settings for the main node of the Electromagnetic Waves, Frequency Domain interface, choose the wavelength for maximum mesh element size control parameter and minimum vacuum wavelength is lambda/6. Now when I click mesh with "Physics-controlled mesh" for "Sequence type" I got this error: "Failed to set mesh size automatically. Expand mesh tree node to review error for details." When I expand a mesh tree node I got this: "Size cannot be defined automatically for this node as material properties are configured by either variables or functions. Set the maximum element size to 0.2 wavelengths or smaller and rebuild the mesh." I am trying to compute a plasmonic structure (3D model waveoptics) for a wavelength of 633 nm. Could you please guide me what I can do/try next?

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.