kartikye / PyGranSim

simulation module for PyGran: a DEM toolkit for rapid quantitative analysis of granular/powder systems

Home Page:http://www.pygran.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to the PyGranSim webpage!

CircleCI Total alerts Language grade: Python codecov

PyGranSim is part of the PyGran project, an open-source toolkit primarily designed for analyzing DEM simulation data. In addition to performing basic and custom post-processing, PyGran enables running DEM simulation with the PyGranSim module. For more info on PyGran, see here.

If your find PyGran useful in your research, please consider citing the following paper:

DOI for Citing PyGran

@article{aam2019pygran,
  title={PyGran: An object-oriented library for DEM simulation and analysis},
  author={Abi-Mansour, Andrew},
  journal={SoftwareX},
  volume={9},
  pages={168--174},
  year={2019},
  publisher={Elsevier},
  doi={10.1016/j.softx.2019.01.016}
}

Quick Installation

PyGranSim is typically installed with other PyGran submodules. See here for more info. For a solo PyGranSim local installation, simply clone this repository and then use pip (or pip3) to run from the source dir:

pip install . --user

You can alternatively run setup.py to build and/or install the package. See setup.py -h for more info.

Basic Usage

PyGranSim also provides an interface for running DEM simulation with LIGGGHTS. This is achieved by importing the simulation module as shown in the script below for simulating granular flow in a hopper.

import PyGranSim as simulation
from PyGranParams import stearicAcid, steel

# Create a DEM parameter dictionary
param = {

	'model': simulation.models.SpringDashpot,
	'boundary': ('f','f','f'),
	'box':  (-1e-3, 1e-3, -1e-3, 1e-3, 0, 4e-3),

	'species': ({'material': stearicAcid, 'radius': 5e-5,}, 
		),
		
	'gravity': (9.81, 0, 0, -1),

	'mesh': { 'hopper': {'file': 'silo.stl', 'mtype': 'mesh/surface', \
		'material': steel}, },
}

# Instantiate a DEM class
sim = simulation.DEM(**param['model'])

# Insert 1000 particles for species 1 (stearic acid)
insert = sim.insert(species=1, value=1000) 

# Evolve the system in time 
sim.run(nsteps=1e6, dt=1e-6)

For more examples on using PyGran for running DEM simulation, check out the examples page.

About

simulation module for PyGran: a DEM toolkit for rapid quantitative analysis of granular/powder systems

http://www.pygran.org

License:GNU General Public License v2.0


Languages

Language:Python 87.6%Language:C++ 12.4%