Attempting 3D waveguide simulation #2865
Replies: 2 comments 2 replies
-
Yes, 3d simulations work — we've done many, many validated 3d simulations. (But the more parameters you have, the easier it is to make a mistake in setting things up, and 3d simulations are harder to visualize and take longer to run so it's harder to debug them.) I'm a little confused by your simulation. You are trying to get the dispersion relation of a waveguide? But then why wouldn't you use a 2d simulation, since your waveguide is invariant in one direction? i.e. why is Also, it looks like you are exciting the wave with an Hz source at (0,0,-3), but then trying to detect the field by its Ez component at (0,0,0). This won't work because it looks like your structure has an x=0 mirror symmetry plane, in which case an Hz source is odd with respect to this plane and will excite only odd-symmetry fields, so your Ez component at x=0 will be zero … any nonzero Ez field you happen to detect will just be garbage from roundoff and perhaps discretization errors. In general, I tend to use harminv with the same field component and the same location as the source. |
Beta Was this translation helpful? Give feedback.
-
I made a few changes to the code which helped me plot the frequencies and visualize the simulation. If you have any questions about the module functions I used, in the code let me know. You can get an idea of what the simulation looks like with sim.plot3D(). I used a few of my functions to plot the real parts of the frequencies and I am getting an incremental changes for the frequencies for every step-wise change in k-points. I do not know why you put the source outside the waveguide as stevengj has pointed out. But that said here's what I got when I widened to df = 3.0. As stevengj said, these can be nonsensical values I just want to help you visualize the simulation and manage the data better Here's what I got for df = 1, I may have increase nks,
|
Beta Was this translation helpful? Give feedback.
-
Hello!
As part of my internship, I have been doing some work on MEEP, and we have gotten to the step where we are trying to gather the effective index of a waveguide with grating in 3D. Previously, we've done this with 2.5D (Sans grating) and received values that seemed to fit alternative method solutions fairly well. However, this is not the case for 3D.
Attempting to create a waveguide in 3D, then to use run_k_points to gather frequencies at certain points seems to strictly return the same range of frequencies for each k point, and not a consistent, incremental increase as is expected. Additionally, its especially difficult to get any frequencies below 0.5, and if I do, then I find a ceiling at 0.6. Through testing, I've found that, as far up the chain as I can understand it, it only reads reflected light? If I put a PML barrier in the z direction at the end of my cell, my k points return nothing despite being ahead of the barrier. Whereas if I dont put one, I get that same range of frequencies as mentioned previously.
I've brought in the code below. I'm practically at wit's end, I have tried nearly everything, tweaking nearly every parameter to get appropriate frequency values to come out, but whenever I do the math to obtain the effective index, the results are never right.
Does anyone have any idea how to get this to work?
Beta Was this translation helpful? Give feedback.
All reactions