prepic.simulation module

Classes for modelling PIC simulation parameters

class prepic.simulation.Simulation(plasma, box_length=None, ppc=None)[source]

Bases: prepic.base.BaseClass

Class for estimating the recommended simulation parameters.

Δx

Transverse spatial resolution.

Type

float, length

Δy

Transverse spatial resolution.

Type

float, length

Δz

Longitudinal spatial resolution.

Type

float, length

nx

Transverse number of cells.

Type

int, dimensionless

ny

Transverse number of cells.

Type

int, dimensionless

nz

Longitudinal number of cells.

Type

int, dimensionless

L

Length of cubic simulation box.

Type

float, length

ppc

Number of particles per cell.

Type

int, dimensionless

npart

Total number of (macro-)particles in the simulation box.

Type

int, dimensionless

dt

Simulation time step per iteration.

Type

float, time

t_interact

Time it takes for the moving window to slide across the plasma.

Type

float, time

nstep

Number of iterations to perform.

Type

int, dimensionless

Notes

Here longitudinal means along the laser propagation direction. Recommended number of particles per cell: 64 (1D), 10 (2D), 8 (3D).

Examples

>>> import unyt as u
>>> from prepic import Plasma, Laser, GaussianBeam
>>> mylaser = Laser.from_power(power=10 * u.petawatt, ɛL=300 * u.joule,
...                            beam=GaussianBeam(w0=5 * u.micrometer))
>>> myplasma = Plasma(n_pe=1e18 / u.cm**3, laser=mylaser)
>>> Simulation(myplasma)
<Simulation(<Plasma(1e+18 cm**(-3), <Laser(300.0 J, 28.18311836098954 fs, <GaussianBeam(5.0 µm, 0.8 µm)>)>, None)>, 133.5577261430166 µm, 8 dimensionless)>