Skip to content
simulation module for PyGran: a DEM toolkit for rapid quantitative analysis of granular/powder systems
Python C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci codecov called directly (no bashrc) Jan 15, 2020
tests/DEM DEM class instantiated via with statement Jan 15, 2020
LICENSE added Clean class Oct 11, 2019

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

  title={PyGran: An object-oriented library for DEM simulation and analysis},
  author={Abi-Mansour, Andrew},

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 to build and/or install the package. See -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, dt=1e-6)

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

You can’t perform that action at this time.