The APDL Commands You Must Know to Enhance Your Efficiency

The APDL Commands You Must Know to Enhance Your Efficiency

点击此处查看 ✿水哥原创ANSYS视频教程清单 ✿


This article summarizes commonly used APDL internal functions. Internal functions, through specific commands, return certain function values based on user input variables. Proper use of internal functions can greatly improve operational efficiency, achieving more with less effort. These APDL functions are sourced from the ANSYS help documentation.

  1. Degree and Radian Conversion

    • AFUN: By default, in radians. Use this command to switch to degrees.
  2. Mathematical Functions

    • ABS(X): Returns the absolute value of X.
    • SIGN(X,Y): Returns the sign of Y multiplied by the absolute value of X. If Y is 0, the result is positive.
    • EXP(X): Returns e raised to the power of X.
    • LOG(X): Returns the natural logarithm of X.
    • LOG10(X): Returns the base 10 logarithm of X.
    • SQRT(X): Returns the square root of X.
    • NINT(X): Rounds X to the nearest integer, considering rounding.
    • MOD(X,Y): Returns the remainder of X divided by Y.
    • RAND(X,Y): Returns a random number between X and Y following a uniform distribution.
    • GDIS(X,Y): Returns a random number following a normal distribution with mean X and standard deviation Y.
    • SIN(X), COS(X), TAN(X): Trigonometric functions. Default X is in radians, switch to degrees using the *AFUN command.
    • SINH(X), COSH(X), TANH(X): Hyperbolic sine, cosine, and tangent functions.
    • ASIN(X), ACOS(X), ATAN(X): Inverse trigonometric functions.
    • ATAN2(Y,X): Returns the arctangent of Y/X.
  3. String Array Functions

    • UPASE(CPARM): Returns the uppercase string of CPARM.
    • LWCASE(CPARM): Returns the lowercase string of CPARM.
  4. Selection Functions

    • (K,L,V,A,N,E)SEL: Selects elements based on category.
    • (K,L,V,A,N,E)SL(L,V,A,N,E): Selects other types of elements on existing geometry sets, e.g., NSLE selects nodes on the current element.
  5. Next Element Numbering

    • NDNEXT(N), ELNEXT(E), KPNEXT(K), LSNEXT(L), ARNEXT(A), VLNEXT(V): Returns the next higher number of the specified element type relative to the currently selected set.
  6. Position Coordinate Functions

    • CENTRX(E), CENTRY(E), CENTRZ(E): Returns the XYZ coordinates of the centroid of element E in the global coordinate system.
    • NX(N), NY(N), NZ(N): Returns the XYZ coordinates of node N in the current active coordinate system.
    • KX(K), KY(K), KZ(K): Returns the XYZ coordinates of keypoint K in the current active coordinate system.
  7. Element Number Based on Coordinates

    • NODE(X,Y,Z): Returns the nearest node number to the coordinates (X,Y,Z) in the current active coordinate system.
    • KP(X,Y,Z): Returns the nearest keypoint number to the coordinates (X,Y,Z) in the current active coordinate system.
  8. Distance Calculation

    • DISTND(N1,N2), DISTKP(K1,K2), DISTEN(E,N): Returns the distance between nodes, keypoints, or element centroids.
  9. Angle Query Functions

    • ANGLEN(N1,N2,N3), ANGLEK(K1,K2,K3): Returns the angle between lines defined by nodes or keypoints.
  10. Nearest Element Functions

    • NNEAR(N), KNEAR(K), ENEARN(N): Returns the nearest node, keypoint, or element number.
  11. Area Calculation Functions

    • AREAND(N1,N2,N3), AREAKP(K1,K2,K3), ARNODE(N): Returns the area of triangles or the area assigned to a node.
  12. Normal Vector Functions

    • NORMNX(N1,N2,N3), NORMNY(N1,N2,N3), NORMNZ(N1,N2,N3), NORMKX(K1,K2,K3), NORMKY(K1,K2,K3), NORMKZ(K1,K2,K3): Returns the direction cosines of the normal vectors of the planes defined by nodes or keypoints.
  13. Element Connection Query Functions

    • ENEXTN(N,LOC), NELEM(E,NPOS): Returns the element number connected to a node or the node number of an element.
  14. Element Property Query Functions

    • EATT(E,VAL), RCON(R,LOC): Returns specific properties of elements or real constants.
  15. Nodal Result Functions

    • UX(N), UY(N), UZ(N), ROTX(N), ROTY(N), ROTZ(N), TEMP(N): Returns nodal displacements, rotations, or temperature.

These are some commonly used internal functions in APDL. If you have any questions about the explanations of certain commands, you can refer to the Help documentation for specific details. Feel free to add any practical commands not mentioned in the comments section.



© 版权声明
点赞0赞赏 分享
评论 抢沙发