-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBeamAnalysisAndDesign_rev2.py
192 lines (155 loc) · 6.98 KB
/
BeamAnalysisAndDesign_rev2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from RCBeamMVDesign import rc_beam_M_V_design
from RCBeamTDesign import rc_beam_torsion_design
from BeamForces_rev7 import get_beam_forces
from ImportExcelTables import import_excel_tables
# etabs table to be exported: Model > Assignments > Frame Assignments > Frame Assignments - Summary
# input excel filename below
frame_assignments_excel = '211214 Building 1 REV42 - Frame Assignments.xlsx'
# etabs table to be exported: Analysis > Results > Frame Results > Beam Forces
# input excel filename below
beam_forces_excel = "211214 Building 1 REV42 - Beam Forces.xlsx"
# etabs table to be exported: Model>Definitions>Frame Sections>Frame Sections
# input excel filename below
frame_sections_excel = "211214 Building 1 REV42 - Frame Sections.xlsx"
# concrete grade of RC beams we want to design
concrete_grade = 'C30/37'
# imports etabs tables that were exported to excel
beam_forces, frame_count_df, frame_assignments = import_excel_tables(frame_assignments_excel,
beam_forces_excel,
frame_sections_excel,
concrete_grade)
# define beam and stations we want to analyse and design
beam_unique_name = 936 # beam unique name we want to retrieve internal forces
# get beam length and array containing stations spaced 0.5
beam_length = frame_assignments[frame_assignments["Unique Name"] == beam_unique_name]["Length"].iloc[0] / 1000 # in meters
all_stations = np.arange(0, beam_length, 0.5)
# get beams forces for all stations and for maximum forces stations.
beam_forces_df_all = get_beam_forces(beam_forces, beam_unique_name, all_stations)
beam_forces_df_all = beam_forces_df_all.sort_values(by="Station")
# Uncomment below to plot M_uls
#beam_forces_df_all.plot(x = 'Station', y = 'M_uls', kind='line')
#plt.gca().invert_yaxis()
#plt.show(block=True)
#plt.interactive(False)
# stations we want to analyse and design (in meters) - ensure station < length of beam
stations = [1.09, 4.2, 8.2, 13.2, 17.2, 20.7, 24.2, 28.2, 32.2]
# get beams forces for stations above and for maximum forces stations
beam_forces_df = get_beam_forces(beam_forces, beam_unique_name, stations)
# create list of top rebar - ensure number of lines is equal to number of stations in beam_forces_df
bottom_rebar = [[[11, 20], ],
[[11, 32], ],
[[11, 20], ],
[[11, 25], ],
[[11, 20], ],
[[11, 20], ],
[[11, 20], ],
[[11, 25], ],
[[11, 20], ],
[[11, 32], ],
[[11, 32], ],
[[11, 20], ],
[[11, 20], ],
]
# create list of bottom rebar - ensure number of lines is equal to number of stations in beam_forces_df
top_rebar = [[[11, 32], ],
[[11, 20], ],
[[11, 32], [11, 32]],
[[11, 20], ],
[[11, 32], [2, 32]],
[[11, 20], ],
[[11, 32], ],
[[11, 20], ],
[[11, 32], ],
[[11, 32], [11, 32]],
[[11, 20], ],
[[11, 32], [11, 32]],
[[11, 32], ],
]
# create list of shear rebar - ensure number of lines is equal to number of stations in beam_forces_df
shear_rebar = [[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
[7, 12, 200],
]
wk = 0.3 # set concrete crack width in mm
fck = 30 # set concrete resistance in MPa
c_nom_top = 35 # set concrete cover in mm, top zone
c_nom_bot = 35 # set concrete cover in mm, bottom zone
c_nom_s = 35 # set concrete cover in mm, sides
# run section design for each station in beam_forces_df
ratios, s_bar_top, s_bar_bottom = rc_beam_M_V_design(beam_forces_df, bottom_rebar, top_rebar, shear_rebar, c_nom_top, c_nom_bot, c_nom_s, wk, fck)
# unzip ratios vector to get Med and Ved ratios
ratios_unzipped = list(zip(*ratios))
# add ratios to beam dataframe
beam_forces_df['M_ratio'] = ratios_unzipped[0]
beam_forces_df['V_ratio'] = ratios_unzipped[1]
# add rebar info - bottom
beam_forces_df['bottom_rebar'] = bottom_rebar
beam_forces_df['s_bar_bottom'] = s_bar_bottom
# add rebar info - top
beam_forces_df['top_rebar'] = top_rebar
beam_forces_df['s_bar_top'] = s_bar_top
# add rebar info - shear
beam_forces_df['shear_rebar'] = shear_rebar
add_areas_torsion = rc_beam_torsion_design(beam_forces_df, bottom_rebar, top_rebar, shear_rebar, c_nom_top, c_nom_bot, fck)
# unzip add_areas_torsion vector to get additional longitudinal rebar and transverse rebar
add_areas_torsion_unzipped = list(zip(*add_areas_torsion))
# add ratios to beam dataframe
beam_forces_df['add_torsion_Asl'] = add_areas_torsion_unzipped[0]
beam_forces_df['add_torsion_Asw'] = add_areas_torsion_unzipped[1]
units_dict = {'Unique Name': '',
'Label': '',
'Story': '',
'h': 'mm',
'b': 'mm',
'Station': 'm',
'M_uls': 'kN.m',
'V': 'kN',
'M_sls': 'kN',
'T': 'kN.m',
'M_ratio': '',
'V_ratio': '',
'bottom_rebar': '[[n, diam],...]',
's_bar_bottom': 'mm',
'top_rebar': '[[n, diam],...]',
's_bar_top': 'mm',
'shear_rebar': '[n, diam, spacing]',
'add_torsion_Asl': 'mm2',
'add_torsion_Asw': 'mm2/m',
}
# build units dataframe
units_df = pd.DataFrame(units_dict, index=[0])
# concatenate units dataframe with beam_forces_df dataframe putting units in first row
beam_forces_df = pd.concat([units_df, beam_forces_df], axis=0)
beam_forces_df.to_excel("BeamDesignData_" + str(beam_forces_df.iloc[1, :]["Label"]) + "_" +
str(beam_forces_df.iloc[1, :]["Unique Name"]) + ".xlsx")
'''
# try function manually
Beam_140 = beam_forces[beam_forces["Unique Name"] == 140]
etabs_station = find_nearest(Beam_140["Station"], 1.5)
Beam_140 = Beam_140[Beam_140["Station"] == etabs_station]
Beam_140 = Beam_140[Beam_140["Load Case/Combo"] == 'ULS-grav'].sort_values('abs(M3)', ascending = False)
Beam_140_M3 = Beam_140.iloc[0,:]['M3']
# extract width and depth from section_name
section_name = "RC Beam 1400x550dp"
numbers = []
temp_num = ""
for c in section_name:
if c.isdigit():
temp_num = temp_num + c
elif temp_num != "":
numbers.append(temp_num)
temp_num = ""
'''