## PMLs

In general, this is already covered and/or will be covered throughout this website.

I have forgotten the theory details about this subject, but I will try to write few lines that everyone can understand.

One can design model geometry without using PMLs, particular boundary condition can do just fine (in some cases). If you are not an expert (like me) I suggest to use them in almost every situation. Problem arises in FEM modeling because you have to limit your modeling domain as much as possible to save time and computational resources. When you limit your space of interest, you need to set some BC at least, in order to have some chances to get meaningful solution, For instance, scattering boundary condition (SCBC) will do fine if solving for scattered field. If you go for total field, SCBC are just not enough, because cannot deal with propagating fields (see Solving for total field pages). Thus you can get reflections (multiple, depending on the model), and overall solution is compromised, if the system can converge at all.

The situation gets considerably better when combining boundary conditions with PMLs. Naively, PML are absorbing layers, that will attenuate any wave passing twice through them, before reflecting back into modeling space. They will absorb propagating as well as evanescent fields. When using scattering harmonic propagation, incident field is defined as zero in all PML domains. It is crucial to set PMLs refractive index to be the same as adjoining dielectric medium, since any discontinuity in refractive indices (any interface) introduces reflections. Near the inner boundary PML is purely dielectric, and slowly is becoming more and more absorbing. It is usually just fine to use default PML in COMSOL. However, it is important to use swept mesh for PML meshing. Five layers are good starting point, and each meshing element should be of the same size as nearest meshing element in the modeling space. That should determine how thick your PML should be.

What to do if you have COMSOL older than 3.5a without hotfix. Initially, when I worked with older COMSOL (3.4) in scattering harmonic propagation, I was struggling a lot with PMLs. Usually, solution looked like in Fig.1, where PML was reflecting forward scattered field. After sending one of my models to friend who had updated Comsol 3.5a with patch, and recieving solution without any reflections, where he didn´t change anything, I realized and comsol support confirmed that default PML implementation was wrong.

What can you do about it? You can update your version. If that is not an option, you can implement your own PML. There you should make PML as regular subdomain, and define refractive index as some complex absorbing material. Level of dificulty of manual implementation is unknown to me. There is a reference that might help, and I will try to put the link here [].

One can design model geometry without using PMLs, particular boundary condition can do just fine (in some cases). If you are not an expert (like me) I suggest to use them in almost every situation. Problem arises in FEM modeling because you have to limit your modeling domain as much as possible to save time and computational resources. When you limit your space of interest, you need to set some BC at least, in order to have some chances to get meaningful solution, For instance, scattering boundary condition (SCBC) will do fine if solving for scattered field. If you go for total field, SCBC are just not enough, because cannot deal with propagating fields (see Solving for total field pages). Thus you can get reflections (multiple, depending on the model), and overall solution is compromised, if the system can converge at all.

The situation gets considerably better when combining boundary conditions with PMLs. Naively, PML are absorbing layers, that will attenuate any wave passing twice through them, before reflecting back into modeling space. They will absorb propagating as well as evanescent fields. When using scattering harmonic propagation, incident field is defined as zero in all PML domains. It is crucial to set PMLs refractive index to be the same as adjoining dielectric medium, since any discontinuity in refractive indices (any interface) introduces reflections. Near the inner boundary PML is purely dielectric, and slowly is becoming more and more absorbing. It is usually just fine to use default PML in COMSOL. However, it is important to use swept mesh for PML meshing. Five layers are good starting point, and each meshing element should be of the same size as nearest meshing element in the modeling space. That should determine how thick your PML should be.

What to do if you have COMSOL older than 3.5a without hotfix. Initially, when I worked with older COMSOL (3.4) in scattering harmonic propagation, I was struggling a lot with PMLs. Usually, solution looked like in Fig.1, where PML was reflecting forward scattered field. After sending one of my models to friend who had updated Comsol 3.5a with patch, and recieving solution without any reflections, where he didn´t change anything, I realized and comsol support confirmed that default PML implementation was wrong.

What can you do about it? You can update your version. If that is not an option, you can implement your own PML. There you should make PML as regular subdomain, and define refractive index as some complex absorbing material. Level of dificulty of manual implementation is unknown to me. There is a reference that might help, and I will try to put the link here [].

Figure 1. Light interaction with resonant metallic nanostructures, solved in scattering harmonic propagation in Comsol 3.4. Notice artificial hotspots in forward scattering direction, with intensity higher than nanoparticel near-fields. Hotspots are due to default PML failure. When nanoparticles are not present (refractive index changed to vacuum), hot spots are still present in solution.