0% found this document useful (0 votes)
34 views

Computational Methods in Acoustics

This document provides an overview of computational methods in acoustics. It begins with an introduction to the finite difference method for numerically solving the Helmholtz equation and wave equation. It then discusses cellular automata methods, including lattice gases, the lattice Boltzmann method, and the transmission line matrix method. Next, it covers the finite element method for solving acoustic problems using weighted residual methods and Galerkin solutions. Following this, the boundary element method is introduced using the Kirchhoff-Helmholtz integral theorem. Finally, raytracing methods are discussed for applications in marine acoustics, atmospheric acoustics and room acoustics. The document serves as a compendium for the course "Numerical Ac

Uploaded by

Jitendra Itankar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Computational Methods in Acoustics

This document provides an overview of computational methods in acoustics. It begins with an introduction to the finite difference method for numerically solving the Helmholtz equation and wave equation. It then discusses cellular automata methods, including lattice gases, the lattice Boltzmann method, and the transmission line matrix method. Next, it covers the finite element method for solving acoustic problems using weighted residual methods and Galerkin solutions. Following this, the boundary element method is introduced using the Kirchhoff-Helmholtz integral theorem. Finally, raytracing methods are discussed for applications in marine acoustics, atmospheric acoustics and room acoustics. The document serves as a compendium for the course "Numerical Ac

Uploaded by

Jitendra Itankar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

7/30/2019 Computational Methods in Acoustics

C OMPUTATIONAL M ETHODS
IN A COUSTICS

U LF R. K RISTIANSEN
E RLEND M. V IGGEN

D EPARTMENT OF E LECTRONICS AND


T ELECOMMUNICATIONS — NTNU 2010

http://slidepdf.com/reader/full/computational-methods-in-acoustics 1/75
7/30/2019 Computational Methods in Acoustics

http://slidepdf.com/reader/full/computational-methods-in-acoustics 2/75
7/30/2019 Computational Methods in Acoustics

Contents

Preface v

1 The finite difference method 1


1.1 The Taylor series and finite differences . . . . . . . . . . . . . . . 1
1.1.1 Discretisation and finite differences . . . . . . . . . . . . 2
1.1.2 Higher order derivatives . . . . . . . . . . . . . . . . . . . 4
1.2 Helmholtz equation . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 Boundary conditions . . . . . . . . . . . . . . . . . . . . . 5
1.2.2 Matrix form . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Example: Simple model of a drum . . . . . . . . . . . . . . . . . 7
1.3.1 Governing equations . . . . . . . . . . . . . . . . . . . . . 8
1.3.2 Finite difference equations . . . . . . . . . . . . . . . . . . 9
1.3.3 Special cases . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 The wave equation . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4.1 Initial conditions . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.2 Reflection-free boundary conditions . . . . . . . . . . . . 12
1.4.3 Interface between two media, 1D example . . . . . . . . 13
1.5 Further topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.5.1 Creating difference schemes . . . . . . . . . . . . . . . . . 14
1.5.2 Approximation error . . . . . . . . . . . . . . . . . . . . . 15
1.5.3 Richardson extrapolation . . . . . . . . . . . . . . . . . . 16
1.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2 Cellular automata methods 19


2.1 Lattice gases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.1 The HPP model . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.2 The FHP model . . . . . . . . . . . . . . . . . . . . . . . . 22
2.2 The lattice Boltzmann method . . . . . . . . . . . . . . . . . . . . 24
2.3 The transmission line matrix (TLM) method . . . . . . . . . . . . 27
2.3.1 Basic theory . . . . . . . . . . . . . . . . . . . . . . . . . . 28

iii

http://slidepdf.com/reader/full/computational-methods-in-acoustics 3/75
7/30/2019 Computational Methods in Acoustics

iv

2.3.2 Sound sources and walls . . . . . . . . . . . . . . . . . . . 29


2.3.3 Further TLM topics . . . . . . . . . . . . . . . . . . . . . . 30
2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

3 The finite element method 33


3.1 Finite elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.1 Global and local basis functions . . . . . . . . . . . . . . 36
3.2 The weighted residual method . . . . . . . . . . . . . . . . . . . 38
3.2.1 Subdomain collocation . . . . . . . . . . . . . . . . . . . . 39
3.2.2 Point collocation . . . . . . . . . . . . . . . . . . . . . . . 39
3.2.3 Galerkin’s method . . . . . . . . . . . . . . . . . . . . . . 40
3.3 Galerkin solution of the Helmholtz equation . . . . . . . . . . . 40
3.3.1 In one dimension . . . . . . . . . . . . . . . . . . . . . . . 41
3.3.2 In higher dimensions: General solution . . . . . . . . . . 43
3.3.3 General boundary conditions . . . . . . . . . . . . . . . . 44
3.4 Different types of elements . . . . . . . . . . . . . . . . . . . . . . 45
3.4.1 Isoparametric elements . . . . . . . . . . . . . . . . . . . 46
3.4.2 One-dimensional pipe elements . . . . . . . . . . . . . . 47
3.4.3 Infinite Bettess elements . . . . . . . . . . . . . . . . . . . 48
3.4.4 Wave envelope elements . . . . . . . . . . . . . . . . . . . 49
3.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

4 The boundary element method 50


4.1 The Kirchhoff-Helmholtz integral theorem . . . . . . . . . . . . 50
4.1.1 Free field . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.2 Discretisation of the surface integral . . . . . . . . . . . . . . . . 54
4.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5 Raytracing methods 57
5.1 The ray approximation . . . . . . . . . . . . . . . . . . . . . . . . 58
5.2 Raytracing for marine and atmospheric acoustics . . . . . . . . . 61
5.3 Room acoustics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

http://slidepdf.com/reader/full/computational-methods-in-acoustics 4/75
7/30/2019 Computational Methods in Acoustics

Preface

What am I reading?
This compendium is written for the course TTT12 Numerical acoustics at the
Norwegian University of Science and Technology. In earlier years, the curricu-
lum of this course was a collection of articles, mostly written by Ulf Kristiansen
in Norwegian. These articles have been collected, translated to English, rewrit-
ten and expanded by Erlend Viggen, and the result is this compendium! We
hope you’ll find it useful.

Why computational acoustics?


In acoustics, and in most other fields of physics for that matter, the equations
that govern the behaviour of physical systems are well-known. For instance,
the wave equation describes how sound propagates. We can find analytical
solutions to these equations in a few simple special cases, but for more com-
plex cases it quickly becomes virtually impossible to find a solution by direct
analytical calculation.
Computational physics saves us from this mess, making it possible to find
approximately correct solutions to these more complex cases. We simplify the
analytical problem into a problem of doing many smaller calculations, which
give us the desired result. In the old days, before digital computers existed,
these smaller calculations were done by hand by humans — whose job title
actually was “computer”! Nowadays, almost everything is done on digital
computers, making it feasible to handle very large computations.
Naturally, computational physics has increased in popularity as computers
have increased in power. Nowadays, it is seen a separate branch of physics,
along with theoretical and experimental physics.
Computational acoustics is used throughout the entire acoustic industry.
Automobile manufacturers simulate the acoustics of cars to determine how
much noise they will create. Loudspeaker manufacturers simulate the acoustic
 behaviour of loudspeaker cabinets before building prototypes. Acoustic con-
sultants simulate the acoustics of concert halls before they are built. After all,
it’s much cheaper and more effective to correct the acoustics of the concert hall

http://slidepdf.com/reader/full/computational-methods-in-acoustics 5/75
7/30/2019 Computational Methods in Acoustics

vi

before it is built rather than after.


Although there exist several different computer programs that can do per-
form different kinds of acoustic simulations, these are limited in usefulness
without any understanding of how they work. With this understanding, it is
possible to do simulations that are more correct, more effective and more rele-
vant.

What will I learn from this compendium?


You will be introduced to a wide variety of different computational methods
which can be used to perform acoustic simulations on the computer. You will
learn the basics of these methods, and you will be able to implement many of 
them as computer programs.
In short, this compendium gives you an extremely useful skill: The ability
to write your own computer programs to simulate a wide variety of acoustical
problems. Not bad!

What if I find an error?


While we have tried not to include any mistakes in the text, there may be some
errors left. If you find an error anywhere in the compendium, mathematical
or lingual, tell Erlend Viggen and he’ll fix it. Corrections and suggestions are
very much appreciated.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 6/75
7/30/2019 Computational Methods in Acoustics

Chapter 1
The finite difference method

The finite difference method is one of the most classic methods in numerical
analysis of differential equations. Instead of trying to find an exact solution of 
a differential equation in an entire domain (e.g. finding the sound field in a
room), one attempts to find approximate solutions at a number of points in the
domain.
These points are placed on the nodes of a grid which covers the entire do-
main. With a clever choice of grid, we can find solutions in domains of pretty
much any shape. The fineness of this grid generally determines how good the

approximate
In the finitesolution is. method, partial differential equations are discretised.
difference
Derivatives in the equations can be directly replaced by approximations which
can be found from the Taylor series, so that each node’s value ends up depend-
ing on its neighbours’ values. This gives a system of linear equations which
may be solved directly on a computer. Thus, the finite difference method is
very direct, simple, and powerful.
In this chapter, we will describe how finite differences can be found from
the Taylor series, and show how the Helmholtz equation and the wave prop-
agation can be discretised. We will also give an example of a system with a
coupling of vibrations and acoustics.

1.1 The Taylor series and finite differences


It is known from earlier courses that any smooth function f ( x) can be rewritten
as a Taylor series around a point c,


f  (c)  (i )
 f ( x) = f (c) +
1!
(x − c) + f  2!(c) (x − c)2 + . . . = ∑  f  i!(c) (x − c)i . (1.1)
i =0

The Taylor series is a sum of an infinite number of terms. It is possible to

http://slidepdf.com/reader/full/computational-methods-in-acoustics 7/75
7/30/2019 Computational Methods in Acoustics

2 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

truncate this series as


f  (c) (n )
 f ( x ) = f (c) +
1!
(x − c) + . . . + f  n!(c) + Rn (x), (1.2)

where the term Rn is called the remainder, and is given by

f (n+1) (ξ )
Rn ( x ) =
(n + 1) !
(x − c ) n +1 , (1.3)

where ξ is a value between c and x. We will now examine how the Taylor series
is useful for creating finite difference expressions, i.e. estimating derivatives of 
 f ( x) at some point x from f ( x) itself.

20
ex
2 terms
15 4 terms
6 terms
8 terms
10

−5−3 −2 −1 0 1 2 3
x

Figure 1.1: By including more and more terms of the Taylor series of e x , we see
that the series converges to the desired function.

1.1.1 Discretisation and finite differences

We assume
ential thatDwe
operator mayhave a differential
contain equation
derivatives ) = 0, where
Dφ(xorders.
of different ∗ the differ-
We wish to examine the function φ( x) over an interval 0 x Lx , and ≤ ≤
start by discretising the independent variable x. We restrict x to a discrete set
of M + 1 different values xi , where

x i +1 − xi = ∆ x and xi = i ∆ x, for i = 0 , 1 , . . . , M. (1.4)

The distribution of nodes is shown in Figure 1.2.


∗ For instance, the Helmholtz equation can be written in one dimension with a differential op-
erator D = ∂2 /∂ x2 + k 2 .

http://slidepdf.com/reader/full/computational-methods-in-acoustics 8/75
7/30/2019 Computational Methods in Acoustics

1.1 T HE TAYLOR SERIES AND FINITE DIFFERENCES 3

0 ∆x 2∆ x i∆ x M∆ x
Figure 1.2: M + 1 nodes spaced evenly with a spacing ∆ x.

The differential terms in the operator D can be replaced with finite differ-
ences. These are found from the Taylor series in equation 1.2, which can now
 be written as
d ∆ xn dn
φ ( x i +1 ) = φ ( x i + ∆ x ) = φ ( x i ) + ∆ x φ ( xi ) + . . . + φ( xi )
dx n! dx n
(1.5)
∆ x n +1 d n +1

+ (n + 1)! dx n+1 φ( xi + θ x),
where 0 < θ < 1.
The last term in this series is the remainder, as in equation 1.3. We can for
instance let the second derivative term represent the remainder. Abbreviating
φ( xi ) to φi , we then find

dφi ∆ x2 d2
φi+1 = φi + ∆ x + φ ( x i + θ ∆ x ), (1.6)
dx 2! dx 2
giving

dφi φi+1 φi ∆ x d2
= + ( + ∆ )
dx −∆x 2! dx 2 φ xi θ x (1.7)
φi+1 − φi
= + O ( ∆ x ).
∆x

The remainder is proportional to ∆ x, or in other words, (∆ x). This means O


that if we remove it, the equation gets an approximation error proportional to
∆ x.
Equation 1.7 is called a forward difference approximation of the first deriva-
tive of φ(xi ), since we estimate the derivative by looking forward. We can find
the backward difference approximation by first using the Taylor series to esti-
mate φ( xi−1 ),
2 2
φi−1 = φi
dx + ∆2!
− ∆x dφi x
dx 2 ( i
d φ x − θ ∆ x ). (1.8)

From this, we obtain


dφi
= i
φ φi−1 −
+ (∆ x ). O (1.9)
dx ∆x
If instead we let the third order term in the Taylor series represent the re-
mainder, we can find expressions for φi+1 and φi−1 which can be combined to
find an expression for the central difference equation,

dφi φ
= i +1
φi−1
+
− O ( ∆ x 2 ). (1.10)
dx 2∆ x

http://slidepdf.com/reader/full/computational-methods-in-acoustics 9/75
7/30/2019 Computational Methods in Acoustics

4 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

We see from the error term that the central difference approximation gets better
as ∆ x → 0 faster than the forward and backward difference approximations.
Therefore, it is generally a much better idea to use central differences than
forward or backward differences.
Figure 1.3 shows a comparison of how well forward, backward and central
difference schemes find the derivative of sin( x) at x = 1 with widely spaced
nodes.

0.8

0.6 sin(x )
Actual derivative
Forward difference
Backward difference
0.4
Central difference

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2


x

Figure 1.3: Approximations to the derivative of sin( x) at x = 1, with ∆ x = 0.5.

1.1.2 Higher order derivatives


By including an increasing number of terms in the Taylor series and combin-
ing different series, we can find approximations for the first four derivatives,
where all equations have approximation errors of  (∆ x2 ): O
dφi
dx
≈ φi+12−∆xφi−1 , (1.11a)
2
d φ2i
dx
≈ φi+1 − ∆2φxi2 + φi−1 , (1.11b)
d3 φi
dx 3
≈ φi+2 − 2φi+21 ∆+x2φ
3
i −1 − φi −2
, (1.11c)
d4 φi
dx 4
≈ φi+2 − 4φi+1 + ∆6φxi4 − 4φi−1 + φi−2 . (1.11d)

Expressions for approximated derivatives where the error is even smaller


(i.e. (∆ x4 ), (∆ x6 ), etc.) are sometimes necessary. We would then need to
O O
use even more points around the node where the derivative is being calculated.
For studies of sound propagation over long distances in the time domain, both

http://slidepdf.com/reader/full/computational-methods-in-acoustics 10/75
7/30/2019 Computational Methods in Acoustics

1.2 H ELMHOLTZ EQUATION 5

pressure and particle velocity are occasionally computed via first order differ-
ential expressions. To minimize dispersion, eighth order differences may be
necessary in some cases.

1.2 Helmholtz equation


As our first acoustic example, we imagine wave propagation in a long pipe of 
length Lx . We write the Helmholtz equation for plane harmonic waves with
wavenumber k , moving in x direction,

∂2 p
+ k 2 p = 0. (1.12)
∂x2
We can write this in a finite difference form for node i by replacing the double
derivative with the finite difference expression from equation 1.11b,

 pi+1 − 2 pi + pi−1 + k 2 pi = 0. (1.13)


∆ x2

This results in a system of linear equations which relate the values of the
node pressures to each other. To be able to solve this system of equations,
we will need to know something about the edges of the system, the boundary
conditions.

1.2.1 Boundary conditions


Some possible boundary conditions for this pipe are open ends (also known as
a homogenous Dirichlet condition), hard walls (known as a homogenous Neu-
mann condition), an impedance boundary condition, and a velocity condition
(for instance caused by a piston). We go through all of these in order.

Open ends
Since we have the boundary condition p = 0 at the mouth of an open pipe, we
 M −2  M −1  M
get the conditions p0 = 0 and p M = 0 at the end nodes of the system if both
ends of the pipe are open to air.
If we need to find the pressure at a node beyond the end of the pipe (say,
a node at i = M + 1), we can find this by examining the finite difference
Helmholtz equation at the end node at i = M,

 p M+1 − 2 p M + p M−1 + k 2 p M = 0 p M =0


⇒ p M+1 + p M−1
= 0, (1.14a)
∆ x2 ∆ x2

which tells us that p M+1 =  p M−1 .


http://slidepdf.com/reader/full/computational-methods-in-acoustics 11/75
7/30/2019 Computational Methods in Acoustics

6 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

Hard walls
For hard walls, we wish the particle velocity normal to the surface to be zero.  M −2  M −1  M

From the linear Euler’s equation, we find that

uwall =
1 ∂ p
 = 0. (1.15)
−  jωρ ∂x wall

For the end node at i = M, we can write this boundary condition in finite
difference form as

 p M+1  p M−1
= 0, (1.16)
2∆ x
so that p M+1 = p M−1 . This means that for the wall node M, the discretised
Helmholtz equation (1.13) becomes
2 p M−1 − 2 p M + k 2 p M = 0. (1.17)
∆ x2

Impedance boundary condition


If we have a given impedance Z M in the end node at i = M, we can find the
value in a “fictional” exterior point at i = M + 1 through  M −2  M −1  M

p M p M
Z M = = 1  p M+1  p M−1 − , (1.18)
u M

 jωρ 2∆ x

so that
 p M+1 = p M−1 − 2 jωρZ∆ Mx p M . (1.19)

Note that the nodes are now related to each other through a complex num-
 ber. Since we are solving the Helmholtz equation, a complex pressure ampli-
tude implies a phase shift.

Pipe driven with a given velocity


If we have a boundary, for instance at a moving piston, where the particle
velocity u is given, we can implement this by pinning the particle velocity u M  M −2  M −1  M

at the node to a certain value. In equation 1.19, we can replace Z M with p M /u M

to get  p M+1 = p M−1 − 2 jωρ∆x u M . (1.20)

1.2.2 Matrix form


When the discretised Helmholtz equation has been written for each node, the
system of equations can be written in matrix form. We will look at an example
of a pipe which is open at x = 0 and driven by a piston with a given velocity
u M at x M = Lx , which gives a system

(A + k 2 I)p = b, (1.21)

http://slidepdf.com/reader/full/computational-methods-in-acoustics 12/75
7/30/2019 Computational Methods in Acoustics

1.3 E XAMPLE : S IMPLE MODEL OF A DRUM 7

where I is the identity matrix. More explicitly, this is

 − 2 1
    p1
  0

 1 − 2 1     p2   0 
1 1 −2 1  p3 0
+ k 2 I    =   . (1.22)
 ∆ x2  ..
 .. ..
. .   . 
2 −2  p M 2 jωρu M
∆x

Note how we get a tridiagonal matrix, since we are using a central difference
method to approximate ∂2 p/∂x2 .
If we were to solve for p, we would first need to set values for ω and k , in

addition to2 the other constants. Then, we would be able to find p by inverting
the (A + k  I) matrix,

p = (A + k 2 I) −1 (A + k 2 I) p = (A + k 2 I)−1 b. (1.23)

If we have (A + k 2 I) and b in M ATLAB as a matrix called B and a vector called


b, we can find p through left matrix division, p = B b. (This is MATLAB ’s \
well-optimized way of calculating expressions like equation 1.23.)
The values of  k  corresponding to eigenmodes of a system can sometimes
 be found directly from the matrix A. If we have openings in both ends of the
pipe, the matrix equation becomes

(A + k 2 I)p = 0. (1.24)

We note that this resembles the eigenvalue equation

(A − λ I) p = 0 , (1.25)

with k 2 = λ. Therefore, eigenmode values of k can be found through finding



the eigenvalues λ of  A.∗

1.3 Example: Simple model of a drum


In this section we present a finite difference model for a basic coupled system.
The model is sketched in Figure 1.4. A circular drum skin (an ideal membrane)
is coupled to a hard walled tube. Only axisymmetric motion in assumed for
the membrane, and the acoustic motion is assumed one-dimensional. One goal
is to model with very few degrees of freedom, so that the analytic equations for
the resonant wavenumbers might be obtained and discussed.

∗ For more information on finding eigenvalues, see for instance Elementary Linear Algebra by
C.H. Edwards, Jr. and D.E. Penney.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 13/75
7/30/2019 Computational Methods in Acoustics

8 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

6
Membrane
a
1 2 3

 y
4
L

Acoustic
cavity

Figure 1.4: Geometry of the problem on the left, with discretisation nodes
shown and labelled on the right.

1.3.1 Governing equations

The membrane is governed by Newton’s second law, relating the force per
area caused by tension and pressure with the acceleration of the membrane.
The equation becomes


 ∂2 η 1 ∂η
+
 ∂2 η
+ p = σ  2 , (1.26)
∂r2 r ∂r ∂t

where η is the displacement away from the cavity (i.e. in negative y direction),
T the tension and σ the mass density per area. The air in the acoustic cavity is
governed by the wave equation,

∂2 p 1 ∂2 p
= 0. (1.27)
∂ y2 − c2a ∂t2
In addition, a coupling equation for the membrane/cavity interface can be
found from the linear Euler’s equation and written as

∂ p ∂2 η
=ρ 2. (1.28)
∂ y ∂t

We assume harmonic time variation and seek the eigenvalues of the system.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 14/75
7/30/2019 Computational Methods in Acoustics

1.3 E XAMPLE : S IMPLE MODEL OF A DRUM 9

We rewrite the equations as


 ∂2 η 1 ∂η 
T  + + σω 2 η + p = 0, (1.29)
∂r2 r ∂r
∂2 p ω2
+ 2  p = 0, (1.30)
∂ y2 ca
∂ p
=  ρω 2 η.
− (1.31)
∂ y
We also have a set of boundary conditions. At the open end at y = L (point 5),
we have that p = 0. As the membrane is fixed at its ends, η = 0 at r = a (points
1 and 3). Also, we assume axisymmetric displacement of the membrane, so
that ∂η/∂r = 0 for r = 0 (point 2). Note the introduction of point 6, an outside

non-physical point. equation (1.29) must be written for point 2 (r = 0), the
As the membrane
second term in the parenthesis poses a problem, as ∂η/∂r 0 while 1/r ∞→ →
when r → 0. This is solved by using l’Hôpital’s rule, giving
∂2 η
2T  2 + σω 2 η = 0. (1.32)
∂r

1.3.2 Finite difference equations


For point 2, equation 1.32 becomes
η
4T  22 + σω 2 η2 + p2 = 0.
− (1.33)
∆r
The Helmholtz equation (1.30) at the same point becomes
 p4 − 2 p2 + p6 + ω2 p2 = 0, (1.34)
∆ y2 c2a
while the Helmholtz equation for point 4 becomes
−2 p4 + p2 + ω2 p2 = 0. (1.35)
∆ y2 c2a
The coupling equation for membrane displacement and pressure (1.31) be-
comes
 p4  p6 −
=  ρω 2 η2 . − (1.36)
2∆ y
In the above equations, p5 , η1 , and η3 have been set to zero. p6 is eliminated by
combining equations 1.36 and 1.34.
The unknowns of the system are p2 , p4 , and η2 , meaning that we have a
system with three degrees of freedom.
Simple algebra on the above equations gives a somewhat complicated re-
sult,
2 ω2 ∆ y2
ω2 ∆ y2
 c2

2 2 ρ∆ y ω2 ∆r2
2
2 + 2a 2
− 2 = 0, − (1.37)
ca ω ∆r
2 4 σ  c2m

c m

where cm is the membrane wave velocity, given by c2m = T /σ .

http://slidepdf.com/reader/full/computational-methods-in-acoustics 15/75
7/30/2019 Computational Methods in Acoustics

10 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

1.3.3 Special cases


Some physical insight might be gained by inspecting a few special cases of this
equation.

In vacuo  membrane
If the membrane is not coupled to air in any way, for instance if it is in a vac-
uum, the resonant membrane wavenumber is given directly from equation 1.33
as
ω
k m a =
T /σ 
√ 
∆r = 2. (1.38)

The analytical value is found from the zeroth order Bessel function as k m a =
2.41 (found from J 0 (k m a) = 0). The “one active node” membrane equation
therefore gives a value which is 83 % of the analytical value. This is a fairly
good result, considering we have only used three nodes to get this result, two
of which were set to zero.

T  →∞
When we let T  approach infinity, we essentially make the membrane a hard
wall. Since cm also approaches infinity, equation 1.37 loses the large second
term, and can be simplified to

k a L = 2 2
 ± √  2. (1.39)

The lowest possible wavenumber, found by using the minus sign, gives the
fundamental wavenumber of an open/closed waveguide as k a L 1.531, which ≈
is within 2.6 % of its analytical value of k a L = π /2.

T  = 0
In this case, the membrane acts as a limp mass. cm now goes to zero, so that
we can simplify equation 1.37 to

ω2 ∆ y2 ω2 ∆ y2 2 ρ∆ y


 c2a 2
−  c2a −2  + σ 
− 2 = 0. (1.40)

That is, for a given geometry, the angular frequency depends on the ratio of 
the area mass density of the cavity fluid divided by the area mass density of 
the membrane. √  ≈
In the limit of σ → 0, the equation gives a value k a L = 8 2.83, which
approaches the analytical value for an open end of  π with an error of 10%.

In the limit of  σ  ∞, we essentially assume the membrane to be a hard
wall. Equation 1.40 also reduces to equation 1.39, giving the same result of 

k a L 1.531, which is nearly the hard-wall analytical result of  π /2.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 16/75
7/30/2019 Computational Methods in Acoustics

1.4 T HE WAVE EQUATION 11

1.3.4 Summary
We see that even with this extremely simple model, we find a solution to the
Helmholtz equation which actually is fairly correct in the special cases we have
looked at. The results would be even better if we had used more nodes on
the membrane and inside the drum, but the resulting equations would be so
complex that we would need to solve them numerically on a computer.

1.4 The wave equation


So far, we have looked only at the Helmholtz equation, which is the time-
independent form of the wave equation. The wave equation includes both

space and time derivatives. Therefore, we now need to discretise both in space
and in time.
As an example, we use a 1D system and call our discretisation lengths ∆ x
and ∆t. In the same way as the x coordinate is given by xi = i∆ x, the time t is
given as tk  = k ∆t, where k now is our time index. We thus denote the pressure
at different points in space and time as

 p( xi , tk ) = pik . (1.41)

Thus, the one-dimensional wave equation,

∂2 p 2

∂x2
− c12 ∂∂t p2 = 0, (1.42)

is discretised to
 pk i+1 − 2 pk i + pk i−1 − 1  pk i +1 − 2 pik  + pik −1 = 0. (1.43)
∆ x2 c2 ∆ t2
This means that we can compute the pressure value of node i for the next time
step (k  + 1) by knowing the pressure at point i at the current (k ) and previous

(k  1) time step, as well as the current values in the neighbouring nodes (i 1 −
and i + 1).
Solving for pk i +1 , we get

 pk i +1 = 2 1 α2  pik  + α2  pik +1 + pik  1  pk i −1 , (1.44)


−   − −
where α = c∆∆xt , which can be physically interpreted as the travelled length
of the signal during a time step ∆t compared to the node spacing ∆ x. For a
one-dimensional simulation, it is necessary for stability reasons that α 1.∗ ≤
For the two-dimensional wave equation, the wave equation is given by

∂2 p ∂2 p 2

∂x2
+ 2
∂ y
− c12 ∂∂t p2 = 0. (1.45)

∗ This can be shown either from von Neumann stability analysis or the CFL condition, which
we will not go into in this text.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 17/75
7/30/2019 Computational Methods in Acoustics

12 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

Assuming an equal node spacing in both directions (i.e. ∆ y = ∆ x), we can find
in a similar manner that
 pk i, + 1
j =2 1
−  
2α2  pk i, j + α2  pk i+1, j + pik −1, j + pk i, j+1 + pik , j−1
−  pk i, − 1
j , (1.46)

where j is the node index in y direction (i.e. y = j∆ y).


For three-dimensional axisymmetric geometries, the wave equation is given
 by
∂2 p 1 ∂ p ∂2 p 1 ∂2 p
+ + = 0. − (1.47)
∂r2 r ∂r ∂ z2 c2 ∂t2
Discretising this and solving for pk i, + 1
j , where i is the r index and j is the z index,
we get

1
 pk i, + 2α2  pk i, j + α2  pk i+1, j + pik −1, j + pk i, j+1 + pk i, j−1
−  
j =2 1

(1.48)
α2 − − − −
+  pk   pik  1, j  pk i, j 1 .
i ∆r i+1, j
For axisymmetric systems we have a special case for r 0, since the r →
coordinate is a denominator in the second term in the wave equation. We can
observe that the numerator in the term, ∂ p/∂t, also must go to zero due to
axisymmetry. We can then use L’Hôpital’s rule to find that

∂ p/∂r ∂2 p
lim = 2. (1.49)
r →0 r ∂r
For the two-dimensional and three-dimensional axisymmetric forms of the
wave equation, stable calculations require that α 1/ 2.∗ ≤ √ 
1.4.1 Initial conditions
We saw that to calculate the pressure in time step k + 1, we need to know both

the pressure in time step k  and k  1. This gives us a problem when starting
our simulation, since it means that we cannot simply set up a single pressure
field for t0 = 0 in our domain and let it propagate. This is because we would
also need to know what the pressure field is at t−1 = ∆t. −
This is not a problem if we want to simulate a wave which propagates from
a single source. We then typically wish to pin the pressure at a certain node to
some time-varying function, i.e. a sine function. We can then assume that this
source is turned on at t = 0, so that there is no pressure field present for t 0. ≤
We can thus dodge the problem described in the previous paragraph.

1.4.2 Reflection-free boundary conditions


This can be achieved in different ways. One way is to write the equations for
the outer parts of the discretised area in such a way that they are valid only for
∗ Again, this can be shown either from von Neumann stability analysis or the CFL condition.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 18/75
7/30/2019 Computational Methods in Acoustics

1.4 T HE WAVE EQUATION 13

one-way wave motion, moving out of the solution area. Another way is to put
a damping layer on the outside of the area so that the wave will be damped
gradually. This method is called the perfectly matched layer (PML) method. We
now take a closer look at the first method.
In one dimension, as for wave propagation in a pipe, the wave equation is
given by
∂2
 1 ∂2
−  p = 0.
 (1.50)
∂x2 c2 ∂t2
This can be factorised as
 1 ∂
+

 1 ∂
− ∂x∂
  p = 0. (1.51)
c ∂t ∂x c ∂t

Each factor represents a one-dimensional wave equation for waves in positive


and negative direction, respectively. These are called the one-way equations,
as they allow wave propagation in only one direction.
The problem is that such expressions can easily be written for plane waves
normally incident on the walls, but not for more complex waveforms. For two-
dimensional expressions, Alistair C. Reynolds found [1] an expression of the
form     ∂2
1 ∂ ∂ 1 ∂ y2
± 1+
    p = 0, (1.52)
 c ∂t ∂x 2 ∂2
∂x2

with the + sign indicating waves moving in positive x or y direction and the
− sign indicating waves moving in negative x or y direction.

1.4.3 Interface between two media, 1D example


Two media, with densities ρ1 and ρ2 and speeds of sound c1 and c2 , have an
interface at node M, as shown in Figure 1.5. The boundary conditions to be
fulfilled are continuity in sound pressure and particle velocity.

 M −1 M − 1/2 M M + 1/2 M+1

Figure 1.5: Interface between two media at node M.

Denoting pressure in the first medium as p(1) and pressure in the second
as p(2), the first boundary condition is given by

 p(1) M = p(2) M , (1.53)

http://slidepdf.com/reader/full/computational-methods-in-acoustics 19/75
7/30/2019 Computational Methods in Acoustics

14 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

while the second condition is given from the linear Euler’s equation as

1 ∂ p(1) M 1 ∂ p(2) M
= (1.54)
 ρ1 ∂x  ρ2 ∂x

The wave equation for each material can be written as

1 ∂2 p(1) 1 ∂2 p(1)
2
= , (1.55)
 ρ1 ∂x  ρ1 c21 ∂t2

and
1 ∂2 p(2) 1 ∂2 p(2)
= . (1.56)
 ρ2 ∂x2  ρ2 c22 ∂t2
The two equations are now integrated with respect to x from M 1/2 to −
 M, and M to M + 1/2 respectively, while the sound pressure is considered
constant in the hatched area in Figure 1.5. We get that

1 ∂ p(1) M
− ∂ p(1) M−1/2
− 1 ∆ x ∂2 p(1)
= 0, (1.57)
 ρ1 ∂x ∂x  ρ1 c21 2 ∂t2

and  −
1 ∂ p(2) M+1/2 1 ∆ x ∂2 p(2)
 ρ2 ∂x
− ∂ p(∂x2) M  ρ2 c22 2 ∂t2
= 0. (1.58)

By writing these equations in a finite difference form, adding them, and us-
ing the boundary conditions in equations 1.53 and 1.54, we find for the bound-
ary point M that

1

1 k 
 p −
 1
+
1 k 
 p M
 1 k 
+  p M

∆ x  ρ2  M+1
2  ρ1  ρ2  ρ1 −1
  (1.59)
− 1 1
+
1 k +1
p M − 2 p Mk  + p Mk −1 = 0.
2  ρ1 c1  ρ2 c22
2 ∆ t2

This equation is really just a more general version of equation 1.43. If we let
 ρ1 = ρ2 = ρ and c1 = c2 = c, the two equations become identical.

1.5 Further topics


We will now look at a few mathematical aspects of the finite difference method.

1.5.1 Creating difference schemes


In section 1.1, we saw how to derive the simplest first-order forward and back-
ward difference schemes, but did not look at how to derive better schemes. We
will now look closer at this.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 20/75
7/30/2019 Computational Methods in Acoustics

1.5 F URTHER TOPICS 15

The Taylor series for φi+2 , φi+1 , φi−1 , and φi−2 can be truncated to
2 2 3 3
4∆ x d φi 8∆ x d φi 16∆ x d φi 4 4
φi+2 ≈ φi + 2∆x dφ
dx
i
+
2 dx 2
+
6 dx 3
+
24 dx 4
, (1.60a)
dφ ∆ x2 d2 φi ∆ x3 d3 φi ∆ x4 d4 φi
φi+1 ≈ φi + ∆ x i + + + , (1.60b)
dx 2 dx 2 6 dx 3 24 dx 4
dφ ∆ x2 d2 φi ∆ x3 d3 φi ∆ x4 d4 φi
φi−1 ≈ φi − ∆ x i + 2
− 3
+ , (1.60c)
dx 2 dx 6 dx 24 dx 4
dφ 4∆ x2 d2 φi 8∆ x3 d3 φi 16∆ x4 d4 φi
φi−2 ≈ φi − 2∆ x i + − 6 dx3 + 24 dx4 . (1.60d)
dx 2 dx 2
This system of equations can be more conveniently written in matrix form,

φ
2
φii+
A
 +1

 −  φi
1 0 1 0 0 2 2 4/3 2/3
  φi−1 
 0 − 1 1 0 0 1 1/2 1/6 1/24   φi−2
 ≈ 0. (1.61)
0 0 1 − 1 0− 1 1/2 − 1/6 1/24 dφ
 ∆ x dxi
0 0 1 0 − −
1 2 2 − 4/3 2/3 d2 φ
∆ x2 dx 2i 
d3 φ
∆ x3 dx 3i
 d4 φ

∆ x4 dx 4i

We can find difference schemes by linear combination of the rows of  A. For
A
instance, 1 − 2A2 + 2A3 − A4 results in the equation
3
− φi+2 + 2φi+1 − 2φi−1 + φi−2 + 2∆x3 ddxφ3i ≈ 0, (1.62)

which can be rewritten as


d3 φi
dx 3
≈ φi+2 − 2φi+21 ∆+x2φ
3
i −1 − φi−2
. (1.63)

This scheme is familiar from equation 1.11c. If we include more terms in


our Taylor series and include more points, we can derive any finite difference
scheme to arbitrary order with this method.
This is one of several methods to derive finite difference schemes. There
exist more direct methods, such as the method of undetermined coefficients, but
these are more complicated.

1.5.2 Approximation error


As we saw in section 1.1.1, the finite difference method gives out an approxi-
mation of the exact solution to the problem. The approximation error is directly
linked to the discretisation: For example, we saw that the errors in forward and
 backward difference approximations of the first derivative are proportional to
∆ x, while the errors in the central difference approximation are proportional

http://slidepdf.com/reader/full/computational-methods-in-acoustics 21/75
7/30/2019 Computational Methods in Acoustics

16 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

to ∆ x2 . We therefore say that the forward and backward difference scheme is


first order, while the central difference scheme is second order.
Given an unknown finite difference scheme, it is not immediately obvi-
ous how large its approximation errors are. We will now see how they can be
found.
As an example, let’s take the central difference approximation of the second
derivative, which we have used to discretise the Helmholtz and wave equa-
tions. If we replace φi+1 and φi−1 with their Taylor series, we find that
φi +1 − 2φi + φi−1 = 1
 dφ
φi + ∆ x i +
∆ x2 d2 φi
+
∆ x 3 d3 φi
+
∆x 4 d4 φi
+ O ( ∆ x5 )
∆x 2 ∆x 2 dx 2 dx 2 6 dx 3 24 dx 4
− 2φi
dφi ∆ x2 d2 φi ∆ x 3 d3 φi ∆ x4 d4 φi
∆ ∆ 5
+ φi − x dx + 2 dx 2 − 6 dx 3 + 24 dx 4 + O( x ) ,
which becomes
φi+1 − 2φi + φi−1 = d2φi + ∆x2 d4 φi + O(∆x3 )
∆ x2 dx 2 12 dx 4 (1.64)
2
d φi
= + ( ∆ x2 ) .
O
dx 2
We have now shown that this numerical scheme estimates d2 φi /dx 2 with
an approximation error which scales as ∆ x2 .

1.5.3 Richardson extrapolation


If we know the order of the error term in the method used to calculate some-
thing, we can use a trick called Richardson extrapolation to find a good estimate
from two poorer ones.
As an example, let’s say we want to numerically find the wave number k of 
the fundamental of an open-ended pipe of  L = 1 m length. Since this funda-
mental has a wavelength of 2L, the analytical solution to this is k  = 2π /λ =
2π /2L = π .

(a) Three nodes (b) Four nodes

Figure 1.6: Numerical estimation of the fundamental in an open-ended pipe.

This problem is simple to solve numerically using the standard discretised


Helmholtz equation (1.13), and setting the end nodes’ values to zero. If we use √  ≈
three nodes to discretise the pipe ( ∆ x = 1/2), we find a value k  = 8 2.83.
If we use four nodes ( ∆ x = 1/3), we find k  = 3. These values seem to be

http://slidepdf.com/reader/full/computational-methods-in-acoustics 22/75
7/30/2019 Computational Methods in Acoustics

1.6 S UMMARY 17

converging towards π , which is what we want to find. But we will now see
how we can find a very good result based on these two relatively poor results.
Since we know that the numerical scheme used in the estimation has an
approximation error (∆ x2 ), it is not unnatural to assume that the difference
O
 between the exact solution k ex and the numerical solution k (∆ x ) is

k ex − k (∆x) ≈ K ∆x2, (1.65)

where K  is some constant. Connecting two different estimates k (∆ x1 ) and


k (∆ x2 ) through K , we find that

k ex − k (∆x1) ≈ k ex − k (∆x2) ,


∆ x12 ∆ x22

⇒ k ex ≈ k (∆x1)∆∆xx22 −− k ∆(x∆2x2)∆x21 . (1.66)


2 1

Using the values we found for ∆ x1 = 1/2 and ∆ x2 = 1/3, we find that
k ex ≈ 3.1373, which is a very good approximation of  π . Directly finding a
result of similar quality would actually require using 18 nodes in the discreti-
sation!

1.6 Summary
In this chapter, we have seen how to use the finite difference method to discre-
tise the Helmholtz equation and the wave equation.
For the Helmholtz equation, the result of the discretisation was a system of 
equations relating the pressure at a node with the pressure at its neighbouring
nodes through the wavenumber k and the spatial resolution ∆ x. If this system
of equations is small, it can be solved by hand. If it is large, it should be written
in matrix form and solved by inversion of the matrix.
For the wave equation, the discretisation resulted in an equation giving
the pressure for every node at time step tk +1 as the pressures in the node and
its neighbours at tk  and the pressure of the node at tk −1 . For stability in one
dimension, we need to have c∆∆xt 1. In two-dimensional and an axisymmetric

three-dimensional simulations, we need to have c∆∆xt 1/ 2. ≤ √ 
Generally,
which the finite
any partial difference
differential method
equation is abefairly
can straightforward
discretised. method in
This discretisation
can be used to find an approximate solution to the equation, given appropriate
 boundary conditions (and initial values, for time-dependent equations).
While the finite difference method is powerful and simple, it is not simple
to adapt it properly to boundaries of arbitrary shape. For instance, how to
discretise the circular boundary in Figure 1.7? Some solutions to that problem
are:

• Finer grid: Make the entire grid finer. This will improve the approximation
around the boundary at the cost of strongly increased computation time.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 23/75
7/30/2019 Computational Methods in Acoustics

18 C HAPTER 1 T HE FINITE DIFFERENCE METHOD

Figure 1.7: Circular boundary wall, along with suggested discretised approxi-
mation.

• Adaptive grid: Make the grid finer locally around difficult boundaries. This is
somewhat complicated in practice.

• Improved boundary conditions: Use improved boundary conditions which


can take into account a wall placed anywhere between two adjacent nodes.
Also quite complicated.

All in all, there is no simple, good way to do this in the finite difference method.
This is one of the reasons why the finite element method has gained popularity,
since it elegantly handles complicated boundaries. We go into this method in
Chapter 3.
Also, computer hardware limits how fine you can make a grid. This limit
is quite strict in three dimensions: If you have M nodes along each edge, you
get a total of M3 nodes. This quickly gets out of hand for larger rooms, such as
cinemas and concert halls!
If we want to be able to represent frequencies of up to 20 000 Hz, we need
a theoretical minimum spatial resolution of  ∆ x = λ/2 = 8.5 10−3 m. As an
×
example, we can look at how much memory we need to be able to hold the
pressures for each node in memory if we were to solve the wave equation for
a room the size of B245. This room has dimensions 5.8 5.5 2.7m3 , which
× ×
would require 1.4 108 nodes! If we use double precision variables and store
×
two pressures per node in memory at any time (we need pk  and pk −1 to find
 pk +1 ), we need 16 bytes of memory per node, or 2 GB of memory in total. This
would be quite possible to handle on a normal personal computer, but since
this number scales linearly with the volume of the room, it quickly gets out of 
hand for larger rooms. And the time required to do such calculations would be
formidable! Also, we haven’t even mentioned marine acoustics. Imagine sim-
ulating high-frequency acoustics with finite differences in the kind of spatial
scales you find there!
For this reason, high-frequency approximations such as raytracing are used
in cases where the wavelength is small compared to the geometry of the prob-
lem. We will take a closer look at raytracing in Chapter 5.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 24/75
7/30/2019 Computational Methods in Acoustics

Chapter 2
Cellular automata methods

In this chapter we will look at a number of methods which are created for
efficient implementation on computers, rather than being true to a set of dif-
ferential equations. Such methods have received some interest also in acoustic
wave propagation. These types of methods are often called cellular automata.
One example of a cellular automaton is the english mathematician John
Conway’s The Game of Life from 1970. It takes place on a set of cells arranged in
a two-dimensional cartesian grid, like a chess board, where each cell has eight
neighbours. One decides before the automaton starts running which cells are
to be “inhabited” and which are to be empty.
The state of the system develops from one time step to the next according
to the following two rules:
• Birth: An empty cell becomes inhabited if it has three and only three
neighbours.
• Life and death: A living cell remains alive if it has two or three living
neighbours. In any other case, it dies.
The challenge lies in finding initial populations which grow, repeat themselves
after a certain number of updates, etc. An example of a developing population
is shown in Figure 2.1.

Figure 2.1: The first five time steps of the development of the initial condition
known as the F-pentomino, which takes 1103 time steps to stabilise.

The Game of Life utilises two principles which are typical for cellular au-
tomata:

19

http://slidepdf.com/reader/full/computational-methods-in-acoustics 25/75
7/30/2019 Computational Methods in Acoustics

20 C HAPTER 2 C ELLULAR AUTOMATA METHODS

• Parallelism: All cells are updated simultaneously.


• Locality: The development of a cell is only determined by cells in its
immediate vicinity.

Both principles also characterise physical processes.


This automaton showed that simple rules applied on a microscopic level
can give large macroscopic consequences, depending on the initial condition.
Populations can grow exponentially, be stable, or simply die off.
The goal is to find a set of rules which are both parallel and local, rules
which also give a behaviour corresponding to the differential equations gov-
erning physical systems. This can be done for a lot of physical systems (see for
instance reference [2]), but can it be done for acoustics?

2.1 Lattice gases


A lattice gas automaton is one type of cellular automata. It attempts to simulate
the behaviour and interaction of many single particles in a gas in a simple
fashion as possible. Particles of equal mass move around on a regular grid at
a velocity of one grid node per time step, and may collide with each other if 
several particles meet in the same node. The purpose of lattice gas automata
is to simulate the microscopic behaviour of gases through a very simple set of 
rules.

2.1.1 The HPP model


The first lattice gas model to be proposed was the HPP model. This was named
after its creators, Hardy, Pomeau, and de Pazzis, who proposed the method in
1973 [3, 4]. It is based on a two-dimensional square grid, where particles can
have one of four possible velocity vectors: East, north, west and south. In any
node, up to four particles may be present simultaneously, but they must all
have unique velocity vectors.
For each time step, two rules are applied:

• Translation: All particles move from their node to the neighbouring node
in the direction of their velocity vector.
• Collision: If two particles meet head on after translation in a node with
no other particles present, they are thrown out at right angles.

These rules are illustrated in Figure 2.2. It is important to note that these rules
are defined so that the physical quantities of mass and momentum are pre-
served in each collision.
The particle density ρ and total particle velocity u of particles at a node can
 be found from which particles are present at the node. If ci are the four velocity
vectors (i = 1,2, 3,4) and ni (x, t) = 0, 1 indicates the absence or presence of a

http://slidepdf.com/reader/full/computational-methods-in-acoustics 26/75
7/30/2019 Computational Methods in Acoustics

2.1 L ATTICE GASE S 21

∆t

(a) Translation rule

∆t

(b) Collision rule

Figure 2.2: Update rules of the HPP model.

particle with a velocity vector ci in the node at x at time t, the particle density
and total momentum are given by

 ρ(x, t) = ∑ ni (x, t), (2.1)


i
 ρ(x, t)u(x, t) = ∑ ci ni (x, t). (2.2)
i

In words, the density is given by the total number of particles in the node,
while the momentum is found by summing the individual momentum of every
particle in the node.
The most interesting properties of the HPP model (which are in fact shared
 by all lattice gas automata) are:
• Simplicity: It is extremely simple, both in concept and implementation.
• Space: It requires very little memory — the state of a node can be repre-
sented using 4 bits, each indicating the presence or absence of a particle.
• Parallelism: It is very simple to parallelise. In principle, one can utilise
as many processors as there are nodes in the grid. This means that the
computational time required to perform a simulation decreases linearly
with the number of processors, at least to a certain point.
It is obvious that such a model does not directly describe waves. Waves
follows differential equations and not collision rules of this kind. Still, macro-
scopic quantities such as mass, momentum, and total energy are conserved.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 27/75
7/30/2019 Computational Methods in Acoustics

22 C HAPTER 2 C ELLULAR AUTOMATA METHODS

Due to the physically correct nature of the collisions, it was hoped that the
HPP method would give the correct macroscopic behaviour of a fluid, i.e. a
 behaviour corresponding with the Navier-Stokes equation, so that values of 
density and particle velocity would tend to correspond to the physically cor-
rect values. If the method gave the correct fluid behaviour, it would also give
correct wave behaviour since wave propagation is a property of compressible
fluids.
Unfortunately, the HPP model was mathematically shown to fail due to
a lacking symmetry property of the lattice. This means that it does not give
correct Navier-Stokes behaviour, and cannot be used for simulations of fluid
flow or wave propagation.
One example where it still gives reasonably correct wave behaviour is a

situation wherecause
collision rules two plane waves
the two meet
waves toeach
passother, as shown
through in Figure
each other with2.3. The
double
amplitude in the plane of collision.

∆t ∆t

Figure 2.3: Collision of two infinite plane waves in the HPP model.

2.1.2 The FHP model


The FHP model was named after Frisch, Hasslacher, and Pomeau, who pro-
posed it in 1986 [5]. It is based on the same idea as the HPP model. The main
difference lies in the lattice — where the lattice is square in the HPP model, it
is hexagonal in the FHP model. This means that each particle can now have six
different possible velocities, and each node can have up to six particles with
equal mass and different velocities.
While the translation rule is unchanged from the HPP model, the collision
rules are somewhat different. In a hexagonal lattice, there are two possible res-
olutions for a head-on collision which conserve both mass and momentum. To
choose between the two, randomness is introduced. There is a 50 % probability
for each of the two possible resolutions, as shown in Figure 2.4a. There is also
a second collision rule in the FHP model called the triple collision rule, which
is shown in Figure 2.4b.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 28/75
7/30/2019 Computational Methods in Acoustics

2.1 L ATTICE GASE S 23

 0.  5
 p  =

∆t

 p  =  
0  .5  

(a) Double collision rule

∆t

(b) Triple collision rule

Figure 2.4:
Collision rules of the FHP model.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 29/75
7/30/2019 Computational Methods in Acoustics

24 C HAPTER 2 C ELLULAR AUTOMATA METHODS

Unlike the HPP model, the FHP model has been shown to give behaviour
consistent with the Navier-Stokes equation [6]. It has even been used to simu-
late complex acoustic behaviour [7].
The FHP model retains all the advantages of the HPP model, with the addi-
tional advantage of actually being able to simulate real physics. Still, it suffers
under certain disadvantages inherent to lattice gas methods. Lattice gas sim-
ulations are inherently noisy, as the concentration and distribution of particles
is constantly changing.
This statistical noise is a property of real fluids, not merely lattice gases.
When we interact with fluids in our daily lives, we see them as continuous
and uniform. If we were able to look at the fluid at size scales on the or-
der of nanometers, though, we would be able to see that the fluid is neither

continuous nor uniform, as it consists of individual molecules which are con-


stantly moving around. We would be able to see that some areas of this cloud
of molecules are denser than others, as in Figure 2.5. When looking at larger
size scales, these non-uniformities even out due to the law of large numbers.

Figure 2.5: Molecules in a glass of water. When zooming in far enough, one
sees that the fluid is no longer uniform.

The statistical noise in lattice gases is a desired property if the goal is to


study these fluctuations, but a problem if the goal is to simulate fluids on large
scales. To alleviate this problem, it was common to present results based on
space or time averages of lattice gas results, but the noise problem could never
 be entirely removed.
The solution to the noise problem was to go from looking at individual par-
ticles to looking at particle distributions indicating the concentration of parti-
cles. This was the idea behind the lattice Boltzmann method, which we will
now look into.

2.2 The lattice Boltzmann method


The lattice Boltzmann method was first proposed in 1988 by McNamara and
Zanetti [8]. It is a change from the microscopic scope of lattice gases, where
one tracked the movement of individual particles, to a larger, mesoscopic scope,

http://slidepdf.com/reader/full/computational-methods-in-acoustics 30/75
7/30/2019 Computational Methods in Acoustics

2.2 T HE LATTICE B OLTZMANN METHOD 25

where one tracks the movement of distributions of particles. These distributions


can be seen as averages of a large number of individual particles.
In the lattice Boltzmann method, each node in the grid has several different
variables associated with it, f i (x, t). These variables, called distribution func-
tions, represent the density of particles travelling in direction ci at the node
with position x at time t. In the most commonly used two-dimensional lat-
tice, the grid is square and there are nine different velocity vectors ci , shown in
Figure 2.6.

c6 c2 c5

c3 c0 c1

c7 c4 c8

Figure 2.6: The most common two-dimensional set of lattice vectors in the
lattice Boltzmann method. c0 = (0, 0) is a rest vector.

The macroscopic quantities of particle density ρ(x, t) and particle velocity


u(x, t) at the node can be recovered from f i ( x, t) through the relations

 ρ(x, t) = ∑  f i (x, t), (2.3)


i
 ρ(x, t)u(x, t) = ∑ ci f i (x, t). (2.4)
i

If there were no collisions between particles, we could mathematically for-


mulate the streaming of particles through the grid as

 f i (x + ci , t + ∆t) = f i (x, t).

This is a simple translation rule, like the translation rule of the lattice gas au-

tomata.
from thisNow, collisions between particles can be included as a disturbance
pure translation,

 f i (x + ci , t + ∆t) = f i (x, t) + Ωi (x, t). (2.5)

We call Ωi (x, t) the collision operator, which can take many forms. (From here
on, we’ll drop the (x, t) parenthesis and consider it implicit.) One important
restriction on it is that it must preserve the total mass and the total momentum
in the node. In the early days of the lattice Boltzmann method, this collision
operator was based on the collision methods of lattice gas automata. In recent
years, the most popular form of the collision operator has been the so-called

http://slidepdf.com/reader/full/computational-methods-in-acoustics 31/75
7/30/2019 Computational Methods in Acoustics

26 C HAPTER 2 C ELLULAR AUTOMATA METHODS

BGK operator,
Ωi = − τ 1  f i − f ieq
  , (2.6)
eq
where τ  is a relaxation time and f i is an equilibrium distribution analogous
to the Maxwell-Boltzmann distribution.∗
Inserting this BGK operator into equation 2.5, we find that

 f i (x + ci , t + ∆t) =
− 1
1 1 eq
f  + f  . (2.7)
τ  i τ  i
This represents a relaxation of the current particle distribution f i to the equi-
eq
librium particle distribution f i .
The equilibrium distribution is in each time step constructed from the node’s
particle density and particle velocity from before the collision,

eq
 f i

= ρti 1 +
u ci
+
·( u c i )2 · 2
− 2cu 2
 . (2.8)
c2s 2c4s s

cs is the speed of sound in the lattice Boltzmann method, which for the set of 
√ 
lattice vectors shown in Figure 2.6 is cs = ∆ x/(∆t 3). ti is a set of weightings,
one for each type of lattice vector. For the lattice vectors shown in Figure 2.6,
t0 = 4/9, ti = 1/9 for i = 1,2, 3,4, and ti = 1/36 for i = 5,6,7,8.
To summarise, updating the state of the system from one time step to the
next is done through the following steps:
1. Macroscopic quantities: From the current distribution of particles, cal-

culate the macroscopic quantities ρ and u from equations 2.3 and 2.4.
eq
2. Equilibrium: Calculate the equilibrium distribution f i for each node
from the node’s macroscopic variables ρ and u using equation 2.8.
3. Collision: Calculate the post-collision distribution of particles for all fluid
nodes, given by the right side of equation 2.7.
4. Streaming: Move particles one step in the direction of their velocity, com-
pleting equation 2.7.
The lattice Boltzmann method has been mathematically shown to give a
 behaviour consistent with the compressible Navier-Stokes equation as long as
u/cs < 0.1. The simulated fluid has a kinematic shear viscosity † of 

ν= c2s
− τ 
1
∆t, (2.9)
2
and a kinematic bulk viscosity of 
2
ν = ν. (2.10)
3
∗ The Maxwell-Boltzmann distribution describes the most probable velocity distribution of par-
ticles in a gas in equilibrium.
† Viscosity can be considered as internal friction in a fluid. Acoustically, it causes propagating

plane waves to be damped exponentially in space. See Chapter 8 in reference [9] for more.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 32/75
7/30/2019 Computational Methods in Acoustics

2.3 T HE TRANSMISSION LINE MATRIX (TLM) METHOD 27

The viscosity can in principle be made arbitrarily low by letting τ  → 1/2, but
this has a negative impact on the accuracy and stability of the method.
The lattice Boltzmann has shown itself to be capable of simulating wave
propagation [10, 11]. As an example, figure 2.7 shows the result of a simulation
of double-slit diffraction of an acoustic plane wave.
−4
x 10
160

6
140

4
120

2
100

80 0

60 −2

40
−4

20
−6

 
40 60 80 100

Figure 2.7: Double-slit diffraction simulated with the lattice Boltzmann


method. The dashed line shows the node lines, where the density is theoreti-
cally expected to be zero. Taken from ref. [11].

Unfortunately, viscosity in the model is inescapable. Thus, the lattice Boltz-


mann method is restricted to very high viscosities or very small scales in time
and space if a real material is to be simulated.
One interesting variation on the lattice Boltzmann method was published
 by Chopard et al [12]. They showed that by removing the non-linear terms
in the equilibrium distribution, restricting it to a square HPP-like grid, and
choosing τ  = 0.5, the lattice Boltzmann method reduces to the TLM method,
which we will discuss in section 2.3. This is interesting, since the TLM method
was derived independently from the lattice Boltzmann method.
For more information on the lattice Boltzmann method, see references [11,
13–16].

2.3 The transmission line matrix (TLM) method


The TLM method has gained particular popularity in calculations of electro-
magnetic wave propagation, but it can also be applied to acoustics. It is based

http://slidepdf.com/reader/full/computational-methods-in-acoustics 33/75
7/30/2019 Computational Methods in Acoustics

28 C HAPTER 2 C ELLULAR AUTOMATA METHODS

on Huygens’ principle, which states that each point on a wavefront is itself a


new source of waves. The TLM method again uses a square grid of nodes.
We can see the connections between the nodes as a grid of pipes, or acoustic
transmission lines, that each have an impedance Z0 .

P
2
P
P ∆t 2

− P2
P
2

Figure 2.8: Scattering of a pressure pulse in the TLM method.

2.3.1 Basic theory


Let us look at the two-dimensional example in Figure 2.8. A pressure pulse of 
amplitude P enters the middle node from the left. The other three transmission
lines are parallel coupled at the node, so that their total impedance is Z0 /3 [9].
The reflection coefficient Γ in the node becomes

Γ=
Z0 /3 Z0
=

1
. (2.11)
0
Z /3 + Z 0 2 −
The pulse to be reflected back therefore has the amplitude P/2. −
To know what the magnitude of the transmitted pressure pulses are, we
need to use the principles of conserved pressure and conserved energy.∗ Both
these quantities are preserved if the transmitted pressure pulses have ampli-
tudes of P/2. The scattering is shown graphically in Figure 2.8. This scattering
is essentially the only update rule of the basic TLM method.
If we use a similar notation as the one used for lattice gases and lattice
Boltzmann, and let f i in a node represent incoming pressure pulses in pipe i,
we can write outgoing pressure pulses gi in pipe i as†
 f i  f  j
 gi = − 2 +  j∑ 
=i 2 , (2.12)
or in matrix form,

 g1
− 1 1 1 1
   f 1
 g2
  =
1 1 − 1 1 1  f 2
   .
 g3 2 1 1 −1 1  f 3
 g4 1 1 1 −1  f 4
∗ Conserving energy implies conserving the square of the pressure.
† This
notation is slightly different from the one used for lattice gases and lattice Boltzmann:
Here, the different values of i correspond to pipes in the junction, not to pulse directions.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 34/75
7/30/2019 Computational Methods in Acoustics

2.3 T HE TRANSMISSION LINE MATRIX (TLM) METHOD 29

These pressure pulses are transmitted directly on to the neighbouring nodes.


It can be shown [17] that the speed of sound in the TLM method is given by

c= √ 12 ∆∆xt , (2.13)

where as usual, ∆ x is the space resolution and ∆t is the time resolution. This
equation relates ∆ x and ∆t through the desired physical speed of sound.
One problem with the TLM method is related to propagation direction.
Since the energy quanta can only move along the main axes of the grid, a wave
propagating along an axis may move more quickly than a wave moving along
a diagonal. It can be argued that this problem is frequency dependent, and is
negligible for cases where the wavelength is large compared to the cell length.

2.3.2 Sound sources and walls


It is possible to implement sound sources in the TLM method as nodes where
sound pulses constantly appear with amplitudes given by some time-dependent
function. For instance, if we wish that a node should radiate a single-frequency
wave with period T , equation 2.12 is modified to

 gi = A sin
 −
2π 
k ∆t
f i  f  j
+ ∑  , (2.14)
T  2  j=i 2

where A is the amplitude of the sound source and k is the time step.

P ∆t RP

Figure 2.9: Reflection at a wall node with reflection coefficient R. (The effective
position of the wall is indicated as a grey rectangle.)

One of the strengths of the TLM method is that walls with arbitrary real
reflection coefficient R are very simple to implement. Certain nodes can be set
as wall nodes, and these reflect back incoming pulses as shown in Figure 2.9.
A pulse moves one grid space for each time step. Since a reflected pulse
reappears in the same node as it left, we can look at it as having been reflected
halfway, so that its total moved distance is one grid space. Therefore, we can
see that the effective wall position is halfway between the wall nodes and the
neighbouring nodes. This is also indicated in Figure 2.9.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 35/75
7/30/2019 Computational Methods in Acoustics

30 C HAPTER 2 C ELLULAR AUTOMATA METHODS

It is also possible to implement open boundaries in the method, which do


not reflect waves. These are useful as edges of an open domain. We will not go
into the theory of these boundaries here, but instead refer to Kagawa et al. [17]

2.3.3 Further TLM topics


Figure 2.10 shows snapshots in time of the result of a simulation where a wave
is diffracted by a screen. Notice how diffraction phenomena can be modelled
with the TLM method, and how other expected wave phenomena, such as
near-standing waves in front of the screen, are present. Notice also how the
wavefronts in the second figure are smooth and circular, indicating that there
are enough cells per wavelength for the wave propagation to be independent

of angle.
It is worth mentioning that a M ATLAB program called TLMfig was written
some years ago by the acoustics group at NTNU to perform two-dimensional
TLM simulations of acoustics.
For further information on the TLM method, see references [17–19].

2.4 Summary
The methods we have looked into in this chapter share the common property
that they all consist of small computations which are performed simultane-
ously for every node in the grid. This means that the algorithms may be com-
puted on massively parallel processors such as graphics cards. Although it is
not obvious by looking at them, some of these algorithms will give a large-
scale behaviour in accordance with the wave equation, making it possible to
simulate acoustics.
The original lattice gas automaton, the HPP model, turned out to be useless
since it did not actually simulate anything physical. Its successor, the FHP
model, improved upon HPP so that it could be used to simulate fluids. Still, all
lattice gases have the weakness that they track individual particles, and they
are thus troubled by statistical noise.
The lattice Boltzmann method was invented to fix the problems inherent
in the lattice gas automata, which it does quite well. Since it gives behaviour
consistent with the Navier-Stokes equation, which describes fluid flow, it is
widely used in fluid simulations. Since the wave equation is a special case of 
Navier-Stokes, it can simulate sound propagation also. But the method is not
very useful in linear acoustics, since it becomes unstable and inaccurate when
viscosity is reduced. It seems more well-suited for simulating the complex
interaction between acoustic fields and fluid flows, i.e. aeroacoustics.
Finally, we looked at the TLM method, which probably is the most gen-
erally useful method in this chapter. It has all the advantages of the lattice
Boltzmann method, but it is simpler and has none of the disadvantages — as
long as one is only interested in simulating linear acoustics. It gives behaviour

http://slidepdf.com/reader/full/computational-methods-in-acoustics 36/75
7/30/2019 Computational Methods in Acoustics

2.4 S UMMARY 31

Figure 2.10: Diffraction study with the TLM method. (H. Solvik, 1998)

http://slidepdf.com/reader/full/computational-methods-in-acoustics 37/75
7/30/2019 Computational Methods in Acoustics

32 C HAPTER 2 C ELLULAR AUTOMATA METHODS

in accordance only with the wave equation, so any interaction between fluid
flows and acoustic fields is impossible to simulate with the TLM method. But
then again, this is usually not very interesting in most acoustic cases.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 38/75
7/30/2019 Computational Methods in Acoustics

Chapter 3
The finite element method

The finite element method is reminiscent of the finite difference method, but
the approach is somewhat different. In both methods, we divide a domain
into pieces and attempt to find the solution of an equation at the corners of 
these pieces. In the finite difference method, the domain is divided into pieces
 by a regular grid. In the finite element method, these pieces, called elements,
may be created by an irregular mesh. The elements may have many kinds of 
shapes, but very simple shapes such as triangles and quadrilaterals are com-
monly used.
The fact that the mesh may be irregular makes it possible to adapt the mesh
to complex boundaries, and to make the mesh finer in some parts of the do-
main than in others. This allows us to prioritize parts of the domain where we
need the solution to be more accurate.
This added freedom in choosing where we want our nodes comes at a cost:
The finite element method is significantly more mathematically complicated
than the finite difference method. The road from an partial differential equa-
tion to a solvable system of linear equations is also longer and tougher.
Due to this extra complexity, we will not go as deeply in this chapter as we
did in Chapter 1. After going through the basics of the finite element method,
we will go through a simplified 1D example of the Helmholtz equation and
then find a general solution method for higher dimensions. This chapter at-
tempts to give a better understanding of the finite element method, but will not
teach everything which is required to make a general finite element method
solver. In most cases, finding finite element solutions is better left to ready-
made software packages such as the ones in listed in reference [ 20].

3.1 Finite elements


In the finite element method, a domain (a line segment in 1D, an area in 2D, or
a volume in 3D) is divided into small pieces, called elements, which may vary

33

http://slidepdf.com/reader/full/computational-methods-in-acoustics 39/75
7/30/2019 Computational Methods in Acoustics

34 C HAPTER 3 T HE FINITE ELEMENT METHOD

in alignment and size. In 1D, an element is a line segment. In 2D, an element


is some sort of polygon which can be used to tile the entire domain, such as
a triangle or quadrilateral (see Figure 3.1). In 3D, it could be any polyhedron
which can be used to tile the entire space, such as a parallelepiped.
The corners of these elements are known as nodes. In acoustics, we usually
attempt to compute a single variable in each node, namely the acoustic pres-
sure. When node values are known, the pressure values in the space between
the nodes can be interpolated using basis functions. There are several types of 
 basis functions, but we will mostly look at linear basis functions to keep our
discussion as simple as possible.

 y  y

x x
(a) Quadrilateral meshing (b) Triangular meshing

Figure 3.1: A division into elements, or meshing, of a two-dimensional domain.

 y

4 3

1 2 x
a

Figure 3.2: The nodes of a single rectangular element.

Figure 3.1 shows an example where a two-dimensional area has been di-
vided into elements, and Figure 3.2 shows a rectangular element in detail. We
use this element to illustrate the idea of basis functions. Let’s say we have one
constant pressure value for each node: p1 , p2 , p3 , and p4 . Within this element,

http://slidepdf.com/reader/full/computational-methods-in-acoustics 40/75
7/30/2019 Computational Methods in Acoustics

3.1 F INITE ELEMENTS 35

we describe the pressure as

 p(x, y) = N 1 ( x, y) p1 + N 2 ( x, y) p2 + N 3 ( x, y) p3 + N 4 ( x, y) p4 , (3.1)

where N i (x, y) is the basis function belonging to node i. In this element, we
have chosen basis functions which are linear in both x and y direction,

N 1 ( x, y) = 1
 −  − 
x
1
y
, (3.2a)
−  a b
x y
N 2 ( x, y) = 1 , (3.2b)
a b
x  y
N 3 ( x, y) = , (3.2c)
ab
N 4 ( x, y) = 1 − xa y
b
, (3.2d)

for 0 ≤ x ≤ a,
 
0 ≤  y ≤ b.

In matrix form, we write this as



 p1

  p2
  
 p( x, y) = N 1 ( x, y) N 2 ( x, y) N 3 ( x, y) N 4 ( x, y) , (3.3)
 p3
 p4
or
 p( x, y) = N( x, y) p, · (3.4)

Essentially, this means that we are estimating p( x, y) as a weighted average of 
the node values, where the weighting depends on the distance to the nodes.
Here, we have used basis functions which are defined only inside the element,
and which are zero outside it.
The basis functions have two important requirements:
• If we evaluate the basis functions in node i, we must have that N i (xi , yi ) =
1 while N  j=i (xi , yi ) = 0, so that p(xi , yi ) = pi .
• ∑ i N i = 1 everywhere inside the element.

In this example, the basis functions are specially designed for this particular
element. This will be impractical in the general case, where elements will not
have convenient shapes or positions. We need basis functions which can be
easily used for all elements the entire domain. In section 3.4.1, we will see how
this can be done through transformations to local coordinate systems.
Through considering basis functions as local for an element (i.e. as zero
outside the element), equation 3.4 can be valid for each element in the entire
domain of interest. By including all the elements in our geometry and con-
sidering the differential equations in question, we wish to reach a system of 
simultaneous algebraic equations in all the unknown node values pi in the do-
main. We will then be able to solve this system to find the values pi which give
a pressure field which solves the differential equation in question.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 41/75
7/30/2019 Computational Methods in Acoustics

36 C HAPTER 3 T HE FINITE ELEMENT METHOD

3.1.1 Global and local basis functions


In the previous section, we considered the basis functions to be defined only
locally, inside the element, so that they were zero everywhere outside it. It is
also possible to look at the basis functions in a different way — that they are
defined globally, so that a basis function is nonzero in all elements that border
the node that it belongs to. This is illustrated in Figure 3.3.

N i (x, y)

xi

Figure 3.3: A global linear basis function on regular triangular elements be-
comes a pyramid with a hexagonal base.

To further illustrate the idea of global basis functions, we look at how an ar-
 bitrary function φ(x ) can be approximated within a one-dimensional domain
Ω = [0, L]. We divide Ω into M different non-overlapping areas — our ele-
ments. These are bordered by M + 1 nodes at x0 , x1 , . . . , x M . This is shown in
Figure 3.4.
We wish to construct a piecewise linear function φ̂( x), using node values
φ̂( xi ) = φ̂i and the basis functions N i (x ). We can look at N i (x ) as global hat
functions, illustrated in Figure 3.4 and given mathematically by

x x i −1
for xi−1 ≤ x ≤ xi ,

x i x i −1
xi+1 x
N i ( x) =  xi+1 xi − for xi ≤ x ≤ xi+1 , (3.5)
0 otherwise and outside Ω.

The function φ̂( x) is constructed from N i (x ) and φ̂i as

φ̂( x) = ∑ φ̂i N i ( x) in Ω. (3.6)


i

If we wish φ̂( x) to be an estimate of φ(x ), we somehow need to find the opti-


mal node values φ̂i so that the deviation between φ( x ) and φ̂(x ) is as small as
possible.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 42/75
7/30/2019 Computational Methods in Acoustics

3.1 F INITE ELEMENTS 37

φ (x )
φ̂ (x )

x0 x1 x2 x i −1 x i xi+1 x M−1 x M x


0 L

N i−1

Global basis
N i
functions

N i+1

N i N i+1 Local basis


functions
xi xi+1

Figure 3.4: Approximation of a one-dimensional function through linear basis


functions.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 43/75
7/30/2019 Computational Methods in Acoustics

38 C HAPTER 3 T HE FINITE ELEMENT METHOD

There are many possible ways to measure the deviation between φ( x) and
φ̂( x). Maybe we want the deviation to be very small at certain points in the
domain, at the cost of having a higher deviation elsewhere. The estimation
 becomes even more problematic if φ( x ) is actually not a known function, but
for instance the exact solution to some partial differential equation. We will
look into these subjects in the following sections.
We will see later that we will need to calculate integrals over the entire do-
main, integrals which include these basis functions. If we have global basis
functions, we can integrate directly over the entire domain. If the basis func-
tions are local, we divide the integral over the domain into the sum of integrals
over all the elements. In practice, the last method is the most common, since
global basis functions become tricky to handle in two and three dimensions.

3.2 The weighted residual method


The Helmholtz equation can be written as
∇  2
+ k 2  p(x) = D H  p(x) = 0, (3.7)

where D H  is the Helmholtz operator, D H  = 2 + k 2 . ∇


We now insert the approximated pressure, p(x) (N(x) p).∗ Since this is
≈ ·
only approximately correct, we get a small error, which we call the residual, on
the right-hand side,
D H (N(x) p) = R(x). · (3.8)

We wish to find a system of equations which can be solved to give the set of 
node values pi which minimises this residual.
As the first step in finding this system of equations, we integrate equation
3.8 over the entire domain, giving
  D H (N(x) p)dΩ =
·
  R ( x ) d Ω. (3.9)
Ω Ω

We still want to minimise the right-hand side of this equation, which now de-
scribes the average of the residual over the entire domain. Unfortunately, we
have now lost the ability to distinguish between node values p which give a
good solution (i.e. a small residual) everywhere and values which give large
residuals which cancel each other when averaged over the entire domain.
On the other hand, if we had multiplied equation 3.8 with some local weight-
ing function W (x) which is nonzero in only a small region of the domain, we
∗ Note that the Laplacian term ∇2 in the Helmholtz operator destroys any linear functions. This
means that we have a problem applying this operator on the linear basis functions described in
section 3.1. We will see in section 3.3 that the solution lies not in using non-linear basis functions,
 but in changing the form of the Helmholtz operator so there is no second derivative. For now, we
will pretend that there is no problem, in order to make the following discussion simpler.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 44/75
7/30/2019 Computational Methods in Acoustics

3.2 T HE WEIGHTED RESIDUAL METHOD 39

would have found


  W (x) D H (N(x) p)dΩ =
·
  W (x) R(x)dΩ. (3.10)
Ω Ω

If we can find a set of node values which give us a zero right-hand side in this
equation, we know that R(x) is small in the small area where W (x) is nonzero.
Unfortunately, this only tells us that the solution is good in a small area,
so that the solution might still be bad elsewhere in the domain. We solve this
problem by using many weighting functions instead of just one. Instead of 
using a single weighting function W (x), we use a vector W(x) where each
vector element is a different weighting function, W i (x). This set of weighting
functions should ideally cover the entire domain. Setting the equation to zero,
we get    
W(x) D H (N( x) p)dΩ =
· W ( x ) R ( x ) d Ω = 0. (3.11)
Ω Ω

This represents a system of equations, where each row in the vector gives
us a single equation,
  W i (x) D H (N(x) p)dΩ = 0.
·

We will generally want to have a number of equations equal to the number of 
unknowns, so that the system of equations can be solved exactly. This means
(x )
that we
node needpto. use as many weighting functions W i
values as there are unknown
i
Many different types of weighting functions can be used, and we will go
into some of these.

3.2.1 Subdomain collocation


Here, the domain Ω is divided into subdomains Ωi , which might for instance
correspond to elements. The vector W(x) must then consist of vector elements
 1 for x in Ωi ,
W i (x) = (3.12)
0 for x not in Ωi .

With this weighting function, we are trying to find a node pressure vector p
which gives a minimum residual R(x) inside each subdomain Ωi .

3.2.2 Point collocation


For this type of weighting function, each vector element W i (x) in W(x) is given
 by
W i (x) = δ(x yi ), − (3.13)
where δ(x) is the Dirac delta function.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 45/75
7/30/2019 Computational Methods in Acoustics

40 C HAPTER 3 T HE FINITE ELEMENT METHOD

When using this weighting function we are trying to find a node pressure
vector p which gives a minimum value of  D H (N(x) p) at certain points in ·
space, yi . In practice, the number of such points is generally much larger than
the number of unknowns. This gives an overdetermined system of equations,
which can be approximately solved by a method of least squares.

3.2.3 Galerkin’s method


This is the most commonly used method. We choose to use the basis functions
themselves as weighting functions, i.e.

W i (x) = N i (x). (3.14)

Thus, with Galerkin’s method, equation 3.11 becomes


 
N(x) D H ( N(x) p)dΩ = 0. · (3.15)

Generally, if we have three vectors a, b, and c, where b and c have the same
number of elements, it can be shown that

a (b c) = (a
· ⊗ b ) c,
where a b indicates the outer product of  a and b.∗ Using this, we can rewrite

equation 3.15 into
N ( x) ⊗ D H N(x)dΩp = 0. (3.16)
Ω 
We have put the node pressure vector outside the integral, as it is not a function
of space. Notice how the integrations are now only performed over the basis
functions.

3.3 Galerkin solution of the Helmholtz equation


One characteristic property of the finite element method is that quite a few
derivations must be gone through before one finds a system of equations which
can be solved directly on a computer. We will therefore restrict ourselves to the
Helmholtz equation.
We will first show how to solve this equation in a simple one-dimensional
system, ending up with a matrix equation which can be solved directly. We
will then indicate how the derivation is performed in higher dimensions.
∗ The outer product is theproduct of a columnvector anda row vector whichresultsin a matrix,
i.e.     
a1 a b a1 b2
a ⊗b = b1 b2 = 1 1 .
a2 a2 b1 a2 b2
In both cases, the ith component of the resulting vector becomes
{a(b · c)}i = {(a ⊗ b)c}i = ∑ ai b j c j .
 j

http://slidepdf.com/reader/full/computational-methods-in-acoustics 46/75
7/30/2019 Computational Methods in Acoustics

3.3 G ALERKIN SOLUTION OF THE H ELMHOLTZ EQUATION 41

3.3.1 In one dimension


First we give a detailed example of how to apply the finite element method to
a one-dimensional Helmholtz equation using Galerkin’s method. We solve for
the domain Ω = [0, L], using nodes x0 , x1 , . . . , x M with an even spacing ∆ x, so
that our global basis functions become
 −
x x i −1
∆x
for xi−1 ≤ x ≤ xi ,
N i ( x) =
 −
xi+1 x

0
∆x for xi ≤ x ≤ xi+1 ,
otherwise and outside Ω.
(3.17)

We will solve the equation with a open-end boundary condition p0 = 0 at one


end and a given velocity boundary condition u M at the other.

N 0 N 1 N i N  M−1 N  M

x0 x1 xi x M−1 x M x
0 L

Figure 3.5: Global linear basis functions for a one-dimensional system between
x = 0 and x = L.

Equation
side, 3.16 equates
so that each elementone vector
in these on theisleft
vectors side with
a single another
equation on the
based right
around
a single weighting function. In our case, when we insert for the Helmholtz
operator, element i of equation 3.16 becomes
  L
∂2 N  j ( x)
L
  
∑   N i ( x) dx + k 2 N i ( x) N  j ( x)dx  p j = 0.
 (3.18)
 j
∂x2
0 0

Since we know the pressure p0 at x0 , we have one unknown less. To compen-


sate, we remove the corresponding weighting function, so that we still have
the same number of equations and unknowns. In other words, we remove the
i = 0 case and let 1 i M, while we still have that 0 j M.
We will now resolve the problem that was alluded to earlier — that the
≤ ≤ ≤ ≤
second derivative in the Helmholtz equation destroys linear basis functions.
We resolve this by performing a partial integration of the first integral,
L  L
 −   L
  ∂2 N  j ( x) ∂N  j (x ) ∂N i (x ) ∂N  j (x )
N i (x ) 2
dx = N i ( x) dx.
∂x ∂x 0 ∂x ∂x
0 0

There are now only first derivatives on the right side of this equation, which
means that it is now possible to use linear basis functions.∗
∗ This works well, but is not exactly mathematically rigorous — if the basis functions are linear,

http://slidepdf.com/reader/full/computational-methods-in-acoustics 47/75
7/30/2019 Computational Methods in Acoustics

42 C HAPTER 3 T HE FINITE ELEMENT METHOD

The first term on the left side is


  L
∂N  j ( x) ∂N  j ( L)
N i ( x)
∂x
= N i ( L)
∂x
− N i (0) ∂N ∂x j (0)
0


We have that N i (0) = 0 only for the i = 0 case, which we have removed. Thus,
the last term falls away. Also, the first term is only nonzero for i = M, where
N  M ( L) = 1. When we multiply it with p j as in equation 3.18 and apply the
Euler’s equation,∗ it becomes

∂ ∂ p( L)
∑ N i ( L) ∂x N  j ( L) p j ≈ N i ( L) ∂x = − jωρN i ( L)u M .
 j

We can use these results to rewrite equation 3.18 as


  
L
∂N i ( x) ∂N  j (x )
  L

∑  − dx + k 2 N i (x ) N  j (x )dx  p j = jωρN i ( L)u M . (3.19)

 j ∂x ∂x
0 0

Since the integrals on the left side is performed only over the basis functions,
we can insert the basis function expressions from equation 3.17 and integrate
directly. It can easily be shown that the integrals become

L
 ∆x
1
for j = i − 1,
∂N i ( x) ∂N  j ( x)

  dx = − 2 for j = i, 0 otherwise,
∂x ∂x ∆x
1
0 ∆x
 for j = i + 1,
1 for j = i 1,
  L 6 ∆x
 −
N i (x ) N  j ( x)dx = 4 0 otherwise.
6 ∆x for j = i,
0

1
6 ∆x for j = i + 1,

These integrals are zero unless the basis functions are neighbours, since only
neighbouring basis functions overlap at all.
As we can see in Figure 3.5, the basis functions at the end are one-sided.
This means that the values of the integrals are halved for j = i = 0 or j = i =
 M, so that we get respective integral values of  ∆1x and 26 ∆ x in these cases. −
Thus, equation 3.19 becomes
 1 k 2
+ ∆ x  pi−1 +
 − 2
+
4k 2
∆ x  pi +
  1 k 2

+ ∆ x  pi+1 = 0
∆x 6 ∆x 6 ∆x 6 (3.20)
≤ ≤ −
for 1 i M 1
the left side is zero while the right-side is non-zero. We could have found the same result in a more
rigorous manner, but then the derivation would become even more complicated and confusing.
∗ The Euler’s equation at x = L becomes
∂ p( L)
=  jωρ u( L).

∂x

http://slidepdf.com/reader/full/computational-methods-in-acoustics 48/75
7/30/2019 Computational Methods in Acoustics

3.3 G ALERKIN SOLUTION OF THE H ELMHOLTZ EQUATION 43

and
k 2 2k 2
 1
+ ∆ x  pi−1 +
 − 1
+ ∆ x  pi = jωρu M

∆x 6 ∆x 6 (3.21)
for i = M

Using our knowledge that p0 = 0, we write this in matrix form as


 − 2 1
  4 1
   p1
  0

  1 − 2 1   1 4 1    p2   0 
1 .. k 2 ∆ x .. .. ..
. + . . = . .
 ∆x   6      
1 −2 1 1 4 1  p M−1 0
1 − 1 1 2  p M  jωρ u M
(3.22)
This matrix system can be solved directly on a computer by inversion. Note
that the problem we solve here is the exact same problem as we solved by
the finite difference method in equation 1.22. There are marked similarities
 between the matrix systems, which is only reasonable since both solve the same
problem.
We have now seen how different types of boundary conditions are handled
in the Galerkin finite element method. Constant-value (Dirichlet) boundaries,
such as the open end, are handled by removing their corresponding weighting
function, while derivative-value (Neumann) boundaries, such as the velocity
 boundary, are handled through the partial integration.

3.3.2 In higher dimensions: General solution


It is also possible to do a more general derivation which works for problems in
higher dimensions than one. We will now perform this for a general domain
Ω, with impedance boundary conditions along its boundary Γ.∗
We insert for the Helmholtz operator in equation 3.16, and get
  N( x) ⊗ ∇2N(x)dΩp + k 2
  N (x ) ⊗ N ( x ) d Ω p = 0. (3.23)
Ω Ω

To avoid our notation becoming long and messy, we will drop (x) and consider
it implicit from now.
In the first integral in this equation, we integrate over matrix elements of 
the form N i 2 N  j . Using a vector differential identity,† we can rewrite this

∗ For example, Γ is the curve containing the area Ω in 2D, or the surface containing the volume
Ω in 3D.

The vector differential identity is
∇ · ( ψ F ) = ( ∇ ψ ) · F + ψ ( ∇ · F ).
We can find by associating the arbitrary scalar ψ with N i and the arbitrary vector F with ∇ N  j that
N i ∇2 N  j = −(∇ N i ) · (∇ N  j ) + ∇ · ( N i ∇ N  j ).

http://slidepdf.com/reader/full/computational-methods-in-acoustics 49/75
7/30/2019 Computational Methods in Acoustics

44 C HAPTER 3 T HE FINITE ELEMENT METHOD

integral as
  N i
   
∇2 N  j dΩ = − (∇ N i ) · (∇ N  j )dΩ + ∇ · ( N i ∇ N  j )dΩ.
Ω Ω Ω

Using the divergence theorem,∗ this becomes


  N i
 
∇2 N  j dΩ = − (∇ N i ) · (∇ N  j )dΩ +
  ∇ ·
N i ( N  j n̂Γ )dΓ,
Ω Ω Γ

where Γ is the boundary of  Ω and n̂Γ is the boundary normal unit vector of 
dΓ. By doing this, we have changed the differential terms in the integration
to a lower order, enabling use of the simpler linear basis functions. This is
equivalent to the partial integration we did for the one-dimensional case. (In
fact, the divergence theorem is a generalisation of partial integration!)
Similarly to the one-dimensional case, we apply the matrix in the last term
to the vector p and use the linear Euler’s equation to find
  ∇
∑  N i ·  ≈  
N  j p j n̂Γ dΓ ∇ ·
N i (  p(x) n̂Γ ) dΓ =  jωρ −
  N i un (x)dΓ,
 j Γ Γ Γ

where un is the normal velocity on Γ. If we now define a boundary admittance


 A as the reciprocal of the impedance, i.e. A = un / p, this becomes

− jωρ
  N i un (x)dΓ =  jωρ

   AN i p(x)dΓ ≈ − jωρ ∑ 
   AN i N  j dΓ p j .
Γ Γ
 j Γ

We may now use these results to rewrite equation 3.23 as


 
− ∇N ⊗ ∇NdΩp + k 2
  N ⊗ NdΩp − jωρ
   AN ⊗ N dΓ p = 0. (3.24)
Ω Ω Γ

This is essentially what we were looking for: A general finite element formu-
lation of the Helmholtz equation which may be solved with an appropriate
meshing of the domain and an appropriate selection of basis functions.

3.3.3 General boundary conditions


Together with the general solution in equation 3.24, we need to specify bound-
ary conditions for the outer edges of the domain. These are specified through
the admittance A, which was introduced earlier. If we have different values of 
the admittance on different parts of the boundary, we can split the boundary
integral into a sum of several integrals.
Among different types of admittance boundary conditions, we have:
∗ The divergence theorem is also known as Gauss’ theorem. It states that
  ∇ · F dΩ =
  ·F n̂ Γ dΓ,
Ω Γ

where Ω is a domain, Γ is the boundary of the domain, and n̂Γ is the boundary normal unit vector
of  Γ.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 50/75
7/30/2019 Computational Methods in Acoustics

3.4 D IFFERENT TYPES OF ELEMENTS 45

• Hard surface: un = 0, so that A = 0.


• Constant velocity: un = U 0 , so that A = U 0 / p.
• Plane waves: A = 1/ ρc.

Γ2 , A2 = 1/ ρc

Γ1 , A1 = U 0 / p

 A0 = 0

Figure 3.6: Boundary geometry of a baffled piston system. Γ1 represents


the piston of constant velocity amplitude U 0 , while Γ2 represents a boundary
where we expect nearly plane wavefronts. On the hard wall, un = 0 so that
 A = 0.

As an example, Figure 3.6 shows the geometry of a baffled piston system


(i.e. a surface of constant velocity set in a hard wall). For this system, equation
3.24 becomes
 
− ∇N ⊗ ∇NdΩp + k 2
  ⊗
N N dΩ p
Ω Ω
    ⊗ (3.25)
− jωρU 0 N dΓ1 −  jk  N N d Γ2 p = 0.
Γ1 Γ2

Note how the boundary integral over the hard wall disappears due to A being

zeroConstant-value
on the wall. boundary conditions (i.e. open ends of a pipe) are imple-
mented as for the one-dimensional case. Since the pressure nodes’ values are
known along the boundary, their corresponding weighting functions should
 be removed to ensure the same number of equations and unknowns.

3.4 Different types of elements


We will now look at a few special types of elements which are useful in differ-
ent circumstances.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 51/75
7/30/2019 Computational Methods in Acoustics

46 C HAPTER 3 T HE FINITE ELEMENT METHOD

3.4.1 Isoparametric elements


This type of element is widely used, as it is suitable for irregular element
shapes, and has advantages related to the numerical integration of the element
matrices. We wish to place the element arbitrarily with regard to the coordinate
system, and place the nodes where it is appropriate. This leads to a distortion
of the element. We will conduct this discussion for two-dimensional quadri-
lateral elements, but the method is equally applicable in other dimensions and
for other shapes.
We introduce a local coordinate system in the variables ξ  and η, which are
defined for
− ≤
1 ξ , η 1. ≤
For a four-node element, linear basis functions will be given by
1
N 1 (ξ , η ) = (1 ξ )(1 η ),
− − (3.26a)
4
1
4

N 2 (ξ , η ) = (1 ξ )(1 + η ), (3.26b)
1
N 3 (ξ , η ) = (1 + ξ )(1 + η ), (3.26c)
4
1
N 4 (ξ , η ) = (1 + ξ )(1 η ).
− (3.26d)
4

 y η
1 2 1 3

−1 1 ξ 

2
3 1 −1 4
x

Figure 3.7: Transformation between a complex element in the x– y plane and a
simple element in the ξ –η plane.

This element is transformed to an element in the ( x, y) plane, where the


nodes are placed in given points ( xi , yi ). The transformation is done simply by
using the same transformations as for the pressure interpolation,

x = N 1 x1 + N 2 x2 + N 3 x3 + N 4 x4 , (3.27a)


 y = N 1 y1 + N 2 y2 + N 3 y3 + N 4 y4 . (3.27b)

http://slidepdf.com/reader/full/computational-methods-in-acoustics 52/75
7/30/2019 Computational Methods in Acoustics

3.4 D IFFERENT TYPES OF ELEMENTS 47

For the matrix integrations, we need terms of the type ∂N i /∂x and ∂N i /∂ y.
From the chain rule of partial derivatives, we have that
∂N i ∂N i ∂x ∂N i ∂ y
= + ,
∂ξ  ∂x ∂ξ  ∂ y ∂ξ 
so that       
∂N i ∂x ∂ y ∂N i ∂N i
∂ξ  ∂ξ  ∂ξ  ∂x ∂x
∂N i = ∂x ∂ y ∂N i =J ∂N i .
∂η ∂η ∂η ∂ y ∂ y

J is known as the Jacobian matrix, and can be evaluated from the interpolation
expressions in equation 3.27. From this, we have that
∂N i ∂N i
N i (x, y) = ∂x
∂N i = J− 1 ∂ξ 
∂N i = J−1 N i (ξ , η ). (3.28)
∇ ∂ y
    ∂η ∇
When performing a coordinate transformation in an area integral, one must
relate the two infinitesimal areas through the determinant of the Jacobian ma-
trix,
dxdy = J dξ dη. ||
Thus, our integrals over individual elements Ωk  may be transformed:
    1 1
N i (x, y) N  j ( x, y)dxdy = N i (ξ , η ) N  j (ξ , η ) |J|dξ dη, (3.29a)
Ωk  −1 −1
1 1
1 1
  ∇ [ N i ( x, y)] [ N  j ( x, y)] dxdy =
·∇  − −  − ∇ [J N i (ξ , η )] [J−
· ∇ N  j (ξ , η)]|J|dξ dη.
Ωk  1 1
(3.29b)
While N i (ξ , η ) does not change between elements, J changes both between

elements and during the integration. These integrals are most commonly solved
numerically.

3.4.2 One-dimensional pipe elements


For pipe systems where the wave propagation is mainly one-dimensional but
where continuous or instantaneous changes in cross-section are important, for
instance music instruments, mufflers, etc., special pipe elements have been de-
veloped.
We reformulate the infinitesimal volume element dΩ as A( x)dx. We can
insert this into the Galerkin’s method formulation, equation 3.16. Assuming
that the area varies slowly, it is possible to derive a finite element formulation
for these pipe elements,
   L
∂N i ∂N  j
  L
∂N  j
  
L
∑  − A(x )dx + k 2 N i N  j A( x)dx + N i A( x )  p j = 0.
 j
∂x ∂x ∂x 0
0 0
(3.30)

http://slidepdf.com/reader/full/computational-methods-in-acoustics 53/75
7/30/2019 Computational Methods in Acoustics

48 C HAPTER 3 T HE FINITE ELEMENT METHOD

 Ai+
1
 Ai
i i+1

Figure 3.8: A simple conical pipe element.

The area A( x) can be expressed through values Ai for the area at nodes and
the basis functions,

 A( x) = N i Ai + N i+1 Ai+1 in Ωi . (3.31)

As in reference [21], we assume that the area A( x) has a linear variation, like
the pressure.

3.4.3 Infinite Bettess elements


In addition to the common finite elements, element types which extend to
infinity have been developed. The first element type of this kind was pro-
posed by Peter Bettess in 1977 [22], although it was not specifically designed
for acoustics. The elements are based on standard one-dimensional basis func-
tions given by Lagrange polynomials,
n x j −x
N i ( x) = ∏ x −x for i = 1 , 2 , . . . , n,
=i  j
 j =1, j i

where i and j are nodes in an element with n nodes. The infinite elements were
formulated by using the same basis functions multiplied with an exponential
decay,
n− 1 x x −
 j
N i (x ) = e(xi − x )/ L ∏ for i = 1 , 2 , . . . , n. (3.32)
x
=i  j
 j=1, j
xi −
Note how the j = n term is not used, as it is assumed that xn = ∞. If  N n is
required, it can be found from
n 1−
N n = 1 − ∑  N i . (3.33)
i=1

The element type was developed further by including a wave factor,



n 1 x j −x
N i ( x) = e( xi − x )/ L e jkx ∏ x −x for i = 1 , 2 , . . . , n. (3.34)
=i  j
 j=1, j  i

http://slidepdf.com/reader/full/computational-methods-in-acoustics 54/75
7/30/2019 Computational Methods in Acoustics

3.5 S UMMARY 49

3.4.4 Wave envelope elements


A more recent development is the wave envelope element, proposed in the
1980s by R. Astley [23, 24]. This modifies other basis functions N i by multiply-
ing them with a wave factor, given by
r
N i = N i i e− jk (r−ri ) (3.35)
r
in three dimensions. This element is used in an outer region of the geometry
to simulate a wave which propagates outwards from the origin. The scaling
ensures that N i = N i for r = ri .
This type of elements avoids a problem with the Bettess elements — that
the integration over basis functions such as the one in equation 3.34 required
integrating over trigonometric functions to infinity. This is avoided with the
wave envelope elements if the weighting functions are chosen as complex con-
 jugates of the basis functions, i.e.
r
W i = N i∗ = N i i e+ jk (r−ri ) .
r
 
Using the Galerkin method, W i N i = N i rri
2
, resulting in simpler integrals.

3.5 Summary
In the finite element method, the computational domain is divided into ele-
ments with simple shapes, where each element corner is a node. The nodes
have solution values and basis functions associated with them. These basis
functions are used to interpolate the nodes’ values throughout the domain. In
this way, it is possible to relate the solution value at any point in the domain
with the values of surrounding nodes. The solution is found by finding the
node values which minimize the error throughout the domain.
It is natural to compare the finite element method with the finite difference
method, since both work by finding approximate solutions to partial differ-
ential equations through a discretisation process. The finite element method
avoids certain problems which the finite difference method has with complex
 boundaries: Making the mesh finer and thus getting better accuracy in crit-
ical areas in the domain is theoretically straightforward in the finite element
method. It is also much simpler to implement moving boundaries, as when
simulating a car crash. The domain may be remeshed for each time step if 
necessary.
On the other hand the finite element method loses to the finite difference
method in mathematical simplicity and directness. Many equations, such as
the Helmholtz equation which we have looked into, require considerable math-
ematical manipulation before a finite element method of solution can be found.
The finite element method is preferred in certain scientific fields where its
advantages are important, such as solid mechanics. In other fields, such as
fluid dynamics, the finite difference method is preferred.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 55/75
7/30/2019 Computational Methods in Acoustics

Chapter 4
The boundary element method

The boundary element method is a more recent method than the others. It can
 be derived from an older theorem, called the Kirchhoff-Helmholtz integral the-
orem. This states that the solution of the Helmholtz equation inside a domain
may be found from an integral over the boundary of the domain. For this to
 be valid, the pressure itself and its normal derivative must be known on this
 boundary, and there must be no acoustic sources inside the domain itself.
In the boundary element method, the boundary is discretised into elements.
Inside each element, the pressure and its normal derivative is either assumed to

 be constant
over or somehow
the boundary interpolated.
is greatly simplified.With these approximations, the integral
The method also goes one step further — if the pressure on the surface is
unknown, it may be found if its normal derivative on the surface (which is
related to the normal velocity) is known, or vice versa. This means that we
need only know either the pressure or its normal derivative on the surface to
find the solution inside the domain.
In this chapter, we will briefly describe the basics of the boundary element
method. Not necessarily enough to write an implementation of the method,
 but hopefully enough to give an understanding of how it works.

4.1 The Kirchhoff-Helmholtz integral theorem


We assume that we have a three-dimensional domain Ω which is bounded by
a surface Γ, as shown in Figure 4.1. (The formulation will be slightly different
if the problem is not three-dimensional.)
We start with Green’s 2. identity, which relates two functions φ(y) and ψ(y)
through a modified divergence theorem,
  ∇
φ 2
ψ 2
− ψ∇ φ
  
dΩ = φ
∂ψ
− ψ
∂φ
 d Γ. (4.1)
∂n ∂n
Ω Γ

50

http://slidepdf.com/reader/full/computational-methods-in-acoustics 56/75
7/30/2019 Computational Methods in Acoustics

4.1 T HE K IRCHHOFF-H ELMHOLTZ INTEGRAL THEOREM 51



Γ n̂Γ Γ
n̂Γ n̂Γ

(a) Simple domain (b) Slightly less simple domain

Figure 4.1: Two examples of a domain Ω  bounded by a surface Γ.

Here, ∂/∂n = n̂Γ ·∇


is the normal derivative. For this identity to be valid, both
φ(y) and ψ(y) must be twice continuously differentiable ∗ inside Ω.
We rewrite φ and ψ as

φ ( y ) = p ( y ), ψ ( y ) = G ( y ),

and let both functions be solutions of the Helmholtz equation inside Ω. The
integrand of the volume integral then becomes

 p ∇2 G − G∇2 p = −k 2 pG + k 2 pG = 0,


and we are left with only the surface integral,
   p
∂G
− G
∂ p
 dΓ = 0. (4.2)
∂n ∂n
Γ

Now, we assume one more thing: That the function G (y) is a Green’s func-
tion, i.e. the field around a point source placed at a point x,

e− jkR
G (y ) = , where R= x| − y|. (4.3)
R

This is an entirely valid solution for the Helmholtz equation. However, it goes
to infinity for y = x. At this singularity, it is not continuously differentiable,
and Green’s 2. theorem, equation 4.1, is no longer valid if  x is inside Ω.
We may avoid this problem by placing a spherical surface Γ with radius 
around x, removing this point from the domain, as shown in Figure 4.2. Thus,
G(y) becomes twice continuously differentiable inside Ω. On the surface Γ ,
we have that

R = ,
∂n
= − ∂R∂ , dΓ = 2 sin θ dθ dφ.
∗ This means that ∇2 φ(y) and ∇2 ψ(y) must both be continuous functions.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 57/75
7/30/2019 Computational Methods in Acoustics

52 C HAPTER 4 T HE BOUNDARY ELEMENT METHOD

x x
Γ
n̂Γ
Γ Γ
n̂Γ n̂Γ

(a) x inside Ω (b) x covered with a surface Γ

Figure 4.2: Removing the singularity in G( y) at y = x from Ω  by enclosing it


inside a surface Γ .

Since we have now redefined the surface in our problem by adding Γ , we


will need to integrate over both Γ and Γ in equation 4.2. The integral over Γ
 becomes
   p
∂G
− G
∂ p
  
dΓ =
π 
sin θ dθ
 −
2π 
 p
∂ e− jkR
+
e− jkR ∂ p 2
 dφ

∂n ∂n ∂R R R ∂R
Γ 0 0
π  π 
2 e− jk  1
+e
=
  sin θ dθ
   p
 
 jk  +
− jk  ∂ p  2 dφ.
   ∂R
0 0

If we let  → 0, all the () terms in this integral disappear, e− jk 


O → 1, and
 p(y) → p(x). We are only left with the (1) term, O
     π  2π 
 
∂G ∂ p
 p − G dΓ = sin θ dθ  p dφ = 4π  p(x).
∂n ∂n
Γ 0 0

Thus, the integral over Γ and Γ gives us

1 e− jkR ∂ p ∂ e− jkR


 p(x) = 4π    R ∂n −  p ∂n R  dΓ. (4.4)
Γ

This is the Kirchhoff-Helmholtz integral theorem!


The theorem states that we may calculate the pressure p(x) anywhere in-
side the domain Ω from the pressure p and its normal derivative ∂ p/∂n on the
surfaces surrounding Ω.
For this theorem to be valid, p(x) must be twice continuously differentiable
inside the domain. This means that we cannot have sources inside Ω; any
sources must be enclosed within a surface so that p(x) does not have any sin-
gularities inside Ω.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 58/75
7/30/2019 Computational Methods in Acoustics

4.1 T HE K IRCHHOFF-H ELMHOLTZ INTEGRAL THEOREM 53

4.1.1 Free field


So far, we’ve been working under the assumption that Ω is an enclosed do-
main. It is also possible to investigate free field problems with the Kirchhoff-
Helmholtz integral theorem, which makes it even more useful.

Γ∞

Γ Ω Γ
Figure 4.3: as a surface inside , enclosed by a spherical shell ∞.

We may redefine our surface again, letting


Γ → Γ+Γ ∞.

We now denote internal surfaces as Γ, while Γ∞ is a infinitely large spherical


shell around the origin at r ∞, as shown in Figure 4.3. The integral in equa-

tion 4.4 must therefore be performed over both Γ and Γ∞ . The outer integral
 becomes
  − e  jkr ∂ p
−  p
∂ e− jkr


r ∂n ∂n r
Γ∞
π  2π 
  −     (4.5)
  e  jkr ∂ p
= lim sin θ dθ r + jkp + p r2 dφ.
r →∞ r2 ∂r
0 0
To solve this, we need to use the Sommerfeld radiation condition, which
states that we cannot have spherical waves propagating inwards from infinity.
In Sommerfeld’s own words, [25]
the sources must be sources, not sinks of energy. The energy which
is radiated from the sources must scatter to infinity; no energy may
be radiated from infinity into [.. . ] the field.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 59/75
7/30/2019 Computational Methods in Acoustics

54 C HAPTER 4 T HE BOUNDARY ELEMENT METHOD

Mathematically, the Sommerfeld radiation condition states that

r
 ∂ p
+ jkp
→ 0, p →0 when r → ∞. (4.6)
∂r
Inserting this into our integral, we find that the entire integrand goes to zero,
so that
 
e− jkr ∂ p
 p
∂ e− jkr
−dΓ = 0.

(4.7)
r ∂n ∂n r
Γ∞

This means that the Kirchhoff-Helmholtz integral theorem in equation 4.4


is equally valid both when Γ encloses Ω, and when Γ is a surface inside an
infinite domain Ω.

4.2 Discretisation of the surface integral


The Kirchhoff-Helmholtz integral theorem in equation 4.4 is quite powerful,
 but it is obviously difficult to calculate analytical solutions except in very sim-
ple cases. However, we may approximate by discretising the surface integral.
We split the surface Γ into plane surface elements Γi with centers yi , and
assume that the pressure and normal derivative of the pressure are constant
on each element,

 p(y) |on Γi = p( yi ) = pi ,
∂ p(y)
 =
∂ p(xi )
= qi .
∂n on Γi ∂n

We have also renamed the partial derivative of the pressure to q(y) for nota-
tional simplicity. Through the Euler’s equation, this quantity is also related to
the normal velocity amplitude un (y),

q(y) =  jωρun (y).


− (4.8)

For instance: On a rigid surface, we have un (y) = 0, giving q(y) = 0.


Thus, the Kirchhoff-Helmholtz integral theorem becomes

1
   − e  jkR   ∂ e− jkR

4π  ∑ 
 p(x) ≈ q j dΓ −  p j dΓ . (4.9)
 j R ∂n R
Γ j Γ j

This is fine as long as we know both pi and qi on every surface element Γi .


However, it is possible to find unknown values of  pi from known values of qi
or vice versa, meaning that we only need to know one to find the other. This
is a key point in the boundary element method, and we start by evaluating the
pressure on the surface element Γi , setting p(x) = p(xi ) = pi .
When placing x on Γ, we no longer need to cover it in a full sphere to re-
move it from Ω like we did when deriving the Kirchhoff-Helmholtz integral
theorem. Instead, it is sufficient to cover it in a hemisphere. The only dif-
ference halving the sphere in this way makes is that the factor 4π  is halved,
 becoming 2π .

http://slidepdf.com/reader/full/computational-methods-in-acoustics 60/75
7/30/2019 Computational Methods in Acoustics

4.2 D ISCRETISATION OF THE SURFACE INTEGRAL 55

Thus, equation 4.9 becomes

∂ e− jkR
2π  pi + ∑  p j
  dΓ = ∑ q j
  − e  jkR
d Γ,
 j
∂n R  j
R
Γ j Γ j

or
 
ˆ ij + 2πδij = ∑ q j Gij ,
∑  p j  H 
 j  j
  ∂ e− jkR
  − e  jkR (4.10)
ˆ ij =
where  H  dΓ and Gij = d Γ.
∂n R R
Γ j Γ j

ˆ
In  H ij and Gij , we integrate over functions of  R. This is the distance from xi ,
the center of the surface element Γi which we are evaluating the pressure on,
and y, a point on another surface element Γ j .
While most elements of  H  ˆ ij and Gij are simple in principle to calculate nu-
merically, special attention must be paid to the i = j case, where 1/R goes to
infinity at y = xi .
The integrand in  H  ˆ ii is

∂ e− jkR
− 
e  jkR
= n̂Γi ·∇ .
∂n R R

Since R is the length of a vector pointing from the center of the plane element
Γi to another point on Γi , the gradient in this equation must always lie in the
same plane as Γi . Since the normal vector n̂Γi is always normal to Γi , it is
perpendicular to the gradient. The dot product becomes zero, so that

ˆ ii = 0.
 H 

On the other hand, the integrand in Gii actually goes to infinity at y = xi .


This integral still converges to a specific value, but we will not go into how to
calculate it here.
Equation 4.10 is equivalent to the matrix equation

Hp = Gq, where H = Ĥ + 2π I. (4.11)

Since all the matrix elements  H  ˆ ij and Gij are nonzero, these matrices are fully
populated. Formulating the problem in this manner allows us to find unknown
values of the pressures on the surface from known values of the normal veloc-
ities.
First, let’s assume that the normal velocities, which are related to qi through
equation 4.8, are known on all the surface elements. We may then find the
unknown surface pressures as p = H−1 Gq. Now we know both pi and qi on
each surface element Γi , and we may find the pressure in the domain through
the discretised Kirchhoff-Helmholtz integral theorem in equation 4.9.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 61/75
7/30/2019 Computational Methods in Acoustics

56 C HAPTER 4 T HE BOUNDARY ELEMENT METHOD

Second, if we know the pressures on all the surface elements but not the
normal velocities, we may find these as q = G−1 Hp. We may then find use
these to find the pressure in the domain, as in the previous case.
Third, if we know the pressures on some of the surfaces and the normal
velocities on the others, it is possible to use linear algebra methods to reformu-
late these matrices and vectors so that one vector holds all our knowns and the
other holds all our unknowns. Then, the unknowns may be found through in-
version. We will not go into any detail here beyond stating that this is possible.

4.3 Summary
In this chapter, we have seen how a solution of the Helmholtz equation may be
found inside a domain from an integral over its boundary. We have also seen
how a discretisation of this boundary allows us to find the boundary pressure
from its normal derivative, or vice versa. This allows us to calculate the pres-
sure anywhere in the domain, simply by knowing either the pressure on the
 boundary or its normal derivative.
Finding the pressure or its normal derivative from the other is done by re-
lating them through a system of equations, which may be formulated in matrix
form. The two matrices relate each boundary element with every boundary el-
ement including itself, resulting in fully populated matrices. When the number
of elements grows, the storage requirements and required computational time
increase more quickly than for other methods.
This means that the boundary element method is most appropriate for
problems where we have a large volume and a small surface, for instance if 
we want to examine the radiated sound field around a loudspeaker in a free
field.
It is also difficult to handle cases where the field around a point source (the
Green’s function) is not linear or changes through the domain. For this reason,
the BEM is not an appropriate method for nonlinear acoustics or underwater
acoustics with a varying sound speed profile.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 62/75
7/30/2019 Computational Methods in Acoustics

Chapter 5
Raytracing methods

Raytracing is a method used not only in acoustics, but also in other fields such
as radio communication, optics, seismology, and computer graphics. By tak-
ing a high-frequency approximation and thus neglecting the low-frequency
phenomenon of diffraction, we may see the sound field as being transported
along a number of rays emanating from an acoustic source. This concept may
 be familiar from geometrical optics, where we track rays of light emitted by a
light source and passing through e.g. lenses, as shown in Figure 5.1.

Figure 5.1: Rays from a light source being bent by a lens.

A major advantage of the raytracing approach is that it makes it simple to


study propagation of sound in cases where the speed of sound varies through-
out the domain. In these cases, the sound path will tend to bend throughout
the domain, and the rays will bend accordingly. For this reason, raytracing is
widely used in marine and atmospheric acoustics.
Another advantage is that raytracing may be less computationally expen-
sive than the other methods for studying high-frequency sound propagation
in a large domain. For this reason, raytracing is also commonly used as a
tool for predicting the acoustic character of e.g. concert halls before these are
 built. While raytracing may give somewhat erroneous results at low frequen-
cies since diffraction is neglected, the method works when the wavelengths are
much smaller than the domain’s geometry.

57

http://slidepdf.com/reader/full/computational-methods-in-acoustics 63/75
7/30/2019 Computational Methods in Acoustics

58 C HAPTER 5 R AYTRACING METHODS

5.1 The ray approximation


We may not always assume that the speed of sound is constant. For instance,
in marine and atmospheric acoustics, the speed of sound is a function of depth
and altitude. A general speed of sound may be written as c(x), so that the
wave equation becomes
2
∇2 p(x, t) = c21(x) ∂  p∂t(x2, t) . (5.1)

We now assume that this equation is solved by

 p(x, t) = A(x)e jω (t−W (x)/c0 ) , (5.2)

Here, c0 is some reference speed of sound, and W (x) is called the eikonal. The
eikonal is a generalised representation of how the phase of a pressure wave
varies with position.
For instance, for a plane wave moving in x direction, the eikonal would be
simply
W (x) = x.
For a spherical wave radiating from the origin, the eikonal would be

W (x) = r.

In both cases, it is clear that the waves’ direction of propagation, represented


 by the unit vector ŝ, may be related to the eikonal as
∇W  .
ŝ = (5.3)
|∇W |
We normalize by |∇W | here to ensure that |ŝ| = 1 always.
If we substitute our trial solution (5.2) into the wave equation (5.1) and
apply the derivatives, we can separate the result into two equations: One for
the real part and one for the imaginary part,
2 2 2
Real: − ∇ A A + ωc2 ∇W · ∇W  = ωc2 , (5.4a)
0

Imaginary: 2 ∇ A · ∇W  + ∇2 W  = 0. (5.4b)


 A
This is a difficult system of equations to solve, since they include A, W , their
gradients, and their Laplacians.
We may simplify things a great deal by assuming that the frequency is very
high, i.e. ω → ∞. The first term in equation 5.4a is then negligible, and the
equation may be simplified to
2
∇W · ∇W  = c2c(0x) = n2, (5.5)

http://slidepdf.com/reader/full/computational-methods-in-acoustics 64/75
7/30/2019 Computational Methods in Acoustics

5.1 T HE RAY APPROXIMATION 59

where n is the index of refraction. This equation is called the eikonal equation,
and we might have attempted to solve it to find the eikonal W (x). This is one
possible way to calculate sound propagation in inhomogeneous media, but this
method has its own problems and is not related to raytracing, which is what
we want to be studying. More information on solving the eikonal equation
numerically may be found in e.g. reference [26].
The neglected A term is related to diffraction of the sound field. By ne-
glecting it, we similarly neglect diffraction. This corresponds well with the
fact that we have done a high-frequency approximation, and diffraction is a
low-frequency phenomenon.
The eikonal equation implies that

W  = n.
|∇ |
Combining this with equation 5.3, we find that

∇W  = nŝ. (5.6)

Figure 5.2: Two ray path unit vectors ŝ at two different points along a ray.

Now, the main concept of raytracing is that we may see the propagation
of sound as happening along rays which start at some acoustic source and
move throughout the domain, carrying the acoustic energy with them. At ev-
ery point along the ray it is moving in ŝ direction, as shown in Figure 5.2. This
means that the ray is bending according to how ŝ is changing along its path.
Each ray carries a certain amount of acoustic power. The rays tend to di-
verge as they move further away from their source, so that the intensity be-
comes lower with distance. In Figure 5.3, the total power on the left side of the
gray area is equal to the total power on the right side. We know this classically
from the inverse square law — intensity goes down as the surface goes up,
 but their product stays constant. In the raytraing approach, we may also see
the power on both sides as being equal because the same amount of rays pass
though both surfaces. This may be derived from equation 5.4b, as in references
[9, 27].
We may also find an expression for the ray path direction ŝ through ds,
which is the length of an infinitesimal step along the ray path, and its x, y,

http://slidepdf.com/reader/full/computational-methods-in-acoustics 65/75
7/30/2019 Computational Methods in Acoustics

60 C HAPTER 5 R AYTRACING METHODS

Figure 5.3: Since the rays are denser on the left side of the gray area, the inten-
sity is higher than on the right side. But since the same amount of rays pass
through the surface, the power is the same on both sides.

and z components dx, dy, and dz, which are shown in Figure 5.4. The ray path
direction may be expressed as

dx dy dz
ŝ = x̂ + ŷ + ẑ, (5.7)
ds ds ds
where x̂ is the unit vector in x direction, etc.

 y

dx
dy
 d s

Figure 5.4: “Infinitesimal” components on a ray moving in the x − y plane.

We may find the derivative along the ray of some quantity through the
derivative in the direction of the ray path,

d
= ŝ · ∇. (5.8)
ds
To find out how the ray bends along its path, we apply this ray path derivative
to the ray path direction itself and use equation 5.6,

d d
ds
nŝ =
ds

W  = ∇ dsd W  = ∇ (ŝ · ∇W ) = ∇ (ŝ · nŝ) = ∇n (ŝ · ŝ) (5.9)
= n.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 66/75
7/30/2019 Computational Methods in Acoustics

5.2 R AYTRACING FOR MARINE AND ATMOSPHERIC ACOUSTICS 61

Thus, we see that the bending of the ray is only dependent on the gradient of 
the index of refraction.
We could derive a similar equation for the behaviour of light as well. In
that case, we would have a well-defined reference speed c0 ; the speed of light
in a vacuum. In acoustics, we do not have such a well-defined reference speed,
so we may as well set c0 = 1, so that the index of refraction becomes n = 1/c,
and equation 5.9 becomes

d ŝ
= ∇
1
= − c12 ∇c. (5.10)
ds c c
This equation may be used to calculate how the ray path bends as it moves
through a medium with a position-dependent speed of sound. It shows us
that the ray will tend to bend away from an increase in the speed of sound.
However, we may simplify these calculations further by making assumptions
on how the speed of sound changes in the domain.

5.2 Raytracing for marine and atmospheric acoustics


In the ocean and the atmosphere, the speed of sound may be assumed to be
a function of depth or altitude only, so that c(x) = c( z). The sound speed
variations are due to variations in factors such as temperature and density in
the acoustic medium.
When the speed of sound does not depend on x or y, we can see that the
x and y components of equation 5.10 are zero. Therefore, the ray will stay

in the same vertical plane, which we may define to be the x  z plane, thus
simplifying our problem to a two-dimensional one.
A segment of a bending ray will form an arc which may be seen as part of 
a circle with radius R, as shown in Figure 5.5. If the angle θ is defined as in the
figure, we find

dz = sin θ ds, (5.11a)


dx = cos θ ds, (5.11b)
ds = R dθ. (5.11c)

TheUsing
last ofequation
these equations is found
5.11b, the from the
x component ofarc length 5.10
equation formula.
becomes

d
   
1 dx
=
d cos θ
= 0.
ds c ds ds c

This means that the quantity cos θ ( z)/c( z) is constant along the entire ray. If 
we define θ0 and c0 as the angle of the ray and the speed of sound at its starting
position, we may find an expression similar to Snell’s law,

cos θ ( z) cos θ0


= = ξ . (5.12)
c( z) c0

http://slidepdf.com/reader/full/computational-methods-in-acoustics 67/75
7/30/2019 Computational Methods in Acoustics

62 C HAPTER 5 R AYTRACING METHODS

R
d     
s   
dz θ
dx

 z

Figure 5.5: A ray segment forms an arc dθ which is part of a circle with radius
R. The z axis is drawn downward, as common in marine acoustics.

We have here introduced the ray parameter ξ , which is constant along the ray.
If we take the z derivative of both sides, we find from the product rule that
d cos θ ( z) d 1 1 d
= cos θ + cos θ = 0. (5.13)
dz c( z) dz c c dz
From the chain rule, we have that
d dθ d
dz
cos θ =
dz dθ
cos θ = − dθ
dz
sin θ,

and from equations 5.11a and 5.11c we find that


dθ 1
= .
dz R sin θ
We may insert these into equation 5.13 to get
cos θ dc sin θ
= 0,
c2 dz cR sin θ
Solving this for R, we get
− −
R( z) = − cosc( zθ () z) dc1( z) = − ξ g1( z) . (5.14)
dz

Here, we have introduced g( z) as a briefer notation for the sound speed gradi-
ent dc ( z)/dz.
The sign of R( z) is relevant. For positive or negative R, the ray will curve in
positive or negative z direction, respectively. For instance, R would be negative
in Figure 5.5.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 68/75
7/30/2019 Computational Methods in Acoustics

5.2 R AYTRACING FOR MARINE AND ATMOSPHERIC ACOUSTICS 63

From the above equation we may find the curvature radius of the ray at
any depth or altitude z directly from the initial state of the ray (c0 /cos θ0 ) and
the sound speed gradient. We may use this to trace the ray exactly in any area
where the gradient is constant. In reality however, g( z) will change smoothly
with z. To find the ray path, we will need to start discretising.

c( z)
 z0

 z1

 z2

 z3

 z4

 z

Figure 5.6: The continuous sound speed profile ( ) is discretised into a func-
tion which is piecewise linear ( ).

We assume that our acoustic medium is divided into layers of constant


sound speed gradient, as shown in Figure 5.6. The speed of sound itself be-
comes piecewise linear,

c( z) = ci + gi ( z − zi ) for zi≤  z ≤  zi+1,


c − ci (5.15)
where ci = c( zi ), and gi = i+1 .
 zi+1 − zi

We may measure c( zi ) in the ocean with a CTD instrument, and in the atmo-
sphere we may measure it with a weather balloon. The ray curvature in each
layer becomes
1
Ri = .− (5.16)
ξ gi

Now that we know the ray curvature, we want to find how far in x direction
the ray travels as it passes through one layer. We want to find the position xi+1 ,
as illustrated in Figure 5.7.
From equations 5.11b and 5.11c, we find that

dx = R cos θ dθ.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 69/75
7/30/2019 Computational Methods in Acoustics

64 C HAPTER 5 R AYTRACING METHODS

xi x i +1 x

 zi
θi

 zi+1 θ i +1

 z

Figure 5.7: A ray segment passing through one layer of constant sound speed
gradient.

Integrating this from one layer to the next, we find

xi+1
  θi+1
 
dx = Ri cos θ dθ,
xi θi

x i +1 − xi = Ri (sin θi+1 − sin θi ) . (5.17)

We may find Ri from equation 5.16, and we may find θi from equation 5.12 as
1
θi = cos− (ξ ci ) .
Thus, we are able to track the ray as it moves from layer to layer. When the
ray hits a surface, e.g. the water surface, the seabed, or the ground, we may
assume the reflection to be specular. A flat surface will not cause the ray pa-

rameter ξ  to change since cos(θ ) = cos( θ ), but ξ  will need to be recalculated
if the surface is sloped.
Examples of raytracing results may be found for instance in Hovem’s book
[27].

5.3 Room acoustics


In room acoustics, raytracing is used to predict important parameters such as
impulse responses, acoustic coverage, and the directivity of received sound.
The first article on raytracing in concert halls was published in 1968 by Krok-
stad, Strøm, and Sørsdal [28], who were all affiliated with the Technical Uni-
versity of Norway (now NTNU) at the time.
One problem with using raytracing for room acoustics is the high-frequency
approximation which underlies the method. The effects of diffraction, which
is a low-frequency phenomenon, are not included in the results. However, the
low frequency content of sound matters less for the perception of sound in the

http://slidepdf.com/reader/full/computational-methods-in-acoustics 70/75
7/30/2019 Computational Methods in Acoustics

5.3 R OOM ACOUSTICS 65

room [28], so we may just accept that our results may be somewhat inaccurate
at low frequencies.
In a room, we may assume that the speed of sound is constant. From equa-
tion 5.10 we get that
d ŝ
= 0.
ds c
Thus, the ray will never bend along its path. It will only change direction when
 bouncing off a wall.

Figure 5.8: Some of the rays from a source which pass through a counting
sphere.

To examine the transmission of sound from source to a receiver in the room,


we let the source send out rays, track their path through the room, and count
how many rays pass through a counting sphere, as shown in Figure 5.8.

When a ray bounces off a surface, we decrease its energy by a factor 1 α,
where α is the absorption coefficient of the surface. Thus, we may track how
the ray is losing energy as it is bouncing around the room. When the ray’s
energy falls below a certain threshold, we stop tracing it.
We also track how far the ray has moved as we trace it. In this way, we may
find when the ray hits the counting sphere. By adding the energy of all rays
which hit the counting sphere within different time intervals, we may make a
histogram to estimate the impulse response between source and receiver. More
information on this may be found for instance in references [ 28, 29].

Figure 5.9: When a ray impinges on a diffusing wall, there is a chance that the
ray will be reflected in a random direction.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 71/75
7/30/2019 Computational Methods in Acoustics

66 C HAPTER 5 R AYTRACING METHODS

Some surfaces have a tendency to scatter incoming sound into other direc-
tions instead of giving specular reflection. We may define a scattering coeffi-
cient δ as the amount of energy not reflected specularly. When a ray hits such
a surface, we may give it a probability of  δ of being reflected in a random di-
rection instead having a specular reflection. This simulates diffusion in such a
way that we get statistically correct behaviour.
This section gives only a brief idea of some of the methods used in ray-
tracing for room acoustics. There are many alternative methods in this field.
More information may be found in the book by Kuttruff [29], or by taking other
courses such as TT8302 Room acoustics.

5.4 Summary
Raytracing is a high-frequency approximation in which we assume that sound
propagates along rays which emanate from an acoustic source. If the speed of 
sound varies throughout the domain, the rays will tend to bend towards lower
speed of sound. We may trace the movement of these rays to determine the
acoustic coverage of the domain. The more rays we trace from the source, the
more accurate our result becomes.
The method is particularly well adapted for cases where the speed of sound
varies, such as marine or atmospheric acoustics, where the speed of sound is
generally assumed to be a function of depth or height only. It is also widely
used for room acoustics, where it may be less computationally expensive than
other methods, particularly at high frequencies. Also, using raytracing gives
directional information which may be valuable for analysis and auralisation of 
rooms.
One disadvantage of raytracing is that the effects of diffraction are neglected
due to the high-frequency approximation. This means that even with infi-
nite computational resources, raytracing can never be completely accurate in all
cases. However, since the importance of diffraction decreases with frequency,
the potential accuracy of raytracing will increase correspondingly.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 72/75
7/30/2019 Computational Methods in Acoustics

Bibliography

[1] A. C. Reynolds, “Boundary conditions for the numerical solution of wave


propagation problems,” Geophysics, vol. 43, no. 6, pp. 1099–1110, 1978.

[2] B. Chopard and M. Droz, Cellular Automata Modelling of Physical Systems.


Cambridge University Press, 1998.

[3] J. Hardy, Y. Pomeau, and O. de Pazzis, “Time evolution of a two-


dimensional classical lattice system,” Physical Review Letters, vol. 31, no. 5,
pp. 276–279, 1973.

[4] J. Hardy, Y. Pomeau, and O. de Pazzis, “Time evolution of a two-

dimensional model system. I. Invariant states and time correlation func-


tions,” Journal of Mathematical Physics, vol. 14, no. 12, pp. 1746–1759, 1973.

[5] U. Frisch, B. Hasslacher, and Y. Pomeau, “Lattice-gas automata for the


Navier-Stokes equation,” Physical Review Letters, vol. 56, no. 14, pp. 1505–
1508, 1986.

[6] U. Frisch, D. d’Humieres, B. Hasslacher, P. Lallemand, Y. Pomeau, and J.-P.


Rivet, “Lattice gas hydrodynamics in two and three dimensions,” Complex
Systems, vol. 1, no. 4, pp. 649–707, 1987.

[7] P. Stansell and C. A. Greated, “Lattice gas automaton simulation of acous-


tic streaming in a two-dimensional pipe,” Physics of Fluids, vol. 9, no. 11,
pp. 3288–3299, 1997.

[8] G. McNamara and G. Zanetti, “Use of the Boltzmann equation to simulate


lattice-gas automata,” Physical Review Letters, vol. 61, no. 20, pp. 2332–
2335, 1988.

[9] L. E. Kinsler, A. R. Frey, A. B. Coppens, and J. V. Sanders, Fundamentals of 


acoustics. John Wiley & Sons, 4th ed., 2000.

[10] J. M. Buick, C. A. Greated, and D. M. Campbell, “Lattice BGK simulation


of sound waves,” Europhysics Letters, vol. 43, no. 3, pp. 235–240, 1998.

67

http://slidepdf.com/reader/full/computational-methods-in-acoustics 73/75
7/30/2019 Computational Methods in Acoustics

68

[11] E. M. Viggen, “The lattice Boltzmann method with applications in acous-


tics,” Master’s thesis, NTNU, 2009.
[12] B. Chopard and P. O. Luthi, “Lattice Boltzmann computations and appli-
cations to physics,” Theoretical Computer Science, vol. 217, no. 1, pp. 115–
130, 1999.

[13] D. H. Rothman and S. Zaleski, Lattice-Gas Cellular Automata: Simple Models


of Complex Hydrodynamics. Cambridge University Press, 1997.

[14] M. Sukop and D. Thorne, Lattice Boltzmann Modeling: An Introduction for


Geoscientists and Engineers. Springer, 2006.

[15] J. Lätt, Hydrodynamic Limit of Lattice Boltzmann Equations. PhD thesis, Uni-
versity of Geneva, 2007. Freely available online at http://lbmethod.org.

[16] S. Succi, The Lattice Boltzmann Equation for Fluid Dynamics and Beyond. Ox-
ford University Press, 2001.

[17] Y. Kagawa, T. Tsuchiya, B. Fujii, and K. Fujioka, “Discrete Huygens’ model


approach to sound wave propagation,” Journal of Sound and Vibration,
vol. 218, no. 3, pp. 419 – 444, 1998.

[18] Y. Kagawa, T. Tsuchiya, K. Fujioka, and M. Takeuchi, “Discrete huygens’


model approach to sound wave propagation - reverberation in a room,
sound source identification and tomography in time reversal,” Journal of 
Sound and Vibration, vol. 225, no. 1, pp. 61–78, 1999.
[19] C. Christopoulos, The Transmission-Line Modeling Method: TLM. IEEE
Press, 1995.

[20] “List of finite element software packages.” Wikipedia article.

[21] M. J. Crocker, Handbook of Acoustics. John Wiley & Sons, 1998.

[22] P. Bettess, “Infinite elements,” International Journal for Numerical Methods


in Engineering, vol. 11, no. 1, pp. 53–64, 1977.

[23] R. Astley, “Wave envelope and infinite elements for acoustical radiation,”
International Journal for Numerical Methods in Fluids, vol. 3, no. 5, pp. 507–
526, 1983.

[24] R. Astley and W. Eversman, “Finite element formulations for acoustical


radiation,” Journal of Sound and Vibration, vol. 88, no. 1, pp. 47–64, 1983.

[25] A. Sommerfeld, Partial Differential Equations in Physics. Academic Press,


1964.

[26] B. Engquist and O. Runborg, “Computational high frequency wave prop-


agation,” Acta Numerica, vol. 12, pp. 181–266, 2003.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 74/75
7/30/2019 Computational Methods in Acoustics

69

[27] J. M. Hovem, “Marine acoustics: The physics of sound in underwater en-


vironments.”
[28] A. Krokstad, S. Strøm, and S. Sørsdal, “Calculating the acoustical room
response by the use of a ray tracing technique,” Journal of Sound and Vibra-
tion, vol. 8, no. 1, pp. 118–125, 1968.

[29] H. Kuttruff, Room Acoustics. Elsevier, 4th ed., 2000.

http://slidepdf.com/reader/full/computational-methods-in-acoustics 75/75

You might also like