Skip to main content

Python API for Fluid-solid interaction FEM simulations

Project description

description

LoudPy

LoudPy is an open-source Python API dedicated to loudspeaker finite element simulation, released under the GPL-3.0 license.

Overview

Designing a loudspeaker with FEM means choosing between complex general-purpose tools that require deep expertise, or expensive commercial software. LoudPy is a free, Python-based alternative built specifically for loudspeaker/transducer engineers and researchers.

Starting from a CAD file of your loudspeaker, LoudPy lets you:

  • run harmonic frequency-domain simulations (structural, acoustic, or fully coupled FSI)
  • extract eigenfrequencies and mode shapes of the mechanical structure
  • simulate nonlinear behaviour
  • post-process results directly as NumPy arrays and plot them

The finite element formulations are entirely custom — this project does not depend on any external FEM library. Numerical computations rely exclusively on NumPy, SciPy, and Numba, while meshing is handled by Gmsh.

This project was developed by Romain Degraeve as part of the IMDEA Master's programme in Acoustics (International Master Degree in Acoustics).

Installation

The easiest way to install LoudPy is via pip:

pip install loudpy

For development installation, see the Developer Setup section below.

Examples

The LoudPy_exemples/ folder contains ready-to-run scripts:

Example Description
Frequency_study/FSI Coupled structural–acoustic frequency sweep
Frequency_study/Meca Mechanical-only frequency sweep
Eigen_study Complex eigenfrequency analysis
Time_study/Single_tone Nonlinear time-domain simulation, single tone
Time_study/Multitone Nonlinear time-domain simulation, multi-tone

Publication

LoudPy will be presented at Acousticum 2026 — paper link (ref. 226).

Contributing

If you want to contribute to this open-source project, feel free to reach out:


Technical Details

Workflow

LoudPy handles 2D axisymmetric geometries. The full pipeline is:

  1. Import — a STEP file is loaded and converted to BREP format by LoudPy
  2. Physical entity assignment — the Gmsh standalone app is used to assign named physical groups: closed curve loops define subdomains, individual curves define boundaries. This produces two paired files: a .brep (geometry) and a .geo (named entities)
  3. Meshing — LoudPy loads both files, links named entities to materials and boundary conditions, and generates the mesh via the Gmsh Python API (bundled — no separate install needed)
  4. Solve — the chosen study assembles and solves the FEM system
  5. Export — results are saved to HDF5 (.h5) files; fields and coordinates are stored as NumPy arrays and reloaded with the built-in reader classes

Solvers

Study Class Description
Frequency-domain FSI FreqStudy Coupled structural–acoustic harmonic solver
Frequency-domain meca FreqStudy Mechanical-only harmonic solver
Complex eigenvalue EigenStudy Complex eigenfrequency analysis (mechanical domain)
Nonlinear time-domain TimeStudy Geometrically nonlinear transient solver

Physics

  • Structural domain — 2D axisymmetric linear elasticity, T6 elements
  • Acoustic domain — pressure-based formulation, T6 elements
  • Fluid-structure couplingInterfaceAcouMeca coupling assembled automatically
  • Damping — Rayleigh (α, β) and hysteretic (η), both supporting non-proportional formulations
  • Radiation — Perfectly Matched Layer (PML) for free-field acoustic radiation

Material Library

Built-in materials (materials.json): Polypropylene, Paper, Copper, Rubber, Kapton, PhenolicCloth, Air, SolidGlue. Custom materials can be added to the JSON file or defined directly in the study script.

Post-processing

  • FreqReader / EigenReader / TimeReader — context-managed HDF5 readers
  • extract_subdomain(snap, name, field) — field values restricted to a named subdomain
  • extract_interface(snap, name, field) — field values along a coupling interface
  • Built-in plotting: SPL sweeps, field maps, deformed interface, mechanical sweeps

Developer Setup

LoudPy uses PDM for package management.

Install PDM via pipx (recommended — keeps PDM isolated):

pipx install pdm

Or via uv:

uv pip install pdm

Verify:

pdm --version

Install LoudPy in editable mode:

pdm install -e .

LoudPy is developed under Python 3.13. To install it with uv:

uv python install 3.13

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loudpy-0.0.7.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loudpy-0.0.7-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file loudpy-0.0.7.tar.gz.

File metadata

  • Download URL: loudpy-0.0.7.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.27.0 CPython/3.13.9 Darwin/25.5.0

File hashes

Hashes for loudpy-0.0.7.tar.gz
Algorithm Hash digest
SHA256 fa85352ef4508aeaf8320fffe3ef3cf1ca35a0054a9a3beaec73e5541c57aceb
MD5 ca1696214b6880b34fa0c45fe2a47157
BLAKE2b-256 401dd372588e1e5b9c79f8806d402fa4c8d06f643edb5c7ca392cac62af84bb2

See more details on using hashes here.

File details

Details for the file loudpy-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: loudpy-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.27.0 CPython/3.13.9 Darwin/25.5.0

File hashes

Hashes for loudpy-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 af6197c140a216679d2865366a93ad5dbed1949f82afec697980987d2f4ae106
MD5 01208c133ac692888f2a7b7c2766fc6b
BLAKE2b-256 75060b38c681a4eb653fae603f9083a94666c017415f9609cbefcd94bb8e612b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page