Spaces:
Sleeping
Sleeping
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" | |