## Retrieving Accurate PSD Reaction Forces in ANSYS Mechanical

We just finished up a tech support call for a customer that wanted a way to get accurate reaction loads from a PSD run in ANSYS Mechanical. Alex Grishin took the call and provided a nice example to the customer, so we thought we would leverage that and share it with all of you.  Even if you are not in need of this particular function, it is a great example of using snippets.  If you are not familiar with this, check out our recent webinar on the subject.

The reason why you have to do this is because doing an accurate PSD force calculation is not a simple thing.  The math is a bit complicated, because PSD responses are probabilities of results that loose sign.  And it is right now only available in Mechanical APDL (MAPDL).  This is not a problem because we can use an APDL command object to get the results from MAPDL and bring them back to ANSYS Mechanical.

## Three Simple Steps

There are three very simple steps needed to get this done:

1. Identify the geometry you want the reaction loads calculated on
Do this by selecting a face, edge, or corner and create a named component.  You will use that named component to grab the nodes that sit on the piece of geometry and do an FSUM in MAPDL. In our example, we call the named selection react_area1.
2. Tell the solver to store the required modal information
Since ANSYS Mechanical doesn’t do reaction force calculations they save disk space by not storing the info needed for such calculations, but we need them.  So add a command object in your modal analysis environment that says save all my results (outres) and expand all my modes (mxpand):
outres,all,all
mxpand,,,,yes,,yes
3. Calculate the reaction force
Now we simply need to add a command object to the post processing branch that:
• gets the PSD deflection results (set,3)
• selects the named selection (cmsel),which is a nodal component in MAPDL,
• gets the nodes attached (esln)
• calculates the reaction load (fsum)
• stores the results in parameters that we return to ANSYS Mechanical. (*get,my_).  Remember that anytime you create a MAPDL parameter in the post processor that starts with my_ it gets returned to ANSYS Mechanical. (well, that is the default, you can change the prefix)
• select everything so that MAPDL can keep post processing like normal

For our example, it looks like this:
/post1
set,3,1
cmsel,s,react_area1
esln
fsum
*get,my_fsumx,fsum,0,item,fx
*get,my_fsumy,fsum,0,item,fy
*get,my_fsumz,fsum,0,item,fz
allsel

The following figure shows the model tree for our example, and the returned parameters:

Nothing fancy, simple in fact: Make a component, store the required info in the result files, do an FSUM and bring back the results.

That was a short article!  And no exciting pictures.  So… if you want to you could check out the travels of The PADT Hat around the world.

## Workbench and Excel, Part 1: Using the Excel Component System

It is a fact.  Microsoft Excel is the most used engineer tool in the world.  If you are like me, you do everything you can’t do in ANSYS in Excel.  And a lot of the time you wish you could talk directly from Excel to ANSYS – and in the day many of us wrote kludgey VB Macros that would write APDL scripts run ANSYS MAPDL in the background.  In the past couple of releases our friendly neighborhood ANSYS developers have added a lot of different ways to work with Excel: saving tables to a file, Python scripting to talk to Excel, and an Excel System.  I remember reading about these things as they came out, even wrote about how cool they were, but I never had the opportunity to use them.

Then, last week, I noticed an Excel icon just sitting there in the toolbox, mocking me, taunting me to use it.

So I dragged it out on my project page and tried to use it… and got no where.  My assumptions were not valid, it  didn’t work the way I expected because, it turned out, I was not thinking about how it fit into the project correctly.  So I backed up, actually read the help (gasp!) and after a experimenting got it to work, I thought.  Then I talked to some folks at ANSYS, Inc. and they reminded me of what this is: an Excel Solver System.  It is  not a tool that lets you “drive” your project from Excel. It lets you use Excel to calculate values.

This posting is a summary of what I learned. And as I was working through it I thought it would be good to also cover the python interface to Excel and how to save tabular information to Excel. These will be covered in future articles (hence this being Part 1).

## What You Need to Know

As I said above, my problem was that I was thinking about how Excel fit into my project all wrong.  The first thing you should do is read the help on the Excel System.  The best way to find it is type excel into search.  The item with the most hits will take you to the article for component systems, then click on Microsoft Office Excel. (I wish I could just put a link in… grumble… grumble… ).

To use the Excel system you do the following:

2. Make a spreadsheet and use range names to identify parameters
4. Edit the system and tell the program which parameters are input and which are output
5. Go into the parameter manager and hook up any derived parameters you want to pass to Excel and use any of the Excel parameters with other parameters as needed
6. Tell ANSYS to run a VB macro (if you want)
7. Update your project or Design Points

We will go through the process in detail but first, a few things you should know:

• The system kind of looks and feels like the parameter manager in Workbench, but it is not.  You have to think of Excel as a “solver” that feeds parameters from and to the parameter manager.
• I struggled with this because I thought of output parameters as values calculated by Workbench and input parameters as ones that come from Excel, but the opposite is true.
• Excel Input Parameter: A value calculated in Workbench parameter manager
• Excel Output Parameter: A value calculated in Excel
• You need to get your head around this or you will get stuck like I did.  The example should help.
• Parameters that come from DesignModeler are dimensionless in the parameter manager.
• This one really held me up for a while.  If you assign a parameter from Excel that has a unit to drive your geometry in design modeler, you get an error.
• The solution is to make sure that you DO NOT use units on Excel parameters that you get or pass to DesingModeler
• When you attach the Excel file to your Excel system on the project page Workbench copies the Excel file to your project and buries it in dpall\XLS.
• You will get burned by this if you go to your original excel file, edit it, then try and update your project.  Your changes will not show up.  That is because it is not linked to the original file, it is linked to a copy stored in that XLS directory.
• Once you have linked a file you should exit Excel then open the file by RMB on the Excel system and choose  “Open File in Excel” (see below for more on this whole process)
• I recommend that you start buy making your Excel file, save it with the name you want in the C:\Temp directory, attach that file, close Excel, then open from Workbench.
• Now you have a file to add your stuff to and you don’t have to worry about having an earlier version lurking around.
• An important side effect of this is if you delete your system, it deletes your Excel file!  So make sure you make a copy or do a save as before you remove the Excel system
• To get changes in Excel to show up in your project, you need to save the file AND refresh/reload.
• Making a change to he Excel file will put the system out of date.  A refresh on the project page or a reload on the “Edit Configuration” page will update things.
• The parameter names in Excel are case sensitive.  So whatever your prefix is in the system properties (WB_ by default) you need to have the same in your Excel spreadsheet for range names.
• To get a full update, including running any macros and doing any calculation, you have to update the system.   This is kind of obvious, but I kept forgetting to do it.
• Your Excel file will not update if you use RSM.  Make sure your default for updating your project is to run local and, that if you are using design points, you set that update to run in the foreground.
• The easiest way to check and change this is to click on the parameter bar and view its properties.  Under Design Point Update Process set Update Option to Run in Foreground.
• If you want to have your Excel file define both input and output parameters for the same ANSYS simulation, workbench sees that as  a “cyclic dependency and will not let you do it.
• Although annoying at first glance, it kind of makes sense.  If you feed a value to Excel and then Excel calculates a new value that effects your ANSYS model, you need to update the ANSYS model, which will change the value that gets passed into Excel, which will change the value that gets passed out which changes your ANSYS model, which… and so it goes in a loop. This is considered a bad thing.
• This goes back to the fact that Excel should be used as a solver, not as  ‘”driver” of you simulation.
• If you do want to drive your analysis from Excel, you’ll need to do some scripting. We’ll cover that in a future article.

## The Process

I started this article with a really cool valve demo model. Then found that it was just too slow and a pain to work with for showing how the Excel system works.  So I went back to my second favorite type of model, a simple “tower of test.”  (my favorite is a FPWHII – flat plate with a  hole in it).  You can download the project here.

Like every other system in Workbench, you simply drag from the toolbox to the Project Schematic.  Notice how the green “drop zones” are all empty spaces.  You can’t drop it on an existing cell in a system because there is no dependency between other systems and an Excel system.  The Excel system is connected through parameters, which we will see in a bit.

Once you have dropped it onto the schematic, click on the Top cell (C1 in this case) and check out the properties (RMB Properties if the window is not already open).  From the properties you can see the system ID (XLS) and you can specify an Analysis Type.  You can leave it blank or type in something like “Home Grown Optimization.”

Then click on the Analysis cell (C2 in this case) and look at the properties.  They are shown here:

One key thing to note is that the directory where the Excel file will be copied is shown.  I did this once already on this project so it made a XLS-1 directory. If I did it again, I’d see XLS-2, etc…   In fact, by the time I got done with this article and trying all sorts of things, it ended up in XLS-8.

The most important option under Setup is the “Parameter Key”   Any Excel named range that begins with this string will get read into the parameter manager.  If you make it blank, all the named ranges will come in.

## Make a Spreadsheet and Use Range Names to Identify Parameters

Now you need to create your spreadsheet.  You need to plan ahead here a bit.  Figure out what parameters you need Excel to get from your models and what parameters you want to send back.  Come up with good names because that is what gets passed to Workbench.

What happens when you attach a file is that Workbench goes to the Excel sheet and steps through all the named ranges in the file.  If it finds one with a name that starts with the filter value, it grabs the first value in the range as the parameter value and then grabs the second as the units.  If your range is bigger, it just ignores the rest.

So this tells us that we need to create a range that has at least one cell, or two if units are important. For our simple example we will be calculating costs  and outputting that using the input Volume, Length and Width. There is a formula in the cost cell that multiples those values times pre-set costs per unit volume, length and width and sums them up to get a cost.

So the laziest thing you can do is select a cell and name it.

But it will help you and others if you actually make a table that has a descriptive name, the parameter name (WB_ should be your default), the value for that parameter, and the units, if any.  Note that for an input parameter you can just set the value to zero to get started.  Here is what the tables look like for our example:

To create a range you select the value and units for a given parameter, hold down the Right-Mouse-Button (RMB), and Select “Define Range”

A cool thing that Excel does is to use the value just to the left of the range as the default name of the range.  So by creating the table you save yourself some typing.  Or, if you don’t use a table, just type in the name you want .

Now just click OK and you have a named range.  You can repeat this for each range, or you can get fancy and use the fact that your data is in a table, with the parameter name to the left, to quickly generate all the ranges at once.

To do this, select the WB Param, value and unit columns. Then go to –>Formulas –> Defined Names –> Create from Selection.  When the dialog box pops up make sure only “Left column” is checked.  Click OK.

In one fell swoop you created all your named ranges.  To see, edit, and delete ranges, regardless of how they were created, go to Formulas –> Defined Names –> Name Manager.

Take some time to look at this and understand it. When you are debugging and fixing stuff, you will use this window.

Now you have an Excel file that Workbench will like!  Time to attach  it. Save it (I recommend to save to temp so you don’t get it confused with the copy that Workbench will make).

This is the easiest step. Simply RMB on the Analysis cell in the system and browse for the file.

Now your Analysis cell has a lightning bolt, update to have it read the file and find parameters.  If you have your parameters set up wrong, such that you don’t have any named ranges with the specified prefix, it will generate an error but will still attach the file.

NOTE:  If you get some weird errors  “Unexpected error…” and “Exception from HRESULT:…” when updating your Excel system, check your Excel file.  Odds are you have an open dialog box or the file is somehow locked. The error generates because Workbench can’t get Excel to talk to it.

## Edit the System and Tell the Program Which Parameters are Input and Which are Output

Although you have a green check mark, you will notice that your system is still not connected to your parameters, and therefor it is not connected to the rest of your model.  The way to fix this is to RMB->Edit Configuration. Double-clicking on Analysis also does the same thing.

This puts you in Outline Mode.  You should be familiar with this mode from the Parameter Manager or Engineering Data.

Take some time to explore this outline.  Notice the setup cell, where you have access to the system properties.  Then it’s child, the Excel file.  Click on it to the properties for the file connection.  Under that is the important stuff, the parameters.

If you did everything correctly, you will see all of your parameters in alphabetical order.  If you click on one, you will see the properties.  Here they are for the cost value:

It shows the range, the value and units (C column) and the Quantity name.  Workbench guesses by units.  So PSI comes in as pressure by default.  If it is a stress, you need to change it here.

But your main task right now is to tell Workbench which of these parameters you want passed to the parameter manager, and what type of parameter, input or output, they are.  Here is where I get screwed up.  Because an input parameter in the parameter manager is an output parameter here.  Remember, the Excel system is a solver that takes in parameters from the parameter manager and send back values to drive your models.  So in our example, all the dimensions and the volume are passed from the parameter manager TO excel, so they are input.  The cost is passed from Excel to the Parameter manager so it is output.

Now you have hooked up your Excel system. Click on the “Return to Project” at the top of the window and you will go back to the project schematic and see that a Parameters cell has been added to the system and it has been attached to the parameter bar.

## Go Into the Parameter Manager and Hook Things Up

Although the Geometry and Mechanical systems are connected through the parameters to the Excel system, no relationships exist.  We need to assign some values to our Excel parameters.

This is what our test model looks like before we do this:

Our goal is to have the parameters in the first column below to drive those in the second:

 Driving Parameter Driven Parameter P7: Len P10: WB_L P5: W1 P12: WB_W P8: Solid Volume P11: WB_V

I tried to just click on the value in value column (C) and change the value from the number it is to the parameter name it should be but that does not work.  Because the parameter is set as a constant.  So, you need to click anywhere on the row for the parameter you want to set, then go down to the Properties window and change the Expression to the Parameter ID you want to change.  This changes the Expression to be an equation and the Expression Type to be Derived:

That is it. You now have Excel in your project as a solver. Update your project and the cost will be calculated and presented as a parameter for optimization, DOE studies or whatever you want.

## Tell ANSYS to run a VB macro (if you want)

One really cool feature is that you can tell the program to run a VB macro on an update. What you do is go to your system, click on Analysis then RMB-> Edit Configuration.  Then click on the file cell (A3).  The property area now shows info on your file, and has a Use Macro row at the bottom. Click on the checkbox and a Macro Name row will popup.  Enter the name of a macro in your spreadsheet and you are off.

Here is a silly example where I use a macro to calculate a value.  For the example I put in the well known equation for deriving the Kafizle of a system:

1. Create a new row in my table for the Kafizle value to go in
2. Create a name WB_KF for the value
3. Write my macro (don’t laugh):
Sub CalcKafizle()
Range(“E7”) = Rnd(1) + Cos(Range(“E5”).Value)
End Sub
4. Save my sheet and KABOOM. I now need to save it as an xlsm, not xlsx!  I didn’t think about that!
• This means my Excel connection wont’ work.  So you have to delete your system and start again with your macro file.  So plan ahead! I’m glad I did this silly example rather than running in to it on a real problem.
5. Once everything is right again, go into the outline for the excel system and make that new parameter (WB_KF)  an output parameter.
6. Then click on the File (A3) and go to the properties window and click on the Use Macro checkbox
7. Put the macro name into the  Macro Name field

Now you can run you project, and every time you do, the program will calculate a new cost and Kafizle value.  This of course begs the question, what are the proper units of Kafizle?  Here is the Design Point table:

## Thoughts and Conclusions

I started this effort thinking I would drive my model from Excel, basically replacing the Parameter Manager with Excel.  But that does not work because Excel doesn’t know enough about your project to handle the dependencies that can really cause problems if you don’t solve in the correct order.  So once I figured that out I found some pretty good uses.  Here are some other ideas for how to use the Excel System:

• Do additional post processing on result values
• Use formulas or lookup tables to calculate loads.
• Just make sure that the values you take from your ANSYS model into Excel (inputs) are also input parameters in the parameter manager.
• Use tables and lookups to calculate input values for an analysis
• A good example would be a “family of parts” application where you put in a part number and Excel does a vlookup() on a table that has all the input parameters listed by part number.
• To include results from an ANSYS analysis in a system model you have in Excel.
• You still have to force the update on the ANSYS side, which is not the ideal way to run a system model, but it may be easier than writing scripts and hooking it up that way.

This is a new feature at R13 and it can be a bit “touchy.”  Especially if you are rooting around in it like a Javalina rooting around in your flower bed (Arizona reference).  If you do something really crazy it can loose its way and start generated errors. I found the best solution at that point was to save a copy of my Excel file, delete the system, and start over.

This took a lot longer than I thought to write, but the Excel System does a lot more than I thought.  I think as we all start thinking about how to use this tool, people will come up with some pretty cool applications.

## Knowing the ID of Coordinate Systems Created in ANSYS Mechanical – or perhaps – You didn’t know that, everyone knows that…

During this weeks webinar on Using APDL Snippets in ANSYS Mechanical a question came up about coordinate systems. I actually don’t remember the original question, but in answering it the question came into my mind: how do you get access to the ID of coordinate systems that you create in ANSYS Mechanical?

For a lot of items you can add to the ANSYS Mechanical model tree, you can attach a Command Object (snippet) and ANSYS Mechanical passes a parameter with the ID of the thing you want access to (material, contact pair, spring, joint, etc…).  But there is no way to add a Command Object to a coordinate system.

So I dug into it and found something I didn’t know.  The problem with discovering something like this and sharing it is that you either just uncovered something that can help a lot of users or you are going to embarrass yourself over something that everyone already knows.  The idea of a blog is to be casual and informal, so let’s see which I did.

If you click on a user created coordinate system in ANSYS Mechanical The Detail View list two things in the first grouping “Definition”.  They are Type and Coordinate System ID.  The default for the ID is “Program Controlled”  I’ve never clicked on it to see what the other options are. It turns out you can change it to “Manual”

Once you do that it gives you a second “Coordinate System ID” line and you can put in whatever number you want there.

Problem solved.  Just give your coordinate system whatever number you want and use that number in your macro.  Couldn’t be easier.

Hopefully, this was helpful. If so, rate this posting at a 5.

If you already knew this little factoid, rate it as a 1.

– Eric

## Files and Info from “Using APDL Snippets in ANSYS Mechanical”

We just finished the webinar “Using APDL Snippets in ANSYS Mechanical” and wanted to share the files we used and some additional information.

The presentation can be found here.

The sample script for plotting mode shapes is here.

You can view a recording of the presentation here on our WebEx site.

PADT’s ANSYS Webinar Series is now off on Summer Break. We will be back in August!

## A Further Assessment of Design Assessment

Last weeks PADT ANSYS Webinar Series webinar was on a little used feature in ANSYS Mechanical called Design Assessment, or DA.  If you missed it, you can view a recording at:

And a PDF of the presentation can be found here:

As promised, this weeks The Focus posting will be a follow up on that webinar with an in-depth look at the scripts that were used in the example.  But first, let us review what DA is for those that don’t remember, fell asleep, or don’t want to sit through 60+ minutes of me mumbling into the telephone.

## Review of DA

Design Assessment is a tool in ANSYS Workbench that works with ANSYS Mechanical to take results from multiple time or load steps, perform post processing on those results, and bring the calculated values back into ANSYS Mechanical for viewing as contour plots.  It was developed to allow the ANSYS, Inc. developers to add some special post processing tools needed in the off shore industry, but as they were working on it they saw the value of exposing the Application Programmers Interface (API) to the user community so anyone can write their own post processing tools.

You use it by adding a Design Assessment system to you project.  In its most basic form, the default configuration, it is set up to do load case combinations.  That in itself is worth knowing how to use it.  But if you want to do more, you can point it to a custom post processing set of files and do your own calculations.

A custom DA is defined by two things.  First is an XML file that tells ANSYS Mechanical what user input you want to capture, how you want to get results out of mechanical, what you want to do with the results, and how you want them displayed in your model tree.  Second is one or more Python scripts that actually do the work of capturing what the user input, getting results, doing the calculation, and sticking the resulting values back in the model.  Both are well documented and, once you get your head around the whole thing, pretty simple.

Right now DA works with Static and Transient Structural models.  It also only allows access to element stress values.  Lots of good enhancements are coming in R14, but R13 is mature enough to use now.

If that review was too quick, review the recording or the PowerPoint presentation.

## A Deep Dive Into an Example

For the webinar we had a pretty simple, and a bit silly, example – the custom post processing tool took the results from a static stress model and truncates the stress values if they are above or below a user specified value.  Not a lot of calculating but a good example of how the tool works.

Note, this posting is going to be long because there is a lot of code pasted in.  For each section of code I’ll also include a link to the original file so you can download that yourself to use.

Here is the XML file for the example (Original File):

`   1:  <?xml version="1.0" encoding="utf-8"?>`
`The first lesson learned was that you have to get all the tags and headers just right. `
`It is case sensitive and all the version and other stuff has to be there`
`Cutting and pasting from something that work is the best way to go`
`   2:  <!-- `
`   3:  www.PADTINC.com `
`   4:            XML file for ANSYS DA R13`
`   5:            Demonstration of how to use DA at R13`
`   6:            Goes through results and sets stresses below floor value to floor`
`   7:              value and above ceiling value to ceiling value.     `
`   8:              `
`   9:          User adds DA Result to specify Floor and Ceiling`
`  10:          Attribute group can be used to specify a comment`
`  11:          `
`  12:          Calls da_trunc_solve.py and da_trunc_eval.py in c:\temp`
`  13:          `
`  14:          Eric Miller`
`  15:          5/18/2011`
`  16:  -->`
`  17:   `
`Everything is in a DARoot tag.`
`  18:  <DARoot ObjId ="1" Type="CAERep" Ver="2">`
`Attributes tags define items you want to ask the user about.  `
`  19:    <Attributes ObjId="2" Type="CAERepBase" Ver="2">`
`This first attribute is a drop down for the user to decide which stress value they want `
`You use <AttributeType> to make it a dropdown then put the values in <Validation>`
`  20:      <DAAttribute ObjId="101" Type="DAAttribute" Ver="2">`
`  21:        <AttributeName PropType="string">Stress Value</AttributeName>`
`  22:        <AttributeType PropType="string">DropDown</AttributeType>`
`  23:        <Application PropType="string">All</Application>`
`  24:        <Validation PropType="vector&amp;lt;string>">`
`  25:               SX,SY,SZ,SXY,SYZ,SXZ,S1,S2,S3,SEQV`
`  26:        </Validation>`
`  27:      </DAAttribute>`
`Next is the prompt for the stress floor value`
`  28:      <DAAttribute ObjId="102" Type="DAAttribute" Ver="2">`
`  29:        <AttributeName PropType="string">Stress Floor</AttributeName>`
`  30:        <AttributeType PropType="string">Double</AttributeType>`
`  31:        <Application PropType="string">All</Application>`
`  32:        <Validation PropType="vector&amp;lt;string>">-1000000,10000000</Validation>`
`  33:      </DAAttribute>`
`Then the Ceiling Value`
`  34:       <DAAttribute ObjId="103" Type="DAAttribute" Ver="2">`
`  35:        <AttributeName PropType="string">Stress Ceiling</AttributeName>`
`  36:        <AttributeType PropType="string">Double</AttributeType>`
`  37:        <Application PropType="string">All</Application>`
`  38:        <Validation PropType="vector&amp;lt;string>">-1000000,10000000</Validation>`
`  39:      </DAAttribute>`
`Finally a user comment, just to show how to do a string.`
`  40:      <DAAttribute ObjId="201" Type="DAAttribute" Ver="2">`
`  41:        <AttributeName PropType="string">User Comments</AttributeName>`
`  42:        <AttributeType PropType="string">Text</AttributeType>`
`  43:        <Application PropType="string">All</Application>`
`  44:      </DAAttribute>`
`  45:    </Attributes>`
`To expose an attribute, you can put it in an AttributeGroup to get info shared by`
`all DA result objects.  This one just does the Comment`
`  46:    <AttributeGroups ObjId ="3" Type="CAERepBase" Ver="2">`
`  47:      <DAAttributeGroup ObjId="100002" Type="DAAttributeGroup" Ver="2">`
`  48:        <GroupType PropType="string">User Comments</GroupType>`
`  49:        <GroupSubtype PropType="string">Failure Criteria</GroupSubtype>`
`  50:        <AttributeIDs PropType="vector&amp;lt;unsigned int>">201</AttributeIDs>`
`  51:      </DAAttributeGroup>`
`  52:    </AttributeGroups>`
`<DAScripts> is the most important part of the file.  It defines the scripts to run for a `
`solve and for a evaluate.  At R13 you do need to specify the whole path to your python files`
`  53:    <DAScripts ObjId="4" Type="DAScripts" Ver="2">`
`  54:      <Solve PropType="string">c:\temp\da_trunc_solve.py</Solve>`
`  55:      <Evaluate PropType="string">c:\temp\da_trunc_eval.py</Evaluate>`
`  56:      <DAData PropType="int">1</DAData>`
`  57:      <CombResults PropType="int">1</CombResults>`
`  58:      <SelectionExtra PropType="vector&amp;lt;string>">DeltaMin, DeltaMax</SelectionExtra>`
`  59:    </DAScripts>`
`The other way to get user input is to put attributes into a <Results> object.  `
`Here we are putting the choice of stresses (101),and the floor and ceiling (102,103)`
`into an object`
`  60:    <Results ObjId="5" Type="CAERepBase" Ver="2">`
`  61:      <DAResult ObjId ="110000"  Type="DAResult" Ver="2">`
`  62:        <GroupType PropType="string">Ceiling and Floor Values</GroupType>`
`  63:        <AttributeIDs PropType="vector&amp;lt;unsigned int>">101,102,103</AttributeIDs>`
`  64:        <DisplayType PropType="string">ElemCont</DisplayType>`
`  65:      </DAResult>`
`  66:    </Results>`
`  67:  </DARoot>`

I always have to go over XML files a few times to figure them out. There is a lot of information, but only a small amount that you need to pay attention to.  After a while you figure out which is which.

Now on to the fun part, the Python scripts.  The first one gets executed when they user chooses solve.

da_trunc_solve.py is shown below and you can get the original here.   The comments inside pretty much explain it all.  It basically does two things:  creates an ANSYS MAPDL macro that extracts all the element stresses and puts them in a text file, then it runs MAPDL with that macro.

`   1:  import subprocess`
`   2:  import os`
`   3:  import shutil`
`   4:   `
`   5:  #======================================================================`
`   6:  #`
`   7:  #   ------------------------------------------------------------  PADT`
`   8:  #    www.PADTINC.com`
`   9:  #`
`  10:  #    da_trunc_solve.py`
`  11:  #         Demonstration python script for Design Assessment in `
`  12:  #            ANSYS R13`
`  13:  #         Called on solve from ANSYS Mechanical`
`  14:  #         Bulk of code copied and modified from TsaiWu example`
`  15:  #            provided by ANSYS, Inc.`
`  16:  #`
`  17:  #       E. Miller`
`  18:  #       5/18/2011`
`  19:  #======================================================================`
`  20:  def trunc_solve(DesignAssessment) :`
`  21:   `
`  22:      # Get number of elements in model`
`  23:   `
`  24:   `
`  25:      # Change directory to current workspace for DA`
`  26:      originaldir = os.getcwd()`
`  27:      os.chdir(DesignAssessment.getHelper().getResultPath())`
`  28:   `
`  29:      #Get the path to the results file name and the location of the temp directory`
`  30:      rstFname = DesignAssessment.Selection(0).Solution(0).getResult().ResultFilePath()`
`  31:      rstFname = rstFname.rstrip('.rst')`
`  32:      apath = DesignAssessment.getHelper().getResultPath()`
`  33:      `
`  34:      print "Result File:", rstFname`
`  35:      print "Apath:", apath`
`  36:   `
`  37:      # Write an ANSYS APDL macro to start ANSYS, resume the result file, grab the stress`
`  38:      #   results and write them to a file`
`  39:   `
`  40:      macfile = open(DesignAssessment.getHelper().getResultPath()+"\\runda1.inp", "w")`
`  41:   `
`  42:      macfile.write("/batch\n")`
`  43:      macfile.write("/post1\n")`
`  44:      macfile.write("file,"+rstFname+"\n")`
`  45:      macfile.write("set,last\n")`
`  46:      macfile.write("*get,emx,elem,,num,max\n")`
`  47:      macfile.write("*dim,evls,,emx,10\n")`
`  48:      macfile.write("etable,esx,s,x\n")`
`  49:      macfile.write("etable,esy,s,y\n")`
`  50:      macfile.write("etable,esz,s,z\n")`
`  51:      macfile.write("etable,esxy,s,xy\n")`
`  52:      macfile.write("etable,esyz,s,yz\n")`
`  53:      macfile.write("etable,esxz,s,xz\n")`
`  54:      macfile.write("etable,es1,s,1\n")`
`  55:      macfile.write("etable,es2,s,2\n")`
`  56:      macfile.write("etable,es3,s,3\n")`
`  57:      macfile.write("etable,eseqv,s,eqv\n")`
`  58:      macfile.write("*vget,evls(1, 1),elem,1,etab,  esx\n")`
`  59:      macfile.write("*vget,evls(1, 2),elem,1,etab,  esy\n")`
`  60:      macfile.write("*vget,evls(1, 3),elem,1,etab,  esz\n")`
`  61:      macfile.write("*vget,evls(1, 4),elem,1,etab, esxy\n")`
`  62:      macfile.write("*vget,evls(1, 5),elem,1,etab, esyz\n")`
`  63:      macfile.write("*vget,evls(1, 6),elem,1,etab, esxz\n")`
`  64:      macfile.write("*vget,evls(1, 7),elem,1,etab,  es1\n")`
`  65:      macfile.write("*vget,evls(1, 8),elem,1,etab,  es2\n")`
`  66:      macfile.write("*vget,evls(1, 9),elem,1,etab,  es3\n")`
`  67:      macfile.write("*vget,evls(1,10),elem,1,etab,eseqv\n")`
`  68:   `
`  69:      macfile.write("*cfopen,darsts,txt\n")`
`  70:      macfile.write("*vwrite,evls(1,1),evls(1,2),evls(1,3),evls(1,4),`
`evls(1,5),evls(1,6),evls(1,7),evls(1,8),evls(1,9),evls(1,10)\n")`
`  71:      macfile.write("(G16.9, X, G16.9, X, G16.9, X, G16.9, X, G16.9, X, `
`G16.9, X, G16.9, X, G16.9, X, G16.9, X, G16.9)\n")`
`  72:      macfile.write("*cfclose\n")`
`  73:      macfile.write("finish\n")`
`  74:      macfile.write("/exit,nosave\n")`
`  75:   `
`  76:      macfile.close()`
`  77:   `
`  78:      # Set up execution of ANSYS MAPDL. `
`  79:      #   Note: Right now you need to grab a different license than what Workbench is using`
`  80:      exelocation = "C:\\Program Files\\ANSYS Inc\\v130\\ansys\\bin\\winx64\\ansys130.exe"`
`  81:      commandlinestring = " -p ansys -b nolist -i runda1.inp -o runda1.out /minimise"`
`  82:   `
`  83:      #Execute MAPDL and wait for it to finish`
`  84:      proc = subprocess.Popen(commandlinestring,shell=True,executable=exelocation)`
`  85:      rc = proc.wait()`
`  86:   `
`  87:      # Read the output fromt the run and echo it to the DA log file`
`  88:      File = open("runda1.out","r")`
`  89:      DesignAssessment.getHelper().WriteToLog(File.read())`
`  90:      File.close()`
`  91:   `
`  92:      # Go back to the original directory`
`  93:      os.chdir(originaldir)`
`  94:   `
`  95:  trunc_solve(DesignAssessment`

• You have to use MAPDL to get your stress values. Right now there is no method in the API to get the values directly.
• You need a second MAPDL license in order to run this script.  It does not share the license you are using for ANSYS Mechanical at R13.  This should be addressed in R14.
• One work around right now is to use an APDL code snippet in the ANSYS mechanical run that makes the text file when the original problem is solved.  The SOLVE script is then no longer needed and you can just have an evaluate script.  Not a great solution but it will work if you only have once seat of ANSYS available.
• Note the directory changes and getting of result file paths.  This is important. Mechanical does stuff all over the place and not in just one directory.
• Make sure the MAPDL execution stuff is correct for your installation.

Once the solve is done and our text file, darsts.txt, is written, we can start truncating with the evaluate script (Original File).  This script is a little more sophisticated. First it simply reads the darsts.txt file into a python array.  It then has to go through a list of DA Results objects that the user added to their model and extract the stress value wanted as well as the floor and ceiling to truncate to. For each result object requested, it then loops through all the elements truncating as needed.  Then it stores the truncated values.

`   `
`   1:  import subprocess`
`   2:  import os`
`   3:  import shutil`
`   4:  import sys`
`   5:   `
`   6:  #======================================================================`
`   7:  #`
`   8:  #   ------------------------------------------------------------  PADT`
`   9:  #    www.PADTINC.com`
`  10:  #`
`  11:  #    da_trunc_eval.py`
`  12:  #         Demonstration python script for Design Assessment in `
`  13:  #            ANSYS R13`
`  14:  #         Called on eval from ANSYS Mechanical`
`  15:  #         Bulk of code copied and modified from TsaiWu example`
`  16:  #            provided by ANSYS, Inc.`
`  17:  #`
`  18:  # NOTE: Right now it just does SX.  XML and script need to be modified to allow user`
`  19:  #       to specify component to use (X, Y, or Z)`
`  20:  #`
`  21:  #       E. Miller`
`  22:  #       5/18/2011`
`  23:  #======================================================================`
`  24:  def trunc_eval(DesignAssessment) :`
`  25:   `
`  26:      # Change directory to current workspace for DA`
`  27:      originaldir = os.getcwd()`
`  28:      os.chdir(DesignAssessment.getHelper().getResultPath())`
`  29:   `
`  30:      # Find number of elements in DA`
`  31:      Mesh = DesignAssessment.GeometryMeshData()`
`  32:      Elements = Mesh.Elements()`
`  33:      Ecount = len(Elements)`
`  34:      print "DA number of elements is ",Ecount`
`  35:      print "Number of Result Groups:",DesignAssessment.NoOfResultGroups()`
`  36:   `
`  37:      # get User comment from Atribute Group`
`  38:      # Note: Assuems one.  Need to use a loop for multiple`
`  39:      attg = DesignAssessment.AttributeGroups()`
`  40:      atts = attg[0].Attributes()`
`  41:      usercomment = atts[0].Value().GetAsString()`
`  42:      print "User Comment = ", usercomment`
`  43:   `
`  44:          # create arrays for SX/Y/Z values`
`  45:      sx = []`
`  46:      sy =  []`
`  47:      sz = []`
`  48:      sxy = []`
`  49:      syz =  []`
`  50:      sxz = []`
`  51:      s1 = []`
`  52:      s2 = []`
`  53:      s3 = []`
`  54:      seqv = []`
`  55:      # read file written during solve phase`
`  56:      #   append stress values to SX/Y/Z arrays`
`  57:      File = open("darsts.txt","r")`
`  58:      for line in File:`
`  59:          words = line.split()`
`  60:          sx.append(float(words[0]))`
`  61:          sy.append(float(words[1]))`
`  62:          sz.append(float(words[2]))`
`  63:          sxy.append(float(words[3]))`
`  64:          syz.append(float(words[4]))`
`  65:          sxz.append(float(words[5]))`
`  66:          s1.append(float(words[6]))`
`  67:          s2.append(float(words[7]))`
`  68:          s3.append(float(words[8]))`
`  69:          seqv.append(float(words[9]))`
`  70:      File.close()`
`  71:   `
`  72:      # Loop over DA Results created by user`
`  73:      for ResultGroupIter in range(DesignAssessment.NoOfResultGroups()):`
`  74:          # Get the Result Group`
`  75:          ResultGroup = DesignAssessment.ResultGroup(ResultGroupIter)`
`  76:          # Extract Cieling and Floor for the Group`
`  77:          strscmp  = ResultGroup.Attribute(0).Value().GetAsString()`
`  78:          strFloor = float(ResultGroup.Attribute(1).Value().GetAsString())`
`  79:          strCeil  = float(ResultGroup.Attribute(2).Value().GetAsString())`
`  80:          print "DA Result", ResultGroupIter+1, ":", strFloor, strCeil`
`  81:   `
`  82:          #Add a set of results to store values in`
`  83:          ResultStructure = ResultGroup.AddStepResult()`
`  84:   `
`  85:          print "strscmp", strscmp`
`  86:   `
`  87:          # Loop on elements `
`  88:          for ElementIter in range(Ecount):`
`  89:              #Add a place to put the results for this element`
`  90:              ResultValue = ResultStructure.AddElementResultValue()`
`  91:              # Get the element number and then grab SX values that`
`  92:              #   was read from file`
`  93:              Element = Mesh.Element(ElementIter).ID()`
`  94:   `
`  95:              if strscmp == "SX":`
`  96:                  sss = sx[Element-1]`
`  97:              elif strscmp == "SY":`
`  98:                  sss = sy[Element-1]`
`  99:              elif strscmp == "SZ":`
` 100:                  sss = sz[Element-1]`
` 101:              elif strscmp == "SXY":`
` 102:                  sss = sxy[Element-1]`
` 103:              elif strscmp == "SYZ":`
` 104:                  sss = syz[Element-1]`
` 105:              elif strscmp == "SXZ":`
` 106:                  sss = sxz[Element-1]`
` 107:              elif strscmp == "S1":`
` 108:                  sss = s1[Element-1]`
` 109:              elif strscmp == "S2":`
` 110:                  sss = s2[Element-1]`
` 111:              elif strscmp == "S3":`
` 112:                  sss = s3[Element-1]`
` 113:              elif strscmp == "SEQV":`
` 114:                  sss = seqv[Element-1]`
` 115:   `
` 116:              # Compare to Ceiling and Floor and truncate if needed`
` 117:              if sss > strCeil:`
` 118:                  sss = strCeil`
` 119:              if sss < strFloor:`
` 120:                  sss = strFloor`
` 121:              # Store the stress value`
` 122:              ResultValue.setValue(sss)`
` 123:      # Go back to the original directory`
` 124:      os.chdir(originaldir)`
` 125:   `
` 126:  trunc_eval(DesignAssessment)`
` 127:   `

• The same directory issues hold here.  Make sure you follow them
• Always loop on ResultGroups.  You can assume the number of attributes is constant but you never know how many results the user has asked for.
• In this example it is assumed that the stress label is the first attribute and that the floor and ceiling are the second and third.  This is probably lazy on my part and it should be more general.
• The way to make it more general is to loop on the attributes in a group and grab their label, then use the label to determine which value it represents.
• Before you can store values, you have to create the result object and then each result value in that structure:
• ResultStructure = ResultGroup.AddStepResult() for each result object the user adds to the tree
• ResultValue = ResultStructure.AddElementResultValue() for each element
• ResultValue.setValue(sss) to set the actual value

And that is our example.  It should work with any model, just make sure you get the paths right for where the files are.

## Be a Good Citizen and Share!

If you have the gumption to go and try this tool out, we do ask that you share what you come up with.  A good place is www.ANSYS.NET.  That is the repository for most things ANSYS.  If you have questions or need help, try xansys.org or your ANSYS support provider.

Happy Assessing!

## Files for Design Assessment in R13

During the Webinar on 5/18/2011 we discussed a simple example we created to show how to use Design Assessment.  Click here to download the Zip file.

You can get a PDF of the PowerPoint here.

You can watch a recording of the webinar at: http://tinyurl.com/PADT-DA-Webinar

## Murphy’s Law of Convergence

Ted Harris was working at tech support problem and got this convergence graph.  Ouch!

He calls it “Murphy’s Law of Convergence”

Jason called it “Asymptotic Sisyphaen Convergence”

Doug commented:

“It’s like a pinball machine.  Just shake the monitor a little, but not too much, don’t want to trip the tilt sensor. “

I call it annoying.  Share your names or comments for this type of convergence below.

## A Moving Look at a Solid Tool: Rigid Dynamics

Most of us who have been doing this simulation thing  for a while (in fact, if you still call it analysis instead of simulation you probably fall in this group) always think of ADAMS or DADDS when someone brings up Rigid Body Dynamics tools. Most people forget that ANSYS, Inc. has had a strong offering in this area for some time, and at R13 it really is mature and full featured.

# Background

A good place to start is to step back and describe what Rigid Dynamics is.  That is the name ANSYS, Inc. uses, but many people refer to it as Kinematic/Dynamic, Multibody Dynamics, Rigid Body Dynamics (RBD), or motion simulation. In most case all of these names refer to a numerical simulation where:

1. More than one part is connected as an assembly
2. Joints defined between the parts
3. Large deflection motion
4. Time dependent motion (if not, then it is just kinematics)
5. Parts are rigid (not flexible) in most cases

Think back to your dynamics class, probably your sophomore year in college.  Linkages, gears, cams, etc…  You are basically solving for the full equation of motion where inertia, time, gyroscopics. And all that stuff is taken into consideration.  The key thing to remember is that you can model a rigid system as a set of point masses  (Bodies) with inertial properties and six degrees of freedom (UX/Y/Z, and ROTX/Y/Z) You then connect them by defining a relationship (Joints) between their degrees of freedom.  You then apply forces, acceleration, velocity, and/or displacement over time and solve. To solve, the problem must be fully constrained in that there may not be any free DOF’s.

The most comprehensive jumping off point I found for the topic is a website from the University of Waterloo: http://real.uwaterloo.ca/~mbody/

## Rigid Dynamics in ANSYS

You have been able to do Rigid Dynamics in ANSYS MAPDL for a long time.  MPC184 for joints and MASS21 for the bodies has been there since the Spice Girls were popular.  But, you had to use the implicit solver in MAPDL which can take some time to solve a long problem.  So ANSYS, Inc. has been working for a few releases now on an explicit rigid body solver that is much more efficient for this type of problem. You get access to the kinematic (no inertia terms, just motion) for free if you have ANSYS Professional NLS or better. To solve dynamics problems, you need a license for the Rigid Body Dynamics Solver as an add-on to ANSYS Professional NLS or better.

To create a model you simply insert a “Rigid Dynamics” system into your project:

Figure 1: Rigid Dynamics System

It looks and acts a lot like an ANSYS Mechanical system, but is set up a bit differently to deal with the needs of Rigid Dynamics and to take away the things that you need for flexible FEA in ANSYS Mechanical.

## Analysis Process

A real model can be very complicated and take some time to create, but the process of making it is the same regardless of the complexity:

 Do your normal geometry and material setup Remove auto contacts if you don’t need them (joints should constrain in most cases) Add any point masses you want to add Define Joints Fix to ground as needed Key is to make sure joints are correct and you don’t over/under constrain the problem Coordinate system orientation is critical Constrained DOF’s show up on plot for each joint – Blue=free Lots of nice options Define Springs Between geometry or geometry to ground Set Up Analysis Define step controls Solver options Nonlinear Controls Output Controls Apply Loads Acceleration Gravity Joint Loads Remote Displacement Constraint Equations Solve Post Process Deformation, Velocity, Acceleration of Parts Total or Aligned Probes on Parts, Joints, Springs Key thing is to get graphs of behavior Also makes a table you can export

# Joints, Springs & Contact

An important part of any Rigid Dynamics tool is the Joint Library. This defines what you can and can’t connect.  The ANSYS tool has all of the standard options:

Table 1: Joints (Courtesy of the ANSYS User Manual)

 Revolute ROTZ Free Cylindrical UZ, ROTZ Free Translational UX Free Slot UX, ROTX, ROTY, ROTZ Free Spherical ROTX, ROTY, ROTZ Free Bushing UX, UY, UZ, ROTX, ROTY, ROTZ Free User specified stiffness and damping in all DOF’s Planer UX, UY, ROTZ Free Universal ROTX, ROTY Free General User defines free DOF’s as well as stiffness and damping on free DOF’s

You define joints by selecting the Connections part of the tree and insert the Joint you want.  Joints can be between two bodies or between a body and fixed ground.  Each details view is a little different but most look like the one for the revolute joint:

Figure 2: Revolute Details View

In most cases, defining the joints is very easy.  You use the geometric feature that is in your real part to define the joint.  Two holes for a revolute joint or a slot for a slot.  The important thing to pay attention to for joints is which body is the reference body, and which is the mobile body. The first body you click on is the reference and the second is the mobile one.  If you get it wrong, RMB on the joint in the tree and choose Flip Reference/Mobile.

Next, pay attention to your coordinate systems for the joint. By default, the coordinate system is defined in the reference face of the details and by default is aligned with the geometry you picked to define the reference.  This is because the coordinate system needs to move with the geometry.  If the reference geometry isn’t exactly what you want, you can change it by picking a new face, line, or point.  Make sure you check the graphics window and that the coordinate system is in the right place.

Once your joints are done, you can insert the other type of connection, a spring. They work the same way except they define a force load on the bodies that is related to their relative position.  You can have tension only, compression only, or a normal spring.  They work like joints in that you specify two bodies or a body and ground to connect.  You have more control on where the endpoints of the spring are, by specifying a piece of geometry or a point in a coordinate system.  You can also add in preload.

Figure 3: Spring in Assembly

You can also specify contact.  But before you do, make sure that a joint won’t work first.  If contact makes sense, then put it in just like you would in ANSYS Mechanical.

Figure 4: Contact

# Other Stuff you Should Know

Sometimes you don’t have geometry? No worries. you can define a point mass and add in its inertia properties to get the same behavior.

The Rigid Dynamics solver has its own command language and just like when you use MAPDL as the solver, you can use code snippets to send it commands.  It uses Python and the commands are documented in the help.  The most common use for this is creating relationships between DOF’s that joints can’t do.  Gears are the best example, you can specify that body 2 rotate twice for every time body 1 rotates, etc…  It is also a good way to define a non-linear spring or a complicated stop condition.

Figure 5: Code Snippets

Speaking of stops, you can specify stops and locks on the joints to control how far a joint can move and if it reaches that stop, that it freezes (lock).

# Conclusions

And, without going into too much detail, that is Rigid Dynamics in ANSYS.  You can see some cool examples on the ANSYS website:

http://www.ansys.com/Products/Simulation+Technology/Structural+Mechanics/ANSYS+Rigid+Dynamics#/0

The key as always is to take the time to really read understand the tool then crawl-walk-run.  Don’t start with a 100 part assembly and expect it to work.  Pick a simple assembly or a simple subassembly and go from there.  In fact, regardless of your part, start with a four-bar linkage and get that going first.

Happy motion!

## PADT’s New CUBE HVPC Computers

Editors Note, 7/30/2014:
This was an early post on our CUBE systems, we have since updated and improved our offering.  Visit www.padtinc.com/cube to get the latest information.

Most of you should have received an e-mail blast yesterday announcing that PADT is now selling  a line computer systems that are configured specifically for CFD and FEA users.  Our CUBE High Value Performance Computers became a product line when a couple of customers asked us about the hardware we ran on and if they could get the same from us.  After doing a couple of systems this way we decided to go mainstream.

You can read our announcement here:

[Replaced]

We also have a new website with more details:

Give us a call (480.813.4884) or send an e-mail (info@padtinc.com) if you need more information or have questions.

# What is PADT Up To?

Since The Focus is kind of an engineer-to-engineer exchange, we thought we would use this weeks posting to give the hard core users out there some details on these systems and some things everyone should know.

The thing we want to point out first is that these are not super-fast high performance systems.These are based on the new AMD chips which are fast per cycle, but run at a lower clock speed. You would need the latest Intel Nahelem chips for maximum performance.  What they are is a balance between speed and price.  As an example, you can go to the Dell website and configure a 3.0 GHz Intel based system with 8 cores that is as close to the CUBE w12 (12 core) system for about \$9,800.  the w12 is \$5,800.  that is 68% more expensive than the Intel based system for maybe a 40% speed increase.  And, if you have enough parallel licenses, it may be about the same speed 12 AMD cores vs. 8 Intel cores.  That is the kind of tradeoff we look at when configuring these systems.  If you need more than 8 cores then the price difference really gets big.

That is one way we get the price down. The other is by cutting back on two big price drivers for someone selling computers: service and inventory.  We just don’t cut back, we pretty much cut it out.  When you buy a system we order the parts to build it. This saves us a ton on inventory and we pass that on to you.  We did this because in reality, you really don’t need it tomorrow.  In fact, it will probably take 3-4 weeks just to get buy-in from your management.  So way then pay a lot of money to get the machine in 2-3 days when you already waited 3-4 weeks?

We really cut back on support. We test your system here with your software and then ship it off.  You get 8 hours of phone support and a 1 year parts only warranty.  After that, you have to pay for time or parts.  We did this because in the years we have been running computers for simulation, we never use the service and we almost never have a bad part we need replaced after one year.  sometimes you get a bad part right out of the box, but if it lasts a year, it will last till it is out of date.

So, in a nutshell, we are trying to find a sweet spot for users where, for a reasonable amount of money, they can get a reasonable amount of throughput.

# Some Highlights

## Portable Mini Cluster – 96 Cores, Two Boxes, 256 GB of RAM: \$43,250

One cool thing to point out about our 96 core system is that we built it to be portable.  We felt that if someone needed that much horsepower they probably wanted to share it.  So we build it into its own rack that we put on wheels.  We also add two UPS’s to provide battery backup power.  So if you need to unplug it and roll it down the hallway, go for it.  This also makes these systems perfect for use in security areas where you need to wheel a box around between closed secure rooms as needed. When you get done with a project, pull the drives and wheel it to the next project.

Another cool thing about this system is that it uses a special Infiniband interconnect that does not require a switch when you connect only two systems.  This saves a few thousand dollars.

## The “Sweet Spot” – 32 Cores, 128 GB of RAM, \$12,300

We feel that the best deal in the CUBE line is the 32 core system.  Not so much because of the hardware but more because of the ANSYS HPC license packs.  If you buy two packs, you get the ability to two jobs on 8 cores each or one job on 32 cores.  It also comes with enough RAM to handle bigger problems (128GB) at a great price.  Even if you add some bells and whistles it should still be under \$15,000.  You need to run the numbers but most users will be able to purchase a CUBE w32 and two HPC packs for about the same or less than two 8 cores systems, an interconnect, and 16 parallel tasks, and still run faster.

## What To Do with all Those Dang Files! – The 10TB Fileserver

We configured this system after a customer that bought a 96 core system from us told us that they were paying something like \$20k for a fancy file storage device.  Now granted, this is a very fast I/O machine with software and hardware that lets you write files to it during a run.  But honestly, why do that?  Why not just put 1-3 TB on your compute server or mini-cluster and then get a cheap box with a bunch of inexpensive disk drive on it. Run on the fast machine and when you get done, copy your files to the inexpensive file server.  Our pre-configured FS10 has 10GB of disk space for \$5,000.

But that only solves one problem: what to do with those big files when you need to keep them around.  What do you do for long term storage?  At PADT we use these external hard drive docking stations (eSTAT Drive Bay) and we go out and buy standard 1TB hard drives.  We plug those guys in, copy our files to the hard drive, unplug it, label the drive, and throw it in a drawer.  To be safe, we often make two copies of the files and actually put one in a fire safe.  The fs10 comes with an external eSATA Dual Drive bay to solve your long term archiving problems in a simple and cost effective way.

# Bottom Line

So, is a CUBE HVPC system right for you?  You need to decide if giving up some speed, support and delivery time is worth the savings. Also, is a system designed for CFD and FEA a better fit, vs. a database server that they label as an HPC machine.  The best way is to contact us, and we’ll help answer those questions.

Not the most exciting The Focus posting, but we think you will agree that this approach to computing can be very efficient, so we thought we would share it with you.

## Beyond Clicking: Named Selections Move to the Worksheet

It seems like a minor thing.  For many users who have not known the glory that is APDL selection logic, they are not even aware of the power that surges through your fingers when you grab all the vertices between X = 1.2 and X=1.8, grab the lines attached to those vertices, then the areas defined by those lines.  It sometimes borders on a magical incantation.  It is not a minor thing.  It is reaching into your model and grabbing it by the throat and asserting your control over it.

OK, maybe that is an exaggeration.  But it has been a frustration for many of us to only be able to create named selections by clicking on geometry in Workbench.  At release 13 the friendly developers working on ANSYS Mechanical have added a very cool adaptation of the MAPDL selection logic into the workbench world: Worksheet Named Selections.  Right now they only work with geometry, but look for nodes in future releases.

## Creating a Worksheet Based Named Selection

Most people don’t know about this feature because it is not really obvious that it is there.  If you have no Named Selections in your model, the Named Selections Icon in the toolbar doesn’t even show up unless you click on the Model top branch of your tree:

Figure 1: Accessing Names Selections for the first time in a model

If you have some already in your model, just click on the Named Selection branch and you will see the Named Selection icon on the tool bar.

To create a Named Selection… OK.  Stop.

<RANT> Someday I’ll find the committee that decided to call these groups of entities “Named Selections” and give them a bill for my coming carpal tunnel syndrome.  I think it is a good descriptive name and as long as I’m just clicking on it in a GUI, the name is fine.  But when I’m talking or typing about it… what a pain to have two words to describe it.  I miss the days of only having 8 characters for entity and routine names in FORTRAN.  There is too much verbosity in the world!  Down with long, descriptive names!  Up with short, non-descriptive names that you have to “know” in order to use!  Why couldn’t we call it a set, or a group, or an assembly – better yet, asmb.  Anyhow, from now on I will refer to Named Selections as NSs or a NS.</RANT>

To create a NS using a worksheet, you simply clock on the NS icon.  This adds a NS Branch and a NS to that branch.  If you look at the details View for the NS you will see that the Scoping Method is set to Geometry Selection by default.  Click on the Geometry Selection and you get a drop down menu that now offers you the choice of using the Worksheet.  Make that choice:

Figure 2: Telling Workbench you want it to reveal Worksheet method of creating a NS

Now you should see a new tab in your graphics window called Worksheet, and in that Worksheet you should see a Generate button and a table.  If you window is large enough, it will look like this:

Figure 3: The NS Worksheet

If it is too small to show the whole table, a scroll bar will be at the bottom and cover up that blank row. Don’t panic, it is supposed to do that.

Figure 4: The NS Worksheet with Scroll Bar covering the first row

If you are like me you get to this point and you go “What Next”  It is not obvious what the next step is (well, to me anyway.  But it may be trivial to those with younger brains).  Clicking on the blank row doesn’t do anything. To start creating you selection you right click on the table and choose Add.  You are now ready to specify your NS.

## Building a Worksheet Based Named Selection

This tool is pretty clever.  You basically add rows to the table that act on geometry from top to bottom.  In many cases you just use one line.  But for more sophisticated selections, you can really stack them up and get complicated.  After each line is executed, the active set changes based on what is on that row.  The final active set is what goes into the named selection.

Lets take a look at the table and each column in it.

Figure 5: NS Table

Action
This is the most important column. It tells workbench what you want to do in this step of applying the filter.  Under action you have the following options:

• Add: Adds the entities defined by the row to the active set.
• This is a UNION in set theory
• For the first row in the table:
• This is a CREATE operation in set theory
• There is no “active set” so the first line add’s to a null set (xSEL,S,,, in APDL)
• For the second and subsequent rows:
• In order for it to work, the value in the Type column has to be the same.  If they are not the same, then nothing gets selected.
• This is an OR operation.  So if you have one line that selects all vertices with X > 0 and a second with Y > 0 you will get vertices that are X > 0 OR Y>0.
• xSEL,A,,, in APDL
• Remove: Removes the entities specified on the row from the set.
• Think of it as an unselect: xSEL,U,,, in APDL
• Filter: Selects a subset from the active set
• This is an INTERSECTION in set theory
• This is an AND operation.  It puts everything in the active set that is also defined by the row in the active set.
• xSEL,R,,, in APDL
• Invert:  Selects everything not in the active set of the current active set type, and makes it active
• This is a COMPLIMENT in set theory
• This is a NOT using the everything of the current type vs. the active set.
• xSEL,INVE in APDL
• Convert:  Selects all of the entities of the type specified in the Geometry Type column that are connected to the active set and makes those entities the new active set
• Must go up or down in topology tree by one step:  vertex <-> Edge <-> Face <-> Body
• When going up it selects ANY entity that is attached to the current select set.  There is no way to specify just those that are fully defined
• xSLx in APDL:  LSLA, ASLL, KSLL, LSLK, etc…

Geometry Type
Right now it only selects the standard geometry topology types:

 Workbench CAD Name MAPDL Name Body Solid Volume Face Surface Area Edge Curve Line Vertex Vertex Key Point

Remember that you can only have one Geometry Type in the active set at a time.

Criterion
This tells the program what filter you want to apply to select geometry.  The table below shows the different criterion and what Geometry Type’s they apply to:

 Vertex Edge Face Body Comment Size X X X Selects entities by whose Length (Edge), Area (Face), Volume (Body) fall within the specified values Type X X X Finds entities of a certain underlying shape: Body: Solid, Surface, Line Face: Plane, Cylinder, Cone, torus, Sphere, Spline, Faceted Edge: Line, Circle, Spline, Faceted Location X X X X You can specify a value or a range and you can also specify a coordinate system to use! Location Y X X X X You can specify a value or a range and you can also specify a coordinate system to use! Location Z X X X X You can specify a value or a range and you can also specify a coordinate system to use! Face Connections X Used to pick edges by the number of faces they are connected to:  0 would be all free edges, 1 would be all edge on only one face, 2 would be shared by 2 faces, etc…

Operator
This is where you specify how you want to control your selection.  You have your standard if() type operators as well as the ability to specify a range.  For range you put values in the Lower and Upper Bound columns and for all others, the Value column.  The options are:

• Equal, Not Equal, Less Than, Less than or Equal, Greater Than, Greater Than or Equal
• Range

Units
Like most things in Workbench, you can change the units here if you want.

Value
Here is where you put in value you want to select on (unless it is a range).  Put in a numerical value for Criterion = Size or Location X/Y/Z.  Use the values in the table above for Criterion = Type. And lastly, if you are doing Face Connections, put in the number of faces.

Lower Bound, Upper Bound
When Criterion is set to Range, you specify the range here.

The other thing you should know is how to modify your table.  To change a value in a cell, just click on it.  To delete a row, click on a cell  in the row then RMB and select delete.  Do the same thing to insert a new row before the currently selected row.

Lastly, remember to hit the generate button!  If you don’t, it does not update and even though you have a green checkbox next to your NS in the tree, it is not up to date.  You have to hit generate or select the NS branch and RMB->Generate Named Selections

## Starting with Picking

A nice way to start a NS using a worksheet is to actually pick an entity on the screen then RMB->Create Named Selection.  this brings up a dialog box where you can specify the name and if you want to turn it into a Worksheet named selection:

Figure 6: Selection Name and Options Dialog

If you choose “Apply Selected Geometry” it makes a standard Scoping Method of “Geometry Selection”  This is the default.  But if you pick “Apply geometry items of same:” and then pick one of the options, it creates a NS with a Scoping Method of “Worksheet.”  Now you can go into the worksheet and add rows to it.

## Tips on Using the Worksheet Named Selections

That was a lot of information! If you need more clarification you can get even more from the Help menu:

// Mechanical User’s Guide // Basics // The Mechanical Application Interface // Named Selections // Worksheet Rules for Specifying Named Selection Criteria

When you want to use these selections it is fairly simple.  Each time you add a row you modify the selected set.  Like most things it is a good idea to take a crawl-walk-run approach. Add a row and click the generate button and see how many entities you get in the details view.  Or simply click on the graphics tab to visually see what was selected. Then add the next row, and so on until you have what you want.

As always, it is a good idea to give descriptive names to your NSs.  The default of Selection, Selection 1, Selection 2 doesn’t hold up in 4 months when you try to figure out what you were trying to do.

Some Examples

The most common way that we have used this is to select all the holes of a certain size.  There are a couple of ways to do this, but the one I prefer has the following steps.

1. First you need to know the circumference of an edge on your hole.  You can do this by multiplying your diameter by PI or just select one of the edges and read the length of the edge on the bottom of the screen (because multiplying by PI is too hard)

Figure 7: Avoiding the use of the first thing you learned in 5th grade geometry
2. Now click on the Named Selection icon and change the Scoping Method to Worksheet.  Add a line and set it to: ADD, EDGE, TYPE, EQUAL, CIRCLE
This gives you all the circle edges
3. Next Add another row and set it to: FILTER, EDGE, SIZE, EQUAL, 0.7854 (That is the length of my hole’s circumference for this example).  Note that we used FILTER, not ADD!
View the results and you should now see the edges of you holes. It is often good to switch to wireframe to see all the edges:

Figure 8: Edges Selected on Holes of Diameter 0.25”

4. The next step is to get the cylinders.  We do this with a new row that uses Convert To: CONVERT TO, FACE.  This gives us the holes we want, but also the top and bottom faces that are attached to the hole edge:
Figure 9: Faces attached to hole edges
5. The last step is to select all the cylinders in the active group.  Add a row with: FILTER, FACE, TYPE, EQUAL, CYLINDER:

Figure 10: Holes are selected!

## Final Thoughts

And that is a basic introduction to using the worksheet to do selections.  As always, the best way to get good with this is to use it.  The help is a pretty good reference as well.  Users can get very creative with this and really make some big improvements to productivity, eliminating the need for a few more APDL Code Snippets in the tree.

## Random Thoughts on RSM, ANSYS people, and my new iPad2 and my Son’s 3DS

Warning, when you get done reading this you might be a little disappointed.   A couple of our engineers promised nice chunky articles for this week but then got hammered with billable work.  And I was off doing paperwork all week so I didn’t have time to write anything truly useful.  So, a day late, here are some random thoughts disgorge as a stream of consciousness prattling.

# I’m Digging RSM

We have been redoing our compute server setup for a while now and it is getting pretty robust and useful.  When I recently had an opportunity to run a real model I initially submitted it on my desktop, then found that it bogged it down so much that I could not continue my slug through HR documents and financial reports… and the livelihood of PADT depends on my ability to slug through such things. The obvious solution was to batch off my ANSYS Mechanical solve on one of our servers.  And RSM made it easy.

I have to give credit to Jason Krantz and our IT team for getting things set up right a while back.  So when it came time for me to use it, it was real easy.  Now the graph on Ted2 (the server, not Ted Harris) is humming along using 7 CPU’s and about 13GB of RAM and my job is on LS3 and the force value is plunging towards convergence.  Good times… Good times…

To make this article somewhat worthwhile I thought I’d pass along a couple of things I had to remember or that Doug reminded me of.

## Controlling the solve options on the remote machine

If you want to set the number of CPU’s, memory usage or any other options that go on the ANSYS command line, you do that by going to Tools->Solve Process Settings… in ANSYS Mechanical.  Pick the queue on the remote machine (if you don’t see it, you don’t have RSM set up right and that is a subject for a real posting…)  then click on Advanced.  Here you will see you options for using DANSYS, specifying your memory (always a good idea in my opinion), the number of CPU’s, additional command line options, Unix options, etc…  the most important ones, and the ones you should always check before you run are the number of processors and memory.

Since you are running remote your output file and your various convergence graphs don’t get displayed automatically.  I have to admit I sat at may desk for a while before I realized nothing was going to happen on its own.  Then Doug reminded me, only with a small amount of disdain in his voice, that you have to prompt the remote solver for such information.  You do this by Clicking on Solution Information in the tree and RMB –> Retrieve.  It will send off a request to the solving machine to send back the data.  It takes some time but eventually you will get updated Solution Information.

Of course the old-foggy way of doing it is to SSH over to the solving machine (I use PUTTY) and go to the solving directory and do a tail on the solve.out file.  The graph is much more useful but having a file scrolling convergence information across your screen is much more impressive and makes you look much busier to people who wander buy and glance at your screen.  At least in contrast to Facebook.

Which makes you look more impressive or productive?  trail –f solve.out, ANSYS Mechanical Convergence Plot, or Facebook?  Maybe I should set the terminal for the trail file to be green on black…

## Getting Files Back

One downside of RSM as it is now configured is that it doesn’t copy back all the files that you may create during your run.  It can’t read your mind so it doesn’t know that “frc_hist.csv” is something you need.  A simple work around is to add an APDL Code Snippet to the post processing part of your tree and add a line at the end with something like:  /sys, cp frc_hist.csv ~

This copies the file to your home directory on the remote machine.  Then, when the job is done you an go over and retrieve it.

# ANSYS People

I get to interact a lot with the people that work at ANSYS, Inc.  Sales, Support, Development.  The whole company.  And over the last two weeks we have been fortunate enough to have some folks come out and visit our largest customer, Honeywell.  This has been going on for years now, since we started PADT 17 years ago.

Last night we took three of these ANSYS folks to dinner.  One from HQ here in the US, one from ANSYS India and one from ANSYS France.  We started at 7’ish and got chased out of the restaurant at 10:00.  We talked about old ANSYS stuff, new ANSYS stuff, development methods, solvers, computers, strange animals, traveling, the competition, graphing, jScript, UDF’s, automatic report generation, morphing, blah, blah, blah.  Three hours was gone in a blink of the eye.  Fun.

My point – the best thing about ANSYS, Inc. is the people who work there.  Smart, passionate, knowledgeable, hard working, and their hearts are always in the right place.

Just thought I’d pass that along.  If you get a chance to really spend some quality time with any of them, do it.

# ANSYS Commercial

And if you haven’t seen it yet, check out the new ANSYS commercial on the home page: http://www.ansys.com  Click on “View Video”  Put aside your engineers detachment and strong desire to pick anything that looks like marketing to little pieces.  I think it is super cool and makes me even well up a bit.  I really like the new tag line: Realize Your Product Promise.

# My new iPad2 and my Son’s 3DS

Love it.  3G version.  Take it everywhere. Instant access, on a screen I don’t have to strain to read, to information.

But from an engineering standpoint, I bring it up to not only fill up space in this posting.  I bring it up because we have been wondering a lot about the fact that the type of interface on an iPad is probably going to become the dominant interface.  How should the GUI on an simulation tool change to take advantage of that?

About the same time as I got my iPad2, my son got a Nintendo 3DS.  It has a small but very clear 3D screen that you don’t need glasses to view.  How cool would it be if one of your monitors was like that. If you could put your graphics window on the 3D monitor and view your model in 3D without dorky glasses? Would that be a productivity increase or just a source of additional eye strain?

# Back to paperwork

OK, I’ve filled up a posting.  Now on to filling out FORM BRDI-1A: 2010 BUSINESS R&D AND INNOVATION SURVEY.  The first words under the title are “Your Response is Required by Law” so I better get cracking… wait, my model just converged. Let me go retrieve that csv file and see if the answers make sense.

## Making Pretty Plots in ANSYS Mechanical and Mechanical APDL

UPDATE:

This content is still good for APDL plotting, but way out of date for Ansys Mechanical. If you want to learn more about getting high quality images out of Ansys Mechanical at Ansys 2020R2 and newer, including 3D Printing your results, take a look at, “An Update on Outputting Results from Ansys Mechanical.”

I was looking for some new images for our web page and all of the plots I had were pretty much screen grabs.  Not the high quality I was looking for.  And putting a picture of Angelina behind a mode plot probably won’t go over too well, or will go over too well and will distract everyone.  So I brought up the original models and started playing around trying to get a better quality image, and did pretty well.  And, needing an article for this week, I thought I’d share what I found. If you don’t use MAPDL, skip on down to the ANSYS Mechanical bit.

# ANSYS Mechanical APDL

For my MAPDL plots I actually referred back to an old “The Focus” article I did in 2002. Yes, 2002.  You can go back to that article for the details but here are the important bits below:

• Invest in a good image editing tool. If you are ultra-cheap, use the open source GIMP.  But Adobe Photoshop and Corel Paint Shop Pro are worth the investment.  With Paint Shop Pro having the price/performance advantage if you don’t already have Photo Shop
• You don’t want to do screen grabs.  MAPDL has great plotting to file abilities and you want to use those.
• Use the /show command to output high quality graphics and skip using the pixels on your screen. You have two great options:
• Use /SHOW,PNG to tell MAPDL to write to a PNG file when you issue plot commands
•   PNG is the best choice for smaller files and high resolution.  JPG may be more common but you will find that the images can be fuzzy, especially around edges.  Go PNG.

• If you are really hard-core and you want an exact representation of you model that can be scaled, then do a /show,PSCR,,,8.  This makes an encapsulated postscript file.
• If you don’t know what that is, we advice you don’t bother.
• But if you do, pop it into Illustrator, group it and now you have a vector graphic you can scale, trim, edit and really do cool things with.
• Get to know how to use the /ERASE, /NOERASE button for making multiple plots on a page.  You can use /win with the standard view commands to show results from different modes, different load steps, or if you get real clever, even different models.   Here is an example for plotting 4 different mode shapes:
 ! Plots first 4 modes /erase /win,1,ltop \$/win,2,rtop /win,3,lbot \$/win,4,rbot /view,all,1,1,1,1 /vup,all,Z /angle,all,0 /dist,all,1.3 /focus,all,.2,.08,.05 /win,2,off \$/win,3,off \$/win,4,off /plopt,info,0 /annot,delete /TSPEC, 15,0.700,1,0,0 *dim,anx,,4 *dim,any,,4 *dim,frq,,4 anx(1) = -.98, .4, -.98, .4 any(1) = .01, .01, -.92,-.92 *do,i,1,4 set,1,I *get,frq(i),mode,i,freq plnsol,u,sum /win,i,off /win,i+1,on /noerase *enddo /tlab,anx(1),any(1),Mode 1: %frq(1)% Hz/t /tlab,anx(2),any(2),Mode 2: %frq(2)% Hz/t /tlab,anx(3),any(3),Mode 3: %frq(3)% Hz/t /tlab,anx(4),any(4),Mode 4: %frq(4)% Hz/t /replot /erase anx= any=
• Get rid of that black or blue-blue background by changing your screen to reverse video.
• Through the GUI: PlotCtrls->Style->Colors->Reverse Video
• Or put the following in a macro:
/RGB,INDEX,100,100,100, 0
/RGB,INDEX, 80, 80, 80,13
/RGB,INDEX, 60, 60, 60,14
/RGB,INDEX, 0, 0, 0,15

• Use /TYPE to turn on slower, but higher quality hidden line removal
• Default is z-buffer, which is fast but not a accurate
• Precise is the best: /TYPE,,4 for hidden
• Get smoother curved surfaces by increasing the number of facets on your polygons with /EFACET
• /GRAPH,POWER is needed for it to work (default)
• /EFACET,4 puts 16 (4/edge) faces on every element face.

• Getting lots of pixels is the most important.  Just make a big file with lots of pixels by using /GFILE, 2400.
• This gives you a file that is 2400 pixels tall
•   You can then scale it down when you want to use it and get nice clean images.

There is a lot more you can do, like annotation, backgrounds, changing fonts, etc… But this covers the basics that everyone should know.  Take a look at the original article and help on the following command for more: /PLOPT, /EDGE, /TRIAD, /LIGHT, /DEV,FONT, /TEXTRE, /GFORMAT, /ANNOT.

# ANSYS Mechanical

Now things get a little different. In that MAPDL is old, older than some of you reading this article, it has some wicked cool tools that were put in there from the days when many of us didn’t even have a color monitor.  Now the world is online and everything is about an 200pixel wide JPEG file to be uploaded onto Facebook, you don’t have as many options to get high quality images out of the Workbench interface.  But the good news is that the default image, is better than most of the high quality ones you have to work for to get out of MAPDL.

## The Basics for ANSYS Mechanical

So, for a lot of cases, just doing a screen grab of your graphics window in ANSYS Mechanical is good enough. But if you want nicer plots, here are some suggestions:

• If you are on Windows Vista or 7, then you need to turn of Windows Aero.  This is the transparent fancy-pants options for how windows are displayed. But the screen capture used in ANSYS Mechanical doesn’t work if it is turned on.  So if you are going to be doing Images or Animations, you need to turn it off.
• Beyond the basic screen grab you should become familiar with the options under the little “New Figure or Image” Icon on the main icon bar

• If you choose Figure or Image it adds a Figure or Image object under whatever object you have selected.
• A figure is a 3D image that updates every time you click on it.  It stores the view settings when it is made, but you can rotate and zoom at any time.  It is a 3D picture
• An image is a screen capture that is stored in the tree.  You can also import an image from your hard drive.
• The easiest way to get a nice plot is to get what you want on the screen and use “Image to File”.
• By default this will make a PNG file that is the resolution of the image on your screen.
• For a higher quality image, make your graphics window bigger.  Remember, all ANSYS is doing is grabbing your screen and saving it to a file.
• The default background is a bit annoying for plots, especially if you want just your model.  To turn it off go back to your project page and use Tools->Options->Appearance and set Background Style to Solid and Background color to white.
• If you want to go old school and have white text and black background, you can set that here as well.

• If you want to make an image that can float in your PowerPoint (no background, transparent) then I like to turn off all the decorations.  Do this by making sure your background is solid (white is usually good enough) and then go to View in the menu and uncheck Ruler, Legend, and Triad.
• Once in PowerPoint, use the “Set Transparent Color” feature to set the white bits to clear.
• Or, use you fancy image editing software to remove the background. (and put a cheesy one in if you want, as shown here:)
• Play with the options to get the image you want.  The contour style, if you want your elements shown or not, etc…
• Another thing to know is how to change the default format for saving the images.  The default is PNG, which we recommend.  But if you need JPEG or BMP you can change it in Mechanical under  Tools>Options>Mechanical>Miscellaneous>Image>Image Transfer Type.

## Getting Better Resolution on a Single Plot in ANSYS Mechanical

The above will work for most plots, but what to do if the image you get from screen grabs is just not good enough?  Maybe you are on a laptop and you can’t get the resolution you need. I especially find this true when I want to view my mesh.  This is the default I get with mesh on:

By using the Print Preview tab, I can get a very high resolution image:

• Get the view you want in the graphics window.
• Click on the Print Preview tab at the bottom of the graphics window
• You should see what you saw on the screen.  Don’t panic.
• On the Print Preview tool bar click on the little picture and choose High Resolution
• It should update with a very nice high-rez image.
• This is an HTML page, so you can right click on the image and copy it, or save it to disk.

## Getting Better Resolution on a Multiple Plots in ANSYS Mechanical

The above will work for a single image but can be a pain if you want a bunch.  For that we recommend that you leverage the Report Writer capability, even if you don’t want the report.  The Report Writer makes an HTML report of everything in your Model tree.  So if you put Figures in your tree, it will make those for you when you do a Report Preview, all in one nice little directory.  Here is how to use it:

• For every plot you want, click on the object you want the plot of and then sue the “New Figure or Image” drop down to insert figures for every view you want.
• Don’t use Images, remember those are just screen grabs and won’t give you better resolution.
• When you are done, click on the “Report Preview” tab under the Graphics Window.
• ANSYS Mechanical will go of and think for a while, then it will show you your HTML report.
• You can cut and paste from the report if you don’t have a lot of images.
• If you do have a lot of images, you will want to click on the Publish button
• This brings up a dialog.  Don’t use the default Single file format, change it to “Page, Figures in Subfolder (*.html)” and pick a directory
• they will be sitting in the Project_Files directory.
• The default images are 600 pixels wide, which may be OK.  But if not, then you need to go into Options and tell ANSYS to make bigger, better images.
• Go to Tools->Options->Mechanical->Report->Figure Dimensions
• Set the Graphics Height and Width higher.  I like 1800 x 1500.  That is three time more than the default
• You can get even more resolution by changing the Graphics Resolution to 2:1 or 4:1.  This makes the pictures 2 or 4 times larger.  But that can take a while…
• Now go back and redo the Report Preview and you should see much larger images, and much higher quality.
• To save to a folder, publish them.
• Click on the images below to see them in their full resolution:

Default 600px wide image

1800px wide image

3600px wide image

# Conclusion

And those are the high points.  Like everything else, the help is your friend and has much more detailed information.  And don’t be afraid to just try stuff out.  Explore the options and settings, make lots of images.  That worst thing that can happen is that you will create some files you need to delete.

We hope this will help you make pretty pictures for your next report so that project guy won’t grill you on stuff he really doesn’t understand…

## FE Modeler Part 3: Morphing Meshes

In the first two parts of this series we talked about how to use FE Modeler to translate meshes and how to create geometry from meshes.  The third “big” thing that this tool does is allow you to morph a mesh to a new shape.  There are a few less important things that FE Modeler does, and we will cover those in the last article of this series.

First, let’s take a good long look at the picture to the left.  Mesh morphing is nothing like what the image shows, but it is pretty creepy to look at so I thought I’d throw it up there.

Mesh morphing in FE Modeler works by taking the faceted surface geometry you can create, covered in the previous article, and allowing the user to apply transformations or a projection to that geometry.  You would use this if you want to change your geometry while keeping the same basic mesh.  This is because when you are doing optimization or parametric study and changing the CAD geometry, you force a remesh every time and sometimes the change in mesh is large enough to effect your study.  You would also need to use this method if all you had was an FE mesh.

## Basic Process

Let’s start with a very simple example to show how it is done.

Figure 1 shows a piece of example geometry.  It has some nice features that we will do more complex morphs on.

Figure 1: Simple Example Geometry, Itching to be Morphed

To start off we do the same geometry (covered in detail in Part 2 of this series):

2. Select Geometry Synthesis in the tree and make sure Use Node components is Yes
3. Click on the Initial Geometry Icon
4. If everything works you should have a solid that you can now work with

Now you need to define how you want to modify the faceted geometry.  Do this by selecting Initial Geometry in the tree and then clicking on the “New Target Configuration” Icon.  See Figure 2.

Figure 2: Creating the Target Configuration

When you do this the program will go out and configure some things internally and then add two new things to the tree: 1) a “Target Configuration” that is a child of Initial Geometry and 2) a Parameterized configuration branch. Figure 3 shows the result in the tree.

Figure 3: Model Tree After Creation of Target Configuration

So, at this point you might be trying to figure out why there are branches and children where they are. The way I think about it is that the Geometry Synthesis listing is not a branch and is not a child of something.  It is it’s own “tree”  So everything on the first level under it, its children, are different things you can do with Geometry Synthesis:  Find skins, define working Geometry,  Set up mesh Morphing (Initial Geometry), and view what the current mesh looks like based on the current parameters (Parameterized Configuration).  I feel that the Initial Geometry branch is mislabeled and should say Mesh Morphing, but it is too late to change the name now.

Back to morphing meshes…  The way you specify what you want morphed is to define Design Points that have some sort of translation or projection.  Then you specify how far to translate with a parameter that you control in the Project Schematic.  For our first run through, we are going to offset a surface.

Do this by clicking on Design Point and then on the Transformation Icon and Select “Face Offset” (or RMB –>Insert->Face Offset) and fill out the details view.  For this example I used the end face and set the maximum offset value to 30 mm.  Note, even though it doesn’t say it in the GUI, the help points out that you should put in your maximum value that you might use.  the program then scales from the original to this value as you change the offset parameter.  Figure 4 shows the setup for this example.

Figure 4: Specifying the Face Offset, Before Generation

Click on Generate the Design Point to see what the offset looks like:

Figure 5: The Offset Face after Generation

Here is where it gets a little tricky.  All you did was define a potential geometry change.  That change is not applied to the model until you actually set parameters and apply them.   And, the parameter is controlled at the Project Schematic level, not within FE Modeler.  The value you put in under Design Point, that is simply a maximum value that the program uses to figure out how to do the Morphing.  The actual morphing uses the parameter as defined in the Project Schematic.

To see this click on Parameterized Configuration and you will see that there is 1 parameter, it is called Mesh.Morpher.1, and its value is 0.  (Figure 6).

Figure 6: Configuration Information after Offset is Defined

Therefore, your next step is to go to the project schematic and change the offset value to some new value you want to morph the mesh to (remember, the value we put in for the Design Point is our guess at the maximum value, we can use any value we want for the parameter value).  To change the value in the Project Schematic, bring up the schematic and click on the parameter bar.  You should now see the parameter in the Outline view. For this example, I changed it to 17.354.  Now exit back to the parameter manager and click on Update Project.  Go back to your FE Modeler window, click on Parameterized Mesh, and you should see the morphed mesh:

Figure 7: Morphed Mesh

Figure 8 shows an animation from an offset of 0 to 30:

Figure 8: Mesh Morphing from an Offset of 0mm to 30mm

To get the mesh out and usable in your model you have one more step.  If you click on Write Solver File now you will get your original geometry.  You need to click on Parameterized Mesh then click on the Update FE Modeler Mesh icon.  Now set your Target System and chose Write Solver file.  Or, if you are staying in workbench, drag a new system onto the Model in the Project Schematic.  The cool thing about this is that you now have a parametric model that is linked to an analysis in Workbench. It is therefore easy to do design studies, optimization, and the rest of the cool things Workbench is great at, and without CAD geometry!  Figure 9 shows an example of using the mesh for a modal analysis.

Figure 9: Using the Morphed Mesh in a Modal Analysis

## Getting More Complicated

Although the process is the same, you can get a lot more complicated.  The program allows for five different translations, offsets or projections, and some of them have multiple options within. They are all kind of self explanatory.

Figure 10: Morphing Options

Here is the description from the help as a reference:

 Translation (of vertices, edges, surfaces, or parts): A translation is given in the global Cartesian coordinate system or by the definition of a translation vector between two points. Rotation (of vertices, edges, surfaces, or parts): You must define a rotation axis between two points or a point and a vector and then give a rotation angle in degrees or radians. Face (Surface) Offset – a Face Offset can be: Uniform – Enter a negative or positive Offset Value to move the face inward or outward. Non Uniform – Enter a negative or positive Offset Value to move the face inward or outward. With this transformation, you can offset a surface with a nonlinear curve. In addition, a Non Uniform surface offset includes the following options: Distance to the edges – Define the distance from the edges to the maximum displacement of the transformed face. Function type – Select a function type based on the shape you want to obtain, options include: Linear, Double Tangent, Linear-tangent, Tangent-linear. Immobile edges – By default, all of the edges for the target surface are selected. You can de-select edges if desired. Edge Offset: An offset of one edge along a face by a specified distance; always with a given sign depending on the edge normal. Projection: a projection of a face, an edge, or a vertex onto a face, edge, or vertex or a group of faces or a group of edges. The Projection transformation works in tandem with the Working Geometries feature. Using an imported Working Geometry, you can project the entities of a Target Configuration onto the entities of the imported (Working) geometry.

For this example I added a rotation for the block sticking up, a translation for the top circle face of the cylinder, and an edge offset for the lower right edge.  the result is shown in Figure 11.

Figure 11: Part with Offset, Rotation, Translation and Edge Offset Applied. Overlaid on Original Mesh

Figure 12: Part with Offset, Rotation, Translation and Edge Offset Applied. Labeled.

Figure 13: Animation of Morphing

Whew, that is a lot of material, and we are out of time to get this article back.  Look for a Part 3.5 in the near future filling in some missing pieces and a few more examples.

If you want to try this yourself, ask you sales professional for  temp Key of the ANSYS Mesh Morpher. And as always, start simple and work your way to more complex parts.

## Mapped Face Meshing in ANSYS Workbench

In the era of automatic tetrahedral meshing, many have lost their way.  Wondering analysts simply read in their geometry, specify a few sizing controls, hit a mesh button and get a mesh.  But in the end, they receive a mesh that is not ideal, especially on the surface.  What these meandering meshers need is a map… a mapped mesh.

OK, that is a pretty lame introduction, but I’ve run out of Monty Python references and I don’t have Doug’s B movie knowledge.

Bad intro aside, many users are not aware of the strong capabilities available in Workbench meshing for creating really nice mapped meshes on surfaces.  Once created, these mapped meshes can be used to mesh 2D and shell models as well as to extrude a mesh (sweep method) for a 3D Hex mesh or a ‘seed’ mesh for a tetrahedral mesh (patch conforming algorithm).  By using a controlled mapped mesh, users can ‘find’ their way to a better mesh.

## Mapped Mesh Method

The Mapped Mesh Method has been an Mesh Control that has been in ANSYS for a while.  It is found in the Mesh Control menu item when you are in the Mesh part of the tree, or by RMB->Insert->Mapped Face Meshing.  For simple geometry, and some not so simple, you simply slap that control on a face or faces and let ANSYS figure out the best way to make a mapped mesh.

Figure 1: Insert Mapped Face Meshing

In the past, the area had to be a pretty “square” topology – four easily identified edges.  But over the last couple of releases more intelligence has been added to recognize complex geometries as mapable. Figure 2 shows several different topologies and how the mesher does a nice job of mapping them with no user modification.

Figure 2: Automatic Meshing of Complex Topologies with Mapped Meshes

Note that the last topology did not map mesh.  We will come back to that.  But the other five all meshed with a nice looking mapped mesh. So how does ANSYS figure out how to do this?

What they do is take geometry and break it up into 4 sided chunks.  They call this making Submaps.  But to do this they need to identify the outside edges in terms of squarish topology. The secret to doing this is identifying the vertices (points where edges connect) as either a corner, a side or an edge.  Figure 3 (stolen from the user manual) shows an example of each:

Figure 3: Vertex Types

The algorithm identifies the vertex type by looking at the inside (mesh side) angle formed by the two edges attached to the vertex using based on the following table:

 Vertex Type Angle Range Number of Elements Connected Image End 0°-135° 1 Side 136°-224° 2 Corner 225°-314° 3

You can get a feel for the algorithm (but not the actual one, it is much more complex) by stepping through breaking up the geometry in Figure 3 and follow the following steps in your head:

1. Mesh the edges creating nodes on the edges based on local and global meshing settings
2. March around the edges making virtual edges that combine by combining any edges linked by Side vertices (the only one is F-G-A in this example).
3. Go to the first corner you encountered.  Shoot a line along the vector from B-C until you intersect with an edge. Find F-E.
4. Count number of nodes from A-B, call it N. Then count N nodes from F toward E and make the Nth node a virtual vertex H.
5. Draw a virtual edge from C-H. Note, B-C-H is now one virtual edge because in B-C-H, C is now a Side vertex.
6. Keep marching around from H till you get back to A.  You end up with 4 corners so now you have a sub map.
7. Go back to where you broke off, C, and march around to C (remember H-C is now an edge and C looks like an End in this topology) until you get another corner.  You now have the second sub map.

Pretty cool, huh. I wish I would have thought of that.  The actual method is of course much more complex and has allsorts of checks and “if this, than do that” stuff in it.

## Helping the Algorithm Out

Sometimes the angles just don’t work out so you need to go in and tell the mesher what is a corner, side, or end.  You do this in the Details view for the Mapped Face Meshing method you attach to the face.

Figure 4: Details View for Mapped Face Meshing Method

You basically click on the cell for Sides, Corners and Ends and then identify the vertices for each.  The last example in figure three has rounded corners so the algorithm identifies the vertices on the rounds as Sides because they are 180° apart. The result is the free mesh shown in Figure 5. If you want a mapped mesh, you need to specify the vertices on the rounds. Figure 6 shows the result. Well, maybe sometimes the free mesh is better.

Figure 5: Resulting Free Mesh with Automatic Identification of Vertices

Figure 6: Mapped Mesh after Manual Identification of Vertices

The other option on really nasty geometry is to take it into DesignModeler and imprint the surfaces to create your own sub maps.

## Conclusions

In most cases, just putting a Mapped Face Meshing control on a surface will give you a nice mapped mesh.  The mapped mesh is usually more uniform, has less distorted elements, no triangles, and usually has less nodes. But a mapped mesh is not always better, you need to use your engineering judgment to decide which is best in each application.  I like to use this control on fillets and on blocky parts.

So, when you are not liking the look of the default surface mesh, even if you are not hex meshing your model, turn off the autopilot, and try a Mapped Face Meshing control.

## FE Modeler Part 2: Converting a Mesh to Geometry

One of the “Holy Grails” of simulation is the ability to take a Finite Element mesh and convert it into geometry that you can then use to create a new mesh or import it into a CAD system as CAD geometry.  What most users do not know is that ANSYS, Inc. has a product that can do this -  FE Modeler.  With the addition of a very affordable Mesh Morpher License users have access to a straightforward process to convert a mesh into geometry.

People usually want to do such a conversion for one of two reasons.  The first is the “legacy mesh.”  They have a FEA mesh from the past that has no geometry associated with it and they want to make a new mesh or use it to create a mesh around it for CFD.  This can also be an STL file from somewhere.  The second is that they want to do an analysis or get a CAD part of a part that is distorted in some way by a load.  They may want to do a metal forming simulation and get the final shape for their assembly model or they may need to do a flow analysis on a piece of geometry that gets highly distorted.

## The Basics:

If you have ever tried to take a mesh to geometry yourself using other tools or a CAD tool, you know it is very hard to do unless you are working with a part made out of nothing but flat planes.  This is because the way a tool like this must work is to:

1. Take a 3D FEA model and finds only external faces.
2. Find edges between faces that can be considered an edge.  This is done by looking at the angle between the normals of the faces and if they are above a certain criteria, they are tagged as an edge.
3. Gather the edges into loops and find all the element faces enclosed by those loops.
4. Fit a cylinder, plane, cone, or NURB surface to the faces and bound them with the edge loops.

If you have a simple, blocky part where all the faces meet at right angles, no problem. But add a few fillets and boom, the tools can never sort out the loops. So what to do?

You need to help the algorithm out by splitting up your faces into components (or Named Selections in Workbench speak) and make sure that those components define a chunk of external element faces that are fairly easy for the program to work with. Figures 1-4 show this for some simple blocks.

Block 1 has right angle corners so the algorithm makes quick work of it and finds six surface and 12 edges.  Unfortunately, real parts rarely have all right angles.

Block 2 has fillets and a fine enough mesh such that the algorithm can’t find any edges.  It tries to turn the entire outer surface of the mesh into one big surface, and fails.  No closed loops, bummer.

Block 3 is the same as 2, except that the top surface patch is defined by a nodal component.  This gives the algorithm enough information to create two loops and therefore a valid solid. But maybe not what you want because the larger surface kind of wraps around most of the block, and when you try to turn that into a Parasolid it usually fails, as shown in Figure 4.

The 4th block has a component defined for each surface in the original CAD model.  The algorithm loves this and makes each patch into a nice surface that then converts to usable CAD geometry.  This is fairly easy (if a bit tedious) to do if you are starting with CAD geometry, meshing it, and using the deformed shape to create a new mesh.  But if you have just a mesh you will need to be a bit of a Mechanical APDL selection guru to make it happen, but more on that below.

Figure 1: Mesh from *.CDB File

Figure 2: Nodal Components

Figure 3: Surfaces After Detection

## The Process:

To illustrate the process, we will assume we have a real world problem:  You have a piece of tubing as shown in Figure 5 that you want to install into place, but to do so you really have to distort it (Figure 6 is the stress analysis results in the installed shape).  As you can see, there is significant ovalization and you need to figure out what the flow will be in this distorted shape.

 Figure 5: CAD Geometry Figure 6: Installed Shape

Figure 7: Project Schematic of Stress and Fluid Runs

So the first step is really in the CAD area.  You need to use ANSYS DesignModeler to split your geometry up into surfaces that can be easily found and refit by FE Modeler.  One thing that always helps is to split any cylinders in half.  Break up long, nasty surfaces and merge together any small and complex ones.  You can create your components (Named Selections) here or in ANSYS Mechanical, your call.  But either way every surface that is not a plane needs to be given an individual name.  If your CAD systems supports it, you can do it in the CAD system as well before you slice and prep in ANSYS DesignModeler.

 While I was writing this article Matt Sutton was doing Part 3 of his Mechanical Scripting HOWTO.  I asked him if he could make an example script that would automatically create a Named Selection for each surface in a part.  You can find it here: http://www.padtinc.com/blog/post/2011/01/05/An-ANSYS-Mechanical-Scripting-Example.aspx If you have complex geometry, this script is highly recommended.

Next, move into ANSYS mechanical and set up your analysis like you normally would.  If you didn’t bring over Named Selections, define them now.  Now you need to insert a simple code snippet into the  Solution Branch with two commands:

 upcoord, 1       cdwrite Figure 8: Command Snippet

The UPCOORD command tells MAPDL to take the current solution (by default the last load step. If you want a different point in the solution, you need to add a SET command first) and move the nodes to the deflected shape that has been calculated. After this command your nodes are in your deformed shape. The CDWRITE command simply writes the model to a text file, and because your nodes are in the deflected position, that file will contain your distorted geometry.  Run your analysis and when it is done, the snippet is executed and the *.cdb file is written.  If you already have a solution and do not want to rerun, just go into ANSYS MAPDL and type the commands into /POST1.

Now that you have the distorted mesh, you need to get it into FE modeler.  Create a new standalone FE Modeler system and RMB on Model and choose Add Input Mesh…  Your *.cdb file is going to be in your project directory in the dp0/sys/Mech directory (of course, this assumes that you only have the one model in your project.  Use the appropriate dp* and sys* to identify your file if you are using something other than the first model in your project).

If you are not using SI units you will need to set the properties for the FE Modeler system and for the file in the Project Schematic or things will get all messed up. To do this RMB on the Model cell and choose properties.  Set the units for FE Modeler here.  Then RMB again on the cell and choose Manage Input Meshes.  This shows the file in the outline view and when you click on it, you can change the Unit System property.

Figure 8.5: Setting Units on FE Modeler and on your input mesh file

Launch FE modeler and make sure your mesh came in without any problems.  Check the Bodies and the Element types, etc…  Then look at your components in the tree.  Note that it not only captured the surface components you defined, any nodal constraint or load that you defined will show up as well.  You may need to delete some components. You can also use the selection capabilities in FE Modeler to make new components.

Once you are happy with that, it is time to let the program find faces.  Select Geometry Synthesis in the tree and then in the Details make sure that “Use Node Components” is set to Yes!  This is very important and the most common mistake users make.

Figure 9: Nodal Components in FE Modeler

Now click on the Initial Geometry icon and it will go do its thing.

If you get bad surfaces, you need to go back and add more components and break things up a bit.  but if it works you should see a solid of your part.  You are not done yet.  These are not “CAD” surfaces but rather faceted (a bunch of triangles) surfaces.

Figure 10: Deformed Faceted Surface

Select Initial Geometry in the tree and you should see a “Convert to Parasolid” icon on the ribbon bar.  Click that and it will use the Parasolid modeling kernal to try and fit your surfaces.  This can take a while on a complex part.  If you split things up well enough and your mesh was fine enough, you should now have a surface model of your geometry!

Figure 11: Parasolid Surface Geometry in FE Modeler

If you geometry is simple, it will even sew it into a solid.  But if the little icon next to your part in the tree is a surface and not a block, you still need to sew things together.  Do this by choosing the Add a Sew Tool icon or RMB-> Add a Sew Tool.  Select the surfaces you want to sew, using the tree being the easiest way to select all of them.  Then hit the generate button and see what you get.  If it does not make a solid, make the tolerance number a bit bigger.  If that still does not work, you may need to export the surfaces to a CAD tool with good surfacing and sew it there.

To export your distorted geometry, select Parasolid Geometry in the tree and choose Export to a Parasolid File or RMB-> Export to a Parasolid File.

You have done it, you have real CAD geometry of your deformed shape!

Figure 12: The Holy Grail: You Distorted Geometry in Your CAD System

Getting the distorted shape into CAD is pretty critical, at least now your drawings are realistic instead of some guess at the installed shape.  But if you need to do more analysis, that proceeds like any other simulation.  You read in your CAD geometry (CAD geometry you made from distorted nodes, yea, that is what I’m talking about! Hoooo haaaa!) and set it up for your analysis and run it.  In our example we took the Parasolid file into DM and created a fluid volume inside the pipe (which is way easy to do in DM) and then did a CFD run.

All in ANSYS products, all within the Workbench Environment.

## Starting with a Legacy Mesh or STL file:

The reason why the above method worked so well is that we had original CAD geometry that we could make components for.  When you start with just a legacy mesh without components you need to get in there an make nodal components on the surface.  FE Modeler has some basic node picking capabilities that you can use, but for real parts you really need to get into ANSYS Mechanical APDL and use the following method:

1. Use ESURF with MESH200 elements to create a surface mesh from your solid mesh.
2. Delete the solid mesh
3. Use picking, selection commands and such to break those elements into surfaceable chunks.
4. When you have things split up fairly well, CDWRITE to make a CDB file for FE Modeler.

This can be pretty tedious, but a bit of up-front work will result in nicer surfaces, or determine if you even get a solid model.