Posts

Showing posts with the label Ansys Classic

Ansys Euler Angle Calculation

Image
Tait-Brian Angles Z-X'-Y''  * After a simulation is complete, it is sometimes useful to know how much the overall object is rotated and translated. This is true especially for rigid body objects. While simple in 2D, it gets more complicated for 3D rotations. Euler angles always makes my head spin. A rotating reference frame? *   Ansys uses the Z-X'-Y'' sequence  for defining the coordinate system but there is also the *GET command to extract the Euler Angles of a Local Coordinate System. So let's say you have 3 nodes on a rigid beam that has been rotated and translated in 3D space. One could do it the hard way by starting with the general definition of R in the Rotation Matrices and go in reverse to get the angles with some fun scripting in your math package of choice. Or... the easy way: define a local coordinate system using NWPLAN at the deformed nodes at each result time step and use the *GET command to extract angles. *dim , MyAngles, ...

Ansys APDL - Some Neat Commands

For those starting out, here's a few commands I find pretty neat. If you're not familiar with them, it's worth checking out. NDNEXT & ELNEXT When looping through a bunch of nodes or elements, this provide some convenience.   /post1     cmsel , s, NodesOfInterest     *get , ncount, node, 0, count     *dim , uxsave,, ncount, 2     nnow = 0     *do ,ct,1,ncount        nnow = ndnext(nnow)       uxsave(ct, 1) = nnow        *get, uxsave(ct, 2), node, nnow, u, x       *enddo   *stat , uxsave Alternately, one could instead use fancier commands:  *VGET with *VMASK   cmsel , s, NodesOfInterest   *get , nmx, node,, num, max    *get , ncount, node,, count      *dim , ndata,, nmx, 3   *dim , nkeep,, ncount, 2       *vget , ndata(1,1), node, 1, nsel   *vfill ,ndata(1,2),ram...

ACT Console

Image
The Humble Hammer Not being very handy around the house, I own a cheap  low cost hammer. But as any pro would tell you, no one uses a hammer for roofing. It is very inefficient and gives you a sore arm. We all want to avoid repeated stress-related injuries (physical and emotional). "Mouse Finger" injury is very real! To mitigate this, Ansys Mechanical has this really cool Automation API. Though intended for ACT debugging and creation, the ACT Console allows the user to input commands that is immediately reflected inside Mechanical. This functions like the Input Line in Ansys Classic! Unfortunately Mechanical only speaks Python and not APDL; so I'm just starting to learn a new language which is hard for an old guy like me. The potential benefits are enormous. Here are some examples: Say you do non-linear analysis 60% of the time and use the the same settings from a mental checklist. Now you could create Python script to automate those clicks.  If you have many t...