Spaces:
Sleeping
Sleeping
File size: 510 Bytes
463cfd5 d70ce0c |
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 26 27 |
def generate_plate_apdl(thickness, length, width, hole_diameter, force):
apdl_script = f"""
/PREP7
MP,EX,1,2E11
MP,PRXY,1,0.3
BLOCK,0,{length},0,{width},0,{thickness}
CYLIND,0,{hole_diameter/2},0,0,{thickness}
VSUB,ALL
ET,1,SOLID185
ESIZE,5
VMESH,ALL
NSEL,S,LOC,Z,0
D,ALL,ALL
NSEL,S,LOC,Z,{thickness}
F,ALL,FY,-{force}
/SOLU
ANTYPE,STATIC
SOLVE
/POST1
PRNSOL,S,EQV
PRNSOL,U,SUM
/EXIT
"""
with open("plate_simulation.inp", "w") as file:
file.write(apdl_script)
return "plate_simulation.inp"
|