license:mit region:us
---
license: mit
---

The Helmholtz pulsating sphere datasets provides numerical solutions of the time-harmonic Helmholtz equation. The dataset is generated using the DOLFINx framework.

![image/png](https://cdn-uploads.huggingface.co/production/uploads/637ccd80b8e573d75bea1328/gNiLtv6lANzBR2uSwxGc-.png)

## Dataset Details
- *Domain Description*: The domain consists of a 2D domain with a pulsating sphere placed at the center. The pulsating sphere is encompassed by a bigger square.
- *Physics Constants*: The speed of sound is $c=343.20\, ms^{-1}$, and the fluid density is $\rho=1.2043\, kgm^{-3}.
- *Frequency*: The frequency is sampled uniformly from the interval $[400Hz,\, 500Hz]$.
- *Velocity Boundary Condition*: The surface S of the sphere has a boundary velocity condition with $v_0=1e-3mms^{-1}$.
- *Normalized Admittance Boundary Condition*: Both boundaries $\Gamma_1$ and $\Gamma_2$ have a normalized admittance boundary condition. The values for each boundary is sampled uniformly and individually from the interval $[0,\, 1]\times [0i,\, 1i]$.
- *Samples*: The train dataset contains a total of 4096 samples and the test dataset 512 samples.
- *Mesh*: Gmsh is used to create the mesh and parameters were chosen to ensure at least 15 elements per wavelength for the highest frequency. The mesh is created once and used for every sample.

## Generation Method
To define, assemble, and solve the problem, we use the DOLFINx FEM framework. 
DOLFINx serves as the computational environment of FEniCSx, representing the next generation of FEniCS. 
FEniCSx implements a substantial user interface that allows for defining the PDE and its boundary conditions in the Unified Form Language (UFL) format, assembling the problem, specifying a solver and its options, solve and writing the solution to files. 
It benefits from a large community and stands as one of the most popular open-source alternatives to commercial software like COMSOL.
The solution process involves multiple steps:
1. Mesh Loading: The mesh is created using the Gmsh API and is then imported into
DOLFINx, along with the previously defined tags for cells and boundaries.
2. Function Space Definition: The function space on which the trail and test functions are defined is a Lagrange space of degree 2.
Additionally, a second Lagrange function space of degree 1 is defined, facilitating saving the solution to simpler file formats, as higher order elements are not supported by all output schemes.
4. Defining the Linear Problem: The linear problem is defined using the weak fromulation of the Helmholtz equation in ufl.
5. Solving the System: A “preonly” Krylov method with a Cholesky preconditioner, and the MUltifrontal Massively Parallel sparse direct Solver (MUMPS) algorithm, a parallel sparse direct solver, is employed ensuring efficient and precise solutions.
6. Output Saving: Solutions are saved to the hierarchical ADIOS2 native binary-pack (bp version 4) format.
Detailed implementations can be found on GitHub. Refer to the GitHub repository https://github.com/JakobEliasWagner/Helmholtz-Pulsating-Sphere.

## Usage
The dataset is saved in the hierarchical ADIOS2 native binary-pack (bp version 4) format.
The solution p is a complex valued function saved in p_real and p_imag.
As the domain is symmectric (indicated by dash-dotted lines) only one quarter of the domain is simulated and saved to file. 
The saved data is the upper right (first) quadrant.


## References
[DOLFINx] Igor A. Baratta, Joseph P. Dean, Jørgen S. Dokken, Michal Habera, Jack S. Hale, Chris N. Richardson, Marie E. Rognes, Matthew W. Scroggs, Nathan Sime, and Garth N. Wells. DOLFINx: the next generation FEniCS problem solving environment.

[Gmsh]  Christophe Geuzaine and Jean-Fran¸cois Remacle. Gmsh: A 3-d finite element mesh generator with built-in pre-and post-processing facilities. 79(11):1309–1331. Publisher: Wiley Online Library.

[Acoustics] Steffen Marburg and Bodo Nolte. Computational acoustics of noise propagation in fluids: finite and boundary element methods, volume 578. Springer.
