Skip to content

Plasma Particle Dynamics (PPDyn), a python code to simulate plasma particles using Molecular Dynamics Algorithm. Numba JIT compiler for Python has been implemented for faster performance. Detailed documentation can be found at https://ppdyn.readthedocs.io/.

License

Notifications You must be signed in to change notification settings

sayanadhikari/PPDyn

Repository files navigation

PPDyn Example

PPDyn (Plasma Particle Dynamics)

CI build DOI Documentation Status PyPI Version Binder

A python code to simulate plasma particles using Molecular Dynamics Algorithm. Numba JIT compiler for Python has been implemented for faster performance.

A detailed documentation can be found at https://ppdyn.readthedocs.io/.

Example:

PPDyn Example

Problem

Contributors

Installation

Prerequisites

  1. GNU Make
  2. python3 or higher
  3. git

Procedure

Using Anaconda/Miniconda (Preferred)

First make a clone of the master branch using the following command

git clone https://github.com/sayanadhikari/PPDyn.git

Then enter inside the PPDyn directory

cd PPDyn

Now create a conda environment using the given environment.yml file

conda env create -f environment.yml

Activate the conda environment

conda activate ppdyn

Usage

Upon successful compilation, run the code using following command

python ppdyn.py -i input.ini

Using PyPI

pip install PPDyn

Usage

Download the input template to your working directory

wget https://raw.githubusercontent.com/sayanadhikari/PPDyn/main/input.ini

Now, either create a python script in your working directory or use your python console

from PPDyn import ppdyn
from PPDyn.ppdplot import animate
import time

start = time.time()
ppdyn(input)
end = time.time()
print("Elapsed (after compilation) = %s"%(end - start)+" seconds")
animate()

Using GNU Make

First make a clone of the master branch using the following command

git clone https://github.com/sayanadhikari/PPDyn.git

Then enter inside the PPDyn directory

cd PPDyn

Now complile and built the PPDyn code

make all

Usage

Upon successful compilation, run the code using following command

ppdyn -i input.ini

Parameter Setup

Edit the input.ini and run the code again. The basic structure of input.ini is provided below,

;
; @file		input.ini
; @brief	PPDyn inputfile.
;
;scope = default

[simbox]
Lx  = 15.0    ; System length in X
Ly  = 15.0    ; System length in Y
Lz  = 20.0    ; System length in Z

[particles]
N     = 1000 ; Number of particles
Vxmax = 1.0     ; Maximum velocity in X
Vymax = 1.0     ; Maximum velocity in Y
Vzmax = 1.0     ; Maximum velocity in Z
Temp  = 0.1     ;
dist = True     ; Use distribution: True
mean = 1  ; if dist = True
stdDev = 0.2  ; if dist = True

[screening]
k = 0.0

[gravity]
g_0= 0.0063;    Reduced Earth's gravity

[cutoff radius]
rc = 1e-5

[boundary]
btype = mixed ; Type of boundary Options: periodic, reflecting, mixed

[time]
tmax  = 10.0    ; Final time
dt    = 0.010   ; time step size

[diagnostics]
dumpPeriod  = 5    ; Data dump period
dumpData    = True
vtkData     = True
realTime    = False

[directory]
dataDir = data #put runname here

[options]
parallelMode  = True ;True ;set to false to disable parallel

Visualization

For visualization, user either can use the python scripts available inside scripts directory or can write their own. After successful run the data will be available under data directory. Two different data formats are available at present. The complete dataset will available under the name particle.hdf5. For vtk visualization users can use .vtu files inside data/vtkdata. Paraview can be used to animate particle dynamics very easily. A sample video can be found here.

Contributing

We welcome contributions to this project.

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

License

Released under the MIT license.

About

Plasma Particle Dynamics (PPDyn), a python code to simulate plasma particles using Molecular Dynamics Algorithm. Numba JIT compiler for Python has been implemented for faster performance. Detailed documentation can be found at https://ppdyn.readthedocs.io/.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published