MultipleScattering.jl

A Julia library for simulating, processing, and plotting multiple scattering of waves.

MultipleScattering.jl calculates how time-harmonic waves are scattered by many particles. It uses the multipole method, also called the T-matrix method, to solve the Helmholtz equation. This method is particularly efficient for particles in an infinite domain. Each particle is represented by its T-matrix, so particles can have any shape and properties for which a T-matrix is known.

The package is set up for different spatial dimensions and different types of waves which satisfy Helmholtz equations, such as acoustics, electromagnetism, and elasticity. Acoustics in 2D and 3D is implemented here. For details on the maths see Martin (1995), Gower et al. (2017), and the notes in Theory.

Features

  • Acoustic waves in two and three spatial dimensions.
  • Particles: penetrable, sound-hard and sound-soft circles and spheres, concentric capsules, and 2D Helmholtz resonators. New particles only need a T-matrix, see New particles.
  • Sources (incident waves): plane waves, point sources, beams, and any linear combination of these. See RegularSources.
  • Results in the frequency domain, and in the time domain by using Fourier transforms with smooth impulses. See Time response.
  • Random placement of particles in a region, for a given volume fraction, and statistics over many random configurations.
  • Plot recipes for particles, shapes, sources, fields, and results. See Plotting.

Installation

Install Julia v1.10 or later, then run

using Pkg
Pkg.add("MultipleScattering")

Quick example

Calculate the field scattered by a single circular particle when it is hit by a plane wave:

using MultipleScattering

host_medium = Acoustic(2; ρ = 1.0, c = 1.0)  # 2D acoustics, density 1.0 and sound speed 1.0
particle = Particle(Acoustic(2; ρ = 0.5, c = 0.6), Sphere([0.0, 0.0], 1.0))
source = plane_source(host_medium; direction = [1.0, 0.0])

# the total field at the point x = [3.0, 0.0] for the angular frequency ω = 2.0
result = run([particle], source, [3.0, 0.0], 2.0)
round.(field(result), digits = 6)

# output

1×1 Matrix{ComplexF64}:
 0.391303 + 1.054422im

If you have the package Plots installed, then plot(FrequencySimulation([particle], source), 2.0) plots the whole field around the particle.

Where to start

  • The Introduction walks through a complete simulation, from the medium to plotting results in time.
  • Simulations and results explains what run calculates, how to choose basis_order, and how to use the results.
  • The manual pages on RegularSources, Shapes, and Particles describe the building blocks in more detail.
  • The Examples show complete scripts, many with plots.
  • The Library lists every type and function.

These packages build on MultipleScattering.jl:

Contents