LIGGGHTS vs LAMMPS for DEM: validation and scaling on cloudHPC

Published by Ruggero Poletto on

Silo discharge: flow rate vs orifice and discharged mass vs time

TL;DR

  • We ran the same granular physics in LIGGGHTS-PUBLIC 3.8.0 and in LAMMPS (GRANULAR package) on cloudHPC: 3 validation cases + a scaling study up to 192 cores, 27 runs in total.
  • Physics match: Hertz contact times match the analytical solution to 0.014 % in both codes; silo flow rates agree within 0.7 %; without rolling resistance, column-collapse runouts land in the same 2 mm bin.
  • One trap: in the LAMMPS build we used (7 Feb 2024) the tsuji damping returns the wrong restitution (e = 0.44 when 0.3 is requested). It is the missing โˆš2 factor that LAMMPS corrected in a later release; LIGGGHTS hits the target exactly.
  • Speed: LIGGGHTS was 1.15โ€“1.25ร— faster at every core count; both codes scale the same way (โ‰ˆ 9ร— from 8 to 192 cores on 818 k particles).
  • Validation: both reproduce Beverloo’s C = 0.58 and are within +3.5 % of the Lube et al. (2004) experimental runout at a โ‰ˆ 3.
LIGGGHTS and LAMMPS discharging the same silo side by side

Why compare LIGGGHTS and LAMMPS now?

LIGGGHTS (“LAMMPS Improved for General Granular and Granular Heat Transfer Simulations”) was forked from a 2012 version of LAMMPS and became the open-source reference for the Discrete Element Method (DEM). Its public branch has been frozen at 3.8.0 since 30 November 2017 (version history). Meanwhile LAMMPS itself kept moving: its pair_style granular now offers Hertz, JKR and DMT normal models, Mindlin tangential contacts, rolling and twisting resistance, all in the parent code that is actively maintained.

So the practical question for anyone starting a DEM project today is simple: is the specialised fork still worth using, or has the parent caught up? Both codes are available on cloudHPC, so we set up identical cases and let the numbers answer.

Results at a glance

CaseMetricReferenceLIGGGHTSLAMMPS
1. Hertz impactcontact time, 0.1โ€“10 m/sHertz (analytical)max error 0.013 %max error 0.014 %
1. Hertz impactrestitution, input e = 0.30.300.3000.440 (tsuji, 7 Feb 2024 build)
2. Silo dischargeflow rate W, D0 = 24 mmBeverloo, C = 0.580.2049 kg/s0.2034 kg/s
2. Silo dischargefitted Beverloo C / k0.58 / 1.5 (textbook)0.583 / 0.510.580 / 0.50
3. Column collapserunout, a โ‰ˆ 3Lube et al. 2004+3.5 %+3.4 %
3. Column collapserunout, a โ‰ˆ 1Lube et al. 2004โˆ’9.7 %โˆ’9.7 %
Scalingloop time, 818 k particles, 192 coresโ€”69.5 s86.9 s
SpeedLAMMPS / LIGGGHTS time ratioโ€”11.15โ€“1.25

How the runs were set up

  • Solvers: LIGGGHTS-PUBLIC 3.8.0 (pair_style gran model hertz tangential history) and LAMMPS with the GRANULAR package, the 7 Feb 2024 build available on cloudHPC at the time of testing (pair_style granular hertz/material โ€ฆ tangential mindlin โ€ฆ damping tsuji).
  • Same input data: one Python generator writes a single data file per case. LIGGGHTS (atom_style granular) and LAMMPS (atom_style sphere) read the same id type diameter density x y z lines, so both codes start from identical particle positions and diameters.
  • Material: soda-lime glass beads, ฯ = 2500 kg/mยณ, E = 10 MPa (softened, as usual in DEM), ฮฝ = 0.3, e = 0.9, ฮผ = 0.5, ยฑ5 % size polydispersity.
  • Walls: analytic cylinders in both codes. Floors and the silo base are frozen particles (more on why below).
  • Machines: cloudHPC hypercore instances (physical cores, one MPI process per core), regular (non-preemptible) instances so that timings are not disturbed.

Case 1 โ€” Hertz impact: contact time and restitution

Sketch of the head-on impact test

Nine pairs of 4 mm spheres collide head-on. Five pairs test the restitution (e = 0.3 โ†’ 1.0 at 1 m/s), four more test the Hertz contact time over two decades of impact velocity (0.1 โ†’ 10 m/s, elastic). The contact time is measured from the overlap history, the restitution from the velocities before and after contact.

Hertz impact results: restitution and contact time
Input eLIGGGHTS measured eLAMMPS (tsuji) measured eLAMMPS error
0.30.3000.440+47 %
0.50.5000.616+23 %
0.70.7000.778+11 %
0.90.9000.928+3 %
1.01.0001.0000 %

What we learned. The elastic part of the contact law is identical and exact in both codes: contact times match the Hertz solution within 0.014 % from 0.1 to 10 m/s. The damping is not. LIGGGHTS reproduces the requested restitution exactly. The LAMMPS tsuji model in the 7 Feb 2024 build returns a bouncier contact, and the error grows as e decreases.

The LAMMPS documentation explains why: a โˆš2 factor in the Tsuji damping (from Marshall, 2009) was missing in earlier versions and was added in a later release. We checked it with the same LAMMPS build (run locally, inputs and log in the package): feeding it an input that includes the โˆš2 factor brings the measured e back to 0.300 / 0.500 / 0.700 / 0.900. Newer LAMMPS versions also provide damping coeff_restitution, whose formula is the same one LIGGGHTS uses. Not available in the build we tested, so for cases 2 and 3 we used a calibrated tsuji input of 0.862, which gives the target e = 0.9 in LAMMPS.

Practical rule: whatever DEM code you use, run a two-particle impact test before trusting a restitution coefficient. It takes seconds on cloudHPC (our impact run cost โ‚ฌ0.01).

Case 2 โ€” Silo discharge vs Beverloo

Sketch of the flat-bottom silo

A flat-bottom cylindrical silo (ร˜ 120 mm) is filled with ~66 600 beads of 3 mm, settled for 0.7 s, then the orifice is opened (D0 = 18, 24, 30 mm). The mass flow rate W comes from a linear fit of discharged mass between 0.5 and 2.5 s. The reference is the Beverloo correlation, W = C ฯ_b โˆšg (D0 โˆ’ k d)^2.5, with ฯ_b = 1505 kg/mยณ from the measured settled packing (ฯ† = 0.60).

Silo discharge: flow rate vs orifice and discharged mass vs time
D0 [mm]W LIGGGHTS [kg/s]W LAMMPS [kg/s]DifferenceBeverloo textbook [kg/s]
180.09670.0971โˆ’0.4 %0.0579
240.20490.2034+0.7 %0.1452
300.37830.3785โˆ’0.1 %0.2839

What we learned. The two codes are indistinguishable: within 0.7 % at every orifice, with practically overlapping discharge curves. Both sit 33โ€“68 % above the textbook Beverloo curve, but the fit tells the story: C = 0.583 (LIGGGHTS) and 0.580 (LAMMPS), the textbook 0.58, and k โ‰ˆ 0.5 instead of 1.5. The difference is geometric: our orifice rim is made of spheres, so the opening widens by up to one bead diameter just above the base. That shifts the “empty annulus” term by about one d (1.5 โˆ’ 1 โ‰ˆ 0.5).

A modelling note. We first tried to build the perforated base with a LAMMPS region wall (a slab minus a cylinder). Region walls cannot represent the sharp edge of a hole: particles near the rim fell through or were ejected. LIGGGHTS can use an STL mesh plate instead. To keep the geometry identical in both codes we used the classic DEM approach: a rough base of frozen particles with the orifice cut out and a frozen plug that is deleted to open the silo.

Case 3 โ€” Granular column collapse vs experiments

Sketch of the axisymmetric column collapse

A column of 2 mm beads (initial radius r_i = 30 mm, aspect ratio a = h_i / r_i โ‰ˆ 1 and โ‰ˆ 3) settles inside a cylinder, which is then removed instantly. The final runout rโˆž is compared with the experimental scaling of Lube et al. (2004): rโˆž = r_i (1 + 1.24 a) for a < 1.7 and rโˆž = r_i (1 + 1.6 a^ยฝ) for a > 1.7. Runout is measured as the edge of the continuous deposit (annulus coverage below 50 %), so isolated rolling grains do not inflate it. A third run adds rolling resistance (ฮผ_r = 0.1): rolling_friction cdt in LIGGGHTS, rolling sds in LAMMPS.

Column collapse: runout vs Lube et al. 2004 and final profiles
Casea (LIGGGHTS / LAMMPS)rโˆž LIGGGHTS [mm]rโˆž LAMMPS [mm]Lube et al. [mm] (LIGGGHTS / LAMMPS a)Error LIGGGHTS / LAMMPS
a โ‰ˆ 11.04 / 1.04626268.6 / 68.7โˆ’9.7 % / โˆ’9.7 %
a โ‰ˆ 32.92 / 2.93116116112.0 / 112.2+3.5 % / +3.4 %
a โ‰ˆ 3, ฮผ_r = 0.13.02 / 3.01108112113.4 / 113.3โˆ’4.8 % / โˆ’1.1 %

What we learned. Without rolling resistance the two codes give the same runout and the same deposit profile. The tall column (a โ‰ˆ 3) is within 3.5 % of the experiment; the squat column (a โ‰ˆ 1) stops about 10 % short, a known sensitivity of short columns to friction and initial packing. With rolling resistance the codes diverge by two bins (4 mm), because cdt and sds are different models: same ฮผ_r, different torque law. If your application needs rolling resistance (non-spherical grains approximated by spheres), calibrate it in the code you will use.

Speed and scaling (818 k particles)

A dense lattice of 805 500 flowing beads (d = 1 mm) on a 12 684-bead base (818 339 particles including the orifice plug) discharges for 30 000 steps on hypercore instances from 8 to 192 cores. We report the solver loop time from each log (instance boot and result upload excluded).

Scaling: loop time and parallel efficiency, LIGGGHTS vs LAMMPS
CoresLIGGGHTS [s]LAMMPS [s]LAMMPS / LIGGGHTSEfficiency LIGGGHTS / LAMMPSSolver cost LIGGGHTS / LAMMPS
8640.8768.21.20100 % / 100 %โ‚ฌ0.31 / โ‚ฌ0.38
16526.5646.81.2361 % / 59 %โ‚ฌ0.51 / โ‚ฌ0.63
32339.5389.31.1547 % / 49 %โ‚ฌ0.66 / โ‚ฌ0.76
48242.2281.01.1644 % / 46 %โ‚ฌ0.71 / โ‚ฌ0.82
96119.4149.81.2545 % / 43 %โ‚ฌ0.70 / โ‚ฌ0.88
19269.586.91.2538 % / 37 %โ‚ฌ0.82 / โ‚ฌ1.02

Solver cost = loop time ร— cores ร— โ‚ฌ0.22 per vCPU-hour (regular hypercore).

What we learned.

  • LIGGGHTS is consistently 15โ€“25 % faster than LAMMPS on the same physics. The same gap appears in the silo (904 s vs 1124 s at D0 = 24 mm) and collapse runs (1067 s vs 1330 s at a โ‰ˆ 3).
  • Both codes scale the same way: 9.2ร— (LIGGGHTS) and 8.8ร— (LAMMPS) from 8 to 192 cores. The modest efficiency is geometry, not the codes. A cylindrical bed in a Cartesian box leaves many subdomains nearly empty (at 192 ranks, 80 of them held fewer than 1 200 of the 818 k particles), and the jump from 8 to 16 ranks puts a whole layer of subdomains below the floor. A balance command or a tighter box would help both codes equally.
  • In euros, the fastest solution is not the cheapest: 8 cores cost โ‚ฌ0.31 of solver time, 192 cores โ‚ฌ0.82, for a 9ร— shorter wait.

Run times and costs

SeriesRunsInstanceBilled cost
Sizing + impact316 vCPU hypercore / 2 vCPU highcoreโ‚ฌ0.78
Silo discharge (3 orifices ร— 2 codes)616 vCPU hypercore, regularโ‚ฌ13.03
Column collapse (3 cases ร— 2 codes)616 vCPU hypercore, regularโ‚ฌ13.52
Scaling (6 sizes ร— 2 codes)128โ€“192 vCPU hypercore, regularโ‚ฌ73.36
Total27โ‚ฌ100.69

The billed cost includes instance boot, result upload and shutdown, not only the solver. For the 192-core scaling runs the solver ran for about 70โ€“90 s but each instance was billed for about 26โ€“27 minutes. For short benchmark runs the overhead dominates, so run short jobs on few cores and keep large instances for long simulations.

How to run LIGGGHTS and LAMMPS DEM cases on cloudHPC

  1. LIGGGHTS: upload a folder with one input file whose name starts with in (e.g. in.hopper) plus meshes and data files referenced with relative paths. Other files must not start with in (rename inlet.stl to plate_inlet.stl).
  2. LAMMPS: input files named in.*, *.in, *.lmp or *.lammps. Several main inputs run one after the other; variables must be defined inside the input (no -var on the command line). With one input the log is log.lammps, with several it is log.<input>.lammps.
  3. Cores: both codes run one MPI process per physical core. Use hypercore or highcore; on hyperthreaded types only half the selected vCPU are used.
  4. Check the restitution in your LAMMPS build with a two-particle test before production (see Case 1).
  5. Size the box to the particles, not to the loose fill: empty subdomains made our silo runs about twice as slow as necessary.
  6. Download your results: cloudHPC storage is cleaned automatically after 60 days.

FAQ

Is LIGGGHTS still maintained?

The public branch, LIGGGHTS-PUBLIC, has had no release since 3.8.0 (November 2017). It still compiles and runs well, and in our tests it was the faster of the two codes.

Can LAMMPS replace LIGGGHTS for DEM?

For spherical particles with Hertz-Mindlin contacts, yes: in our tests the physics matched within 0.7 % (silo) and to the same 2 mm (collapse, without rolling resistance). Check the damping model in your LAMMPS version and expect runs to be 15โ€“25 % slower than LIGGGHTS.

Why does my LAMMPS granular simulation have the wrong coefficient of restitution?

In LAMMPS versions before the โˆš2 correction, damping tsuji under-damps the contact (e = 0.44 instead of 0.3 in our test). Use damping coeff_restitution in newer versions, or calibrate the tsuji input with a two-particle impact.

How many cores should I use for a DEM simulation?

In our test, parallel efficiency fell below 50 % once each core had fewer than about 25 000 particles (cylindrical geometry, default decomposition). If you pay per core-hour, fewer cores are cheaper; if the deadline matters, 96 cores cut the solver time by about 5ร— and 192 cores by about 9ร— compared with 8 cores.

Does LIGGGHTS support STL walls that LAMMPS does not?

Yes. LIGGGHTS can use triangulated STL meshes as walls (fix mesh/surface + fix wall/gran). LAMMPS granular walls are analytic primitives or regions, and region walls do not handle sharp edges such as an orifice rim. For complex equipment geometry this is still a strong reason to choose LIGGGHTS.

References

  1. C. Kloss, C. Goniva, A. Hager, S. Amberger, S. Pirker, Models, algorithms and validation for opensource DEM and CFDโ€“DEM, Progress in Computational Fluid Dynamics 12 (2012) 140โ€“152. doi:10.1504/PCFD.2012.047457
  2. A. P. Thompson et al., LAMMPS โ€” a flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales, Computer Physics Communications 271 (2022) 108171. doi:10.1016/j.cpc.2021.108171
  3. W. A. Beverloo, H. A. Leniger, J. van de Velde, The flow of granular solids through orifices, Chemical Engineering Science 15 (1961) 260โ€“269. doi:10.1016/0009-2509(61)85030-6
  4. G. Lube, H. E. Huppert, R. S. J. Sparks, M. A. Hallworth, Axisymmetric collapses of granular columns, Journal of Fluid Mechanics 508 (2004) 175โ€“199. doi:10.1017/S0022112004009036
  5. Y. Tsuji, T. Tanaka, T. Ishida, Lagrangian numerical simulation of plug flow of cohesionless particles in a horizontal pipe, Powder Technology 71 (1992) 239โ€“250. doi:10.1016/0032-5910(92)88030-L
  6. K. L. Johnson, Contact Mechanics, Cambridge University Press, 1985. doi:10.1017/CBO9781139171731
  7. LAMMPS documentation, pair_style granular (damping models, โˆš2 correction of the Tsuji model). docs.lammps.org/pair_granular.html
  8. CFDEMยฎproject, LIGGGHTSยฎ version history. cfdem.com/liggghtsr-version-history
  9. LIGGGHTS-PUBLIC source repository. github.com/CFDEMproject/LIGGGHTS-PUBLIC

CloudHPC is a HPC provider to run engineering simulations on the cloud. CloudHPC provides from 1 to 224 vCPUs for each process in several configuration of HPC infrastructure - both multi-thread and multi-core. Current software ranges includes several CAE, CFD, FEA, FEM software among which OpenFOAM, FDS, Blender and several others.

New users benefit of a FREE trial of 300 vCPU/Hours to be used on the platform in order to test the platform, all each features and verify if it is suitable for their needs


Categories: DEMscalability