Skip to content

Commit

Permalink
organize BUG model
Browse files Browse the repository at this point in the history
  • Loading branch information
ACea15 committed Oct 4, 2024
1 parent 804006e commit cb1f0f7
Show file tree
Hide file tree
Showing 8 changed files with 513 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/documentation/examples/industrialAC/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ a time step in the Runge-Kutta solver of 0.005.
```{=org}
#+results: GustXRF3578
```
[file:figs/GustXRF3578.pdf](figs/GustXRF3578.pdf)
[file:figs/GustXRF3578.png](figs/GustXRF3578.png)
The computational times of the different solvers are shown in Table
[2](#table:IndustrialAC_times). The implicit solvers have taken one order of
Expand Down
193 changes: 193 additions & 0 deletions examples/BUG/NASTRAN/DLMs/dlm_model.bdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
$pyNastran: version=msc
$pyNastran: punch=True
$pyNastran: encoding=utf-8
$pyNastran: nnodes=0
$pyNastran: nelements=0
$AERO
$RWing1
CAERO1 10000000 950 2 8 1
15.2407 0. 2.1653 3.2385 15.2407 2.0044 2.1653 3.2385
$RWing2
CAERO1 10010000 950 3 8 1
15.2407 2.0044 2.1653 3.2385 16.0661 5.9289 2.0626 3.1405
$RWing3
CAERO1 10020000 950 9 8 1
16.0661 5.9289 2.0626 3.1405 17.9564 14.916 1.8272 2.9161
$RWing4
CAERO1 10030000 950 6 8 1
17.9571 14.916 1.8272 2.9161 19.9389 21.504 1.6547 1.857
$RWing5
CAERO1 10040000 950 4 8 1
19.9389 21.504 1.6547 1.857 21.2601 25.896 1.5397 1.1509
$RHTP
CAERO1 10050000 950 6 8 1
37.0023 0. 5.9207 3.3784 39.6557 5.8618 5.6268 1.2164
$LWing1
CAERO1 10060000 950 2 8 1
15.2407 0. 2.1653 3.2385 15.2407 -2.0044 2.1653 3.2385
$LWing2
CAERO1 10070000 950 3 8 1
15.2407 -2.0044 2.1653 3.2385 16.0661 -5.9289 2.0626 3.1405
$LWing3
CAERO1 10080000 950 9 8 1
16.0661 -5.9289 2.0626 3.1405 17.9564 -14.916 1.8272 2.9161
$LWing4
CAERO1 10090000 950 6 8 1
17.9571 -14.916 1.8272 2.9161 19.9389 -21.504 1.6547 1.857
$LWing5
CAERO1 10100000 950 4 8 1
19.9389 -21.504 1.6547 1.857 21.2601 -25.896 1.5397 1.1509
$LHTP
CAERO1 10110000 950 6 8 1
37.0023 0. 5.9207 3.3784 39.6557 -5.8618 5.6268 1.2164
$RWing1
PAERO1 950
$RWing2
PAERO1 951
$RWing3
PAERO1 952
$RWing4
PAERO1 953
$RWing5
PAERO1 954
$RHTP
PAERO1 955
$LWing1
PAERO1 956
$LWing2
PAERO1 957
$LWing3
PAERO1 958
$LWing4
PAERO1 959
$LWing5
PAERO1 960
$LHTP
PAERO1 961
$AERO CONTROL SURFACES
$RWing1
AELIST 66600010000000100000011000000210000003100000041000000510000006
1000000710000008100000091000001010000011100000121000001310000014
10000015
$RWing2
AELIST 66600110010000100100011001000210010003100100041001000510010006
1001000710010008100100091001001010010011100100121001001310010014
1001001510010016100100171001001810010019100100201001002110010022
10010023
$RWing3
AELIST 66600210020000100200011002000210020003100200041002000510020006
1002000710020008100200091002001010020011100200121002001310020014
1002001510020016100200171002001810020019100200201002002110020022
1002002310020024100200251002002610020027100200281002002910020030
1002003110020032100200331002003410020035100200361002003710020038
1002003910020040100200411002004210020043100200441002004510020046
1002004710020048100200491002005010020051100200521002005310020054
1002005510020056100200571002005810020059100200601002006110020062
1002006310020064100200651002006610020067100200681002006910020070
10020071
$RWing4
AELIST 66600310030000100300011003000210030003100300041003000510030006
1003000710030008100300091003001010030011100300121003001310030014
1003001510030016100300171003001810030019100300201003002110030022
1003002310030024100300251003002610030027100300281003002910030030
1003003110030032100300331003003410030035100300361003003710030038
1003003910030040100300411003004210030043100300441003004510030046
10030047
$RWing5
AELIST 66600410040000100400011004000210040003100400041004000510040006
1004000710040008100400091004001010040011100400121004001310040014
1004001510040016100400171004001810040019100400201004002110040022
1004002310040024100400251004002610040027100400281004002910040030
10040031
$RHTP
AELIST 66600510050000100500011005000210050003100500041005000510050006
1005000710050008100500091005001010050011100500121005001310050014
1005001510050016100500171005001810050019100500201005002110050022
1005002310050024100500251005002610050027100500281005002910050030
1005003110050032100500331005003410050035100500361005003710050038
1005003910050040100500411005004210050043100500441005004510050046
10050047
$LWing1
AELIST 66600610060000100600011006000210060003100600041006000510060006
1006000710060008100600091006001010060011100600121006001310060014
10060015
$LWing2
AELIST 66600710070000100700011007000210070003100700041007000510070006
1007000710070008100700091007001010070011100700121007001310070014
1007001510070016100700171007001810070019100700201007002110070022
10070023
$LWing3
AELIST 66600810080000100800011008000210080003100800041008000510080006
1008000710080008100800091008001010080011100800121008001310080014
1008001510080016100800171008001810080019100800201008002110080022
1008002310080024100800251008002610080027100800281008002910080030
1008003110080032100800331008003410080035100800361008003710080038
1008003910080040100800411008004210080043100800441008004510080046
1008004710080048100800491008005010080051100800521008005310080054
1008005510080056100800571008005810080059100800601008006110080062
1008006310080064100800651008006610080067100800681008006910080070
10080071
$LWing4
AELIST 66600910090000100900011009000210090003100900041009000510090006
1009000710090008100900091009001010090011100900121009001310090014
1009001510090016100900171009001810090019100900201009002110090022
1009002310090024100900251009002610090027100900281009002910090030
1009003110090032100900331009003410090035100900361009003710090038
1009003910090040100900411009004210090043100900441009004510090046
10090047
$LWing5
AELIST 66601010100000101000011010000210100003101000041010000510100006
1010000710100008101000091010001010100011101000121010001310100014
1010001510100016101000171010001810100019101000201010002110100022
1010002310100024101000251010002610100027101000281010002910100030
10100031
$LHTP
AELIST 66601110110000101100011011000210110003101100041011000510110006
1011000710110008101100091011001010110011101100121011001310110014
1011001510110016101100171011001810110019101100201011002110110022
1011002310110024101100251011002610110027101100281011002910110030
1011003110110032101100331011003410110035101100361011003710110038
1011003910110040101100411011004210110043101100441011004510110046
10110047
$SETS
$RWing1
SET1 666000 1004 2001
$RWing2
SET1 666001 2003 2005 2008 2010
$RWing3
SET1 666002 2012 2014 2016 2018 2020 2022 2024
2026 2028
$RWing4
SET1 666003 2030 2032 2034 2036 2038 2040 2042
$RWing5
SET1 666004 2044 2046 2048 2050 2052
$RHTP
SET1 666005 4000 4001 4002 4003 4004 4005 4006
4007 4008 4009 4010 4011 4012 4013
$LWing1
SET1 666006 100410002001
$LWing2
SET1 66600710002003100020051000200810002010
$LWing3
SET1 66600810002012100020141000201610002018100020201000202210002024
1000202610002028
$LWing4
SET1 66600910002030100020321000203410002036100020381000204010002042
$LWing5
SET1 6660101000204410002046100020481000205010002052
$LHTP
SET1 666011 4000100040011000400210004003100040041000400510004006
10004007100040081000400910004010100040111000401210004013
$REJECT_CARDS
SPLINE6 66600010000000 666000 666000
SPLINE6 66600110010000 666001 666001
SPLINE6 66600210020000 666002 666002
SPLINE6 66600310030000 666003 666003
SPLINE6 66600410040000 666004 666004
SPLINE6 66600510050000 666005 666005
SPLINE6 66600610060000 666006 666006
SPLINE6 66600710070000 666007 666007
SPLINE6 66600810080000 666008 666008
SPLINE6 66600910090000 666009 666009
SPLINE6 66601010100000 666010 666010
SPLINE6 66601110110000 666011 666011
5 changes: 5 additions & 0 deletions examples/BUG/NASTRAN/DMAPs/Dihedral.bdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
COMPILE FREQRS
ALTER 'GUST.*CASES.*DLT.*FRL.*DIT.*QHJL'
DIAGON(20)
$
OUTPUT4 wj,,,,//0/11///8 $
7 changes: 7 additions & 0 deletions examples/BUG/NASTRAN/DMAPs/KMPhi.bdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$$$$ EXTRACT FEM MATRICES $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
DIAG 20
COMPILE SEMODES
ALTER 'CALL.*SUPER3.*CASECC.*CASEM.*PHA1.*LAMA2'
OUTPUT4 PHA,,,,//0/11///20
OUTPUT4 MAA,,,,//0/12///20
OUTPUT4 KAA,,,,//0/13///20
74 changes: 74 additions & 0 deletions examples/BUG/NASTRAN/DMAPs/Qhhj.bdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
$$$$ EXTRACT AERO MATRICES $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ K : AERODYNAMIC DOF = 2 * N AERO BOX
$ A : STRUCTURAL DOF = 6 * N GRID
$ J : N AERO BOX
$ H : N MODES012
$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Retrieve the Spline Matrices form AERO0 and store them in DBALL
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
COMPILE AERO0
ALTER 'CALL.*PLINOUT.*AECASE.*AEBGPDTS.*AEUSETS.*GPGK0.*GDGK0'
EQUIVX GPGK0/SPL_F_AK/ALWAYS
EQUIVX GDGK0/SPL_D_AK/ALWAYS $
CALL DBSTORE SPL_F_AK,,,,//111/112/'DBALL'/0 $
CALL DBSTORE SPL_D_AK,,,,//113/114/'DBALL'/0 $
$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Retrieve the Matrices AJJ D12JK SKJ form PFAERO and store them in DBALL
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
COMPILE PFAERO
ALTER 'AMG.*MKLIST,ACPT/'
TYPE PARM,,I,N,EXIST $
TYPE PARM,,CS,N,CK $
CALL DBFETCH /SPL_F_AK,,,,/111/112/0/0/S,EXIST $
CALL DBFETCH /SPL_D_AK,,,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
$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
PARAML A_JJ//'TRAILER'/1/S,N,COL $
MATGEN ,/ID/1/COL $
FBS L_AJJ,U_AJJ,ID/INVAJJ $
MPYAD S_KJ,INVAJJ,/Q_KJ $
MPYAD SPL_F_AK,Q_KJ,/Q_AJ $
MPYAD Phi_HA,Q_AJ,/Q_HJ $
OUTPUT4 Q_HJ,,,,//0/12///9 $
28 changes: 24 additions & 4 deletions examples/BUG/NASTRAN/read_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import feniax.plotools.nastranvtk.bdfdef as bdfdef
import jax.numpy as jnp
import jax
import numpy as np

bdf = BDF()#debug=False)
bdf.read_bdf("./BUG_103cao.bdf", validate=False)
Expand Down Expand Up @@ -61,7 +62,7 @@
WRITE_ASETS= False
if WRITE_ASETS:
model_red.write_asets("./Config/asets_clamped_reduced.bdf")
WRITE_GRID= True
WRITE_GRID= False
if WRITE_GRID:
model_red.write_grid("../FEM/structuralGrid")

Expand All @@ -82,7 +83,14 @@
RWing3=dict(nspan=9, nchord=8),
RWing4=dict(nspan=6, nchord=8),
RWing5=dict(nspan=4, nchord=8),
RHTP=dict(nspan=6, nchord=8))
RHTP=dict(nspan=6, nchord=8),
LWing1=dict(nspan=2, nchord=8),
LWing2=dict(nspan=3, nchord=8),
LWing3=dict(nspan=9, nchord=8),
LWing4=dict(nspan=6, nchord=8),
LWing5=dict(nspan=4, nchord=8),
LHTP=dict(nspan=6, nchord=8)
)

aeros2ids = dict(RWing1=3504001,
RWing2=3500001,
Expand All @@ -91,7 +99,7 @@
RWing5=3503001,
RHTP=3600001)

PRINT_CAEROS = False
PRINT_CAEROS = True
if PRINT_CAEROS:
for ki, vi in bdfaero.caeros.items():
print(f"*{ki}*-p1: {vi.p1}")
Expand All @@ -104,7 +112,12 @@
aeros[ki]['p4'] = bdfaero.caeros[i].p4
aeros[ki]['x12'] = bdfaero.caeros[i].x12
aeros[ki]['x43'] = bdfaero.caeros[i].x43

ki_l=('L'+ki[1:])
aeros[ki_l]['p1'] = bdfaero.caeros[i].p1*np.array([1.,-1.,1.])
aeros[ki_l]['p4'] = bdfaero.caeros[i].p4*np.array([1.,-1.,1.])
aeros[ki_l]['x12'] = bdfaero.caeros[i].x12
aeros[ki_l]['x43'] = bdfaero.caeros[i].x43

print(sorted(bdfaero.asets[0].ids))
print(bdfaero.Nodes([2001, 2003, 2005, 2008, 2010] + list(range(2012, 2053, 2)))) # wing nodes

Expand All @@ -114,6 +127,13 @@
aeros['RWing4']['set1x'] = list(range(2030, 2044, 2))
aeros['RWing5']['set1x'] = list(range(2044,2053, 2))
aeros['RHTP']['set1x'] = list(range(4000, 4014))
#####
aeros['LWing1']['set1x'] = [1004, 10002001]
aeros['LWing2']['set1x'] = [10002003, 10002005, 10002008, 10002010]
aeros['LWing3']['set1x'] = list(range(10002012, 10002030, 2))
aeros['LWing4']['set1x'] = list(range(10002030, 10002044, 2))
aeros['LWing5']['set1x'] = list(range(10002044,10002053, 2))
aeros['LHTP']['set1x'] = [4000]+list(range(10004001, 10004014))

dlm = GenDLMPanels.from_dict(aeros) # pass your dictionary with DLM model
dlm.build_model()
Expand Down
Loading

0 comments on commit cb1f0f7

Please sign in to comment.