Fluid model
ViscousEulerSPH
Euler equations with viscosity discretized with smoothed particle hydrodynamics (SPH).
Overview
pressure and viscosity contributions. It is intended for meshfree fluid experiments rather than FEEC-based field simulations.
Use cases
- SPH verification with pressure and viscosity
- meshfree compressible-fluid experiments
- testing particle-based viscosity and pressure pushers
Governing equations
PDEs solved by model:
Continuity:
Momentum:
Entropy:
where denotes the entropy per unit mass and is the viscous stress tensor.
The viscous stress tensor for a Newtonian fluid is given by:
where is the dynamic (shear) viscosity and is the identity tensor.
The internal energy per unit mass can be defined in two ways:
Normalization
Discretization
PushEtaPushVxB(ifwith_B0is True)PushVinSPHpressure(ifwith_pis True)PushVinViscousPotential(ifwith_viscosityis True)
Diagnostics
The following scalars are tracked during simulation:
- SPH kinetic energy:
en_kin
Examples

Dam break
A dense fluid column collapses under gravity in a closed box. Smoothed particle hydrodynamics follows the collapse, the wave across the box and the settling of the fluid, using markers alone. The column starts at rest with in the unit square, under gravity .

Gas expansion into vacuum
An isothermal gas initially occupies the left part of a one-dimensional box and expands into the vacuum. Smoothed particle hydrodynamics follows the rarefaction wave and the gas streaming into the vacuum, and the result is compared with the exact self-similar solution. The initial state is with isothermal sound speed .

SPH velocity diffusion
A sinusoidal velocity field diffuses on a periodic interval. The binned SPH current is compared with the exact viscous decay of the mode. The initial state is on , with viscosity . The reference decay rate is .