summaryrefslogtreecommitdiff
path: root/Connections/Shear/Finplate/finPlateCalc.py
blob: 7a8acc9e712ca5f6ee0c9ec3de8c3712c3f8445d (plain)
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
'''
Created on 07-Aug-2014

@author: subhrajit
'''
    
import math
from model import *
from PyQt4.Qt import QString
import logging
flag  = 1
logger = None

def module_setup():
    
    global logger
    logger = logging.getLogger("osdag.finPlateCalc")

module_setup()

def finConn(uiObj):
    global flag
    global logger
    '''(Dictionary) --> Dictionary
    '''
    
    beam_sec = uiObj['Member']['beamSection']
    column_sec = uiObj['Member']['columSection']
    connectivity = uiObj['Member']['connectivity']
    f_u = uiObj['Member']['fu(MPa)']
    f_y = uiObj['Member']['fy(MPa)']
    
    F = uiObj['Load']['shearForce(kN)']
    	
    bolt_dia = uiObj['Bolt']['diameter(mm)']
    bolt_type  = uiObj["Bolt"]["type"]
    bolt_grade = uiObj['Bolt']['grade']
    
    plate_thk = uiObj['Plate']['thickness(mm)']
    plate_width = uiObj['Plate']['width(mm)']
    plate_len = uiObj['Plate']['height(mm)']
    
    weld_thk = uiObj["Weld"]['size(mm)']
    FOS_u = 1.25
    FOS_n = 1.1
    k_b = 0.5
    dictbeamdata  = get_beamdata(beam_sec)
    print dictbeamdata
    t_wb = float(dictbeamdata[QString("tw")])
    d_web_b = float(dictbeamdata[QString("D")])
    mu_f = 0.55
    
    #------- tw of beamt_wb = 8.9      # Thickness of web of the connected member ISMB 400
    #-----D of beam d_web_b = 380   #column Clear depth of web of the connected member ISMB 400
    no_row_b = 3
    no_col_b = 1
#------------------------------------------------------------------------------ 
    #---------------------------------------------------------- # Fin plate data
    #------------------------------------------------------------ plate_thk = 10
    #--------------------------------------------------------- plate_width = 100
    #----------------------------------------------------------- plate_len = 300
#------------------------------------------------------------------------------ 
    #------------------------------------------------------------------- F = 140
    # your calculations
    '''
    Design of bolts
    '''
    logger.info("Starting Design Calculations ")
    # Shearing capacity of bolt
    V_dsb = (0.78*math.pi*bolt_dia**2/4 * math.floor(float(bolt_grade))*100)/(math.sqrt(3)*1000*FOS_u) 
    V_dsb = round(V_dsb,3)
    
    
    # Bearing capacity of bolt
    V_dpb = 2.5*k_b*bolt_dia*t_wb*f_u/(FOS_u*1000)
    V_dpb = round(V_dpb,3)
    if V_dsb > V_dpb:
       V_db = V_dpb
    else:
       V_db = V_dsb
      
    #number of bolts
    no_b = math.ceil(F/V_db)
    if no_b <= 2:
        no_b = 3 
           
    # Hole diameter
    if bolt_dia == 12 or bolt_dia == 14:
        dia_h = bolt_dia + 1
    elif bolt_dia == 16 or bolt_dia == 18 or bolt_dia == 20 or bolt_dia == 22 or bolt_dia == 24:
        dia_h = bolt_dia + 2
    else:
        dia_h = bolt_dia + 3    
    
    # End and edge distance
    d_edge = 2 * dia_h
    d_end = 2 * dia_h
    if d_edge < 50 or d_end < 50:
        d_edge = 50
        d_end = 50
    else:
        d_edge = math.ceil(d_edge)
        d_end = math.ceil(d_end)
    
    # Web side plate length and width input
    if plate_len == 0:
        plate_len = d_web_b - 60
    elif plate_len > d_web_b - 60:
        logger.error("The length of the plate is more than the available depth of %2.2f mm " % (plate_len))
        print('Re-enter Length')
    plate_width_min = 2*d_end
    if plate_width == 0:
        plate_width_min = 2*d_end
    if plate_width < plate_width_min:
        logger.error(" Plate width is less than the minimum width required of %2.2f mm " % (plate_width_min))
        #print('Re-enter Width')
    #.......................................................................
        
    plate_len_b = plate_len - 2*d_edge # Length available for bolt group
    pitch_min = 1.5*bolt_dia
    pitch = plate_len_b/(no_b-1)
    pitch = round(pitch,3)
    if no_col_b == 1:
       gauge = 0
    else:
       gauge = 50 
    
    # Deciding on arrangement of bolts    
    no_b_oneline = (plate_len_b//pitch_min) + 1
    
    
        
    if pitch < pitch_min:
        logger.warning("Pitch distance is less than the minimum required")
        #print('Pitch distance is insufficient') 
    
   
        
    
    #.......................................................................
    '''
    Web side plate design
    '''
    
    #if plate_len > d_web_b:
        #print('Reselect the length of plate less than depth of the connected web')
    
    thk_min = round((5*F*1000)/(f_y*plate_len),3)
    
    if thk_min > plate_thk:
        logger.error("The selected thickness of finplate is less than the minimun required")
        flag = 0
        #print('Thickness of fin plate is insufficient')
        
    #d_clear = 20
    x = int(no_b//2)
    M_ext = 0
    for i in range(1,x+1):
        if no_b%2 == 1: 
            M_ext += 2*(i*(pitch**2)/pitch)*V_dsb
        elif no_b%2 == 0:
            M_ext = i*((pitch/2)**2)/(pitch/2)*V_dsb    
    M_ext = round(M_ext/1000,3)
    #print(M_ext) 
        
    M_cap = 1.2*(f_y/FOS_n)*(plate_thk*plate_len**2)/(6*1000)
    M_cap = round(M_cap/(1000),3)
    #print(M_cap) 
    
    if M_cap < M_ext:
        
        logger.error("The flexural moment capacity of the finplate is less than the external moment")
        flag = 0
        #print('The plate design is OK') 
    #flag = False
    
    '''
    Weld Design
    '''
    # Resultant shear on weld
    l_eff_w = plate_len - 2*weld_thk
    #print(l_eff_w)
    H_sh = (M_ext*6000)/(2*(l_eff_w**2))
    #print(H_sh)
    V_sh = F/float(2*l_eff_w) 
    #print(V_sh)
    R_sh = math.sqrt(H_sh**2 + V_sh**2)
    R_sh = round(R_sh,3)
    #print(R_sh)
    
    t_w_ductility = 0.6 * plate_thk / 0.7
    #print(t_w_ductility)
    
    if weld_thk < t_w_ductility:
        thk_weld = int(t_w_ductility)
    else:
        thk_weld = weld_thk
        
    #print(weld_thk)
    
    # Weld strength
    f_wd = f_u/float(math.sqrt(3)*FOS_u)    
    #print(f_wd)
    R_nw = f_wd*0.7*weld_thk/1000
    R_nw = round(R_nw,3)
    # End of calculation
    
    outputObj = {}
    outputObj['Bolt'] ={}
    outputObj['Bolt']['shearcapacity'] = V_dsb
    outputObj['Bolt']['bearingcapacity'] = V_dpb
    outputObj['Bolt']['boltcapacity'] = V_db
    outputObj['Bolt']['numofbolts'] = no_b
    outputObj['Bolt']['boltgrpcapacity'] = 0.0
    outputObj['Bolt']['numofrow'] = no_row_b
    outputObj['Bolt']['numofcol'] = no_col_b
    outputObj['Bolt']['pitch'] = pitch
   
    outputObj['Bolt']['enddist'] = d_end
    
    outputObj['Bolt']['edge'] = d_edge
    outputObj['Bolt']['gauge'] = gauge
    
    outputObj['Weld'] = {}
    outputObj['Weld']['thickness'] = thk_weld
    outputObj['Weld']['resultantshear'] = R_sh
    outputObj['Weld']['weldstrength'] = R_nw
    
    outputObj['Plate'] = {}
    outputObj['Plate']['height'] = 0
    outputObj['Plate']['width'] = 0
    outputObj['Plate']['externalmoment'] = M_ext
    outputObj['Plate']['momentcapacity'] = M_cap

    if flag != 0:
        logger.info("Design is safe")
    else:
        logger.error("Design is not safe")
    return outputObj