Smoothed particle hydrodynamics
From Wikipedia, the free encyclopedia
Smoothed Particle Hydrodynamics (SPH) is a computational method used for simulating fluid flows. It has been used in many fields of research, including astrophysics, ballistics, vulcanology and tsunami. It is a Lagrangian method (where the co-ordinates move with the fluid), and the resolution of the method can easily be adjusted with respect to variables such as the density.
Contents |
[edit] Method
The smoothed particle hydrodynamics (SPH) method works by dividing the fluid into a set of discrete "fluid elements". These particles have a spatial distance (known as the "smoothing length", typically represented in equations by h), over which their properties are "smoothed" by a kernel function. This means that any physical quantity of any particle can be obtained by summing the relevant properties of all the particles which lie within two smoothing lengths. For example, the temperature of particle i depends on the temperatures of all the particles within a radial distance 2h of particle i.
The contributions of each particle to a property are weighted according to their distance from the particle of interest. Mathematically, this is governed by the kernel function (symbol W). Kernel functions commonly used include the Gaussian function and the cubic spline. The latter function is exactly zero for particles further away than two smoothing lengths (unlike the Gaussian, where there is a small contribution at any finite distance away). This has the advantage of saving computational effort by not including the relatively minor contributions from distant particles.
The equation for any quantity A of particle i, represented as Ai is given by the equation
where mj is the mass of particle j, Aj is the value of the quantity A for particle j, ρj is the density associated with particle j, and W is the kernel function mentioned above. For example, the density of particle i (ρi) can be expressed as:
where the summation over j includes all particles in the simulation.
Similarly, the spatial derivative of a quantity can be obtained by using integration by parts to shift the del ( ) operator from the physical quantity to the kernel function,
Although the size of the smoothing length can be fixed in both space and time, this does not take advantage of the full power of SPH. By assigning each particle its own smoothing length and allowing it to vary with time, the resolution of a simulation can be made to automatically adapt itself depending on local conditions. For example, in a very dense region where many particles are close together the smoothing length can be made relatively short, yielding high spatial resolution. Conversely, in low-density regions individual particles are far apart and the resolution is low, optimising the computation for the regions of interest. Combined with an equation of state and an integrator, SPH can simulate hydrodynamic flows efficiently. However, SPH tends to smear out shocks and contact discontinuities to a much greater extent than state-of-the-art grid-based schemes.
The Lagrangian-based adaptivity of SPH is analogous to the adaptivity present in grid-based adaptive mesh refinement codes, though in the latter case one can refine the mesh spacing according to any criterion selected by the user. Because it is Lagrangian in nature, SPH is limited to refining based on density alone.
Often in astrophysics, one wishes to model self-gravity in addition to pure hydrodynamics. The particle-based nature of SPH makes it ideal to combine with a particle-based gravity solver, for instance tree gravity, particle mesh, or particle-particle mesh.
[edit] Uses in Astrophysics
The adaptive resolution of smoothed particle hydrodynamics, combined with its ability to simulate phenomena covering many orders of magnitude, make it ideal for computations in theoretical astrophysics.
Simulations of galaxy formation, star formation, stellar collisions, supernovae and meteor impacts are some of the wide variety of astrophysical and cosmological uses of this method.
Generally speaking, SPH is used to model hydrodynamic flows, including possible effects of gravity. Incorporating other astrophysical processes which may be important, such as radiative transfer and magnetic fields is an active area of research in the astronomical community, and has had some limited success.
[edit] Uses in Fluid Simulation
Smoothed particle hydrodynamics is being increasingly used to model fluid motion as well. This is due to several benefits over traditional grid-based techniques. First, SPH guarantees conservation of mass without extra computation since the particles themselves represent mass. Second, SPH computes pressure from neighboring particles rather than by solving linear systems of equations. Finally, unlike grid-base technique which must track fluid boundaries, SPH creates a free surface for two-phase interacting fluids directly since the particles represent the denser fluid (usually water) and empty space represents the lighter fluid (usually air). For these reasons it is possible to simulate fluid motion using SPH in real time. However, both grid-based and SPH techniques still require the generation of renderable free surface geometry using a polygonization technique such as metaballs and marching cubes, point splatting, or "carpet" visualization.
One drawback over grid-based techniques is the need for large numbers of particles to produce simulations of equivalent resolution. Most particles will be used to fill water volumes which are never rendered. Accuracy can also be significantly higher with sophisticated grid-based techniques (such as particle level sets).
Muller et. al uses SPH to simulate water flowing into a glass at 5 fps. Kipfer and Westermann (Technical University at Munchen, Germany) use SPH to simulate rivers in real-time.
[edit] External links
[edit] Software
- sparticles 1.2 from the Swiss National Supercomputing Centre
- GADGET is a freely available code for cosmological N-body/SPH simulations