Downloads · 30 days
0
wjenkinson/sph-particle-gnn
sph-particle-gnn is a other model from wjenkinson. Use it for the other task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A physics-informed Graph Neural Network that predicts per-particle displacements and velocities for 2D SPH (Smoothed Particle Hydrodynamics) fluid simulations.
Downloads · 30 days
0
Access
Public
Updated Feb 26, 2026
Repo size
812 KB
Likes
1
Public
Click a slice to open those files.
.pt812 KB · 96%
From the Hugging Face model README
A physics-informed Graph Neural Network that predicts per-particle displacements and velocities for 2D SPH (Smoothed Particle Hydrodynamics) fluid simulations.
| Property | Value |
|---|---|
| Architecture | Edge-conditioned GNN with residual message passing |
| Node features | [is_fluid, is_solid, is_wall, is_piston, vx, vy] (6 channels) |
| Edge features | [Δx, Δy, Δz, ‖r‖] (4 channels) — relative positions + distance |
| Output heads | Displacement (dx, dy, dz) + Velocity (vx, vy) |
| Particle types | 1 = fluid, 2 = solid, 3 = wall, 4 = piston |
| Neighbour radius | 0.003 (with periodic BC in x) |
| Domain | x ∈ [−0.1, 0.1], y ∈ [−0.08, 0.13] |
Autoregressive rollout of 2D particle-based fluid dynamics (e.g. extrusion, dam-break, jet impact).
Not intended for: 3D simulations, turbulent flows, or real-time safety-critical applications.
import torch
from model import SimpleGnnPredictor, load_checkpoint
model, hparams = load_checkpoint("model.pt")
# Build a torch_geometric Data object for your particle state
# (see inference.py for a complete example)
displacement, velocity = model(data)
next_pos = current_pos + displacement
See inference.py for a self-contained single-step and multi-step rollout example.
{
"model_state_dict": OrderedDict, # model weights
"model_hparams": {
"in_channels": 6,
"hidden_channels": int, # e.g. 64 or 128
"edge_channels": 4,
"num_layers": int, # e.g. 2 or 3
},
}
If you use this model, please cite the repository:
@software{sph_gnn_2025,
title = {SPH Particle Dynamics GNN},
url = {https://huggingface.co/YOUR_USERNAME/sph-particle-gnn},
year = {2025},
}