-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_xhale.py
1864 lines (1705 loc) · 86 KB
/
generate_xhale.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
import h5py as h5
import numpy as np
import os
import sharpy.utils.algebra as algebra
route = os.path.dirname(os.path.realpath(__file__)) + '/'
cases = [
# 'gravity_only',
'tip_force',
'tip_moment',
# 'aeroelastic_aoa0',
# 'aeroelastic_aoa3',
# 'aeroelastic_aoa5',
# 'aeroelastic_trim',
# 'aeroelastic_statictrim',
# 'aero_only',
'cog',
]
structural_cases = ['cog', 'gravity_only', 'tip_force', 'tip_moment']
horseshoe = 'on'
for case in cases:
vertical_tail = True
if vertical_tail:
case_name = 'xhale_ifasd_vertical_tail' + '_' + case
print('Generating xhale with vertical Ctail')
else:
case_name = 'xhale_ifasd_horizontal_tail' + '_' + case
print('Generating xhale with horizontal Ctail')
if case in structural_cases:
# structural-only cases
flow = [
'BeamLoader',
'NonLinearStatic',
'BeamLoads',
'BeamPlot',
]
else:
# aeroelastic simulations
flow = [
'BeamLoader',
'AerogridLoader',
'StaticCoupled',
'BeamLoads',
'BeamPlot',
'AerogridPlot',
]
if case == 'aeroelastic_statictrim':
# aeroelastic simulations
flow = [
'BeamLoader',
'AerogridLoader',
'StaticTrim',
'BeamLoads',
'BeamPlot',
'AerogridPlot',
]
if case == 'aero_only':
# aero simulations
flow = [
'BeamLoader',
'AerogridLoader',
'StaticUvlm',
# 'BeamLoads',
'BeamPlot',
'AerogridPlot',
'DynamicCoupled',
]
u_inf = 14
rho = 1.225
if case == 'cog':
rho = 0.0
in_structural_twist = 5*np.pi/180
if vertical_tail:
if case in structural_cases:
alpha = 0
beta = 0*np.pi/180
roll = 0
cs_deflection = 0*np.pi/180
aileron_deflection = 0*np.pi/180
thrustC = 0
differential = 0
else:
alpha = 2.59034*np.pi/180
beta = 0.*np.pi/180
cs_deflection = 1.14867*np.pi/180
aileron_deflection = 0*0.039011*np.pi/180
thrustC = 0.179577
differential = 0
roll = 0
in_structural_twist = 5*np.pi/180
if case == 'aeroelastic_aoa0':
alpha = 0
beta = 0*np.pi/180
roll = 0
cs_deflection = 0*np.pi/180
aileron_deflection = 0*np.pi/180
thrustC = 0
differential = 0
elif case == 'aeroelastic_aoa3':
alpha = 3*np.pi/180
beta = 0*np.pi/180
roll = 0
cs_deflection = 0*np.pi/180
aileron_deflection = 0*np.pi/180
thrustC = 0
differential = 0
elif case == 'aeroelastic_aoa5':
alpha = 5*np.pi/180
beta = 0*np.pi/180
roll = 0
cs_deflection = 0*np.pi/180
aileron_deflection = 0*np.pi/180
thrustC = 0
differential = 0
elif case == 'aero_only':
alpha = -1*np.pi/180
beta = 0*np.pi/180
roll = 0
cs_deflection = 0*np.pi/180
aileron_deflection = 0*np.pi/180
thrustC = 0
differential = 0
# in_structural_twist = 0
elif case == 'aeroelastic_statictrim':
alpha = 2.57*np.pi/180
beta = 0.*np.pi/180
cs_deflection = 1.54*np.pi/180
aileron_deflection = 0*0.039011*np.pi/180
thrustC = 0.199
differential = 0
roll = 0
else:
raise NotImplementedError()
gravity = 'on'
gravity_value = 9.807
if case in ['tip_force', 'tip_moment']:
gravity = 'off'
elif case == 'cog':
gravity_value = 0.0
sigma = 1
ga_mult = 0.1
gust_intensity = 0.20
gust_length = 15*0.2
n_step = 1
if case == 'aeroelastic_aoa5':
n_step = 6
n_structural_steps = 1
if case in ['structural_cases']:
n_structural_steps = 2
if case == 'tip_moment':
n_structural_steps = 20
if case == 'gravity_only':
n_structural_steps = 2
if case == 'aeroelastic_statictrim':
n_step = 1
static_relaxation_factor = 0.5
initial_relaxation_factor = 0.3
final_relaxation_factor = 0.5
relaxation_steps = 50
tolerance = 1e-6
fsi_tolerance = 1e-6
wake_length = 4 # meters
span_section = 1.0
dihedral_outer = 10*np.pi/180
length_centre_tail = 1.106
length_outer_tail = 0.65
span_tail = 0.24
span_ctail_L = 0.145
span_ctail_R = 0.24
span_fin = 0.184
span_vfin = 0.15
n_sections = 3
# DISCRETISATION
# spatial discretisation
m = 8
m = 16
m_tail = 3
m_fin = 4
# m = 16
# m_tail = 4
# m_fin = 8
# print('CAUTION: ALL SURFACES M=8!!!')
# m = 8
# m_tail = 8
# m_fin = 8
if horseshoe == 'on':
mstar = 1
else:
mstar = int(wake_length/0.2*m)
print('mstar = ', mstar)
# dont change n_elem_mult
n_elem_multiplier = 1
n_elem_section = 4
n_elem_section_dihedral = 8
n_elem_centre_tail = 1
n_elem_outer_tail = 1
n_elem_tail = 1
n_elem_fin = 1
n_elem_main = int((n_sections-1)*n_elem_section*n_elem_multiplier + n_elem_section_dihedral)
n_surfaces = 20
# temporal discretisation
physical_time = 30
tstep_factor = 1
dt = 0.2/m/u_inf*tstep_factor
n_tstep = round(physical_time/dt)
n_tstep = 15000
# beam processing
n_node_elem = 3
span_main = n_sections*span_section
# total number of elements
n_elem = 0
n_elem += n_elem_main
n_elem += n_elem_main
n_elem += n_elem_centre_tail
n_elem += n_elem_tail
n_elem += n_elem_tail
n_elem += n_elem_fin
n_elem += n_elem_outer_tail
n_elem += n_elem_tail
n_elem += n_elem_tail
n_elem += n_elem_fin
n_elem += n_elem_outer_tail
n_elem += n_elem_tail
n_elem += n_elem_tail
n_elem += n_elem_fin
n_elem += n_elem_outer_tail
n_elem += n_elem_tail
n_elem += n_elem_tail
n_elem += n_elem_outer_tail
n_elem += n_elem_tail
n_elem += n_elem_tail
n_elem += n_elem_fin
n_elem += n_elem_fin
n_elem += n_elem_fin
n_elem += n_elem_fin
n_elem += n_elem_fin
# number of nodes per part
n_node_section = n_elem_section*(n_node_elem - 1) + 1
n_node_section_dihedral = n_elem_section_dihedral*(n_node_elem - 1) + 1
n_node_main = n_elem_main*(n_node_elem - 1) + 1
n_node_centre_tail = n_elem_centre_tail*(n_node_elem - 1) + 1
n_node_tail = n_elem_tail*(n_node_elem - 1) + 1
n_node_outer_tail = n_elem_outer_tail*(n_node_elem - 1) + 1
n_node_fin = n_elem_fin*(n_node_elem - 1) + 1
# total number of nodes
n_node = 0
n_node += n_node_main + n_node_main - 1
n_node += n_node_centre_tail - 1
n_node += n_node_tail - 1
n_node += n_node_tail - 1
n_node += n_node_fin - 1
n_node += n_node_outer_tail - 1
n_node += n_node_tail - 1
n_node += n_node_tail - 1
n_node += n_node_fin - 1
n_node += n_node_outer_tail - 1
n_node += n_node_tail - 1
n_node += n_node_tail - 1
n_node += n_node_fin - 1
n_node += n_node_outer_tail - 1
n_node += n_node_tail - 1
n_node += n_node_tail - 1
n_node += n_node_outer_tail - 1
n_node += n_node_tail - 1
n_node += n_node_tail - 1
n_node += n_node_fin - 1
n_node += n_node_fin - 1
n_node += n_node_fin - 1
n_node += n_node_fin - 1
n_node += n_node_fin - 1
# stiffness and mass matrices
n_stiffness = 12
n_mass = 17
# PLACEHOLDERS
# beam
x = np.zeros((n_node, ))
y = np.zeros((n_node, ))
z = np.zeros((n_node, ))
stiffness_db = np.zeros((n_stiffness, 6, 6))
mass_db = np.zeros((n_mass, 6, 6))
beam_number = np.zeros((n_elem, ), dtype=int)
num_node_elements = np.zeros((n_elem, ), dtype=int) + 3
frame_of_reference_delta = np.zeros((n_elem, n_node_elem, 3))
structural_twist = np.zeros((n_elem, n_node_elem))
conn = np.zeros((n_elem, n_node_elem), dtype=int)
elem_stiffness = np.zeros((n_elem, ), dtype=int)
elem_mass = np.zeros((n_elem, ), dtype=int)
boundary_conditions = np.zeros((n_node, ), dtype=int)
app_forces = np.zeros((n_node, 6))
n_lumped_mass = 0
lumped_mass_nodes = None
lumped_mass = None
lumped_mass_inertia = None
lumped_mass_position = None
end_nodesL = np.zeros((n_sections,), dtype=int)
end_nodesR = np.zeros((n_sections,), dtype=int)
end_elementsL = np.zeros((n_sections,), dtype=int)
end_elementsR = np.zeros((n_sections,), dtype=int)
end_tails_nodesL = np.zeros((2, ), dtype=int)
end_tails_elementsL = np.zeros((2, ), dtype=int)
end_tails_nodesR = np.zeros((2, ), dtype=int)
end_tails_elementsR = np.zeros((2, ), dtype=int)
end_of_centre_tail_node = 0
end_of_centre_tail_elem = 0
end_tip_tail_nodeC = np.zeros((2, ), dtype=int)
end_tip_tail_elemC = np.zeros((2, ), dtype=int)
tail_beam_numbersR = np.zeros((2, 3)) # 0=centre spar, 1=R tail, 2=L tail
tail_beam_numbersL = np.zeros((2, 3)) # 0=centre spar, 1=R tail, 2=L tail
tail_beam_numbersC = np.zeros((3, ))
fin_beam_numberC = 0
fin_beam_numberL = 0
fin_beam_numberR = 0
vfin_beam_numberC = 0
vfin_beam_numberL = 0
vfin_beam_numberR = 0
fin_beam_numberLL = 0
fin_beam_numberRR = 0
# aero
airfoil_distribution = np.zeros((n_elem, n_node_elem), dtype=int)
surface_distribution = np.zeros((n_elem,), dtype=int) - 1
surface_m = np.zeros((n_surfaces, ), dtype=int)
m_distribution = 'uniform'
aero_node = np.zeros((n_node,), dtype=bool)
twist = np.zeros((n_elem, n_node_elem))
chord = np.zeros((n_elem, n_node_elem,))
elastic_axis = np.zeros((n_elem, n_node_elem,))
thrust_nodes = np.zeros((5,), dtype=int)
# FUNCTIONS-------------------------------------------------------------
def clean_test_files():
fem_file_name = route + '/' + case_name + '.fem.h5'
if os.path.isfile(fem_file_name):
os.remove(fem_file_name)
dyn_file_name = route + '/' + case_name + '.dyn.h5'
if os.path.isfile(dyn_file_name):
os.remove(dyn_file_name)
aero_file_name = route + '/' + case_name + '.aero.h5'
if os.path.isfile(aero_file_name):
os.remove(aero_file_name)
solver_file_name = route + '/' + case_name + '.sharpy'
if os.path.isfile(solver_file_name):
os.remove(solver_file_name)
flightcon_file_name = route + '/' + case_name + '.flightcon.txt'
if os.path.isfile(flightcon_file_name):
os.remove(flightcon_file_name)
def read_beam_data(filename='inputs/beam_properties.xlsx'):
import pandas as pd
import sharpy.utils.model_utils as model_utils
# mass
mass_sheet = pd.read_excel(filename, sheetname='mass', header=1, skip_rows=1, index_col=0)
# remove units
mass_sheet = mass_sheet.drop(['[-]'])
mass_data = dict()
for index, row in mass_sheet.iterrows():
mass_data[index] = dict()
mass_data[index]['mass'] = mass_sheet['mass'][index]
mass_data[index]['inertia'] = np.zeros((3, 3))
mass_data[index]['inertia'][0, 0] = mass_sheet['ixx'][index]
mass_data[index]['inertia'][1, 1] = mass_sheet['iyy'][index]
mass_data[index]['inertia'][2, 2] = mass_sheet['izz'][index]
mass_data[index]['inertia'][1, 2] = mass_sheet['iyz'][index]
mass_data[index]['inertia'][2, 1] = mass_sheet['iyz'][index]
mass_data[index]['xcg'] = np.zeros((3,))
mass_data[index]['xcg'][0] = mass_sheet['xcg'][index]
mass_data[index]['xcg'][1] = mass_sheet['ycg'][index]
mass_data[index]['xcg'][2] = mass_sheet['zcg'][index]
mass_data[index]['full_matrix'] = (
model_utils.mass_matrix_generator(mass_data[index]['mass'],
mass_data[index]['xcg'],
mass_data[index]['inertia']))
# stiffness
stiff_sheet = pd.read_excel(filename, sheetname='stiffness', header=1, skip_rows=1, index_col=0)
# remove units
stiff_sheet = stiff_sheet.drop(['[-]'])
stiff_data = dict()
for index, row in stiff_sheet.iterrows():
stiff_data[index] = np.zeros((6, 6))
stiff_data[index][0, 0] = stiff_sheet['ea'][index]
stiff_data[index][1, 1] = stiff_sheet['gay'][index]*ga_mult
stiff_data[index][2, 2] = stiff_sheet['gaz'][index]*ga_mult
stiff_data[index][3, 3] = stiff_sheet['gj'][index]
stiff_data[index][4, 4] = stiff_sheet['eiy'][index]
stiff_data[index][5, 5] = stiff_sheet['eiz'][index]
stiff_data[index][0, 4] = stiff_sheet['k13'][index]
stiff_data[index][4, 0] = stiff_sheet['k13'][index]
stiff_data[index][0, 5] = stiff_sheet['k14'][index]
stiff_data[index][5, 0] = stiff_sheet['k14'][index]
stiff_data[index][4, 5] = stiff_sheet['k34'][index]
stiff_data[index][5, 4] = stiff_sheet['k34'][index]
return mass_data, stiff_data
def read_lumped_mass_data(filename='inputs/lumped_mass.xlsx'):
import pandas as pd
xl = pd.ExcelFile(filename)
sheets = {sheet_name: xl.parse(sheet_name, header=0, skiprows=(0, 2)) for sheet_name in xl.sheet_names}
lumped_mass_data = dict()
n_lumped = 0
for sheet, val in sheets.items():
if sheet == 'Notes':
continue
lumped_mass_data[sheet] = list()
for row in range(len(val)):
n_lumped += 1
lumped_mass_data[sheet].append(dict())
lumped_mass_data[sheet][row]['mass'] = 0.0
lumped_mass_data[sheet][row]['inertia'] = np.zeros((3, 3))
lumped_mass_data[sheet][row]['xcg'] = np.zeros((3,))
# lumped_mass_data[shee[row]t]['full_matrix'] = np.zeros((3, 3))
lumped_mass_data[sheet][row]['mass'] = val['Mass'][row]
lumped_mass_data[sheet][row]['inertia'][0, 0] = val['Ixx'][row]
lumped_mass_data[sheet][row]['inertia'][1, 1] = val['Iyy'][row]
lumped_mass_data[sheet][row]['inertia'][2, 2] = val['Izz'][row]
lumped_mass_data[sheet][row]['inertia'][0, 1] = val['Ixy'][row]
lumped_mass_data[sheet][row]['inertia'][1, 0] = val['Ixy'][row]
lumped_mass_data[sheet][row]['inertia'][0, 2] = val['Ixz'][row]
lumped_mass_data[sheet][row]['inertia'][2, 0] = val['Ixz'][row]
lumped_mass_data[sheet][row]['inertia'][1, 2] = val['Iyz'][row]
lumped_mass_data[sheet][row]['inertia'][2, 1] = val['Iyz'][row]
lumped_mass_data[sheet][row]['xcg'][0] = val['xcg'][row]
lumped_mass_data[sheet][row]['xcg'][1] = val['ycg'][row]
lumped_mass_data[sheet][row]['xcg'][2] = val['zcg'][row]
lumped_mass_data['n_lumped_mass'] = n_lumped
return lumped_mass_data
def generate_fem():
global end_of_centre_tail_node, end_of_centre_tail_elem
global fin_beam_numberC, fin_beam_numberL, fin_beam_numberR
global vfin_beam_numberC, vfin_beam_numberL, vfin_beam_numberR
global fin_beam_numberLL, fin_beam_numberRR
mass_data, stiff_data = read_beam_data()
# import pdb; pdb.set_trace()
lumped_mass_data = read_lumped_mass_data()
# import pdb; pdb.set_trace()
n_lumped_mass = lumped_mass_data['n_lumped_mass']
lumped_mass_nodes = np.zeros((n_lumped_mass, ), dtype=int)
lumped_mass = np.zeros((n_lumped_mass, ))
lumped_mass_inertia = np.zeros((n_lumped_mass, 3, 3))
lumped_mass_position = np.zeros((n_lumped_mass, 3))
lumped_mass_indices = dict()
i_lm = 0
for i, k in enumerate(lumped_mass_data.keys()):
if k == 'n_lumped_mass':
continue
lumped_mass_indices[k] = list()
for j in range(len(lumped_mass_data[k])):
lumped_mass[i_lm] = lumped_mass_data[k][j]['mass']
lumped_mass_inertia[i_lm] = lumped_mass_data[k][j]['inertia']
lumped_mass_position[i_lm] = lumped_mass_data[k][j]['xcg']
lumped_mass_indices[k].append(i_lm)
i_lm += 1
mass_db[0, ...] = mass_data['Linboard']['full_matrix']
mass_db[1, ...] = mass_data['Loutboard']['full_matrix']
mass_db[2, ...] = mass_data['Ldihedral']['full_matrix']
mass_db[3, ...] = mass_data['Rinboard']['full_matrix']
mass_db[4, ...] = mass_data['Routboard']['full_matrix']
mass_db[5, ...] = mass_data['Rdihedral']['full_matrix']
mass_db[6, ...] = mass_data['boom']['full_matrix']
mass_db[7, ...] = mass_data['tailL']['full_matrix']
mass_db[8, ...] = mass_data['tailR']['full_matrix']
mass_db[9, ...] = mass_data['Cfin']['full_matrix']
mass_db[10, ...] = mass_data['Lfin']['full_matrix']
mass_db[11, ...] = mass_data['Rfin']['full_matrix']
mass_db[12, ...] = mass_data['LLfin']['full_matrix']
mass_db[13, ...] = mass_data['RRfin']['full_matrix']
mass_db[14, ...] = mass_data['Cvfin']['full_matrix']
mass_db[15, ...] = mass_data['Lvfin']['full_matrix']
mass_db[16, ...] = mass_data['Rvfin']['full_matrix']
stiffness_db[0, ...] = sigma*stiff_data['Linboard']
stiffness_db[1, ...] = sigma*stiff_data['Loutboard']
stiffness_db[2, ...] = sigma*stiff_data['Ldihedral']
stiffness_db[3, ...] = sigma*stiff_data['Rinboard']
stiffness_db[4, ...] = sigma*stiff_data['Routboard']
stiffness_db[5, ...] = sigma*stiff_data['Rdihedral']
stiffness_db[6, ...] = sigma*stiff_data['boom']
stiffness_db[7, ...] = sigma*stiff_data['tailL']
stiffness_db[8, ...] = sigma*stiff_data['tailR']
stiffness_db[9, ...] = sigma*stiff_data['Cfin']
stiffness_db[10, ...] = sigma*stiff_data['Lfin']
stiffness_db[11, ...] = sigma*stiff_data['Rfin']
rotation_mat = algebra.rotation3d_z(np.pi)
rotation_mat_x = algebra.rotation3d_x(-in_structural_twist)
we = 0
wn = 0
# SECTION 0R
# add the lumped mass of the pods
lumped_mass_id = 'centre_pod'
# for i in range(len(lumped_mass_indices[lumped_mass_id])):
# lumped_mass_nodes[lumped_mass_indices[lumped_mass_id][i]] = 0
for i in range(len(lumped_mass_indices[lumped_mass_id])):
lumped_mass_nodes[lumped_mass_indices[lumped_mass_id][i]] = 0
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]] = np.dot(rotation_mat_x,
np.dot(np.eye(3),
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]])
)
# add thrust as applied force
app_forces[0, 0:3] = thrustC*np.array([0.0, np.cos(in_structural_twist), -np.sin(in_structural_twist)])
thrust_nodes[0] = 0
beam_number[we:we + n_elem_section] = 0
y[wn:wn + n_node_section] = np.linspace(0.0, span_section, n_node_section)
structural_twist[we:we + n_elem_section, :] = in_structural_twist
for ielem in range(n_elem_section):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_section] = 3
elem_mass[we:we + n_elem_section] = 3
boundary_conditions[0] = 1
we += n_elem_section
wn += n_node_section
end_nodesR[0] = wn - 1
end_elementsR[0] = we - 1
# SECTION 1R
# add the lumped mass of the pods
lumped_mass_id = 'R_inboard_pod'
for i in range(len(lumped_mass_indices[lumped_mass_id])):
lumped_mass_nodes[lumped_mass_indices[lumped_mass_id][i]] = wn - 1
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]] = np.dot(rotation_mat_x,
np.dot(np.eye(3),
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]])
)
app_forces[wn-1, 0:3] = thrustC*np.array([0.0, np.cos(in_structural_twist), -np.sin(in_structural_twist)])
thrust_nodes[1] = wn - 1
beam_number[we:we + n_elem_section] = 1
y[wn:wn + n_node_section - 1] = y[wn - 1] + np.linspace(0.0, span_section, n_node_section)[1:]
structural_twist[we:we + n_elem_section, :] = in_structural_twist
for ielem in range(n_elem_section):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_section] = 4
elem_mass[we:we + n_elem_section] = 4
we += n_elem_section
wn += n_node_section - 1
end_nodesR[1] = wn - 1
end_elementsR[1] = we - 1
# SECTION 2R
# add the lumped mass of the pods
lumped_mass_id = 'R_outboard_pod'
# for i in range(len(lumped_mass_indices[lumped_mass_id])):
# lumped_mass_nodes[lumped_mass_indices[lumped_mass_id][i]] = wn - 1
for i in range(len(lumped_mass_indices[lumped_mass_id])):
lumped_mass_nodes[lumped_mass_indices[lumped_mass_id][i]] = wn - 1
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]] = np.dot(rotation_mat_x,
np.dot(np.eye(3),
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]])
)
app_forces[wn-1, 0:3] = thrustC*(1 + differential)*np.array([0.0, np.cos(in_structural_twist), -np.sin(in_structural_twist)])
thrust_nodes[1] = wn - 1
beam_number[we:we + n_elem_section_dihedral] = 2
structural_twist[we:we + n_elem_section_dihedral, :] = in_structural_twist
# y[wn:wn + n_node_section - 1] = y[wn - 1] + np.linspace(0.0, span_section, n_node_section)[1:]
y[wn:wn + n_node_section_dihedral - 1] = y[wn - 1] + np.linspace(0.0,
np.cos(dihedral_outer)*span_section,
n_node_section_dihedral)[1:]
z[wn:wn + n_node_section_dihedral - 1] = z[wn - 1] + np.linspace(0.0,
np.sin(dihedral_outer)*span_section,
n_node_section_dihedral)[1:]
for ielem in range(n_elem_section_dihedral):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_section_dihedral] = 5
elem_mass[we:we + n_elem_section_dihedral] = 5
# elem_stiffness[we:we + n_elem_section] = 4
# elem_mass[we:we + n_elem_section] = 4
boundary_conditions[wn + n_node_section_dihedral - 1 - 1] = -1
we += n_elem_section_dihedral
wn += n_node_section_dihedral - 1
end_nodesR[2] = wn - 1
end_elementsR[2] = we - 1
if case == 'tip_force':
app_forces[end_nodesR[2], 2] = 15*np.cos(5*np.pi/180)
app_forces[end_nodesR[2], 1] = 15*np.sin(5*np.pi/180)
elif case == 'tip_moment':
app_forces[end_nodesR[2], 4] = -30*np.cos(5*np.pi/180)
app_forces[end_nodesR[2], 5] = 30*np.sin(5*np.pi/180)
# SECTION 0L
beam_number[we:we + n_elem_section] = 3
structural_twist[we:we + n_elem_section, :] = -in_structural_twist
y[wn:wn + n_node_section - 1] = np.linspace(0.0, -span_section, n_node_section)[1:]
for ielem in range(n_elem_section):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
conn[we, 0] = 0
elem_stiffness[we:we + n_elem_section] = 0
elem_mass[we:we + n_elem_section] = 0
we += n_elem_section
wn += n_node_section - 1
end_nodesL[0] = wn - 1
end_elementsL[0] = we - 1
# SECTION 1L
# add the lumped mass of the pods
lumped_mass_id = 'L_inboard_pod'
for i in range(len(lumped_mass_indices[lumped_mass_id])):
lumped_mass_nodes[lumped_mass_indices[lumped_mass_id][i]] = wn - 1
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]] = np.dot(rotation_mat_x.T,
np.dot(rotation_mat,
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]])
)
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]][0] *= -1
# lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]][1] *= -1
app_forces[wn-1, 0:3] = thrustC*np.array([0.0, -np.cos(in_structural_twist), -np.sin(in_structural_twist)])
thrust_nodes[3] = wn - 1
beam_number[we:we + n_elem_section] = 4
structural_twist[we:we + n_elem_section, :] = -in_structural_twist
y[wn:wn + n_node_section - 1] = y[wn - 1] + np.linspace(0.0, -span_section, n_node_section)[1:]
for ielem in range(n_elem_section):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_section] = 1
elem_mass[we:we + n_elem_section] = 1
we += n_elem_section
wn += n_node_section - 1
end_nodesL[1] = wn - 1
end_elementsL[1] = we - 1
# SECTION 2L
# add the lumped mass of the pods
lumped_mass_id = 'L_outboard_pod'
for i in range(len(lumped_mass_indices[lumped_mass_id])):
lumped_mass_nodes[lumped_mass_indices[lumped_mass_id][i]] = wn - 1
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]] = np.dot(rotation_mat_x.T,
np.dot(rotation_mat,
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]]))
lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]][0] *= -1
# lumped_mass_position[lumped_mass_indices[lumped_mass_id][i]][1] *= -1
# app_forces[wn-1, 1] = -thrustL
# thrust_nodes[4] = wn - 1
app_forces[wn-1, 0:3] = thrustC*(1 - differential)*np.array([0.0, -np.cos(in_structural_twist), -np.sin(in_structural_twist)])
thrust_nodes[4] = wn - 1
beam_number[we:we + n_elem_section_dihedral] = 5
structural_twist[we:we + n_elem_section_dihedral, :] = -in_structural_twist
# y[wn:wn + n_node_section - 1] = y[wn - 1] + np.linspace(0.0, -span_section, n_node_section)[1:]
y[wn:wn + n_node_section_dihedral - 1] = y[wn - 1] + np.linspace(0.0, -np.cos(dihedral_outer)*span_section, n_node_section_dihedral)[1:]
z[wn:wn + n_node_section_dihedral - 1] = z[wn - 1] + np.linspace(0.0, np.sin(dihedral_outer)*span_section, n_node_section_dihedral)[1:]
for ielem in range(n_elem_section_dihedral):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_section_dihedral] = 2
elem_mass[we:we + n_elem_section_dihedral] = 2
# elem_stiffness[we:we + n_elem_section] = 1
# elem_mass[we:we + n_elem_section] = 1
boundary_conditions[wn + n_node_section_dihedral - 1 - 1] = -1
we += n_elem_section_dihedral
wn += n_node_section_dihedral - 1
end_nodesL[2] = wn - 1
end_elementsL[2] = we - 1
# centre tail
beam_number[we:we + n_elem_centre_tail] = 6
tail_beam_numbersC[0] = 6
x[wn:wn + n_node_centre_tail - 1] = np.linspace(0.0, length_centre_tail, n_node_centre_tail)[1:]
for ielem in range(n_elem_centre_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [0.0, 1.0, 0.0]
conn[we, 0] = 0
elem_stiffness[we:we + n_elem_centre_tail] = 6
elem_mass[we:we + n_elem_centre_tail] = 6
we += n_elem_centre_tail
wn += n_node_centre_tail - 1
end_of_centre_tail_node = wn - 1
end_of_centre_tail_elem = we
if vertical_tail:
beam_number[we:we + n_elem_tail] = 7
tail_beam_numbersC[1] = 7
x[wn:wn + n_node_tail - 1] = x[wn - 1]
y[wn:wn + n_node_tail - 1] = y[wn - 1]
z[wn:wn + n_node_tail - 1] = z[wn - 1] + np.linspace(0.0, span_ctail_R, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_tail] = 8
elem_mass[we:we + n_elem_tail] = 8
boundary_conditions[wn + n_node_tail - 1 - 1] = -1
end_tip_tail_nodeC[0] = wn + n_node_tail - 1 - 1
end_tip_tail_elemC[0] = we + n_elem_tail - 1
we += n_elem_tail
wn += n_node_tail - 1
beam_number[we:we + n_elem_tail] = 8
tail_beam_numbersC[2] = 8
x[wn:wn + n_node_tail - 1] = x[end_of_centre_tail_node]
y[wn:wn + n_node_tail - 1] = y[wn - 1]
z[wn:wn + n_node_tail - 1] = z[end_of_centre_tail_node] + np.linspace(0.0, -span_ctail_L, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
conn[we, 0] = end_of_centre_tail_node
elem_stiffness[we:we + n_elem_tail] = 7
elem_mass[we:we + n_elem_tail] = 7
boundary_conditions[wn + n_node_tail - 1 -1] = -1
end_tip_tail_nodeC[1] = wn + n_node_tail - 1 - 1
end_tip_tail_elemC[1] = we + n_elem_tail - 1
# import pdb; pdb.set_trace()
we += n_elem_tail
wn += n_node_tail - 1
else:
beam_number[we:we + n_elem_tail] = 7
tail_beam_numbersC[1] = 7
x[wn:wn + n_node_tail - 1] = x[wn - 1]
y[wn:wn + n_node_tail - 1] = y[wn - 1] + np.linspace(0.0, span_ctail_R, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_tail] = 8
elem_mass[we:we + n_elem_tail] = 8
boundary_conditions[wn + n_node_tail - 1 - 1] = -1
end_tip_tail_nodeC[0] = wn + n_node_tail - 1 - 1
end_tip_tail_elemC[0] = we + n_elem_tail - 1
we += n_elem_tail
wn += n_node_tail - 1
beam_number[we:we + n_elem_tail] = 8
tail_beam_numbersC[2] = 8
x[wn:wn + n_node_tail - 1] = x[end_of_centre_tail_node]
y[wn:wn + n_node_tail - 1] = y[end_of_centre_tail_node] + np.linspace(0.0, -span_ctail_L, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
conn[we, 0] = end_of_centre_tail_node
elem_stiffness[we:we + n_elem_tail] = 7
elem_mass[we:we + n_elem_tail] = 7
boundary_conditions[wn + n_node_tail - 1 -1] = -1
end_tip_tail_nodeC[1] = wn + n_node_tail - 1 - 1
end_tip_tail_elemC[1] = we + n_elem_tail - 1
# import pdb; pdb.set_trace()
we += n_elem_tail
wn += n_node_tail - 1
# outer tail 0R
beam_number[we:we + n_elem_outer_tail] = 9
tail_beam_numbersR[0,0] = 9
x[wn:wn + n_node_outer_tail - 1] = np.linspace(0.0, length_outer_tail, n_node_outer_tail)[1:]
y[wn:wn + n_node_outer_tail - 1] = y[end_nodesR[0]]
for ielem in range(n_elem_outer_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [0.0, 1.0, 0.0]
conn[we, 0] = end_nodesR[0]
elem_stiffness[we:we + n_elem_outer_tail] = 6
elem_mass[we:we + n_elem_outer_tail] = 6
we += n_elem_outer_tail
wn += n_node_outer_tail - 1
end_tails_nodesR[0] = wn - 1
end_tails_elementsR[0] = we - 1
beam_number[we:we + n_elem_tail] = 10
tail_beam_numbersR[0,1] = 10
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesR[0]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesR[0]] + np.linspace(0.0, span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_tail] = 8
elem_mass[we:we + n_elem_tail] = 8
boundary_conditions[wn + n_node_tail - 1 -1] = -1
we += n_elem_tail
wn += n_node_tail - 1
beam_number[we:we + n_elem_tail] = 11
tail_beam_numbersR[0,2] = 11
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesR[0]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesR[0]] + np.linspace(0.0, -span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
conn[we, 0] = end_tails_nodesR[0]
elem_stiffness[we:we + n_elem_tail] = 7
elem_mass[we:we + n_elem_tail] = 7
boundary_conditions[wn + n_node_tail - 1 -1] = -1
we += n_elem_tail
wn += n_node_tail - 1
# outer tail 1R
beam_number[we:we + n_elem_outer_tail] = 12
tail_beam_numbersR[1,0] = 12
x[wn:wn + n_node_outer_tail - 1] = np.linspace(0.0, length_outer_tail, n_node_outer_tail)[1:]
y[wn:wn + n_node_outer_tail - 1] = y[end_nodesR[1]]
for ielem in range(n_elem_outer_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [0.0, 1.0, 0.0]
conn[we, 0] = end_nodesR[1]
elem_stiffness[we:we + n_elem_outer_tail] = 6
elem_mass[we:we + n_elem_outer_tail] = 6
we += n_elem_outer_tail
wn += n_node_outer_tail - 1
end_tails_nodesR[1] = wn - 1
end_tails_elementsR[1] = we - 1
beam_number[we:we + n_elem_tail] = 13
tail_beam_numbersR[1,1] = 13
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesR[1]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesR[1]] + np.linspace(0.0, span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_tail] = 8
elem_mass[we:we + n_elem_tail] = 8
boundary_conditions[wn + n_node_tail - 1 -1] = -1
we += n_elem_tail
wn += n_node_tail - 1
beam_number[we:we + n_elem_tail] = 14
tail_beam_numbersR[1,2] = 14
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesR[1]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesR[1]] + np.linspace(0.0, -span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
conn[we, 0] = end_tails_nodesR[1]
elem_stiffness[we:we + n_elem_tail] = 7
elem_mass[we:we + n_elem_tail] = 7
boundary_conditions[wn + n_node_tail - 1 -1] = -1
we += n_elem_tail
wn += n_node_tail - 1
# outer tail 0L
beam_number[we:we + n_elem_outer_tail] = 15
tail_beam_numbersL[0,0] = 15
x[wn:wn + n_node_outer_tail - 1] = np.linspace(0.0, length_outer_tail, n_node_outer_tail)[1:]
y[wn:wn + n_node_outer_tail - 1] = y[end_nodesL[0]]
for ielem in range(n_elem_outer_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [0.0, 1.0, 0.0]
conn[we, 0] = end_nodesL[0]
elem_stiffness[we:we + n_elem_outer_tail] = 6
elem_mass[we:we + n_elem_outer_tail] = 6
we += n_elem_outer_tail
wn += n_node_outer_tail - 1
end_tails_nodesL[0] = wn - 1
end_tails_elementsL[0] = we - 1
beam_number[we:we + n_elem_tail] = 16
tail_beam_numbersL[0,1] = 16
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesL[0]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesL[0]] + np.linspace(0.0, span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
conn[we, 0] = end_tails_nodesL[0]
elem_stiffness[we:we + n_elem_tail] = 8
elem_mass[we:we + n_elem_tail] = 8
boundary_conditions[wn + n_node_tail - 1 - 1] = -1
we += n_elem_tail
wn += n_node_tail - 1
beam_number[we:we + n_elem_tail] = 17
tail_beam_numbersL[0,2] = 17
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesL[0]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesL[0]] + np.linspace(0.0, -span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
conn[we, 0] = end_tails_nodesL[0]
elem_stiffness[we:we + n_elem_tail] = 7
elem_mass[we:we + n_elem_tail] = 7
boundary_conditions[wn + n_node_tail - 1 - 1] = -1
we += n_elem_tail
wn += n_node_tail - 1
# outer tail 1L
beam_number[we:we + n_elem_outer_tail] = 18
tail_beam_numbersL[1,0] = 18
x[wn:wn + n_node_outer_tail - 1] = np.linspace(0.0, length_outer_tail, n_node_outer_tail)[1:]
y[wn:wn + n_node_outer_tail - 1] = y[end_nodesL[1]]
for ielem in range(n_elem_outer_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [0.0, 1.0, 0.0]
conn[we, 0] = end_nodesL[1]
elem_stiffness[we:we + n_elem_outer_tail] = 6
elem_mass[we:we + n_elem_outer_tail] = 6
we += n_elem_outer_tail
wn += n_node_outer_tail - 1
end_tails_nodesL[1] = wn - 1
end_tails_elementsL[1] = we - 1
beam_number[we:we + n_elem_tail] = 19
tail_beam_numbersL[1,1] = 19
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesL[1]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesL[1]] + np.linspace(0.0, span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [-1.0, 0.0, 0.0]
elem_stiffness[we:we + n_elem_tail] = 8
elem_mass[we:we + n_elem_tail] = 8
boundary_conditions[wn + n_node_tail - 1 -1] = -1
we += n_elem_tail
wn += n_node_tail - 1
beam_number[we:we + n_elem_tail] = 20
tail_beam_numbersL[1,2] = 20
x[wn:wn + n_node_tail - 1] = x[end_tails_nodesL[1]]
y[wn:wn + n_node_tail - 1] = y[end_tails_nodesL[1]] + np.linspace(0.0, -span_tail, n_node_tail)[1:]
for ielem in range(n_elem_tail):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))
for inode in range(n_node_elem):
frame_of_reference_delta[we + ielem, inode, :] = [1.0, 0.0, 0.0]
conn[we, 0] = end_tails_nodesL[1]
elem_stiffness[we:we + n_elem_tail] = 7
elem_mass[we:we + n_elem_tail] = 7
boundary_conditions[wn + n_node_tail - 1 -1] = -1
we += n_elem_tail
wn += n_node_tail - 1
# vertical fins (pods)
# centre one
beam_number[we:we + n_elem_fin] = 21
fin_beam_numberC = 21
x[wn:wn + n_node_fin - 1] = x[0]
y[wn:wn + n_node_fin - 1] = y[0]
z[wn:wn + n_node_fin - 1] = z[0] + np.linspace(0.0, -span_fin, n_node_fin)[1:]
for ielem in range(n_elem_fin):
conn[we + ielem, :] = ((np.ones((3, ))*(we + ielem)*(n_node_elem - 1)) + np.array([0, 2, 1]))