Beijing Institute of Technology | Ming-Jian Li
The following APDL code is a companion code for the course on Artificial Intelligence and Simulation Science. Its function is to calculate the process of impact energy absorption between the honeycomb structure on the underside of a lunar lander and the lunar surface using the finite element method, utilizing a geometric source file websurf.igs (click to download). The following code needs to be executed in ANSYS, APDL is the parameteric language of ANSYS.
x
2421fini
2/clear
3/FILNAME,moonlander,1
4! by Ming-Jian Li
5/units,SI
6/dscale,1,1.0
7! input geometric model
8/AUX15
9IOPTN,IGES,SMOOTH
10IOPTN,MERGE,NO
11IOPTN,SOLID,NO
12IOPTN,SMALL,NO
13IOPTN,GTOLER,FILE
14IGESIN,'websurf','igs',' '
15/PREP7
16hct=1 ! honeycomb thickness
17rdt=0.05 ! rigid disk thickness
18tch=3 ! truncated cone height
19tcbr=1.98 ! truncated cone bottom radius
20tctr=1.5 ! truncated cone top radius
21tct=0.01 ! truncated cone shell thickness
22asoil=5 !soil dims
23bsoil=5
24tsoil=0.5
25gap=0.1 !gap between soil and structure
26hcsz=0.1 !mesh size
27hctn=10 !mesh div
28tol=1e-6
29hcex=0.3e6 !Young's modulus
30hcmuxy=0.01 !Poisson's raio
31hcdens=270 !eff density
32soilsz=0.2 !mesh size
33vz=-1 !velocity
34! element
35et,1,solid164
36et,2,shell163
37! mat1 honeycomb
38MP,DENS,1,300
39MP,EX,1,0.3e6
40MP,NUXY,1,0.01
41TB,PLAW,1,,,1,
42TBDAT,1,1e4
43TBDAT,2,0.1e6
44TBDAT,3,
45TBDAT,4,40
46TBDAT,5,5
47TBDAT,6,0.5
48TBDAT,7,
49! mat2 shell
50edmp,rigid,2,0,0
51mp,ex,2,2e5
52mp,prxy,2,0.3
53mp,dens,2,37700
54R,1
55RMODIF,1,1, , ,tct ! shell thickness
56! mat3 soil
57mp,ex,3,12E6
58mp,prxy,3,0.3
59mp,dens,3,1600
60! mat4 rigid disk
61edmp,rigid,4,0,0
62mp,ex,4,2e5
63mp,prxy,4,0.3
64mp,dens,4,27700
65! mat5 rigid ground
66edmp,rigid,5,7,7
67mp,ex,5,12E6
68mp,prxy,5,0.3
69mp,dens,5,1600
70! change mm into m
71arscale,all, , ,0.001,0.001,0.001, ,1,1
72! move upward
73agen,2,all, , ,0,0,hct, , 0,1
74! merge lines
75numcmp,kp
76numcmp,line
77lcomb,1,2
78lcomb,3,4
79lcomb,6,7
80lcomb,11,12
81lcomb,13,14
82lcomb,16,17
83lcomb,19,20
84lcomb,22,23
85lcomb,24,25
86lcomb,30,31
87lcomb,32,33
88lcomb,35,36
89lcomb,38,39
90lcomb,41,42
91lcomb,43,44
92lcomb,48,49
93numcmp,all
94! add the rest of the surf
95*get,lmx,line,,count
96*get,amx,area,,count
97l,15,17
98al,15,16,lmx+1
99l,11,14
100al,11,12,13,lmx+2
101l,6,10
102al,6,7,8,9,lmx+3
103l,4,5
104al,4,lmx+4
105l,21,23
106al,21,22,lmx+5
107l,24,27
108al,24,25,26,lmx+6
109l,28,32
110al,28,29,30,31,lmx+7
111l,33,34
112al,33,lmx+8
113*get,kmx,kp,,count
114k,kmx+1,0,0,hct
115l,kmx+1,1
116l,kmx+1,3
117al,lmx+9,lmx+10,1,2
118alls
119! extrude honey comb & rigid disk
120alls
121lesize,all,hcsz
122lesize,lmx+9,,,2
123lesize,lmx+10,,,2
124vext,1,,,0,0,-hct
125vext,1,10,,0,0,rdt
126lsel,s,loc,z,-tol,hct-tol
127lesize,all,,,hctn
128lsel,s,loc,z,hct+tol,hct+rdt-tol
129lesize,all,,,1
130! honeycomb & rigid disk mesh
131alls
132vsel,s,,,1
133vatt,1,,1
134vsweep,all
135vsel,s,,,2,11
136vatt,4,,1
137vsweep,all
138! truncated cone
139alls
140*get,kmx,kp,,count
141*get,lmx,line,,count
142lgen,2,18,19, ,0,0,tch, , 1,0
143lsscale,lmx+1,lmx+2,,tctr/tcbr,tctr/tcbr,0,,1,1
144k,kmx+4,0,0,hct+tch
145l,kmx+1,kmx+4
146l,kmx+3,kmx+4
147al,lmx+1,lmx+2,lmx+4,lmx+3
148rdis=0.2
149lgen,2,18,19, ,0,0,tch*rdis, , 1,0
150ratio=tctr/tcbr+(1-tctr/tcbr)*(1-rdis)
151lsscale,lmx+5,lmx+6,,ratio,ratio,0,,1,1
152rdis=0.4
153lgen,2,18,19, ,0,0,tch*rdis, , 1,0
154ratio=tctr/tcbr+(1-tctr/tcbr)*(1-rdis)
155lsscale,lmx+7,lmx+8,,ratio,ratio,0,,1,1
156l,kmx+5,87
157l,kmx+6,88
158l,kmx+7,89
159l,kmx+5,kmx+8
160l,kmx+6,kmx+9
161l,kmx+7,kmx+10
162l,kmx+1,kmx+8
163l,kmx+2,kmx+9
164l,kmx+3,kmx+10
165al,130,lmx+9,lmx+5,lmx+10
166al,131,lmx+10,lmx+6,lmx+11
167al,lmx+5,lmx+12,lmx+7,lmx+13
168al,lmx+6,lmx+13,lmx+8,lmx+14
169al,lmx+7,lmx+15,lmx+1,lmx+16
170al,lmx+8,lmx+16,lmx+2,lmx+17
171! truncated cone mesh size
172lsel,s,loc,z,hct+rdt+tol,hct+tch-tol
173lesize,all,,,3
174alls
175lesize,lmx+5,,,4,,1
176lesize,lmx+6,,,4,,1
177lesize,lmx+7,,,2,,1
178lesize,lmx+8,,,2,,1
179lesize,lmx+1,,,2,,1
180lesize,lmx+2,,,2,,1
181lesize,lmx+3,,,3,,1
182lesize,lmx+4,,,3,,1
183! truncated cone rigid shell mesh
184asel,s,loc,z,hct+rdt+tol,hct+tch+tol
185aatt,2,1,2
186amesh,all
187! complete whole model
188alls
189csys,1
190vgen,12,all, , ,0,30,0, , 0,0
191asel,s,loc,z,hct+rdt+tol,hct+tch+tol
192agen,12,all, , ,0,30,0, , 0,0
193csys,0
194! moon soil
195alls
196block,-asoil/2,asoil/2,-bsoil/2,bsoil/2,-gap,-gap-tsoil
197*get,vmax,volu,,count
198vsel,s,,,vmax
199vatt,3,,1
200allsel,below,volu
201lesize,all,soilsz
202vmesh,all
203alls
204! merge nodes
205alls
206nummrg,node,1e-9
207alls
208*get,nodnum,node,,count
209*get,enum,elem,,count
210!create parts
211!part 1 honeycomb,2 rigid disk, 3 rigid truncated cone ,4 soil
212edpart,create,
213! merge rigid bodies
214edcrb,add,,2,3,
215! contact
216nsel,s,loc,z,-tol,tol
217cm,body,node
218nsel,s,loc,z,-gap-tol,-gap+tol
219cm,ground,node
220alls
221edcgen,ESTS,1,4,
222edcontact,10,0,2,0,1,1,1,4,0
223nsel,s,loc,z,-tol,hct+tch+tol
224cm,vehicle,node
225edve,velo,vehicle,0,0,vz
226*dim,time,array,2,1
227*dim,accz,array,2,1
228accz(1)=9.8/6
229accz(2)=9.8/6
230time(1)=0
231time(2)=100
232edload,add,ACLZ,,vehicle,time,accz,0
233/sol
234nsel,s,loc,z,-gap-tsoil-tol,-gap-tsoil+tol
235d,all,ux,0
236d,all,uy,0
237d,all,uz,0
238alls
239time,0.5
240solve
The result is as follows.