jithenderchoudary commited on
Commit
5c82f7b
·
verified ·
1 Parent(s): 2bc3152

Update apdl_generator/apdl_beam.py

Browse files
Files changed (1) hide show
  1. apdl_generator/apdl_beam.py +24 -0
apdl_generator/apdl_beam.py CHANGED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def generate_beam_apdl(length, width, thickness, load):
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
+ ET,1,SOLID185
8
+ ESIZE,5
9
+ VMESH,ALL
10
+ NSEL,S,LOC,X,0
11
+ D,ALL,ALL
12
+ NSEL,S,LOC,X,{length}
13
+ F,ALL,FY,-{load}
14
+ /SOLU
15
+ ANTYPE,STATIC
16
+ SOLVE
17
+ /POST1
18
+ PRNSOL,S,EQV
19
+ PRNSOL,U,SUM
20
+ /EXIT
21
+ """
22
+ with open("beam_simulation.inp", "w") as file:
23
+ file.write(apdl_script)
24
+ return "beam_simulation.inp"