3d dft
I have a working 3D FDTD with PML and I have checked it for reflections at the boundaries, it works fine. Anyway, I have a problem applying DFT (discrete fourier transform) to this. Here's what I do:
Hertzian Dipole in Gaussian Envelope (no difference in DFT with either hard or soft source)
Free Space for checking DFT
When I do DFT only the source comes out with a nice gaussian shape in DFT. All other spacial coordinates that I do a DFT at are not gaussian shaped but have more or less deep 'dints' in the shape. I can supply a pic if needed. The problem now is that in a lossless material there should be nearly the same signal whereever I do the DFT, right? Why doens't that work?
I have read in Taflov's book about numerical dispersion and the differences to them for waves travelling along the axes and along 2D-3D diagonals. But even if I do the DFT along one axis with like 10 grid points distance, they all look defferent. I'm starting to get mad at this ;) I am interested in spectra of abs(ETrans)**2/abs(ESource)**2.
I would be really glad for a helping idea.
Thanx, jank
That may be a good idea.
Numerical dispersion (as you state below) is the prime candidate
1) Numerical dispersion depends on two factors:
- angle
- lambda/gridsize
Concerning the angle I cannot say anything without details about source/probe locations
Concerning lambda/gridsize. It is not entirely clear what shape your source is. I assume it is a
sine wave with gaussian enevelope. Then all frequencies except for those sufficiently close
to the sine wave's frequency should be weak and strongly affected by noise/dispersion
Sufficiently close depends on a) the number of periods in the pulse, b) the parameters
of the envelope c) gridsize .
Which ratio lambda/gridsize do you use? If <10 strong numerical dispersion is possible.
But even for larger ratios dispersion can be a factor.
Finally do you actually model an antenna or do you use a point source?
[/quote]
Hi!
I did some testruns and as you said, it really is the numerical disperion that makes the difference in my case here. The fourier1.jpg is at λ/20 grid resulotion and fourier2.jpg is at λ/100 and as one can clearly see the dispersion is nearly constant in the second while not at all in the first pic. The pics are the fourier spectra abs(Esource)**2/abs(Etrans)**2 so one sees the frequencies that are transmitted (or reflected). The angle is in both cases 0° measuring along the y-axis at same x/z coords as the source. The second run is not perfectly a straight horizontal line which would indicate the all frequencies really do travel at the same speed but I'll take that on in some higher res runs today and see if it works even better.
The source I use is modeld as point source at the moment since it was the easiest way for testing. Yes, a sine source with gaussian envelope. The next step will be to model a laser LED and get some material into the grid for testing. Currently I do not have any idea how to model a coherent nearly nondispersive wavefront. Any ideas how to implement this? I started 1D FDTD an things were a lot easier in 1D ;)
Thanks for your quick answer to the numerical dispersion problem!
jank
The usual method is called TFSF (total field - scattered field) where you compute the total
field only inside a rectangular region and out side only the scattered field. That requires clever
adding/subtraction of a planewave at the boundary between the regions. However for normal
incidence it is straightforward.
Oh yea, I have been reading about the TF/SF method in Taflov's chapter concerning sources. Looks very promising as must admit but I was hoping to get around writing much of the code again ;)
Well anyway, I'll stick to analytics again now and see if I can derive something from scratch for an LED emitting laser light, maybe that works suitable. Basic idea is to model the LED directly ( meaning the doped layers and electrical inversion conditions from many body theory and material physics ) and see what it emits. Should be working as I think by now but numerics can prove me wrong. If it works it would be a nice model to study maybe new LED materials or even go a step further to electro-magnetic computing maybe by injecting magnetic polarized electrons (spin polarization) into a 'transistor' working with light instead of the creepy electrons.
Many thanks for the help so far. If I should succeed in implementing the laserLED I can post it here if you are interested.
janK
If you use normal incidence then you can replace one boundary wall by cells with identical hard sources.
It depends on your absorbing boundary condition whether this works or not. (If I remember correctly
it worked for me when I was using 2d-fdtd and CPML)
I am.
Hey ;)
I am still working and to be honest struggling to tackle this. It sounded a bit like easy but turns out to be rather harsh to implement due to the different scales. At the moment I try to fight down the mem usage due to the very small dx/dy/dz I have to use for the atomic layers and the nanometer scales (which are like miles for mice) the measurements shall be taken on.
I just wannet to say I didn't forget about it ;)
janK
I would consider trying 2d models first and then moving to 3d when you have the feeling you
understand what is going on. I did waste some time with large 3d simulations which did not make
sense because I screwed up the implementation.
The only other suggestion I have is to
1) consider using C or Fortran if you are not already using it. 40e6 cells/s is doable on a
reasonable modern workstation (if you don't use too many boundary layers or large regions
of multipole dispersive materials). But depending on your compiler/CPU 10-20e6 is a reasonable
first goal. My first implementation could be made considerably faster using OpenMP (It was bad
enough for bandwidth not to be an issue). MPI is also useful but more work.
2) if you can get a hold of fairly new GPUs then that is also something worth considering.
programming them has become easier and they really are considerably faster for FDTD
3) if you are using lots of dispersive materials then looking for an efficient algorithm is a good idea.
As far as grids are concerned I would use non-uniform grids as much as possible but probably
would stay away from subgrids or multi-resolution grids because stability problems are not too
easy to solve.
Good luck.