### ===================================================================================================================
### Class for the material properties
### ===================================================================================================================
# Copyright ©2026 Haskoning Nederland B.V.
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
import math
from typing import Optional
from dataclasses import dataclass, field
### ===================================================================================================================
### 2. Material class
### ===================================================================================================================
[docs]
@dataclass
class Material:
"""
Instances of this class represent the material properties for the vibration simulation.
Input:
- name (str): Name of the material. For example 'Limestone'.
- density (float): Value of the density of the material, ρ, in [kg/m3].
- shear_modulus (float): Value of the shear modulus of the material, G, in [GPa].
- poisson_ratio (float): Value of the Poisson’s ratio of the material, ν, in [-].
- quality_factor (float): Quality factor of the material, Q, in [-].
"""
name: str
density: float
shear_modulus: float
poisson_ratio: float
quality_factor: float
# Private attributes to store the provided values
_project: Optional[str] = field(default=None, init=False, repr=False)
@property
def project(self):
return self._project
@project.setter
def project(self, new_project):
self._project = new_project
def __repr__(self) -> str:
return f"Material '{self.name}' (density={self.density}kg/m3)"
@property
def shear_speed(self) -> float:
""" Returns the value of the shear speed of the material, c_s, in [m/s]."""
return math.sqrt(self.shear_modulus * 1E9 / self.density)
@property
def rayleigh_wave_speed(self) -> float:
""" Returns the value of the Rayleigh wave speed of the material, c_R, in [m/s]."""
return self.shear_speed * (0.87 + 1.2 * self.poisson_ratio) / (1 + self.poisson_ratio)
@property
def barkan_material_parameter(self) -> float:
""" Returns the value of the Barkan material property of the material, ρ_B, in [1/m]."""
return 2 / (self.shear_speed * self.quality_factor)
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================