Skip to content

Commit bd0afba

Browse files
authored
Merge pull request #50 from audunarn/dev
Dev
2 parents c2ee059 + 856a519 commit bd0afba

File tree

7 files changed

+217
-96
lines changed

7 files changed

+217
-96
lines changed
208 KB
Binary file not shown.

ANYstructure/calc_structure.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ def __init__(self, main_dict, *args, **kwargs):
3131
self.km2 = main_dict['stf_km2'][0]
3232
self.km3 = main_dict['stf_km3'][0]
3333
self.stiffener_type=main_dict['stf_type'][0]
34+
self.structure_types = main_dict['structure_types'][0]
35+
self.dynamic_variable_orientation = None
36+
if self.structure_type in self.structure_types['vertical']:
37+
self.dynamic_variable_orientation = 'z - vertical'
38+
elif self.structure_type in self.structure_types['horizontal']:
39+
self.dynamic_variable_orientation = 'x - horizontal'
3440

3541
self.sigma_y = self.sigma_y2 + (self.sigma_y1-self.sigma_y2)\
3642
*(min(0.25*self.span,0.5*self.spacing)/self.span)
3743

44+
self._zstar_optimization = main_dict['zstar_optimization'][0]
3845
try:
3946
self.girder_lg=main_dict['girder_lg'][0]
4047
except KeyError:
@@ -59,6 +66,7 @@ def __str__(self):
5966
'\n Stiffener flange thickness: ' + str(self.flange_th*1000)+' mm'+
6067
'\n Material yield: ' + str(self.mat_yield/1e6)+' MPa'+
6168
'\n Structure type/stiffener type: ' + str(self.structure_type)+'/'+(self.stiffener_type)+
69+
'\n Dynamic load varible_ ' + str(self.dynamic_variable_orientation)+
6270
'\n Plate fixation paramter,kpp: ' + str(self.plate_kpp) + ' ' +
6371
'\n Stf. fixation paramter,kps: ' + str(self.stf_kps) + ' ' +
6472
'\n Global stress, sig_y1/sig_y2: ' + str(round(self.sigma_y1,1))+'/'+str(round(self.sigma_y2,1))+ ' MPa' +
@@ -67,6 +75,12 @@ def __str__(self):
6775
'\n km1,km2,km3: ' + str(self.km1)+'/'+str(self.km2)+'/'+str(self.km3)+
6876
'\n Pressure side (p-plate/s-stf): ' + str(self.pressure_side) + ' ')
6977

78+
def get_structure_types(self):
79+
return self.structure_types
80+
81+
def get_z_opt(self):
82+
return self._zstar_optimization
83+
7084
def get_one_line_string(self):
7185
''' Returning a one line string. '''
7286
return 'pl_'+str(round(self.spacing*1000, 1))+'x'+str(round(self.plate_th*1000,1))+' stf_'+self.stiffener_type+\
@@ -355,6 +369,7 @@ def set_main_properties(self, main_dict):
355369
self.pressure_side = main_dict['press_side'][0]
356370
except KeyError:
357371
self.pressure_side = 'p'
372+
self._zstar_optimization = main_dict['zstar_optimization'][0]
358373

359374
def set_stresses(self,sigy1,sigy2,sigx,tauxy):
360375
'''
@@ -918,15 +933,18 @@ def get_some_data(lT):
918933
#print('CENTROID ', 'zp', 'zt', self.get_cross_section_centroid_with_effective_plate(se)*1000,zp,zt)
919934

920935
eq7_19 = sigySd/(ksp*sigyRd) #checked ok
921-
936+
if self._zstar_optimization:
937+
zstar_range = np.arange(-zt/2,zp,0.002)
938+
else:
939+
zstar_range = [0]
922940
# Lateral pressure on plate side:
923941
if checked_side == 'p':
924942
# print('eq7_50 = ',Nsd ,'/', NksRd,'+' ,M1Sd,'-' , Nsd ,'*', zstar, '/' ,Ms1Rd,'*',1,'-', Nsd ,'/', Ne,'+', u)
925943
# print('eq7_51 = ',Nsd,' / ',NkpRd,' - 2 * ',Nsd, '/' ,Nrd,' + ',M1Sd,' - ,',Nsd,' * ',zstar,' / ',MpRd,' * ','1 - ',Nsd,' / ',Ne,' + ',u)
926944
#print('eq7_52 = ',Nsd,'/', NksRd,'-', 2, '*',Nsd,'/', Nrd,'+',M2Sd,'-', Nsd,'*', zstar,'/',MstRd,'*',1, '-',Nsd,'/', Ne,'+', u)
927945
max_lfs = []
928946
ufs = []
929-
for zstar in np.arange(-zt/2,zp,0.002):
947+
for zstar in zstar_range:
930948
eq7_50 = (Nsd / NksRd) + (M1Sd - Nsd * zstar) / (Ms1Rd * (1 - Nsd / Ne)) + u
931949
eq7_51 = (Nsd / NkpRd) - 2 * (Nsd / Nrd) + ((M1Sd - Nsd * zstar) / (MpRd * (1 - (Nsd / Ne)))) + u
932950
eq7_52 = (Nsd / NksRd) - 2 * (Nsd / Nrd) + ((M2Sd + Nsd * zstar) / (MstRd * (1 - (Nsd / Ne)))) + u
@@ -941,7 +959,7 @@ def get_some_data(lT):
941959
else:
942960
max_lfs = []
943961
ufs = []
944-
for zstar in np.arange(-zt / 2, zp, 0.002):
962+
for zstar in zstar_range:
945963
eq7_54 = (Nsd / NksRd) - 2 * (Nsd / Nrd) + ((M1Sd + Nsd * zstar) / (MstRd * (1 - (Nsd / Ne)))) + u
946964
eq7_55 = (Nsd / NkpRd) + ((M1Sd + Nsd * zstar) / (MpRd * (1 - (Nsd / Ne)))) + u
947965
eq7_56 = (Nsd / NksRd) + ((M2Sd - Nsd * zstar) / (Ms2Rd * (1 - (Nsd / Ne)))) + u

ANYstructure/example_data.py

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,51 @@
66
import ANYstructure.helper as hlp
77
import random
88

9+
structure_types = {'vertical': ['BBS', 'SIDE_SHELL', 'SSS'],
10+
'horizontal': ['BOTTOM', 'BBT', 'HOPPER', 'MD'],
11+
'non-wt': ['FRAME', 'GENERAL_INTERNAL_NONWT'],
12+
'internals': ['INNER_SIDE', 'FRAME_WT', 'GENERAL_INTERNAL_WT',
13+
'INTERNAL_ZERO_STRESS_WT', 'INTERNAL_LOW_STRESS_WT']}
14+
915
obj_dict = {'mat_yield': [355e6, 'Pa'], 'span': [4, 'm'], 'spacing': [0.75, 'm'],
1016
'plate_thk': [0.015, 'm'],
1117
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.018, 'm'], 'stf_flange_width': [0.15, 'm'],
1218
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['BOTTOM', ''], 'plate_kpp': [1, ''],
1319
'stf_kps': [1, ''], 'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''],
1420
'sigma_y1': [80, 'MPa'], 'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'],
15-
'stf_type': ['T', '']}
21+
'stf_type': ['T', ''], 'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] }
1622

1723
obj_dict_heavy = {'mat_yield': [355e6, 'Pa'], 'span': [4, 'm'], 'spacing': [0.75, 'm'],
1824
'plate_thk': [0.015, 'm'],
1925
'stf_web_height': [0.5, 'm'], 'stf_web_thk': [0.025, 'm'], 'stf_flange_width': [0.2, 'm'],
2026
'stf_flange_thk': [0.03, 'm'], 'structure_type': ['BOTTOM', ''], 'plate_kpp': [1, ''],
2127
'stf_kps': [1, ''], 'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''],
2228
'sigma_y1': [80, 'MPa'], 'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'],
23-
'stf_type': ['T', '']}
29+
'stf_type': ['T', ''], 'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] }
2430

2531
obj_dict2 = {'mat_yield': [355e6, 'Pa'], 'span': [4, 'm'], 'spacing': [0.7, 'm'],
2632
'plate_thk': [0.018, 'm'],
2733
'stf_web_height': [0.36, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
2834
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['BOTTOM', ''], 'plate_kpp': [1, ''],
2935
'stf_kps': [1, ''], 'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''],
3036
'sigma_y1': [100, 'MPa'], 'sigma_y2': [100, 'MPa'], 'sigma_x': [50, 'MPa'], 'tau_xy': [5, 'MPa'],
31-
'stf_type': ['T', '']}
37+
'stf_type': ['T', ''], 'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] }
3238

3339
obj_dict_L = {'mat_yield': [355e6, 'Pa'], 'span': [2, 'm'], 'spacing': [0.6, 'm'],
3440
'plate_thk': [0.010, 'm'],
3541
'stf_web_height': [0.188, 'm'], 'stf_web_thk': [0.009, 'm'], 'stf_flange_width': [0.09, 'm'],
3642
'stf_flange_thk': [0.012, 'm'], 'structure_type': ['BOTTOM', ''], 'plate_kpp': [0.5, ''],
3743
'stf_kps': [1, ''], 'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''],
3844
'sigma_y1': [30, 'MPa'], 'sigma_y2': [5, 'MPa'], 'sigma_x': [15, 'MPa'], 'tau_xy': [20, 'MPa'],
39-
'stf_type': ['L', '']}
45+
'stf_type': ['L', ''], 'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] }
4046

4147
obj_dict_fr = {'mat_yield': [355e6, 'Pa'], 'span': [3.5, 'm'], 'spacing': [0.7, 'm'],
4248
'plate_thk': [0.015, 'm'],
4349
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
4450
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['FRAME', ''], 'plate_kpp': [1, ''],
4551
'stf_kps': [1, ''], 'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''],
4652
'sigma_y1': [80, 'MPa'], 'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'],
47-
'stf_type': ['T', '']}
53+
'stf_type': ['T', ''], 'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] }
4854

4955
point_dict = {'point5': [12.0, 2.5], 'point8': [0.0, 2.5], 'point3': [8.0, 0.0], 'point2': [4.0, 0.0],
5056
'point6': [8.0, 2.5], 'point7': [4.0, 2.5], 'point9': [0.0, 20.0], 'point4': [12.0, 0.0],
@@ -232,33 +238,38 @@ def get_geo_opt_object():
232238
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
233239
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['BOTTOM', ''], 'plate_kpp': [1, ''], 'stf_kps': [1, ''],
234240
'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''], 'sigma_y1': [80, 'MPa'],
235-
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', '']},
241+
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', ''],
242+
'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] },
236243
{'mat_yield': [355000000.0, 'Pa'], 'span': [4.0, 'm'], 'spacing': [0.7, 'm'], 'plate_thk': [0.015, 'm'],
237244
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
238245
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['BOTTOM', ''], 'plate_kpp': [1, ''],
239246
'stf_kps': [1, ''], 'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''],
240247
'sigma_y1': [80, 'MPa'], 'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'],
241-
'stf_type': ['T', '']},
248+
'stf_type': ['T', ''], 'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] },
242249
{'mat_yield': [355000000.0, 'Pa'], 'span': [4.0, 'm'], 'spacing': [0.7, 'm'], 'plate_thk': [0.015, 'm'],
243250
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
244251
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['BOTTOM', ''], 'plate_kpp': [1, ''], 'stf_kps': [1, ''],
245252
'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''], 'sigma_y1': [80, 'MPa'],
246-
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', '']},
253+
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', ''],
254+
'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] },
247255
{'mat_yield': [355000000.0, 'Pa'], 'span': [4.0, 'm'], 'spacing': [0.7, 'm'], 'plate_thk': [0.015, 'm'],
248256
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
249257
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['GENERAL_INTERNAL_WT', ''], 'plate_kpp': [1, ''], 'stf_kps': [1, ''],
250258
'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''], 'sigma_y1': [80, 'MPa'],
251-
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', '']},
259+
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', ''],
260+
'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] },
252261
{'mat_yield': [355000000.0, 'Pa'], 'span': [4.0, 'm'], 'spacing': [0.7, 'm'], 'plate_thk': [0.015, 'm'],
253262
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
254263
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['GENERAL_INTERNAL_WT', ''], 'plate_kpp': [1, ''], 'stf_kps': [1, ''],
255264
'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''], 'sigma_y1': [80, 'MPa'],
256-
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', '']},
265+
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', ''],
266+
'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] },
257267
{'mat_yield': [355000000.0, 'Pa'], 'span': [4.0, 'm'], 'spacing': [0.7, 'm'], 'plate_thk': [0.015, 'm'],
258268
'stf_web_height': [0.4, 'm'], 'stf_web_thk': [0.012, 'm'], 'stf_flange_width': [0.15, 'm'],
259269
'stf_flange_thk': [0.02, 'm'], 'structure_type': ['GENERAL_INTERNAL_WT', ''], 'plate_kpp': [1, ''], 'stf_kps': [1, ''],
260270
'stf_km1': [12, ''], 'stf_km2': [24, ''], 'stf_km3': [12, ''], 'sigma_y1': [80, 'MPa'],
261-
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', '']})
271+
'sigma_y2': [80, 'MPa'], 'sigma_x': [80, 'MPa'], 'tau_xy': [5, 'MPa'], 'stf_type': ['T', ''],
272+
'structure_types': [structure_types, ''], 'zstar_optimization': [True, ''] })
262273
return [calc_structure.CalcScantlings(dic) for dic in dicts]
263274

264275
def get_geo_opt_fatigue():

0 commit comments

Comments
 (0)