I first started contemplating this article on user defined results several weeks ago, and I was planning on somehow working in a Jersey Shore reference. But now that I’ve relocated to Colorado and am recovering from a climbing trip that was a bit above my ability, my creative juices are a little low (they were used up trying to improvise my way up an overhanging roof pitch).
Exploring User Defined Results
Anyways, User Defined results were first introduced in R12 to grant the user access to element table items.
When you insert a user-defined result, you are required to fill in the ‘expression’ line in the details window.
You can look up everything that’s available through the documentation, but we all know that no one reads the instructions
There’s a much easier way to auto-populate the ‘expression’ line…the Worksheet view! To access this, first click on the ‘Solution’ branch and then select ‘Worksheet’ (tab in R12, button in R12.1 and newer). This will show you a list of all the user defined result expressions. Find one you like, right-mouse-click on it and select ‘Create User Defined Result’.
This will insert a ‘User Defined Result’, the only work you need to do is scope it to a body (if necessary). The only ‘tricky’ part of this process is that you need to solve the model first before using the Worksheet view. This is because before the model has been solved, Mechanical doesn’t know what is in the result file. So if the worksheet view is blank or grayed out, it’s because you haven’t solved the model.
So what’s the benefit of using the User Defined Results? Say you wanted to look at total strain, kinetic energy, or reaction force contour plots…just to name a few. In order to view any of those, you would either have to open the .rst file in MAPDL or use the User Defined Result.
Here’s a quick description of the ‘headers’ available on the Worksheet tab.
U | Displacement |
S | Stress |
EPTO | Total Strain |
EPEL | Elastic Strain |
EPPL | Plastic Strain |
EPTT | Thermal Strain |
ENFO | Element Nodal Reaction Forces |
NDIR | Nodal Orientation Values |
There are more headers that are listed in the documentation (I know, we all agreed that was boring). However if you’re looking for items stored in the NMISC or SMISC (for ‘regular’ or contact elements), those are accessible provided you properly format the expression line.
So now let’s go through an example where we actually use this functionality. A customer called in asking how to calculate the volume of a part above a specified stress level. Interesting question…
First we create a user defined result and use the ‘VOLUME’ expression. So we’re half-way there. Next, we need to understand about how the results are stored for a result item in the ‘Solution’ branch. Each contour plot is actually a vector in the form of element/node vs result. You can see this for yourself by right-mouse-clicking on the item in the tree and selecting ‘export’. So right now we have a vector defined of element vs volume. Now we just need another listing of element vs stress.
When you create a stress result in Mechanical, the default behavior is to show the nodal-stress, which represent the average of the adjacent elements. That’s not what we want. If we look into the ‘Integration Point Results’ we see there are more options. Element mean seems like it might work for us, but when we export it, we see that it’s still reporting stresses at the node, only now it’s using a different integration scheme.
In order to access the average stress value of the element (not node), we need to use the User Defined Results. We’ll ask to evaluate the expression seqv (von Mises) and set the integration option of using the elemental mean.
Now when we export that result item we get what we want…element vs stress:
Now we just need to export both vectors (volume and stress), then copy/paste/sort/sum and you’re done. Don’t forget the most important step…billing for 4 hours of post-processing work.
Long story short, all you MAPDL users who have been complaining about not being able to access element tables should take a look at the User Defined functions.
If you found this article useful, please consider using PADT’s Ansys team for your training or consulting needs.
You must be logged in to post a comment.