Generates the particle positions and times based on random samples from electron positions in the bunch.
Generates the particle positions and times based on random samples from
electron positions in the bunch.
Parameters:
----------
electron_bunch : Bunch
An instance of the Bunch class representing the electron bunch.
charge : float
Total ion charge generated in [C].
"""
ifelectron_bunch.is_empty:
raiseValueError("Electron bunch is empty.")
...
...
@@ -392,47 +423,71 @@ class IonParticles(Bunch):
classBeamIonElement(Element):
"""
Represents an element for simulating beam-ion interactions.
Apertures and monitors for the ion beam (instances of IonAperture and
IonMonitor) can be added to tracking after the BeamIonElement object has
been initialized by using:
beam_ion.apertures.append(aperture)
beam_ion.monitors.append(monitor)
If the a IonMonitor object is used to record the ion beam, at the end of
tracking the user should close the monitor, for example by calling:
beam_ion.monitors[0].close()
Parameters
----------
ion_mass : float
The mass of the ions in kg.
The mass of the ions in [kg].
ion_charge : float
The charge of the ions in Coulomb.
The charge of the ions in [C].
ionization_cross_section : float
The cross section of ionization in meters^2.
The cross section of ionization in [m^2].
residual_gas_density : float
The residual gas density in meters^-3.
The residual gas density in [m^-3].
ring : instance of Synchrotron()
The ring.
ion_field_model : str
The ion field model, the options are 'weak' (acts on each macroparticle), 'strong' (acts on c.m.), 'PIC'.
ion_field_model : {'weak', 'strong', 'PIC'}
The ion field model used to update electron beam coordinates:
- 'weak': ion field acts on each macroparticle.
- 'strong': ion field acts on electron bunch c.m.
- 'PIC': a PIC solver is used to get the ion electric field and the
result is interpolated on the electron bunch coordinates.
For both 'weak' and 'strong' models, the electric field is computed
using the Bassetti-Erskine formula [1], so assuming a Gaussian beam
distribution.
For 'PIC' the PyPIC package is required.
electron_field_model : str
The electron field model, the options are 'weak', 'strong', 'PIC'.
electron_field_model : {'weak', 'strong', 'PIC'}
The electron field model, defined in the same way as ion_field_model.
ion_element_length : float
The length of the beam-ion interaction region. For example, if only a single interaction point is used this should be equal to ring.L.
x_radius : float
The x radius of the aperture.
y_radius : float
The y radius of the aperture.
n_steps : int
The number of records in the built-in ion beam monitor. Should be number of turns times number of bunches because the monitor records every turn after each bunch passage.
The length of the beam-ion interaction region. For example, if only a
single interaction point is used this should be equal to ring.L.
n_ion_macroparticles_per_bunch : int, optional
The number of ion macroparticles generated per electron bunch passed. Defaults to 30.
ion_beam_monitor_name : str, optional
If provided, the name of the ion monitor output file. It must end with an extension '.hdf5'.
If None, no ion monitor file is generated.
use_ion_phase_space_monitor : bool, optional
Whether to use the ion phase space monitor.
generate_method : str, optional
The method to generate the ion macroparticles, the options are 'distribution', 'samples'. Defaults to 'distribution'.
'distribution' generates a distribution statistically equivalent to the distribution of electrons.
'samples' generates ions from random samples of electron positions.
The number of ion macroparticles generated per electron bunch passage.