karthikmn commited on
Commit
b0cf737
·
verified ·
1 Parent(s): ca548ed

Create apdl_generator/apdl_plate.py

Browse files
Files changed (1) hide show
  1. apdl_generator/apdl_plate.py +26 -0
apdl_generator/apdl_plate.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def generate_plate_apdl(thickness, length, width, hole_diameter, force):
2
+ apdl_script = f"""
3
+ /PREP7
4
+ MP,EX,1,2E11
5
+ MP,PRXY,1,0.3
6
+ BLOCK,0,{length},0,{width},0,{thickness}
7
+ CYLIND,0,{hole_diameter/2},0,0,{thickness}
8
+ VSUB,ALL
9
+ ET,1,SOLID185
10
+ ESIZE,5
11
+ VMESH,ALL
12
+ NSEL,S,LOC,Z,0
13
+ D,ALL,ALL
14
+ NSEL,S,LOC,Z,{thickness}
15
+ F,ALL,FY,-{force}
16
+ /SOLU
17
+ ANTYPE,STATIC
18
+ SOLVE
19
+ /POST1
20
+ PRNSOL,S,EQV
21
+ PRNSOL,U,SUM
22
+ /EXIT
23
+ """
24
+ with open("plate_simulation.inp", "w") as file:
25
+ file.write(apdl_script)
26
+ return "plate_simulation.inp"