Ansys Mechanical: All About Joints

Defining & post processing joints with MAPDL

Steve Kiefer
8 min readJul 4, 2020
Image by Pavlofox from Pixabay

Ansys is a commercial Finite Element Analysis (FEA) package with a robust set of structural analysis tools. One unique feature of the Ansys structural solver is the ability to script commands using simple comma-delimited Mechanical Ansys Parametric Design Language (MAPDL) commands. Whether using the Ansys classic interface or the modern Ansys Mechanical via the Workbench interface, MAPDL can be very useful for pre-processing models and/or post-processing results. This article covers some MAPDL commands to export joint element forces & moments as well as some strategies for working with joints in Ansys Mechanical.

Why Joints?

What I am describing as a joint is connection element referred to as ‘joint’ in the Ansys Mechanical interface. Under the hood these are elements comprised of two (usually coincident) nodes with orientation defined by one or more local coordinate systems. The primary joint elements are the MPC184 and COMBI250elements. Rigid, none-to-node connections can also be defined byTARG170 elements. Joints are great for a couple of reasons:

  • Joints can abstract away complicated mechanisms down to a simple set of stiffness values
  • Joints provide a means to extract loads at specific interfaces for additional / detailed analyses in other models (eg sub assemblies)
  • Joint stiffness & damping can be used to tune in dynamic / loads models when correlating to static or dynamic tests

Defining Joints in Ansys Mechanical

When using Ansys Mechanical most Joints are created between Remote Points. The underlying Joint element is a 2-noded (coincident) element and typically you want to connect 2 portions of the model that may have many nodes, eg the surface of a hole or edge. If you are familiar with Nastran, Remote Points are basically RBE2 (rigid) and RBE3 (deformable) MPCs. In Ansys Classic these are referred to as Surface Based Constraints and are complicated to define and prone to error as they use a special subset of Key Options of the contact and target elements. The documentation is also not that clear. However, in Ansys Mechanical they are a breeze to create and you don’t have to worry about the underlying commands.

Another thing to remember is the 2-noded joint element itself actually resides at the coordinate system origin of the reference Remote Point. If you want a joint to model a pin connection that is offset from the modeled geometry, then you would place the coordinate system of the Joint on the axis of the pin.

There are several ways to create joints connected to the model via remote points.

  1. Define a Joint using the Geometry Scoping Method and Applied By set to Remote Attachment. This automatically creates underlying remote points that can be exposed if you right-click and select ‘Promote to Remote Point’
  2. Pre-create the Remote Points and when defining the Joint select Remote Point as the Scoping Method.
  3. Using Named Selections and the Automation-> Object Generator Tool.

The first option works well if you want it done quickly and are OK with the joint coordinate system being at the centroid of the Reference & Mobile geometries. The 2nd option is useful if you want to control the location of the coordinate system or are using Free-Standing Remote Points. The 3rd option is great when there are a lot of similar joints to create. A typical use-case for the Object Generator is for bolted assemblies. The joints typically default to the Fixed type.

A joint created between 2 Remote Points with default settings

Enhancing Joint Definition with MAPDL

Now we have a basic Joint and its time to set the properties. Joints really shine when we add stiffness to them. They then act similarly to CBUSH elements in Nastran. To add stiffness you set the Joint Type to Bushing. Once set a worksheet will show up where stiffness & damping terms in various degrees of freedom can be entered. I find this interface to be a little awkward and slow. I prefer to cut/paste plain text to copy inputs. Enter the Command Snippet! When Ansys Mechanical creates the input deck that eventually goes to the solver it does so sequentially, generally top to bottom of the tree. When you enter a Command Snippet under an object you can add MAPDL commands that manipulate that object using the generic ID parameters eg _jid for the Element Type etc of a joint. I usually set the joint Type to Generic and set all DOFs to ‘Free’ when using Command Snippets with Joints.

Command Snippet Attached to a Joint Object

There are a few flavors of Command Snippets I use with Joints. The first is to define linear stiffness properties using the MPC184 element. Here I define the 6 diagonal stiffness terms and using the TB commands assign them to the joint using the _jid ID parameter. I only need to change the K_* parameters and usually leave the commands below untouched.

COmmand Snippet for Assigning Linear Stiffness MPC184 Joint

Sometimes I use non-linear stiffness with the MPC184 Joint. I typically use non-linear stiffness to model friction slipping or compression only connections but have found other use cases from time to time.

Non Linear Stiffness Command Snippet (Compression only for UZ) for MPC184 Joint

Now I like the MPC184 elements as Joints. But as their name implies they are MPCs. They are Lagrange MPCs and because of their formulation you cannot define boundary conditions or forces on nodes attached to MPC184 elements the same you would on typical structural elements. MPC184 joints have their own special loads that operate on ‘Free’ Degrees of Freedom (which include Degrees of Freedom with stiffness). Where I typically have to ditch the MPC184 element is at locations modeling interface stiffness. I usually want to apply displacement boundary conditions on the far side of the interface stiffness from the component or assembly I am analyzing. Ansys recently added a new element type COMBI250 that is very similar to Nastran’s CBUSH and is a structural element (not an MPC) and can have the usual boundary conditions applied to its nodes. In order to get Ansys to create a COMI250 element (so that it can be modified as desired in the Command Snippet) set the Joint Type to Bushing and set the Formulation to Bushing. I also set the Element Coordinate System to the Reference Remote Point Coordinate system for consistency.

MAPDL Command Snippet for COMBI250 Joint Stiffness

Post Processing Joints

Ansys Mechanical has Joint Probes, specific post-processing objects for reviewing individual joints. It works well for 1 or 2 joints or a quick check, but can be tedious when trying to post process many joints. My main workflow is to export joint forces to text files with multiple joints per file, grouped in a way that makes sense for the assembly. I avoid mixing COMBI250 joints with MPC184 Joints to facilitate exporting.

Before I can export Joint forces and moments I need a way to collect the Joint IDs. There are 2 main ways i go about collecting the joints.

  1. Collecting Element Types in Array parameters using Command Snippets attached to the Joints
  2. Using the Element APDL Name feature of each Joint in the Properties window of the Joint.

I typically use the first method if I have a lot of joints in 1 group. In the first Joint of the Group (top most in the tree) I add the following MAPDL commands.

MAPDL partial Command Snippet to collect joint element IDs

In each subsequent joint of that group I delete the array definition section and let each joint add its Element Type ID to the array parameter, incrementing the idx parameter at each Joint.

Exporting Joint Forces to a Text File

Now its time to export! To do so I add Command Snippets under the Solution object of the analysis. One Command Snippet per joint group.

Here is a complete Command Snippet for exporting MPC184 element forces. Lets walk through it!

In this first section I enter the POST26 processor define the start of the file name and assign a string of the name of the element ID array for this joint group that was either built up in Command Snippets attached to the Joints or in another Command Snippet before this one. Then I use the %parrameter_name% syntax to get the length of the element ID array. I then get the solver directory, date, time, and active unit system. I then build the header. I am using *VWRITE in a slightly differnet way than usual here. Instead of using *CFOPEN I am using the /NOPR command to suppress echo output and outputting to the file using /output, <file>. This lets me write more columns to the text file. After writing the header I issue the /output command to go back to the default output and the /GOPR to echo to the solve.out file. Notice the \b in the *vwrite syntax for appending the next *vwrite to this same line!

Here we enter the loop for each joint element in this array. We initialize some variables (including the OutVars array), we get the nodes an location of the element centroid, then we fill OutVars with these parameters that are just repeated for each load set.

Next we collect the various MPC184 forces and moments (keeping imaginary and real components) add them all up and assign them to columns of the OutVars array. If the eID doesn’t exist then it fills the positions in OutVars with 0.

Before exiting the loop we setup writing to the text file again with the /NOPR, and /output commands. Then we use *mwrite to export the OutVars array in the jik sequence that corresponds to how we willed the array. Then we exit the loop and processor.

(Empty) Joint Results File Output

There we have it a wide text file filled with joint forces ready to be further processed outside of Ansys.

Here is a complete Command Snippet for COMBI250 elements which is very similar to the MPC184 commands we walked through above. The changes are mostly for the esol commands to match the output variables SMISC positions for the COMBI250 element type.

Well that is it for now. In a future post ill cover ways to post-process these joint force text files using Python. I hope this helps you on your Joint analysis adventures!

Check out these other Ansys MAPDL related stories:

--

--