Introduction to Ansys APDL Programming — Easy Hand-on Bar Example of Learning APDL

Beautiful sunset at McGraw Tower, Cornell University
  • Create geometry in the preprocessor (/PREP7 )
  • Define material properties and element attributes (For mechanical analysis: Poisson’s ratio, density, elastic modulus. For element attribute such as element types)
  • Mesh the model (Global and local mesh are allowed)
  • Impose Dirichlet Boundary Conditions and Neuman Boundary Conditions (that is, boundary conditions and loads)
  • Solve for displacement (/SOLVE)
  • Post-processing to obtain nodal solution and result plots (/POST1)
Applied a load on green side of the bar, and clamp another side of the bar (orange)
! Clear the previous result 
FINISH
/CLEAR
/PREP7
! Element type and material properties
ET, 1, 187 ! ElementType, 1, ElementTypeNumber
MP, EX, 1, 10E6 ! Material Properties: Young's Modulus
MP, NUXY, 1, .3 ! Material Properties: Poisson's ratio
! Geometry and element type
BLOCK, 0, 10, 0, 100, 0, 10
! Volumne mesh
VMESH, ALL
! APPLY BOUNDARY CONDITION: Clamp one end (coordinate origin)
NSEL, S, LOC, Y, 0
D, ALL, ALL, 0
! APPLIED LOAD: Load on another end
NSEL, S, LOC, Y, 100 ! Select Y direction 100 side
NSEL, ALL, FY, 100 ! Select all points on the plane
ALLSEL
FINISH ! Solution
/SOLU
/STATUS, SOLU
SOLVE
FINISH
! Post-processing
/POST1
PLNSOL, U, SUM, 0, 1 ! Solve for displacement
Solution derived from the above code
By using DIST(P) command, we are able to manually select the nodes and obtain the distance
  1. https://www.youtube.com/c/FemExpert
  2. https://www.youtube.com/watch?v=qx69C-UyxsE&list=PLtt6-ZgUFmMKFfbOBhmCwG30KIVyvhDop
  3. https://courses.ansys.com/index.php/courses/intro-to-ansys-mechanical-apdl-scripting/

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store