0% found this document useful (0 votes)
115 views84 pages

Fluid Mechanics

This document provides an overview of fluid mechanics concepts relevant for astrophysics. It describes the microscopic origins and macroscopic descriptions of fluids and plasmas. Key concepts covered include the fluid equations, hydrodynamics, magnetohydrodynamics, gas dynamics, instabilities, and numerical methods for computational fluid dynamics.

Uploaded by

a.c.
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)
115 views84 pages

Fluid Mechanics

This document provides an overview of fluid mechanics concepts relevant for astrophysics. It describes the microscopic origins and macroscopic descriptions of fluids and plasmas. Key concepts covered include the fluid equations, hydrodynamics, magnetohydrodynamics, gas dynamics, instabilities, and numerical methods for computational fluid dynamics.

Uploaded by

a.c.
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/ 84

Fluid Mechanics

for Astrophysicists
MAUCA Fundamental Course 2018 – Course Notes

Instructor:
Oliver HAHN
[email protected]
Contents

1 From Microscopic Particles to the Fluid Equations 3


1.1 Describing many particles in physics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 Levels of description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Collisions between particles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.1 Binary Collisions and the Collision Integral . . . . . . . . . . . . . . . . . . . . 8
1.2.2 The Maxwell-Boltzmann distribution . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.3 H-theorem and Entropy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.2.4 The Moment Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2 Hydrodynamic Equations and Phenomenology 18


2.1 Ideal Hydrodynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.1 Local Thermodynamic Equilibrium . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.2 The Equations of Ideal Hydrodynamics . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.3 The fluid velocity field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.1.4 Gravity and hydrostatic equilibrium . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Transport Phenomena and Non-Ideal Hydrodynamics . . . . . . . . . . . . . . . . . . . 24
2.3 Application: Viscous accretion disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.3.1 The origin of disks and basic disk dynamics . . . . . . . . . . . . . . . . . . . . 27
2.3.2 Accretion Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.4 Gas Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.4.1 Acoustic Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.4.2 Shock Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.4.3 Blast Waves and Supernovae . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.4.4 Spherical Accretion Flows and Winds . . . . . . . . . . . . . . . . . . . . . . . 38
2.5 Hydrodynamic Instabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.5.1 Convective Instability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.5.2 Perturbations at an interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.5.3 Surface gravity waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.5.4 Rayleigh-Taylor Instability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.5.5 Kelvin-Helmholtz Instability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.5.6 Jeans Instability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.6 Multi-species, radiative cooling and ionisation . . . . . . . . . . . . . . . . . . . . . . . 46
2.6.1 Average treatment of multi-species gases . . . . . . . . . . . . . . . . . . . . . . 46
2.6.2 The cooling function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.6.3 Ionisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.7 Time scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.8 Turbulence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

3 Plasmas and Magnetohydrodynamics 53


3.1 Charged particles in Astrophysics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.1.1 Astrophysical Plasmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.1.2 Particle Acceleration in Astrophysics . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2 Many particles in a plasma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.2.1 The Vlasov-Maxwell equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.2.2 Debye shielding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

1
3.2.3 The two-fluid model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.3 Basic Magnetohydrodynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.3.1 The Fundamental Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.3.2 Hydromagnetic Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.3.3 Magnetic Buoyancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

4 First steps in Computational Fluid Dynamics 68


4.1 Discretising the fluid equations – Eulerian and Lagrangian schemes . . . . . . . . . . . 68
4.1.1 The fluid equations in an Eulerian frame . . . . . . . . . . . . . . . . . . . . . . 68
4.1.2 The fluid equations in a Lagrangian frame . . . . . . . . . . . . . . . . . . . . . 69
4.2 A simple finite difference Eulerian method . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.2.1 Finite difference discretisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.2.2 Test problem: a convergent flow developing a reflected shock wave . . . . . . . 70
4.2.3 Artificial viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4.2.4 Finite Volume and Riemann solvers . . . . . . . . . . . . . . . . . . . . . . . . . 73
4.3 Smoothed-particle Hydrodynamics (SPH) . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.3.1 Kernel density estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.3.2 Pressure force in SPH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.3.3 Test problem: a convergent flow developing a reflected shock wave . . . . . . . 79

2
Chapter 1

From Microscopic Particles to the


Fluid Equations

1.1 Describing many particles in physics


The study of the dynamics of fluids (or gases) concerns itself with a macroscopic description of a large
number of microscopic particles. It thus has to start with a repetition of what is typically called statistical
physics. The laws we shall derive will describe large ensembles of particles. The trajectories of individual
particles thus cannot be followed due to their sheer number and the mechanistic description will turn
into a statistical one. At the same time, while the motion of an individual particle does not play a role,
in all cases, however, the microscopic properties of the particles will be reflected in the properties of
the statistical ensemble. Such properties are e.g. whether the particles carry an electric charge, whether
they have internal degrees of freedom (such as excited atomic or molecular states), whether they carry
a mass or not (e.g. photons), whether they often scatter off each other and also whether we should treat
them as classical particles or as quantum mechanical objects. We will start by formalising these ideas
first, before we turn to describing the dynamics of ensembles.

1.1.1 Levels of description

Level 0: the quantum world

As quantum mechanics tells us, fundamentally, all particles are really quantum mechanical objects. This
means that they are described by a wave function, which we can e.g. write as ψ(x, t). The probability
of finding the particle at position x is then given by p(x, t) = ψ ∗ (x, t) ψ(x, t). At the same time, the
de Broglie wavelength λ of such a particle of typical momentum p is

h h
λ= ≈√ , (1.1)
p 3mkT
where k is the Boltzmann constant. In this expression, we have used that the typical velocity v of a point
particle of mass m in an ensemble of N particles to which we assign a temperature T is N2 mv 2 = 32 N kT .
If the number density of particles is given by n, then the mean distance between particles is of order

3
` ≈ n−1/3 . The condition that particles on average have a separation much larger than their de Broglie
wavelength (so that the wave functions are non-overlapping) becomes then

hn1/3
√  1. (1.2)
3mkT
When this condition is satisfied, each quantum particle can be treated like a classical particle and we
can safely neglect quantum mechanical effects in our macroscopic description. Typical quantum me-
chanical objects in astrophysics are white dwarfs and neutron stars, which cannot be described in terms
of classical mechanics alone.

Exercise 1 Verify whether quantum effects are important in a gas of electrons in a white dwarf, the core
of the Sun, or the interstellar medium in our Milky Way. Find the numbers for the respective densities on
the internet and use eq. (1.2) to make the point.

The classical limit of quantum mechanics is usually stated in terms of Ehrenfest’s theorem. It simply
states that the expectation values for the position and momentum of a wave function follow the classical
equations of motion if the potential energy changes by a negligible amount over the dimensions of the
wave packet. In that limit, we can thenR fully describe the description
R in terms of an evolution of the
expectation values, which are hxi = ψ ∗ xψ d3 x, and hpi = ψ ∗ (−i~∇) ψ d3 x. We thus get

d hxi hpi d hpi


= , = − h∇V i . (1.3)
dt m dt

Level 1: the classical world – individual particles

In those cases, in which we can neglect quantum mechanical effects, the motion of individual parti-
cles is governed by the classical equations of motion (1.3). In the case of an ensemble of N particles
(x1 , . . . , xN , p1 , . . . , pN ), we would have separate equations for all particles, i.e. 2N equations in to-
tal. If the motion of each particle occurs in d dimensions, the state of the system is fully described by
2 × d × N numbers. Describing the system in this way is stating that any given state is given by a
unique point in a 2dN -dimensional phase-space Γ, where Γ ⊂ R2dN . The motion of the system is then
governed by standard Newtonian dynamics, such that we can use Hamilton’s equations to write their
motion as
∂H ∂H
ṗi = − ẋi = . (1.4)
∂xi ∂pi
The Hamiltonian H = H(x1 , . . . , xN , p1 , . . . , pN , t) is usually a function of all the coordinates, mo-
menta and time of the form
XN
H= p2i /2mi + V. (1.5)
i=1

While this description is appropriate in some cases (reasonably small N , or simple interaction potential
V ), generally solving for the individual trajectories of particles is neither possible nor practical, since
for N → ∞ the dimensionality of the space and the number of equations to be integrated becomes
infinite. The motion of such classical particles can be shown in phase space (see Fig. 1.1 for the phase
space of a single particle) where certain characteristics of the system become more apparent.

4
x p p

2 1 3 3 1

3 1 3 2 2
2
t t x

Figure 1.1: The phase space of a harmonic oscillator (a mathematical pendulum here): The motion of
the pendulum (a single ’particle’) is described either by the graphs of the position x(t) and momentum
p(t) over time, or by the combination of the two into phase space (right-most panel) where both position
and momentum are shown and time corresponds to a certain point on the closed curve. A periodic orbit
corresponds to a closed curve.

Level 2: the distribution function and the collisionless Boltzmann equation

In order to maintain a meaningful limit as the number of particles becomes very large (formally N →
∞), one reduces the number of dimensions to only 2 × d and introduces the notion of a phase-space
density or distribution function f (x, p, t). Formally, this can be achieved by the notion of a statistical
ensemble. The idea is that when N is very large, we can have many possible microscopic realisations, in
terms of different points in Γ-space, that are not relevantly different when viewed from a macroscopic
point of view. What is important is only how many of the particles of the total system occupy a certain
volume in position and velocity space dd x dd p in the sense of an average over ensembles, not how
exactly they do that. So instead of talking about the positions and velocities of individual particles,
we simply express everything in terms of the density of points f (x, p, t) in a reduced 2d-dimensional
phase-space, or µ-space. Then f (x, p, t) dd x dd p is the expected number of particles in a small volume
of phase-space at time t centred at point (x, p). This limit

δN
f (x, p, t) = lim with δV → dn x dn p (1.6)
δV →0+ δV
is really a physical limit in the sense that we want that δV is a volume that is much smaller than the
volume of the system, but still contains a large enough number of ensemble particles.
We will now derive how this density evolves over time. To see this, we will investigate how the phase-
space density changes along the trajectory of one of the microscopic particles. Let us pick one of the
microscopic particles randomly, say a particle i. Between time t and time t + δt, it will have moved from
(xi , pi ) to (xi + δxi , pi + δpi ). Such a derivative along a trajectory, we call substantial derivative or
Lagrangian derivative and denote it by the symbol D/Dt. We then have

Df f (xi + δxi , pi + δpi , t + δt) − f (xi , pi , t)


= lim . (1.7)
dt δt→0 δt
Using Taylor-expansion, we can write up to first order

∂f ∂f ∂f
f (xi + δxi , pi + δpi , t + δt) = f (xi , pi , t) + δxi · + δpi · + δt , (1.8)
∂x xi ∂p pi ∂t

5
where the vertical lines indicate that the derivatives have to be taken at that point. Substituting this
into eq. (1.7), we have
Df ∂f ∂f ∂f
= + ẋi · + ṗi · . (1.9)
Dt ∂t ∂x xi ∂p pi

Background: Continuity equation

We now have to introduce the notion of a continuity equation by means of Gauss’ theorem. Let us
consider the number of particles in some volume V of our 2d-dimensional phase space and let us
use µ = (x, p) as a coordinate in this 2d-dimensional space. Then we have
Z
NV (t) = f (µ, t) dV (1.10)
V

as the number of particles occupying the volume V . This number will change as particles enter
or leave the volume element. Let us denote by ω the 2d-dimensional flow field in phase-space,
i.e. ω = (ẋ, ṗ). This might seem complicated, but it is really just the rate at which particles
move, i.e. the normal velocity v = p/m in the first d coordinates, and the rate at which particles
accelerate, e.g. −∇V in the case of a long-range potential, in the second d coordinates, as given by
the Hamiltonian equations of motion. The rate at which particles enter or leave the volume V is of
course proportional to the density of particles at the boundary of the volume times the component
of ω normal to the surface of the boundary, i.e. we can write
Z I

f (µ, t) dV = − f (µ, t) ω · dS, (1.11)
∂t V ∂V

where the integral on the right-hand-side is over the closed boundary ∂V of V and where dS is
the outward-pointing normal vector at each point of the volume surface boundary.
We can now apply Gauss’ theorem (also sometimes called Ostrogradsky’s theorem, or divergence
theorem) to this surface integral in order to turn it into a volume integral. Indeed we find
Z I Z

f (µ, t) dV = − f (µ, t) ω · dS = − ∇µ · (f (µ, t) ω) dV. (1.12)
∂t V ∂V V

Note that we have added an index µ to the ∇ operator. This means that it is not the usual 3-
dimensional operator but contains 2d-derivatives with respect to all components of x and p.
If we fix the volume V in time, we can pull the time derivative into the integral and since we have
made no further assumptions about the volume V , the equation has to hold also directly for the
integrand, i.e.

f (µ, t) + ∇µ · (f (µ, t) ω) = 0. (1.13)
∂t
This equation will always hold as long as the number of particles in the system is conserved, i.e.
as long as no particles are created in the system or disappear from it.

We already notice that equations (1.11) and (1.13) bear some resemblance. We note that we can rewrite
the second (divergence) term in eq. (1.13) as

∇µ · (f (µ, t) ω) = f (µ, t) ∇µ · ω + ω · ∇µ f (µ, t) (1.14)

Next we notice that the 2d-dimensional velocity ω at the position of the particle that we fixed, i.e.

6
p p

conservation of volume

V
change of f in interior
= flux through surface

∂V
x x

Figure 1.2: (Left:)The number of particles in a volume V of phase space changes depending on how many
particles flow into and out of this volume. (Right:)Illustration of Liouville’s theorem: the phase space
density is conserved along particle trajectories, which implies that the phase space density behaves
like an incompressible flow in phase space, i.e. in the figure, the blue area remains conserved but may
become arbitrarily complicated.

at the location (xi , pi ) in phase-space, must be given by the phase-space velocity of that particle, i.e.
ω(xi , pi ) = (ẋi , ṗi ). Since we assumed that the system is governed by Hamiltonian dynamics, we must
∂H ∂H
be able to express this velocity using the Hamiltonian of the system, i.e. ω = ( ∂p i
, − ∂xi
). This implies
that the divergence of the phase space velocity at the location of the particle i must be

∂2H ∂2H
(∇µ · ω)|(xi ,pi ) = − = 0. (1.15)
∂xi ∂pi ∂pi ∂xi
This means that the phase-space velocity field ω is divergence-free! The motion of the distribution
function f in phase-space is thus incompressible.
Under this condition, the continuity equation simplifies exactly to eq. (1.7), and we have simply

Df ∂f ∂f ∂f
= + ẋi · + ṗi · = 0. (1.16)
Dt ∂t ∂x xi ∂p pi

This is the collisionless Boltzmann equation: the phase-space density f is conserved along the Hamilto-
nian trajectories. Note that the Hamiltonian nature of the system as well as the conservation of particles
in the system are necessary for it to hold. It is usually expressed without recurrence to actual particle
trajectories by replacing ẋ = p/m and ṗ = F, where F(x) is some external force field given by the
gradient of the potential:
Df ∂f p
= + · ∇x f + F · ∇p f = 0, (1.17)
Dt ∂t m
it is then clear that f is conserved along the trajectories fulfilling the canonical Hamiltonian equations
of motion.
But why have we called this equation “collisionless”? The reason is that we lost the possibility to describe
the interaction between individual particles when going from Γ-space to µ-space! The binary interaction
of two particles at positions (x, p) and (x0 , p0 ) in Γ-space cannot trivially be expressed in µ-space, since
it has no longer a notion of single particles. We have to introduce some additional formalism to treat
the case of such binary interactions in a statistical sense in µ-space, which we will do next.

7
Exercise 2 Investigate the evolution of N particles (xi , pi ) with i = 1 . . . N in 1+1 dimensional phase
PN
space µ. We can think of them having the distribution function f (x, p, t) = i=1 δD (x − xi (t)) δD (p −
pi (t)) and we know that f is conserved along the Hamiltonian trajectories, so that we can just evaluate
those trajectories. First, let the particles move in a harmonic potential V = mx2 . Start all the particles
at initial positions xi = 0 and give the particles energies between some E0 and E0 + ∆E of your choice.
How do these particles move in phase space? Now add a non-harmonic perturbation to the potential, i.e.
use V = m(x2 + x4 ) with some small  > 0. How does the motion in phase space change?
[Hint: First, write down the equations of motion of the particles, i.e. ẋi = . . . , ṗi = . . . , then integrate
them numerically and plot the points (xi , pi ) for all particles at a few select times. For the time-integration
of Hamiltonian systems, it is best to use symplectic integrators, which preserve phase-space volume. The
leap-frog algorithm is the simplest of this kind.]

1.2 Collisions between particles


In order to introduce the notion of binary interactions, or collisions, between particles, we will assume
that the interactions occur only over a small distance a in space (which we can think of as the particle
size). We can then quantify how collisional such a system would be by comparing the mean distance
n1/3 between particles to this interaction radius. A system for which na3  1 has on average much
fewer than one particle per interaction volume and we shall call it a dilute gas. In general, we can
estimate the mean distance between collisions of particles to be given by the mean free path
1
λ≈ . (1.18)
πna2
You will later show yourself why the mean free path takes this form.

1.2.1 Binary Collisions and the Collision Integral

From the collisionless to the full Boltzmann equation

Collisions between individual particles can be incorporated into our µ-space description by realising
that the phase space density in this more general case is no longer conserved along particle trajectories.
Instead, particles can exchange momentum and energy among each other. This effect can be incorpo-
rated by adding a collision term to the right-hand-side of the Boltzmann equation (1.16) so that we get
 
D df Cin − Cout
f (x, p, t) = =: 3 3 , (1.19)
Dt dt coll. d xd p
where Cin and Cout are the rates at which particles are scattered into and out of a volume element
d3 x d3 p of µ-space. Note that for now this is just a way of expressing what we intend to do. Let us look
at the details of a collision next.

Description of elastic binary collisions

We will concern ourselves here only with the case of elastic binary collisions, i.e. collisions in which

8
1. only two particles participate at any given time,
2. the particle number remains constant (i.e. no particles disappear or new ones appear),
3. the total momentum and the total energy of the two particles are conserved in the collision.
In a dilute gas, the rate of three-body interactions is significantly lower than that of two-body interac-
tions, so that we can safely ignore it here and the above assumptions are reasonable ones. An example of
non-elastic collisions would be if the particles had internal degrees of freedom (such as internal atomic
energy levels or rotational degrees of freedom of molecules that can be excited), which would require a
more sophisticated treatment than what we are set out to do here.
We thus assume a binary interaction between two particles described by a their respective points in Γ-
space as (x1 , p1 ) and (x2 , p2 ) which get scattered into new states (x01 , p01 ) and (x02 , p02 ). If the collision
is elastic, then also momentum and energy are conserved, i.e.

p1 + p2 = p01 + p02
2 2 2 2
|p1 | |p2 | |p01 | |p0 |
+ = + 2 . (1.20)
2m 2m 2m 2m
The two momenta of the final state have together six degrees of freedom. With these two conservation
equations, we fix four of them. The fifth one is fixed if the interaction force betweeen the two particles
is purely radial. In that case also the angular momentum is conserved and the collision will remain in
the plane defined by the two incoming momentum vectors. The sixth and final condition comes from
the nature of the interaction between the particles and is related to the angle by which the collision
changes the individual momenta, which is thus typically termed the deflection angle.
For our statistical analysis, we are happy with a probability for deflection under various angles. This
notion is captured by the idea of a differential scattering cross-section, which can be calculated for any
given interaction potential. Since it is a statistical concept, it does not make sense to apply it to single
interactions. Let us thus instead consider two beams of particles, the first of particle number density
n1 with a momentum p1 , the second with a density n2 and momentum p2 . Obviously, a particle in the
second beam sees a flux j2 = n1 |p2 − p1 | /m of particles from the first beam. We are interested in the
number of collisions δnc per unit volume and unit time, which scatter particles from the second beam
into a solid angle dΩ. Clearly, this number must be proportional to the number density of particles n2 in
the second beam. It must also be proportional to the incoming flux j to which the particles are exposed
and the solid angle dΩ into which they scatter:

|p2 − p1 |
δnc = σ(p1 , p2 |p01 , p02 ) n2 n1 dΩ. (1.21)
m
The monstrous constant of proportionality is the differential scattering cross-section. Since we are
describing elastic collisions, energy is conserved and thus the entire process must be reversible so that

σ(p01 , p02 |p1 , p2 ) = σ(p1 , p2 |p01 , p02 ). (1.22)

Note that the cross-section has dimensions of an area and directly reflects the area through which an-
other particle has to pass so that scattering occurs.

Exercise 3 Derive the expression for the mean free path given in eq.(1.18) by approximating the cross
section σ through the scale a on which interactions occur.

9
The collision integral

We now want to evaluate the collision terms in equation (1.19). Let us begin with the out-scattering term
Cout . Let us assume that the first beam of particles has their momentum vectors within d3 p1 around
p1 , and the second within d3 p2 around p2 . The number density of particles in the first beam is then
n1 = f (x1 , p1 ) d3 p1 , while that in the second is n2 = f (x2 , p2 ) d3 p2 . The term Cout can then be
obtained by multiplying δnc by d3 x (meaning that we localise the collisions in a region of space d3 x
around x) and then integrating over all Ω and p2 . We thus find
Z Z
|p2 − p1 |
Cout = d3 x d3 p1 d3 p2 dΩ σ(p1 , p2 |p01 , p02 ) f (x, p1 , t) f (x, p2 , t). (1.23)
m
The in-scattering term Cin is just given by considering a process in the other direction, where particles
start with the primed momenta and end up in the un-primed ones. The rate of collisions is then simply

|p02 − p01 |
δn0c = σ(p01 , p02 |p1 , p2 ) f (x, p01 , t) f (x, p02 , t) dΩ d3 p01 d3 p02 . (1.24)
m
The conservation equations (1.20) for momentum and energy imply that

|p2 − p1 | = |p02 − p01 | . (1.25)

We now use that d3 p1 d3 p2 = d3 p01 d3 p02 if the interaction can be described by a Hamiltonian (this
follows from Liouville’s equation). All this lets us rewrite the in-scatter collision term as
Z Z
|p2 − p1 |
Cin = d3 x d3 p1 d3 p2 dΩ σ(p1 , p2 |p01 , p02 ) f (x, p01 , t) f (x, p02 , t). (1.26)
m

We can now insert all this into equation (1.19), after setting without loss of generality p := p2 , then the
full equation using the collisionless Boltzmann equation for the left-hand side is
Z Z
Df ∂f p |p − p1 |
= + · ∇x f + F · ∇p f = d3 p1 dΩ σ(Ω) [f 0 f10 − f f1 ] , (1.27)
Dt ∂t m m
where we have simplified the notation by using f := f (x, p, t), f1 := f (x, p1 , t), f 0 := f (x, p0 , t),
f10 := f (x, p01 , t) and σ(Ω) := σ(p, p1 |p0 , p01 ). While the first four are really just abbreviations, the
last definition for σ(Ω) makes use of the fact that σ is in the end only a function of the scattering angle
Ω between the incoming momenta p and the outgoing p0 . This equation is the Boltzmann equation and
describes the evolution of the distribution function f of a statistical set of particles under a long-range
force field F and elastic binary particle collisions with a differential scattering cross-section σ(Ω).

1.2.2 The Maxwell-Boltzmann distribution

Next we will derive the Maxwell-Boltzmann distribution, which is the equilibrium distribution function
that a uniform gas will attain. For this we assume uniformity by neglecting the configuration space
coordinate x and we will also neglect the effect of any long-range force field, i.e. we set F = 0. This
does not mean that the analysis that follows applies e.g. only in the absence of gravitational forces, we
need to only require that the length-scale over which the gravitational potential changes is much larger
than the mean free path of the particles so that collisions clearly dominate over long range forces. If
the gas is in equilibrium, then clearly Df /Dt = 0, which makes the left-hand-side of equation (1.27)
vanish. Note that this only means that we make the distribution function non-evolving in µ-space, the

10
microscopic particles will still move around and scatter off of each other. For the Boltzmann equation
to still hold, also the right-hand-side has thus to vanish which implies that

f f1 = f 0 f10 . (1.28)

This means that in-scattering and out-scattering will be in exact balance. Since due to the assumed
uniformity of the system, the distribution functions are independent of x and due to the stationarity
also independent of t, we can write f = f (p). Taking the logarithm of the balance condition (1.28), we
find
log f (p) + log f (p1 ) = log f (p0 ) + log f (p01 ). (1.29)
We shall now make a simple Taylor expansion of this logarithm of the equilibrium distribution function.
Up to second order, it must have the form

log f (p) = C0 + C1 · p + C2 p2 + O(p3 ). (1.30)

We note that this contains terms proportional to the momentum and to the kinetic energy1 , so that equa-
tion (1.29) simply reflects energy and momentum conservation in collisions (and higher order terms must
vanish as they are not assumed to be conserved). The expansion up to second order can be rewritten in
a more convenient form as
log f (p) = −B(p − p0 )2 + log A, (1.31)
where A, B and p0 are constants that can be easily expressed in terms of the various coefficients C. We
can now get rid of the logarithm to find the equilibrium solution for the distribution function as
 
f (p) = A exp −B(p − p0 )2 . (1.32)

We can even go further and determine the constants A and B. We know that the number density of
particles is just Z  π 3/2
n = d3 p f (p) = A , (1.33)
B
where we have just carried out the integral to get the second expression. We can also understand the
meaning of p0 as the average momentum of the particles. This can be calculated by formally computing
the mean as R 3 Z
d p pf A  
hpi = R 3 = d3 p p exp −B(p − p0 )2 =: p0 . (1.34)
d pf n
Clearly the remaining constant B takes the role of the inverse of a dispersion in momentum around
the mean momentum p0 . In order for our form to be consistent with the usual form of the Maxwell-
Boltzmann distribution, we just have to set B = (2mkT )−1 to find
 
−3/2 (p − p0 )2
f (p) = n (2πmkT ) exp − , (1.35)
2mkT

where now the temperature alone expresses the dispersion of momenta around the mean momentum.
This can be easily seen by computing the second moment of f as
R 3

2 2 d p p2 f
p − hpi = R 3 − p20 = 3mkT. (1.36)
d pf
1 Note that in full generality, the coefficient C would be a matrix but due to the assumed homogeneity and isotropy of the
2
system, we can just assume that the second order term is given by the trace alone.

11
We note that after dividing by 2m, the first term on the left-hand side reflects the mean kinetic energy
of a particle in the system, while the second term reflects the kinetic energy due to a particle with the
mean momentum p0 , the difference thus must describe the mean internal energy Eint of a particle in
the system. We see immediately that

2 2
p − hpi 3
Eint := = kT, (1.37)
2m 2
while we call the kinetic energy associated with the mean motion the bulk kinetic energy
2
hpi p2
Ekin := = 0. (1.38)
2m 2m

Exercise 4 Derive the expression for the relation between the momentum dispersion and the internal
energy given in equations
D (1.36) and
E (1.37) step by step. Before embarking on this quest, also prove the
2
2
well-known relation (p − hpi) = p2 − hpi .

We note that we can obtain certain characteristics of the macroscopic system by taking moments of the
distribution function f . The zeroth moment gives us the particle number density n, the first one the
mean momentum p0 and the second gives us the internal energy Eint . We will see much more of this
in later parts of this lecture.
Background: Moments of a Distribution

You have certainly encountered the notion of moments


R in basic statistics (or in statistical physics).
For a general probability distribution p(x), with p(x) dx = 1, one calls
Z
µ := hxi = x p(x) dx, (1.39)

the mean. This is also the first “raw” moment of the distribution p(x). The second raw moment
Z

2
x = x2 p(x) dx (1.40)

is normally not used directly, but instead one uses the central second moment, which is
D E Z

2 2 2
σ = (x − hxi) = (x − hxi) p(x) dx = x2 − hxi
2
(1.41)

and this central second


R moment is called
R the “variance” of the distribution. The third and fourth
raw moments are x3 p(x) dx and x4 p(x) dx, respectively. They are usually given however in
a normalised form known as the skewness S and kurtosis K of the distribution:
Z Z
1 3 1 4
S= 3 (x − hxi) p(x) dx, and K = 4 (x − hxi) p(x) dx. (1.42)
σ σ
For a Gaussian distribution, S = 0 and K = 3. In fact, a Gaussian distribution is completely
described by its mean and its variance. All higher moments can be expressed in terms of these two
quantities.

12
1.2.3 H-theorem and Entropy

The Maxwell-Boltzmann distribution that we have derived in the previous section is the equilibrium
solution of the Boltzmann equation. For any initial phase space distribution f , we expect that if collisions
occur frequently enough, the Boltzmann equation will drive it towards the equilibrium state described
by the Maxwell-Boltzmann distribution. We will demonstrate this next.
The essence of this exercise is the notion of irreversible processes and the generation of entropy. While
our Hamiltonian mechanics on the microscopic level (i.e. in Γ-space) is completely reversible, we will
see that the macroscopic description in ω-space is not. This can be shown using Boltzmann’s infamous
H-theorem.
For this, we define the quantity Z
H := d3 p f log f. (1.43)

The H-theorem states that if the distribution function f evolves according to the Boltzmann equation,
and external forces are absent, then H for a uniform gas can never increase with time, i.e.
dH
≤ 0. (1.44)
dt
The time evolution of H can be easily shown to be given by the rather long expression
Z
dH ∂f
= d3 p (1 + log f )
dt ∂t
Z Z Z  
1 |p − p1 | 0 0 f f1
= d3 p d3 p1 dΩ σ(Ω) (f f1 − f f1 ) log 0 0 . (1.45)
4 m f f1
Since for any real numbers a and b the relation (b − a) log(a/b) ≤ 0 holds, the H-theorem is proven. So
now we have to understand why this theorem indeed tells us that collisions will drive the distribution
function towards a Maxwell-Boltzmann distribution.
0 0
First, we see that in equilibrium H is constant in time, i.e. dH
dt = 0, since in equilibrium f f1 = f f1 ,
as we have shown above. Therefore, if we start with an arbitrary distribution function f far from
equilibrium, the system will have a value of H that is much larger than its equilibrium value. If we are
away from equilibrium, the right-hand side of equation (1.45) must be negative and so the system keeps
decreasing its value of H until it reaches equilibrium, in which it will follow the Maxwell-Boltzmann
distribution. The usual entropy of the system is given by
S = −kH + constant. (1.46)

1.2.4 The Moment Equations

In all our derivation we have assumed that the number of particles, their momentum and their energy
are conserved. We have also seen at the end of Section 1.2.2 that these three characteristics of the system
can be expressed as moments of the distribution function. They will allow us to go to the hydrodynamic
description later by reducing further the complexity of our system. While the Boltzmann equation de-
scribes the evolution of the phase-space density f in six-dimensional µ-space, by taking moments we
reduce the dimensionality to three dimensions since we integrate out the momentum space dimensions.
Instead of one equation describing the evolution of a six-dimensional field, we will next obtain a se-
quence of coupled equations that describe only three-dimensional fields. This comes at the price of
multiple equations.

13
The moments

Unlike before, we will now no longer assume that the system is homogeneous, i.e. the mean momen-
tum is allowed to change over space, and so are the number density and the internal energy. We can
summarise the first three moments and their meaning in form in which they are commonly used in
hydrodynamics:
Z
n(x, t) := d3 p f (x, p, t) is the number density of particles (1.47)
Z
1
v(x, t) := d3 p p f (x, p, t) is the velocity field (1.48)
mn
Z
1 m
e(x, t) := d3 p p2 f (x, p, t) − v2 (x, t) is the internal energy field. (1.49)
2mn 2
In addition, one usually defines the mass density field ρ(x, t) := m n(x, t).
And of course one can continue to take higher order moments. There is another property that is some-
what hidden in how we wrote down the moments above. The zeroth moment, the number density, is
obviously a scalar. The first moment, the velocity (or momentum), is a vector. The second moment, the
energy, as we wrote it is again a scalar. But in full generality, instead of p2 , we could have multiplied
two different Cartesian components of the momentum pi pj , which is a so-called tensor product and
can also be written as p ⊗ p. This shows that the second moment is actually a rank-2 tensor (think
matrix), and when we wrote it as a scalar, we actually implicitly took the trace of it. The third moment
can be built from the tensor product of three momenta p ⊗ p ⊗ p and would thus be a rank-3 tensor,
and so on... This sounds complicated but it will become clear shortly why this is and what it means. So
the more simple and formal way would be to write (using Cartesian components)
Z
n(x, t) := d3 p f (x, p, t) 0th moment (1.50)
Z
πi (x, t) := d3 p pi f (x, p, t) 1st moment (1.51)
Z
Πij (x, t) := d3 p pi pj f (x, p, t) 2nd moment . . . (1.52)

The first term – rate of change

We now would like to derive evolution equations for these moments. We shall see that one can obtain
these by taking moments of the Boltzmann equation. Let’s start with the first term of the Boltzmann
equation, the simple ∂f /∂t. For the zeroth moment, we would just integrate it over momentum space,
and we find Z Z
∂f ∂ ∂n
d3 p = d3 p f = , (1.53)
∂t ∂t ∂t
which is just the rate of change of the zeroth moment. Quite obviously, we can do this for all moments
by first multiplying with as many p as we need and then integrating over momentum space. For the
first moment we thus get
Z Z
∂f ∂ ∂π ∂ρv
d3 p p = d3 p pf = = , (1.54)
∂t ∂t ∂t ∂t
where we have used that p and t are independent, and also that ρ = mn in the last equality. So this
gives us the rate of change of a momentum density. And of course this applies to all higher moments as
∂Π
well so that the second moment is logically ∂tij .

14
The second term – advection
p
The second term of the Boltzmann equation is m ·∇x f . For the zeroth moment, we just have to integrate
it over momentum space, i.e.
Z Z
3 p 1 1
d p · ∇x f = ∇x · d3 p pf = ∇x · π = ∇x (nv), (1.55)
m m m
where in the first equality we have used that x and p are independent and so the gradient can be pulled
out of the integral and then just inserted definitions. We note that that in the term for the zeroth moment,
the first moment appears (because there is already a p in the equation).
Let’s look at what happens when we take the first moment of this term. We look at the component i of
it Z Z
pj ∂f 1 ∂ 1 ∂Πij
d3 p pi = d3 p pi pj f = , (1.56)
m ∂xj m ∂xj m ∂xj
and we see, as before, we get the spatial derivative of the next higher moment. The second moment is
then obviously given by
Z Z
pk ∂f 1 ∂ 1 ∂Γijk
d3 p pi pj = d3 p pi pj pk f = , (1.57)
m ∂xk m ∂xk m ∂xk
where Γijk is the third moment of the distribution function.

The third term – acceleration

The next term in the Boltzmann equation is only present if we have long-range or external forces F(x)
(i.e. we assume that the force does not depend on the momentum) and is given by F · ∇p f . Once again,
for the zeroth moment, we just integrate over it and find
Z Z I
d3 p F · ∇p f = F · d3 p ∇p f = F · dSp f = 0, (1.58)

where we have employed Gauss’ theorem in momentum space in the second equality so that we inte-
grate over a boundary at infinity in momentum space. Obviously f should vanish there, and so this
term must be zero.
Let us next look at the first moment of this term, which can be shown to be (see exercise)
Z  
∂f
d3 p pi Fj = −nFi . (1.59)
∂pj

The second moment turns out to be


Z  
∂f
d3 p pi pj Fk = −(Fi πj + Fj πi ). (1.60)
∂pk

This is just a tensorial version of the potential energy change as the particle is accelerated by the force2 .
2 This can be seen by taking the fundamental Newton relation F = ma = ṗ . Since we are looking at a quadratic energy term,
i i i

we want something like ∂t (pi pj ) = pi Fj + pj Fi . Now what’s the relation with the potential energy? Let’s assume F = m∇φ
where φ is the potential, then the potential energy Ep will change if the particle moves a distance dx by dEp = m∇φ · dx. If we
look at the rate at which it changes, i.e. dEp /dt, we get dEp /dt = m∇φ · v = F · v which is just the trace of our expression.
So, this just quantifies the rate of change in potential energy.

15
The last term – collisions
h i
The final term we have in the Boltzmann equation is the collision term ∂f ∂t . Its nature when we take
coll
moments is to tell us whether the collisions conserve the respective moment, since formally it behaves
exactly like the first term (i.e. we can just pull the integral inside the bracket and the derivative). Since
in our case of simple binary elastic collisions all first three moments are conserved, i.e. particle number,
momentum and energy, they all vanish in equilibrium. If one would treat particle processes that violate
one of these (e.g. reactions between particles that do not conserve the particle number, internal atomic
degrees of freedom that can absorb energy) then this term has to be included as a source/sink term
to accommodate this. Equivalently, if one can not assume that collisions are in equilibrium, and the
underlying distribution function is a Mawell-Boltzmann, then additional terms (“non-ideal” terms) will
arise. We will have a look at them shortly.

Putting it all together

Let us put now all the pieces together. The evolution equation for the first three moments are

∂n 1 ∂πi
+ = 0
∂t m ∂xi
∂πi 1 ∂Πij
+ = Fi n (1.61)
∂t m ∂xj
∂Πij 1 ∂Γijk
+ = Fi πj + Fj πi
∂t m ∂xk
..
.

These equations fully describe the conservation of mass, momentum and energy (after taking the trace
of the third eq.) in our system. They are however not a closed system since the equation for one
moment depends on the next moment, so that we have an infinite hierarchy of equations. Without
further assumptions this is thus not tractable. We will see how we can close this hierarchy next.

Exercise 5 (1) Give explicitly the relation between the formal moments and the more intuitive physical
quantities, i.e. what is the relation between v and π, and between e and Πij ?
(2) Show that the first moment of the acceleration term takes indeed the form given in eq. (1.59). [Hint:
try rewriting the term in the integral as three terms by rearranging the derivatives. Then you have to use
again Gauss’ theorem to eliminate one term. Do you know why it can be eliminated?]

Exercise 6 Show that the Maxwell-Boltzmann distribution function in terms of the energy E(p) =
(p − p0 )2 /2m of a particle of momentum p is given by
r  
E −3/2 E
f (E) = 2 (kT ) exp − . (1.62)
π kT

Draw a graph of the distribution of particle energies for three different temperatures. [Hint: use that
f (E)dE = f (p)d3 p.]

Exercise 7 Fermi-Dirac Statistics and White Dwarfs

16
When quantum effects are important, the Maxwell-Boltzmann distribution function is not the equilibrium
distribution function. In that case, the distribution function depends on quantum mechanical properties of
the particle. If the particle is a spin- 12 particle (e.g. proton, neutron, electron), then Fermi-Dirac statistics
applies and the distribution of energies is given by
1
f (E) = h i , (1.63)
E−µ
exp kT +1

where µ is the so-called chemical potential. It reflects the fact that new particles cannot be added to the
system at arbitrary energiesIn the limit of very low temperatures, the chemical potential becomes the
Fermi energy EF , i.e. µ → EF as T → 0. This is called the fully-degenerate limit.
(1) How does the distribution function f (E) behave in this limit for energies above and below the Fermi
energy EF ? Can you explain why Fermions in the fully-degenerate case must have such a chemical
potential µ = EF ? How does the Maxwell-Boltzmann distribution f (E) behave in the limit T → 0?
(2) The Fermi energy for N spin- 12 particles of mass m in a volume V can be calculated to be
 2/3
~2 3π 2 N
EF = . (1.64)
2m V

Electrons in white dwarf stars form such a degenerate electron gas due to the high density. Assume a
white dwarf star of mass MWD = 0.5M and radius RWD = 0.01R . What is its Fermi energy (give
the result in units of eV). Estimate the velocity of the electrons with an energy equal to the Fermi energy
in the white dwarf? Do you think that this velocity has any physical implications? [Hint: in order to
perform this calculation, you need to calculate the electron number density ne = N/V . Assume that
you can convert as ne = ρ/(2mH ), between mass density and electron density with mH the mass of a
hydrogen atom, assume also that the density is constant with radius.]

17
Chapter 2

Hydrodynamic Equations and


Phenomenology

As we have seen in Chapter 1, collisions that conserve energy, momentum and the particle number will
always drive any arbitrary distribution function towards the Maxwell-Boltzmann distribution function
by virtue of the H-theorem. At the same time, we have seen that by taking moments of the Boltzmann
equation, we can derive a hierarchy of evolution equations for these moments, given in eq. (1.61). We
will next derive the equations of ideal hydrodynamics. These equations one obtains under the assump-
tion of local thermodynamic equilibrium, which is simply the assumption that in every point in space,
the distribution function is given by a Maxwell-Boltzmann distribution, however allowing that the tem-
perature T (x) to vary spatially. This leads to a truncation of the hierarchy after the second moment,
the set of equations becomes closed and thus mathematically tractable.
Next we will introduce the extension to non-ideal hydrodynamics. For this we will relax the local ther-
modynamic equilibrium condition by allowing the distribution to be close to but not exactly a Maxwell-
Boltzmann distribution. We will see that under this condition, new phenomena appear such as thermal
conduction and viscosity.
Finally, in this chapter we will look at the hydrodynamic phenomenology arising from these equations,
such as shock waves and fluid instabilities.

2.1 Ideal Hydrodynamics

2.1.1 Local Thermodynamic Equilibrium

Under the assumption that collisions occur frequently, i.e. the mean free path of the particles is much
smaller than typical length scales of the system, one can assume that in every point x, the collisions
have driven the momentum distribution function to a Maxwell-Boltzmann distribution with a spatially
varying temperature T (x) and mean momentum p0 = mv(x). This allows us to close the hierarchy
of equations. We already calculated the moments of the Maxwell-Boltzmann distribution, so we can
just restate them here in spatially varying form. The number density is obviously just n(x), and all
higher moments can be expressed in terms of the number density, the mean fluid velocity v(x) and the

18
temperature T (x):

πi (x) = ρvi (2.1)


kT
Πij (x) = mρ(vi vj + δij ) (2.2)
 m 
kT
Γijk (x) = m2 ρ vi vj vk + (vi δjk + vj δik + vk δij ) , (2.3)
m

where δij is the Kronecker-δ symbol (which is defined to be equal to 1 if i = j and zero otherwise).
These are actually more general than we need. To simplify our expressions somewhat, we will try to
make use of the thermodynamic notions of internal energy and pressure.

Pressure from kinetic theory

Pressure is defined to be the internal resistance of a gas (or fluid) to isotropic compression. For an
adiabatic process (i.e. we perform the compression slowly enough so that the entropy remains constant),
the pressure P is given by the amount of energy dE required to change the volume of the fluid by an
amount dV , i.e. dE = −P dV . By dimensional arguments, P must thus be an energy density.
Pressure is a result of the random motions of particles. If we were to contain a gas at rest in a fixed
volume, then the particles would exert an outward force onto the surface of the container. Let us look
at the left boundary in x-direction of the container. The number of particles hitting the face dA+x in a
time dt will of course be n2 v̄x dA dt if v̄x is the typical RMS velocity of a particle in the x-direction. The
factor 21 comes from the fact that half of the particles will be moving to the right, and the other half to
the right, towards the surface element. A particle of momentum mv̄x will be reflected by the wall and
change its momentum to −mv̄x , the change of momentum is thus −2mv̄x . This imparts an impulse
Fx dt on the wall over a time dt given by
n
F+x dt = dA+x v̄x dt 2mv̄x = mnv̄x2 dA+x dt (2.4)
2
Assuming the isotropic random velocity distribution of the Maxwell-Boltzmann distribution, the RMS
hp2 i−hpi2
velocity along only one dimension will be v̄x2 = 13 m2 . Since pressure is defined as the force
exerted per unit area of the surface we have
n
2 2
P+x = mnv̄x2 = ( p − hpi ) = nkT =: P. (2.5)
3m
Obviously this does no longer depend on how the surface was oriented, the pressure on any surface
will be given by this expression since the random motions are completely isotropic in the Maxwell-
Boltzmann case. In full generality, we can however also define a tensor Pij as

Πij πi πj
Pij := − , (2.6)
m ρ
which in the Maxwell-Boltzmann case takes the trivial form Pij = nkT δij = P δij . We can thus simply
write
Πij Π Πij 1 3 1
= ρvi vj + Pij and = tr = ρv2 + P =: ρv2 + ρ, (2.7)
m 2m 2m 2 2 2
3 kT
where  := 2 m is the internal energy per unit mass associated with a single particle (for a monoatomic
ideal gas).

19
2.1.2 The Equations of Ideal Hydrodynamics

We can insert the results from the previous section now into the moment equations to finally obtain the
hydrodynamic equations in terms of three conservation equations for the mass density, the momentum
density and the energy density (for which we simply consider only the trace of the equation for the
second moment). This yields the so-called conservative form of the hydrodynamic equations
∂ρ ∂
+ (ρvi ) = 0 (2.8)
∂t ∂xi
∂ ∂ ∂P
(ρvi ) + (ρvi vj ) = − + ρFi (2.9)
∂t ∂xj ∂xi
∂e ∂ ∂
+ (evi ) = − (P vi ) + ρFi vi , (2.10)
∂t ∂xi ∂xi
where e = ρ + 12 ρv 2 is the total energy density. The first equation is just the continuity equation, the
second is the momentum equation and the third is an equation for the total energy. They can also be
written (after some transformations) in primitive form, which means that the equations are expressed
in terms of the ’primitive’ variables ρ, v and  instead of the conserved quantities ρ, ρv and e. One then
finds
∂ρ ∂
+ (ρvi ) = 0 (2.11)
∂t ∂xi
∂vi ∂vi 1 ∂P Fi
+ vj = − + (2.12)
∂t ∂xj ρ ∂xi m
∂ vj ∂ P ∂vj
+ = . (2.13)
∂t ρ ∂xj ρ ∂xj
Here, the second equation is called the Euler equation, and the third is called the internal energy equa-
tion.These sets of equations are mathematically equivalent and can be used interchangeably, depending
on which ones are easier to apply in the problem at hand.
Background: Conservation laws

We note however that conservation laws, i.e. equations of the form

∂X
+ ∇ · FX = SX , (2.14)
∂t
where X is a conserved quantity, FX the associated flux (of the form FX = Xv) and SX the
source or sink term for quantity X (i.e. the rate at which X is produced or destroyed in every
point) admit an integral form. By integrating over an arbitrary volume V which is fixed in space
and time (i.e. does not move), we find by applying Gauss’ theorem
Z Z Z

dV X = − dV ∇ · FX + dV SX
∂t V
ZV Z V
= − dS · FX + dV SX . (2.15)
∂V V

This means that they can always be written in a form where the rate of change of X in a fixed
volume V is given by the integral of the flux over the boundary of that volume and the amount of
X produced or destroyed in that volume. Writing the equations in this integral form is typically
I

20
Background: Conservation laws (cont)

called the weak form of the hydrodynamic equations, while writing them in the differential form
is also called the strong form of the equations. The weak form allows one to study e.g. cases in
which the quantity X shows a discontinuity in space as we will see when we discuss shocks.

The adiabatic equation of state

As you might have noticed, the system of equations is now closed and we have three primitive variables
ρ, v and . The pressure P is related to  through ρ and T . We will now express this relation more
directly in order to write also the pressure in terms of primitive variables. First, by eliminating the
temperature from the definitions of P and , we have
2
P = ρ (2.16)
3
for our ideal gas of monoatomic particles. The first law of thermodynamics states that the internal
energy changes as
dU = −P dV + T dS + dQ, (2.17)
where the first term on the right corresponds to the change of energy due to a change in volume at
fixed entropy, the second corresponds to the change due to a change in entropy and the third is due to
heat transfer into or out of the system. For a system in isolation dQ = 0. For an adiabatic process also
dS = 0 so that we only have dU = −P dV . The total internal energy in the system is
3 3 3
U= N kT = P V so that dU = (P dV + V dP ) (2.18)
2 2 2
Since we had in the adiabatic case dU = −P dV we have
   
5 3 P 5 V
− P dV = V dP which yields log = − log , (2.19)
2 2 P0 3 V0

where we have performed a separation of variables followed by an integration in the second equation.
Since we can write ρ = (N m)/V , we immediately find the form

P0
P = K ρ5/3 , with K = 5/3
. (2.20)
ρ0

This is the so-called polytropic equation of state and is usually written in the more general form P =
Kργ , where γ is called the polytropic exponent. Gases and fluids for which the pressure is a function
of only the density, i.e. P = P (ρ) are barotropic fluids. For an ideal monoatomic gas we have γ = 5/3,
but this form is indeed more general and can account even for gases that behave differently. One finds,
e.g., γ = 1 for an isothermal gas, which is a gas for which the temperature does not increase when it is
compressed, or one finds γ = 4/3 for a gas of relativistic particles such as photons.
It is important to note that it is only valid for adiabatic processes, i.e. as long as the entropy remains
constant. However, if we inject entropy into the system while not changing the volume, then the system
will only alter the pre-factor K to a new value K 0 . After the entropy has been raised, it will evolve along
the new adiabatic relation P = K 0 ρ5/3 .

21
a. compression/expansion b. shear c. rotation
✓ ◆ ✓ ◆
1 1 @vi @vj 1 1 @vi @vj
(r · v) ij + (r · v) ij
3 2 @xj @xi 3 2 @xj @xi

∂vi
Figure 2.1: The velocity deformation tensor Dij = ∂v j
, indicating the spatial change in the velocity
field, can be decomposed into three components: a.) the compression/expansion part, given by the
mean of the diagonal elements, 13 Dii , b.) the velocity shear, given by the trace-free symmetric part of
Dij , and c.) the rotation, given by the anti-symmetric part of Dij . Both shear and rotation preserve the
volume of a fluid element and thus cannot act to increase the density.

2.1.3 The fluid velocity field

While a seemingly innocent quantity, the field v(x) describes the mean velocity with which the fluid
(or gas) moves at every point in space. It is the relevant quantity describing the dynamics of the fluid.
An import quantity that can be obtained from the fluid velocity field v(x) is the velocity divergence
tensor given by
∂vi
Dij = (2.21)
∂xj
which combines all possible combinations of velocity-components with directional derivatives. We have
already encountered its trace which is one third of the scalar velocity divergence and describes the local
compression or expansion of a fluid element

tr D = ∇ · v. (2.22)

It is the quantity that is responsible for a change of density in compressible flow, and vanishes for in-
compressible flow. More generally, we can decompose D into its symmetric part Λij and antisymmetric
part Ωij
   
1 ∂vi ∂vj 1 ∂vi ∂vj
Dij = Λij + Ωij , with Λij = + , Ωij = − . (2.23)
2 ∂xj ∂xi 2 ∂xj ∂xi

The symmetric part, once one subtracts its trace, describes the shearing of fluid elements at fixed volume
(see Figure 2.1), which does not alter the density. The antisymmetric part represents the rotation of
fluid elements at fixed volume and can be rewritten as a vector since it only has three independent
components. This vector is the vorticity of flow

ω := ∇ × v = ijkΩjk . (2.24)

By taking the curl of the velocity equation, one can derive the vorticity equation which describes the
time evolution of the vorticity

∂ω 1
+ ∇ × (ω × v) = 2 (∇ρ) × (∇P ) + ∇ × F. (2.25)
∂t ρ

22
ω

ω ω ω
v v

a. vortex stretching b. vortex tilting

Figure 2.2: The effect of the fluid velocity field on a vortex tube (a line of parallel vorticity). Panel a:
vortex stretching occurs when the flow is compressed in a direction perpendicular to the vorticity ω, as
a consequence, the vorticity increases, but its overall density remains constant. Panel b: vortex tilting
occurs when the velocity field has shear. As a result, the vortex tube undergoes an associated rotation.

If the force is conservative, such as the gravitational force, i.e. if F = −m∇φ, then the force term
vanishes. In fact, one can show that this equation implies that vorticity is also a conserved quantity and
can only be produced by the so-called baroclinc term, which is the first term on the right-hand-side of
the equation. For a barotropic fluid, and in particular for a polytropic equation of state P ∝ ργ , this
term will always vanish so that in this case vorticity is manifestly conserved if the flow is also adiabatic
(i.e. no entropy is generated anywhere, which is however not true when shocks occur as we will see
later).
When we can assume a barotropic flow under a conservative force, then the vorticity equation reduces
simply to
∂ω
+ ∇ × (ω × v) = 0. (2.26)
∂t
After a few vector calculus manipulations and using that ∇ · ω = 0, one can write this as

= (ω · ∇)v − ω(∇ · v). (2.27)
Dt
This means that vorticity is simply transported by the flow but two additional components arise: the first
term on the right represents vortex stretching, the second represents vortex tilting. Vortex stretching
means that if a vortex tube (given by ω) is stretched along its axis (i.e. when the flow is divergent along
this direction), then the vorticity must increase. Vortex tilting means that if the fluid velocity component
perpendicular to the vortex tube changes along the tube, then this will tilt the vorticity. These concepts
are important when one studies turbulence.

2.1.4 Gravity and hydrostatic equilibrium

When one considers the self-gravity of the gas, then the density distribution ρ produces a gravitational
force F = −m∇φ where the gravitational potential φ is related to the density through Poisson’s equa-
tion
∆φ = 4πGρ. (2.28)
In full generality for a self-gravitating system, Poisson’s equation has to be solved along with the fluid
equations in order to have a complete system including the gravitational force.

23
A self-gravitating system of finite temperature can be in so-called hydrostatic equilibrium. This is the
condition that all velocities vanish, i.e. u = 0 and ∂u/∂t = 0. From the Euler equation (2.12) it
immediately follows that in hydrostatic equilibrium
1
∇P = −∇φ. (2.29)
ρ
Due to the isotropic pressure in an ideal gas, such a system will usually assume a spherical symmetry
(unless there would be rotation, which would however require non-vanishing velocity). In spherical
symmetry, P and ρ are only functions of the radial coordinate r and the differential operators become
∂ ∂ ∂
∇ = er ∂r and ∆ = r12 ∂r (r2 ∂r ), where er is the radial unit vector. This combines to the equation of
hydrostatic equilibrium in spherical symmetry
∂φ 1 ∂P
=− , (2.30)
∂r ρ ∂r
which after inserting the gravitational force and using Poisson’s equation becomes
 
1 ∂ r2 ∂P
= −4πGρ. (2.31)
r2 ∂r ρ ∂r
Assuming a barotropic fluid with equation of state P = Kργ , this equation can be transformed into the
famous Lane-Emden equation which was an early model of stars in the 19th century.
For isothermal gas (T =const.), the adiabatic exponent is γ = 1 so that P = Kρ. In this case, the solution
to the equations of hydrostatic equilibrium can be shown to be the (singular) isothermal sphere profile,
given by
K
ρ(r) = . (2.32)
2πGr2

Exercise 8 Profile of an atmosphere


For this exercise, let us assume that we can locally treat the earth as flat, with z the upward direction. For a
point above the surface of the Earth, let us assume that the gravitational field is uniform and only directed
in the z-direction. We shall neglect all other complications. Using F = −mgez and assuming that the
gas is isothermal (T =const.), calculate the equilibrium density profile ρ(z) in the direction perpendicular
to the surface.

2.2 Transport Phenomena and Non-Ideal Hydrodynamics


One might question whether the assumption of perfect local thermodynamic equilibrium is always
valid for a system. In systems in which the time between collisions is not negligibly short compared to
the dynamical time scales (or equivalently, the mean free path is not negligibly small compared to the
scales on which density and temperature of the system change, one might want to include the effect of a
small departure from the Maxwell-Boltzmann distribution function. We thus go back to the Boltzmann
equation and use the following perturbation to the distribution function

f (x, p, t) = fM (x, p, t) + δf (x, p, t), where δf  fM , (2.33)

and fM is the Maxwell-Boltzmann


h i distribution. Since for the Maxwell-Boltzmann case, the collisions
∂fM
are in equilibrium, we have ∂t = 0. On the other hand, since δf shall be small, we can assume
coll

24
Df /Dt = DfM /Dt, so that we finally have
 
∂fM p ∂δf
+ · ∇x fM + F · ∇p fM = . (2.34)
∂t m ∂t coll

We now apply a trick. Since we know that fM only depends on the first three moments, which we can
express in terms of n, v and T , we can write fM = fM (n, v, t), then the time derivative of fM must
have the form
∂fM ∂fM ∂n ∂fM ∂T ∂fM ∂vi
= + + (2.35)
∂t ∂n ∂t ∂T ∂t ∂vi ∂t
and the spatial gradient must be

∂fM ∂fM ∂fM


∇fM = ∇n + ∇T + ∇vi . (2.36)
∂n ∂T ∂vi
Some steps of calculation (which you can try as an exercise) then gives
     
1 ∂δf 1 ∂T m 2 5 m 1 2
= vi v − + Λij vi vj − v δij , (2.37)
fM ∂t coll T ∂xi 2kT 2 kT 3

where  
1 ∂vi ∂vj
Λij = + . (2.38)
2 ∂xj ∂xi
We then take again the moments of Boltzmann equation, as we have done before, we see that the
perturbation δf can be parameterised in terms of two minor modifications: an additional term in the
energy equation,

∂ρ ∂
+ (ρvi ) = 0 (2.39)
∂t ∂xi
∂ ∂ ∂Pij
(ρvi ) + (ρvi vj ) = − + ρFi (2.40)
∂t ∂xj ∂xj
 
∂e ∂ ∂ ∂ ∂T
+ (evi ) = − (Pij vj ) + κ + F · (ρv), (2.41)
∂t ∂xi ∂xi ∂xi ∂xi

and the ‘pressure’ Pij is now manifestly tensorial and has the form

Pij = P δij + σij , (2.42)

where σij is the viscous stress tensor


 
1
σij = −2µ Λij − δij ∇ · v − ζδij ∇ · v. (2.43)
3

The Euler equation with included viscosity is called the Navier-Stokes equation (which can be trivially
derived by going to the primitive form of the equations). Together the set of equations is said to provide
the equations of non-ideal hydrodynamics. In summary: what has happened in our derivation from
kinetic theory is that the new fields σij and κ capture the corrections to the moment equations due to the
deviation from the Maxwell-Boltzmann distribution. They provide new physical phenomenology that
we will discuss next. Typically, the new fields derive from the collision term and have to be measured
except in extremely simple cases (such as hard sphere collisions or other relatively simple interaction).

25
Heat conduction

The new term that was added is the correction term to the energy equation of the form
 
∂ ∂T
κ (2.44)
∂xi ∂xi

and it describes heat conduction with a thermal conductivity κ, which reflects the notion that temper-
ature gradients will flatten and attempt to approach a more uniform Maxwell-Boltzmann distribution.
If one can assume that κ is a simple constant, then this term becomes κ∆T , and one can easily show
(see exercise) that in a fluid at rest (neglecting external forces and viscosity for the moment) the energy
equation can be written as
∂T 2κ
= ∆T, (2.45)
∂t 3nk

which is just the heat equation with a thermal diffusivity α = 3nk .

Viscosity

Viscosity simply modifies the pressure tensor Pij and represents a resistance of the fluid to shear and to
compression. The shear viscosity comes from a resistance of the fluid to shearing motion. The tensor
1
Λij − δij ∇ · v (2.46)
3
is just the symmetric trace-free part of the velocity gradient tensor Dij . Remembering that the trace of
the velocity gradient tensor is ∇·v and represents compression and expansion, the trace-free symmetric
part describes a shearing motion that does not change the volume. The resistance to such motion is
proportional to the shear viscosity µ and means that viscous forces will oppose such shearing motions.
It is common to define also the kinematic viscosity ν as
µ
ν= (2.47)
ρ
since µ appears in the momentum equation, there is an implicit dependence on density, which is scaled
out in the kinematic viscosity. For this reason, µ is often also called dynamic viscosity. The importance
of viscous effects in a fluid can be quantified by the dimensionless Reynolds number, which is defined
as
ρvL vL
R= = , (2.48)
µ ν
where ρ is the mass density, v is the fluid velocity, and L is a typical length scale in the system. In
Figure 2.3, you can see the effect of an increasing Reynolds number for around a body. For reasonably
high Reynolds numbers such a flow produces the so-called Kármán vortex sheet.
In addition, there can be a different kind of viscosity associated with compression and expansion, i.e.
proportional to the trace of the velocity gradient tensor. This is the bulk viscosity ζ (or sometimes called
”volume viscosity”). It vanishes for incompressible media but it can be of importance when gases are
rapidly compressed, such as in shock waves.

26
Figure 2.3: Flow around a body with increasing Reynolds number. For R & 70, the Kármán vortex sheet
develops, while for low R, the flow is completely laminar. [Image reproduced from Batchelor (1967)]

2.3 Application: Viscous accretion disks

2.3.1 The origin of disks and basic disk dynamics

Viscosity is a subdominant phenomenon in most astrophysical gas dynamics, it however plays an im-
portant role in simplified models of accretion disks around stars, planets and even black holes. For this
reason, we will discuss these systems in this section. Disks form in many astrophysical contexts: disk
galaxies, protostellar disks, circumplanetary disks, accretion disks around black holes, ... This is always
due to the same underlying principle: the material forming the disk usually starts out in some other
form, think of a dilute cloud of gas made up from more or less randomly moving gas particles. Such a
system will also have at least some angular momentum, either with respect to its own center of gravity,
or with respect to another more massive object towards which it is falling. Since angular momentum is
conserved, if the cloud collapses under its own gravity its rotational velocity must increase. Collisions
of particles in the direction perpendicular to the axis of rotation however do not change the angular
momentum, but will eventually cancel all bulk motion and convert it into internal energy. This means
that collapse of a gaseous object of nonzero angular momentum will always form an oblate structure.
If the gas is able to lose internal energy by a cooling process, this oblate object can become thinner and
thinner turning it into a disk. A disk is thus rotationally supported against gravity in its radial direction
and pressure supported in the direction perpendicular to the disk.
For a disk to be rotationally supported, it means that at all radii the gravitational force has to be balanced
by the centrifugal force which means that for a fluid element of mass m at radius r

G M (< r) m
rΩ2 m = , (2.49)
r2
where Ω is the angular velocity and M (< r) is the total mass enclosed in the radius r. If we can assume
that all the mass is exactly at the centre at r = 0, then we obtain the relation for Keplerian motion

27
around a central body of mass M r
GM
Ω= . (2.50)
r3

We will describe the disk in cylindrical coordinates (r, φ, z), so we have to re-write our fluid equations
in cylindrical coordinates. We can assume that the disk remains a perfect disk by setting vz = 0 and
∂/∂φ = 0. The gradient and the divergence operator in cylindrical coordinates are

∂ 1 ∂ ∂ 1 ∂ 1 ∂ ∂
∇ = er + eφ + ez , ∇·A= (r Ar ) + Aφ + Az . (2.51)
∂r r ∂φ ∂z r ∂r r ∂φ ∂z
For a stable perfect disk, using ideal hydrodynamics, we thus have the continuity equation

∂ρ 1 ∂
+ (rρvr ) = 0. (2.52)
∂t r ∂r
If we neglect pressure (i.e. we assume a thin disk), the Euler equation becomes

∂vr ∂vr vφ2


+ vr − = Fr (2.53)
∂t ∂r r
∂vφ ∂vφ v r vφ
+ vr + = 0. (2.54)
∂t ∂r r
R
Since the only quantity involving z is the density, we can define the surface density Σ = dz ρ and
express everything through that. The rate of mass flow in the radial direction will then be given by

Ṁ (r) = −2πrΣvr . (2.55)

This is the quantity that we are interested in since it describes the so-called accretion rate onto the
central body if we measure it at its location r = 0. The continuity equation in terms of Σ is of course

∂Σ 1 ∂
+ (rΣvr ) = 0. (2.56)
∂t r ∂r

The angular velocity is related to vφ as Ω = vφ /r. This means we can combine the continuity equation,
after multiplying by rvφ , and the Euler equation, after multiplying by r, into the single equation

∂  1 ∂ 
Σr2 Ω + Σr3 Ωvr = 0 (2.57)
∂t r ∂r
We note that this is just a conservation law for the angular momentum density ρr × v. If we integrate
this over z, then we get an angular momentum surface density

` = r2 ΣΩ. (2.58)

We can thus write


∂` 1 ∂
+ (r`vr ) = 0. (2.59)
∂t r ∂r
We now want to look for a steady state (or equilibrium) solution. For this we put the time derivatives
of equations (2.56) and (2.59) to zero and integrate with respect to the radius to find

rΣvr = C1 , and r`vr = C2 , (2.60)

28
where C1 and C2 are integration constants. We can use the first expression to find that (using eq. (2.55))

Ṁ = −2πrΣvr = −2πC1 , (2.61)


which means that for a steady state disk, the accretion rate is constant (at all radii)! The second condition,
using eq. (2.58) and (2.50) means for a non-viscous disk
√ √
C2 = r3 ΣΩvr = GM Σvr r3/2 = GM r1/2 C1 , (2.62)

which clearly cannot be constant, unless vr = 0. This is completely expected since in ideal hydrody-
namics, there is no angular momentum transport and so a steady state disk must just be a Keplerian
disk with vanishing radial velocity. We have introduced this complicated formalism in order to have
it easier with the next step we will make. We will now show that when viscosity is included, there is
indeed momentum transport, and we will get a constant non-zero accretion rate for such a disk.

2.3.2 Accretion Disks


p
The inclusion of viscosity changes the picture dramatically. Since vφ = rΩ = GM/r, fluid elements
at different radii rotate at different velocities – this is called differential rotation. This means that if there
is non-zero viscosity, the shear will be able to transport angular momentum. To demonstrate this, we
just have to add the viscous term from the Navier-Stokes equation. The viscous term that we have to
add to the Euler equation is
1 ∂ 1 ∂
(µSij ) = (νρSij ) , (2.63)
ρ ∂xj ρ ∂xj
where Sij is the trace-subtracted velocity shear tensor. Since we have to use cylindrical coordinates, we
have to express this now in those. A short calculation shows that under our assumptions that vφ and vr
are only a function of radius, after integration over z the non-viscous equation for angular momentum
conservation (2.59) becomes now
 
∂` 1 ∂ 1 ∂ dΩ
+ (r`vr ) = νΣr3 , (2.64)
∂t r ∂r r ∂r dr

where we have used the relation between vφ and Ω. For a disk in equilibrium, we thus get a new
expression for the second constant of integration C2 of the form
 
1 dΩ
r` vr − ν = C2 . (2.65)
Ω dr

We can now impose a boundary condition. A reasonable choice would be to assume that at some radius
r∗ , e.g. the surface of the accreting object, the accreting material is dragged into a rigid rotation so that
dΩ/dr = 0 at r∗ ., this determines C2 , so that we get

Ṁ 2 Ṁ p
C2 = − r∗ Ω(r∗ ) = − GM r∗ , (2.66)
2π 2π
which defines the value of this constant. Since Ω = (GM/r3 )1/2 , we have Ω−1 dΩ/dr = − 32 r. Putting
everything together, we find
  r 1/2 
Ṁ ∗
1− = νΣ. (2.67)
3π r

29
This is the famous result of Shakura & Sunyaev (1973) and it shows that the accretion rate is directly
proportional to the viscosity.
By losing angular momentum through viscosity, material is thus transported inward until it ends up in
the central object. This process is called accretion. Obviously, the energy that is lost as the material is
transported inward must go into internal energy. If we assume that the disk can effectively radiate away
all that energy, it is possible to calculate the energy in radiation that such an accretion disk produces. If
one calculates the respective term in the energy equation, and transforms it to cylindrical coordinates,
using our usual assumption one finds
 2
dE dΩ
= νΣr2 . (2.68)
dt dr
We can insert our result for the accretion rate from above as well as the definition of Ω to find the rate
at which the disk dissipates energy.
  r 1/2 
dE GM Ṁ ∗
= − 4π 3 1 − (2.69)
dt 3 r r
If we assume that all this energy is radiated away, we can calculate the total luminosity (i.e. energy per
unit time) of the disk by integrating over the whole disk, i.e. from r∗ to infinity as
Z ∞ 
dE GM Ṁ
L= − 2πr dr = . (2.70)
r∗ dt 2r∗
This means that the disk has a luminosity that is proportional to the gravitational potential at the surface
of the accreting object as well as the accretion rate. An important argument by Shakura & Sunyaev was
that the physical viscosity of the disk gas is not high enough to explain the luminosities of disks around
X-ray binary stars. They suggested that the viscosity is strongly boosted by a high level of turbulence
in the disk. More recent results demonstrate that magnetic fields in the disk can trigger turbulence that
then leads to a viscosity high enough to explain the values necessary.

2.4 Gas Dynamics


In this section, we will now study phenomena occurring in compressible inviscid flow. Almost all situ-
ations that we encounter in astrophysics are in this regime, so the phenomenology we develop will be
applicable to a wide variety of astrophysical systems.

2.4.1 Acoustic Waves

In compressible flows, perturbations in the flow propagate with the speed of sound as we will see next.
To demonstrate this, we will consider a homogeneous gas of density ρ0 = const and pressure P0 =
const at rest, i.e. v0 := 0 in the absence of any external force. Suppose now that we introduce a
small perturbation in pressure P1 (x, t) and density ρ1 (x, t). These perturbations will give rise to a
perturbation to the velocity field v1 (x, t). Inserting the perturbed fields into the continuity and the
Euler equation, we find
∂ρ1 ∂
+ [(ρ0 + ρ1 ) v1,i ] = 0 (2.71)
∂t ∂xi
∂v1,i ∂v1,i 1 ∂P1
+ v1,j = − . (2.72)
∂t ∂xj ρ0 + ρ1 ∂xi

30
We will now assume that the perturbations are small compared to the unperturbed solution. For this
we assume that the unperturbed fields, ρ0 and P0 are O(1) and the perturbed fields ρ1 , P1 and u1 are
O(), where   1. We then see that products of two unperturbed fields are also O(1), the product
of an unperturbed field with a perturbed one becomes O() while the product of two perturbed fields
becomes O(2 ), which means that the latter will be much smaller than the previous ones. As long as
  1, we can thus neglect terms of order 2 . This procedure is called linearisation. The linearised set
of equations is thus
∂ρ1 ∂v1,i
+ ρ0 = 0 (2.73)
∂t ∂xi
∂v1,i ∂P1
ρ0 = − . (2.74)
∂t ∂xi
We note that we can combine these two equations into one single equations if we take the time derivative
of the first and the spatial derivative of the second, i.e.
∂ 2 ρ1 ∂ 2 v1,i
2
+ ρ0 = 0 (2.75)
∂t ∂t∂xi
∂ 2 v1,i ∂ 2 P1
ρ0 = − (2.76)
∂xi ∂t ∂x2i
∂ 2 ρ1 ∂ 2 P1
⇒ − =0 (2.77)
∂t 2 ∂x2i
This equation already almost looks like a wave equation, if not both ρ1 and P1 appeared. However, we
can find a relation between the two since for a barotropic gas P = P (ρ) and thus

dP dP
P0 + P1 = P (ρ0 ) + ρ 1 ⇒ P1 = ρ1 =: c2s ρ1 , (2.78)
dρ ρ0 dρ ρ0
p
where we denote the square-root of the derivative as cs := dP/dρ at density ρ0 . Since ρ0 = const.,
we can assume that also cs = const. Then our equation (2.77) simply becomes
 2 
∂ 2 2
− cs ∇ ρ1 = 0, (2.79)
∂t2
which is clearly a wave equation with a wave propagation speed cs . It describes the propagation of
acoustic sound waves with sound speed cs . For a polytropic equation of state, we can compute the
adiabatic sound speed to be
s r
q
γ−1 P0 γk
cs = γKρ0 = γ = T0 , (2.80)
ρ0 m
m
where the temperature T0 = k P0 /ρ0 .

Since the wave equation is linear, as in electrodynamics, the principle of a superposition of plane waves
holds, and the solutions are of the form
X
ρ1 (x, t) = ρ̃1 (k) exp [i(k · x − ωt)] , (2.81)
k

where ρ̃1 (k) is the amplitude of the wave with wave number k. A substitution of this into the wave
equation yields a dispersion relation
ω 2 = c2s k2 . (2.82)

31
Figure 2.4: The steepening of a sinusoidal velocity perturbation due to the non-linear terms in the
Burgers’ equation. At time t = 1, a vertical gradient has developed, and at later times, fluid elements
from the left and the right will have moved into the same central region, leading to a velocity field
v(x, t) that is no longer single-valued. This shows the origin of shock waves.

Acoustic waves are thus non-dispersive, i.e. as long as the perturbations are small, they will just prop-
agate as waves that maintain their shape as they travel through the homogeneous unperturbed gas.
Before we end this subsection, we note that we of course also have a linear wave equation for the
velocity perturbations of the form
 2 
∂ 2 2
− cs ∇ v1 = 0. (2.83)
∂t2

It is easy to show that the velocity wave and the density wave have a phase shift of π/2 with respect to
each other.

2.4.2 Shock Waves

In the previous section we assumed that the perturbations are small. Naturally, when they cannot
be considered small, the analysis in terms of linear acoustic waves does no longer apply and a new
phenomenon – shock waves – emerges.

Wave steepening

We have seen that velocity perturbations propagate as acoustic waves when they are small. When they
can no longer be considered small, we will have to consider the full Euler equation. Let us neglect the
pressure term for the moment, then in one dimension, the Euler equation is simply given by

∂v ∂v
+v = 0. (2.84)
∂t ∂x

32
This equation is called Burgers’ equation. We can understand how the fluid moves in this case through
the method of characteristics that we have in fact employed multiple times before. To this end, we want
to follow a fluid element as it moves on a trajectory x(t) with the fluid (the “characteristic curve”) so
that ẋ(t) = v. As before, this leads us to the Lagrangian derivative, i.e. calculating the total derivative
of v(x(t), t) gives us
Dv ∂v ∂v
= + (ẋ · ∇)v = + (v · ∇)v, (2.85)
Dt ∂t ∂t
which means that Burgers’ equation is equivalent to
Dv
= 0, (2.86)
Dt
which simply means that in the absence of pressure forces, every fluid element keeps moving with its
initial velocity. We had seen in the section before that for small perturbations, the fluid velocities just
follow a wave equation, which means that they have e.g. solutions of the form v ∝ sin (k0 (x ∓ cs t)),
so that the characteristics are straight lines of the form x ± cs t = const.
A general perturbation of this form (i.e. no longer assuming that it be small), will however undergo
wave steepening due to the nonlinear terms in the Euler equation as soon as the pressure force drops.
In Figure 2.4, we show the evolution of a sinusoidal velocity perturbation in the absence of pressure as
described by Burgers’ equation. Fluid elements at higher velocity will start to overtake the slower ones
leading to a steepening of the wave until at t = 1, a vertical velocity gradient emerges. It is clear that
the steepening is a results of the non-linear term vj ∂j vi . At later times, the fluid velocity field becomes
multi-valued in the absence of pressure forces. Generally however, the pressure will be nonzero and, as
we will see next, a shock wave develops in that case.

Shock Waves and Jump Conditions

We have just seen how a smooth initial condition can steepen into a solution that will develop a discon-
tinuity. In the theory of discontinuous solutions of the hydrodynamic equations, one expresses such a
situation in terms of a left and a right state, where both states are assumed to initially have constant den-
sity, velocity and pressure, i.e. we have a left state SL = (ρL , PL , vL ) and a right state SR (ρR , PR , vR ).
Assuming that both vL > 0 and vR > 0 and vL > vR a shock will develop. The left state is typically
called the upstream state, the right one the downstream state. The solution to the fluid equations under
discontinuous two-state initial conditions is called a Riemann problem. Remembering the conservative
form of the fluid equations, it is clear that even if the fluid variables are discontinuous, the fluxes of the
conserved quantities must match at the interface between the two states, i.e.

ρ L vL = ρR v R (2.87)
2 2
PL + ρ L vL = PR + ρ R vR (2.88)
EL vL = ER vR . (2.89)

We now introduce the shock velocity vS and require that the fluxes through the moving shock front are
given by the difference of the respective left and right fluxes (in fact this can be rigorously derived for
general conservation laws), i.e.

vs (ρR − ρL ) = ρ R vR − ρ L vL (2.90)
2 2
vs (ρR vR − ρL vL ) = = (PR + − (PL +
ρR v R ) ρL v L ) (2.91)
     
1 2 PR 1 2 PL
vs (ER − EL ) = ρR vR eR + uR + − ρ L vL e L + u L + . (2.92)
2 ρR 2 ρL

33
Figure 2.5: Schlieren image of a jet plane flying at supersonic velocity over the Mojave desert. Clearly
seen can be seen a sequence of compressive shock waves and associated rarefaction waves, also the
turbulent wake left by the jet engine is revealed. [Image credit: NASA Photo]

These conditions, relating pre- and post-shock quantities are called Rankine-Hugoniot conditions. Some
algebra then gives us the shock velocity as
s  
γ + 1 PR
vs = vL + c L 1 + −1 , (2.93)
2γ PL
p
where cL = γPL /ρL is the (upstream) sound speed.
For a stationary shock, i.e. vs = 0, one finds the simpler conditions

ρR (γ + 1)M 2
= (2.94)
ρL 2 + (γ − 1)M 2
PR 2γM 2 − (γ − 1) vL
= , where M = (2.95)
PL γ+1 cL
is the Mach number of the shock, i.e. the fluid velocity in units of the sounds speed. For a shock wave
one always has M > 1. It is easy to see that in the limit of M → ∞, the relation between pre- and
post-shock density becomes
ρR γ+1
→ , (2.96)
ρL γ−1
which for an ideal monoatomic gas (γ = 5/3) becomes ρR /ρL → 4 meaning that the maximum com-
pression in such a gas due to the shock is 4. Figure 2.5 shows the shock waves produced by a jet moving
at supersonic speed i.e. M > 1, through air. The shock waves it produces propagate away from the
plane with the shock velocity, which one can assume to be constant. This phenomenon thus produces

34
Figure 2.6: The SNR 0509-67.5 supernova remnant in the Large Magellanic Cloud. Its diameter is about 7
parsecs, and it is expanding at about 5000 km/s. The explosion was seen ca. 400 years ago on earth. The
green-blue haze shows X-ray emission from the post-shock heated gas, while the red shows emission
in optical wavelengths from the actual shock front. [Image Credit: X-ray: NASA/CXC/SAO/J.Hughes et
al, Optical: NASA/ESA/Hubble Heritage Team (STScI/AURA)]

a cone-shaped shock front trailing from the plane. The shock front has an angle of sin µ = M −1 with
respect to the vector pointing against the direction of motion.
The general Riemann problem in three variables (ρ, P, v) in fact can produce three wave-like features:
(1) a shock wave, (2) a rarefaction wave, and (3) a contact discontinuity. Discussing them is however
beyond the scope of this introductory course.

2.4.3 Blast Waves and Supernovae

An important example for a shock wave phenomenon is given by the solution for a blast wave such
as the one produced in a supernova explosion. A supernova explosion occurs at the end of the life of
massive stars when nuclear fusion processes die out, after which the star collapses and then undergoes
an explosion due to runaway nuclear fusion in the highly compressed stellar matter, expelling the stellar
material to large radii into the interstellar medium. A simple model for such an explosive process is thus
by assuming that a large amount of energy E is suddenly released in a point at r = 0 which is then left
to expand into the surrounding medium of density ρ. One can further assume that the pressure in the
ambient medium is negligible compared to the pressure inside the blast wave, i.e. we set P = 0 in the
ambient medium.
There is an elegant way to solve this problem by exploiting that its solutions are self-similar, i.e. ex-
pressed in the right quantities, the solutions at later times are just scaled versions of the solution at

35
early times. Such self-similar solutions can usually be easily found by dimensional analysis. We are
interested in the location of the shock front rs as a function of time t. The only free parameters in the
problem are the energy of the blast E and the density of the ambient medium ρ. The units of energy
are mass × length2 × time−2 and those of density are mass × length−3 . We can thus obviously combine
E, ρ and t in exactly one way to obtain a length-scale. Let us call this length-scale λ and we have

λ = (Et2 /ρ)1/5 (2.97)

We were originally interested in the radius r(t) of the radial location of a shell of gas inside the spherical
blast. In order to obtain a self-similar solution, we will now express this radius in units of λ, i.e. we
write  ρ 1/5
r
ξ= =r . (2.98)
λ Et2
For the solution to be self-similar, we must have ξ = const, so that we can label every shell by its value
of ξ = ξ0 in that case and obtain the self-similar solutions
 1/5
Et2
r(t) = ξ0 . (2.99)
ρ

The velocity of expansion of the blast wave is then simply


 1/5
drs 2 E
vs (t) = = ξ0 . (2.100)
dt 5 ρt3

We thus have that the blast wave expands as t2/5 and the velocity of the blast decreases as t−3/5 . This
self-similar solution for a spherical blast wave is called a Sedov-Taylor blast wave and was independently
found by Sedov and Taylor in the 1940s in the context of the explosions of atomic bombs. It turns out that
these self-similar solutions are excellent approximations throughout the early phases of both nuclear
explosions as well as supernova explosions (see Figure 2.6). In order to find the equations determining
the radial dependence of ρ, v and P in terms of the self-similar variable ξ.
Let us take the Rankine-Hugoniot condition for a stationary shock wave (i.e. it applies in the frame of
the shock) and assume a very high Mach number. Then we can apply eq. (2.95) in the limit M → ∞,
i.e. we can write
 
γ+1 2 2
ρR = ρL , vR = vs , PR = ρL vs2 . (2.101)
γ−1 γ+1 γ+1

We now want to express the solutions in terms of dimensionless self-similar functions, i.e. we write
 2
r r
ρ(r, t) = ρR ρ(ξ), v(r, t) = vR v(ξ), P (r, t) = PR P (ξ). (2.102)
rs rs

Using the jump conditions, we can then write

γ+1 4 r 8ρL  r 2
ρ(r, t) = ρL ρ(ξ), v(r, t) = v(ξ), P (r, t) = P (ξ). (2.103)
γ−1 5(γ + 1) t 25(γ + 1) t

We also have the boundary condition that at the shock front location ξ = ξ0 and ρ(ξ0 ) = v(ξ0 ) =
P (ξ0 ) = 1.

36
Figure 2.7: Analytic solutions for a Sedov-Taylor blast wave for a γ = 5/3 gas. The radial coordinate
is given relative to the position of the shock front, the fluid quantities are in units of their respective
values at the shock front location.

Next we have to rewrite the hydrodynamic equations in spherical symmetry

∂ρ 1 ∂ 
+ 2 r2 ρv = 0 (2.104)
∂t r ∂r
∂v ∂v 1 ∂P
+v = − (2.105)
∂t ∂r ρ ∂r
 
∂ ∂ P
+v log γ = 0 (2.106)
∂t ∂r ρ

in terms of the ξ. We first use that we can write


∂ 2ξ d ∂ ξ d
=− , and = . (2.107)
∂t 5 t dξ ∂r r dξ
This finally gives us a set of ordinary differential equations
 
dρ 2 d
−ξ + 3ρv + ξ (ρv) = 0 (2.108)
dξ γ+1 dξ
   
2 dv 4 dv 2γ−11 dP
−v − ξ + v 2 + vξ = − 2P + ξ (2.109)
5 dξ 5(γ + 1) dξ 5γ+1ρ dξ
 
d P 5(γ + 1) − 4v
ξ log γ = . (2.110)
dξ ρ 2v − (γ + 1)

This means by exploiting the self-similar nature of the solution, we have reduced the set of partial
differential equations (i.e. in terms of r and t) to a set of ordinary differential equations in terms of
the single independent variable ξ! In fact, Sedov has shown that this system in fact has an analytical
solution, which is however rather lengthy to write down. Alternatively, one can simply solve the set
of ordinary differential equations above by numerical means. The solutions in the case of an ideal
monoatomic gas are shown in Figure 2.7. One sees nicely how the gas is compressed by the maximum

37
ratio of 4 in the shock. The shock-front itself is very narrow, the density asymptotes to zero towards
the origin of the explosion, while the shock produces a constant pressure behind it and an almost linear
velocity profile.

Exercise 9 Using only the self-similar ansatz for the position and velocity of the shock, we can calculate
from the evolution of the shock front propagating from a supernova. Assume a typical 1M star, which
injects about 1051 erg into the interstellar medium of density ρ ∼ 2 × 10−24 g/cm3 . Assuming ξ0 ∼ 1 for
the location of the shock front, show that
 2/5
t
rs (t) ≈ 0.3 pc, (2.111)
1 year

give the respective expression for the shock velocity vs (t), and calculate also the temperature of the gas at
the shock front (assume the mean particle mass is m ≈ 1.3mH , where mH is the mass of a hydrogen atom)
and in the interior (read off the ratio between the asymptotic interior pressure and the peak value from
Figure 2.7). What are the values after 103 and 104 years? These are approximate calculations that work
well at early times, what physical process do you think should be included in a more realistic calculation?

2.4.4 Spherical Accretion Flows and Winds

We will consider in this Section one more simple case that is often used as a basis in more sophisticated
astrophysical models of the accretion of material onto a central mass or the spherical ejection of mass
from a spherical object. They are mathematically equivalent and just differ in the sign of the velocity,
being directed either inward or outward. The spherical accretion model is somewhat academic since
it assumes that angular momentum is small enough in order to prevent the formation of an accretion
disk. Despite this simplification, this model is commonly used as a crude estimate of the accretion rate
of objects, in particular black holes, from an ambient medium.
For this analysis, we will consider a steady spherical flow, so that the radial velocity of the gas is in-
dependent of time. Under such conditions, the mass flux (either inward or outward) must be given by

Ṁ = 4πr2 ρv = const, (2.112)


which we can insert into the spherical continuity equation, for which with ∂ρ/∂t
2 1 dρ 1 dv
+ + =0 (2.113)
r ρ dr v dr
The Euler equation in spherical coordinates after setting ∂v/∂t = 0 and assuming that the gravitational
field is produced by a central mass M
dv dp GM
ρv = − − 2 ρ. (2.114)
dr dr r
Using that dp/dr = c2s dρ/dr, we can eliminate ρ and find the single equation
 
c2s dv 2c2 GM
v− = s − 2 . (2.115)
v dr r r
We see that v = cs (i.e. the point where the flow transitions from sub- to super-sonic) at a radius
GM
r = rc = . (2.116)
2c2s

38
This point is called the sonic point since the gas is transonic there. If we assume that the sound speed
is constant, we can immediately find the transonic mass flux to be

G2 M 2
Ṁ = ±4πrc2 ρcs = ±π ρ. (2.117)
c3s

If the central mass has a velocity V with respect to the ambient medium, then the transonic flux is
changed to be
G2 M 2
Ṁ = ±4πrc2 ρcs = ±π 2 ρ. (2.118)
(V + c2s )3/2
For the case of accretion (Ṁ < 0), these two formulae are known as the equations describing Bondi-
Hoyle accretion after the names of the researchers who first developed this approximation.

Exercise 10 The center of the Milky Way harbors a black hole of mass M ≈ 106 M . Assume that the
(infinite reservoir of) ambient gas has a number density n = 1cm−3 , a mean particle mass of m = 1.2mH ,
and a temperature T = 107 K. How long does it take for the black hole to double its mass due to steady,
isothermal Bondi accretion of gas from its ambient medium? Show your derivation in detail and express
your answer in units of the Hubble time tH ≈ 1010 years, which is roughly the age of the Universe.

2.5 Hydrodynamic Instabilities


Clearly, the most interesting hydrodynamic phenomena are not only those that describe an equilibrium
state. In this section, we will investigate various of the many instabilities that can arise when a system
in equilibrium is perturbed. Since perturbations will naturally occur in a system, we have to distinguish
between stable equilibria, where the perturbation only causes oscillations around the equilibrium state,
and unstable equilibria, where the perturbation can radically alter the state of the system.

2.5.1 Convective Instability

We begin our analysis of unstable systems with a perfect gas that is hydrostatic equilibrium in a (locally)
uniform gravitational field. For simplicity let gravity act in the z-direction, so that for symmetry reasons,
we can assume ρ(z) and P (z) to be a function of z only. Let us assume that at some initial height z, a
blob of gas has the same density ρ and pressure P as its ambient medium, but a perturbation displaces
it upward, where the ambient medium has density ρ0 and pressure P 0 (see Figure 2.8 for an illustration).
The blob remains in pressure equilibrium, but if we assume that it has moved upward in an adiabatic
way, then it might not in general have the same density as the ambient medium. Let us call the density
inside the blob at the new position ρ∗ . If ρ∗ < ρ0 , then the displaced blob of gas is said to be buoyant
and will continue to rise, while if ρ∗ < ρ0 , then the system is stable, and the blob will sink back to its
initial position. To determine whether the system is convectively unstable, we thus have to calculate
the density at the displaced position and compare it to the ambient density.
For an adiabatic process, the new density must be given by
 1/γ
P0
ρ∗ = ρ . (2.119)
P

39
ρ*, P’ ρ’, P’

ρ, P ρ, P

Figure 2.8: Convective instability: displacement of a blob of gas in a stratified medium. The blob will
rise buoyantly if ρ∗ < ρ0 , otherwise it will sink back to its original position.

We next assume that hydrostatic equilibrium in the ambient medium requires a pressure gradient dP/dz,
so that if the blob is displaced by a distance ∆z, we can write the pressure at the higher position as

dP
P0 = P + ∆z. (2.120)
dz
Using the binomial theorem, we can write (1 + x)1/γ ' 1 + x/γ + O(x2 ), so that for the density inside
the adiabatically risen blob
ρ dP
ρ∗ = ρ + ∆z. (2.121)
γP dz
We not have to compare this to the density at the higher position in the ambient medium. It is given by

ρ0 = ρ + ∆z (2.122)
dz
where we can use P = nkT and thus ρ = mP/kT , so that dρ = mdP/kT − mP dT /kT 2 which can
then be put together to yield
ρ dP ρ dT
ρ0 = ρ + ∆z − ∆z. (2.123)
P dz T dz
The difference between the density inside the blob of gas and the ambient medium is then
   
1 ρ dP ρ dT
ρ∗ − ρ0 = − 1 − + ∆z. (2.124)
γ P dz T dz

If we set things up so that dT /dz and dP/dz are both negative (as would be the case if gravity is in the
negative z-direction), then the atmosphere is stable if
 
dT
< 1 − 1 T dP (2.125)
dz γ P dz

This criterion simply states that if the temperature gradient is steeper than the critical value, given
by the right-hand-side, then the atmosphere is convectively unstable and any perturbation will cause
convection to happen. This criterion was first developed by Schwarzschild in 1906 and is thus also called
the Schwarzschild stability criterion.

40
ρ’, U’
ξ
y
ρ, U
x
Figure 2.9: Perturbation at the interface between two fluid phases.

One can even approximate the equation of motion of the blob from Newton’s law as

d2
ρ∗ ∆z = −(ρ∗ − ρ0 )g, (2.126)
dt2
if one assumes the blob to be small so that one can neglect its interaction with the ambient gas. Substi-
tuting eq. (2.124), one finds
d2
∆z + N 2 ∆z = 0, (2.127)
dt2
which is a second order equation in time, meaning that depending on whether N 2 is positive or negative,
meaning that it is either oscillating or a damped motion. In the oscillating case, the frequency is given
by s    
g dT 1 T dP
N= − 1− , (2.128)
T dz γ P dz
which is also called the Brunt-Väisälä frequency and gives the frequency of oscillation of the blob of gas
in the ambient medium. Such convective motion is an important means of heat transport in stratified
atmospheres and particularly in stars.

2.5.2 Perturbations at an interface

The next class of fluid instabilities occur at a perturbed interface between two fluid phases. For simplicity
let us consider the situation in two dimensions and assume that the two phases are separated at y = 0 in
the y-direction, and initially uniform in the x-direction. We then have ρ(y < 0) = ρ and ρ(y > 0) = ρ0
with different velocities. The situation we are thinking of is the one illustrated in Figure 2.9.
We will neglect vorticity (∇ × v = 0 and assume an incompressible fluid ∇ · v = 0 in this simplified
model, so that we can write v = −∇φ for the full fluid velocity. Such a flow is called a potential flow.
In this case, the Euler equation becomes
   
∂φ 1 2 P
−∇ +∇ v = −∇ − ∇Φ, (2.129)
∂t 2 ρ
where Φ is the gravitational potential. This equation can trivially be integrated, and leaves a time-
dependent integration constant F (t), i.e.
∂φ 1 2 P
− + v + + Φ = F (t). (2.130)
∂t 2 ρ

41
We shall now assume that the two fluids have uniform velocities U and U 0 in the x-direction. In the
absence of viscosity, such a situation is a steady state solution of the fluid equations. We will now
consider a small perturbation ξ of the interface between the two phases, i.e. the position of the interface
shall be at y = ξ(x, t). We want to investigate now whether this perturbation grows, decays or oscillates
with time.
Since we have a pure potential flow by assumption, the velocity potential below the interface can be
written as
φ = −U x + δφ, (2.131)
where U gives then the uniform velocity U in the x-directions and δφ is the perturbation satisfying
∇2 δφ = 0 (since ∇ · v = 0). Equivalently, we have above the interface

φ0 = −U 0 x + δφ0 . (2.132)

We want to follow the motion of the interface function ξ(x, t). The vertical velocity is just −∂δφ/∂y
and it is also given by the Lagrangian derivative of the displacement Dξ/Dt, so we equate the two and
keep only terms up to linear order to find for the lower fluid
∂δφ ∂ξ ∂ξ
− = +U (2.133)
∂y ∂t ∂x

where the second term arises because U is along the x-direction and terms ∂δφ ∂ξ
∂z ∂x can be neglected
since they are quadratic in the perturbations. Equivalently, we obtain for the fluid above the surface
∂δφ0 ∂ξ ∂ξ
− = + U0 . (2.134)
∂y ∂t ∂x
Since we are dealing with linear partial differential equations now, we can make the usual plane wave
ansatz and write
ξ(x, t) = A exp [i(kx − ωt)] . (2.135)
This ansatz, together with Laplace’s equation for the velocity potentials ∇2 δφ = 0 implies that then we
have to write

δφ(x, y, t) = B exp [i(kx − ωt) + ky] and (2.136)


0 0
δφ (x, y, t) = B exp [i(kx − ωt) − ky] . (2.137)

Inserting this into the equations above, we find

i(−ω + kU )A = −kB, and (2.138)


i(−ω + kU 0 )A = kB 0 . (2.139)

We can derive the pressure in the upper and lower fluid using the equation for the time evolution of the
velocity potential, eq. (2.130), i.e. in the lower fluid
 
∂δφ 1 2
P = −ρ − + v + gξ + ρF (t), (2.140)
∂t 2
where we have used the approximation Φ = gξ, i.e. g = ∂Φ/∂y|y=0 . One can derive the equivalent
expression for the fluid above the interface, and requiring that the two fluids are in pressure equilibrium
at the interface then implies that
   
∂δφ 1 2 0 ∂δφ0 1 02
ρ − + v + gξ = ρ − + v + gξ + K(t), (2.141)
∂t 2 ∂t 2

42
where K(t) = ρF (t)−ρ0 F 0 (t) which we can safely assume to be constant in time. Under this condition,
K can be found for the unperturbed solution, in which case
1 2 1 0 02
K= ρU − ρ U . (2.142)
2 2
We also need the square of the total fluid velocity v 2 , which is
∂δφ
v 2 = (U ex − ∇δφ)2 = U 2 − 2U (2.143)
∂x
up to linear order in the perturbations. If we insert this into eq. (2.141), we have
   
∂δφ ∂δφ ∂δφ0 ∂δφ0
ρ − −U + gξ = ρ0 − − U0 + gξ . (2.144)
∂t ∂x ∂t ∂x
If we insert the ansatz for the solutions of φ and ξ into this, we finally find

ρ [−i(−ω + kU )B + gA] = ρ0 [−i(−ω + kU 0 )B 0 + gA] . (2.145)

Using the relations between A and B and B 0 , we can further simplify this as
2 2
ρ (−ω + kU ) + ρ0 (−ω + kU 0 ) = kg(ρ − ρ0 ). (2.146)

This is a quadratic equation, and we can write its solution as the well-known dispersion relation of
linear fluid interface instabilities
 1/2
ω ρU + ρ0 U 0 g ρ − ρ0 ρρ0 (U − U 0 )2
= ± − . (2.147)
k ρ + ρ0 k ρ + ρ0 (ρ + ρ0 )2
It is clear that when ω is a purely real number, the perturbations will correspond to simple oscillations
(or acoustic waves), while as soon as ω has a non-zero imaginary part, the perturbations will grow.
Whether such unstable solutions exist clearly depends on whether the term under the square root is
positive or negative which can be used to distinguish regimes of stability and instability. This very
general result can be applied to many relevant cases, which we will consider next.

2.5.3 Surface gravity waves

The simplest application we can consider is for two fluids at rest, with the lighter fluid above the heavier
fluid, i.e. U = U 0 = 0 and ρ > ρ0 . For a perturbation of the interface between them, the dispersion
relation gives s
ω g ρ − ρ0
=± . (2.148)
k k ρ + ρ0
Since k is a real number, then also ω is a real number in this case. This means that the waves are simply
propagating on the surface without growing or damping out. Such waves are called surface gravity
waves and their phase velocity ω/k depends on the wave number k so that they do not maintain their
shape if they are made up from multiple waves but instead disperse. In the√ case of the lighter fluid being
air, and the lower being water, we can safely assume ρ0  ρ, so that ω = ± gk. This is a very simplified
picture however since it implicitly assumes that the water depth is infinite, so that no breaking of the
wave can occur. Also, non-linear effects can lead to some non-dispersive surface gravity waves. Such
waves are called solitons and they occur in various physical situations with the common property that
their shape remains fixed over time.

43
Figure 2.10: Left: Rayleigh-Taylor instability in a numerical simulation of a heavier fluid on top of
a lighter fluid with a sinusoidally perturbed interface [Image credit: Li and Li, U.S. DoE]. Right:
Rayleigh-Taylor instability at the surface of the supernova bubble in the Crab nebula.[Image copyright
by NASA/ESA, J. Hester and A. Loll.]

2.5.4 Rayleigh-Taylor Instability

Unlike in the previous case, we can now take the heavier fluid to sit on top of the lighter fluid. We
expect that gravity tries to pull down the heavier fluid so that this situations should be unstable to
perturbations. You can verify yourself that for an unperturbed interface, this situation is hydrostatic!
In the case that ρ < ρ0 , we find that ω is imaginary. If ω is imaginary, then
ξ ∝ exp(|ω|t), (2.149)
so that we expect the perturbation to grow as expected. This phenomenon is called the Rayleigh-Taylor
instability. Note that in our analysis, we assumed the gravitational acceleration to be constant, so the
analysis is equally applicable if a lighter fluid is being accelerated against a heavier fluid. This situation
naturally occurs at the surface of a supernova explosion bubble, so that Rayleigh-Taylor instability is
also expected to occur for the boundary of the bubble, and can indeed be clearly seen in older supernova
remnants, such as e.g. the Crab nebula. The Rayleigh-Taylor instability leads to prominent “fingers” of
dense fluid penetrating the lighter fluid (see Figure 2.10).

2.5.5 Kelvin-Helmholtz Instability

Another very common instability arises when U and U 0 are non-zero, but when we require ρ > ρ0
so that the system is Rayleigh-Taylor stable. From eq. (2.147) we see immediately that ω can have an
imaginary part if the expression under the square root is negative, i.e. when
g
ρρ0 (U − U 0 )2 > (ρ2 − ρ02 ) . (2.150)
k
We note immediately that this instability is also present if g = 0, in which case it reduces to (U −U 0 )2 >
0 meaning that any relative velocity will trigger it in that case! This instability is called the Kelvin-
Helmholtz instability and it causes the interface between two fluids that are sheared against each other

44
Figure 2.11: Left: Kelvin-Helmholtz instability in clouds due to two layers of air moving at relative
velocities at the cloud layer [Image credit: internet, unknown]. Right: Kelvin-Helmholtz instability in
clouds on Jupiter [Image copyright by NASA]

to become unstable. The simplest example is the emergence of water waves from wind blowing over
the surface, but this instability is in fact extremely common in astrophysical situations whenever the
interface between two phases which are moving at relative velocities is perturbed, see Figure 2.11.

2.5.6 Jeans Instability

Arguably the most important instability in astrophysics arises from the counter-play of gravity and
pressure. Assume we have homogeneous self-gravitating medium whose density we perturb. Whether
gravity will cause a runaway growth of density (over-dense region attracting more and more gas) de-
pends on the pressure force. If pressure is large enough, we will only see the acoustic oscillations that
we discussed earlier. If pressure is too low to achieve this, the gas will however undergo the Jeans
instability. The analysis goes along the lines of our analysis of acoustic waves with the addition of
gravity.
We thus start from the linearised perturbed equations (2.73) and (2.74) that we reproduce here to avoid
page-flipping:
∂ρ1 ∂v1,i
+ ρ0 = 0 (2.151)
∂t ∂xi
∂v1,i ∂P1
ρ0 = − , (2.152)
∂t ∂xi
where quantities with index ‘1’ refer to the perturbation, and those with ‘0’ to the unperturbed quanti-
ties. We now have to supplement this with Poisson’s equation for the perturbation of the gravitational
force (note that this is in fact subtle since the system of equations at constant density is actually incon-
sistent):
∇2 Φ1 = 4πGρ1 . (2.153)
And we also have to add the gravitational force to the Euler equation (2.152), so that we get, after
rewriting the pressure gradient as a density gradient using the sound speed cs
∂v1,i ∂ρ1 ∂Φ1
ρ0 = −c2s − ρ0 . (2.154)
∂t ∂xi ∂xi

45
We note that once again, we can re-write this as a single second order equation of the form
 2 

− cs ∇ ρ1 − ρ0 ∇2 Φ1 = 0,
2 2
(2.155)
∂t2
which conveniently also allows us to directly insert Poisson’s equation (2.153) to finally find
 2 
∂ 2 2
− cs ∇ − 4πGρ0 ρ1 = 0. (2.156)
∂t2
Since this is a linear partial differential equation, we can make our usual plane wave ansatz, i.e. we set
ρ1 = A exp [i(k · x − ωt)] to obtain the dispersion relation
ω 2 = c2s (k 2 − kJ2 ), (2.157)
where we define
4πGρ0
kJ2 = . (2.158)
c2s
We see immediately that when k < kJ , then ω becomes imaginary, which results in density perturba-
tions to grow exponentially. On the other hand, if k < kJ , then the mode of wave number k is stable
and will just cause oscillations (or acoustic waves). The wave number kJ can of course be expressed
in terms of a wave length λJ = 2π/kJ , so that this statement means that in a self-gravitating gas of
background density ρ0 with sounds speed cs , perturbations on wavelengths longer than λJ overcome
pressure forces and will collapse. The length λJ is called the Jeans length. Since it corresponds directly
to a mass on the unperturbed background, one defines also

MJ = ρ0 λ3J (2.159)
3
as the Jeans mass which tells us directly whether a perturbation of mass MJ in a medium at mean
density ρ0 with a sound speed cs will undergo gravitational collapse.

Exercise 11 Compute the Jeans mass for an isothermal, i.e. γ = 1, gas at temperature T with a mean
particle mass m̄ and with an unperturbed mean density ρ0 . What is the Jeans mass of a typical region of
the interstellar medium in the Milky Way? How does this mass compare to the mass of stars? What do
you think this implies for the formation of stars?

2.6 Multi-species, radiative cooling and ionisation


We have neglected in our analysis so far that in the typical astrophysical environment, a gas will not
be made up just from one single particle type. Moreover, depending on temperature and density, atoms
in the gas can be neutral or ionised. And a further complication is that radiative processes enter the
picture which can remove internal energy out of the system. In this section, we will provide the relevant
formulae to deal with these situations. The physical details on these processes would require a separate
course, so that we just provide a set of tools.

2.6.1 Average treatment of multi-species gases

You might have wondered why we have often assumed that the particle mass in our exercises was taken
to be ∼ 1.2 mH the mass of a hydrogen atom mH . In fact this was well motivated as we will see now.

46
The underlying idea is that when we have a multi-species gas, such as one consisting of Hydrogen,
Helium and other heavier elements, collectively called metals in astrophysics, it is most of the time very
reasonable to assume that they are in mutual equilibrium so that they have the same temperature and
mean velocity. If this is the case, we can write the mean mass of the fluid particles by

m̄ = µ mH , (2.160)

where µ is defined to be the mean molecular weight in units of the mass of a Hydrogen atom. Naturally,
the mean molecular weight depends both on the composition of the gas in terms of its atoms, but also
on the ionisation state – think that when a gas gets ionised, the number of particles increases, but not
their mass, so the mean particle mass has to drop. We can then write for a completely neutral gas
P P
j Nj mj Nj Aj
m̄neutral = P ⇒ µneutral = P , (2.161)
j N j j Nj

where Nj is the number of atoms of species j, mj their mass, and Aj := mj /mH is the mass of atoms
of species in units of the mass of a hydrogen atom. Similarly, one can write down the mean molecular
weight for an ionised gas P
j Nj Aj
µionised = P , (2.162)
j Nj (1 + zj )

where zj is the number of free electrons due to species j, so that 1 + zj is the number of electrons plus
the nucleus. It is common now to rewrite these formulae somewhat, so that they can be expressed in
terms of the fraction of the total mass in species j. For this one cosiders
P
1 j (1 + zj )Nj total number of particles
= P = (2.163)
µmH Nj mj total mass of gas
X (1 + zj )Nj X 1 + zj
= Xj = Xj , (2.164)
j
Nj Aj mH j
Aj mh
P
where we set Xj = Nj mj / i Ni mi as the mass fraction of atoms of type j. We thus have

1 X 1 + zj
= Xj . (2.165)
µ j
Aj

For a neutral gas this becomes simply


 
1 1 1
'X+ Y + Z, (2.166)
µneutral 4 A

where X is the mass fraction of the gas in hydrogen, Y the fraction in Helium and Z in heavier elements.
The fraction Z is also called the metallicity of the gas. For the solar environment one finds < 1/A >∼
1/15.5. On the other hand, for a fully ionised gas, one has
 
1 3 1+z
' 2X + Y + Z, (2.167)
µionised 4 A

where one finds in fact that < (1 + z)/A >' 1/2 to a very good approximation. For the solar neigh-
bourhood one has X = 0.70, Y = 0.28, Z = 0.02, while for primordial gas in the early Universe has
X = 0.76, Y = 0.24, Z ∼ 0.

47
Figure 2.12: The volumetric cooling function Λ(T ) based on the detailed calculations of Sutherland
& Dopita (1993). The different curves correspond to different metallicities from super-solar (top-most
curve), to primordial composition with zero metallicity (bottom-most curve).

Exercise 12 Compute the mean molecular weight for both neutral and fully ionised gas of both a solar
neighbourhood composition and a primordial composition. What is the RMS velocity of particles in a gas
of T = 104 K in all of these cases?

2.6.2 The cooling function

A full treatment of radiative processes is beyond the scope of this course, but radiative cooling has
such an important role in astrophysics that we cannot leave it out. It is the simplest form of a radiative
process, where internal energy of a gas is converted into radiation which then leaves the system without
being re-absorbed. Such a situation is called optically thin. The processes that can lead to the emission
of a photon from an interaction between gas particles are manifold. The most relevant processes are
the following two-body processes
1. Collisional excitation: particle collisions excite an electron in an atom, which subsequently de-
excites under emission of a photon ("bound-bound transition").
2. Collisional ionisation: particle collisions lead to the removal of a bound electron, removing an
amount of energy equal to at least the ionisation energy from the system. ("bound-free transition")

48
3. Recombination: an ionised atom can capture a free photon and will emit a photon. ("free-bound
transition")
4. Bremsstrahlung: in ionised gases, free electrons can be accelerated/decelerated by ions leading to
the emission of Bremsstrahlung. ("free-free transition")
While the exact energy balance of these processes can be calculated, they are usually taken together
and summarised as a simple cooling function Λ(T, Z), which is only a function of the temperature and
the metallicity Z. The cooling function directly quantifies the volumetric radiative cooling rate and is
usually given in units of erg cm3 s−1 . The cooling function gives directly the loss of energy of the gas
due to optically thin radiative cooling at a volumetric rate of

∂e
= ne ni Λ(T, Z), (2.168)
∂t
where ne is the number density of electrons and ni is the total number density of all species of ions.
The energy equation in conservative form including optically thin radiative cooling is then

∂e ∂ ∂
+ (evi ) = − (P vi ) + ρFi vi + ne ni Λ(T, Z). (2.169)
∂t ∂xi ∂xi

2.6.3 Ionisation

In order to evaluate the cooling function above, we need the degree of ionisation of a gas. For a gas in
thermodynamic equilibrium, this can be derived rigorously as a function of pressure and temperature
and results in the famous Saha equation. We would however need to spend an entire lecture to do this
and so for our purpose, it shall suffice to provide the result for a gas composed entirely of Hydrogen. In
this case, the ionisation fraction x is given by

x2 (2πme )3/2 (kT )5/2 h χ i


= exp − , (2.170)
x−1 h3 P kT
where me is the mass of the electron and χ = 13.6 eV is the ionisation energy of Hydrogen. In astron-
omy, the neutral state of Hydrogen is labelled as HI, while the ionised state is labelled HII. Note that the
Saha equation describes the collisional equilibrium ionisation in a gas. Gas can also be photo-ionised
by a source emitting photons with an energy above the ionisation energy. For this reason, the Saha
equation does not describe the ionisation of HII regions around young stars.

2.7 Time scales


Often in astrophysics, it is important to give back-of-the-envelope arguments in order to decide whether
certain processes are relevant. An intuitive way to do this is by comparing the time scales on which
certain processes proceed. By calculating which process occurs on a shorter time-scale than others, it
is then possible to decide that this process must be dominant. We will see how this is done next.

The sound-crossing time

We have seen over and over that the most important feature for pressure effects to be able to stabilise
a system is that sound waves can cross through a system before other motions do so. The time-scale

49
on which sound propagates through a system can be estimated as the sound-crossing time through an
object of size R as
 1/3
R 1 3M
tsound ∼ ∼ , (2.171)
cs cs 4π ρ̄
where in the last equality we have estimated the size from mass and mean density.

The free-fall time

For a spherically symmetric system with a mass profile M (r), neglecting pressure forces, we can cal-
culate the time a freely falling mass shell at a radius R needs to fall to the centre. If the mass shell of
mass dm starts at a radius R0 at rest, then its initial energy is given by E0 = − GMR(<R 0
0)
dm, while at
a later time it will have a velocity U and be located at a position R. Since the mass interior to the shell
rests constant, we can simply write M (R(t)) =: M at all times. Energy conservation then requires

1 2 GM GM
U = − . (2.172)
2 R R0
We thus can write using U = dR/dt that
  
1 1
dt = − 2GM − dR, (2.173)
R R0

and substituting ξ = R/R0 and so also dξ = dR/R0 one can write this using that the enclosed mass
remains constant as  −1/2  1/2
8πGρ̄ ξ
dt = − dξ. (2.174)
3 1−ξ
Now we simply have to integrate both sides, and ξ from 0 to 1 to find the free-fall time
 1/2

tff = . (2.175)
32Gρ̄

The cooling time

Another important time scale is the time scale on which an object will lose a significant amount of its
internal energy through optically thin radiative cooling. We had that the internal energy gets reduced
through cooling as
∂e
= n2 Λ(T, Z), (2.176)
∂t
while the internal energy itself is e = 23 nkT , so that the cooling time of the system can be estimated to
be
e 3 kT
tcool ' = . (2.177)
∂e/∂t 2 nΛ

50
Instability time scales

For all of the instabilities we have discussed before, we can also estimate a time scale in terms of the
dispersion relation. For a system of scale L to undergo an instability governed by a dispersion relation
expressed in terms of ω/k, we can estimate ω ∼ 2π/tinstab. and k ∼ 2π/L so that
h ω i−1
tinstab. ' L , (2.178)
k k=2π/L

where the suffix k = ... means that we need to evaluate the dispersion relation for a wave number
k = 2π/L.

Exercise 13 Show that one can also derive the Jeans mass (up to a factor of order unity) by equating
free-fall time and sound crossing time. Why do you think this works? Show that for gas clouds that have
an adiabatic exponent of γ = 5/3, the Jeans mass grows as they contract, implying that they are in fact
always ultimately stable. Show that for an isothermal cloud (γ = 1) this is not true (i.e. the Jeans mass
decreases as it contracts), and that for γ = 4/3 we have marginal stability. What do you think is the
physical implication of the decreasing Jeans mass in the isothermal case?

Exercise 14 As a simple estimate for the temperature that a self-gravitating object needs in order to
oppose gravity, one can use the virial theorem which states that in an equilibrium state, the internal (and
kinetic) energies balance the potential energy in the following way:

2Einternal + Epot = 0. (2.179)

Assume that a cluster of galaxies has a mass 1014 M and a radius of ∼ 1.5 Mpc. What do you estimate
for the temperature of the gas according to the virial theorem? [Note that clusters of galaxies contain
significant amounts of dark matter that we neglect here but that act to increase the gravitational potential].
Calculate the cooling time for the cluster gas. How does it compare to the age of the Universe and what do
you think this means for objects both more and less massive than our 1014 M galaxy cluster?

51
2.8 Turbulence

52
Chapter 3

Plasmas and
Magnetohydrodynamics

3.1 Charged particles in Astrophysics

3.1.1 Astrophysical Plasmas

In many cases in astrophysics, we are dealing with ionised atoms. In an ionised system, the constituent
particles thus carry charge (the electrons a negative one and the ions a positive one). These charged
particles will interact with each other through long-range electromagnetic interactions that can radically
change the behaviour of the system. Whether we can treat an ionised gas as an ideal gas, or whether we
have to treat it as a plasma thus depends on the relative importance of these long-range electromagnetic
interactions.

Plasma orbit theory

In a neutral medium (or in an ionised medium where we can neglect electromagnetic fields), the motion
of a particle of mass m is given by Newton’s law
du
m = F, (3.1)
dt
where F is the gravitational force. A charged particle of charge q will however be subject to an electric
force qE and a Lorentz force qc u × B and thus move according to

du  u 
m = q E + × B + F. (3.2)
dt c
We see that phenomenologically, the gravitational force and the acceleration due to the electric field are
identical, but the effect of the magnetic field B dramatically alters the motion of a particle. To see this,
let us assume the particle is moving with a velocity u⊥ perpendicular to B and we neglect E and F.
Then
du⊥ q
m = u⊥ × B. (3.3)
dt c

53
For simplicity, let B = Bez be directed along the z-axis. Then for u⊥ = (ux , uy , 0), we find
   
d ux Bq uy
= . (3.4)
dt uy mc −ux
We see immediately that this is solved for ux = U0 cos(ωc t), uy = U0 sin(ωc t) with the gyrofrequency
qB
ωc = . (3.5)
mc
The particle thus moves in a circle in the plane perpendicular to B with a radius
u⊥ mc
rg = = u⊥ , (3.6)
ωc qB
which is called the gyroradius, or also sometimes called the Larmor radius. Motion along the direction
uk that is parallel to B will not be affected by the magnetic field. The complete motion of the particle
will thus be helical around the direction of the magnetic field with the two components:
1. circular motion around a moving central point, called the guiding centre, and
2. translatory motion of the guiding centre.
Even for non-uniform magnetic fields, it is usually possible to write the motion in terms of these two
components.
In the presence of either an electric field, a gravitational field, or both, the equation of motion is
du q
m = u × B + F, (3.7)
dt c
where we have combined both gravity and electric force into the term F. We can again split the ve-
locity into two components uk and u⊥ parallel and perpendicular to the magnetic field. The parallel
component will then again be unaffected by the magnetic field and simply obey
duk
m = Fk , (3.8)
dt
where Fk is the part of F that is parallel to B. The perpendicular velocity u⊥ , we can break up into the
motion of the guiding centre ugc and the the circular motion u
u⊥ = u + ugc (3.9)
The circular component is unaffected by F⊥ and just follows (as before)
du q
= u × B, (3.10)
dt mc
while the guiding centre motion now has to be uniform and thus satisfy
q
0 = F⊥ + ugc × B (3.11)
c
in order for the equation of motion to be satisfied. Taking the cross-product with B, we find
q q
F×B= B × (ugc × B) = B 2 ugc , (3.12)
c c
so that  
c F⊥ × B E×B
ugc = =c , if F⊥ = qE . (3.13)
q B2 B2

54
Gradient Drift

Let us now consider a magnetic field which is changing in strength. For simplicity let us set B = B(y)ez ,
i.e. it is unidirectional in the z-direction, but varying in strength in the y-direction. The y-component
of the Lorentz force is then
q
Fy = − ux B(y). (3.14)
c
If we measure the y-coordinate relative to the guiding centre and assume that the variation of B(y) is
small over trajectory of the particle, then to first order
dB
B(y) = B0 + y . (3.15)
dy
This implies that the Lorentz force is
 
q dB
Fy = − ux B0 + y , (3.16)
c dy
which we can average over the circular motion (for which ux = 0), but ux y can be calculated to be
1
ux y = u⊥ rg , (3.17)
2
where rg is the gyroradius. Hence
q
F=∓ u⊥ rg ∇B. (3.18)
2c
We can plug this averaged Lorentz force now into equation (3.13) for the guiding centre motion to find
the expression for the gradient drift
1 B × ∇B
u∇B = ± u⊥ rg . (3.19)
2 B2
It is important to note that the respective signs ± apply to negative and positive charges respectively, so
that gradients in the transverse magnetic field lead to electrons and ions drifting in opposite directions,
which gives rise to an electric current.

Magnetic Mirrors

Next, we consider a magnetic field with a gradient in field strength in the z-direction. When working
with a magnetic field, we always have to make sure that the B-field is divergence-free. Working in
cylindrical coordinates, this constraint equation ∇ · B = 0 becomes
1 ∂ ∂Bz
(rBr ) + = 0. (3.20)
r ∂r ∂z
We can integrate this equation to find (assuming Bz is constant with radius r)
Z r
∂Bz 0 1 ∂Bz 1 ∂Bz
rBr = − r0 dr =' − r2 ⇔ Br = − r . (3.21)
0 ∂z 2 ∂z 2 ∂z
The Lorentz-force in cylindrical coordinates is given by
   
Fr uθ Bz − uz Bθ
 Fθ  = q  uz Br − ur Bz  , (3.22)
c
Fz ur Bθ − uθ Br

55
r
z

Figure 3.1: A basic magnetic mirror machine: the convergence of fields lines at the ends, and the associ-
ated increase in magnetic field strength leads to a reflection of charged particles and thus to a confine-
ment of most particles to the interior. Such magnetic mirrors can be used to confine plasma in fusion
reactors.

so that in our case Fz = − qc uθ Br since we have set Bθ = 0 and we can write uθ = ∓u⊥ . We thus get
q ∂Bz ∂Bz
Fz = ∓ u⊥ rg = −µ , (3.23)
2c ∂z ∂z
where we have defined the magnetic moment
1 2
q 2 mu⊥
µ=± u⊥ rg = . (3.24)
2c B
Alternatively one can express the magnetic moment by eliminating u⊥ instead of rg as
ωc q 2
µ=± πr . (3.25)
2π c g

The z-component of the particle motion is given by


duk ∂Bz
m = Fz = −µ , (3.26)
dt ∂z
and the rate of change of the longitudinal kinetic energy is given by
 
d 1 2 duk dB
muk = uk m = −µ . (3.27)
dt 2 dt dt
Since obviously the sum of the transverse and longitudinal kinetic energies cannot change, we must
also have  
d 1 1
mu2k + mu2⊥ = 0, (3.28)
dt 2 2
which after a short calculation leads to

= 0, (3.29)
dt
which means that the magnetic moment µ is a conserved quantity. This leads to an interesting effect
called a magnetic mirror: The transverse kinetic energy 12 mu2⊥ has to increase when the particle moves
into a region of stronger magnetic field B. However, it can never exceed the total kinetic energy, so that
there will be a limiting B into which the particle cannot penetrate. Instead it will be reflected back!

56
3.1.2 Particle Acceleration in Astrophysics

Local changes in magnetic field strength can not only reverse particle motion, but lead to much more
dramatic effects of particle acceleration. In fact, they are responsible for the highest energy particles in
the Universe: cosmic rays.

Particle acceleration in magnetic clouds: the second order Fermi mechanism

The effect of magnetic mirrors can also act to accelerate particles. For this we assume that a magnetised
cloud (in which the B-field is much stronger than outside) acts like the region of convergent field lines
of the magnetic mirror. The cloud can transfer energy to the particle if it has a relative velocity with
respect to the particle. Let’s assume the cloud is moving with a velocity V . Let us assume the particle is
coming in with a velocity u directly towards the cloud. In the rest frame of the cloud, the particle thus
has a velocity V + u. In the rest frame of the cloud, the collision can be assumed to be elastic, so that
the particle will be reflected with a velocity −(V + u). Transforming back to the rest frame, we get for
the incoming velocity u and for the outgoing −(2V + u). The energy gain in the observer rest frame is
thus
1 1
∆E+ = m(u + 2V )2 − mu2 = 2mV (u + V ). (3.30)
2 2
If the collision is not head on but trailing (i.e. the cloud and the particle move in the same direction),
then we have the energy transfer
∆E− = −2mV (u − V ). (3.31)
If head-on collisions would be equally likely as trailing collisions, then we would have no net energy
transfer. However, head-on collisions turn out to be more frequent (this is the same effect as that when
driving fast on the highway, one passes more cars moving in the opposite direction than one has to
overtake cars). The probability p+ for head-on collisions is proportional to u + V , while that for trailing
collisions p− is proportional to u − V . Normalising so that p+ + p− = 1, we have p+ = (u + V )/2u
and p− = (u − V )/2u and thus after averaging over many collisions

∆E = p+ ∆E+ + p− ∆E− = 4mV 2 . (3.32)

It turns out that the relativistic calculation gives


 2
∆E V
=4 E, (3.33)
E c

which is equal to the non-relativistic result for E = mc2 , i.e. when the particle kinetic energy is small
compared to the rest mass. This result thus implies that the energy of a particle averaged over many
collisions will increase with time. Assuming that collisions occur with some rate proportional to 1/α,
then we can write
dE
= αE ⇒ E(t) = E0 exp(αt). (3.34)
dt
This means that in order to be accelerated to an energy E from an initial energy E0 , the particle needs
to spend a time t = α1 log (E/E0 ) in the region where it can be accelerated. If the mean time that
the particle remains in the acceleration region is τ , then the probability that the particle spends a time
between t and t + dt there is given by the negative exponential distribution
1
P (t) dt = exp(−t/τ )dt. (3.35)
τ

57
Figure 3.2: Energy spectrum of cosmic ray particles. Composed mainly of protons and light nuclei they
are accelerated to energies far in excess of energies available in particle accelerators on earth.

If we substitute E for t, we find


 
1 1 dE
⇒ P (E) ∝ E −(1+ ατ ) ,
1
P (E) dE = exp − log(E/E0 ) , (3.36)
τ ατ αE

which means that we expect that particles accelerated in such a process follow a power law distribution
in energy. We see however that the acceleration process will be very slow, since the energy gain is
proportional to (V /c)2 and the clouds are moving at velocities V  c. This problem is circumvented
in the first order Fermi mechanism.

Particle acceleration at shocks: the first order Fermi mechanism

The relative inefficiency of the second order Fermi mechanism resulted from the fact that head-on colli-
sions and trailing collisions cancel out the first order acceleration term. If we can find an astrophysical
scenario in which only head-on collisions occur, then the acceleration would be dramatically stronger.
It turns out that particles can be trapped in shock fronts which leads to a first order acceleration mech-
anism. When we discussed jump conditions at shocks we had that the continuity equation implies that
at the shock front, which is moving with the shock velocity vs , we have in the rest-frame of the shock

58
(vs = 0, cf. eq. 2.90)
ρ L vL = ρ R v R . (3.37)
We also found that for a stationary strong shock (assuming a very large Mach number, M → ∞), the
compression is ρR /ρL = (γ + 1)/(γ − 1), which for an ideal monoatomic and non-relativistic gas with
γ = 5/3 becomes ρR /ρL = 4. Under these conditions we thus have vR = vL /4. This means that in
the rest-frame of the left state, the gas in the right state moves with vR = − 43 vs (just by inserting into
eq. 2.90), while in the rest-frame of the right state, the gas in the left state moves with vR = 43 vs . When
the particle, moving itself at a velocity +u in the left state, enters the right state, it can thus be reflected
with a change of energy
 2
1 3 1 3 9
∆ELR = m u + vs − mu2 = muvs + mvs2 . (3.38)
2 2 2 2 8
When it moves from the left state back to the right state, it will again see the same relative velocity, so
that ∆ERL = ∆ELR and the total relative energy gain in one round-trip is given by
∆E vs 9  vs  2
=3 + . (3.39)
E u 4 u
This shows us that indeed, we have found a first order mechanism. The relativistic calculation, with a
correct averaging over scattering angles gives the result

∆E 4 vs
= . (3.40)
E 3 c
One can show that in this case
P (E) dE ∝ E −2 dE. (3.41)
A spectrum of cosmic ray particles measured by various experiments on Earth is shown in Figure 3.2.

3.2 Many particles in a plasma

3.2.1 The Vlasov-Maxwell equations

When we consider many particles in a plasma, we can apply the same reasoning as for uncharged
particles. As when we derived the Boltzmann equation, we can express the phase space density of
electrons and ions as fe (x, p, t) and fi (x, p, t), respectively. In the limit of no binary collisions, we
then obtain the new Vlasov equation of the form
 
∂fk p p
+ · ∇fk + qk E + × B · ∇p , (3.42)
∂t mk mk c
where the subscript k is e for electrons and i for ions, with the respective charges qi = +e, qe = −e and
masses. Again, we can define the respective number densities by integrating over momentum space, i.e.
Z Z
ne = d3 p fe (x, p, t), and ni = d3 p fi (x, p, t), (3.43)

and take the first moment to obtain the respective velocities


Z Z
1 1
ve = d3 p p fe (x, p, t), and vi = d3 p p fi (x, p, t). (3.44)
m e ne m i ni

59
If we neglect any external magnetic or electric field (otherwise they have to be added separately), the
charge density (ni − ne )e and the current density (ni vi − ne ve )e will self-consistently generate the
electric and magnetic fields by virtue of Maxwell’s equations. This means that we have the additional
set of equations
∇·E = 4π(ni − ne )e, (3.45)
1 ∂B
∇×E = − , (3.46)
c ∂t
∇ · B = 0, (3.47)
4π 1 ∂E
∇×B = (ni vi − ne ve )e + . (3.48)
c c ∂t
This gives the full set of equations for the collisionless two-fluid plasma model, the Vlasov-Maxwell
equations. It is not usually sufficient to simply apply the Vlasov-Maxwell system, except for dilute
collisionless plasmas, due to the possible strong two-particle interactions in the plasma. For this reason,
for most applications, just as in the hydrodynamic case, one will consider two-body collisions in a
statistical sense. We will present the respective magnetohydrodynamic equations shortly.

3.2.2 Debye shielding

An interesting phenomenon occurs for the electric field in a plasma which is not present for gravity. In
a Plasma, Poisson’s equation for the electrostatic potential φ is
∇2 φ = −4π(ni − ne )e. (3.49)
If we introduce a local charge perturbation Q, then we should expect that in thermodynamic equilibrium,
the electron and ion densities should be simply
   
eφ eφ
ne = n̄ exp , and ni = n̄ exp − . (3.50)
kT kT
If we substitute this into Poisson’s equation, we find that
    
2 eφ eφ
∇ φ = 4πn̄e exp − exp − . (3.51)
kT kT
In the case that eφ/kT  1, we can write this to first order as
r
2 1 kT
∇ φ = 2 φ, where λD = (3.52)
λD 8πn̄e2
is the Debye length. This means that the solution for the gravitational potential is not φ = Q/r but
takes instead the form of a screened potential
 
Q r
φ = exp − . (3.53)
r λD
This means that a charge perturbation from charge neutrality is only felt to a distance ∼ λD . One can
turn this into a dimensionless number by considering the mean number of particles onto which a charge
perturbation would have an influence. The inverse of this is the plasma parameter
s
1 (8π)3 e6 n̄
g= 3 = , (3.54)
nλD (kT )3

60
and it gives the relative importance of the energy scale of electrostatic interactions to the thermal energy.
A small g implies thus that the plasma can be treated as a non-interacting perfect gas. This is why we
can use the ideal gas law also in stars!

3.2.3 The two-fluid model

If we take moments of the Vlasov-Maxwell system and assume a local thermodynamic equilibrium, we
will, just as in the hydrodynamic case, end up with a set of equations which describe the evolution of
the moments of the distribution function. Since we have separate phase space distribution functions
for electrons and ions, we will naturally end up with the equations for two fluids, one representing the
electrons and one the ions. This is the two-fluid model. We will not repeat in depth the derivation of
the moment equations as it is completely analogous to the hydrodynamic case. We end up with the
following set of equations
∂nk
+ ∇ · (nk vk ) = 0 (3.55)
 ∂t   
∂vk vk
mk nk + (vk · ∇)vk = −∇Pk + qk nk E + ×B , (3.56)
∂t c
which represent the continuity and Euler equation which are fulfilled separately by electrons and ions.
We note that naturally we also have a distinct pressure Pk for the two types of particles. Three cases of
equations of state are most important. These are
Pk = 0 for cold collisionless plasmas, (3.57)
Pk = knk Tk for constant but distinct temperatures, (3.58)
Pk = Knγk for adiabatic processes. (3.59)
Naturally, to have a closed set of equations, one needs to supplement these equations with Maxwell’s
equations (3.45-3.48).

Electromagnetic oscillations in cold plasmas

We saw in Section (2.4.1) that in a hydrodynamic fluid, small perturbations lead to acoustic waves. This
was due to the pressure force propagating the perturbation at the sound speed through the fluid. We
will now show that a plasma can sustain oscillations even in the absence of a thermodynamic pressure,
i.e. we set Pk = 0 and thus consider cold collisionless plasmas. Analogous to our discussion of acoustic
waves, we can linearise the Euler equation of the electrons for velocity perturbations v1 around a mean
electron density n0 . In addition, we will also have to perturb Maxwell’s equations so that E = E0 + E1 ,
where E0 = 0 and B = B0 + B1 , where B0 = 0, i.e. we set the unperturbed fields to zero. We then
have at first order for the Euler equation
∂v1
me n0 = −en0 E1 . (3.60)
∂t
The Lorentz force v1 × B1 is a second order term and can thus be neglected at linear order in the
perturbations. From Maxwell’s equations we get in addition
1 ∂E1 4π
= ∇ × B1 + n0 ev1 (3.61)
c ∂t c
1 ∂B1
= −∇ × E1 . (3.62)
c ∂t

61
We can now perform directly a Fourier transform in the time domain, so that we can replace all ∂/∂t
with multiplications by −iω. We then get for the linearised Euler equation
e
v1 = E1 (3.63)
iωme
We can then directly insert this into the remaining equations to obtain the following relation between
the perturbations to the magnetic and electric fields

∇ × B1 = − E1 , (3.64)
c
where  is the dielectric constant of the plasma and is defined as

ωp2 4πn0 e2
 := 1 − , with ωp2 := . (3.65)
ω2 me
The frequency ωp is called the plasma frequency. We can now Fourier transform this equation back to
obtain the well known form of one of Maxwell’s equations in a dielectric medium
1 ∂D
= ∇ × B, where D = E. (3.66)
c ∂t
We can also take a time derivative of the Euler equation, as we had done for the acoustic waves, to
obtain (after Fourier transformation in time, and combining all three equations)

ω2
E1 = c∇ × (∇ × E1 ). (3.67)
c
We can now perform a Fourier transform in space, we obtain
!
ω2 ωp2
k × (k × E1 ) = − 2 1− 2 E1 . (3.68)
c ω

This is a wave equation which describes two distinct waves. If we consider a single mode of this wave,
which we set along the z-axis, we can write the wave equation for this single mode as
 2    
ω − ωp2 − k 2 c2 0 0 E1x 0
 0 ω 2 − ωp2 − k 2 c2 0   E1y  =  0  . (3.69)
0 0 ω 2 − ωp2 E1z 0

There are two fundamentally different waves:


1. plasma oscillations: One solution is E1x = E1y = 0, with ω 2 = ωp2 . This corresponds to
non-propagating longitudinal oscillations with a frequency equal to the plasma frequency. They
becomes propagating waves if a non-zero electron pressure is included.
2. electromagnetic waves: The other solution is E1z = 0, with ω 2 = √ ωp2 + k 2 c2 . These are
propagating transversal
√ waves with a phase velocity vph = ω/k = c/  and group velocity
vgr = dω/dk = c . If ω  ωp , then we obtain the limit ω 2 = k 2 c2 which is the dispersion
relation for electromagnetic waves in vacuum. This means that only for low enough √ ω > ωp , the
plasma will affect the propagation of the electromagnetic wave. In the case ω < ωp ,  becomes
imaginary which means that electromagnetic waves with ω < ωp cannot pass through the plasma
and are instead reflected.

62
Figure 3.3: Pulsar dispersion: Observation of a pulsar in 96 radio channels between 1230 and 1520 MHz.
The dispersion of the pulse is clearly visible in the data and can be used to determine the dispersion
measure. [From: Handbook of Pulsar Astronomy, by Lorimer and Kramer]

63
The Dispersion measure of radio emitters

As we have seen above, the phase velocity of electromagnetic waves propagating through a plasma
depends on the plasma frequency. We had
r
dω ωp2
vgr = = c 1 − 2. (3.70)
dk ω
This means that a wave of frequency ω travels a distance dl = vgr dt in a time interval dt. The time to
travel a distance D is then
Z D Z !−1 Z !
dl 1 D ωp2 1 D ωp2
t= = 1− 2 dl ' 1+ dl, (3.71)
0 vgr c 0 ω c 0 2ω 2

where we have expanded the reciprocal term to linear order. Inserting the definition of the plasma
frequency, we find
Z D
D 2πe2
t= + ne dl. (3.72)
c me cω 2 0
This means that waves of different frequency will arrive at different times. If the source of the emitted
radio waves is a pulsar, then we should expect the emission to be a short pulse at a wide range of radio
wavelengths. From the different arrival times of the pulse in different frequencies, on can then calculate
the dispersion measure
Z D
ne dl = n̄e D. (3.73)
0
If the distance to the pulsar is determined otherwise, one can thus measure the mean electron density
in the interstellar medium, or vice versa, based on an estimate of the mean electron density in the ISM
(n̄e ∼ 0.03 cm−3 in the solar neighbourhood), one can measure the distance of the pulsar. See Figure 3.3
for an example of pulsar dispersion.

3.3 Basic Magnetohydrodynamics


An important simplification occurs when we consider only length scales much larger than the Debye
length and time scales much larger than the inverse of the plasma frequency. In that regime, it is allowed
to assume that electron and ion densities and velocities follow each other. In this case, we can treat the
entire plasma as a single fluid. This allows to combine the equations of the two-fluid system into the
equations of ideal magnetohydrodynamics.

3.3.1 The Fundamental Equations

The fundamental MHD equations are very similar to the equations of ideal hydrodynamics and take the
form
∂ρ
+ ∇ · (ρv) = 0 (3.74)
∂t
∂vi ∂vi 1 ∂
+ vj = Fi − (Pij + Mij ) (3.75)
∂t ∂xj ρ ∂xi
∂B
− ∇ · (v × B) = 0, (3.76)
∂t

64
where Pij is the pressure tensor (Pij = P δij if we only have thermodynamic pressure, otherwise it also
includes viscous terms), and
B2 Bi Bj
Mij := δij − (3.77)
8π 4π
is the magnetic stress tensor. We thus gained one additional vector equation, the induction equation,
which couples the evolution of the magnetic field to the fluid velocity field. The magnetic field acts back
on the fluid velocity through the magnetic stress. We can understand its meaning if we look at Mij for
a magnetic field that is uniform in the z-direction, i.e. B = Bez . Then
   
2 1 0 0 2 0 0 0
B  B 
Mij = 0 1 0 − 0 0 0 , (3.78)
8π 4π
0 0 1 0 0 1
which shows that the magnetic field produces an isotropic pressure in the first term, and a negative
pressure only in the z-direction. This negative anisotropic pressure corresponds to a tension of the
magnetic field. While the positive isotropic part opposes compression of magnetic fields, the anisotropic
second term opposes stretching along magnetic field lines. The isotropic magnetic pressure is
B2
Pmag = , (3.79)

and it can be directly compared to the thermodynamic pressure of a gas to determine whether magnetic
fields are dynamically important in a fluid. This means one can define a dimensionless number, the
plasma-β, which is defined as
P
β= 2 . (3.80)
B /8π
In the corona of the sun, one has β ∼ 0.01,

3.3.2 Hydromagnetic Waves

We remember that the hydrodynamic equations allowed wave solution with a sound speed c2s = ∂P /∂ρ.
These waves will of course still exist also in the MHD case but they will split into two different waves.
The tension of magnetic fields lines gives rise to an additional wave. In total, we have the following
different waves:

Alfvén waves

These are waves that result from the restoring force due to the tension of the magnetic field lines. They
are thus propagating parallel to the magnetic field and have a velocity
1
vA = √ B0 , (3.81)
4πρ0
where ρ0 and B0 are the unperturbed mean density and magnetic field in which the waves propagate.

Slow and fast magnetosonic waves

These are the MHD equivalent of sound waves and they come as a slow and a fast wave. If θ is the angle
between the wave vector k and the magnetic field B, the magnetosonic wave velocities are
q
2 1 1
vms = (c2s + vA 2
)± 2 )2 − 4c2 v 2 cos2 θ.
(c2s + vA s A (3.82)
2 2

65
3.3.3 Magnetic Buoyancy

Based on the MHD equations, it is an easy exercise to argue that sun-spots should come in pairs, con-
nected by magnetic field lines. For this, one can assume a magnetic flux tube parallel to the sun’s
surface, i.e. a tube of parallel magnetic field lines. If we assume the flux tube is in pressure balance with
its environment, we have
B2
Pe = Pi + , (3.83)

where Pe is the exterior thermodynamic pressure, Pi the interior one, and B the magnetic field strength
inside the tube. This already implies that Pi < Pe . If we additionally assume that the temperature in
the exterior equals the temperature inside the flux tube, then

k k B2
ρe T = ρi T + , (3.84)
m m 8π
which can be rewritten as
ρe − ρi B2
= > 0. (3.85)
ρe 8πPe
We see immediately that in this case, the interior of the flux tube must be lighter and can thus buoyantly
rise. If the condition is not everywhere fulfilled, then we expect some parts of the flux tube to become
unstable before others (details are of course complicated). The general picture of such a configuration
that emerges is however that shown in Figure 3.4.

66
Figure 3.4: Top: Magnetic buoyancy of a flux tube originally parallel to the surface of the sun. (a)
Some part of the flux tube becomes buoyantly unstable and begins to rise. (b) The tube buckles out of
the surface, leaving two sunspots and a magnetic loop. [From: The Physics of Fluids and Plasmas by
Choudhuri]. Bottom: A coronal loop on the sun. Plasma is flowing along the flux tube in an arc. [Photo
by NASA].

67
Chapter 4

First steps in Computational Fluid


Dynamics

4.1 Discretising the fluid equations – Eulerian and Lagrangian


schemes
In the astrophysical community, predominantly two rather different approaches are used to simulate
the dynamics of fluids on computers. In the first, the Eulerian schemes, the equations are discretised
on a regular grid structure that remains fixed in physical space (but can be locally refined e.g.) and
the evolution of the fundamental fluid quantities, i.e. either the primitive variables (ρ, u, e) or the
conservative quantities (ρ, ρu, ρu2 + e) are evolved at the grid point locations. In the second class
of schemes, the Lagrangian schemes, the equations are discretised in terms of characteristic points that
move with the fluid. Typically, the main advantage of Lagrangian schemes is that they are self-adaptive,
i.e. the points where the solution is known move into regions of high density, therefore preserving
information about the flow. The usual price to pay in Lagrangian schemes is that it is much harder to
correctly treat mixing of different fluid phases correctly. On the other hand, numerical errors are usually
much better controlled in Eulerian schemes, but sophisticated schemes have to be employed (adaptive
mesh refinement) in order to introduce new grid points in regions of convergent flow, in order to not
wash out details of the flow and preserve information. Here, we will just attempt to give a flavour of
both approaches using Python notebooks. For simplicity, we resort here to a set of two equations, the
continuity and Euler equation, closed with a barotropic equation of state. This set of equations is by
definition isentropic, but allows us to illustrate the fundamental features.

4.1.1 The fluid equations in an Eulerian frame

We just summarise here once again the relevant simplified fluid equations in an Eulerian frame (cf.
Section 2.1.2), which are in primitive form in one spatial dimension given by
∂ρ ∂
+ (ρv) = 0 (4.1)
∂t ∂x
∂v ∂v 1 ∂P
+v = − , (4.2)
∂t ∂x ρ ∂x

68
while the equivalent equations in conservative form are

∂ρ ∂
+ (ρv) = 0 (4.3)
∂t ∂x
∂ (ρv) ∂  ∂P
+ ρv 2 = − . (4.4)
∂t ∂x ∂x

4.1.2 The fluid equations in a Lagrangian frame

We recall the Lagrangian derivative of some quantity q(x(t)) along a characteristic x(t), for which
ẋ = v (i.e. it is moving along with the flow), is given by

Dq ∂q
= + v · ∇q. (4.5)
Dt ∂t
This means that we can write the continuity and Euler equation in the form


= −ρ∇ · v, (4.6)
Dt
Dv 1
= − ∇P. (4.7)
Dt ρ
And the fluid parcel of course follows the characteristic ẋ = v by definition. We see that in principle
the fluid equations take a very simple form in terms of the characteristic curves (xi , vi ),

ẋi = vi , (4.8)

∇ρ
v̇i = − c2s . (4.9)
ρ xi

If we have a way to estimate the density ρ and its gradient ∇ρ from the characteristics, we can solve
these equations. We will see how to do this later. Note that in the second equation, we have exploited
that c2s = ∂P/∂ρ.

4.2 A simple finite difference Eulerian method

4.2.1 Finite difference discretisation

One way to discretise the Eulerian equations above is by the means of finite differences, i.e. we approx-
imate the temporal and spatial derivatives of a quantity q by

∂q q(x, t + ∆t) − q(x, t) ∂q q(x + ∆x, t) − q(x − ∆x, t)
' and ' , (4.10)
∂t ∆t ∂x x 2∆x

which can be easily shown to be accurate at first order in ∆t and to second order in ∆x. For simplicity
we will assume that we know the quantities q(x) at discrete locations i∆x, i ∈ N, so that we can simply
write qi = q(i∆x). We will do likewise in time and write q n = q(t0 + n∆t) so that q 0 = q(t0 ).

69
Putting everything together, we can thus write down a finite difference version of the conservative form
of the equations as

∆t  
ρn+1
i = ρni − (ρv)ni+1 − (ρv)ni−1 , (4.11)
2∆x
∆t  2 
(ρv)n+1
i = n
(ρv)i − (ρv + P )ni+1 − (ρv 2 + P )ni−1 , (4.12)
2∆x
with a polytropic equation of state P = K ργ to close the system.
In order to avoid dealing with boundary conditions, we will use a periodic grid of length N , i.e. for an
index i the relation i + N = i holds. Let’s code this up in Python, try using a Jupyter notebook so
that you can directly visualise the results. Dealing with periodic boundaries is particularly simple if we
use the numpy function roll, which can shift the cells by a specified amount and automatically wraps
around the boundaries.

1 import numpy as np
2 import matplotlib.pyplot as plt
3 %matplotlib notebook
4

5 # compute the right-hand side of the FD equations


6 def RHS( rho, rhou, K, gamma ):
7 pressure = K * rho**gamma
8 rhou2 = rhou**2 / rho
9 drho = -0.5 * (np.roll(rhou,-1)-np.roll(rhou,+1))
10 drhou = -0.5 * (np.roll(rhou2+pressure,-1)-np.roll(rhou2+pressure,+1))
11

12 return (drho,drhou)
13

14 # perform a single time step


15 def step( rho, rhou, dt, dx, K, gamma ):
16 (drho,drhou) = RHS(rho,rhou,K,gamma)
17 rho = rho + dt/dx * drho
18 rhou = rhou + dt/dx * drhou
19

20 return (rho,rhou)

4.2.2 Test problem: a convergent flow developing a reflected shock wave

Now, all we need is a main routine that sets the initial conditions, parameters and calls the time-stepping
function step. As our first initial conditions, we will assume a periodic domain 0 ≤ x ≤ 1, on which
we have an initially uniform density ρ(x, t0 ) = 1 and we put a sinusoidal velocity perturbation v(x) =
sin(2πx, t0 ).

1 # initialise homogeneous particle distribution


2 Lbox = 1.0
3 Ngrid = 256
4 gamma = 5.0/3.0
5 K = 0.3
6 totmass = 1.0

70
t = 0.250000
3.0
2.5
2.0
rho

1.5
1.0
0.5
1.0 t=0.00
t=0.05
0.5 t=0.10
t=0.15
0.0 t=0.20
v

t=0.25
0.5
1.0
0.0 0.2 0.4 0.6 0.8 1.0
x

Figure 4.1: Numerical evolution using finite differences of an initially homogeneous density under a
sinusoidal velocity perturbation evolving into an outward propagating shock. The shock develops but
the finite difference discretisation leads to oscillatory features.

7 dx = Lbox / Ngrid
8

9 x = np.arange(Ngrid) * dx
10 rho = np.ones_like(x) * totmass / Lbox
11 u = np.sin(2.0*np.pi * x)
12 rhou = rho * u
13

14 dt = 0.001
15 t = 0
16 tend = 0.25
17 while t<tend:
18 (rho,rhou) = step( rho, rhou, dt, dx, K, gamma )
19 t = t+dt

The results of this little numerical experiment are shown in Figure 4.1. We see nicely how the flow
that is convergent towards x = 0.5 increases the density at that location until the pressure force has
grown large enough to push back the material. This outward travelling material quickly develops into
two shocks, which are however not well reproduced by the finite difference scheme since a strongly
oscillatory feature develops along with the shock. There are two problems with our simple scheme.
First, the shock is a discontinuity, and so we should not be using a second order spatial approximation,
since it will almost certainly over- or undershoot the true solution in a bad way. The second problem
is that our finite difference discretisation does not respect the causal structure of the problem. When
calculating the updated solution at a location xi , neighbouring locations in both directions, i.e. i + 1

71
and i − 1, are used. However, clearly the pre-shock material should not be allowed to have information
about the shock before it actually arrives.
Incorporating this causal structure properly into such schemes can be achieved by the usage of so-
called Riemann solvers, which are explicitly built to reproduce correctly the causal wave structure of
discontinuous solutions. We will look into this later. First, we will exploit a physical mechanism to
prevent such oscillations at discontinuities, since the terms that are causing the instability can be shown
to contain terms of the form ∇2 v and ∇2 ρ, the first clearly being of the form of viscosity, albeit with a
coefficient with the wrong sign so that oscillations grow and are not damped out.

4.2.3 Artificial viscosity

In order to both get a more intuitive understanding of the role of viscosity, as well as to exploit it as
a mechanism to damp oscillations at high spatial frequency, we make use of what is called artificial
viscosity. Since the leading unstable terms causing the oscillations are of the same form as a negative
viscosity, we should be able to eliminate them with a large enough viscosity.
We remember that the momentum equation with non-zero bulk viscosity ζ takes the form

∂ (ρv) ∂  ∂P ∂2v
+ ρv 2 = − + ζ 2. (4.13)
∂t ∂x ∂x ∂x
While in a physical medium the value of ζ is of course given by the material properties, we will treat
it here as a parameter that we are free to adjust. In order to include it along with our finite-difference
solver, we just have to understand how to express it as a finite difference. We remember that at second
spatial order
∂ 2 v vi+1 − 2vi + vi−1
' . (4.14)
∂x2 i ∆x2
All we need to do is thus to modify the right-hand-side function with the new term:

1 def RHS( rho, rhou, K, gamma, zeta ):


2 pressure = K * rho**gamma
3 rhou2 = rhou**2 / rho
4 drho = -0.5 * (np.roll(rhou,-1)-np.roll(rhou,+1))
5 drhou = -0.5 * (np.roll(rhou2+pressure,-1)-np.roll(rhou2+pressure,+1))
6

7 drhou = drhou + zeta * (np.roll(u,1) - 2.0*u + np.roll(u,-1))/dx**2


8

9 return (drho,drhou)

The results for ζ = 10−5 in code units can be seen in Figure 4.2. The artificial viscosity has indeed
completely removed the oscillatory features. Of course this comes at the price of smeared-out shocks,
which haven been significantly broadened. This is exactly the effect of bulk viscosity. With a proper
Riemann-solver based method, we would be able to obtain a non-oscillatory solution with very sharp
shocks – the reason why such methods are generally preferred.

72
3.0
2.5
2.0
rho

1.5
1.0
0.5
1.0 t=0.00
t=0.05
0.5 t=0.10
t=0.15
0.0 t=0.20
v

t=0.25
0.5
1.0
0.0 0.2 0.4 0.6 0.8 1.0
x

Figure 4.2: Same problem and numerical integration scheme as in Figure 4.1 but with added artificial
viscosity.

4.2.4 Finite Volume and Riemann solvers

We tried to discretise the conservative form of the hydrodynamic equations:


∂ρ ∂
= − (ρv) (4.15)
∂t ∂x
∂ (ρv) ∂ 
= − ρv 2 + P . (4.16)
∂t ∂x
If we integrate these equations over a small volume (really a line segment between xi−1/2 and xi+1/2 ,
as we are in 1D), we have
Z xi+1/2 Z xi+1/2
∂ ∂
ρdx = − (ρv) dx = (ρv)|xi−1/2 − (ρv)|xi+1/2
∂t xi−1/2 xi−1/2 ∂x
Z xi+1/2 Z xi+1/2
∂ ∂ 
(ρv) dx = − ρv 2 + P dx = (ρv 2 + P ) x − (ρv 2 + P ) x .
∂t xi−1/2 xi−1/2 ∂x i−1/2 i+1/2

Obviously, if we define Z xi+1/2


1
hqii := q dx (4.17)
∆x xi−1/2

to be the volume average of a quantity q (where ∆x = xi+1/2 − xi−1/2 ), this is simply


∂ hUi i 1 
=− Fi+1/2 − Fi−1/2 (4.18)
∂t ∆x
where U = (ρ, ρv) and F = (ρv, ρv 2 + P ) are the conserved quantities and the flux function respec-
tively. This means that the average value of the conserved quantity in a cell changes according to the net

73
influx minus outflux into the cell. The problem is thus reduced to two steps: (1) reconstructing the left
and right states at the interface between cells, and (2) computing the flux across the boundary. Since we
are dealing with discontinuous solutions, a reasonable assumption is that U is constant inside of each
cell. Then we have a discontinuity between UL and UR at each cell interface. Such a problem is a Rie-
mann problem and can be solved either exactly or approximately using so-called approximate Riemann
solvers. A simple choice is the Haarten-Lax-Van Leer approximate Riemann solver, which states that
for input states UL and UR , the flux is given by
1 S∗
F(UL , UR ) = (FL + FR ) − (UR − UL ) , (4.19)
2 2
where
S ∗ = max (|vL | + cL , |vR | + cR ) (4.20)
is the maximum signal speed.
We can implement this easily in our previous scheme by just replacing the function RHS to
1 # compute the right-hand side of the FD equations
2 def RHS( rho, rhou, K, gamma ):
3

4 rhou2 = rhou**2 / rho


5 u = rhou/rho
6

7 pressure = K * rho**gamma
8 cs = np.sqrt(gamma * pressure/rho)
9 a = np.abs(u)+cs
10

11 # Uleft
12 rhoL = rho
13 rhouL = rhou
14

15 # Uright
16 rhoR = np.roll(rho,-1)
17 rhouR = np.roll(rhou,-1)
18

19 # Fleft
20 FrhoL = rhou
21 FrhouL = rhou2 + pressure
22

23 FrhoR = np.roll(rhou,-1)
24 FrhouR = np.roll(rhou2+pressure,-1)
25

26 # Sstar
27 Sstar = np.maximum(a,np.roll(a,-1))
28

29 # compute flux
30 FHLLrho = 0.5*(FrhoL+FrhoR) - 0.5 * Sstar *(rhoR-rhoL)
31 FHLLrhou = 0.5*(FrhouL+FrhouR) - 0.5 * Sstar *(rhouR-rhouL)
32

33 # compute flux difference


34 drho = -(FHLLrho - np.roll(FHLLrho,+1))
35 drhou = -(FHLLrhou - np.roll(FHLLrhou,+1))

74
36

37 return (drho,drhou)

This scheme can be shown to be stable if the CFL-condition (Courant-Friedrichs-Lewy) is fulfilled:


∆x
∆t < . (4.21)
2 max (|v| + c)
Typical improvements to this method can be made by (1) increasing the order of the reconstruction step
to either piecewise linear or piecewise parabolic (away from discontinuities), (2) increasing the order
of the time integration. Multi-dimensional solvers can be constructed easily by directional operator
splitting. Here one solves sequentially one-dimensional problems. In 3D, one would solve first along
the x-direction, then along y, then z, followed by a step in the reverse order: first z, then y, then x. Also
unsplit methods exist, but they are somewhat more involved in the multi-dimensional flux calculation.

4.3 Smoothed-particle Hydrodynamics (SPH)


In our little excursion into the numerical world, we will next turn to a Lagrangian method, the so-called
smoothed-particle hydrodynamics, or SPH, method. As we have seen above, the Lagrangian equations
of motion for characteristics are particularly simple, but their use is hampered by the fact that we need an
estimate of the density. This is what SPH is all about. The idea is to use the local density of characteristics
(or fluid parcels) as an estimate of the density by means of so-called kernel density estimation.

4.3.1 Kernel density estimation

Kernel density estimation is a widely used method in statistics to obtain a non-parametric estimate of
a probability density function of a random variable. The basic idea is that for a sample (x1 , x2 , . . . , xn )
that is fairly drawn from an unknown density f , one can use the kernel density estimator
n n  
1X 1 X x − xi
fˆh (x) = Kh (x − xi ) = K , (4.22)
n i=1 nh i=1 h

where K(·) is the kernel function and h > 0 is a smoothing parameter, which one wants to choose as
small as possible while still averaging over enough points to obtain a low variance estimate. Assuming
we know the density ρi at every point xi , then the general kernel estimate of a variable A, that is known
at those points, is given by
Xn  
Ai x − xi
A(x) = mi K , (4.23)
i=1
ρi h

where the term ρ−1 i appears to avoid weighting the estimate by the density of points. For Ai = ρi , this
trivially reduces to
Xn  
x − xi
ρ(x) = mi K . (4.24)
i=1
h
The gradient of a density weighted kernel estimate, assuming that h is spatially constant can also be
easily calculated to be
X n  
Ai x − xi
∇A(x) = mi ∇K , (4.25)
i=1
ρi h

75
h=1
K
0.6 grad K

0.4

0.2

0.0

0.2

0.4

0.6
4 3 2 1 0 1 2 3 4
q

Figure 4.3: The B-spline density estimation kernel and its gradient which are commonly employed in
the estimation of density and density weighted quantities in SPH.

which means that one only has to replace the kernel K with the gradient of the kernel ∇K. A natural
choice for a kernel would be e.g. a Gaussian kernel, but more commonly a function with finite support is
used so that points at distances larger than the support of the kernel can be neglected in the sum, making
the calculation more efficient. The traditionally used kernel in SPH is the B-spline kernel (Monaghan
1992) of the form   
3 q
 σh 1 − 2 q 2 1 − 2 , for 0 ≤ q ≤ 1
3
K(q) = σ 3 (2 − q) , for 1 < q ≤ 2 (4.26)
 h4
0, for q > 2
with a normalisation constant which has in d spatial dimensions the value
 2
 3h , for d = 1
10
σh = 2 , for d = 2 . (4.27)
 7πh1
πh 3 , for d = 3

The gradient of the kernel can be readily calculated as


  q
 3 
 σh 3q 2 − 1 + 4 q 2 , for 0 ≤ q ≤ 1
2
∇K = −σh 49 (2 − q) , for 1 < q ≤ 2 . (4.28)

0, for q > 2

The shape of the B-spline kernel and its gradient are shown in Figure 4.3.

4.3.2 Pressure force in SPH

Using these kernels, we can now finally write down the pressure force term that appears in the La-
grangian Euler equation. There is some ambiguity how exactly the pressure gradient should be formu-
lated and in fact a lot of recent debate about new developments in SPH has gone in this direction. Here,

76
we show two different kernel based discretisations. The first is due to Katz & Hernquist 1989 and has
the form p !  
Dvi X Pi Pj xj − xi
=− mj 2 ∇i K , (4.29)
Dt j
ρi ρj h

where ∇i indicates that the derivative is taken with respect to xi and not xj , and the sum is taken over
all points xj in the support of the kernel, i.e. with a distance smaller than 2h. An alternative formulation
is due to Morris 1996 and has the form
X    
Dvi Pi − Pj xj − xi
= mj ∇i K . (4.30)
Dt j
ρi ρj h

A 1D SPH method

A full scheme is obtained by using the velocity/momentum updates as above, and the density can be
computed by kernel estimation at any desired time. In principle, one could also evolve the density at
the particle locations. It has the form:
X  
Dρi xj − xi
= mj (vi − vj ) ∇i K . (4.31)
Dt j
h

With all the equations at hand, we can now turn all that we have so far into a small Python program
that evaluates the pressure force based on the locations of the characteristics xi . First the code for the
kernels in 1D:

1 def W_1D(q,h):
2 q = np.abs(q)/h
3

4 i1 = np.where(np.logical_and(q>=0,q<=1))
5 i2 = np.where(np.logical_and(q>1,q<=2))
6 i3 = np.where(q>2)
7

8 sigma = 2.0/(3.0*h)
9 ret = np.zeros_like(q)
10 ret[i1] = sigma*(1-1.5*q[i1]**2*(1-q[i1]/2))
11 ret[i2] = sigma*0.25*(2-q[i2])**3
12 ret[i3] = 0.0
13

14 return ret

1 def grad_W_1D(q,h):
2 s = np.sign(q)
3 q = np.abs(q)/h
4

5 i1 = np.where(np.logical_and(q>=0,q<=1))
6 i2 = np.where(np.logical_and(q>1,q<=2))
7 i3 = np.where(q>2)
8

9 sigma = 2.0/(3.0*h)

77
10 ret = np.zeros_like(q)
11 ret[i1] = sigma*(3*(q[i1]/2-1.0)*q[i1]+0.75*q[i1])
12 ret[i2] = -3*sigma*0.25*(2-q[i2])**2
13 ret[i3] = 0.0
14

15 return s*ret

In order to compute the pressure force, we will for simplicity just loop over all particles and zero the
contribution due to the particle itself. We also have to take into account periodic boundaries when
evaluating the kernel: let’s assume our domain has an extent L. For two points xi and xj , under periodic
boundary conditions, the distance vector d is d = xi − xj if −L/2 < xi − xj ≤ L/2. If however
xi − xj > L/2, then d = xi − xj − L, and if xi − xj < −L/2, then d = xi − xj + L. Putting this
together we can calculate the pressure force in a periodic domain using a kernel estimate as
1 def compute_pressure_force( x, rho, L, pmass, h, K, gamma ):
2 pressure = K * rho ** gamma
3

4 ipart = 0
5 pressure_force = np.zeros_like(x)
6 # loop again over all particles
7 for xp in x:
8 # compute distance obeying periodic boundaries
9 d = x - xp
10 ii1 = np.where( d > 0.5*L )
11 ii2 = np.where( d < -0.5*L)
12 d[ii1] = d[ii1] - L
13 d[ii2] = d[ii2] + L
14

15 # Morris (1996) SPH


16 force_i = -(pressure[ipart] - pressure)/(rhop[ipart]*rhop) \
17 * grad_W_1D( d, h ) / h
18

19 # zero self-force
20 force_i[ipart] = 0.0
21 pressure_force[ipart] = np.sum(force_i)
22

23 ipart = ipart + 1
24

25 return pmass * pressure_force

We also need to evaluate the density, if we are interested in it, which we can write as follows:
1 def compute_density( x, L, pmass, h ):
2 rho = np.zeros_like( x )
3 ipart = 0
4 for xp in x:
5 d = x - xp
6 ii1 = np.where( d > 0.5*L )
7 ii2 = np.where( d < -0.5*L)
8 d[ii1] = d[ii1] - L

78
9 d[ii2] = d[ii2] + L
10 rho_i = pmass * W_1D( d, h )
11 rho[ipart] = np.sum(rho_i)
12 ipart = ipart + 1
13 return rho

4.3.3 Test problem: a convergent flow developing a reflected shock wave

Once again we consider the test problem from above, an initially uniform density and a sinusoidal
velocity perturbation. Instead of the first order time integration method we used for the finite difference
scheme, we will here use a leap-frog integration scheme which is second order accurate in time: we first
update the density and particle positions by a half time-step ∆t/2, then we perform a full time-step for
the velocities, followed by a final half time-step for positions and densities using the new velocities. The
code fragment that sets up the initial conditions and performs the time integration should then look like
this:
1 Lbox = 1.0
2 Npart = 256
3 h = 0.01
4 totmass = 1.0
5 gamma = 5.0/3.0
6 K = 0.3
7 pmass = totmass / Npart
8 dx = Lbox / Npart
9 tend = 0.25
10

11 x = np.arange(Npart) * dx
12 rho = np.ones_like(x) * totmass / Lbox
13 v = np.sin(2.0*np.pi * x)
14

15 dt = 0.01
16 t = 0
17 while t<tend:
18 # drift
19 x = x + 0.5*dt * v
20

21 # kick
22 rho = compute_density( x, Lbox, pmass, h )
23 acc = compute_pressure_force( x, rho, Lbox, pmass, h, K, gamma )
24 v = v + dt * acc
25

26 #drift
27 x = x + 0.5*dt * v
28

29 t = t + dt

The final solution can be seen in Figure 4.4. We recover a solution that is very similar to our first try
with the finite difference scheme, a shock develops but again produces oscillations. Once again these
could be reduced by adding artificial viscosity.

79
h = 0.01
3

2
rho

1.0 t=0.00
t=0.05
0.5 t=0.10
t=0.15
0.0 t=0.20
v

t=0.25
0.5
1.0
0.0 0.2 0.4 0.6 0.8 1.0
x

Figure 4.4: Numerical evolution using the SPH method of an initially homogeneous density under a
sinusoidal velocity perturbation evolving into an outward propagating shock. As in the finitie differ-
ence scheme without artificial viscosity, the solution has oscillatory features. Once again, they can be
suppressed using artificial viscosity.

80
Index

H-theorem, 13 de Broglie wavelength, 3


dielectric constant, 62
accretion, 30 differential rotation, 29
accretion disks, 27 dilute gas, 8
accretion rate, 28 dimensional analysis, 36
acoustic sound waves, 31 dispersion measure, 64
adiabatic process, 19 dispersion relation, 43
adiabatic sound speed, 31 distribution function, 5
artificial viscosity, 72 dynamic viscosity, 26

baroclinc term, 23 Ehrenfest’s theorem, 4


barotropic fluids, 21 electric current, 55
blast wave, 35 electric force, 53
Boltzmann constant, 3 entropy, 13, 21
Boltzmann equation, 10 Euler equation, 20
Bondi-Hoyle accretion, 39
Brunt-Väisälä frequency, 41 Fermi energy, 17
bulk kinetic energy, 12 Fermi-Dirac statistics, 17
bulk viscosity, 26 finite differences, 69
buoyant, 39 free-fall time, 50
Burgers’ equation, 33
Gauss’ theorem, 6, 20
CFL-condition, 75 guiding centre, 54
chemical potential, 17 gyrofrequency, 54
cold collisionless plasmas, 61 gyroradius, 54, 55
collision term, 8
collisionless Boltzmann equation, 7 Hamiltonian, 4
Conservation laws, 20 heat conduction, 26
conservative form, 20 heat equation, 26
Continuity equation, 6 hydrostatic equilibrium, 24
continuity equation, 20
convectively unstable, 39 ideal magnetohydrodynamics, 64
cooling function, 49 incompressible, 7
cooling time, 50 induction equation, 65
infinite hierarchy, 16
Debye length, 60 internal energy, 12, 21
deflection angle, 9 internal energy equation, 20

81
Jeans instability, 45 Rankine-Hugoniot conditions, 34
Jeans length, 46 Rayleigh-Taylor instability, 44
Jeans mass, 46 Reynolds number, 26
Riemann problem, 33, 74
Kármán vortex sheet, 26 Riemann solvers, 72
Kelvin-Helmholtz instability, 44 rotationally supported, 27
Keplerian motion, 27
kernel density estimation, 75 Saha equation, 49
kinematic viscosity, 26 scattering cross-section, 9
Lagrangian derivative, 5, 33 Schwarzschild stability criterion, 40
Lane-Emden equation, 24 screened potential, 60
Larmor radius, 54 Sedov-Taylor blast wave, 36
leap-frog integration, 79 self-gravitating system, 23
local thermodynamic equilibrium, 24 self-similar, 35
Lorentz force, 53 shear viscosity, 26
luminosity, 30 shock velocity, 34
smoothed-particle hydrodynamics, 75
Mach number, 34 solitons, 43
macroscopic, 3, 5 sonic point, 39
magnetic mirror, 56 sound speed, 31
magnetic moment, 56 sound-crossing time, 50
magnetic stress tensor, 65 stationary shock, 34
mass density, 14 statistical ensemble, 5
Maxwell-Boltzmann distribution, 10 statistical physics, 3
mean free path, 8, 9 strong form, 21
mean molecular weight, 47 substantial derivative, 5
metallicity, 47 supernova explosion, 35
metals, 47 surface density, 28
method of characteristics, 33 surface gravity waves, 43
microscopic, 3, 5
Moments of a Distribution, 12 thermal conductivity, 26
moments of the Boltzmann equation, 14 thermal diffusivity, 26
moments of the distribution function, 12, 13 thin disk, 28
turbulence, 23
Navier-Stokes equation, 25 two-fluid model, 61
neutron stars, 4
non-ideal hydrodynamics, 25 velocity divergence tensor, 22
optically thin, 48 virial theorem, 51
Vlasov-Maxwell equations, 60
phase-space, 4 vortex stretching, 23
phase-space density, 5 vortex tilting, 23
plasma frequency, 62 vorticity, 22
plasma parameter, 60 vorticity equation, 22
plasma-β, 65
Poisson’s equation, 23 wave equation, 31
polytropic equation of state, 21 wave function, 3
polytropic exponent, 21 wave steepening, 33
potential flow, 41 weak form, 21
primitive form, 20 white dwarfs, 4

82
Bibliography

83

You might also like