Two different bunches as input

Moderators: cyao, michael_borland

Post Reply
Björklund
Posts: 84
Joined: 19 May 2016, 07:14

Two different bunches as input

Post by Björklund » 14 Feb 2017, 07:35

Hi,

I'm running simulations on accelerating a double-bunch (longitudinal) structure through a linac. I have up to this point created my own "artificial" bunches by duplicating a simulated ASTRA file and changing the longitudinal phase space to correspond to the RF at different phases, resulting in a single input file with two separate bunches in it. So far so good.

What I now want to do is to change the charge in the individual bunches, and this turns out not to be so simple, at least for me. The way to do this for me is probably to make some extra duplications in one of the bunches (to increase the relative number of particles), but this is hard to do in a good way if the charge of one bunch is not an integer multiple of the charge in the other. I need to have both bunches in the same simulation because of wakefield effects and CSR, so I can't run them separately.

Therefore, I would like to know if there already is a way of changing the charge in parts of an input file or otherwise if this could maybe be introduced in an upcoming version of elegant. The possibility of specifying two different files in sdds_beam together with some relation between the bunch charges would be great.

Best regards
Jonas

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Two different bunches as input

Post by michael_borland » 14 Feb 2017, 09:13

Jonas,

The attached files demonstrate how to do this.

--Michael
Attachments
varyCharge.zip
(16.64 MiB) Downloaded 373 times

Björklund
Posts: 84
Joined: 19 May 2016, 07:14

Re: Two different bunches as input

Post by Björklund » 15 Feb 2017, 03:41

Hi,

Thanks for the quick reply!

This looks very much like something I could use, but I don't think I understand how it works. When setting 'track_pages_separately = 1', doesn't the code track the bunches specified on the respective pages separately, i.e. one by one, or can they still influence each other via e.g. wakefields?

Best regards
Jonas

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Two different bunches as input

Post by michael_borland » 15 Feb 2017, 09:05

Jonas,

Sorry, I misunderstood what you are trying to do.

Unfortunately, during any single step, elegant assigns a single value of the charge to each macroparticle. The only way to do what you want is to vary the number of particles in the two bunches.

Addressing this limitation is on my list of things to do...

--Michael

Björklund
Posts: 84
Joined: 19 May 2016, 07:14

Re: Two different bunches as input

Post by Björklund » 16 Feb 2017, 03:34

Hi,

All right, then I'll try to do this in as good a way as possible in my own script for now. Waiting with suspense for future versions :)

Thanks!
Best regards
Jonas

Post Reply