Skip to content

[FEATURE] add pytta.bem, boundary elements for radiation into free field - #123

Open
aguirreSL wants to merge 1 commit into
PyTTaMaster:developmentfrom
aguirreSL:dev-bem
Open

aguirreSL wants to merge 1 commit into
PyTTaMaster:developmentfrom
aguirreSL:dev-bem

Conversation

@aguirreSL

Copy link
Copy Markdown

Adds pytta.bem, a boundary element solver for the sound radiated by a vibrating closed body into free field. It solves the surface equation

½ p(x) = ∫_S [p(y) ∂G/∂n(x, y) - G(x, y) q(y)] dS(y),   G = e^(-jkr) / (4πr),

by collocation with constant triangular elements, n pointing into the fluid and q = ∂p/∂n = -jωρ v_n (Ciskowski and Brebbia, Boundary Element Methods in Acoustics, 1991; Marburg and Nolte, Computational Acoustics of Noise Propagation in Fluids, 2008).

  1. icosphere(radius, level): a triangulated sphere with outward normals.
  2. surface_pressure(nodes, tris, freq, velocity, chief=None, c, rho): the pressure on each element for a normal velocity per element. CHIEF points inside the body (Schenck, J. Acoust. Soc. Am. 44, 1968), ten by default, are added by least squares and remove the irregular frequencies of the surface equation.
  3. field(nodes, tris, freq, pressure, velocity, points): the pressure at points in the fluid.

The regular integrals use the seven-point rule of Dunavant (1985). On its own element, the 1/r part of G is integrated exactly in polar coordinates around the collocation point, and ∂G/∂n vanishes for a flat element. The ITA-Toolbox has no BEM of its own, only interfaces to external solvers, so this is a new implementation.

The tests in tests/test_bem.py use a sphere of 0.1 m radius with 1280 elements and print the measured differences:

  1. A pulsating sphere at ka = 0.55, 1.83 and π gives the analytic surface pressure ρcU jka / (1 + jka) within 2.9e-3 and the field at three points within 8.7e-3. At ka = π, an irregular frequency, the same solve without CHIEF points is off by more than 5 % (14 %).
  2. A rigid sphere oscillating along z at ka = 1.5 gives the analytic dipole field within 4.6e-3 and its surface pressure within 5.8e-3.

Checked with Python 3.12, numpy 1.26 and scipy 1.17. The 7 failures of development (3 in test_h5io.py, 4 in test_pyttasave.py) are the same with and without this change.

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant