Taking the derivative of the SPH density estimator

156 Views Asked by At

I am taking a course in Smooth Particle Hydrodynamics but I am struggling with some of the steps involved in deriving the method. I have written out the steps in my notebook I hope that is ok. I have numbered the steps and asked questions about each step. If someone is able to explain I would greatly appreciate it, Thank you.

The derivation and more details are done here on page 16 https://arxiv.org/pdf/1007.1245.pdf Sorry if this isnt a good post, I just really need some help

enter image description here

1

There are 1 best solutions below

2
On BEST ANSWER
  1. From (3.39) you have $\rho_i=\sum_km_kW_{ik}$, so then $$ \frac{\partial\rho_i}{\partial\mathbf r_j}=\sum_km_k\frac{\partial W_{ik}}{\partial\mathbf r_j} $$ since $m_k$ is constant.

  2. Because it leads to a useful result. Actually there are two reasons why it's useful. Firstly, SPH uses the derivative of the kernel function to interpolate the derivative of the function. The kernel function is a function of one variable ($r$, the distance between the two points) so to differentiate the kernel function in some direction at a point using the chain rule you can always use the 1D derivative of the kernel function and then multiply by the derivative of the distance between the two points. This means you don't have to differentiate the kernel in lots of different ways all the time.

  3. $\mathbf r_{ik}=\mathbf r_{i}-\mathbf r_k$, and $r_{ik}$ is the length of $\mathbf r_{ik}$. So $$ \frac{\partial r_{ik}}{\partial \mathbf r_j} = \frac{1}{r_{ik}}(\mathbf r_{i}-\mathbf r_{k})\frac{\partial}{\partial \mathbf r_j}(\mathbf r_i-\mathbf r_k)=(\delta_{ij}-\delta_{kj})\hat{\mathbf r}_{ik}.$$ Since $\frac{\partial\mathbf r_i}{\partial\mathbf r_j}$ is $0$ if $i\neq j$ and $1$ if $i=j$, we have $\frac{\partial\mathbf r_i}{\partial\mathbf r_j}=\delta_{ij}$.

  4. The derivation is strange here, if it was the case that $\partial/\partial\mathbf r_j\equiv\nabla_j$ then $$\frac{\partial\rho_i}{\partial\mathbf r_j}=\sum_km_k\frac{\partial W_{ik}}{\partial\mathbf r_j}=\sum_km_k\nabla_jW_{ik}, $$ so it's not clear to me.

There is another way to obtain (3.61) though which is simpler. We are looking for the SPH interpolant of the Euler equation (ignoring body forces, which can be applied to each computational particle individually), $$ \frac{\mathrm d\mathbf v_i}{\mathrm dt} = -\frac{\nabla p_i}{\rho_i}. $$ First rewrite $$\frac{\nabla p_i}{\rho_i}=\nabla\left(\frac{p_i}{\rho_i}\right)+\frac{p_i\nabla\rho_i}{\rho_i^2}$$ and then find the SPH interpolant, using the standard SPH approximation of a derivative, $$ \nabla F_i=\sum_j\frac{m_j}{\rho_j}F_j\nabla_iW_{ij}. $$ We get $$\frac{\mathrm d\mathbf v_i}{\mathrm dt}=-\sum_j\frac{m_j}{\rho_j}\frac{p_j}{\rho_j}\nabla_iW_{ij}-\frac{p_i}{\rho_i^2}\sum_j\frac{m_j}{\rho_j}\rho_j\nabla_iW_{ij}=-\sum_jm_j\left(\frac{p_j}{\rho_j^2}+\frac{p_i}{\rho_i^2}\right)\nabla_iW_{ij}, $$ exactly as (3.61) (with $I$ and $j$ swapped).