Electromagnetics
Permanent-magnet motor →
Rotating-machine electromagnetics (nonlinear P2 FEM, sliding band)
Rust · CPU/GPU · FEM/BEM · Surrogates
Sonium is a set of libraries to quickly optimise multi-physics problems. Portable and platform-agnostic across CPU and GPU, scalable, and self-contained — with classical FEM/BEM solvers and fast surrogates covering fluids, solids, thermics, acoustics, electromagnetics, and coupled problems.
Motors / Rooms / Speakers / Fans / Propellers / Structures / Reactors
From equations to engineering
Rotating machines, heat transfer, and free-surface flow. Explore solver output across the growing simulation collection.
Electromagnetics
Rotating-machine electromagnetics (nonlinear P2 FEM, sliding band)
Thermal
Heat conduction + natural convection + radiation (P1 FEM, backward Euler)
Fluid mechanics
Two-phase Navier-Stokes + Cahn-Hilliard with WALE LES, CSF surface tension, compressible air, subgrid bubble parcels (BDF2, adaptive dt)
Reusable PDE solvers and surrogates at the core, application simulators on top, and optimisation loops around them.
| Portable | Platform-agnostic across CPU and GPU (CUDA, Metal), scalable from laptop to cluster, and self-contained — pure Rust, no heavy external solver stack required. |
|---|---|
| Solvers | Classical FEM/BEM (Burton–Miller BEM, multi-physics FEM, iterative/direct/eigen solvers) or fast surrogates when optimisation needs thousands of evaluations. |
| Physics | Fluid and solid mechanics, thermics, acoustics, electromagnetics, and coupled problems — rooms, loudspeakers, fans, propellers, structures, motors, and jet loop reactors. |
| Validation | Checked against analytical solutions (Mie scattering, plane waves), cross-validated backends, and a standalone QA workspace with pass/fail gates. |
| Performance | Benchmarked against vendor libraries (Accelerate, OpenBLAS, SuperLU, cuSOLVER, cuSPARSE) with published methodology, platform details, and workload-specific results. |
The physics modules under sonium-fem, condensed from
the support matrix — every row below ships with tests, examples, or
QA coverage in the listed dimensions.
| Acoustics | Pressure (Helmholtz and wave equations, PML, ports, room acoustics), aeroacoustics (convected flow, linearised Euler/Navier–Stokes, Lighthill, FW-H), electroacoustics (transducers, Thiele–Small). |
|---|---|
| Fluid | Incompressible Navier–Stokes/Stokes, compressible DG Euler/NS, turbulence (Spalart–Allmaras, k–ω SST), porous, phase-field, reacting, shallow-water, lubrication, and general transport. |
| Solid | Linear and nonlinear elasticity, J2 plasticity (Johnson–Cook, crushable foam), shells, beams, plates, contact, fracture, composites, and eigenmodes. |
| Thermal | Conduction and transients, participating-media radiation, and thermoelectrics. |
| Electromagnetics | Maxwell H(curl), eddy currents, magnetostatics, electrostatics, and semiconductor transport. |
| Coupled | Fluid–structure interaction, thermoelasticity, piezoelectricity, electrothermal, MHD, electrochemistry, batteries, and 0D lumped circuits. |
| Shared | H1/H(div)/H(curl) elements, regional assembly, PML and impedance boundaries, BDF/explicit stepping, AMG/multigrid, adjoints with shape and topology optimisation. |
Full dimension-by-dimension matrix:
sonium-fem/PHYSICS.md
Three ways into the project, depending on what you want.
| Showcase | The range of what is possible — acoustic, fluid, and solid simulations with pictures, films, and detail pages. |
|---|---|
| Perf | Results — benchmark gaps vs vendor libraries and OpenCourant, with platforms and methodology. |
| QA | Accuracy checks — analytical references, cross-backend comparisons, and manifest-backed validation cases. |
Explore the stack by layer, from shared utilities to application simulators. Names link to source.
sonium-audio | Audio DSP: IIR/FIR filters, RIR analysis, analog coloration, differentiable DSP. |
|---|---|
sonium-fastmath | Vectorised sincos f32/f64 (NEON, AVX2, AVX-512, WASM SIMD, scalar fallback). |
sonium-wave | Analytical wave/Helmholtz solutions — the references QA validates against. |
sonium-xem | Shared BEM/FEM types: room geometry, galleries, JSON/XEM interchange. |
sonium-materials | Versioned material records with provenance, property curves, and checked adapters. |
sonium-topology | Machine topology discovery, CPU placement, and bandwidth calibration. |
sonium-compute | CPU/CUDA/Metal backend abstraction with strict device-memory quotas. |
sonium-fft | Batched complex/real FFT and STFT on top of sonium-compute. |
sonium-mesher | Mesh generation and partitioning for FEM/BEM. |
|---|---|
meshlang-* | MeshLang geometry compiler: AST, parser, and AST → Gmsh/Python backend. |
sonium-solvers | Facade over the family below; high-level solve, mixed-precision, differentiable APIs. |
|---|---|
-core | Core traits (ComplexField, LinearOperator, Preconditioner) and dense matrices. |
-sys | Runtime detection, NUMA topology, lane executor. |
-sparse | CSR/BSR/triplet formats and SpMV plans. |
-direct | Dense LU/Cholesky, sparse LU/Cholesky, multifrontal BLR. |
-iterative | GMRES family, CG, BiCGSTAB, IDR(s), MINRES, TFQMR. |
-preconditioners | Jacobi, ILU/ILUT/HILU, AMG, Schwarz, Chebyshev, saddle-point. |
-eigen | LOBPCG eigensolvers and adjoint sensitivities. |
-optimization | BFGS, L-BFGS(-B), Nelder-Mead, SQP/SLSQP, MMA, IPM, CMA-ES, BOBYQA. |
-nonlinear | Newton-Raphson variants, Anderson acceleration. |
-time-integration | Newmark-β, generalized-α, explicit schemes, adjoint checkpointing. |
sonium-fem | Generic multi-physics FEM: acoustics, elasticity, Maxwell, thermal, fluids, and more. |
|---|
sonium-bem | Burton–Miller BEM with FMM acceleration for acoustic scattering. |
|---|---|
sonium-coupling | Interior/exterior FEM/BEM coupling: monolithic traces, power ledgers. |
sonium-sim-motor | Permanent-magnet motor operating points, current-angle sweeps, MTPA, thermal and rotor-stress checks. |
|---|---|
sonium-sim-jlr | Single-phase jet loop reactor simulation with lattice Boltzmann flow, CPU/CUDA paths, and paper-reference comparisons. |
sonium-sim-room | Room measurement datagen for RoomEQ testing (FEM + low-frequency TBEM). |
sonium-sim-pcfan | PC-fan aeroacoustic optimisation workflow. |
sonium-sim-propellers | Shrouded, toroidal, and serrated propeller aeroacoustics. |
sonium-sim-speaker | Loudspeaker BEM simulation with CEA-2034 output and optimisation. |
sonium-sim-speaker-modeling | Electrovibroacoustic driver, enclosure, and port-flow models. |
sonium-sim-structural-mechanics | Bracket-first structural workflows on Sonium FEM: statics, modes, transients, harmonic response. |
sonium-surrogates | Checked POD-MLP surrogate runtime for fast optimisation loops. |
sonium-roomeq | RoomEQ configuration types and CEA-2034 spinorama scoring. |
sonium-roomsim | Room acoustic simulator for the browser (WebAssembly), in sonium-wasm. |
sonium-bench | Vendor-comparison and performance harnesses. |
|---|---|
sonium-demo-workers | Native compute workers behind the interactive demo labs. |
sonium-qa | Accuracy validation suite — see the QA section. |
sonium-py | Thin Python/PyO3 façade over the Rust acoustic solvers. |