Theory
SPH Approximation
The key idea of the smoothed particle hydrodynamics (SPH) method is to approximate any field \(f(x)\) using a smoothing kernel \(W(r)\),
where \(h\) is the smoothing length.
Replacing the integral with the sum over all particles, the SPH interpolant is discretized as,
Similarly, the gradient can be approximated as,
The cubic B-spline M4 function has been widely used as the smoothing kernel in the astrophsical SPH community, which is also adopted in the code,
where \(r=\left \| x_i-x_j \right \| /h\), and \(\alpha_d=3/(2\pi h^3)\) in the 3-dimensional case.
Note
Suppose a simple cubic distribution with mean particle spacing of \(\Delta x\), the initial smoothing length is taken as \(h=1.2\Delta x\) in the code. The particle radius is thus \(2.4\Delta x\) for the M4 kernel here. Therefore, each SPH particle has ~57 neighbor particles.
Lagrange Equations
The Lagrange equations describe the conservation of mass, momentum, and energy,
where \(\sigma=-pI+s\) is the stress tensor, and \(\dot{\epsilon}=\frac{1}{2} ((\nabla v)^\top + \nabla v)\) is the strain rate.
The equations are then discretized into SPH formulations,
where \(v_{ij}=v_i-v_j\). \(\Pi_{ij}\) and \(\zeta_{ij}\) are artificial terms.
Artificial Terms
Artificial Viscosity
The standard artificial viscosity \(\Pi_{ij}\) is introduced to handle shocks in SPH, such as particle interpenetration and unphysical oscillations in the pressure field after the shock wave passes,
where
Artificial Stress
The artificial stress \(\zeta_{ij}\) is implemented to suppress the possible tensile instability that leads to numerical clumping of particles,
where \(\Delta x\) is the mean particle spacing, and the tensor \(\zeta_i\) represents a local measure of tension in principal axes of the stress \(\sigma_i\),
with the eigendecomposition of \(\sigma_i\) as \(U\mathrm{diag}(\sigma_i^A,\sigma_i^B,\sigma_i^C)U^\top\).
Correction Tensor
The correction tensor \(C_i\) is used to increase the consistency of velocity gradient to the first order, in order to conserve the angular momentum of the particle system. The corrected velocity gradient is then,
where the correction tensor is given by,
XSPH
The XSPH term is optional to apply an averaged speed smoothed by the velocity of neighbor particles. The equation of motion is then modified as,
Nothe that the linear and angular momentum are still conserved exactly when using the XSPH correction.
Strength Model
The elastic perfectly plastic mdoel is used the update the deviatoric stress tensor \(s\). The Hooke’s law describes the linear elastic behavior of solid materials as,
where \(G\) is the shear modulus, \(\dot{R}=\frac{1}{2} ((\nabla v)^\top - \nabla v)\) is the rotation rate. The yielding criterion is then introduced to model plasticity, with the deviatoric stress limited by,
Von Mises Yield Criterion
In the simple Von Mises yield criterion, the factor \(f\) is computed as
where \(Y_0\) is the material yield strengh.
Drucker-Prager Yield Criterion
A more general pressure-dependent yield criterion is to use the Drucker-Prager model. And the yield strength is given by,
where \(Y_0\) is the cohesion at zero pressure, \(Y_m\) is the strength limit, and \(\mu\) is the coefficient of internal friction. The subscripts i and d here denote intact and damaged respectively. For partially damaged material, the yield strength is interpolated according to the scalar damage \(D\),
Damage and Fragmentation
The Grady-Kipp scalar damage \(D\in[0,1]\) is introduced to represent the degree of fragmentation, with \(D=0\) being intact, and \(D=1\) being fully fractured. The failure of solid material leads to a reduction of its strength in tension and shear deformation. The pressure and deviatoric stress are then modified by,
The Weibull distribution is commonly used to describe the number of flaws per unit volume with activation threshold lower than \(\epsilon\), following \(n(\epsilon)=k\epsilon^m\). With the particle strain measured as a scalar,
where \(E\) is the elastic modulus, the damage growth is obtained by,
where \(n_{\mathrm{act}}\) is the number of active flaws inside the particle, \(c_g=0.4c_s\) is the speed of crack growth, and \(R_i\) is the particle radius.
The fracture area \(A_i\) is integrated until fully damaged,
The most frequent \(L_m\) and the largest \(L_\max\) of the fragment size distribution are calculated as
The cumulative number of fragments larger than a given size \(L\) inside a particle is then given by,
Equation of State
Tillotson EOS
The commonly used Tillotson equation is designed to duplicate the linear shock-particle velocity relation at low pressures and to extrapolate to the Thomas-Fermi limit at high pressures.
For compressed states, or cold expanded states with the specific energy less than the energy of incipient vaporization \(e<e_{iv}\), the pressure \(p_c\) is obtained by,
where \(a\), \(b\), \(A\), \(B\), \(e_0\) are Tillotson parameters, \(\eta=\rho/\rho_0\), \(\mu=\eta-1\), and \(\nu=1/\eta-1\).
For hot expanded states with \(e>e_{cv}\) exceeding the complete vaporization energy, the pressure \(p_e\) is,
The pressure in a partial vaporization regime is given by the linear interpolation of both phases as,
P-alpha Porosity
The pressure in porous materials is given by the pressure in the solid material \(p_s\) divided by the distension \(\alpha\),
In the p-alpha model, the distension \(\alpha\) is a function of the pressure,
where \(p_e\) and \(p_s\) represent the pressure constants at elastic and solid states.
K-d Tree
The binary k-d tree is implemented to search for neighbors within the particle radius for SPH interpolation. Starting from the root node, each tree node includes one SPH particle and two child nodes that are spilted by a hyperplane. Note that the computational complexity is \(\mathcal{O}(n\log n)\) both for constructing a balanced k-d tree and for finding all pairs of neighbor particles using the tree.
When considering self-gravity, the monopole and quadpole terms are also calculated for the same tree nodes. The Barnes-Hut algorithm is then used to approximate the gravitational forces between all particles, with the criterion given by,
where \(l_n\) is the edge length of the node, \(r\) is the distance between a SPH particle and the node, and \(\theta\) is the open angle. In that case, the node’s gravitational force acting on the SPH particle can be approximated as a point mass at the node’s center of mass.
Gravitational Softening
The gravitational softening kernel \(\phi(r,h)\) is necessary to correct the inter-particle gravitational forces, and should match the above M4 kernel. The radial derivative \(\phi'(r,h)\) is given by,
Time Integration
The second-order leapfrog integration regime is implemented in the code,
where the timestep \(\Delta t\) is determined by the Courant-Friedrichs-Lewy (CFL) condition,