### ===================================================================================================================
### FUNCTION viia_calculate_equivalent_damping
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
import math
### ===================================================================================================================
### 2. Function to calculate equivalent damping
### ===================================================================================================================
[docs]def viia_calculate_equivalent_damping(data_dict: dict, frequency: float) -> float:
"""
Function to calculate equivalent damping for calculating pile horizontal spring damping.
Input:
- data_dict (dict): Dictionary contains geo inputs for the calculation.
- frequency (float): Frequency used for the calculation.
Output:
- Returns damping as a float.
"""
soil_g = data_dict['avg_soil_density'] * data_dict['avg_soil_velocity'] ** 2
soil_eks = soil_g * (2 * (1 + data_dict['soil_poisson_ratio']))
pile_ep = (data_dict['max_elastic_modulus_top'] + data_dict['min_elastic_modulus_top']) / 2
delta_x = 2 * ((pile_ep / soil_eks) ** (-3 / 40))
if data_dict['pile_cross_section_shape'] == 'Circular':
equivalent_diameter = data_dict['pile_cross_section_dimension']
else:
equivalent_diameter = math.sqrt(data_dict['pile_cross_section_dimension'] ** 2 / math.pi) * 2
a_0 = 2 * math.pi * frequency * equivalent_diameter / data_dict[
'avg_soil_velocity']
alpha_x = 1 - (3 * math.pi / (32 * delta_x)) * (
(data_dict['pile_density'] / data_dict['avg_soil_density']) / (1 + data_dict['soil_poisson_ratio'])
* a_0 ** 2)
soil_radiation_damping = (3 / (2 * alpha_x * delta_x * (1 + data_dict['soil_poisson_ratio']))) * (a_0 ** (3 / 4))
damping = 1 * data_dict['pile_damping_ratio'] / 4 + 3 * data_dict[
'soil_damping_ratio'] / 4 + 3 * soil_radiation_damping / 4
return damping
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================