Skip to main content

System modeling, including lumped mass and FEM.

Project description

sdypy-model

A namespace Python package for the SDyPy project.

The package currently contains the following finite elements:

  • beam: Euler-Bernoulli and Timoshenko beam elements.
  • shell: MITC4 shell elements.
  • tet: Quadratic (10 node) tetrahedral elements.

It also provides an exterior acoustics solver:

  • acoustic_external: exterior acoustic radiation/scattering with a collocation boundary element method (BEM), including an optional Burton–Miller formulation to suppress spurious internal resonances.

Note: The package is still under development and may not be fully functional.

Beam elements

import sdypy as sd

beam_obj = sd.model.Beam(...)

M = beam_obj.M
K = beam_obj.K

Shell elements

import sdypy as sd

shell_obj = sd.model.Shell(...)

M = shell_obj.M
K = shell_obj.K

Tetrahedral elements

import sdypy as sd

tet_obj = sd.model.Tetrahedron(...)

M = tet_obj.M
K = tet_obj.K

Acoustic radiation (external BEM)

Solve for the acoustic field radiated by a vibrating surface. The surface is a triangular mesh (e.g. a pyvista.PolyData) with coordinates in metres. Define the boundary condition (either Dirichlet or Neumann). With a Neumann boundary condition you prescribe the normal velocity at each node; the solver returns the velocity potential φ on the boundary, from which the pressure p = jωρφ is recovered anywhere in the exterior field.

import numpy as np
import pyvista as pv
import sdypy as sd

# Vibrating surface (triangle mesh, coordinates in metres)
sphere = pv.Sphere(radius=0.15, theta_resolution=30, phi_resolution=30)
vn = 0.01 * np.ones(sphere.n_points)        # normal velocity [m/s]

prob = sd.model.AcousticExternalProblem(
    mesh=sphere,
    rho=1.225, c0=343.0,                    # air: density [kg/m3], sound speed [m/s]
    boundary_condition=vn,                  # (n_points,) scalar, or (n_points, 3) vector
    boundary_condition_type="Neumann",      # "Neumann" (velocity) | "Dirichlet" (pressure)
    frequency=500.0,                        # [Hz]
    use_burton_miller=False,                # combined (Burton–Miller) formulation, optional
)

phi, q = prob.solve_problem()               # boundary solution: potential + ∂φ/∂n

# Radiated velocity potential at field points of shape (N, 3) [m]
pts = np.array([[0.3, 0.0, 0.0], [0.0, 0.0, 0.5]])
phi_field = prob.evaluate_field(pts)        # velocity potential φ
p = 1j * 2 * np.pi * prob.frequency * prob.rho * phi_field   # pressure p = jωρφ [Pa]

Use set_frequency() / set_boundary_condition() to reuse the assembled model across a frequency sweep without rebuilding the mesh. All quantities are in SI units and the complex time convention is e^{jωt}. A complete, validated example (pulsating sphere vs. the analytical solution) is in examples/acoustic_external_example.py.

Disclaimer

This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.

Use of this software is at your own risk.

This software is distributed under the terms of the MIT License. See the LICENSE file for more details.

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

sdypy_model-0.1.5.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

sdypy_model-0.1.5-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file sdypy_model-0.1.5.tar.gz.

File metadata

  • Download URL: sdypy_model-0.1.5.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for sdypy_model-0.1.5.tar.gz
Algorithm Hash digest
SHA256 991d22d0519b6b69e3603f888f156ee2644185c8a835371c06359a5a6f71cfcd
MD5 3db59447f49fa6ec2b5f2063ab89cf3e
BLAKE2b-256 7e688158dd09c6a2c61d4fb532ae6891b6a9486165e4b2bf156ce180f89733b4

See more details on using hashes here.

File details

Details for the file sdypy_model-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: sdypy_model-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for sdypy_model-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8f00dc07a7a61391abec548d4e88995e5d12a12b5174eab15d91a0775208e0a5
MD5 16d502afaae43bec3d550bdc9e41b69d
BLAKE2b-256 65d90708c9f93fee42ae53a9332e4ce2c578d238755e26eea8a14fb98e5654a0

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