### ===================================================================================================================
### FUNCTION viia_calculate_pile_strength
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
from __future__ import annotations
from typing import TYPE_CHECKING, Tuple
import math
# References for functions and classes in the viiaPackage
if TYPE_CHECKING:
from viiapackage.viiaStatus import ViiaProject
from viiapackage.supports.pile_foundation.pile_properties.calculate_pile_reinforcement import \
viia_calculate_pile_reinforcement
### ===================================================================================================================
### 2. Function to calculate pile strength
### ===================================================================================================================
[docs]def viia_calculate_pile_strength(project: ViiaProject, data_dict: dict) -> Tuple[float, float]:
"""
Function to calculate pile vertical spring nonlinear properties.
Input:
- project (obj): VIIA project object containing collections of fem objects and project variables.
- data_dict (dict): Dictionary contains geo inputs for the calculation.
Output:
- Returns tuple of two floats: Tensile capacity and compressive capacity.
"""
# Calculate applied tensile capacity
pile_concrete = project.create_material(name=data_dict['concrete_strength_grade'], code='EC', capacity=True)
if data_dict['pile_cross_section_shape'] == 'Circular':
concrete_surface = math.pi * (data_dict['pile_cross_section_dimension'] / 2) ** 2 / 10 ** 6
else:
concrete_surface = data_dict['pile_cross_section_dimension'] ** 2
concrete_tensile_capacity = pile_concrete.capacity.f_ctm * concrete_surface
pile_concrete.remove_material()
pile_reinforcement = viia_calculate_pile_reinforcement(data=data_dict)
rebar_tensile_capacity = \
pile_reinforcement['yield_stress'] * pile_reinforcement['rebar_area'] * pile_reinforcement['num_of_rebar']
gov_tensile_capacity = max(concrete_tensile_capacity, rebar_tensile_capacity)
# get tensile capacity
tensile_capacity = min(gov_tensile_capacity, data_dict['tensile_capacity_geo'])
# get compressive capacity
compressive_capacity = data_dict['compressive_capacity_geo']
if compressive_capacity > 0:
compressive_capacity = -compressive_capacity
if compressive_capacity > -100:
raise ValueError("ERROR: Incorrect input for compressive-capacity by geotechnical advisor in MYVIIA.")
return tensile_capacity, compressive_capacity
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================