Flow Lab

Syllabus / Module 14: Applications: Physics & Engineering

Lesson 14.6

Acoustics & Wave Propagation

The acoustic wave equation from linearized fluid equations, sound speed, standing waves in pipes, spherical waves, Doppler effect.

Written byClaude Sonnet

🌊
Why this matters for simulation: Aeroacoustics — the noise from jets and propellers.

By the end of this lesson you can…

  • Linearize the mass and momentum equations of an ideal gas about rest to get $p'_{tt} = c^2\nabla^2p'$, and compute $c = \sqrt{\gamma p_0/\rho_0}$ at $20^\circ$C, saying why Newton's isothermal value is $15\%$ low.
  • Turn a plane wave into an impedance $Z = \rho_0c$, an intensity and a decibel level.
  • Find the resonances of pipes with closed and open ends, and the room modes $\frac c2\sqrt{(m/L_x)^2 + (n/L_y)^2}$.
  • Solve the radial wave equation with $U = rp$, and explain the $1/r$ decay and $6$ dB per doubling of distance.
  • Derive $R = (Z_2 - Z_1)/(Z_2 + Z_1)$ and compute that air-water reflects $99.89\%$ of the intensity.
  • Derive the Doppler shifts, and relate the Mach cone angle to $\sin\theta = 1/M$.
  • Run a 2D leapfrog room simulation, read its modes off a probe spectrum, and measure how the grid shifts them.
On this page
·
  1. From Euler to the wave equation
  2. Plane waves, impedance and decibels
  3. Pipes: standing waves and eigenvalues
  4. Spherical waves
  5. Reflection and transmission
  6. The Doppler effect
  7. Absorption, and the sound of flight
  8. A 2D room by finite differences
  9. The lab
  10. The exercise: pipe and room modes
  11. Concept checks
  12. Problems
  13. What comes next
  14. Key Takeaways

14.5 Vibrating Beams & Structures ended on a wave with an unusual dispersion, ω∝k2\omega\propto k^2. Sound is the plainest wave there is, ω=ck\omega = ck at every audible frequency. 9.4 The Wave Equation & Vibrating Strings said in a callout that sound obeys the string’s equation, and 11.12 Compressible Flow & Shocks got it in 1D from the Euler equations. Here we derive it in 3D and use it: pipes and rooms, spherical waves, interfaces, the Doppler shift, and a 2D finite-difference room checked against its exact modes.

▶ Video Linearizing the Euler equations about still air, plane waves and impedance, resonances of open and closed pipes, spherical waves, reflection at an interface, the Doppler effect, and a 2D room simulationcaptions only
Transcript
  1. Sound is a small perturbation of still air. Linearize the mass and momentum equations about rest and close them with p prime equals c squared rho prime. Eliminating the velocity gives p prime t t equals c squared times the Laplacian of p prime, the wave equation in three dimensions. The speed is the square root of gamma p zero over rho zero, 343.2 metres per second at 20 degrees Celsius. Newton took the compressions as isothermal and got 290.1, which is 15.5 percent low.
  2. A plane wave has pressure equal to Z times velocity, where the impedance Z is rho zero c, 413 in air. Intensity is the rms pressure squared over Z. Levels are 20 log of pressure over 20 micropascals, about the threshold of hearing, from memory, so 1 pascal rms is 93.98 decibels, and doubling the pressure adds 6.02. For a spherical wave put U equal to r p. The equation for U is the one-dimensional wave equation, so the outgoing wave is F of r minus c t over r. A source of 1 watt gives 5.73 pascals, 109.1 decibels at 1 metre, and every doubling of distance costs 6.02 decibels.
  3. A tube guides the wave along its axis. At a closed end the air cannot move, so the pressure slope is zero. At an open end the atmosphere holds the pressure, so it is zero. Separating variables gives the Sturm-Liouville problem. Alike ends resonate at n c over 2 L, and a closed-open pipe has only odd harmonics, c over 4 L times 2 n minus 1, so it sounds an octave below an open pipe of equal length. For a pipe of length 0.5 metres, the closed-open pipe resonates at 171.5, 514.5 and 857.5 hertz, and the open-open pipe at 343, 686 and 1029.
  4. At an interface between impedances Z 1 and Z 2, pressure and particle velocity must be continuous. That gives R equals Z 2 minus Z 1 over Z 2 plus Z 1. A rigid wall has R equal to plus 1, the closed end, and a pressure-release surface has R equal to minus 1, the open end. Water at 20 degrees, from memory, has an impedance 3581 times that of air. So R is 0.99944, and 99.89 percent of the intensity is reflected. Only minus 29.5 decibels is transmitted. The pressure on the water side is 1.9994 times the incident pressure, doubled as at a wall, yet with so much impedance almost no power crosses.
  5. A source emitting crests every T zero while it moves toward you at speed v s delivers them closer together, so f prime equals f zero over 1 minus v s over c. Behind the source it is f zero over 1 plus v s over c. A 440 hertz siren on a car at 30 metres per second sounds 482.2 hertz approaching and 404.6 receding. At Mach 0.5 the lab finds 2.000 and 0.667 times f zero. As the Mach number reaches 1 the fronts pile up. Above 1 the source outruns its waves, which are tangent to a cone with sine theta equal to 1 over M, 30 degrees at Mach 2. A shock is the Doppler effect run past its limit.
  6. Take a 6 metre by 4 metre room with rigid walls. Its modes are Neumann eigenfunctions, with frequencies c over 2 times the square root of m over L x squared plus n over L y squared. The first are 28.583, 42.875, 51.529 and 57.167 hertz, and there are 46 below 250. The leapfrog scheme of the earlier lessons steps the pressure on a grid. The Courant number is 0.7 against a limit of 1 over root 2, so with 0.1 metre cells the step is 204.1 microseconds. Here a pulse leaves the corner and the walls throw it back.
  7. Fire a zero-mean pulse in one corner, record the far corner, apply a Hann window and take the spectrum. At 0.1 metre cells the peaks sit within 0.01 hertz of the grid formula, and well within a fraction of a hertz of the exact modes: 28.580 against 28.583, 57.155 against 57.167. Higher modes drift more. For the 4,0 mode, exact 114.333, the peaks at 0.2, 0.1 and 0.05 metre cells are 113.895, 114.227 and 114.304 hertz, errors of minus 0.438, minus 0.106 and minus 0.029, a factor of roughly 4 per halving. Put a 1 by 1 metre block in the middle and the lowest peak moves from 28.58 to 26.32 hertz.
  8. We took sound from Euler to a numerical room whose leapfrog grid gets the eigenmodes right to a fraction of a percent. Each cell talks only to its neighbours, so the work per step grows with the number of cells. The next lesson, n-body, is about bodies that all act on all. The syllabus lists the N-body equations, softening, leapfrog for N-body, energy and momentum checks, the cost of all pairs, Barnes-Hut trees and the fast multipole idea. The leapfrog is the same scheme, with a sum over all pairs on the right-hand side.

From Euler to the wave equation

Perturb air at rest: p=p0+p′p = p_0 + p', ρ=ρ0+ρ′\rho = \rho_0 + \rho', with u\mathbf u small and p0p_0, ρ0\rho_0 constant. Mass and momentum from 11.3 Momentum: Pressure & the Euler Equations (gravity only adds a hydrostatic profile) are

ρt+∇⋅(ρu)=0,ρ (ut+(u⋅∇)u)=−∇p.\rho_t + \nabla\cdot(\rho\mathbf u) = 0, \qquad \rho\,(\mathbf u_t + (\mathbf u\cdot\nabla)\mathbf u) = -\nabla p .

Keep first-order terms: products like ρ′u\rho'\mathbf u and (u⋅∇)u(\mathbf u\cdot\nabla)\mathbf u are second order, constants have no derivative.

ρt′+ρ0 ∇⋅u=0,ρ0 ut+∇p′=0.\rho'_t + \rho_0\,\nabla\cdot\mathbf u = 0, \qquad \rho_0\,\mathbf u_t + \nabla p' = 0 .

Three unknown fields, two equations. The closure is thermodynamic: for smooth flow without viscosity or conduction, entropy rides with the fluid (from memory, as in the compressible-flow lesson), so linearized about uniform air p′=c2ρ′p' = c^2\rho' with c2=(∂p/∂ρ)s=γp0/ρ0c^2 = (\partial p/\partial\rho)_s = \gamma p_0/\rho_0. Differentiate the mass equation in time, take the divergence of the momentum equation, and eliminate ∇⋅ut\nabla\cdot\mathbf u_t:

ρtt′=−ρ0 ∇⋅ut=∇2p′⟹ ptt′=c2 ∇2p′ \rho'_{tt} = -\rho_0\,\nabla\cdot\mathbf u_t = \nabla^2p' \quad\Longrightarrow\quad \boxed{\,p'_{tt} = c^2\,\nabla^2p'\,}

This is the wave equation of 9.8 Higher Dimensions: Membranes & Drums in three dimensions. The curl of the momentum equation gives ∇×ut=0\nabla\times\mathbf u_t = 0: sound has no vorticity, so u=∇φ\mathbf u = \nabla\varphi.

Why adiabatic. Newton (1687, from memory) took the compressions as isothermal and got c=RTc = \sqrt{RT}. Laplace (1816, from memory) saw that heat cannot cross a wavelength in a fraction of a period. With γ=1.4\gamma = 1.4 and R=287.05R = 287.05 J/(kg K) for dry air (from memory), p0=101 325p_0 = 101\,325 Pa and T=293.15T = 293.15 K, we get ρ0=p0/(RT)=1.204\rho_0 = p_0/(RT) = 1.204 kg/m3^3 and

c=γRT=343.2 m/s,cNewton=RT=290.1 m/s.c = \sqrt{\gamma RT} = 343.2 \text{ m/s}, \qquad c_{\text{Newton}} = \sqrt{RT} = 290.1 \text{ m/s}.

Newton’s value is γ=1.183\sqrt\gamma = 1.183 times too small, 15.5%15.5\% low. We use c=343c = 343 m/s below; since c∝Tc\propto\sqrt T, sound is 3.4%3.4\% faster on a day 2020 K warmer.

Is linearizing legitimate? It needs ∣u∣≪c|\mathbf u|\ll c and ∣p′∣≪p0|p'|\ll p_0. A 9494 dB sound (defined next) has pressure amplitude 1.411.41 Pa, so p′/p0=1.4×10−5p'/p_0 = 1.4\times10^{-5}; at 11 kHz the air moves 0.540.54 μ\mum at 3.43.4 mm/s, ∣u∣/c=10−5|\mathbf u|/c = 10^{-5}. The dropped terms are smaller by that factor. A jet engine is not small, and shocks appear (11.12 Compressible Flow & Shocks).

Plane waves, impedance and decibels

In 1D, p′=f(x−ct)+g(x+ct)p' = f(x - ct) + g(x + ct) (9.5 d'Alembert's Solution & Characteristics). For the right-going part the momentum equation ρ0ut=−px′\rho_0u_t = -p'_x gives u=f/(ρ0c)u = f/(\rho_0c):

p′=Z u,Z=ρ0c.p' = Z\,u, \qquad Z = \rho_0c .

The characteristic impedance is the pressure needed to move the air at a given speed; for air Z=1.204×343=413Z = 1.204\times343 = 413 Pa s/m (rayl). A left-going wave has p′=−Zup' = -Zu. The power per area is p′up'u, and its average is the intensity I=prms2/ZI = p_{rms}^2/Z.

Hearing spans a huge range, so levels use logarithms: SPL=20log⁡10(prms/pref)\mathrm{SPL} = 20\log_{10}(p_{rms}/p_{ref}) dB with pref=20p_{ref} = 20 μ\muPa, about the threshold of hearing at 11 kHz (from memory). One pascal rms is 93.9893.98 dB, about 9494, and carries I=2.42×10−3I = 2.42\times10^{-3} W/m2^2. Doubling the pressure adds 6.026.02 dB; a second equal uncorrelated source doubles II and adds 3.013.01 dB. A sinusoid peaking at one atmosphere is 191.1191.1 dB, the ceiling for a small perturbation.

Pipes: standing waves and eigenvalues

A tube guides the wave along xx: ptt′=c2pxx′p'_{tt} = c^2p'_{xx} on 0<x<L0\lt x\lt L. At a closed end u=0u = 0, so px′=0p'_x = 0: Neumann. At an open end the atmosphere holds the pressure, p′=0p' = 0: Dirichlet, an idealization we correct below. Separating p′=ϕ(x)cos⁡ωtp' = \phi(x)\cos\omega t gives −ϕ′′=k2ϕ-\phi'' = k^2\phi, k=ω/ck = \omega/c, the Sturm-Liouville problem of 8.2 Eigenvalue Problems & Sturm–Liouville Theory:

Endsϕn\phi_nkLkLfn=ω/(2π)f_n = \omega/(2\pi)
closed-closedcos⁡(nπx/L)\cos(n\pi x/L)nπn\pinc/(2L)nc/(2L)
open-opensin⁡(nπx/L)\sin(n\pi x/L)nπn\pinc/(2L)nc/(2L)
closed-opencos⁡((2n−1)πx/2L)\cos\bigl((2n-1)\pi x/2L\bigr)(2n−1)π/2(2n-1)\pi/2(2n−1)c/(4L)(2n-1)c/(4L)

The closed-open pipe has only odd harmonics, 1:3:51:3:5, and sounds an octave below an open pipe of equal length. The string of 9.4 The Wave Equation & Vibrating Strings has the same two ladders (fixed-fixed, fixed-free), the beam’s ωn∝n2\omega_n\propto n^2 (14.5 Vibrating Beams & Structures) comes from the same kind of eigenproblem with a different operator, and the chain of 14.1 Coupled Oscillators & Normal Modes is a pipe made of beads. Another view: a standing wave needs 2kL+δ=2πn2kL + \delta = 2\pi n, where δ\delta is the phase change from the two reflections. A closed end reflects pressure unchanged, an open end flips its sign (shown below), so closed-open has δ=π\delta = \pi and kL=(2n−1)π/2kL = (2n - 1)\pi/2.

Worked example. For L=0.5L = 0.5 m and c=343c = 343 m/s the closed-open pipe resonates at 171.5171.5, 514.5514.5 and 857.5857.5 Hz; the open-open pipe at 343343, 686686 and 10291029 Hz. For 440440 Hz an open pipe needs L=c/(2f)=0.390L = c/(2f) = 0.390 m, a closed one c/(4f)=0.195c/(4f) = 0.195 m.

End correction. Air just outside an open end moves with the wave, so the pipe acts longer: about 0.61r0.61r per unflanged open end of radius rr (Levine and Schwinger, 1948, from memory). For r=1.2r = 1.2 cm the closed-open pipe has Leff=0.5074L_{eff} = 0.5074 m and its fundamental drops from 171.5171.5 to 169.0169.0 Hz, 2.52.5 Hz flat.

Discrete pipe. On NN cells of size hh the second difference, with mirror ghosts at a closed end and sign-flipped ghosts at an open end, gives a symmetric matrix. For N=40N = 40 np.linalg.eigvalsh gives 171.489171.489, 514.203514.203 and 856.123856.123 Hz against exact 171.5171.5, 514.5514.5, 857.5857.5: the error grows like (kh)2/24(kh)^2/24, −0.006%-0.006\% for the first mode and −0.16%-0.16\% for the third. The exercise builds this matrix.

Spherical waves

A small pulsating sphere gives p′(r,t)p'(r, t). The Laplacian of such a function is prr+(2/r)pr=r−2(r2pr)rp_{rr} + (2/r)p_r = r^{-2}(r^2p_r)_r, from the divergence on a thin shell (2.7 Divergence: Sources & Sinks). Put U=rp′U = rp': then Urr=rprr+2prU_{rr} = rp_{rr} + 2p_r, so

ptt=c2(prr+2r pr)⟺Utt=c2Urr.p_{tt} = c^2\left(p_{rr} + \frac2r\,p_r\right) \quad\Longleftrightarrow\quad U_{tt} = c^2U_{rr}.

The 3D radial problem is the 1D wave equation, U=F(r−ct)+G(r+ct)U = F(r - ct) + G(r + ct), and the outgoing wave is p′=F(r−ct)/rp' = F(r - ct)/r. The shape travels at cc while the amplitude falls as 1/r1/r, so I∝1/r2I\propto1/r^2 and the power 4πr2I4\pi r^2I is constant. Each doubling of distance costs 20log⁡102=6.0220\log_{10}2 = 6.02 dB: 9494 dB at 11 m is 88.088.0 dB at 22 m and 7474 dB at 1010 m. One acoustic watt (power level 120120 dB re 10−1210^{-12} W) from a point source gives I=0.0796I = 0.0796 W/m2^2 at 11 m, prms=IZ=5.73p_{rms} = \sqrt{IZ} = 5.73 Pa, 109.1109.1 dB, falling to 6060 dB at 287287 m in a lossless free field. In 3D a pulse passes without a tail, while in 2D (our simulation) it leaves one (Huygens’ principle, from memory).

Reflection and transmission

Media of impedance Z1Z_1 (x<0x\lt0) and Z2Z_2 (x>0x\gt0) meet at x=0x = 0. An incident Af(t−x/c1)A f(t - x/c_1) gives a reflected RAf(t+x/c1)RA f(t + x/c_1) and a transmitted TAf(t−x/c2)TA f(t - x/c_2). Pressure and particle velocity are continuous at the interface. With u=±p/Zu = \pm p/Z:

1+R=T,1−RZ1=TZ2⟹R=Z2−Z1Z2+Z1,T=2Z2Z1+Z21 + R = T, \qquad \frac{1 - R}{Z_1} = \frac{T}{Z_2} \quad\Longrightarrow\quad \boxed{R = \frac{Z_2 - Z_1}{Z_2 + Z_1}, \quad T = \frac{2Z_2}{Z_1 + Z_2}}

The reflected intensity fraction is R2R^2 and the transmitted 4Z1Z2/(Z1+Z2)24Z_1Z_2/(Z_1 + Z_2)^2; they add to 11 (Problem 2). A rigid wall (Z2→∞Z_2\to\infty) gives R=+1R = +1, a Neumann condition; a pressure-release surface (Z2→0Z_2\to0) gives R=−1R = -1, Dirichlet: the pipe’s two ends.

Air to water. For water at 20∘20^\circC, ρ=998\rho = 998 kg/m3^3 and c=1482c = 1482 m/s (from memory), Z2=1.479×106Z_2 = 1.479\times10^6 Pa s/m, 35813581 times the air’s 413413. Then R=0.99944R = 0.99944 and R2=0.99888R^2 = 0.99888: 99.89%99.89\% of the intensity is reflected, 0.112%0.112\% (−29.5-29.5 dB) transmitted. The water-side pressure is T=1.9994T = 1.9994 times the incident one, doubled as at a wall, yet with 35813581 times the impedance almost no power crosses. From below R=−0.99944R = -0.99944. A swimmer hears little of the shouting on the pool deck.

The Doppler effect

A source emits crests every T0=1/f0T_0 = 1/f_0 while moving toward a still observer at vs<cv_s\lt c. Crest kk leaves vskT0v_skT_0 closer and arrives vskT0/cv_skT_0/c earlier, so arrivals are spaced by

T′=T0(1−vsc),f′=f01−vs/c.T' = T_0\Bigl(1 - \frac{v_s}{c}\Bigr), \qquad f' = \frac{f_0}{1 - v_s/c} .

Behind the source it is f0/(1+vs/c)f_0/(1 + v_s/c). For a moving observer and still source the crests are λ=c/f0\lambda = c/f_0 apart and met at relative speed c+voc + v_o: f′=f0(1+vo/c)f' = f_0(1 + v_o/c). The cases differ because sound has a medium. In general f′=f0(c+vo)/(c−vs)f' = f_0(c + v_o)/(c - v_s), speeds positive toward each other (Problem 3).

A siren. A 440440 Hz siren on a car at 3030 m/s (108108 km/h) sounds 482.2482.2 Hz approaching and 404.6404.6 Hz receding: ratio 1.1921.192, 3.043.04 semitones. A listener driving at 3030 m/s past a still siren would hear 478.5478.5 and 401.5401.5 Hz.

The limit M→1M\to1. As M=vs/c→1M = v_s/c\to1, 1/(1−M)→∞1/(1 - M)\to\infty and wavefronts pile up ahead. For M>1M\gt1 the source outruns its waves, which are tangent to a cone of half-angle sin⁡θ=1/M\sin\theta = 1/M, 30∘30^\circ at M=2M = 2, the cone quoted in 11.12 Compressible Flow & Shocks. A shock is the Doppler effect run past its limit.

◆ Interactive Pipes, and wavefronts from a moving source

Loading simulation…

At M=0.5M = 0.5 the lab counts arrival times at observers ahead and behind and finds 2.0002.000 and 0.6670.667 times f0f_0, matching 1/(1∓M)1/(1 \mp M). In the pipe view, closed-open, mode n=2n = 2 (514.5514.5 Hz at L=0.5L = 0.5 m, the third harmonic) has one interior pressure node where the fundamental has none.

Absorption, and the sound of flight

Add viscosity to the momentum balance, ρ0ut=−px′+43μ uxx\rho_0u_t = -p'_x + \frac43\mu\,u_{xx}, with μ=1.81×10−5\mu = 1.81\times10^{-5} Pa s for air (from memory). Eliminating as before, ptt′=c2pxx′+4μ3ρ0pxxt′p'_{tt} = c^2p'_{xx} + \frac{4\mu}{3\rho_0}p'_{xxt}, and a plane wave ei(kx−ωt)e^{i(kx - \omega t)} decays as e−αxe^{-\alpha x} with

α=2μ ω23ρ0c3.\alpha = \frac{2\mu\,\omega^2}{3\rho_0c^3}.

High frequencies die first. At 11 kHz α=9.8×10−6\alpha = 9.8\times10^{-6} Np/m, only 0.0850.085 dB per kilometre, and 100100 times more at 1010 kHz. Real air absorbs far more at 11 kHz, a few dB/km (from memory), because heat conduction and molecular relaxation add to viscosity; I do not derive them. The room simulation below uses a crude friction term σpt\sigma p_t, a decay independent of frequency: σ=1\sigma = 1 s−1^{-1} is a 6060 dB energy decay in 13.813.8 s.

A 2D room by finite differences

Take a 66 m by 44 m room with rigid walls, ∂p/∂n=0\partial p/\partial n = 0. This is a 2D slice, fields independent of height (a true 3D room adds a third index). The modes are Neumann eigenfunctions, like the membrane of 9.8 Higher Dimensions: Membranes & Drums with Neumann in place of Dirichlet ends, so mm or nn may be zero:

pmn=cos⁡mπxLxcos⁡nπyLy,fmn=c2(mLx)2+(nLy)2.p_{mn} = \cos\frac{m\pi x}{L_x}\cos\frac{n\pi y}{L_y}, \qquad f_{mn} = \frac c2\sqrt{\left(\frac m{L_x}\right)^2 + \left(\frac n{L_y}\right)^2}.

At c=343c = 343 m/s the first are 28.58328.583 Hz (1,0)(1,0), 42.87542.875 Hz (0,1)(0,1), 51.52951.529 Hz (1,1)(1,1), 57.16757.167 Hz (2,0)(2,0); (0,2)(0,2) and (3,0)(3,0) coincide at 85.75085.750 Hz. There are 4646 below 250250 Hz. Drive one and, without damping, the source pumps that pattern up without bound.

The scheme is the leapfrog of 10.5 Wave Equation Numerics & the CFL Condition on a cell-centred grid, ν=cΔt/h\nu = c\Delta t/h:

pijn+1=2pijn−pijn−1+ν2(pi+1,jn+pi−1,jn+pi,j+1n+pi,j−1n−4pijn).p^{n+1}_{ij} = 2p^n_{ij} - p^{n-1}_{ij} + \nu^2\bigl(p^n_{i+1,j} + p^n_{i-1,j} + p^n_{i,j+1} + p^n_{i,j-1} - 4p^n_{ij}\bigr).

Walls lie on cell faces and a wall neighbour contributes nothing: a mirror ghost. The lab’s rigid block works the same way. The limit is ν≤1/2\nu\le1/\sqrt2: for h=0.1h = 0.1 m, Δt≤206.2\Delta t\le206.2 μ\mus; the lab uses ν=0.7\nu = 0.7, 204.1204.1 μ\mus. This is the time stepping of 4.7 Energy & Symplectic Integrators on a grid of coupled oscillators. The plane-wave test gives the grid’s own modes exactly, since a cosine fits mirror walls: sin⁡2(ωΔt/2)=ν2[sin⁡2(mπ/2Nx)+sin⁡2(nπ/2Ny)]\sin^2(\omega\Delta t/2) = \nu^2[\sin^2(m\pi/2N_x) + \sin^2(n\pi/2N_y)].

A real room is 3D, with limit 1/31/\sqrt3. For 6×4×36\times4\times3 m up to 11 kHz at 1010 cells per wavelength, h=3.43h = 3.43 cm gives 1.781.78 million cells and, at 95%95\% of the limit, 18 20018\,200 steps per simulated second: 3.3×10103.3\times10^{10} cell updates per second of sound.

The lab

◆ Interactive 2D room acoustics: click to place the source, probe or block; tone or pulse; probe trace and spectrum against the exact room modes

Loading simulation…

  1. Defaults (h=0.1h = 0.1 m, c=343c = 343, σ=1\sigma = 1): drive at 28.628.6, 42.942.9 and 51.551.5 Hz. The field locks into cos⁡(πx/Lx)\cos(\pi x/L_x), then cos⁡(πy/Ly)\cos(\pi y/L_y), then their product.
  2. Press measure spectrum: peaks sit on the dashed mode lines, and the readout lists exact, grid and measured values.
  3. Set c=330c = 330 m/s (about −2∘-2^\circC): the lowest mode falls to 27.5027.50 Hz, as f∝cf\propto c.
  4. Cell size 0.20.2 m: the (4,0)(4,0) peak slides down; 0.050.05 m brings it back.
  5. Tick rigid block and measure again: peaks move and the dashed lines no longer apply.

The exercise: pipe and room modes

The playgrounds compute levels and a Doppler shift, then run the 2D leapfrog room in numpy on a coarse grid. The exercise builds the pipe eigenproblem and the room-mode list.

🐍 Pythonc, impedance, decibels, reflection and Doppler
⌘/Ctrl + Enter
🐍 PythonA coarse 2D room: modes from the probe spectrum
⌘/Ctrl + Enter
🧪 Coding exerciseExercise: pipe resonances and the finite-difference eigenvalues
⌘/Ctrl + Enter

Concept checks

✅ Concept check

What is the ratio of Newton's isothermal sound speed to the adiabatic one for air, $c_{\text{isothermal}}/c$ with $\gamma = 1.4$?

✅ Concept check

A pipe is closed at one end and open at the other, and its fundamental is $f_1$. Which frequencies does it resonate at?

✅ Concept check

A point source gives $94$ dB at $1$ m in open air. What is the level at $8$ m, in dB?

✅ Concept check

A sound wave in a pipe reaches an open end. In the simplest model the reflected pressure wave is

Problems

✏️ Pen & paperHelium and the squeaky voice●○○

Helium has γ=5/3\gamma = 5/3 and R=2077R = 2077 J/(kg K) (from memory). Find cc at 20∘20^\circC and the factor by which vocal-tract resonances, which scale like c/Lc/L, rise.

Show worked solution

c=(5/3)(2077)(293.15)=1007.4c = \sqrt{(5/3)(2077)(293.15)} = 1007.4 m/s, 2.942.94 times air’s 343.2343.2 m/s. The resonances rise by 2.942.94, about one and a half octaves, so the voice sounds thin while the pitch of the vocal folds is unchanged.

✏️ Pen & paperEnergy at an interface●●○

Show that the reflected and transmitted intensity fractions add to 11.

Show worked solution

For incident pressure amplitude AA the intensity is A2/(2Z1)A^2/(2Z_1). The reflected wave has R2A2/(2Z1)R^2A^2/(2Z_1), a fraction R2R^2; the transmitted has T2A2/(2Z2)T^2A^2/(2Z_2), a fraction T2Z1/Z2T^2Z_1/Z_2. Then

R2+Z1Z2T2=(Z2−Z1)2+4Z1Z2(Z1+Z2)2=1.R^2 + \frac{Z_1}{Z_2}T^2 = \frac{(Z_2 - Z_1)^2 + 4Z_1Z_2}{(Z_1 + Z_2)^2} = 1.

TT may exceed 11 (1.99941.9994 into water): that is pressure, not energy.

✏️ Pen & paperTwo cars, one horn●●○

Two cars drive toward each other at 3030 m/s each, and one sounds a 440440 Hz horn (c=343c = 343 m/s). What does the other driver hear?

Show worked solution

f′=f0(c+vo)/(c−vs)=440×373/313=524.3f' = f_0(c + v_o)/(c - v_s) = 440\times373/313 = 524.3 Hz. The effects multiply: 1.0958×1.0875=1.19171.0958\times1.0875 = 1.1917, from 482.2482.2 Hz (source moving) and 478.5478.5 Hz (listener moving).

What comes next

We took sound from Euler to a numerical room whose leapfrog grid gets the eigenmodes right to a fraction of a percent at ten points per wavelength. Each cell talks only to its neighbours, so the work per step grows with the number of cells. The next lesson, 14.7 N-Body Simulation, is about bodies that all act on all. The syllabus lists the N-body equations, softening, leapfrog for N-body, energy and momentum checks, the O(N2)O(N^2) cost, Barnes-Hut trees and the fast multipole idea; the leapfrog is the scheme of 4.7 Energy & Symplectic Integrators, with a sum over all pairs on the right-hand side.

Key Takeaways

  • Linearizing about still air with p′=c2ρ′p' = c^2\rho' gives ptt′=c2∇2p′p'_{tt} = c^2\nabla^2p', c=γp0/ρ0=343.2c = \sqrt{\gamma p_0/\rho_0} = 343.2 m/s at 20∘20^\circC; Newton’s isothermal 290.1290.1 m/s is 15.5%15.5\% low.
  • A plane wave has p′=±Zup' = \pm Zu, Z=ρ0c=413Z = \rho_0c = 413 Pa s/m, and I=prms2/ZI = p_{rms}^2/Z; 11 Pa rms is 9494 dB.
  • Closed ends are Neumann and open ends Dirichlet: nc/(2L)nc/(2L) for like ends, odd harmonics (2n−1)c/(4L)(2n-1)c/(4L) for closed-open, plus an end correction near 0.61r0.61r.
  • With U=rpU = rp the radial equation is 1D: p=F(r−ct)/rp = F(r - ct)/r, I∝1/r2I\propto1/r^2, 6.026.02 dB per doubling.
  • R=(Z2−Z1)/(Z2+Z1)R = (Z_2 - Z_1)/(Z_2 + Z_1): air-water reflects 99.89%99.89\%; a wall gives R=+1R = +1, a free surface R=−1R = -1.
  • Doppler: f0/(1−vs/c)f_0/(1 - v_s/c) for a moving source, f0(1+vo/c)f_0(1 + v_o/c) for a moving observer; for M>1M\gt1 a cone with sin⁡θ=1/M\sin\theta = 1/M.
  • Viscous loss grows as ω2\omega^2; Lighthill puts turbulence on the right of the same wave equation.
  • A 2D leapfrog room at ν=0.7\nu = 0.7 gets the modes to 0.010.01 Hz at h=0.1h = 0.1 m; the (4,0)(4,0) error falls 4×4\times per grid halving.
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.