Pravash
Pravash (Sanskrit: प्रवास — journey, flow) — fluid dynamics simulation for AGNOS
Particle-based and grid-based fluid simulation. SPH for real-time effects, Euler/Navier-Stokes for accurate simulation, shallow water for surface waves, multi-phase for immiscible fluids, viscoelastic for honey/lava, heat transfer and combustion for fire effects. Built on hisab for math foundations.
Non-linear SWE, Manning friction, wetting/drying, wave breaking, Boussinesq dispersion, terrain-following, multi-phase SPH, phase-field interface tracking, Oldroyd-B viscoelasticity, heat conduction, combustion, Rayon parallelism, GPU-agnostic compute interface — zero unsafe, 230+ tests.
Installation
[]
= "0.24"
Default features: sph, grid, shallow.
Optional: buoyancy, vortex, coupling, compute, parallel, ai, logging.
MSRV: 1.89 (Rust edition 2024).
Features
| Feature | Default | Description |
|---|---|---|
sph |
yes | Smoothed Particle Hydrodynamics — particle-based fluids |
grid |
yes | Euler/Navier-Stokes grid-based solver |
shallow |
yes | Non-linear shallow water equations — 2D surface waves |
buoyancy |
no | Buoyancy, drag, Reynolds number, flow regime |
vortex |
no | Vorticity, Lamb-Oseen/Rankine vortices, enstrophy, Kolmogorov scale |
coupling |
no | Fluid-body interaction, FLIP/PIC hybrid, level set, added mass |
compute |
no | GPU-agnostic ComputeBackend trait, packed f32 buffers |
parallel |
no | Rayon parallelism for SPH and grid operations |
ai |
no | Daimon/hoosh integration (network deps) |
logging |
no | Structured logging + chrome://tracing profiling via PRAVASH_LOG |
full |
-- | Enables all features |
Quick Start
use ;
use ;
let mut particles = create_particle_block;
let config = water_2d;
let mut solver = new;
for _ in 0..100
println!;
Modules
| Module | Description |
|---|---|
sph |
SPH solver with spatial hash acceleration, PCISPH, surface tension, adaptive timestep, multi-phase (per-phase EOS/viscosity/interface tension), viscoelastic (Oldroyd-B), heat conduction, combustion |
grid |
Navier-Stokes: semi-Lagrangian + MacCormack advection, diffusion, DST + GS pressure projection, vorticity confinement, buoyancy, periodic boundaries. Rayon-parallelized advection and projection |
shallow |
Non-linear SWE with convective terms, flux-form continuity, Manning bed friction, wetting/drying, wave breaking detection + dissipation, Boussinesq dispersion, well-balanced terrain-following |
phase_field |
Allen-Cahn phase-field interface tracking with advection and double-well relaxation |
buoyancy |
Archimedes buoyancy, drag force, terminal velocity, Reynolds number, flow regime classification |
vortex |
Vorticity, Lamb-Oseen/Rankine vortex models, enstrophy, Kolmogorov microscale |
coupling |
RigidBody interaction (sphere/box SDF), FLIP/PIC hybrid, particle-level set, added mass, field drag |
compute |
GPU-agnostic ComputeBackend trait, PackedParticles f32 buffer packing, kernel parameter structs |
common |
FluidParticle (with phase, temperature, fuel, conformation tensor), FluidMaterial (water/oil/honey/air/lava), FluidConfig, ParticleSoa (SOA layout), ParticleArena (memory pool) |
Examples
| Example | Features | Description |
|---|---|---|
basic_fluid |
sph |
SPH dam break with SphSolver, kinetic energy tracking |
shallow_water |
shallow |
Shallow water splash with Manning friction |
multiphase |
sph |
Water-oil two-phase simulation with interface tension |
Run an example:
Architecture
pravash (this crate)
+-- hisab (math: vectors, spatial hash, FFT/DST, PDE solvers)
Consumer Crates
| Crate | Usage |
|---|---|
| kiran | Water, smoke, fire effects |
| joshua | Fluid simulation |
| impetus | Fluid-body interaction |
Documentation
- Migration Guide — breaking changes from 0.24.x
- Roadmap — upcoming features
- Contributing — workflow, code style, testing requirements
- Security Policy — reporting, supported versions
Building
License
GPL-3.0 — see LICENSE.