### ===================================================================================================================
### Calculate pile reinforcement
### ===================================================================================================================
# Copyright ©VIIA 2024
### ===================================================================================================================
### 1. Import modules
### ===================================================================================================================
# General imports
import math
from typing import Dict
# References for functions and classes in the viiaPackage
from viiapackage.pile_properties import viia_find_strand_surface, viia_find_prestress_reinforcement_properties, \
viia_find_reinforcement_properties
### ===================================================================================================================
### 2. Function to calculate pile reinforcement
### ===================================================================================================================
[docs]def viia_calculate_pile_reinforcement(data: dict) -> Dict[str, float]:
"""
Function to calculate pile reinforcement properties, based on complete pile data.
Input:
- data_dict (dict): Dictionary contains geo inputs for the calculation.
Output:
- Returns pile reinforcement properties as a dictionary.
"""
pile_reinforcement = {}
if data['rebar_config_top'] == 'None':
yield_stress, _, youngs_modulus = viia_find_prestress_reinforcement_properties(
prestress_reinforcement=data['prestress_tendon_steel_class'])
pile_reinforcement['rebar_area'] = viia_find_strand_surface(
num_of_wires=data['num_of_wires_per_strand'],
strand_diameter=data['strand_diameter'])
pile_reinforcement['rebar_config'] = data['prestress_tendon_config']
pile_reinforcement['num_of_rebar'] = int(data['prestress_tendon_config'][-1])
pile_reinforcement['edge_distance'] = data['prestress_tendon_edge_distance']
pile_reinforcement['youngs_modulus'] = youngs_modulus * 1e6
pile_reinforcement['yield_stress'] = yield_stress * 1e6
else:
yield_stress, _, youngs_modulus = viia_find_reinforcement_properties(
steel_class=data['rebar_steel_class_top'])
pile_reinforcement['rebar_area'] = math.pi * (data['rebar_diameter_top'] / 2) ** 2
pile_reinforcement['rebar_config'] = data['rebar_config_top']
pile_reinforcement['num_of_rebar'] = int(data['rebar_config_top'][-1])
pile_reinforcement['edge_distance'] = data['rebar_edge_distance_top']
pile_reinforcement['youngs_modulus'] = youngs_modulus * 1e6
pile_reinforcement['yield_stress'] = yield_stress * 1e6
return pile_reinforcement
### ===================================================================================================================
### 3. End of script
### ===================================================================================================================