File size: 435 Bytes
85e24e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f289a7d
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
def generate_beam_apdl(length, width, thickness, load):
    apdl_script = f"""
/PREP7
MP,EX,1,2E11
MP,PRXY,1,0.3
BLOCK,0,{length},0,{width},0,{thickness}
ET,1,SOLID185
ESIZE,5
VMESH,ALL
NSEL,S,LOC,X,0
D,ALL,ALL
NSEL,S,LOC,X,{length}
F,ALL,FY,-{load}
/SOLU
ANTYPE,STATIC
SOLVE
/POST1
PRNSOL,S,EQV
PRNSOL,U,SUM
/EXIT
"""
    with open("beam_simulation.inp", "w") as file:
        file.write(apdl_script)
    return "beam_simulation.inp"