NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.17k stars 598 forks source link

Tutorial for computing the radiation pattern and total flux of a disc in cylindrical coordinates #2629

Closed oskooi closed 9 months ago

oskooi commented 10 months ago

Adds a new tutorial demonstrating the computation of the total flux from the the radiation pattern of a disc in cylindrical coordinates.

Meep Adjoint Meetings (4)

Meep Adjoint Meetings (5)

stevengj commented 10 months ago

If you want to do this, you'll want to have a finite structure (or no structure at all, just vacuum), so that all of the power is radiated. (If you have a structure with a slab waveguide extending to infinity, like the LED examples, you will have a hard time disentangling the radiated power and the power in the waveguide mode, especially since the near2far approach cannot give you the latter).

Note also that the same r^2 sin(theta) weighting is needed for the power in any cone, not just over all angles.

oskooi commented 10 months ago

If you want to do this, you'll want to have a finite structure (or no structure at all, just vacuum), so that all of the power is radiated.

This seems to be working after I replaced the infinitely extended LED with a finite-sized disc. I also modified the polar-coordinate plot of the radiation pattern to specify 0° as the $+z$ direction (previously it was the $+r$ direction). This conforms with the standard convention used in spherical coordinates.

stevengj commented 10 months ago

Maybe try it without a ground plane to avoid any trickiness in the near-to-far calculation arising from that? Basically, you don't have a closed "near-field surface". One option is to extend it radially towards infinity (there is a nonzero contribution from the surface of the metal because the tangential magnetic fields don't vanish there), ideally using a windowed Green's function (#1952).

image

Another option, for PMC ground planes, is to treat it as an anti-symmetric problem and add the mirror flip of the near-field surface (essentially the method of images).

image

In both cases, you can see that what you are currently doing is missing some of the near-to-far source terms, which is probably why it doesn't give the correct total flux.

In the present case maybe try doubling the cell radius (and the near-to-far with it) to make sure you are converged.

oskooi commented 10 months ago

Maybe try it without a ground plane to avoid any trickiness in the near-to-far calculation arising from that? Basically, you don't have a closed "near-field surface".

Simulating the same structure using a closed near-field surface by removing the ground plane and duplicating the disc and the source below the $z = 0$ plane (the method of images) does indeed produce the expected result: the difference in the flux computed from the near and far fields goes to zero with resolution.

I have added a note which describes this effect as well as the possible workarounds mentonoed above.

led_method_of_images_simulation_layout