General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

How to use apdl script to setup mechanical project

    • me262
      Subscriber

      Hi,

      I'm trying to understand how to use APDL to solve a simple dice-shaped volume. I just need to understand the basics.

      I put my script inside the Mechanical solution section and set an area as a fixed boundary condition and an area force on the opposite side. The geometry is imported as an IGES file.

      The .iges file gets imported, but the geometry section in the tree is still empty, therefore I need to link the geometry inside Workbench to the mechanical analysis. But why? It should be done by the APDL script itself.

      Furthermore, Mechanical tells me to add at least one structural load in the tree on the left side manually to make it work, but I did that via APDL?

      Inside MAPDL, it's working so far, but inside Mechanical, it is not. So what did I miss?

      /PREP7
      et,1,SOLID185
      MP,ex,1,10E6
      MP,NUXY,1,.3

      surface_count = 3

      *dim,str_path,String,128,4
      str_path(1,1) = 'C:\\Users\\xxxxx\\'
      str_path(1,2) = 'model_thickness_'

      *dim, temp1, string, 128
      temp1(1,1) = strcat(str_path(1,1),str_path(1,2))

      str_path(1,3) = CHRVAL(10)

      *dim, iges_filename, string, 128

      iges_filename(1,1) =  strcat(temp1(1,1),str_path(1,3))

      CDREAD,solid, iges_filename(1,1), iges
      *status, all

      *status, all

      vmesh, all
      *status, all
      *get, num_mesh_nodes, node, 0, count
      *get, num_mesh_elements, elem, 0, count

      NSEl,S,LOC,X,10
      D,ALL,UX
      D,ALL,UY
      D,ALL,UZ
      NSEL,S,LOC,X,-10
      F,ALL,FX,-10
      ALLSEL,ALL
      FINISH

      /SOLU
      SOLVE
      FINISH

    • Gary Stofan
      Ansys Employee

       The Workbench Mechanical application (i.e Static Structural) only uses the APDL as a solver.
       It is not possible for the Tree to be created from APDL code. 
       

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.