Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
55 views33 pages

SPH - J.J. Monaghan PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views33 pages

SPH - J.J. Monaghan PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Annual Reviews

www.annualreviews.org/aronline

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

Annu. Rev. Astron. Astrophys. 1992.30:543-74


Copyright 1992 by Annual Reviews h~c. All rights reserved

SMOOTHED PARTICLE
HYDRODYNAMICS
J.

J.

Monaghan

Department of Mathematics, MonashUniversity, Clayton, Victoria 3168,


Australia
KEYWORDS:
computational-fluid dynamics, numerical analysis
1.

INTRODUCTION

Smoothed particle hydrodynamics (SPH) was invented to simulate


nonaxisymmetric phenomena in astrophysics
(Lucy 1977, Gingold
& Monaghan1977). Wewanted a method that was easy to work with and
could give reasonable accuracy. The SPHmethodsatisfied these requirements. As a bonus we found the SPH was rugged, gave sensible answers
in difficult situations, and could be extended to complicatedphysics without muchtrouble.
The SPHmethodis a particle method. Unlike the particle in cell method
(PIC) (Harlow 1957, 1974, 1988), SPHdoes not need a grid to calculate
spatial derivatives. Instead, they are found by analytical differentiation of
interpolation formulae. The equations of momentumand energy become
sets of ordinary differential equations which are easy to understand in
mechanical and thermodynamicalterms. For example, the pressure gradient becomesa force betweenpairs of particles. The astrophysicist can then
use intuition in a waywhichis difficult with the original partial differential
equations. This intuition, coupled with detailed analysis, has allowed SPH
to be extended to a wide variety of astrophysical problems. Althoughvery
accurate finite-difference methodsexist--and these are better than SPHfor
some problems--they cannot handle complex physics in three dimensions
with the same ease.
Various aspects of SPHhave been reviewed by Monaghan(1985, 1988a)
and Benz (1988, 1989).
543
0066-4146/92/0915q3543 $02.00

Annual Reviews
www.annualreviews.org/aronline
544

MONAGHAN

2.

FUNDAMENTALS

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

At the heart of SPHis an interpolation methodwhich allows any function


to be expressed in terms of its values at a set of disordered points--the
particles. The ideas are given in Lucy (1977), Gingold &Monaghan(1977,
1982), and Monaghan(1985).
The integral interpolant of any function A(r) is defined

A,(r)
fA
(r) W(rr, h )dr

2.1

where the integration is over the entire space, and Wis an interpolating
kernel which has the two properties
m(r-- r,

h) dr =

2.2

and
lim W(r-r,h) = ~(r r),

h~0

2.3

wherethe limit is to be interpreted as the limit of the correspondingintegral


interpolants. It is clear that kernel interpolation is related to the subject
of singular integrals (Natanson 1960).
For numerical work the integral interpolant is approximated by a summation interpolant
As(r) =--},mbAh W(r-rb, h),

2.4

where the summationindex b denotes a particle label, and the summation


is over all the particles. Particle b has massmb,position rb, density p~, and
velocity vh. The value of any quantity A at rb is denoted by A~.
The essential point is that we can construct a differentiable interpolant
of a function from its values at the particles (interpolation points) by using
a kernel which is differentiable. Derivatives of this interpolant can be
obtained by ordinary differentiation; there is no need to use finite differences and no need for a grid. For example, if we want VA,we can use
VA(r) = Z m~~ V W(r- r~,
though to obtain higher accuracy we would obtain the interpolant
writing

2.5
by

Annual Reviews
www.annualreviews.org/aronline

SMOOTHED PARTICLE

HYDRODYNAMICS

545

pVA = V(pA) - A Vp,

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

as shownin the examplesbelow and, in the particular case of the pressure


gradient, we would use a symmetrized form (e.g. Equation 3.3).
The original calculations of Gingold & Monaghan(1977) used a Gaussian kernel. In one dimension
1
W(x, h) = ~ e- (x 2/~,

2.6

which is the usual example of a sequence which mimics a delta function


in the limit h -~ 0. A kernel based on splines (Monaghan& Lattanzio 1986)
has proven computationallyefficient (other kernels will be discussed later).
However,if you want to find a physical interpretation of an SPHequation,
it is alwaysbest to assumethe kernel is a Gaussian. This is the first golden
rule of SPH.
The error in approximating Equation 2.1 by Equation 2.4 depends on
the disorder of the particles (Monaghan1982) and is normally O(h2) or
better. It is important to realize that although the summationsare formally
over all the particles, only a small numberactually contribute because W
can be chosenso that it falls off rapidly for Ir-r/,[ _> h.
For the rest of this review we will not distinguish betweena summation
interpolant and the actual function since this will be clear from the context.
The density is estimated everywhere by
p(r) = ~ mbW(r-- rb,

2.7

Another example is
V"v = ~ rnbvb VW(r-rt,, h),

2.8

but in this case it is better to rememberthe second golden rule of SPH


which is to rewrite formulae with the density placed inside operators. For
the previous case we write
V "v = [V "(pv)-v" Vp]/p,

2.9

so that the divergence of the velocity at particle a can be found from


p,(V" v),, = ~ (vb-v~)- VaW,

2.10

where the notation V, Wubdenotes the gradient of W(ra-rb, h) taken with


respect to the coordinates of particle a. If the kernel is a Gaussian, the
contribution from particle b to the divergence of the velocity at particle a
is given by

Annual Reviews
www.annualreviews.org/aronline
546 o MONAGHAN
2,
2mo(v,, vb)" (r,-rb)W,,b/h

2.11

which showsth~it the contribution is positive if the particles are moving


awayfrom each other, as expected. The vorticity of particle a is estimated
in the same way by
pa(V v). = ~ mbva~ Va W.b.

2.12

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

Taking the kernel to be a Gaussian we find that the contribution of


particle b to the vorticity of particle a is proportional to the relative angular
momentum
per unit mass of the two particles.
3.

SIMPLE

3.1

The

EQUATIONS

Momentum

OF

MOTION

Equation

Using the ideas outlined in the previous section, the equations of motion
can be obtained easily. The pressure gradient could be estimated by using
p~VP~= ~ mb(P~--P,,)V, W,~,

3.1

and this has the advantage that the force vanishes exactly whenthe pressure
is constant. However,it has the disadvantage that the linear and angular
momentum
are not conserved exactly (an isolatcd pai~r ~ of particles with
different pressures wouldbootstrap themselvegto infinity), and it is difficult
to construct a consistent energy equation.
In this case it is better to symmetrize the pressure gradient term by
rewriting VP/p according to
3.2
The momentumequation for particle

dv,,_d, -- ~b mb ~P~+~ V,W~,

a then becomes
3.3

where here and elsewhere d/dt denotes a derivative following the motion.
The momentumequation in the form of Equation 3.3 was first derived
from using a discrete form of the action principle for an adiabatic fluid.
The contribution to the force on particle a from particle b when the
kernel is a Gaussian is
2mom~(P~ Pa~ ra

- wob,

3.4

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED

PARTICLE

HYDRODYNAMICS

547

which shows that the pressure gradient, when translated into an SPH
equation, produces a symmetric central force between pairs of particles.
As a result linear and angular momentaare conserved.
Infinitely many symmetric forms of the SPHmomentumequations can
be constructed. For example, noting

( ) _l vr_,

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

VP

P V 1

the SPH momentumequation

3.5

becomes

dV,d~
= -- ~ rn~
+
V~ W~,
( P b~ _ ~b ~P ~

3.6

which is symmetric for any value of o-. Another symmetric combination is


obtained by noting
VP= 2x/PVx/~.

3.7

Mypreference is for the form of Equation 3.2 since it arises naturally from
an action principle.
The effect of a constant external pressure Pext can be approximated by
replacing P everywhereby P--Pext (Lattanzio et al 1985a).
3.2

The Continuity

Equation

The continuity equation can be replaced either by the interpolant


p. = ~ m~W~b,

3.8

or by
dp~= ~ mbv,,bV,W,,~,
dt ~

3.9

where the notation v,~ = v~-v~, has been used. Almostall SPHcalculations
use Equation 3.8, but there are definite advantages in using Equation 3.9.
In particular, if Equation 3.8 had been used in SPHcalculations of the
motion of water (Monaghan1991), the density would have dropped near
the edge of the fluid (this is SPHs valiant attempt to model an edge)
and the resulting pressure would have caused the edge to oscillate. With
Equation3.9 the initial density of each particle can be set, and it will only
vary when particles moverelative to each other. Tests on shocks show
that Equation 3.8 has no advantages over Equation 3.9. There is also a
computational a~tvantage in using Equation 3.9 since the rates of change
of all physical variables can be computedin one subroutine, or one pass

Annual Reviews
www.annualreviews.org/aronline
548

MONAGHAN

over a tree. The disadvantage is that exact conservation of mass is not


retained.
In some accretion problems it can be useful to treat accretion onto a
body as loss of mass to a sink (Anzer et al 1987). The continuity equation
then becomes

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

dt

- pV" v-f (r),

3.10

wheref(r) is, for example, a continuous function which is zero outside


sphere surrounding the origin. If we assume h is constant in space and
time (the general case is treated later) we can write the continuity equation
as

dt 2 mbv~b" V W,b-- ~ mb ~ W,b,

3.1 1

where we have used an interpolant form of the sink to facilitat6 solving


the equation. If we substitute for p~ (Equation 3.8), and allow the mass
vary with time, we find
dm~
dt - m~,p~,

3.12

which shows that, in SPH, a sink is interpreted as a region within which


the particles lose mass. This treatment of the sink is smootherthan simply
eliminating particles that enter a sphere surrounding the sink hole.
3.3

The Thermal

Energy

Equation

The equation for the rate of change of thermal energy per unit mass
dt -

3.13

Vv

can be written for particle a in the form

or, by noting
dt

the thermal energy equation for particle a can be written

Annual Reviews
www.annualreviews.org/aronline

SMOOTHED

= ~rnh

PARTICLE

HYDRODYNAMICS

v~h VW~,b.

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

By taking the average of the two previous equations, we find


= ~ mb~p~
VaWab
b + ~J Yah"
,
du, 1 __ /Pb
d~

549
3.16

3.17

which has the same symmetric factors as Equation 3.3.


It is characteristic of SPHthat gradient terms can be written in many
different ways. Similar transformations are possible for finite-difference
equations.
Anyof the above forms of the energy equation, when interpreted using
a Gaussian kernel, show that the thermal energy of particle a increases
whenparticle b approaches it. This is the SPHequivalent ofV -v < 0. Benz
(1989) finds that in somecases it is better to use Equation 3.14 instead
Equation 3.17.
It has been found (Hernquist 1991, private communication)that if the
thermal energy equation is integrated using any of the SPHforms above,
and if the density is calculated using Equation3.8, the total entropy is not
conserved as accurately as the energy. If an entropy equation is integrated
then the total energy is not conserved as accurately as the entropy.
However,if the gas is ideal, the total entropy will be conserved exactly if
the density is calculated using Equation 3.9 and the thermal energy is
calculated using any of the forms given above. In this case the mass is not
conserved exactly. It seems one cannot have everything~
3.4 Movin9 the Partic&s
Particles are movedusing either
3.18

dt v,,

or the XSPHvariant (where "X" is the unknownfactor) (Monaghan1989)

dt

~"

v,,+~mbb

W~,b,

3.19

with ~ = (p,+pb)/2 and e(0 ~ ~ ~ 1) as a constant. The XSPHvariant


movesa particle with a velocity that is closer to the averagevelocity in its
neighborhood. Strict consistency then requires that if p is found using
Equation 3.9, ~ should be used in place ofv in
No dissipation is introduced by XSPHbut it increases the dispersion

Annual Reviews
www.annualreviews.org/aronline

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

550

MONAGHAN

(which can be reduced by using a different kernel in Equation 3.19). The


XSPHvariant has proven useful in the simulation of nearly incompressible
fluids such as water, where it keeps the particles orderly in the absence of
viscosity.
Another interesting feature of the XSPHvariant is that if pressure and
viscous forces are set to zero, it simulates the Burgers equation with very
large effective Reynolds number. Experiments (Monaghan, unpublished)
showthat for this problemthe XSPHresults are as good as the best finitedifference equations.

3.5

Equation of State

The equation of state can be as complicated as desired. For exampleBenz


et al (1986, 1987) use equations of state for metals and minerals, including
phase changes, in their simulation of the formation of the Moon.

4. VISCOSITY
4.1 Viscosity

AND THERMAL CONDUCTION

Manyforms of artificial
viscosity have been proposed (Lucy 1977, Wood
1981, Monaghan& Gingold 1983, Evrard 1988, Loewenstein & Mathews
1984), but the most commonlyused artificial
viscosity is obtained by
writing the momentumequation as

dt-

~b mb ~+p~ +FIb

V"W"b

4.1

wherel-lab is given by

and
hvab "
ra/, +

~ab

4.2

The viscosity vanishes when vabr,b > 0, which is the SPHequivalent of


the condition V" v > 0.
The expression for FIa~ contains a term that is linear in the velocity
differences, which produces a shear and bulk viscosity (Monaghan1985).
The quadratic term is necessary to handle high Machnumber shocks, and

Annual Reviews
www.annualreviews.org/aronline

SMOOTHED

PARTICLE

HYDRODYNAMICS

551

is roughly equivalent to the Von Neumann-Richtmyerviscosity used in


finite-difference methods.This viscosity has a numberof desirable features:

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

1. it is Galilean invariant;
2. it vanishes for rigid bodyrotation;
3. it conserves total linear and angular momenta.
Manytests have confirmed that, with this viscosity, sho~k fronts are
spread over ~3h, which is sufficiently.,
accurate for most purposes in
astrophysics. The values of ~ and fl are not critical, but they should be
near ~ = 1 and fl = 2 for best results. The parameter r/2 in the formula for
/~,,b prevents singularities. It should be small enough to prevent severe
smoothingof the viscous term in high density regions, and this is normally
achieved by taking r/2 = 0.01h2. This choice of r/2 means that smoothing
of the velocity will only take place if the particle spacing is < 0. lh.
In the case of accretion disks, the presence of viscosity is required in
order to fit the observations, and this can be achieved by taking fl = 0,
and choosing appropriate values~or ~ and h. In manyother situations the
physical viscosity is small, but shocks can still occur. To treat the shocks
correctly requires ~ ~ 1 but the shear viscosity maythen be too large. In
order to escape this difficulty there are several possible routes:
1. Construct a more general viscosity similar to the linear term involving
~. This can be done (Monaghan
1991), btrt the resulting tensor viscosity
does not guarantee angular momentumconservation.
2. Follow the finite-difference methodsand use a switch. The idea is to
monitor somequantity, for examplethe density, and try to predict the
rapid change that comes with a shock. Experiments (Monaghan1990)
with a switch based on the density variation worked for one-dimensional shocks, but in astrophysical collapse problems the switch was
always on. A switch based on the rate of change of the force was also
examined.The force is a sensitive predictor of a shock, but a universal
rule to control the switch has not been found.
3. Use a predictor-corrector methodfor the time steps, and only use the
viscosity in the predictor step as in the two step Lax-Wendroffscheme
(Richtmyer & Morton 1967, Gadd 1978).
A more general viscosity wouldbe of very great value.
4.2 Thermal Conduction
The thermal conduction term
1
- V" (xVu)
P

4.4

Annual Reviews
www.annualreviews.org/aronline

552

MONAGHAN

can be approximated in a standard way, but because of the second derivatives it is found to be very sensitive to particle disorder (Brookshaw1986,
Monaghan1988a). A better way is to base the SPH form on an integral
approximation which in SPH form becomes
-- ~ mb(qo + q~) (u~ub)
(r.b- V. W.~)
,
_ ~
+~]~
Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org
by Lund University Libraries, Head Office on 01/15/08. For personal use only.

Pab(rab

4.5

where q = x/p has the dimensions of length x velocity. If the kernel is a


Gaussian, and the thermal conductivity and density are constant, the
contribution of particle b to the heat conduction of particle a is given by
- 2rnbx(ua-- ub) Wab
ph
2

4.6

Thermalconduction therefore takes place by the exchange of heat between


pairs of particles. If the particles are in one dimension, and equispaced, it
is easy to showthat the SPHconduction equation mimics finite-difference
equations.
The SPHconduction term (Equation 4.5) conserves total energy and,
when the thermal energy increases monotonically with temperature, it is
easy to showthat the total entropy increases, as it should.
Equation 4.5 can be varied by replacing
fi~b

by
P~Pb

4.7

In application to infinite strength shocks (Monaghan1988) the heat conduction term removes the unwantedwall heating. In this case it is convenient to replace
q,+qb by h~(~,b+4lw~l),

4.8

where 9 ~ 0.5 is a constant.


If diffusive radiation transport occurs it can be included in the thermal
energy equation using a term similar to the thermal conduction term above
(Brookshaw 1985). However, this cannot be the complete story because
the conduction conserves total energy, and there will be no heat loss. Heat
loss requires a surface term. This can be derived by physical arguments
(Brookshaw1986) or by starting with the exact equation and transforming
it by multiplying by the kernel and integrating over all space (Campbell
1988). Surface terms then appear naturally. However,as with finite-difference methods,there are still substantial obstacles to overcomein simulating
radiative processes in complex astrophysical phenomena.
If there are sources of heating or cooling, these can be added to thc

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED

PARTICLE

HYDRODYNAMICS

553

thermal energy equation. Several authors (Monaghan & Varnas 1988,


Monaghan & Lattanzio 1991, Hernquist & Katz 1989) have included
cooling from atomic and molecular processes. The cooling time is normally
extremely short comparedto the dynamical time scale and it is necessary
to integrate the thermal energy equation implicitly. There is no difficulty
in doing this.
SPATIALLY-VARYING

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

6.

RESOLUTION

The early experiments with SPHused an h that varied with time but was
constant in space. The most commonrule was to take
h ~ 1/(p) /~,

1
(P) = ~Pb,

6.1

where v is the numberof dinaensions and n is the numberof particles. It


is h which determines the resolution and the number of neighbors that
contribute to the properties at a point. The efficiency and the accuracy
wouldtherefore be greater if h was chosen so that it dependedon the local
particle numberdensity. Several authors (Hernquist & Katz 1989, Evrard
1988, Benz et al 1990) have used local resolution lengths, which has
increased the resolution enormously.Typically, h~ is calculated from
dt

\vp,,/

dr

6.2

Wheneach particle has its own h, momentumcan be conserved if the


kernel is symmetric. A symmetric kernel can be obtained by using any of
the standard kernels with h replaced by a symmetric combination of the
hs for the two particles. A simple example is the arithmetric mean. An
alternative is to use the average of two kernels, one with h~ and one with
h~ (Hernquist & Katz 1989). This form appears when the equations are
derived l~oman action principle.
A suitable density interpolant is
p(r) ~m~W(r--rb, h~ ),

6.3

and integration over all space shows that mass is conserved. The set of
equations to be solved whenthe resolution length varies in space and time
is
dt

- ~ m~ ~ + ~p~ + ~ V, ~,

6.4

Annual Reviews
www.annualreviews.org/aronline
554

MONAGHAN

du.
1 ~ { P~ Pa
~ -- ~ b~mb~p~+ p~ +H.b

6.5

dp. = ~ mbv.~,"V. l~.b,


dt ~

6.6

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

dh.
dt

f h.~
k.vp./ ~

6.7

dr~

6.8

d~=~o,
where

= ~[ w(r.~,no)w(ro~,
or
I/~ab

~ W(rab ,

hab)

and h.~ is an average of the h. and hb. The XSPHvariant can be used
instead of Equation 6.8 and a summationcan be used instead of Equation
6.6.
A discussion of some mathematical questions concerning the relation
between the SPHequations and the exact equations is deferred to a later
section of this review.

7.

KERNELS

The use of different kernels is the SPHanalogue of the use of different


difference schemes in finite difference methods. The advantage of SPHis
that the kernel can be calculated in a subroutine, or a table, and it is then
trivial to change a code with one kernel into a code with another. Many
kernels can be devised (Natanson 1960, page 58; Monaghan1982), but the
kernel based on spline functions (Monaghan& Lattanzio 1985)

3 2 33
1--~q +~q
W(rh) = ;v l ! (2--q)3

if0 <~_< 1;
ifl

<~<2;

otherwise

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED PARTICLE HYDRODYNAMICS

555

where v is the number of dimensions and ~ is a normalization constant


with the values

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

10

in one, two, and three dimensions respectively, has advantages. This kernel
has compact support; the second derivative is continuous, and the dominant error term in the integral interpolant is O(h2). The compactsupport
meansthat interactions are exactly zero for r > 2h; the continuity of the
secondderivative meansthat the kernel is not sensitive to disorder and the
errors in approximating the integral interpolants by summation interpolants are small provided the particle disorder is not too large. The error
in the integral interpolant can be determined by Taylor expansion of A(r)
about r in Equation 2.1.
Whenthe particles are equispaced, or nearly equispaced, the accuracy
of kernel interpolation can be discussed using the Poisson summation
formula (Monaghan1985). This shows that the Fourier transform of good
kernels falls rapidly with wavenumber. As an example, if particles with
equal mass rn are in one dimension, and equispaced with spacing 2, the
density from the SPHsum is approximately

where F is the Fourier transform of the kernel. It is then easy to show


that, for example, the Gaussian kernel produces negligible errors if h > 2.
More accurate kernels in one dimension can be constructed by requiring
them to be normalized, to have zero first moments[i.e. W(r, h) an even
function of r], and vanishing second moments

rz W(r, h) dr =

7.1

so that by Taylor expansionof the function A(r) in the integral interpolant


equation (2.1) the dominant error is O(h4). An example is the Super
Gaussian kernel in three dimensions:

A kernel with similar properties can be constructed by starting with any


of the standard kernels and constructing a newkernel with the coefficients
A and B according to

Annual Reviews
www.annualreviews.org/aronline
556 MOrqA~I-~N

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

BW(r,h) (1 - 2)
Ar

7.3

so that the new kernel is normalized and the second momentsvanish. The
disadvantage of these high order kernels is that the kernel becomesnegative
in part of the domain, and this can have serious consequences whenthere
is a sharp change in density. An undershoot occurs, and the density may
becomenegative. A similar effect occurs with high order finite-difference
schemes but this has been tamed by using total variation diminishing
(TVD) algorithms.
The kernels give enormousflexibility to an SPHcalculation. In principle
different equations can have different kernels though there is no evidence
that any advantage is to be gained by that. An exception may be in the
XSPHvariant where the kernel for the correction to the velocity could be
chosen to reduce the dispersion. In the case of finite differences, Gadd
(1978) shows that the two step Lax-Wendroff time integration can
improved by using a moderate accuracy O(h:) gradient in the first step
with the dampingterm, and a high accuracy gradient in the final step. The
SPHequivalent would be to insert viscosity and a standard kernel (e.g.
Gaussian) in the first step, and then use a more accurate kernel (e.g.
Super Gaussian) in the final step.
8.

MAGNETIC

FIELDS

The SPHformulation of magnetic forces was considered initially by Gingold & Monaghan(1977). An application was made to magnetic fields
polytropes. Further aspects of the application of SPHto magnetic field
problems have been considered by Philips & Monaghan(1985), Philips
(1986), and Habe (1989). The equations of MHDin SPHform have
applied by Stellingwerf (1990a) to blast waves in a magnetic medium.
8.1

Force

and Current

The magnetic force per unit mass is


,IB
,
P

8.1

wherethe current ,1 is given by


,1 = ~c2Vx B,

8.2

where SI units have been used. The current can be estimated using
pV x B = V x (pB)--(Vp) x B,
so that

8.3

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED PARTICLE

po(v B)oy~m~(
Bo-B~) oVWo~

HYDRODYNAMICS

557

8.4

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

which vanishes, as it should, when B is constant. In general, SPHshould


estimate the current accurately because the current is wherethe matter is.
To interpret Equation 8.4, assume the kernel is a Gaussian. The contribution of particle b to the current at particle a is then

(_2~,

co 2m
b Wab~ (Ba __ Bb) (r~-h2p~
]

ro).

8.5

This expression shows that particle b only gives information about the
current perpendicular to the direction (r,,-r~). Withthis in mind, Equation
8.5 is an inverse of the Biot-Savart law.
8.2 Time Variation

of Magnetic

Field

The time variation of B can be taken in the form


~(~)

= (V)V = (~" V)pv-

~ (B-

8.6

If thej componentof a vector field A at the particle b is denoted by Ab,~


then the SPHfo~ of Equation 8.6 is
1

The effect of particle b on the rate of change of B/p of particle a can be


interpreted in physical terms whenthe kernel is a Gaussian. The interpretation is complicatedby the fact that either B or p can vary as the particles
moverelative to each other.
Analternative to Equation 8.6 is to use
dB
dt

B(V.v)+(B.V)v,

8.8

with the SPHequivalent


l

8.9

where V~b,j is the jth componentof Yab" The first term increases B by
squeezing the field lines. The second term in the summationaffects the j
component of B by shearing.
Equation 8.9 can also be written

Annual Reviews
www.annualreviews.org/aronline
558

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

dB,_
dt

MONAGHAN

~mb(v,,bBa)VWub.
pu ~

8.10

Magnetic Forces
8.3
The simplest way to calculate the magnetic force is to substitute for Ja
(calculated from Equation 8.4) in J B. This force does not conserve linear
and angular momentaexactly. A force per unit mass that does conserve
linear and angular momenta(Phillips & Monaghan1985) is given
1 c~Mgij
ps ~x

8.11

where the stress tensor is defined by


1(

1 ~ ~

The SPHequivalent is then

However, when we examine a disturbance propagating along the x axis in


a uniform isothermal gas with a pure R~ field, the motion is found to be
unstable if the wavelengths are sufficiently
short (kh > 2) and
2c~ < B.~/(p~o), i.e. the AIN6nspeed is greater than ~ times the sound
speed. This result was confirmed by numerical simulation. The reason for
the instability is that the magneticstress tensor in this case is positive, and
the pair force between the particles is negative. The particles therefore
attract each other and clump on the scale of h. A simple way of removing
the problem is to sweep over the particles and find the maximum
value of
the magnetic stress tensor, then subtract this from the stress tensor in
Equation 8.12. Experiments show that the algorithm is then stabilized
(Phillips & Monaghan1985), but it would be preferable to have a more
elegant procedure.
8.4 Additional
Remarks
Because the current is located where the particles are, it would be an
advantage to update if, then calculate B via the Biot-Savart law. An
algorithmic advantage is that the tree code used for the gravitational field
could be used to implement the Biot-Savart law.
The additional terms from finite conductivity can be included without

Annual Reviews
www.annualreviews.org/aronline

SMOOTHED PARTICLE

HYDRODYNAMICS

559

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

difficulty. These terms are diffusion terms and they maybe estimated using
expressions similar to those suggested for heat diffusion.
In star forming regions the ionization can be so low that the field can
slip through the material. To simulate this process requires the inclusion
of neutrals, ions, grains, and electrons. This is a simple generalization of
the SPHequations used for modeling gas and dark matter in cosmology.
9.

SPECIAL

9.1

Energy

RELATIVITY
Momentum

Tensor

SPHequations for special relativity were given by Monaghan(1985). These


equations are similar to those used by Amsdenet al (1976) whoused PIC
to simulate high Sl~eed collisions of atomic nuclei.
Weassume the fluid consists of baryons for which the energy momentum
tensor is (Landau &Lifshitz 1975)
~--~v = (nmoc2+ n~ ~_ p)u~uv+ Pg~V,
9.1
where Greek indices run from 0 to 3 and the metric coefficients are defined
by
g00 = - 1,

gij = 1.

In these equations n is the numberdensity of baryons in the rest frame of


the element of fluid, P is the pressure, and f is the thermal energy in the
rest frame of the fluid. The details of these thermodynamicquantities are
given by Chandrasekhar(1958) and the speed of sound c is given by Synge
(1957). v i s t he 4 -velocity w ith UvUV=- 1, a nd m0 i s t he b aryon r est
mass.
9.2

The Momentum

Equation

The momentumequations follow from


9.2

-0
which, on writing X = nmoc2+n&,becomes
O Mi

63

9.3

0~- +~S)vx (MvJ)=


where
c2

M = ?~(P+X)v,

~ - x/(1 -v2/c2
).

9.4

Annual Reviews
www.annualreviews.org/aronline
560

MONAGItAN

Mis the momentum


per unit volumeof the fluid as seen by the computing
observer. For SPH we need quantities per particle. The momentumper
baryon is denoted by

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

M
q =~,

9.5

where N = yn is the number density of the fluid seen by the computing


observer. Noting the conservation law for the baryon number
ON ~
~ + ~x~ (Uv~) = 0,

9.6

we can write Equation 9.3 in the form


dq
dt

1
VP
N

9.7

where
dq ~q
dt - Ot +vVq

9.8

is the usual derivative following the motion. The special relativistic momentum equation is therefore almost identical to the nonrelativistic equation.
The SPHform is obtained by first noting that the interpolation formula
is now
A,(r) ~,vbW
(r--rb, h),
b

where vb is the numberof baryons associated with particle b. This formula


is not relativistically invariant, nor is it meantto be. It is the particular
interpolation suited to our computational observer, and in this sense it is
equivalent to that observer dividing space into cells for a finite-difference
calculation. The SPHform for Equation 9.7 is
9.9
The relativistic
momentumequation has all the properties of the nonrelativistic equation. In particular it conserves relativistic linear and angular momenta:

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED PARTICLE HYDRODYNAMICS

~v~r, qa.

~ v,q~,
a

561
9.10

9.3 The Eneryy Equation


The energy equation is

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

0~--0~
-0
j
Ox

9.11

which becomes (Monaghan 1985)

~S[(~o+x)~-P]+v-

(e+x)v

9.12

The energy per unit volumeis


E = (P+X)y2-P,

9.13

and the energy per baryon is


E
~ = -N

9.14

with the nonrelativistic form


mcZq -

1 2
~mv +~.

With the definition


Equation 9.12 as
de
dt

9.15
(9.14), and the continuity equation, we can write

i
V(Pv)
N

9.16

whichhas the sameform as the nonrelativistic equation for the total energy
(kinetic plus thermal) per unit mass. An SPHform of this equation
dt - ~ m~~, NSf +b /VW"b"

9.17

These equations have been used by Lahy (1988) to modelrelativistic shock


phenomena.
An alternative formulation of relativistic SPHhas been described by
Khefets et al (1990). Their formulation retains the covariant form, and
therefore more elegant than the preceding formulation. It remains to be
seen which is the more convenient for simulations.

Annual Reviews
www.annualreviews.org/aronline
562

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

9.4

MONAGHAN
Dissipation

The usual recipes for dissipation in relativistic fluid dynamics,for example


thosegiven by Landau & Lifshitz (1975) or Weinberg (1972), lead
instabilities (Hiscock &Lindbl0m1985) with typical timescales for water
in the bath of 10-34 seconds (this is not a misprint!). The nonrelativistic
limit, c --* ~, is singular. An alternative suggested by Carter is also known
to lead to instabilities (Olson &Hiscock 1990). Hawleye.t al (1984) refer
to Weinbergs dissipative terms, but in their numerical calculations they
use an artificial pressure proportional to (Vv)2 which is similar to the
VonNeumann-Richtmyerviscosity. They take the practical point of view
that the artificial viscosity does not have to be physical, but only has to
prevent post-shock oscillations. The PIC calculations do not use explicit
dissipation but, because physical quantities are averaged over a cell, dissipation is implicit. Total energy and momentum
are conserved, but the
contribution of dissipation to the inertia is never included. The formulation
of relativistic dissipation terms is clearly in a bad state and all numerical
methodsface these difficulties. Experience suggests that the best form of
dissipation for relativistic SPHwould use velocity or momentum
differences. No suitable formula has been suggested.
10.

IMPLEMENTATION

AnSPHcalculation is initiated by specifying the mass, position, velocity,


and thermal energy of each particle. In addition, if the density is calculated
from Equation 3.9 the initial density is specified. Other quantities, such as
the mixture of elements associated with each particle, may be needed.
The Particle Setup
10.1
It is often convenient to set the particles up on a regular grid. In that
case a Cartesian grid with equal spacing can be used, though there are
advantages in using a body centered cubic lattice in three dimensions
(Monaghan& Lattanzio 1991), namely (a) it gives a better representation
of integrals by sumsthan the simple Cartesian grid, (b) it gives a particle
more nearest neighbors, and (c) if planar compressionoccurs, the particle
distribution is better because the particles are closer together perpendicular
to the direction of compression. Regardless of the grid, if the cell size
associated with the position of particle a is A V,, then m, can be taken as
10.2 Data Structures
For problems where the sam:e ~h can be used for each particle, the data
structure should be based ~a li~k lists. These are discussed by Monaghan

Annual Reviews
www.annualreviews.org/aronline

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

SMOOTHED

PARTICLE

HYDRODYNAMICS

563

(1985) and by Hockney& Eastwood(1981). If the spline-based kernel


used, the link list cells should be 2h wide so that only neighboring cells
can contribute to particles in a given cell. For somecomputers (e.g. Vax)
the calculations are muchfaster if the labels of all the contributing particles
are fi~st gathered into a single array. Relabelling the particles so that the
numericaldifferences of labels of particles in neighboringcells are small is
worthwhile.
Wheneach particle has its own h the calculation of the SPHsums can
be made part of a tree code calculation (Appel 1985, Barnes &Hut 1986,
Hernquist & Katz 1989, Benz et al. 1989) which is the natural methodfor
calculating self-gravitational forces on a set of particles. The tree code can
be vectorized (Hernquist 1990, Makino1990).
10.3

Time Stepping

The numerical integration of the ordinary differential equations for the


physical variables at each particle can be carried out by standard methods
(e.g. leapfrog or predictor-corrector) with a time-step control that involves
the Courant condition, the force terms, and the viscous diffusion term
(Monaghan1989). The time step fit can then be chosen by first calculating
6tf and c~tcv accordingto

and
6tcv = min
a c~+0.6(eca+flmaxbg~b)
then 6t = 0.25 min(~it~, 6toy). Here ~tf is based on the force per unit mass
f, and 6tcv combinesthe Courant and the viscous time-step controls. There
is evidence from computer experiments that the coefficient 0.25 can be
replaced by 0.4 for the 6tcv term.
If the time step is chosen correctly, the total energy should be conserved
to within 0.5%over 400 time steps. If a predictor-corrector or leapfrog
methodis used it is possible to ensure exact linear and angular momentum
conservation. Benz (1989) reports good results with a second-order Runge
Kutta integrator due to Fehlberg which can often work with a time step
larger than would be expected from the Courant condition.
Whenrapid molecular cooling occurs the energy equation must be
integrated implicitly. This requires the straightforward solution of a nonlinear equation for each particle (Monaghan& Varnas 1988, Hernquist
Katz 1989, Monaghan& Lattanzio 1991).

Annual Reviews
www.annualreviews.org/aronline
564

MONAGHAN

For manyastrophysical problems there is a wide range of time scales.


To cope with this the particles can be groupedinto sets, each with its own
time step (Hernquist & Katz 1989).

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

1 1.

APPLICATIONS

1 1.1 Gas Dynamics


The simplest SPHtest is to use it to study linear wavephenomena.A series
of tests (propagation of density and velocity perturbations and boundary
oscillations) show that good agrcemcnt with theory is obtained if the
wavelength is > 2~zh. The deviation from the correct dispersion relation
depends on the Fourier transform of the kernel [an example is given by
Monaghan(1990)]. It is interesting to note that in these calculations with
particle spacing s, the results are significantly moreaccurate (in particular
better propagation speeds) if h = s or h = 2s and least accurate with
h = 1.5s.
In various tests (Monaghan, unpublished) SPH was applied to the
problemof supersonic flow of an ideal gas over a step. The results, while
satisfactory, were not as sharp as those which can be obtained with high
quality TVDfinite-difference schemes. A similar situation occurs in the
simulation of supersonic flow over a cylinder. In both cases the shock
profiles are blurred by thc viscosity. In these cases there is the additional
problem of how best to model the boundaries. However, recent work on
nearly incompressible fluid flow with rigid boundaries ~(see below) suggests
a convenient treatment for any boundary. It would be worth applying this
treatment to supersonic flow.
The application of SPHto shocks and shock tube phenomenahave been
described by many authors (Monaghan & Gingold 1983, Monaghan
Pongracic 1985, Lattanzio et al 1985b, Hernquist &Katz 1989). The typical
problem is the Sod (1978) shock tube for which SPHgives excellent results.
In this problem it is useful to introduce a small amountof heat diffusion
(g = 0.125) to removea blip in the pressure at the contact discontinuity
which is otherwise treated very accurately. SPHhas also been applied to
the plane and cylindrical infinite strength shocks of Noh (Monaghan
1988b). The calculations include thermal conduction as well as viscosity.
These results are typical, and showthat the SPHequations give satisfactory
shock profiles and good contact discontinuities.
The development of a compressible RayleighoTaylor instability in an
isothermal gas with the layers having a density ratio of 4:1 has been
studied using SPH(Monaghan1989). The configuration has a fixed top
and bottom boundary, and periodic side conditions. A series of similar
calculations confirm that the SPHequations determine the onset of the

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED PARTICLE HYDRODYNAMICS

565

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

stability in agreement with the analysis of Bernstein &Book(1983). This


instability is of considerable interest in the developmentof a supernova,
and SPHcalculations (see below) agree with accurate finite-difference
calculations.
Blast waves calculated with SPH(Stellingwerf 1990a) agree well with
theory.
1 1.2 Binary Stars and Stellar Collisions
The interaction of two stars is ideally suited to SPH.Matter, energy, and
momentum
are transported accurately by the SPHparticles as the stars
movethrough space. A finite-difference calculation for the same problem
would introduce errors from the advection through the grid, and would
require a large numberof cells to cover the space within which the stars
are moving.
The early SPHcalculations for binary stars were concerned with the
Roche and Darwin problems for polytropes (Gingold & Monaghan1978).
Only a small numberof particles (less than 400) were used, but the results
were in good agreement with stability theory. In a later calculation (Gingold & Monaghan1979, 1980) the Roche problem for central orbits was
studied. In this work the SPHcalculations were compared with results
from the integration of equations describing the coupling between the
linear oscillations of the polytrope and the nonlinear orbital motion. Good
agreement was obtained. For stronger interactions the SPHsimulation
gave the first direct results for tidal disruption and capture. This workhas
since been superseded by the more accurate work of Benz & Hills (1987)
and Goodman & Hernquist (1991) on binary polytropes. The interaction of three polytropes was studied by Cleary & Monaghan(1990) for
an ensemble of configurations using ~ 100 particles per polytrope. This
quite small numberof particles is near the lower limit for a reasonable
calculation, but it appears to be adequate to indicate deviations from
the classical 3-body system. The collision of white dwarf stars has been
considered by Benz &Thielemann(1990) and Benz et al (1990). In the first
of these papers allowance was made for radiation pressure and energy
generation using a reduced nuclear network. In the second paper the
question of mass exchange between interacting white dwarfs and the formationof a disk was considered in detail. This paper contains a very useful
and detailed description of their tree code.
Rasio &Shapiro (1991) have applied SPHto the collision of a giant star
and a compact object.
1 1.3 Formation of the Moon and Impact Problems
The collision theory of the origin of the Moonhas been studied in detail
by Benz et al (1986, 1987, 1989a) using SPH. This work shows the power

Annual Reviews
www.annualreviews.org/aronline

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

566

MOr~AGr~AN

of SPH.The configuration consists of a planetesimal that collides with an


embryonicEarth. The equation of state (originally the Tillotson, but later
the Char D ANEOS)is appropriate for rocky materials and iron and
therefore complicated, but it can be included in an SPHcode without
difficulty.
A problem of considerable interest is the cratering produced by the
impact of an asteroid or comet on a planetary surface. In particular the
impact on the Earth is of interest for the Cretaceous extinction event. This
problem has been examined by Pongracic (1989) who modeled the impact
in two dimensions using a variety of equations of state. A variety of
configurations were considered, including impact on water over a typical
rocky sea bottom, impact on model mountains, and impacts at oblique
angles. A related problem concerns the delivery of material to the Earth
by comets. This problem has been examined by Chyba et al (1990) using
an SPH code. None of these cometary or asteroid impact problems have
been taken beyondthe initial stage of crater formation, though this is often
enough to estimate the amount of material flung to large distances and
the maximumtemperatures reached.
Stellingwerf &Campbell (1990) have examined the hypervelocity impact
of metals. Laser ablation has been studied by Stellingwerf (1990b).
1 1.4 Fragmentation

and Cloud Collisions

Lattanzio et al (1985a), Lattanzio & Henriksen (1988), and Keto &


tanzio (1989) applied SPHto the study of interacting isothermal clouds
a model for the processes conjectured for molecular cloud complexes. The
SPHsimulation allowed a systematic study of the way complex structures
formed in the interactions between initially spherical clouds. The authors
used a fourth-order multigrid Poisson solver with the source terms mapped
to the grid and the grid forces mappedback to the particles. The smoothing
length h was the same for all particles. A similar calculation (Nagasawa
et al 1988) used a spatially-varying h. In a later calculation (Monaghan
Varnas 1988) an attempt was made to simulate an entire cloud complex
with the isothermal assumption replaced by a cooling formula suitable for
the interstellar medium.
SPHhas been used to study the fragmentation in isothermal rotating
clouds (Gingold & Monaghan 1981, 1983, Miyama et al 1984) and
clouds and disks (Monaghan& Lattanzio 1991) using an accurate molecular cooling formula. The results from a molecular cooling sequence have
been applied to an observed molecular fragmentation structure (Keto
Lattanzio 1989, Keto et al 1991). Most of these calculations used ~ 30,000
particles, and the same h was used for each particle.
An interesting study of instabilities in a rotating cloud was made by

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED PARTICLE HYDRODYNAMICS

567

Durisen et al (1986) who compared an SPH simulation with a finitedifference simulation and found the SPHsimulation to be mucheasier and
moreefficient. It is useful to note that the SPHcalculation was completed
in a few days whereas the finite-difference calculation took more than a
year to implementsatisfactorily.

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

1 1.5 Cosmological

and Galactic

Problems

The typical cosmological problem requires the simulation of the growth


of fluctuations in two fluids (gas and dark matter) in an expandinguniverse.
SPHis ideal for this type of problem. The two fluids can be easily distinguished by using a tag for each particle. A link list can then be constructed for the gas particles to compute thermodynamicquantities, and
the gravitational field can be obtained using all the particles. Morefluids
could be easily incorporated.
Applications of SPHto problems arising in cosmologyhave been considered by Evrard (1988) and Hernquist & Katz (1989) who laid
foundations for an effective combination of a tree code with SPHwhich
has subsequently been used to investigate a variety of problems in cosmology and galaxy interactions (Barnes & Hernquist 1991). Bond et
(1989) have studied cosmological problems using a fourth-order multigrid
Poisson solver in place of the tree code.
11.6

Disks

and Rings

Zurek & Benz (1986) used SPHto simulate the nonlinear development
an unstable thick barytrope disk around a star. Their work showed that
the disk evolved to a structure with a rotation law predicted by linear
theory. In a related calculation Monaghan(1990) explored the stability
the isothermal rings postulated by a theory of the solar system. Artymowicz
et al (1991) used SPHto study the effect of a disk on the elements of
central binary.
11.7

Radio Jets
SPHsimulations of jet models (Coleman & Bicknell 1985, 1988; see also
Bicknell et al 1990) making use of axial symmetry, and special kernels
which take into account boundaries by changing the normalization, have
been used to determine observational properties of jets. In related work
Balsara et al (1991) have used SPHto model supersonic shear layers and
have noted that SPHcan automatically model subgrid turbulence.
1 1.8 Motion Near Black Holes
A comprehensive use of SPHfor fluid dynamics near a black hole awaits
the development of a general relativistic
version of SPH(see below).

Annual Reviews
www.annualreviews.org/aronline

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

568

MONAGHAN

Bicknell & Gingold (1983) examined the effect of a polytrope moving


the gravitational field of a massive body. Evans & Kochanek(1989) applied
SPHto the disruption of a polytrope in the neighborhoodof a black hole,
but they confined the simulation to the first passage and only included the
zeroth-order gravitational field. This problemis of special interest in active
galactic nuclei where the formation of an accretion disk and its subsequent
developmentas a source of fuel for the black hole is the object of the study.
It is an intrinsically difficult problembecause the material of the disrupted
star becomesspread out over very great distances, and to simultaneously
achieve good resolution and modelthe collision and viscous forces requires
a very large numberof particles.
11.9

Supernovae

The mixing due to Rayleigh-Taylor instabilities


during a supernova
explosion has been the subject of manycomputer simulations. The first
SPHsimulations of supernova explosions were carried out for polytropes
(Nagasawaet al 1988). The results disagreed with finite-difference calculations. Benz & Thielmann (1990) pointed out that Nagasawaet al had
used a 6 fuuction source of energy at the center. With a smoothedsource
the SPHformulation gave results in agreement with finite-difference calculations. Herant & Benz (1991) have performed further SPHcalculations
withrealistic initial states.
1 1.10 Special and General Relativity
Only a small number of SPHrelativistic
calculations have been carried
out. Lahy (1989) applied SPH to shock tube and nuclear collision
problems. The results were poor by comparison with the nonrelativistic
shock results because a good artificial viscosity for SPHhasnt been found.
The SPHequations for post-Newtonian fluid dynamics were set up by
Thompson(1984) and applied to the collapse of rotating neutron stars.
The SPHequations for fluid dynamics in a knownstationary metric were
described by Monaghan& Lahy (1989).
1 1.1

1 Magnetic

Phenomena

SPHhas been used to study the collapse of magnetic gas clouds (Phillips
1986, Habe 1989), the propagation of Alfv6n waves (Monaghan& Phillips
1985), and the structure of static magnetic polytropes (Gingold & Monaghan 1977). The development of a blast wave in a magnetic cloud has
been considered by Stellingwerf & Peterkin (1990). There is nowabundant
evidence that magnetic fields must be taken into account for star formation
and the time would seem to be ripe for the development of a robust SPH

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED

PARTICLE

HYDRODYNAMICS

569

algorithm for both ideal MHDand for MHDin the presence of plasma
drift.

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

11.12

Nearly

Incompressible

Flow

SPHwas designed for compressible flow problems, but it can be extended


to nearly incompressible flow (Monaghan& Humble1991). The essential
point is that an artificial equation of state can be constructed so that
compressibility effects are at or belowthe 1%level. All that is required is
that the MachnumberMof the flow should be ~ 0.1, since compressibility
effects are O(M2). Because terrestrial
flows can be characterized
a typical velocity (for example a bursting dam of height H produces
typical velocities ~ x/29H, where g is the acceleration due to gravity), it
is possible to design an equation of state so that M~ 0.1. The SPHtreatment is then straightforward, and free-surface problems (bursting dams,
tidal bores, waterfalls, etc.) can be treated easily. The boundaries can be
replaced by chains of fixed particles whichinteract with the water particles
by forces which are modeledon molecular forces.
The disadvantage is that time steps are a factor ten shorter than normal,
but since all standard finite-difference techniques for free-surface problems
include an iteration cycle of several steps, this disadvantage is minimal.
Thermalconvection and fluids with different densities can be treated without difficulty.

12. THEORETICAL POINTS CONCERNING SPH


12.1 The Derivation of SPHwhen h = h(t)
One convenient way to derive the SPH equations is to start with the
original equations, multiply through by a kernel and, by integrations by
parts or Gausss theorem, determine an equation which the SPHintegral
interpolants must satisfy. This idea has been used to examine the SPH
equations whenthe resolution length varies with space and time.
For the present we consider the case in which h varies only with time.
Start with the exact continuity equation in one dimension:
0p 0
~ + ~x (pv) =

12.1

If Equation 12.1 is multiplied by W(x-x,h) and integrated over x


assuming that in the integration by parts the integrand vanishes at the
limits, we get
Ofll

ot

--h

+ (pv)~ = 0.

12.2

Annual Reviews
www.annualreviews.org/aronline
570

MONAGHAN

The term involving/~ exists because changes in/9 can occur whenh changes
even whenthe particles are held fixed. This is equivalent to the change in
physical quantities in a finite-difference calculation whichoccurs if the grid
is altered and physical quantities are mappedfrom the old grid to the new
grid.
If we approximate p~ by the summationinterpolant
Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org
by Lund University Libraries, Head Office on 01/15/08. For personal use only.

p(X)l

= mb W(X--Xb, h)
b

then
OW

12.3

and
~
OW
c~x(PV)~= ~~,rn~vb Ox

12.4

These equations satisfy the interpolant form of the continuity equation


provided 2b = v~, the usual assumption in SPH.
These results show that the summationinterpolant is an exact solution
of the integral interpolant form of the exact equations. Of course the
integral and summationinterpolants differ, and this difference is the error
in the calculation of the density.
If we use Equation 3.9 we are approximating the rate of change of the
true density, not the rate of change of the integral interpolant. There is
therefore no/~ term.
The momentumequation can be discussed in the same way by working
with the equation
~

OP

12.5

Tt(PV)+ ~(pv ) Proceeding as before we find


+

(pv2)~-h~(pv),

=- .

12.6

If we substitute the following SPHsummationinterpolants for the integral


interpolants
(pV)l

= mbv b W(X -- xt, ,


b

and

h)

12.7

Annual Reviews
www.annualreviews.org/aronline
SMOOTHED

dP = ~mb__(~_~W(x_xb,
~x

PARTICLE

HYDRODYNAMICS

571

12.8

b Pb \ CX/b

Equation12.6 is satisfied if

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

_ __I~(OP~

12.9

which ~s the usual SPHequation. The thermal energy equation can be


derived in the same way.
12.2 Deriving the SPH Equations when h = h(r, t)
The previous arguments have been extended by Bicknell (1991) to the case
of h varying with space and time. If, for example, we assume h depends
on the coordinate of the contributing particle, we multiply the continuity
equation by W[x--x~, h(x, t)], and integrate as before. Wefind

where ~ is the derivative of h following the motion. Equation 12.10 is


satisfied exactly by the summationinterpolant for the density and for pv.
The summation interpolant conserves mass because

psdx = ~mo.

12.11

If we apply the same procedure to the momentumequation we recover


Equation 12.9.
A point worth noting is that if we use interpolants with h dependent
upon the contributing particle, then the spatial gradients do not involve
derivatives of h. For example
(pV)s = m~v~ ~ W(x-- x~ , h~ ).

12.12

On the other hand if we use an h which depends on the position where we


want the estimate, then the spatial derivative of the summationinterpolant
involves the spatial derivative of h. This is the case for the interpolation
which uses an average h, or an average of the kernels, as in Section 6. The
errors are of O(h~) provided the scale of variation of h is comparable to
that of other physical quantities (Hernquist & Katz 1989). In this case
total mass is not conserved exactly since

Annual Reviews
www.annualreviews.org/aronline
572

MONAGHAN

IV[x-- xb, h(x)] dx ~ O.

12.13

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

The conclusion that we draw from this is: It is possible to interpolate with
hs that vary in space as well as time but local errors [typically O(h2)]
are inescapable. These difficulties occur in adaptive grid finite-difference
methods, but SPHis incomparably easier to work with.
12.3 Remarks Concernin# Errors
As we have seen, the errors in the integral interpolants can be estimated
analytically. It is more difficult to estimate the errors in the summation
interpolants unless the particle positions are orderly. The original discussion of SPH by Lucy (1977), and by Gingold & Monaghan (1977),
assumed that the particles were randomly distributed and the summations
were MonteCarlo estimates of the integral interpolants. The results were
therefore expected to show large fluctuations and correspondingly large
errors. Theselarge fluctuations were not found, even in fission calculations,
because the particles were not distributed according to a random number
generator.

They are

distributed

by the

dynamics

which is an altogether

different matter. In the cases where somemoderate disorder occurs, as in


the collapse of a rotating cloud, the best estimate of the errors is probably
that of Niedereiter (1978) whoestimated the errors as being ~: n- ~ log v- 5,
where n is the number of points. A related result due to Wozniakowski
(1991) gives the average error as ~cn- ~ logn~v- ~/2. (This remarkableresult
was produced by a challenge with a payoff of sixty-four dollars!)
In complicated dynamical problems, large variations in the physical
properties occur naturally, and this is clearly true for astronomical objects
like star forming regions and interacting galaxies. Similar large variations
are expected in the numerical simulations, and it is a mistake to assume
that these large variations are numerical artifacts produced by the simulation. For this reason the shock calculations of Rasio &Shapiro (1991),
wherethe initial properties are given randomvariations, are not necessarily
a measureof the errors that occur in practice. The ultimate test of accuracy
is how well the numerical method reproduces knownresults. The applications described in this paper show that SPHprovides a robust accurate
tool for the study of astrophysical fluid dynamics.

Literature Cited
Amsden, A. A., Harlow, F. H., Nix, J. R.
1976. J. Comput. Phys. 20:119
Anzer, U., Borner, G., Monaghan,J. J. 1987.
Astron. Astrophys. 176:235

Appel, A. W. 1985. SIAM J. Sci. Stat.


Comput. 6:85
Artymowicz,P., Clarke, C. J., Lubow,S. H.,
Pringle, J. E. 1991. Ap. J. 370:L35

Annual Reviews
www.annualreviews.org/aronline

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

SMOOTHED PARTICLE HYDRODYNAMICS


Balsara, D. B., Norman, M. L., Bicknell,
G. V., Gingold, R. A. 1991..4,0. J. In
press
Barnes, J., Hut, P. 1986. Nature 324:446
Barnes, J., Hernquist, L. E. 1991..40. J. 370:
65
Benz, W. 1988. Comput. Phys. Comm.48
Benz, W. 1989. Numerical Modelling of Stellar Pulsation. Nato Workshop, Les Arcs,
France
Benz, W., Bowers, R. L., Cameron, A. G.
W., Press, W. H. 1990./10. J. 348:647
Benz, W., Cameron, A. G. W., Metosh, H.
J. 1989a. Icarus 81: 113
Benz, W., Hills, J. G. 1987. 4p. J. 323:
614
Benz, W., Hills, J. G, Thielmann, F.-K.
1989b. 40. J. 342:986
Benz, W., Slattery, W. L., Cameron, A. G.
W. 1986. Icarus 66:515
Benz, W., Slattery, W. L., Cameron, A. G.
W. 1987. Icarus 71:30
Benz, W., Thielmann, F.-K. 1990. 40. J.
Lett. 348:117
Bernstein, I., Book,D. 1983. Phys. Fluids" 26:
453
Bicknell, G. V. 1990. SI.4M J. Sci. Star.
Cornout. 99:341
Bicknell, G. V. 1991. SIAM J. Sci. Star.
Cornout. 12:1198
Bickncll, (3. V., Cameron, R. A., Gingold,
R. A. 1990..4.0. J. 357:373-87
Bicknell, G. V., Gingold, R. A. 1983. ,40. J.
273:749-60
Bond, J. R., Lattanzio, J. C., Monaghan,J.
J. 1989. Bull. ,4m. 4stron. Soc. 21:1216
Brookshaw,L. 1985. Proc..4stron. Soc..4uat.
6:207
Brookshaw,L. 1986. The Stability of Binary
Systems and Rotating Stars. PhDthesis.
Monash Univ.
Campbell, P. M. 1988. Some New41gorithms
for Boundary Value Problems in SPH.
Albuquerque: Mission Res. Corp.
Chandrasekhar, S. 1958. Introduction to the
Study of Stellar Structure. Dover
Chyba, C. F., Thomas,P. J., Brookshaw,L.,
Sagan, C. 1990. Science 289:366
Cleary, P., Monaghan,
J. J. 1990. ,40. J. 349:
150
Coleman, C. S., Bicknetl, G. V. 1985.
MNR4S 214:337 55
Coleman, C. S., Bicknell, G. V. 1988.
MNR.4S 230:497
Durisen, R. H., Gingold, R. A., Tohline, J.
E., Boss, A. P. 1986..4p. J. 305:281
Evans, C. R., Kochanek,C. S. 1989. 40. J.
Lett. 346:L13
Evrard, A. E. 1988. MNRAS235:911
Gadd, A. J. 1978. Q. J. R. Meteorol. Soc.
104:583
Gingold, R. A., Monaghan, J. J. 1977.
MNRAS 181:375

573

Gingold, R. A., Monaghan, J. J. 1978.


MNR4S 184:481
Gingold, R. A., Monaghan, J. J. 1979.
MNR4S 188:45
Gingold, R. A., Monaghan, J. J. 1980.
MNR.4S 191:897
Gingold, R. A., Monaghan, J. J. 1981.
MNRAS 197:461
Gingold, R. A., Monaghan, J. J. 1982. J.
Comput. Phys. 46:429
Gingold, R. A., Monaghan, J. J. 1983.
MNRAS 204:715
Goodman,J., Hernquist, L. 1991. Ap. J. 378:
419
Habe, A. 1989. In Status Rep. Super Computing Japan, ed. T. Nakamura, M. Nagasawa. National Lab. High Energy Phys.
Harlow, F. H. 1957. J. Assoc. Comput.Mach.
4:137
Harlow, F. H. 1964. Methods Comput. Phys.
3:319
Harlow, F. H. 1988. Comput. Phys. Comm.
48:1
Hawley,J., Smarr, L., Wilson, J. 1984. A,0.
J. 277:296
Herant, M., Benz, W. 1991. Ap. J. 370:L81
Hernquist, L. 1990. J. Comput.Phys. 87:137
Hernquist, L., Katz, N. 1989. Ap. J. Suppl.
70:419
Hiscock, W. A., Lindblom, L. 1985. Phys.
Rev. D 31:725
Hockney, R. W., Eastwood, J. W. 1981.
ComputerSimulation using Particles. New
York: McGraw-Hill
Keto, E., Lattanzio, J. C. 1989. Ap. J. 346:
184
Keto, E., Lattanzio, J. C., Monaghan,J. J.
1991. Ap. J. 383:639
Khefets, A., Miller, W. A., Zurek, W. 1990.
Phys. Rev. D 41:451
Lahy, N. 1989. A Particle Method for Relativistic Fluid Mechanics.MScthesis. Monash Univ.
Landau, L. D., Lifshitz, E. M. 1975. Fluid
Mechanics. Oxford: Pergamon
Lattanzio, J. C., Henricksen, R. N. 1988.
MNRAS 232:565
Lattanzio, J. C., Monaghan,J. J., Pongracic,
H., Schwarz, M. P. 1985a. MNRAS215:
125
Lattanzio, J. C., Monaghan,J. J., Pongracie,
H., Schwarz, M. P. 1985b. SIAMSci. Stat.
Comput. 7:591
Loewenstein, M., Mathews, W. G. 1984. J.
Comput. Phys. 62:414
Lucy, L. B. 1977. Astron. J. 82:1013
Makino, H. 1990. J. Comput. Phys. 87:148
Miyama,S. M., Hayashi, C., Narita, S. 1984.
Ap. J. 279:621
Monaghan, J. J. 1982. SIAM J. Sci. Stat.
Cornput. 3:422
Monaghan, J. J. 1985. Comput. Phys. Rep.
3(2):

Annual Reviews
www.annualreviews.org/aronline

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

574

MONAGHAN

Monaghan, J. J. 1988a. Comput. Phys.


Comm. 48:89
Monaghan, J. J. 1988b. SPH Meets the
Shocks of Nob. Preprint
Monaghan,J. J. 1989. J. Comput. Phys. 82:
1
Monaghan, J. J. 1990. Flows in the Modern
Laplacian Theory. Preprint
Monaghan, J. J. 1991. Generalized Viscosities Jbr SPH.Preprint
Monaghan, J. J., Gingold, R. A. 1983. J.
Comput. Phys. 52:374
Monaghan,J. J., Humble, R. J. 1991. Arbitrary Incompressible Flow with SPH. Preprint
Monaghan, J. J., Lahy, N. 1989. Marcel
Grossman1988. World Sci.
Monaghan, J. J., Lattanzio, J. C. 1985.
Astron. Astrophys. 149:135
Monaghan, J. J., Lattanzio, J. C. 1986.
Astron. Astrophys. 158:207
Monaghan,J. J., Lattanzio, J. C. 1991. Ap.
J. 375:177
Monaghan, J. J., Pongracic,
H. 1985.
1MACS 1:187
Monaghan, J. J., Varnas, S. 1988. MNRAS
231:515
Nagasawa, M., Nakamura, T., Miyama, S.
M. 1988. Publ. Astron. Soc. Jpn. 40:691
Natanson, I. P. 1960. Theory of Functions of
a Real Variable. NewYork: Ungar
Niedereiter, H. 1978. Bull. Amer. Math. Soc.
84:957
Olson, X., Hiscock, W. A. 1990. Phys. Rev.
D 41:3687

Phillips, G. J. 1986. MNRAS


221: 571
Phillips,
G. J., Monaghan, J. J. 1985.
MNRAS 216:883
Pongracic, H. 1989. Numerical Modelling of
Large Body Impacts. PhD thesis. Monash
Univ.
Rasio, F. A., Shapiro, S. L. 1991. Ap. J. 111
Richtmyer, R. D., Morton, K. W. 1967.
Difference Methodsfor Initial Value Problems. NewYork: Wiley
Sod, G. A. 1978. J. Comput. Phys. 27:1
Stellingwerf, R. F. 1990a. Blast WaveStability in Nuclear Explosion. Albuquerque:
Mission Res. Corp.
Stellingwerf, R. F. 1990b. Low Intensity
Laser Ablation. Albuquerque: Mission
Res. Corp.
Stellingwerf,
R. F., Campbell, P. 1990.
Hyperveloeity
Impact Modelling Usin
9
SPH. Albuquerque: Mission Res. Corp.
Stellingwerf, R. F., Peterkin, R. E. 1990.
Smooth Particle Magnetohydrodynamics.
Albuquerque: Mission Res. Corp.
Synge, J. L. 1957. The Relativistic
Gas.
Amsterdam: North-Holland
Thompson, M. C. 1984. Post Newtonian
Rotating Core Collapse Models. PhD
thesis. MonashUniv.
Weinberg, S. 1972. Gravitation and Cosmology. New York: Wiley
Wood, D. 1981. MNRAS194:201
Wozniakowski, H. 1991. Bull. Am. Math.
Soc. 24:185
Zurek, W., Benz, W. 1986. Ap. J. 308:123

Annu. Rev. Astro. Astrophys. 1992.30:543-574. Downloaded from arjournals.annualreviews.org


by Lund University Libraries, Head Office on 01/15/08. For personal use only.

You might also like