Vdocuments - MX Liggghts Tutorial
Vdocuments - MX Liggghts Tutorial
LIGGGHTS is a simulation code for conducting Discrete Element Method (DEM) simulations of granular
materials. Unlike some commercial codes, LIGGGHTS is not driven by a graphical user interface. Rather, the
user drives the simulation by assembling a text-based input deck consisting of a series of commands to conduct
the simulation. The input deck is read sequentially, so ordering of statements is important.
1. Initialization
Set the parameters that need to be defined before particles are created
2. Setup
Define the material properties, particles, geometry, and particle generation
3. Detailed Settings
Define some settings that correspond to speed and memory utilization, output options, etc.
4. Execution
The actual run command that executes the simulation
Note that there are two basic types of statements in a LIGGGHTS input deck – individual commands and fixes.
The individual commands establish basic settings for the simulation, while the fixes are used to set particular
aspects of the simulation. Generally, fixes (and a few commands, e.g. region) follow a common structure of
In this tutorial, we will step through a few input decks to describe the commands and fixes to run each simulation.
This tutorial is not intended to cover all possible situations and commands, but rather, to try to describe some
common elements in a LIGGGHTS simulation and to provide a starting point for users to develop their own
simulations. For additional or more specific information about options for each statement, please see the
documentation.
Finally, at the end of this report, we provide some ‘best practices’ that have been collected over the past few
years to try to help the reader avoid some common mistakes and to achieve the maximum performance out of the
simulation.
http://slidepdf.com/reader/full/liggghts-tutorial 1/18
8/17/2019 Liggghts Tutorial
A cylindrical hopp er was initially fill ed with a set of spher ical particles which were allowed to settl e under the
influence of gravity. The bottom of the hopper was then opened and the material was allowed to pour from the
hopper.
http://slidepdf.com/reader/full/liggghts-tutorial 2/18
8/17/2019 Liggghts Tutorial
### This simulation involves inserting a set of particles into a cylindrical hopper,
### allowing them to settle under gravity, and then suddenly opening a stopper at the
### bottom of the hopper and allowing the particles to pour out. We track the
### flowrate of material from the hopper by tracking how many particles remain in the
### system as a function of time.
fix pts all particletemplate/sphere 1 atom_type 1 density constant 1000 & different
radius constant 0.0015 Comment [A10]: Describe the particles to be
fix pdd all particledistribution/discrete 63243 1 pts 1.0 inserted (material type, radius, and density)
region factory cylinder z 0 0 0.10 0.4 0.41 units box
fix ins all insert/rate /region seed 123481 distributi ontemplate pdd & Comment [A11]: Describe the composition of
nparticles 150000 particlerate 150000 insert_every 1000 & the particle distribution
overlapcheck yes vel constant 0. 0. -1.0 region factory ntry_mc 10000 Comment [A12]: Describe the particle insertion;
primary focus is on the number of particles, the
# Import mesh from cad: insertion rate, and the initial velocity; This example
fix cad1 all mesh/surface file hopper.stl type 2 scale 0.001 uses the insert/rate/region method in which all
particles are placed inside a specified primitive
# Use the imported mesh as granular wall region.
fix geometry all wall/gran/hertz/history mesh n_meshes 1 meshes cad1
Comment [A13]: Declare the geometry files to
be read in to the simulation; various options for
# Create stopper for funnel
scaling, rotation, and translation are possible
fix stopper all wall/gran/hertz/history primitive type 2 zplane 0.0
Comment [A14]: Declare which geometry
# Define the physics elements should be used as actual walls in the
pair_style gran/hertz/history simulation
pair_coeff ** Comment [A15]: Use of a primitive wall;
primitive options include planes and cylinders
http://slidepdf.com/reader/full/liggghts-tutorial 3/18
8/17/2019 Liggghts Tutorial
# Integrator
fix integrate all nve/sphere Comment [A17]: Declaration of the integrator
to use; always nve/sphere unless using multisphere
# Gravity particles
fix grav all gravity 9.81 vector 0.0 0.0 -1.0
Comment [A18]: Establish the gravity vector
# Time step
timestep 0.00001 Comment [A19]: Time step for the simulation.
Typically try to keep this less than or equal to 20%
# Thermodynamic output settings of the Rayleigh time.
thermo_style custom step atoms ke cpu
thermo 10000 Comment [A20]: ; Describe which quantities are
to be printed in the logfile
thermo_modify norm no lost ignore
Comment [A21]: How often to write
# Check time step and initialize dump file thermodynamic quantities
fix ctg all check/timestep/gran 1 0.01 0.01
run 1 Comment [A22]: Set options for
thermodynamics output; ‘norm’ normalizes output
unfix ctg
on a per particle basis ; ‘lost ignore’ allows the
simulation to continue running if a particle is lost
# Create imaging information
from the simulation, which occurs when a particle
dump dumpstl all stl 10000 dump*.stl
dump dmp all custom 10000 dump.1 id type type x y z ix iy iz vx vy vz & travels
this is aoutside the as
bad thing, specified domain
it indicates limits;is often,
a system losing
fx fy fz omegax omegay omegaz radius mass incorrectly; however, for this simulation (and
continuous flow processes in general), once we start
discharging particles from the hopper, we want to
eliminate the particles from the simulation in order
### Execution and further settings to speed it up
# Fill the hopper Comment [A23]: Run the time step check over 1
run 150000 upto time step
http://slidepdf.com/reader/full/liggghts-tutorial 4/18
8/17/2019 Liggghts Tutorial
A continuous blendi ng mixer is simul ated in which a stream of particles enters at one end and is c ontinuously
blended as it travels down the length of the bed before discharging through a chute at the other end of the unit.
We consider different feed rates and different impeller rotation rates. Material is fed into the simulation via a
constant mass flowrate stream at one end of the unit, and is removed through a chute at the other end.
http://slidepdf.com/reader/full/liggghts-tutorial 5/18
8/17/2019 Liggghts Tutorial
### This simulation involves inserting a stream of particles at one end of a continuous
### blending mixer, conveying and mixing the material along the bed of the mixer, and then
### discharging the material through a chute at the other end of the unit.
### Initialization
# Preliminaries
units si
atom_style sphere
boundary fff
newton off
communicate single vel yes
# Declare domain
region reg block -0.320 0.320 -1.960 1.460 -0.290 0.335 units box
create_box 1 reg
### Setup
# Integrator
fix integrate all nve/sphere
# Gravity
fix grav all gravity 9.81 vector 0.0 0.0 -1.0
http://slidepdf.com/reader/full/liggghts-tutorial 6/18
8/17/2019 Liggghts Tutorial
http://slidepdf.com/reader/full/liggghts-tutorial 7/18
8/17/2019 Liggghts Tutorial
1
A Couette cylinder with axial flow, base d on work by Kheiri pour et al , is depicted in the figure below. The device
is intended to look at the rheological behaviour of a granular flow and to permit study of the tendency for material
to segregated based on particle size. In these simulations, we have randomly inserted two different particle sizes
(particles are otherwise identical) over a one second interval. The stopper at the bottom of the hopper is then
pulled and material flows through a periodic z-boundary condition to flow back into the top of the unit. In doing so,
the net mass in the system remains constant. Simultaneously, the drum in the center of the unit rotates about its
axis, setting up a shearing action inside the cylinder.
1
Study of powder flow patterns in a Couette cell with axial flow using tracers and solid fraction measurements , M.
Kheiripour Langroudi, P. R. Mort, Gi. I. Tardos, Granular Matter, Oct 2011, Vol 13, Iss 5, pp 541-552
http://slidepdf.com/reader/full/liggghts-tutorial 8/18
8/17/2019 Liggghts Tutorial
### This simulation first inserts a set of particles into the Couette cylinder and allows
### them to settle. Then the interior cylinder is set to rotate at a constant rate and the
### bottom of the hopper is opened to allow material to flow in the vertical direction. A
### periodic boundary is used in the z-direction to reinsert the flow of material and
### maintain a constant mass of material in the apparatus.
### Initialization
# Preliminaries
units si
atom_style sphere
boundary ffp Comment [A34]: Using a periodic boundary in
newton off the z-direction so we can pour material back and
communicate single vel yes forth between two vessels while minimizing the
amount of extraneous vessel motion
# Declare domain
region reg block -0.078 0.078 -0.078 0.078 -0.1524 0.306 units box
create_box 2 reg
### Setup
# Integrator
fix integrate all nve/sphere
http://slidepdf.com/reader/full/liggghts-tutorial 9/18
8/17/2019 Liggghts Tutorial
# Gravity
fix grav all gravity 9.81 vector 0.0 0.0 -1.0
# Timestep
timestep 0.00000625
# Check timestep
fix timecheck all check/time step/gran 1 0.01 0.01
run 1
unfix timecheck
# Dump output
#dump dmp all custom 16000 dump.1 id type type x y z ix iy iz vx vy vz fx fy fz &
omegax omegay omegaz radius
#dump dumpstl all stl 16000 dump*.stl
#dump dmp2 all custom 16000 dump.txt type x y z radius
# Run 30 sec
run 4800000
http://slidepdf.com/reader/full/liggghts-tutorial 10/18
8/17/2019 Liggghts Tutorial
A narrow slot is fil led by a stream of pa rticles falling near one side, with the f low passing across a narrow jet of air.
The air stream causes the particles to blow towards the opposite end of the slot and creates a pile against the far
wall.
In this example, we’ve designed the stream force to be added via the ‘fix addforce’ command. Using this
command, we have designated a small region of space immediately below the inlet stream of particles that
causes all particles that enter the region to experience a body force that pushes them laterally. While we’ve used
a simple constant force in this example, it is also possible to use variable quantities for the force to represent
more complicated flow fields. In addition, the force can be applied to certain groups of particles.
While this flow treatment is obviously reduced in fidelity from a truly coupled CFD-DEM simulation, it does provide
a simple way to at least include some influence of an external flow field. Thus, for situations in which the particles
do not significantly alter the flow field, we can use CFD to determine the flow field in the absence of the solid
phase, and then apply this flow field to the DEM simulations to better understand the actual particle dynamics.
One could envision using this to model the segregation due to drag forces acting on different sized particles.
http://slidepdf.com/reader/full/liggghts-tutorial 11/18
8/17/2019 Liggghts Tutorial
### This simulation involves inserting particles into slot across a horizontal air
### stream that applies a force to the particles and pushes them sideways, creating
### a pile-up at the far end of the slot. The focus here is on the use of the applied
### body force to act as a weak 1-way coupled flow field. While not a general substitute
### for the full 2-way coupling, it is useful in some circumstances.
### Initialization
units si
atom_style sphere
boundary fff
newton off
communicate single vel yes
# Declare domain
region reg block -0.155 0.155 -0.015 0.015 -0.005 0.235 units box
create_box 2 reg
### Setup
# Physics
pair_style gran/hertz/history
pair_coeff **
# Particle insertion
fix pts all particletemplate/sphere 1 atom_type 1 density constant 1000 &
radius constant 0.002
fix pdd all particledistribution/discrete 34234 1 pts 1.0
region factory block -0.14 -0.10 -0.006 0.006 0.215 0.225 units box
fix ins all insert/rate/region seed 54325 distributiontemplate pdd &
nparticles 10000 particlerate 10000 insert_every 500 overlapcheck yes &
vel constant 0. 0. -2.0 region factory ntry_mc 10000
# Geometry
fix wal11 all wall/gran/hertz/history primitive type 1 zplane 0.0
fix wall2 all wall/gran/hertz/history primitive type 1 xplane -0.15
fix wall3 all wall/gran/hertz/history primitive type 1 xplane 0.15
fix wall4 all wall/gran/hertz/history primitive type 1 yplane -0.01
fix wall5 all wall/gran/hertz/history primitive type 1 yplane 0.01
# Integration
fix integrate all nve/sphere
# Gravity
fix grav all gravity 9.81 vector 0.0 0.0 -1.0
# Timestep
http://slidepdf.com/reader/full/liggghts-tutorial 12/18
8/17/2019 Liggghts Tutorial
timestep 0.00001
# Thermo settings
thermo_style custom step atoms ke cpu
thermo 10000
thermo_modify lost ignore norm no
compute_mod ify thermo_temp dynamic yes
# Run remainder
run 200000 upto
http://slidepdf.com/reader/full/liggghts-tutorial 13/18
8/17/2019 Liggghts Tutorial
This simulation is designed to highlight the use of the servo-controlled wall, in which a geometric construct can
move in response to a collision with a particle. Typical walls in a DEM simulation are assumed to be immune to
the influence of particle impacts, and so wall motions must be completely prescribed. Using the servo wall allows
us to consider additional systems, such as the shear cell shown here, in which the wall position is determined by
a combination of a subjected load and impacts with the particles.
An annular ring was initially filled with t wo sets of spheric al particles (red = 4 m m diameter and blue = 6 mm)
which were allowed to settle under the influence of gravity. The particles were filled sequentially with the larger
blue particles on the bottom, followed by the red particles on top. After the cell is filled, an annular lid is lowered
onto the top of the cell and held with a load on top. The lid is allowed to move in the z-direction in response to
stresses imparted by the particles and the load on top. Once the lid has been placed, the bottom of the ring is
slowly rotated to create a shear field and instigate segregation.
Once the shearing action starts, the smaller particles percolate down through the layer of larger particles, causing
the material to vertically segregate.
http://slidepdf.com/reader/full/liggghts-tutorial 14/18
8/17/2019 Liggghts Tutorial
### Initialization
# Preliminaries
units si
atom_style sphere
boundary fff
newton off
communicate single vel yes
# Declare domain
region reg block -0.325 0.325 -0.325 0.325 -0.001 0.081 units box
create_box 2 reg
### Setup
# Physics
pair_style gran/hertz/history
pair_coeff **
# Geometry
fix cad1 all mesh/surface/stress file shear_cell.stl type 1 scale 0.001 stress on
fix cad2 all mesh/surface/stress file bottom_plate.stl type 1 scale 0.001 stress on
fix ins_mesh all mesh/surface/planar file factory.stl type 1 scale 0.001
fix geometry all wall/gran/hertz/history mesh n_meshes 2 meshes cad1 cad2 Comment [A41]: Insert some of the geometry
components. A loaded top plate will be added later
once particles have been inserted.
# Integration
fix integrator all nve/sphere
# Gravity
fix grav all gravity 9.81 vector 0.0 0.0 -1.0
# Timestep
timestep 0.00002
# Thermodynamic output
thermo_style custom step atoms ke cpu
thermo 10000
thermo_modify lost ignore norm no
http://slidepdf.com/reader/full/liggghts-tutorial 15/18
8/17/2019 Liggghts Tutorial
http://slidepdf.com/reader/full/liggghts-tutorial 16/18
8/17/2019 Liggghts Tutorial
Best Practices
Stability
Keep the timestep below 20% TR for stability. Use the fix_check_timestep_gran to ensure that your
timestep is not too large.
Use ‘thermo modify lost ignore’ for continuous processes in order to allow the simulation to ignore
particles that leave the simulation domain. Otherwise, the simulation will shut down once the first
particle is lost.
In conjunction with the previous note, do not ignore lost particles for batch processes as a lost particle is
an indication that the simulation isn’t stable.
Pay attention to the kinetic energy and cpu time in your thermo output.
o If the kinetic energy is jumping about violently, it is an indication that the timestep may be too
large. This could result in a particle deeply penetrating another body during the course of one
timestep, resulting in a huge repulsive force and high corresponding kinetic energy in the next
step.
o The
fairlycpu time per
smooth step should
progression remain
when fairly
filling constant
a system. when
If the at equilibrium,
time/step suddenlyand should
starts follow a
to increase
dramatically during filling, it is an indication that something is blocking the feed zone and
preventing you from achieving the desired fill rate. This may also manifest as warnings that
fewer particles were inserted than desired.
Particle generation
If you see warnings that the simulation was unable to insert the desired amount of particles, it is an
indicator that you are trying to feed too aggressively. To counter this, either (1) decrease the feed rate,
(2) increase the size of the insertion zone, or (3) increase the initial velocity of the particles so they clear
the zone more quickly.
o The insertion zone is often limited by the size of the geometry. In cases where it is not, it can
sometimes be tempting to enlarge the zone dramatically to ease particle insertion. However,
this can cause two problems. First, if the zone is large in the direction of gravity, particles may
accelerate to sufficiently high velocities so as to cause stability problems where a particle will
impact another body at too high of a speed to be handled by the base timestep. Second, it may
force you to expand the domain of the simulation, which can slow the simulation down
(depends on p rocessor assignment).
o Setting the initial velocity too high can lead to stability problems as described above.
If the simulation initially inserts particles without issue, but then starts to suffer problems where it is
unable to insert the desired number of particles, it is an indication that something is now obstructing the
insertion zone. Most likely is that the previously inserted mass has backed up or formed a pile that is
now intruding into the insertion zone.
It is generally a good idea to make sure a batch system is fully enclosed so as to avoid losing particles
during the simulation. However, the presence of a lid can limit the ability to insert particles. If the lid is
inserted as a separate object, it can be moved about before and after the particle insertion to facilitate
the filling operation, or simply added to the system after all particles have been added.
Using different material types for different groups of particles, even if all of the material properties are
identical, can be a convenient way to identify particles and groups of particles during post-processing.
This is especially true for mixing problems.
Of the three insertion methods (pack, rate/region, and stream), it is recommended to use the
rate/region or stream methods. The pack method relies on being able to fill a volume with a large
number of particles at one time via random sequential addition, which will typically fill a volume to no
more than 30%. This can make it difficult to achieve the desired number of particles and will often leave
a large empty space in the simulation domain that reduces the efficiency of parallelization. Using the
http://slidepdf.com/reader/full/liggghts-tutorial 17/18
8/17/2019 Liggghts Tutorial
Geometry
Use a simple mesh, even w/ high-aspect ratio triangles. Tests thus far indicate no difference in accuracy
of results ( disclamer – more testing is needed here, especially for stress calculations! ) between using a
coarse mesh as generated directly from a CAD program, and using a fine mesh as generated by a tool
such as gmsh.
o The high-aspect ratio triangles may diminish the ability to parallelize the geometry, but if there
are significantly fewer facets than a fine description, you may end up saving more time in the
long run. In many simulations, the number of particles will far exceed the number of facets in
the geometry, and so parallelizing the geometry isn’t as critical.
Simplify the geometry to avoid including parts that will never touch the particles (e.g. the motor that
drives a mixer).
Simplify geometry to avoid very small curved surfaces if possible. These may end up using a lot of facets
that aren’t really that important.
Keep in mind that gravity doesn’t always have to point down.
Speed-ups
Keep the domain size as small as possible without losing geometry. This will avoid wasting processing
power on empty space.
Pay attention to the processor distribution. For many systems, you can take advantage of knowing
where your particles will be during the simulation to assign processors in an advantageous way and
enhance the speed of the simulation. For example, if you have a batch mixer where the particles are
gently mixed and generally occupy only the lower half of the mixer volume, using two processors in the
z-direction results in the top-most layer of processors doing very little work and not being used
effectively. Using a single layer in the z-direction instead will lead to a significantly faster simulation.
In the absence of testing, set the skin size for neighbor list calculations to ~ 1 particle diameter. Setting
the neighbor list skin size too small leads to overly frequent recalculations of the neighbor list, while
setting it too large leads to huge memory requirements. The optimal setting is a balance between the
two and depends on the size of the particles, the density of the system, and the speed at which particles
are moving about. A single guideline for all cases is thus difficult to set, and ideally some testing should
be done to optimize the simulation.
Adjust physical properties as possible for speed. For example, modulus can often be set much lower
than realistic values, yielding a significant speedup, without impacting the overall simulation results.
7
Typically, setting the elastic modulus to ~10 Pa is sufficiently high so as to capture the basic particle
dynamics. Increasing the density also has a positive effect by allowing for a larger timestep, though
typically we are not able to alter density by as much as an order of magnitude.
Visualization/post-processing
You can export the geometry in multiple sets of dump files to facilitate visualization by allowing you to
set the transparency on a per-body basis.
You can use multiple particle types, even if they all have the same material properties, to help with post-
processing elements. For example, when considering the performance of a mixer, having two particle
types, with one type fed to each side of the mixer, it becomes trivial to visualize mixing performance as
you can color by particle type. You can also calculate quantities like a mixing index based on particle
type.
http://slidepdf.com/reader/full/liggghts-tutorial 18/18