Source code for viiapackage.supports.pile_foundation.pile_properties.calculate_coupled_system_properties

### ===================================================================================================================
###   FUNCTION viia_calculate_coupled_system_properties
### ===================================================================================================================
# Copyright ©VIIA 2024

### ===================================================================================================================
###   1. Import modules
### ===================================================================================================================

# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Tuple, Optional
from pathlib import Path
import math

# References for functions and classes in the rhdhv_fem package
from rhdhv_fem.fem_math import fem_smaller

# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
    from viiapackage.viiaStatus import ViiaProject
from viiapackage.supports.pile_foundation.pile_properties.get_building_fundamental_frequency import \
    viia_get_building_fundamental_frequency


### ===================================================================================================================
###   2. Function to calculate coupled system properties
### ===================================================================================================================

[docs]def viia_calculate_coupled_system_properties( project: ViiaProject, data_dict: dict, yield_stiffness: float, folder: Optional[Path] = None) \ -> Tuple[float, float]: """ Function to calculate coupled system frequency and stiffness. Input: - project (obj): VIIA project object containing collections of fem objects and project variables. - data_dict (dict): Dictionary contains geo inputs for the calculation. - yield_stiffness (float): Yield stiffness for the pile, in [N/m]. - folder (path): Optional input to specify the input folder. By default the default location for the file is used, which should be the location for the VIIA workflow. Input used for component testing. Output: - Returns tuple with two floats: The system frequency, in [Hz], and system stiffness, in [N/m]. """ # Calculate the fundamental frequency of the building building_fundamental_frequency = viia_get_building_fundamental_frequency(project=project, folder=folder) # Calculate coupled system frequency equivalent_stiffness_fixedbase = (2 * math.pi * building_fundamental_frequency) ** 2 * data_dict[ 'pile_total_load'] * 0.7 / project.gravitational_acceleration system_frequency = 1 / ((1 / building_fundamental_frequency) * math.sqrt( 1 + equivalent_stiffness_fixedbase / yield_stiffness)) system_stiffness = (2 * math.pi * system_frequency) ** 2 * ( data_dict['pile_total_load'] / project.gravitational_acceleration) # Check the value of coupled stiffness if fem_smaller(equivalent_stiffness_fixedbase, 5 * system_stiffness): project.write_log( f"WARNING: Stiffness of superstructure should be much higher than the coupled system. Calculated " f"superstructure stiffness is {equivalent_stiffness_fixedbase} N/m and calculated coupled system " f"stiffness is {system_stiffness}. Please check your inputs.") return system_frequency, system_stiffness
### =================================================================================================================== ### 3. End of script ### ===================================================================================================================