next up previous contents
Next: Evolving Quantities in Time Up: SPH: Smoothed Particle Hydrodynamics Previous: Parallelization of the Hydro   Contents


Derivatives in SPH

For other hydrodynamic quantities $q$, defined for every particle $q_i$, can be calculated at arbitrary points in space by a corresponding equation
\begin{displaymath}
q_i=\sum_j m_j \frac{q_j}{\rho_j} W_{ij},
\end{displaymath} (5)

using the gather-scatter method as described above. We find that essentially any extensive quantity can be calculated as a density wieghted sum. For intensive quantities, simply multiply by the density in the SPH sum, and then divide by the density. For instance, the SPH averaged velocity at a particle position can be given as
\begin{displaymath}
v_i=\frac{(\rho v)_i}{\rho_i}=\frac{1}{\rho_i}\sum_j m_j v_j W_{ij}.
\end{displaymath} (6)

Perhaps more importantly, the SPH method allows us to calculate not just hydro quantities, but their spatial derivatives as well, such as in the Newtonian force law $F_{hydro}=\nabla P/\rho$. We define the derivative of a hydro quantity ``$q$'' by using the chain rule, finding that

\begin{displaymath}
\nabla q_i=\sum_j m_j
\frac{q_j}{\rho_j}\nabla W_{ij},
\end{displaymath} (7)

where all terms in the expression, most importantly the derivative, are well-defined. As an example of this approach in action, the standard Newtonian fluid acceleration is calculated by the SPH code as
$\displaystyle \vec{a}_{hydro}=\frac{1}{\rho}\nabla P$ $\textstyle =$ $\displaystyle \nabla (P/\rho) + \frac{P}{\rho^2}\nabla \rho$  
  $\textstyle =$ $\displaystyle \sum_j m_j\frac{P_j}{\rho_j^2}\nabla
W_{ij}+\frac{P_i}{\rho_i^2}\sum_j m_j\nabla W_{ij}$  
  $\textstyle =$ $\displaystyle \sum_j
m_j\left(\frac{P_j}{\rho_j^2}+\frac{P_i}{\rho_i^2}\right)\nabla W_{ij}.$ (8)

The code currently assumes a polytropic form for the equation of state, i.e. $P_i=A_i \rho_i^\Gamma$, where $\Gamma$ is a constant, and $A_i$, our entropic variable, is constant unless an artificial viscosity prescription is used. For more on this, see Sec. 3.5.


next up previous contents
Next: Evolving Quantities in Time Up: SPH: Smoothed Particle Hydrodynamics Previous: Parallelization of the Hydro   Contents
Joshua Faber 2003-06-28