Particle distributions

Warning

This section is currently in development.

class picmistandard.PICMI_GaussianBunchDistribution(n_physical_particles, rms_bunch_size, rms_velocity=[0.0, 0.0, 0.0], centroid_position=[0.0, 0.0, 0.0], centroid_velocity=[0.0, 0.0, 0.0], velocity_divergence=[0.0, 0.0, 0.0], **kw)[source]

Describes a Gaussian distribution of particles

Parameters:
  • n_physical_particles (integer) – Number of physical particles in the bunch

  • rms_bunch_size (vector of length 3 of floats) – RMS bunch size at t=0 [m]

  • rms_velocity (vector of length 3 of floats, default=[0.,0.,0.]) – RMS velocity spread at t=0 [m/s]

  • centroid_position (vector of length 3 of floats, default=[0.,0.,0.]) – Position of the bunch centroid at t=0 [m]

  • centroid_velocity (vector of length 3 of floats, default=[0.,0.,0.]) – Velocity (gamma*V) of the bunch centroid at t=0 [m/s]

  • velocity_divergence (vector of length 3 of floats, default=[0.,0.,0.]) – Expansion rate of the bunch at t=0 [m/s/m]

class picmistandard.PICMI_UniformDistribution(density, lower_bound=[None, None, None], upper_bound=[None, None, None], rms_velocity=[0.0, 0.0, 0.0], directed_velocity=[0.0, 0.0, 0.0], fill_in=None, **kw)[source]

Describes a uniform density distribution of particles

Parameters:
  • density (float) – Physical number density [m^-3]

  • lower_bound (vector of length 3 of floats, optional) – Lower bound of the distribution [m]

  • upper_bound (vector of length 3 of floats, optional) – Upper bound of the distribution [m]

  • rms_velocity (vector of length 3 of floats, default=[0.,0.,0.]) – Thermal velocity spread [m/s]

  • directed_velocity (vector of length 3 of floats, default=[0.,0.,0.]) – Directed, average, proper velocity [m/s]

  • fill_in (bool, optional) – Flags whether to fill in the empty spaced opened up when the grid moves

picmistandard.PICMI_UniformFluxDistribution

alias of PICMI_AnalyticFluxDistribution

class picmistandard.PICMI_AnalyticDistribution(density_expression, momentum_expressions=[None, None, None], momentum_spread_expressions=[None, None, None], lower_bound=[None, None, None], upper_bound=[None, None, None], rms_velocity=[0.0, 0.0, 0.0], directed_velocity=[0.0, 0.0, 0.0], fill_in=None, **kw)[source]

Describes a plasma with density following a provided analytic expression

Parameters:
  • density_expression (string) – Analytic expression describing physical number density (string) [m^-3]. Expression should be in terms of the position, written as ‘x’, ‘y’, and ‘z’. Parameters can be used in the expression with the values given as keyword arguments.

  • momentum_expressions (list of strings) – Analytic expressions describing the gamma*velocity for each axis [m/s]. Expressions should be in terms of the position, written as ‘x’, ‘y’, and ‘z’. Parameters can be used in the expression with the values given as keyword arguments. For any axis not supplied (set to None), directed_velocity will be used.

  • momentum_spread_expressions (list of strings) – Analytic expressions describing the gamma*velocity Gaussian thermal spread sigma for each axis [m/s]. Expressions should be in terms of the position, written as ‘x’, ‘y’, and ‘z’. Parameters can be used in the expression with the values given as keyword arguments. For any axis not supplied (set to None), zero will be used.

  • lower_bound (vector of length 3 of floats, optional) – Lower bound of the distribution [m]

  • upper_bound (vector of length 3 of floats, optional) – Upper bound of the distribution [m]

  • rms_velocity (vector of length 3 of floats, detault=[0.,0.,0.]) – Thermal velocity spread [m/s]

  • directed_velocity (vector of length 3 of floats, detault=[0.,0.,0.]) – Directed, average, proper velocity [m/s]

  • fill_in (bool, optional) – Flags whether to fill in the empty spaced opened up when the grid moves

This example will create a distribution where the density is n0 below rmax and zero elsewhere.:

.. code-block:: python
dist = AnalyticDistribution(density_expression=’((x**2+y**2)<rmax**2)*n0’,

rmax = 1., n0 = 1.e20, …)

class picmistandard.PICMI_AnalyticFluxDistribution(flux, flux_normal_axis, surface_flux_position, flux_direction, lower_bound=[None, None, None], upper_bound=[None, None, None], rms_velocity=[0.0, 0.0, 0.0], directed_velocity=[0.0, 0.0, 0.0], flux_tmin=None, flux_tmax=None, gaussian_flux_momentum_distribution=None, **kw)[source]

Describes a flux of particles emitted from a plane

Parameters:
  • flux (string) – Analytic expression describing flux of particles [m^-2.s^-1] Expression should be in terms of the position and time, written as ‘x’, ‘y’, ‘z’, and ‘t’.

  • flux_normal_axis (string) – x, y, or z for 3D, x or z for 2D, or r, t, or z in RZ geometry

  • surface_flux_position (double) – location of the injection plane [m] along the direction specified by flux_normal_axis

  • flux_direction (int) – Direction of the flux relative to the plane: -1 or +1

  • lower_bound (vector of floats, optional) – Lower bound of the distribution [m]

  • upper_bound (vector of floats, optional) – Upper bound of the distribution [m]

  • rms_velocity (vector of floats, default=[0.,0.,0.]) – Thermal velocity spread [m/s]

  • directed_velocity (vector of floats, default=[0.,0.,0.]) – Directed, average, proper velocity [m/s]

  • flux_tmin (float, optional) – Time at which the flux injection will be turned on.

  • flux_tmax (float, optional) – Time at which the flux injection will be turned off.

  • gaussian_flux_momentum_distribution (bool, optional) – If True, the momentum distribution is v*Gaussian, in the direction normal to the plane. Otherwise, the momentum distribution is simply Gaussian.

class picmistandard.PICMI_ParticleListDistribution(x=0.0, y=0.0, z=0.0, ux=0.0, uy=0.0, uz=0.0, weight=0.0, **kw)[source]

Load particles at the specified positions and velocities

Parameters:
  • x (float, default=0.) – List of x positions of the particles [m]

  • y (float, default=0.) – List of y positions of the particles [m]

  • z (float, default=0.) – List of z positions of the particles [m]

  • ux (float, default=0.) – List of ux positions of the particles (ux = gamma*vx) [m/s]

  • uy (float, default=0.) – List of uy positions of the particles (uy = gamma*vy) [m/s]

  • uz (float, default=0.) – List of uz positions of the particles (uz = gamma*vz) [m/s]

  • weight (float) – Particle weight or list of weights, number of real particles per simulation particle

class picmistandard.PICMI_FromFileDistribution(file_path, **kw)[source]

Load particles from an openPMD file.

The openPMD file must contain the attributes position, momentum, weighting.