2
$\begingroup$

I am trying to implement SPH using the directions shown in this paper.

The density needs to be updated using the formula

$$ \rho(\mathbf{x}_i)=\sum_j m_jW_\text{default}(\mathbf{x}_i-\mathbf{x}_j,h) $$

The smoothing kernel is $$ W_\text{default}(\mathbf{r},h)=\frac{315}{64\pi h^9}\cases{(h^2-||\mathbf{r}||^2)^3,\quad 0\leq\mathbf{r}\leq h\\0,\quad\quad\quad\quad\quad ||\mathbf{r}||>h} $$

If there are no particles within the smoothing length($h$), won't the density of a particle become zero based on this formula?

$\endgroup$
2
$\begingroup$

Yes. You need to choose the radius $h$ large enough that for each particle, there is always a significant number of other particles within the first particle's radius.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ That would make the amount of particles I need for the simulation really high. How do I handle rogue particles in case I'm simulating the particles in a huge space? I'll have to check if the density is zero and cancel all calculations for that particle? $\endgroup$ – punitjajodia Jan 30 '15 at 12:59
  • 1
    $\begingroup$ If you don't want to increase the number of particles, you have to choose $h$ large enough. $\endgroup$ – Wolfgang Bangerth Jan 31 '15 at 3:39
0
$\begingroup$

Actually, the density never becomes zero because of self-contribution (i=j). However, you need neighboring particles, unless the sampling of mass density is poor. The optimal number of neighbors is around 20 in 2D and 50 in 3D.

You can also check the discussion about the calculation of the desired smoothing length here.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Yes, density will become zero if there is no particle. That's why it is very important in SPH to have particles well distributed. Also must select smoothing length large enough, such that you will always end up with a minimum number of particles in the kernel and use numerical techniques to keep particles well distributed.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.