Source code for viiapackage.tools.viia_check_out_of_plane

### ===================================================================================================================
###   Check out-of-plane
### ===================================================================================================================
# Copyright ©VIIA 2025

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

# General imports
import math
import json


### ===================================================================================================================
###   2. Function to check for out-of-plane behaviour walls
### ===================================================================================================================

[docs]def viia_check_out_of_plane( wall_type: float, wall_height: float, total_height: float, wall_thickness: float, wall_weight: float, overburden_load: float, inclination_angle: float, peak_ground_acceleration: float, fundamental_period: float): """ Function to find the seismic out-of plane resistance and seismic demand of masonry walls Input: - wall_type (float): Type of the wall studied, either vertically spanning, i.e. type 1 or cantilever wall, i.e. type 2. - wall_height (float): Height of the wall considered, in [m]. - total_height (float): Total height of the building considered, in [m]. - wall_thickness (float): The thickness of the wall considered, in [m]. - wall_weight (float): Self weight of the masonry wall, in [kg/m3]. - overburden_load (float): The overburden load on the wall, in [kN/m]. - inclination_angle (float): The rotation angle of the wall, in [deg]. - peak_ground_acceleration (float): Maximum ground acceleration at the location of the building, in [m/s2]. - fundamental_period (float): Fundamental period of vibration of the building, in [s]. Output: - Returns the seismic out-of-plane resistance and seismic demand of masonry walls is calculated. """ hw = wall_height ht = total_height tw = wall_thickness w = wall_weight fnt = overburden_load psi = inclination_angle agd = peak_ground_acceleration t1 = fundamental_period tnom = tw / (0.975 - 0.025 * fnt / w) g = 9.81 # ground acceleration in m/s2 # finding eccentricities according to the boundary conditions if wall_type == 1: eb, ep, e0, et, beta = _boundary_one(tw) elif wall_type == 2: eb, ep, beta = boundary_two(tw) # finding the weight distribution, assuming uniform thickness of walls if wall_type == 1: wb, wt, yb, yt = weight_distribution_one(w, hw) elif wall_type == 2: y = weight_distribution_two(hw) # calculating the seismic resistance if wall_type == 1: ar = seismic_resistance_one(wb, wt, yb, yt, hw, fnt, eb, et, e0, ep, psi, w, tnom, g, beta) ar = round(ar, 2) elif wall_type == 2: ar = seismic_resistance_two(w, hw, y, fnt, eb, ep, g, tnom, beta) ar = round(ar, 2) # Calculating the seismic demand sad = determine_s_ad(wall_type, hw, ht, fnt, w, agd, t1) sad = round(sad, 2) results = { 'ratio': 'Fnt/W=' + str(fnt / w), 'wall thickness': str(tw * 1000) + 'mm', 'values': [{'height': hw, 'resistance': ar, 'demand': sad}]} # Saving to a json file with open('results.json', 'w') as file: json.dump(results, file, indent=4)
### =================================================================================================================== ### 3. Helper functions ### =================================================================================================================== def _boundary_one(tw): """ This function finds the eccentricities eb, ep, e0, et, and beta for vertically spanning walls.""" eb = 0 ep = 0 e0 = 0.5 * tw et = 0.5 * tw beta = 4.07 return eb, ep, e0, et, beta
[docs]def boundary_two(tw): """ This function finds the eccentricities eb, ep, and beta for cantilever walls.""" eb = 0.5 * tw ep = 0 beta = 3.1 return eb, ep, beta
[docs]def weight_distribution_one(w, hw): """ This function finds the weight for the lower half of the wall, the weight of the upper half of the wall and the y distances where these weights act for vertically spanning walls Input: - w : masonry wall weight - hw: height of the wall considered Output: - wb: weight of the lower half of the wall - wt: weight of the upper half of the wall - yb: distance y where the weight of the lower wall acts - yt: distance y where the weight of the upper wall acts """ wb = 0.5 * w wt = 0.5 * w yb = 0.25 * hw yt = 0.25 * hw return wb, wt, yb, yt
[docs]def weight_distribution_two(hw): """ This function finds the y distance where the weight acts for cantilever walls.""" y = 0.5 * hw return y
[docs]def seismic_resistance_one(wb, wt, yb, yt, hw, fnt, eb, et, e0, ep, psi, w, tnom, g, beta): """ This function calculates the seismic out-of-plane resistance of vertically spanning masonry walls.""" # virtual work calculation a = wb * yb + wt * (hw - yt) + fnt * hw b = wb * eb + wt * (e0 + eb + et) + fnt * (e0 + eb + et + ep) - psi * (wb * yb + wt * yt) # angle = b / a # maximum deflection delta_i = b * hw / (2 * a) delta_m = 0.6 * delta_i # mass moment of inertia j, of the total kinematic wall system, gets canceled in the main formula for resistance j = (1 / 12) * (w / g) * (tnom ** 2 + (hw / 2) ** 2) + ( wb * (eb ** 2 + yb ** 2) + wt * ((e0 + eb + et) ** 2 + yt ** 2) + fnt * (e0 + eb + et + ep) ** 2) / g # mass participation factor gamma = w * hw ** 2 / (8 * j * g) # period tp = beta * (j / a) ** 0.5 # seismic resistance; vertically spanning wall ar = ((2 * math.pi) / tp) ** 2 * (delta_m / (gamma * g)) return ar
[docs]def seismic_resistance_two(w, hw, y, fnt, eb, ep, g, tnom, beta): """ This function calculates the seismic out-of-plane resistance of cantilever masonry walls.""" # Virtual work a = w * y + fnt * hw b = w * eb + fnt * (eb + ep) # angle = b / a # maximum deflection delta_i = b * hw / a delta_m = 0.3 * delta_i # mass moment of inertia j, of the total kinematic wall system, gets canceled in the main formula for resistance j = (1 / 12) * (w / g) * (tnom ** 2 + hw ** 2) + ( w * (eb ** 2 + y ** 2) + fnt * (hw ** 2 + (eb + ep) ** 2)) / g # mass participation factor gamma = w * hw ** 2 / (2 * j * g) # period tp = beta * (j / a) ** 0.5 # seismic resistence; cantiliver wall ar = ((2 * math.pi) / tp) ** 2 * (delta_m / (gamma * g)) return ar
[docs]def determine_s_ad(wall_type, hw, ht, fnt, w, agd, t1): """ This function calculates the seismic demand Sad (in g) according to the wall type, i.e. type 1 for vertically spanning and type 2 for cantilever walls.""" if wall_type == 1: qa = 2 else: qa = 1 ta = ((0.28 * hw) / (1 + (2 * fnt / w))) ** 0.5 z = 0.5 * hw sad = (agd / qa) * (3 * (1 + z / ht) / (1 + (1 - ta / t1) ** 2) - 0.5) if sad >= agd / qa: return sad else: sad = agd / qa return sad
### =================================================================================================================== ### 4. End of script ### ===================================================================================================================