-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spontaneous Radiation Rises as Resolution increases #89
Comments
The input file:
The Beam file:
The Lattice file:
|
Hmm..there's one or two possibilities here... First of all, just a minor point, are you filtering the radiation field before plotting the power? This may all be low-frequency content, but I can't see a power spectrum so I don't know...usually it's OK since there is a high-pass filtering that Puffin itself does when running in 3D (defaulted at a 1/3rd of the resonant frequency, but it can be adjusted), but it can also depend on the temporal profile of the beam if it's short enough. Usually I'd actually just band-pass the field around the resonant frequency and also the harmonics separately if necessary, but it depends on what you're looking for and what scenario you're investigating. Another thing is, the radiation field mesh uses an absorbing boundary of 16 nodes surrounding the outer edge on all sides. They are included in the mesh setup in the input file, so if you tell puffin to setup 100 nodes in the x-direction for the mesh, the inner 68 will be non-absorbing nodes surrounded by 16 absorbing nodes on each side (32 absorbing nodes in total). This number of absorbing nodes is currently fixed in puffin. If you have a lot of diffraction, then you may see power being sucked out of the system through the absorbing boundaries. Changing the grid spacing while keeping the length constant would change the length of the absorbing boundary, resulting in more or less power being absorbed by the boundaries. I've not had a chance to look properly at the numbers, but if you have a lot of diffraction (Rayleigh range comparable to the undulator period) you may also find that calculating the diffraction step every period is not good enough. Having said that, I seem to recall that in practice this didn't seem to affect the results significantly even when the Rayleigh range was pretty much equal to the undulator period, but I may be remembering wrong :) . You can adjust the diffraction step size with the 'sDiffFrac' variable in the main input file. It is the length of the diffraction step expressed in units of the undulator period, defaulted to 1. You could try reducing it. Worst case is calculating a diffraction step at the end of every RK4 temporal-longitudinal step (sDiffFrac = 0.03333333333333333)...this will massively increase your simulation time...so I hope it's not that... The last thing I can think of is simply an under-sampling of the beam compared to the radiation grid. My quick (maybe wrong) calc from looking at the input file looks like there's roughly 10,000 transverse grid elements (100 in x and 100 in y) and only 1000 randomly distributed (OK, well it's a Halton sequence but almost :) ) macroparticles for each slice in the transverse direction....for context, the way I usually set it up is to have the beam contained within around 20 or so nodes in the centre of the grid in each of x and y when using 1000 macroparticles in each transverse slice. In the example file you gave, the beam may not be being properly sampled by the field, if that makes any sense. This interplay between the beam and grid sampling is crucial, rather than the absolute individual sampling of the beam and field grid. Maybe my numbers for the file here are incorrect...but as I say I'd aim to have about 20 or so nodes in the centre of the grid in each of x and y sampling the beam here (usually 5 or 6 times the standard deviation if it's a Gaussian beam), with the outer nodes there to allow for the field diffraction (usually 64 or 128 total, but depends on the amount of diffraction you need to model). With a Gaussian in x and y that's fine, adding more doesn't give you much, if any, benefit (certainly not worth the extra compute tbh). OTOH maybe your focussing system is causing the beam to stretch/contract significantly in x or y across the length of the undulator but hopefully this can point you in the right direction. I'd suggest testing this in periodic mode if you're not already - you'll be able test all this relatively quickly to pin down/eliminate the transverse variations you're investigating before moving to a full-fat simulation. |
I got trouble with the resolution setup. It is found that as the transverse resolution increases by increasing number of nodes keep, the spontaneous radiation continuous to increase with no end.
A specific image file is attached:
I would really appreciate if I can get some help!
The text was updated successfully, but these errors were encountered: