Skip to content

ajulik1997/epc1d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

epc1d - Electrostatic PIC code in a 1D cyclic domain

One-dimensional particle-in-cell code written in Cython for simulating Landau damping and the two-stream instability.

Two-stream instability (full view)

Quick-start

Compile Cython code with: ./compile.sh

Generate default two-stream instability data: ./epc1d --twostream

Render to video: python render.py tmp.npz (ensure ffmpeg is available)

Arguments

Argument Abbr. Type Default Units Required?
--landau -l bool False Yes, if not --twostream
--twostream -t bool False Yes, if not --landau
--render -r bool False Optional
--length -L float 4π if --landau
100 if --twostream
Debye lengths Optional
--cells -c int 20 cells Optional
--particles -p int 1e3 if --landau
1e4 if --twostream
particles Optional
--alpha -a float 0.2 unitless Optional,
used with --landau
--newton -N int 10 Newton iterations Optional,
used with --landau
--vbeam -v float 2 thermal speeds Optional,
used with --twostream
--time -T float 20 normalised time Optional
--steps -s int 50 time steps Optional
--name -n str tmp Optional

Examples

  • 22500 particles, 10000 steps, full view: link
  • 500000 particles, 1000 steps, full view: link
  • 1000000 particles, 1400 steps, part-view (shown below): link

Two-stream instability (pv view)

About

Electrostatic PIC code in a 1D cyclic domain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published