-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcalc_structure.py
4831 lines (4095 loc) · 208 KB
/
calc_structure.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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from scipy.special import gammaln
from scipy.stats import gamma as gammadist
import numpy as np
from scipy.integrate import simps
import os, time, datetime, json, random, math
from scipy.optimize import minimize
try:
import anystruct.helper as hlp
import anystruct.SN_curve_parameters as snc
except ModuleNotFoundError:
import ANYstructure.anystruct.helper as hlp
import ANYstructure.anystruct.SN_curve_parameters as snc
class Structure():
'''
Setting the properties for the plate and the stiffener. Takes a dictionary as argument.
'''
def __init__(self, main_dict: dict = None, *args, **kwargs):
super(Structure,self).__init__()
if main_dict is None:
self._panel_or_shell = None
self._plate_th = None
self._web_height = None
self._web_th = None
self._flange_width = None
self._flange_th = None
self._mat_yield = None
self._mat_factor = None
self._span = None
self._spacing = None
self._structure_type = None
self._sigma_y1 = None
self._sigma_y2 = None
self._sigma_x1 = None
self._sigma_x2 = None
self._tauxy = None
self._plate_kpp = None
self._stf_kps = None
self._km1 = None
self._km2 = None
self._km3 = None
self._stiffener_type = None
self._structure_types = None
self._dynamic_variable_orientation = None
if self._structure_type is None:
self._dynamic_variable_orientation = None
self._puls_method = None
self._puls_boundary = None
self._puls_stf_end = None
self._puls_sp_or_up = None
self._puls_up_boundary = None
self._zstar_optimization = None
try:
self._girder_lg = None
except KeyError:
self._girder_lg = None
try:
self._pressure_side = None
except KeyError:
self._pressure_side = None
self._panel_or_shell = None
else:
self._main_dict = main_dict
if 'panel or shell' not in main_dict.keys():
self._panel_or_shell = 'panel'
else:
self._panel_or_shell = main_dict['panel or shell'][0]
self._plate_th = main_dict['plate_thk'][0]
self._web_height = main_dict['stf_web_height'][0]
self._web_th = main_dict['stf_web_thk'][0]
self._flange_width = main_dict['stf_flange_width'][0]
self._flange_th = main_dict['stf_flange_thk'][0]
self._mat_yield = main_dict['mat_yield'][0]
self._mat_factor = main_dict['mat_factor'][0]
self._span = main_dict['span'][0]
self._spacing = main_dict['spacing'][0]
self._structure_type = main_dict['structure_type'][0]
self._sigma_y1=main_dict['sigma_y1'][0]
self._sigma_y2=main_dict['sigma_y2'][0]
self._sigma_x1 = main_dict['sigma_x1'][0]
self._sigma_x2 = main_dict['sigma_x2'][0]
self._tauxy=main_dict['tau_xy'][0]
self._plate_kpp = main_dict['plate_kpp'][0]
self._stf_kps = main_dict['stf_kps'][0]
self._km1 = main_dict['stf_km1'][0]
self._km2 = main_dict['stf_km2'][0]
self._km3 = main_dict['stf_km3'][0]
self._stiffener_type=main_dict['stf_type'][0]
self._structure_types = main_dict['structure_types'][0]
self._dynamic_variable_orientation = None
if self._structure_type in self._structure_types['vertical']:
self._dynamic_variable_orientation = 'z - vertical'
elif self._structure_type in self._structure_types['horizontal']:
self._dynamic_variable_orientation = 'x - horizontal'
self._puls_method = main_dict['puls buckling method'][0]
self._puls_boundary = main_dict['puls boundary'][0]
self._puls_stf_end = main_dict['puls stiffener end'][0]
self._puls_sp_or_up = main_dict['puls sp or up'][0]
self._puls_up_boundary = main_dict['puls up boundary'][0]
self._zstar_optimization = main_dict['zstar_optimization'][0]
try:
self._girder_lg=main_dict['girder_lg'][0]
except KeyError:
self._girder_lg = 10
try:
self._pressure_side = main_dict['press_side'][0]
except KeyError:
self._pressure_side = 'both sides'
self._panel_or_shell = main_dict['panel or shell'][0]
# Property decorators are used in buckling of shells. IN mm!
@property # in mm
def hw(self):
assert self._web_height is not None, 'Variable missing: self._web_height'
return self._web_height * 1000
@hw.setter # in mm
def hw(self, val):
self._web_height = val / 1000
@property # in mm
def tw(self):
assert self._web_th is not None, 'Variable missing: self._web_th - web thickness'
return self._web_th * 1000
@tw.setter # in mm
def tw(self, val):
self._web_th = val / 1000
@property # in mm
def b(self):
assert self._flange_width is not None, 'Variable missing: self._flange_width'
return self._flange_width * 1000
@b.setter # in mm
def b(self, val):
self._flange_width = val / 1000
@property # in mm
def tf(self):
assert self._flange_th is not None, 'Variable missing: self._flange_th'
return self._flange_th * 1000
@tf.setter # in mm
def tf(self, val):
self._flange_th = val / 1000
@property # in mm
def spacing(self):
assert self._spacing is not None, 'Variable missing: self._spacing'
return self._spacing* 1000
@spacing.setter # in mm
def spacing(self, val):
self._spacing = val / 1000
@property # in mm
def t(self):
assert self._plate_th is not None, 'Variable missing: self._plate_th'
return self._plate_th* 1000
@t.setter # in mm
def t(self, val):
self._plate_th = val / 1000
@property # in mm
def panel_or_shell(self):
return self._panel_or_shell
@panel_or_shell.setter # in mm
def panel_or_shell(self, val):
self._panel_or_shell = val
@property
def stiffener_type(self):
return self._stiffener_type
@stiffener_type.setter
def stiffener_type(self, val):
self._stiffener_type = val
@property
def E(self):
return self._E
@E.setter
def E(self, val):
self._E = val
@property
def v(self):
return self._v
@v.setter
def v(self, val):
self._v = val
@property
def mat_yield(self):
return self._mat_yield
@mat_yield.setter
def mat_yield(self, val):
self._mat_yield = val
@property
def mat_factor(self):
assert self._mat_factor is not None, 'Missing variable: self._mat_factor'
return self._mat_factor
@mat_factor.setter
def mat_factor(self, val):
self._mat_factor = val
@property
def span(self):
assert self._span is not None, 'Missing variable: self._span: span of stiffener'
return self._span
@span.setter
def span(self, val):
self._span = val
@property
def sigma_x1(self):
assert self._sigma_x1 is not None, 'Missing variable: self._sigma_x1'
return self._sigma_x1
@sigma_x1.setter
def sigma_x1(self, val):
self._sigma_x1 = val
@property
def sigma_x2(self):
assert self._sigma_x2 is not None, 'Missing variable: self._sigma_x2'
return self._sigma_x2
@sigma_x2.setter
def sigma_x2(self, val):
self._sigma_x2 = val
@property
def sigma_y1(self):
assert self._sigma_y1 is not None, 'Missing variable: self._sigma_y1'
return self._sigma_y1
@sigma_y1.setter
def sigma_y1(self, val):
self._sigma_y1 = val
@property
def sigma_y2(self):
assert self._sigma_y2 is not None, 'Missing variable: self._sigma_y2'
return self._sigma_y2
@sigma_y2.setter
def sigma_y2(self, val):
self._sigma_y2 = val
@property
def tau_xy(self):
assert self._tauxy is not None, 'Missing variable: self._tauxy'
return self._tauxy
@tau_xy.setter
def tau_xy(self, val):
self._tauxy = val
@property
def girder_lg(self):
assert self._girder_lg is not None, 'Missing variable: self._girder_lg'
return self._girder_lg
@girder_lg.setter
def girder_lg(self, val):
self._girder_lg = val
def __str__(self):
'''
Returning all properties.
'''
try:
return \
str(
'\n Plate field span: ' + str(round(self._span*1000)) + ' mm' +
'\n Stiffener spacing: ' + str(self._spacing*1000)+' mm'+
'\n Plate thickness: ' + str(self._plate_th*1000)+' mm'+
'\n Stiffener web height: ' + str(self._web_height*1000)+' mm'+
'\n Stiffener web thickness: ' + str(self._web_th*1000)+' mm'+
'\n Stiffener flange width: ' + str(self._flange_width*1000)+' mm'+
'\n Stiffener flange thickness: ' + str(self._flange_th*1000)+' mm'+
'\n Material yield: ' + str(self._mat_yield/1e6)+' MPa'+
'\n Structure/stiffener type: ' + str(self._structure_type)+'/'+(self._stiffener_type)+
'\n Dynamic load varible_ ' + str(self._dynamic_variable_orientation)+
'\n Plate fixation paramter,kpp: ' + str(self._plate_kpp) + ' ' +
'\n Stf. fixation paramter,kps: ' + str(self._stf_kps) + ' ' +
'\n Global stress, sig_y1/sig_y2: ' + str(round(self._sigma_y1,3))+'/'+str(round(self._sigma_y2,3))+ ' MPa' +
'\n Global stress, sig_x1/sig_x2: ' + str(round(self._sigma_x1,3))+'/'+str(round(self._sigma_x2,3))+ ' MPa' +
'\n Global shear, tau_xy: ' + str(round(self._tauxy,3)) + ' MPa' +
'\n km1,km2,km3: ' + str(self._km1)+'/'+str(self._km2)+'/'+str(self._km3)+
'\n Pressure side (p-plate/s-stf): ' + str(self._pressure_side) + ' ')
except TypeError:
return \
str(
'\n Stiffener spacing: ' + str(self._spacing * 1000) + ' mm' +
'\n Plate thickness: ' + str(self._plate_th * 1000) + ' mm' +
'\n Stiffener web height: ' + str(self._web_height * 1000) + ' mm' +
'\n Stiffener web thickness: ' + str(self._web_th * 1000) + ' mm' +
'\n Stiffener flange width: ' + str(self._flange_width * 1000) + ' mm' +
'\n Stiffener flange thickness: ' + str(self._flange_th * 1000) + ' mm' )
def get_beam_string(self, short = False):
''' Returning a string. '''
if type(self._stiffener_type) != str:
print('error')
base_name = self._stiffener_type+ '_' + str(round(self._web_height*1000, 0)) + 'x' + \
str(round(self._web_th*1000, 0))
if self._stiffener_type == 'FB':
ret_str = base_name
elif self._stiffener_type in ['L-bulb', 'bulb', 'hp']:
if not short:
ret_str = 'Bulb'+str(int(self._web_height*1000 + self._flange_th*1000))+'x'+\
str(round(self._web_th*1000, 0))+ '_(' +str(round(self._web_height*1000, 0)) + 'x' + \
str(round(self._web_th*1000, 0))+'_'+ str(round(self._flange_width*1000, 0)) + 'x' + \
str(round(self._flange_th*1000, 0))+')'
else:
ret_str = 'Bulb'+str(int(self._web_height*1000 + self._flange_th*1000))+'x'+\
str(round(self._web_th*1000, 0))
else:
ret_str = base_name + '__' + str(round(self._flange_width*1000, 0)) + 'x' + \
str(round(self._flange_th*1000, 0))
ret_str = ret_str.replace('.', '_')
return ret_str
# base_name = self._stiffener_type+ '_' + str(round(self._web_height*1000, 0)) + 'x' + \
# str(round(self._web_th*1000, 0))
# if self._stiffener_type == 'FB':
# ret_str = base_name
# else:
# ret_str = base_name + '__' + str(round(self._flange_width*1000, 0)) + 'x' + \
# str(round(self._flange_th*1000, 0))
#
# ret_str = ret_str.replace('.', '_')
#
# return ret_str
def get_structure_types(self):
return self._structure_types
def get_z_opt(self):
return self._zstar_optimization
def get_puls_method(self):
return self._puls_method
def get_puls_boundary(self):
return self._puls_boundary
def get_puls_stf_end(self):
return self._puls_stf_end
def get_puls_sp_or_up(self):
return self._puls_sp_or_up
def get_puls_up_boundary(self):
return self._puls_up_boundary
def get_one_line_string(self):
''' Returning a one line string. '''
return 'pl_'+str(round(self._spacing*1000, 1))+'x'+str(round(self._plate_th*1000,1))+' stf_'+self._stiffener_type+\
str(round(self._web_height*1000,1))+'x'+str(round(self._web_th*1000,1))+'+'\
+str(round(self._flange_width*1000,1))+'x'+\
str(round(self._flange_th*1000,1))
def get_report_stresses(self):
'Return the stresses to the report'
return 'sigma_y1: '+str(round(self._sigma_y1,1))+' sigma_y2: '+str(round(self._sigma_y2,1))+ \
' sigma_x1: ' + str(round(self._sigma_x1,1)) +' sigma_x2: ' + str(round(self._sigma_x2,1))+\
' tauxy: '+ str(round(self._tauxy,1))
def get_extended_string(self):
''' Some more information returned. '''
return 'span: '+str(round(self._span,4))+' structure type: '+ self._structure_type + ' stf. type: ' + \
self._stiffener_type + ' pressure side: ' + self._pressure_side
def get_s(self):
'''
Return the spacing
:return:
'''
return self._spacing
def get_pl_thk(self):
'''
Return the plate thickness
:return:
'''
return self._plate_th
def get_web_h(self):
'''
Return the web heigh
:return:
'''
return self._web_height
def get_web_thk(self):
'''
Return the spacing
:return:
'''
return self._web_th
def get_fl_w(self):
'''
Return the flange width
:return:
'''
return self._flange_width
def get_fl_thk(self):
'''
Return the flange thickness
:return:
'''
return self._flange_th
def get_fy(self):
'''
Return material yield
:return:
'''
return self._mat_yield
def get_span(self):
'''
Return the span
:return:
'''
return self._span
def get_kpp(self):
'''
Return var
:return:
'''
return self._plate_kpp
def get_kps(self):
'''
Return var
:return:
'''
return self._stf_kps
def get_km1(self):
'''
Return var
:return:
'''
return self._km1
def get_km2(self):
'''
Return var
:return:
'''
return self._km2
def get_km3(self):
'''
Return var
:return:
'''
return self._km3
def get_side(self):
'''
Return the checked pressure side.
:return:
'''
return self._pressure_side
def get_tuple(self):
''' Return a tuple of the plate stiffener'''
return (self._spacing, self._plate_th, self._web_height, self._web_th, self._flange_width,
self._flange_th, self._span, self._girder_lg, self._stiffener_type)
def get_section_modulus(self, efficient_se = None, dnv_table = False):
'''
Returns the section modulus.
:param efficient_se:
:return:
'''
#Plate. When using DNV table, default values are used for the plate
b1 = self._spacing if efficient_se==None else efficient_se
tf1 = self._plate_th
#Stiffener
tf2 = self._flange_th
b2 = self._flange_width
h = self._flange_th+self._web_height+self._plate_th
tw = self._web_th
hw = self._web_height
# cross section area
Ax = tf1 * b1 + tf2 * b2 + hw * tw
assert Ax != 0, 'Ax cannot be 0'
# distance to center of gravity in z-direction
ez = (tf1 * b1 * tf1 / 2 + hw * tw * (tf1 + hw / 2) + tf2 * b2 * (tf1 + hw + tf2 / 2)) / Ax
#ez = (tf1 * b1 * (h - tf1 / 2) + hw * tw * (tf2 + hw / 2) + tf2 * b2 * (tf2 / 2)) / Ax
# moment of inertia in y-direction (c is centroid)
Iyc = (1 / 12) * (b1 * math.pow(tf1, 3) + b2 * math.pow(tf2, 3) + tw * math.pow(hw, 3))
Iy = Iyc + (tf1 * b1 * math.pow(tf1 / 2, 2) + tw * hw * math.pow(tf1+hw / 2, 2) +
tf2 * b2 * math.pow(tf1+hw+tf2 / 2, 2)) - Ax * math.pow(ez, 2)
# elastic section moduluses y-axis
Wey1 = Iy / (h - ez)
Wey2 = Iy / ez
return Wey1, Wey2
def get_plasic_section_modulus(self):
'''
Returns the plastic section modulus
:return:
'''
tf1 = self._plate_th
tf2 = self._flange_th
b1 = self._spacing
b2 = self._flange_width
h = self._flange_th+self._web_height+self._plate_th
tw = self._web_th
hw = self._web_height
Ax = tf1 * b1 + tf2 * b2 + (h-tf1-tf2) * tw
ezpl = (Ax/2-b1*tf1)/tw+tf1
az1 = h-ezpl-tf1
az2 = ezpl-tf2
Wy1 = b1*tf1*(az1+tf1/2) + (tw/2)*math.pow(az1,2)
Wy2 = b2*tf2*(az2+tf2/2)+(tw/2)*math.pow(az2,2)
return Wy1+Wy2
def get_shear_center(self):
'''
Returning the shear center
:return:
'''
tf1 = self._plate_th
tf2 = self._flange_th
b1 = self._spacing
b2 = self._flange_width
h = self._flange_th+self._web_height+self._plate_th
tw = self._web_th
hw = self._web_height
Ax = tf1 * b1 + tf2 * b2 + (h-tf1-tf2) * tw
# distance to center of gravity in z-direction
ez = (b2*tf2*tf2/2 + tw*hw*(tf2+hw/2)+tf1*b1*(tf2+hw+tf1/2)) / Ax
# Shear center:
# moment of inertia, z-axis
Iz1 = tf1 * math.pow(b1, 3)
Iz2 = tf2 * math.pow(b2, 3)
ht = h - tf1 / 2 - tf2 / 2
return (Iz1 * ht) / (Iz1 + Iz2) + tf2 / 2 - ez
def get_moment_of_intertia_hp(self):
# class Stiffener:
# def __init__(self, h, tw, plate_width, plate_thickness):
# self.h = h
# self.tw = tw
# self.bf = 2.5 * self.tw
# self.tf = 2.5 * self.tw
# self.r = self.tw
# self.plate_width = plate_width
# self.plate_thickness = plate_thickness
#
# @classmethod
# def from_hp(cls, h, tw, plate_width, plate_thickness):
# return cls(h, tw, plate_width, plate_thickness)
#
# def _distance(self, x, c, r):
# y1 = (self.h - self.tf) / 2
# y2 = self.tf / 2
# if (x <= -c).any() or (x >= c).any():
# return np.abs(x) - c + r
# else:
# theta = np.arcsin((y1 - y2) / r)
# A1 = theta * r ** 2 / 2
# A2 = (y1 - r) * (x + c - r)
# A3 = (y2 - r) * (c - r) + r ** 2 * theta
# if x <= 0:
# return A1 - A2
# else:
# return A1 - A3 - (x - c - r) * y1
#
# def _integrand(self, x, c, r):
# y = self._distance(x, c, r)
# return y ** 2
#
# def get_moment_of_inertia_hp(self):
# # Create points for integration
# c = (self.h - 2 * self.tw) / 2
# r = self.tw
# x = np.linspace(-c, c, num=1000)
#
# # Integrate to find moment of inertia
# integrand = lambda x: self._integrand(x, c, r)
# y = self._distance(x, c, r)
# I = simps(y * integrand(x), x)
#
# return I
#
# def get_moment_of_inertia_plate(self):
# I_plate = (self.plate_width * self.plate_thickness ** 3) / 12
# return I_plate
#
# def get_moment_of_inertia_combined(self):
# I_stiffener = self.get_moment_of_inertia_hp()
# I_plate = self.get_moment_of_inertia_plate()
# I_combined = I_stiffener + I_plate
# return I_stiffener, I_plate, I_combined
class Stiffener:
def __init__(self, hp_height, hp_thickness, plate_width, plate_thickness):
self.hp_height = hp_height
self.hp_thickness = hp_thickness
self.plate_width = plate_width
self.plate_thickness = plate_thickness
def _integrand(self, x, c, r):
if (x <= -c).any() or (x >= c).any():
return (x ** 2 + r ** 2) ** 0.5
else:
return r
def _distance(self, x, c, r):
if (x <= -c).any() or (x >= c).any():
return self.hp_height / 2 - self.hp_thickness - r
elif x >= c:
return self.hp_height / 2 - self.hp_thickness - r
else:
return self.hp_height / 2 - self.hp_thickness - (x ** 2 - c ** 2) ** 0.5
def get_moment_of_inertia_hp(self):
# Create points for integration
c = (self.hp_height - 2 * self.hp_thickness) / 2
r = self.hp_thickness
x = np.linspace(-c, c, num=1000)
# Integrate to find moment of inertia
integrand = lambda x: self._integrand(x, c, r)
y = self._distance(x, c, r)
I = simps(y * integrand(x), x)
return I
def get_moment_of_inertia(self):
I_stiffener = self.get_moment_of_inertia_hp()
I_plate = self.plate_thickness * (self.plate_width ** 3 / 12)
I_total = I_stiffener + I_plate
return I_stiffener, I_plate, I_total
stiffener = Stiffener(hp_height=300, hp_thickness=12, plate_width=680, plate_thickness=25)
I_stiffener, I_plate, I_total = stiffener.get_moment_of_inertia()
print(f"Moment of inertia of stiffener: {I_stiffener:.3e} mm^4")
print(f"Moment of inertia of plate: {I_plate:.3e} mm^4")
print(f"Moment of inertia of combined: {I_total:.3e} mm^4")
def get_moment_of_intertia(self, efficent_se=None, only_stf = False, tf1 = None, reduced_tw = None,
plate_thk = None, plate_spacing = None):
'''
Returning moment of intertia.
:return:
'''
if only_stf:
tf1 = t = 0
b1 = s_e = 0
else:
# if tf1 == None:
# tf1 = self._plate_th
tf1 = t = self._plate_th if tf1 == None else tf1
b1 = s_e =self._spacing if efficent_se==None else efficent_se
e_f = 0
h = self._flange_th+self._web_height+tf1
tw = self._web_th if reduced_tw == None else reduced_tw/1000
hw = self._web_height
tf2 = tf = self._flange_th
b2 = bf = self._flange_width
Ax = tf1 * b1 + tf2 * b2 + hw * tw
Iyc = (1 / 12) * (b1 * math.pow(tf1, 3) + b2 * math.pow(tf2, 3) + tw * math.pow(hw, 3))
ez = (tf1 * b1 * (h - tf1 / 2) + hw * tw * (tf2 + hw / 2) + tf2 * b2 * (tf2 / 2)) / Ax
Iy = Iyc + (tf1 * b1 * math.pow(tf2 + hw + tf1 / 2, 2) + tw * hw * math.pow(tf2 + hw / 2, 2) +
tf2 * b2 * math.pow(tf2 / 2, 2)) - Ax * math.pow(ez, 2)
# ###
# z_c = bf * tf * e_f / (s_e * t + hw * tw + bf * tf)
# I_z = 1.0 / 12.0 * t * math.pow(s_e,3) + 1.0 / 12.0 * hw * math.pow(tw,3) + 1.0 / 12.0 * tf * math.pow(bf,3) +\
# t * s_e * math.pow(z_c,2) + \
# tw * hw * math.pow(z_c,2) + bf * tf * math.pow(e_f - z_c,2)
# ###
#
# z_c = (bf * tf * (tf / 2.0 + t / 2.0 + hw) + hw * tw * (hw / 2.0 + t / 2.0)) / (s_e * t + hw * tw + bf * tf)
# I_sef = 1.0 / 12.0 * tw * hw ** 3 + 1.0 / 12.0 * bf * tf ** 3 + 1.0 / 12.0 * s_e * t ** 3 + tw * hw * (
# hw / 2.0 + t / 2.0 - z_c) ** 2 + tf * bf * (hw + t / 2.0 + tf / 2.0 - z_c) ** 2 + s_e * t * z_c ** 2
# print(I_sef, I_z, Iy)
#print(2*(bf*(h/2)**3/12 + tf*(h-tf)**3/12) + tw*h**3/12, Iy)
return Iy
def get_Iz_moment_of_inertia(self, reduced_tw = None):
tw = self._web_th*1000 if reduced_tw is None else reduced_tw
hw = self._web_height * 1000
tf2 = self._flange_th * 1000
b2 = self._flange_width * 1000
if self._stiffener_type == 'FB':
Iz = math.pow(tw,3)*hw/12
elif self._stiffener_type == 'T':
Iz = hw*math.pow(tw,3)/12 + tf2*math.pow(b2,3)/12
else:
Czver = tw/2
Czhor = b2/2
Aver = hw*tw
Ahor = b2*tf2
Atot = Aver+Ahor
Czoverall = Aver*Czver/Atot + Ahor*Czhor/Atot
dz = Czver - Czoverall
Iver = (1/12)*hw*math.pow(tw,3) + Aver*math.pow(dz,2)
dz = Czhor-Czoverall
Ihor = (1/12)*tf2*math.pow(b2,3) + Ahor*math.pow(dz,2)
Iz = Iver + Ihor
return Iz
def get_moment_of_interia_iacs(self, efficent_se=None, only_stf = False, tf1 = None):
if only_stf:
tf1 = 0
b1 = 0
else:
tf1 = self._plate_th if tf1 == None else tf1
b1 = self._spacing if efficent_se==None else efficent_se
h = self._flange_th+self._web_height+tf1
tw = self._web_th
hw = self._web_height
tf2 = self._flange_th
b2 = self._flange_width
Af = b2*tf2
Aw = hw*tw
ef = hw + tf2/2
Iy = (Af*math.pow(ef,2)*math.pow(b2,2)/12) * ( (Af+2.6*Aw) / (Af+Aw))
return Iy
def get_torsional_moment_venant(self, reduced_tw = None, efficient_flange = True):
# if efficient_flange:
# ef = self.get_ef_iacs()*1000
# else:
# ef = self._flange_width * 1000
tf = self._flange_th*1000
tw = self._web_th*1000 if reduced_tw is None else reduced_tw
bf = self._flange_width*1000
hw = self._web_height*1000
# if self._stiffener_type == 'FB':
# It = ((hw*math.pow(tw,3)/3e4) * (1-0.63*(tw/hw)) )
# else:
# It = ((((ef-0.5*tf)*math.pow(tw,3))/3e4) * (1-0.63*(tw/(ef-0.5*tf))) + ((bf*math.pow(tf,3))/3e4)
# * (1-0.63*(tf/bf)) )
# G = 80769.2
# It2 = (2/3) * (math.pow(tw,3)*hw + bf*math.pow(tf, 3)) *(hw+tf/2)
# print(It, It2*G)
# print(hw, tw, bf, tf)
I_t1 = 1.0 / 3.0 * math.pow(tw , 3) * hw + 1.0 / 3.0 * math.pow(tf, 3) * bf
# I_t2 = 1.0 / 3.0 * math.pow(tw , 3) * (hw + tf) + 1.0 / 3.0 * math.pow(tf, 3) * (bf - tw)
# print('It', I_t1, I_t2, It* 1e4)
return I_t1# * 1e4
def get_polar_moment(self, reduced_tw = None):
tf = self._flange_th*1000
tw = self._web_th*1000 if reduced_tw is None else reduced_tw
ef = self.get_flange_eccentricity()*1000
hw = self._web_height*1000
b = self._flange_width*1000
#Ipo = (A|w*(ef-0.5*tf)**2/3+Af*ef**2)*10e-4 #polar moment of interia in cm^4
#Ipo = (tw/3)*math.pow(hw, 3) + tf*(math.pow(hw+tf/2,2)*b)+(tf/3)*(math.pow(ef+b/2,3)-math.pow(ef-b/2,3))
# C24/3*C70^3+C26*((C70+C26/2)^2*C25)+C26/3*((C72+C25/2)^3-(C72-C25/2)^3) + (C25*C26^3)/12 + (C70*C24^3)/12
Ipo = tw/3*math.pow(hw, 3)+tf*(math.pow(hw+tf/2,2)*b)+tf/3*(math.pow(ef+b/2,3)-math.pow(ef-b/2,3)) + \
(b*math.pow(tf,3))/12 + (hw*math.pow(tw,3))/12
return Ipo
def get_flange_eccentricity(self):
ecc = 0 if self._stiffener_type in ['FB', 'T'] else self._flange_width / 2 - self._web_th / 2
return ecc
def get_ef_iacs(self):
if self._stiffener_type == 'FB':
ef = self._web_height
# elif self._stiffener_type == 'L-bulb':
# ef = self._web_height-0.5*self._flange_th
elif self._stiffener_type in ['L', 'T', 'L-bulb', 'HP-profile', 'HP', 'HP-bulb']:
ef = self._web_height + 0.5*self._flange_th
return ef
def get_stf_cog_eccentricity(self):
e = (self._web_height * self._web_th * (self._web_height / 2) + self._flange_width * self._flange_th *
(self._web_height + self._web_th / 2)) / (self._web_height * self._web_th + self._flange_width * self._flange_th)
return e
def get_structure_prop(self):
return self._main_dict
def get_structure_type(self):
return self._structure_type
def get_stiffener_type(self):
return self._stiffener_type
def get_shear_area(self):
'''
Returning the shear area in [m^2]
:return:
'''
return ((self._flange_th*self._web_th) + (self._web_th*self._plate_th) + (self._web_height*self._web_th))
def set_main_properties(self, main_dict):
'''
Resettting all properties
:param input_dictionary:
:return:
'''
self._main_dict = main_dict
self._plate_th = main_dict['plate_thk'][0]
self._web_height = main_dict['stf_web_height'][0]
self._web_th = main_dict['stf_web_thk'][0]
self._flange_width = main_dict['stf_flange_width'][0]
self._flange_th = main_dict['stf_flange_thk'][0]
self._mat_yield = main_dict['mat_yield'][0]
self._mat_factor = main_dict['mat_factor'][0]
self._span = main_dict['span'][0]
self._spacing = main_dict['spacing'][0]
self._structure_type = main_dict['structure_type'][0]
self._sigma_y1=main_dict['sigma_y1'][0]
self._sigma_y2=main_dict['sigma_y2'][0]
self._sigma_x1 = main_dict['sigma_x1'][0]
self._sigma_x2 = main_dict['sigma_x2'][0]
self._tauxy=main_dict['tau_xy'][0]
self._plate_kpp = main_dict['plate_kpp'][0]
self._stf_kps = main_dict['stf_kps'][0]
self._km1 = main_dict['stf_km1'][0]
self._km2 = main_dict['stf_km2'][0]
self._km3 = main_dict['stf_km3'][0]
self._stiffener_type=main_dict['stf_type'][0]
try:
self._girder_lg=main_dict['girder_lg'][0]
except KeyError:
self._girder_lg = 10
try:
self._pressure_side = main_dict['press_side'][0]
except KeyError:
self._pressure_side = 'p'
self._zstar_optimization = main_dict['zstar_optimization'][0]
self._puls_method = main_dict['puls buckling method'][0]
self._puls_boundary = main_dict['puls boundary'][0]
self._puls_stf_end = main_dict['puls stiffener end'][0]
self._puls_sp_or_up = main_dict['puls sp or up'][0]
self._puls_up_boundary = main_dict['puls up boundary'][0]
self._panel_or_shell = main_dict['panel or shell'][0]
def set_stresses(self,sigy1,sigy2,sigx1,sigx2,tauxy):
'''
Setting the global stresses.
:param sigy1:
:param sigy2:
:param sigx:
:param tauxy:
:return:
'''
self._main_dict['sigma_y1'][0]= sigy1
self._sigma_y1 = sigy1
self._main_dict['sigma_y2'][0]= sigy2
self._sigma_y2 = sigy2
self._main_dict['sigma_x1'][0]= sigx1
self._sigma_x1 = sigx1
self._main_dict['sigma_x2'][0]= sigx2
self._sigma_x2 = sigx2
self._main_dict['tau_xy'][0]= tauxy
self._tauxy = tauxy
def get_cross_section_area(self, efficient_se = None, include_plate = True):
'''
Returns the cross section area.
:return:
'''
tf1 = self._plate_th if include_plate else 0
tf2 = self._flange_th
if include_plate:
b1 = self._spacing if efficient_se==None else efficient_se
else:
b1 = 0
b2 = self._flange_width
#h = self._flange_th+self._web_height+self._plate_th
h = self._web_height
tw = self._web_th
#print('Plate: thk', tf1, 's', b1, 'Flange: thk', tf2, 'width', b2, 'Web: thk', tw, 'h', h)
return tf1 * b1 + tf2 * b2 + h * tw
def get_cross_section_centroid_with_effective_plate(self, se = None, tf1 = None, include_plate = True,
reduced_tw = None):
'''
Returns cross section centroid
:return:
'''
# checked with example
if include_plate:
tf1 = self._plate_th if tf1 == None else tf1
b1 = self._spacing if se == None else se
else:
tf1 = 0
b1 = 0
tf2 = self._flange_th
b2 = self._flange_width
tw = self._web_th if reduced_tw == None else reduced_tw/1000
hw = self._web_height
Ax = tf1 * b1 + tf2 * b2 + hw * tw
effana = (tf1 * b1 * tf1/2 + hw * tw * (tf1 + hw / 2) + tf2 * b2 * (tf1+hw+tf2/2)) / Ax
return effana
def get_weight(self):
'''
Return the weight.
:return:
'''
return 7850*self._span*(self._spacing*self._plate_th+self._web_height*self._web_th+self._flange_width*self._flange_th)
def get_weight_width_lg(self):
'''
Return the weight including Lg
:return:
'''
pl_area = self._girder_lg*self._plate_th
stf_area = (self._web_height*self._web_th+self._flange_width*self._flange_th)*(self._girder_lg//self._spacing)
return (pl_area+stf_area)*7850*self._span
def set_span(self,span):
'''
Setting the span. Used when moving a point.
:return:
'''
self._span = span
self._main_dict['span'][0] = span
def get_puls_input(self, run_type: str = 'SP'):
if self._stiffener_type == 'FB':
stf_type = 'F'
else:
stf_type = self._stiffener_type
map_boundary = {'Continuous': 'C', 'Sniped': 'S'}
sig_x1 = self._sigma_x1
sig_x2 = self._sigma_x2
if sig_x1 * sig_x2 >= 0:
sigxd = sig_x1 if abs(sig_x1) > abs(sig_x2) else sig_x2
else:
sigxd = max(sig_x1, sig_x2)
if self._puls_sp_or_up == 'SP':
return_dict = {'Identification': None, 'Length of panel': self._span*1000, 'Stiffener spacing': self._spacing*1000,
'Plate thickness': self._plate_th*1000,
'Number of primary stiffeners': 10,
'Stiffener type (L,T,F)': stf_type,
'Stiffener boundary': map_boundary[self._puls_stf_end]
if map_boundary[self._puls_stf_end] in ['C', 'S']
else 'C' if self._puls_stf_end == 'Continuous' else 'S',
'Stiff. Height': self._web_height*1000, 'Web thick.': self._web_th*1000,
'Flange width': self._flange_width*1000,
'Flange thick.': self._flange_th*1000, 'Tilt angle': 0,
'Number of sec. stiffeners': 0, 'Modulus of elasticity': 2.1e11/1e6, "Poisson's ratio": 0.3,
'Yield stress plate': self._mat_yield/1e6, 'Yield stress stiffener': self._mat_yield/1e6,
'Axial stress': 0 if self._puls_boundary == 'GT' else sigxd,
'Trans. stress 1': 0 if self._puls_boundary == 'GL' else self._sigma_y1,
'Trans. stress 2': 0 if self._puls_boundary == 'GL' else self._sigma_y2,
'Shear stress': self._tauxy,
'Pressure (fixed)': None, 'In-plane support': self._puls_boundary,
'sp or up': self._puls_sp_or_up}
else:
boundary = self._puls_up_boundary
blist = list()
if len(boundary) != 4:
blist = ['SS', 'SS', 'SS', 'SS']
else:
for letter in boundary:
if letter.upper() == 'S':
blist.append('SS')
elif letter.upper() == 'C':
blist.append('CL')
else:
blist.append('SS')
return_dict = {'Identification': None, 'Length of plate': self._span*1000, 'Width of c': self._spacing*1000,
'Plate thickness': self._plate_th*1000,
'Modulus of elasticity': 2.1e11/1e6, "Poisson's ratio": 0.3,
'Yield stress plate': self._mat_yield/1e6,
'Axial stress 1': 0 if self._puls_boundary == 'GT' else sigxd,
'Axial stress 2': 0 if self._puls_boundary == 'GT' else sigxd,
'Trans. stress 1': 0 if self._puls_boundary == 'GL' else self._sigma_y1,
'Trans. stress 2': 0 if self._puls_boundary == 'GL' else self._sigma_y2,
'Shear stress': self._tauxy, 'Pressure (fixed)': None, 'In-plane support': self._puls_boundary,
'Rot left': blist[0], 'Rot right': blist[1], 'Rot upper': blist[2], 'Rot lower': blist[3],