Discrete element method · Rust · CUDA · MCP-ready

Soil, grain by grain,
at GPU speed.

Granum simulates sand, soft clay and cement-admixed clay as particles. It runs laboratory tests and staged field models on one GPU, and an AI agent can build, run and report them for you.

Stage 1 · Generating grains

0particles in one field model on one GPU
0sand triaxial tests at once in 72 s
0particle-steps per second, RTX 5090
0engines: CUDA, wgpu (Metal/Vulkan/DX12), CPU

Built around the tests and models of geotechnical practice

A project is a laboratory test or a staged model built like a finite element model. The same project file runs in the desktop app, from a script, through the AI agent, or as a batch on a remote GPU.

Three engines, one algorithm

A double-precision CPU engine, a CUDA engine compiled at run time with NVRTC, and a wgpu engine for Metal, Vulkan and DirectX 12. Kahan-compensated positions keep single precision honest.

Laboratory tests built in

Drained and undrained triaxial, stress-path CIU, oedometer, unconfined compression, Brazilian, deposition, angle of repose and shallow footing, each with its summary values and quality checks.

Staged field models

Regions, rigid structures, DCM columns, mats and walls, placed, cured, loaded and excavated in phases, with settlement plates, inclinometers and piezometers recorded over time.

Pore pressure and consolidation

An excess pore pressure on a coarse grid, undrained or consolidating by Darcy flow, with an energy-consistent force on the grains and a time scale that runs months of consolidation in seconds.

AI agent and MCP server

A Model Context Protocol server with 33 tools lets an LLM agent create a project, run it, read the results and write the report, while you watch every step in the app.

Calibration at scale

Many specimens run at once on one card, so Latin hypercube and local searches can test every candidate on every test with repeated packings, and finish in hours instead of weeks.

MCP-ready

Built for agents, not adapted to them

The Model Context Protocol server is part of Granum itself. Start the program with --mcp and any MCP client sees its 33 tools, so there is no adaptor, plugin, Python wrapper or separate MCP server to install and keep in step with the solver.

No adaptor No separate MCP server stdio or HTTP Same project files as the app

Connect in one line

# register Granum's built-in MCP server
claude mcp add granum -- granum --mcp

The commands are granum and granum-server. The built-in chat assistant uses the same server, so a model an agent builds opens in the app and the other way round.

Step-by-step setup for Claude Code, Claude Desktop and Cursor, and the chat assistant →

33 tools, the whole workflow

agent ⇄ granum (MCP)

Replay of a live run: DeepSeek V4.1 Flash through the built-in TigrimOS chat set up, ran and reported the test in 25 s.

New particle

Compressible clay aggregates

In Granum a clay particle is a coarse-grained lump of saturated clay fabric. It shrinks as its own mean stress rises, along a normal compression line with unloading lines and creep, so the radius of every particle follows the consolidation of the clay around it.

Neighbouring aggregates touch through an adhesive, hysteretic contact whose stiffness grows with the aggregate's yield stress. In cement-admixed clay, bonds nucleate and grow during a simulated curing in proportion to the local cement-to-water ratio and the degree of hydration, and an aggregate that loses its bonds loses part of its yield stress.

  • One particle for soft, stiff and cement-admixed Bangkok clay
  • Water content and mix ratio set the start state, with no parameter fitted mix by mix
  • Shear strength and the critical state emerge from the assembly and are not prescribed
Illustration: under load the aggregates shrink along their compression line (right); on unloading they swell back along an unloading line.

Verified, then measured

Each benchmark is reported with its run time on the GPU that ran it, including the places where the model still falls short.

Chung and Ooi impact benchmarks: Granum against Hertz theory and Kratos
Impact benchmarks. Chung & Ooi (2011): Hertz's solutions within 0.1 %, oblique impacts within 0.2° of Kratos above 15°.
DEM8 penetration benchmark against eight codes
DEM8 penetration. Inside the band of eight open-source codes for 25,000–100,000 particles, in 2.3–12.7 min on an RTX 3090.
Consolidation of a granular layer against Terzaghi's solution
Consolidation. Settlement follows Terzaghi to within 0.05 of the drained value up to half consolidation, and to the end on a 2.5 mm grid.
Effective stress paths of soft Bangkok clay, measured and simulated
Soft Bangkok clay. Undrained strength within 16 % in five CIU tests; the pore pressure is 13–21 % low, which the paths show openly.
Cement-admixed Bangkok clay: stress-strain, pore pressure and stress paths
Cement-admixed clay. Peak at about 2 % strain and softening; 78 % of 27 CIU peaks within a factor of 1.5.
Unconfined strength of 88 cement-admixed clay tests
88 unconfined tests. Correlation 0.93 in logarithm; 7- and 14-day strengths predicted without being fitted.

Time per step on one GPU

Measured with the CUDA engine. Large models run at about 10⁸ to 2.4×10⁸ particle-steps per second.

Professional and Academic Research editions

Dynamic granular flow

Silos and hoppers, rotating drums, collapsing slopes, impacts and tamping, in real time with no numerical damping. Hopper and drum walls that turn, rigid weights that fall freely, sinks that weigh the outflow, and initial states read from a file. Each case is checked against the open-source codes of the DEM8 benchmark or a laboratory law. Not included in the Education edition.

Youwai, S. (2026). Granum, an agentic-AI GPU discrete element program: verification for dynamic granular flows. Zenodo. doi:10.5281/zenodo.23666311

DEM8 silo emptying. Flow rates of 100,000 grains within 0.7–1.9 % of the band of eight open-source codes (Dosta et al. 2024); large to small orifice 3.10, against 3.10 ± 0.06.
DEM8 rotating drum. Turning shell and end plates. Small grains in a quadrant follow seven codes within 246 grains rms, and the segregation waves peak within 0.04 s of theirs.
Hoppers and Beverloo. Discharge through orifices of 5–10 grain diameters follows Beverloo's law with C = 0.54 and k = 1.51; a 4-diameter orifice jams, as frictional grains do.
Column collapse. A sand calibrated on its angle of repose reproduces the runout of Lube et al. and the final height of Lajeunesse et al. for aspect ratios of 0.5 to 8.
Impact on sand. A steel ball penetrates 0.72–0.94 times Uehara et al.'s law, and stops in a time nearly independent of the impact speed, as Katsuragi and Durian found.
Dynamic compaction. A free 10 t tamper dropped from 5 to 15 m onto a 16 m loose fill reaches a depth of influence of 0.47–0.59 √(WH), within the field range of Mayne et al.

From the laboratory to the field

Staged DEM model of the Wang Noi compound DCM wall
Compound DCM wall, Wang Noi. 254,530 particles in a 1.5 m slice: stiff and soft clay, DCM columns, a stabilised mat, a precast wall, an embankment and a two-stage excavation, with 44,838 cement bonds grown during curing. About two hours on one RTX 5090.
Section through an embankment on DCM and stiffened DCM piles
Embankment on cement columns. About 785,000 particles, settlement since the end of curing.

Bangna–Bangpakong embankment

A unit cell of 49,503 particles consolidates for 470 field days at 0.24 ms per step, and a half-section of 502,797 particles records settlement, lateral movement and excess pore pressure at 58 monitors as it consolidates.

Sand fill from the literature

Eighteen drained triaxial tests ran at once on one card in 72 s to choose a fill whose friction angle is 30°.

Editions

The same solver in both, with dynamic granular flow reserved for the Professional and Academic Research licences. Choose by how you will use it.

For students and teachers

Education

Free

  • Desktop app with all built-in laboratory tests
  • CPU, CUDA and wgpu engines
  • Compressible clay aggregates and cement bonds
  • Staged models, pore pressure and consolidation
  • AI agent and built-in MCP server
Education limits Up to 50,000 particles per model Calculates on your own computer Reports and pictures carry an Education watermark No dynamic granular flow (silos, drums, impact, tamping)

For teaching and non-commercial academic research. Need larger models or dynamic analysis for your research? Ask for a free Academic Research licence.

For engineering practice

Professional

On request

  • Licence for commercial and consulting projects
  • Dynamic granular flow: silos, hoppers, drums, impact and tamping
  • Technical support from the developers
  • Help with calibration on your laboratory data
  • Batch runs on cloud GPUs
  • Training for your team

Tell us about your project and we will reply with a licence offer.

The paper

Granum: an agentic, GPU-accelerated discrete element program for soil

Sompote Youwai, King Mongkut's University of Technology Thonburi, 2026. The design of the program and its three engines, the Chung and Ooi impact benchmarks (within 0.1 % of Hertz), the DEM8 penetration benchmark against eight open-source codes, and Granum in geotechnical use: triaxial tests 16 times faster than 32 CPU threads, an eleven-parameter cemented-clay calibration in hours, and a 785,000-particle embankment in 2.5 hours.

Cite Granum
@misc{youwai2026granum,
  author    = {Youwai, Sompote},
  title     = {Granum: an agentic, GPU-accelerated
               discrete element program for soil},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.23652515},
  url       = {https://zenodo.org/records/23652515}
}

Contact us

For the Professional edition, collaboration, or questions about the models, write to us. The form opens your email program with the message filled in.

AI Research Group
Department of Civil Engineering
King Mongkut's University of Technology Thonburi (KMUTT)
Bangkok, Thailand
tellusfem@gmail.com

Granum Education edition

Download

Licence · All releases and checksums · Quick start