Demo091224 / apdl_generator /apdl_plate.py
SuriRaja's picture
Update apdl_generator/apdl_plate.py
d70ce0c verified
raw
history blame contribute delete
510 Bytes
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"