A quick video showing a new way to create section planes by using coordinate systems.
Back “in the day” when we rode horses into work as Finite Element Analysis Engineers, we had somewhat limited compute capacity. 70,000 elements was a hard and fast limit. But we still needed accurate results with local refinement in areas of concern. The way we accomplished that was with a process called submodeling where you make a refined local model just of the area you care about, and a coarse mesh that modeled the whole part but still fit on the computer. The displacement field from the coarse model was then applied as a boundary condition on the refined model.
We called the refined model a zoom model or a submodel. It worked very well for many years. Then computers got bigger and we just started meshing the heck out of those areas of interest in the full part model. And in many cases that is still the best solution for an accurate localized stress: localized refinement.
Submodeling is one of those “tricks” in stress analysis that used to be used all the time. But until recently it was a bit of a pain to do in ANSYS Mechanical so it fell out of use. Now, the process of doing submodeling is easy, efficient, and accurate. The purpose of this posting is to introduce the concept to newer users who have not used it before, and show experienced (old) users how much easier it is to do in ANSYS Mechanical vs. Mechanical APDL.
What is Submodeling?
The best description of submodeling is the illustration that has been in the ANSYS help system, in one form or another, for over 25 years:
The basic idea is that you have a coarse model of your whole part or assembly. You ignore small features in the mesh that don’t have an impact on the overall response of the system – the local stiffness does not have influence on the strain beyond that local region. You then make a very refined model, the submodel, of the region of interest. You use the displacement field (and temperature if you have a temperature gradient) from the coarse model and apply it to the submodel as a boundary condition to get the accurate highly-refined response in the area of interest.
The process is based on St. Venant’s principle: “… the difference between the effects of two different but statically equivalent loads becomes very small at sufficiently large distances from load.”
What a cool name this guy had: Adhémar Jean Claude Barré de Saint-Venant. To top it off he was not just a mathematician, but he was given the title of Count as well… a count mathematician. And, I have to say, I have serious beard envy. He had some very nice facial hair, I can’t even grow thick stubble.
Anyhow, what he showed was that if you are looking at the stresses in a part far away from where loads are applied, how those loads are applied does not matter. So we can replace the forces/pressures/etc… from our course model as an equivalent static deflection load and the stress field will be the same.
The way this is done in a Finite Element model is you determine what faces in your submodel are “inside” your course model. These are called the cut boundary faces and the nodes on those faces are the cut boundary nodes. and you apply the displacement field from the coarse model onto the nodes
The most common use is to add mesh refinement in an area without having to solve the whole model. Another common usage is to actually mesh small features like fillets, holes, and groves that were left out of or under-meshed in the full model. It can also be used to capture material non-linearities if that behavior is highly localized.
But probably the most beneficial use today is to study the parametric variation of small features like the size of a fillet or a hole. If changing the size of such features does not change the overall response of the system, then you only need to do a parametric study on the submodel – as the guy with the great beard proved, if the static load does not change with your geometric variations, you don’t have to look at the whole structure.
And don’t forget the new crack growth capabilities. You will probably want to do that on a submodel around your crack and not on your whole geometry.
Here is a more modern version of the original example geometry:
The red highlight shows the cut boundaries. this is where you need to apply the displacement field.
This is the nasty coarse mesh. Now if you were modeling a single part, you would just mesh the fillets and be done with it. But assume this is in a large assembly.
The Submodel. Nice elements in the key area.
You can even set up the radius as a parameter and do a study, where only the Submodel is modified and updated.
The process is fairly simple:
- Make and solve your full model
- Make a geometry model of the area you want a submodel in
- Attach the submodel to the engineering data and solution of the full model
- Set up and solve the submodel
Before we get started, here is a ANSYS 14.5 archived project for both models we will discuss in this posting: PADT-Focus-Submodeling-2013_08_14.wbpz
For the sample geometry we showed above, the system looks like this:
When you go into ANSYS Mechanical for the sample model, you have a new model branch:
When you first get in there, the branch is empty, you have to insert Body Temperature and/or Displacement:
The Details for the Displacement object are as follows:
There are a lot of options here. It is basically using the external load mapper to map the displacements. Consult the help and just play around with the options to understand them better. In most cases, all you need to do is specify the faces that you want the displacement field applied to for the Scope section.
A cool feature is that once you have specified the faces, you can “Import Load” and then view them by clicking on the object. Graphics Control –>Data = All shows vectors. Total/X/Y/Z shows the applied displacement field as a contour:
Now you just need to make sure your Submodel is set up correctly, you have the mesh you want, and any other loads that are applied directly to the Submodel are the same as the loads in the full model (see next section). Run and you get your refined results.
Here is that same process with a more realistic model of a beam with a tube welded on it. The welds are not modeled in the full model and the fillets in the beam are very coarse.
So here is the geometry. Imagine that these two parts are actually part of a very large assembly so we really can’t refine them the way we want.
This is what the systems look like. Note that the geometry comes from one source. I made the submodel in the same solid model in DesignModeler and just suppress the parts I don’t want in each Mechanical model.
The loading is simple. I fix one end and put a force on the top of the tube.
And here is my coarse mesh. I could probably mesh the tube with a lot more elements, especially along the axis.
The results. Not too useful from a stress standpoint. Deflections are good, but the fillet is missing and beam is too coarse.
So here is the submodel. All the fillets are in there and it is just the area around the connection.
I used advanced meshing to get a really nice refined mesh. It only solves in about 20 seconds so I can really refine it.
Here are the cut boundaries. The bottom of the beam ribs are also selected.
And here is the result. A really accurate look at the stresses in the fillet. I could even put a probe in there and do some nice fatigue or crack growth.
The other thing that showed up were some stress problems on the bottom of the beam. Those could be an issue under a high load. The fillet stress on top my yield out but these stresses under the beam could be a fatigue problem.
Tips and Hints
In most cases, doing a sub model is pretty simple. But there is a lot more to it than what we covered here. Because I need to get back to some very pressing HR tasks, I’ll just list them here so you know that you are aware of them:
- Label your systems in the project page with some sort of “full” and “sub” terminology Things get really confusing fast if you don’t.
- You can do submodeling with a transient or multiple substep model. In your Imported Displacement/Body Temperature, specify what load step to grab the loads from.
- Don’t forget temperature. One of the most common problems is when a user applies temperature and therefore gets thermal stress. They then forget to apply that to their submodel and everything is wrong.
- Make sure you don’t change material properties. Remember, these models are statically identical, you are just looking at a chunk with greater refinement.
- Remember that loads need to be away from the area you are zooming in on. Don’t cut where a load is applied, or even near where one is applied. The exception is temperature. (Sometimes you can get away with pressure loads too, but you have to be very careful to get the same load over the area)
- Your can’t have geometry in the submodel sticking too far out of the coarse mesh. The displacement is interpolated onto the fine mesh and if a node on the fine mesh is outside the coarse mesh, the program extrapolates and that can sometimes induce errors. If you see spotty or high stresses on your cut boundaries, that is why. There are tools in the Submodeling details to help diagnose and fix that.
- If you are going to do a parametric study on geometry changes in the submodel, use a separate geometry file to create that model (I just duplicate the original and suppress the full geometry in DM). Why? Because if you change a parameter in your geometry model, both models will need to resolve since they both use the same geometry file, even if the geometry change occurs on a part that is suppressed in the full model.
- You can do submodels of submodels as many levels down as you want.
- You can have multiple submodels in one system
- Read the help, it is fairly detailed
That is about all for now. As always: crawl, walk, run. Start with a very simple sub model with obvious cut boundaries and get experienced.
We recently had a tech support request from a customer, asking for the ability to define a spatially varying thermal contact conductance (TCC) on a contact region in ANSYS Mechanical. We came up with a solution for ANSYS 14.5 via an example which includes a couple of verification plots.
The test model consists of two solids, connected via a contact region. The thermal contact conductance at the contact region was defined as a table, with the rows and columns of the table corresponding to local coordinates within the plane of the contact surface. The table was defined and implemented using Mechanical APDL commands in the Mechanical tree.
Low values of TCC were used for testing purposes. This helped verify that the tabular values were actually being used as intended. A constant temperature was applied to the face at one end of the model, while a different constant temperature was applied to the face at the extreme other end of the model. This temperature differential caused heat to flow through the contact region, subject to the resistance defined via TCC values.
The coordinates in the plane of the contact surface were Y and Z. Thus, the table of TCC values varied in the Y and Z directions, as shown here:
Y | 0.0 1.0
0.0 | 0.0001 0.0005
1.0 | 0.0005 0.0002
Three ANSYS Mechanical APDL command objects were inserted into the tree in the Mechanical editor. The first command object simply added a scalar parameter to keep track of the contact element type/real constant set number for use later:
The second command object was placed in the analysis type branch, meaning this set of commands would be executed just prior to the Solve command. This command object does three things:
1. Defines the TCC table vs. Y and Z coordinates.
2. Reads the table in as an MAPDL real constant for the contact elements identified in the first command object.
3. Issues the command, “rstsuppress,none”. More on this later.
This is how the second command object was defined:
That third step mentioned above was a key to getting this technique to work in 14.5. The rstsuppress command is not documented currently, but Al Hanq of ANSYS, Inc. has told me that it will be documented in the future. The default setting turns off contact results from being written to the results file in a thermal analysis. The idea is to help keep results file sizes from getting excessively large, especially for transient thermal runs. In this case, we actually wanted the thermal contact results in the results file, so we issued “rstsuppress,none” so the thermal contact results were not suppressed.
The final command object was for verification of the applied TCC values. This set of commands generates two plots using MAPDL postprocessing commands. The first plot is of heat flux going through the contact elements. The second plot displays the TCC values for node ‘i’ of each contact element (averaged).
Here is the third command object:
Both of these plots show up in the tree, labeled as Post Output and Post Output 2 in the image above.
This is the resulting thermal flux at the contact surface:
Here is the applied thermal contact conductance, as mapped from the table defined in the second command object:
In summary, we took advantage of Mechanical APDL command objects to apply thermal contact conductance values that vary along the contact region. We also used MAPDL commands to create two plots that help verify that the TCC values were applied as intended. Hopefully this is a helpful example.
Most of the time ANSYS Mechanical does a great job of keeping track of all our input and output files needed for a particular simulation. Every once in a while though, a glitch can happen which could lead to a corrupt database that gives you errors, say, if you try to reopen the ANSYS Mechanical editor. If you suspect that somehow your project database for a Mechanical model (or any other model that uses the same interface as ANSYS Mechanical) has been corrupted, you just might be able to recover it using these steps:
1. Copy any .mechdb files from the project directory to a different location. Rename them to a .mechdat extension. These will be named SYS.mechdb, SYS-1.mechdb, etc. The easiest way to find these files is to click on View > Files from the Workbench window, then scroll through the list until you find the .mechdb file or files. Then right click on each one and select “Open Containing Folder.” This will open Windows Explorer in the directory in which the file resides. You can then copy the files to a new location and rename them to .mechdat extensions.
2. Copy any .agdb (DesignModeler) files or other geometry files from the project directory to a different location. These will be named SYS.agdb , SYS-1.agdb, etc. (for DesignModeler) and can be found using View > Files as I described above. No need to rename these.
3. Start a new Workbench session.
4. Click File > Import. Set the type of file to import to “Importable Mechanical File”. Browse to the two .mechdat files created in step 1 (by renaming the copied .mechdb files) and import each.
5. If needed for geometry files, in the resulting Project Schematic in the Workbench window, right click on the first block’s geometry cell and select Replace Geometry > Browse. Browse to the copied SYS.agdb file or other geometry file from step 2. Repeat any additional analysis block in similar fashion.
6. Then save the project with a new name and directory.
This should allow you to recreate a Workbench project that allows you to continue working. We hope this suggestion is helpful if the need ever arises to use it.
(Artwork by Eric… Ted does much nicer smiley faces)
Postprocessing results along a path has been part of the Workbench Mechanical capability for several rev’s now. We need to define a path as construction geometry on which to map the results unless we happen to have an edge in the model exactly where we want the path to be or can use an X axis intersection with our model. You have the option to ‘snap’ the path results to nodal locations, but what if you want to use nodal locations to define the path in the first place? We’ll see how to do this below.
For more information on “picking your nodes”, see the Focus blog entry written by Jeff Strain last year: http://www.padtinc.com/blog/the-focus/node-interaction-in-mechanical-part-1-picking-your-nodes
The top level process for postprocessing result along a path is:
- Define a Path as construction geometry
- Insert a Linearized Stress result
- Calculate the desired results along the path using the Linearized Stress item
The key here is to define the path using existing nodes. Why do that? Sometimes it’s easier to figure out where the path should start and stop using nodal locations rather than figure out the coordinates some other way. So, let’s see how we might do that.
- First, turn on the mesh via the “Show Mesh” button so that it’s visible for the path creation
- From the Model branch in Mechanical, insert Construction Geometry
- From the new Construction Geometry branch, insert a Path
- Note that the Path must be totally contained by the finite element model, unlike in MAPDL.
- If you know the starting and ending points of the path, enter them in the Start and End fields in the Details view for the Path.
- Otherwise, click on the “Hit Point Coordinate” button:
- Pick the node location for the start point, click apply
- Pick the node location for the end point, click apply
- In the Solution branch, insert Linearized Stress (Normal Stress in this case); set the details:
- Scoping method=Path
- Select the Path just created
- Set the Orientation and Coordinate System values as needed
- Define Time value for results if needed
Results are displayed graphically along the path…
…as well is in an X-Y plot and a table
Besides normal stresses, membrane and bending, etc. results can be accessed using these techniques. So, the next time you need to list or plot results along a path, remember that it can be done in Mechanical, and you can use nodal locations to define the starting and ending points of the path.
Selection Information, Manage Views, and Changing Settings on Multiple Load Steps
There is no way to hide the embarrassing reality. I am supposed to be an expert. I am introduced to people as such. People all over the world read stuff I write about how to use ANSYS products more effectively. But last week and this week, humility has struck a devastating blow on my ego. I found three very useful things in ANSYS Mechanical that I either didn’t know, or forgot about. I even mentioned one of them (Manage Views) in an update presentation as “cool and very important feature” then promptly forgot it was there.
As payment for my sins, I will share a brief description of each with all of you, in the hopes that I will: 1) make you feel better about yourself because you already knew this stuff, or 2) give you the knowledge you need to avoid the embarrassment, and lost productivity, that my ignorance has brought me.
I mention this one first because it was pointed out to me by no less than the ANSYS Mechanical product manager at ANSYS, Inc. Yikes. I believe he actually did a face palm when I asked him “What is Selection Information? There is an Icon with an i on the toolbar? Really?”
There it is, right next to the Worksheet icon, an icon I use all the time. What it does is give you information about geometry, CAD and nodes, in your model. There are three ways to get it, not just the icon on the toolbar:
- Click the Icon
- In the menu go to View>Windows>Selection Information
- Double-click on the Selection details at the bottom of the ANSYS Mechanical Window
However you use it, you will get a new window, embedded with the existing windows, that shows you information about the geometry entity of entities that you select. Normal selection options apply. You can pick vertices, edges, surfaces, or bodies. I like to drag it out as it’s own window so I can see it all. (Notice how I talk like I do this all the time… yea, whatever. I just figured out that it is a lot better if I drag it out and look at it by itself.)
My sample model is just a cylinder, so If I pick the end and the cylinder I get:
See how it lists the two faces, and a summary. There is some internal info in there as well like ID’s that ANSYS mechanical uses to do stuff. The toolbar across the top lets you select a coordinate system to do the calculations in, set options (the green checkbox) or control if you want individual info, summary info, or both.
The options are useful because by default, everything is on. Turning some stuff off can reduce the clutter.
For nodes, I can get location, node number, and body information:
When you are in the window there are some useful things you can do with the list. The first is sort by clicking on the column headers. What node is at your max X position in your cylindrical coordinate system? Just set the Coordinate System and click on X(in) twice to sort from max o min:
If you select any of the cells, you can right mouse click and get a context menu that lets you reselect the entities being listed, export to a text or Excel file, Refresh, or copy to the clipboard:
Give it a shot next time your in a model and want to know some stuff.
One of the more useful capabilities in ANSYS Mechanical APDL is the ability to define views in a macro and call them back up again, getting the same standard views every time. Well you have been able to do that in Workbench when the introduced the “Scary Eye” icon at I think 14.5 (maybe 14):
Although it looks like a secret Masonic symbol, the icon actually represents a handy tool for saving views not only in your model but to files. It is also available in View->Windows->Manage Views.
Not only that, it lets you save the view commands to an external file that you can use with other models or even go in and edit to create a very specific view.
When you start it up, it brings up its own little window as well, that has eye themed icons to control your view saving/recall experience.
- “Spooky Eye Box with a Plus Sign” creates a view from the current view you are seeing
- “X” deletes the currently selected view or views
- “Guy with 80’s hair looking at a box” applies the currently selected view. Double-clicking on the view does the same thing.
- “A-bar-B” is used to rename the selected view
- “Spooky Eye Box with Green Blob” redefines the currently selected view with whatever the current view settings are in the graphics window. Think of it as an overwrite.
- “Disk with arrow out” reads in a saved view file from disk.
- “Disk with arrow in” saves the currently selected view to disk.
So, get your model positioned the way you want it using the mouse to control the view, then click the first icon to save it. The program puts the window into “rename” mode so you can give it a descriptive name here. Just keep doing that till you have all your views defined.
If at some point you want to change view, no need to delete and recreate it. Simply Click on the view you want to redefine and then click on “Spooky Eye Box with Green Blob.”
Note: You can only select more than one view and delete it. None of the other commands work for more than one view. But the save views command saves all the views, regardless of how many you have selected.
Here are some views I created:
Now it gets cool. Click on a view and then click on the “Save” (last) icon. It will save the views as an XML file. Pop that into your handy-dandy XML editor and you can check out the view definitions:
This is where I get excited. Now you can go into this file and create your own view, or modify a view to be very specific. I didn’t have enough time to figure out what all the options did, but if you get a view that is close to what you want, you should be able to modify it from there.
The last thing to talk about is what happens if you right mouse click on a view? You get:
Yes, copy as MAPDL! Not only is this useful for us old guys that just like to look at MAPDL, it lets you use the same view for any plots you may make with a code snippet as you used for the plots in ANSYS Mechanical. So your views are consistent for all your plots!
Modifying Multiple Load Steps
This was one of those “there has to be a way to do this” moments. We were talking about different ways to speed up the solution of a transient thermal model and I suggested that instead of using automatic time step controls they put in some values. But for the life of me I couldn’t figure out how to change a bunch of load step settings at the same time, so I was changing them one at a time. For every step, change the step number, then change the value:
Yawn! This started off a “well in ANSYS classic, I could write a script that would… blah… blah… blah…”
There has got to be a better way. There is. In the Graph window the load steps are shown on the X-axis. Simply multi-select the steps you want to change there:
In the example above I CTRL-Clicked steps 3, 5, and 7. Now my Analysis Settings details view looks like:
See how Current Step Number and Step End Time are “Multi Step”. Any change I make to settings will now be applied to the selected steps. A huge time savings. And a big “Duh, I should have known that!”
A quick video showcasing the automatic contact generation feature in ANSYS Mechanical. This feature automatically selects the faces that are in contact or are close to contact and assigns a contact definition.
We are pleased to introduce a new feature in The Focus blog, video posts. With this entry we are putting up our first “The Focus Video Tips, Examples, and Demonstrations” Sometimes a video just works better, especially when showing how to do something in a Graphical User Interface.
So we have put some basic infrastructure in place and that lets us quickly record something on one of our computers, stick a title and end slide on it, and then upload to YouTube.
In this first entry, we show how easy it is to read in geometry from SolidWorks to ANSYS Mechanical.
Good news out there in ANSYS land. ANSYS, Inc. just made the relationship with EVEN as close as possible – by acquiring them. Here at PADT it was love at first sight when we first were introduced to the ANSYS Composite PrepPost (ACP) add-on. The solver capabilities in ANSYS Mechanical APDL have been very strong for composite modeling for some time. But the pain and suffering required to set up a complex composite geometry kept many users from accessing those fantastic elements. ACP solved that problem by providing a tool that takes care of the bookeeping and geometry issues involved in building an accurate model of composite layups.
Here is the official press release.
With this acquisition ANSYS, Inc. has secured the future development of this tool and given all of us in the ANSYS world even better access to the consulting team at EVEN. You can learn more about the ACP tool on our ACP page. We also have an older blog posting on ACP when it came out. We also did a seminar on the last release, here is the recording to that. [probably time to write an updated posting on newer capabilities…].
Learn more about EVEN on their web site.
This is great news, and we can not wait to see further improvements in the composite modeling capabilities for the ANSYS Product family.
PADT’s popular “ANSYS Customization with the ANSYS Parametric Design Language Guide” Has been updated and reformatted as a book and published as “Introduction to the ANSYS Parametric Design Language” in both softcover and Kindle formats.
This book started life as a class that PADT taught for many years. Then over time people asked if they could buy the notes. And then they asked for a real book. The bulk of the content came from Jeff Strain with input from most of our technical staff. Much of the editing and new content was done by Susanna Young and Eric Miller.
Here is the Description from Amazon.com:
The definitive guide to the ANSYS Parametric Design Language (APDL), the command language for the ANSYS Mechanical APDL product from ANSYS, Inc. PADT has converted their popular “Introduction to APDL” class into a guide so that users can teach themselves the APDL language at their own pace. Its 12 chapters include reference information, examples, tips and hints, and eight workshops. Topics covered include:
– User Interfacing
– Program Flow
– Retrieving Database Information
– Arrays, Tables, and Strings
– Importing Data
– Writing Output to Files
– Menu Customization
At only $75.00 it is an investment that will pay for itself quickly. Even if you are an ANSYS Mechanical user, you can still benefit from knowing APDL, allowing you to add code snippets to your models. We have put some images below and you can also learn more and purchase your copy on Amazon.com. They can ship anywhere in the world.
My mother in law is still getting used to the concept of a smart phone.
MIL: “Do you have a GPS so you know how to get there?”
Me: “There’s an App for that.”
MIL: “Do you have a flashlight?”
Me: “There’s an App for that.”
MIL: “Do you have a chromatic tuner?”
Me: “There’s an app for that.”
OK, maybe my mother-in-law didn’t ask about the tuner, but there is in fact an app for that.
In similar fashion, now that ACT (ANSYS Customization Toolkit) is a reality, we can start answering questions with, “There’s an Extension for that.” What is an extension? It’s a bit of customized software that you can integrate with ANSYS Workbench to have it do things that aren’t built in to the current menus.
We’ll leave the nuts and bolts of how Extensions work for another article, but please be aware that current ANSYS customers can now download several Extensions from the ANSYS Customer Portal. We’ll take a look at one of these in this blog entry.
To access the currently available extensions, you must have a login to the ANSYS Customer Portal and be current on maintenance (TECS). Within the customer portal, the Extensions are available by clicking on Downloads > Extension Library; then click on ACT Library.
As of this writing there are 12 extensions available for download. These vary from the sophisticated Acoustics Extension for 14.5 to simpler extensions such as the one we’ll look at here which allows you to change the material property numbers of entities in Workbench Mechanical.
Once you have downloaded the desired extension, you’ll need to install it. For use in the current project, you click on Extensions at the menu near the top of the Workbench Window and click on Install Extension.
After clicking on Install Extension, you browse to the folder in which you have saved the downloaded extension. The Extension file extension (I’m not making this up) is .wbex. Here is what it looks like when loading the material change extension:
Next you must click on Extensions again the Workbench window, and click on Manage Extensions. That will bring up this window.
Check the box next to any extensions you want to load, then click Close. If you have already launched the Mechanical editor, you will probably need to exit Workbench and get back in or at least click on File > New and reload for the new extension to show up.
When you open the Mechanical editor, the new extension should show up in the menus. Here is what the material change button looks like after the extension has been loaded:
Each time you open a new Workbench session, you’ll need to click on Extensions > Manage Extensions if you want an extension to be loaded into the Mechanical editor.
Alternatively, you can have an extension load every time by clicking on Tools > Options from the Workbench window, followed by a click on Extensions. Enter the name of the desired extension in the box, as shown here.
After clicking OK, any new Mechanical editor session will have the material change extension loaded.
So, what good is it? I will now show a simple example of implementation of the material change extension. The idea here is that we have a bolted connection and we want to look at two different conditions by changing the material properties of the washers to see what effect that has on the results. Using the material change extension, I can force the washers (and nuts and bolts too) to have a specific material number rather than the default value assigned by Workbench. The material number is used in the Mechanical APDL batch input file created by Workbench to identify which elements have which material properties.
Now before you APDL gurus get all riled up, yes, I know this can be done with the magic ‘matid’ parameter. That’s how we’ve been doing things like this for years. The material number extension is nicer since it’s an actual button built into the GUI. We’re really trying to show how extensions work here, not necessarily the best way to simulate a model with changing material properties.
That all being said, here is what it looks like. Clicking on the ‘matchange’ button in the menus inserts a new matchange object in the tree under the analysis type branch. In this example, the matchange button has been clicked three times, resulting in three matchange objects.
The matchange functionality requires that we create Named Selections for any entities for which we want to change material property numbers. How do I know that? When I downloaded the extension from the ANSYS Customer Portal, a nice read me .pdf file came along with it.
Here I have clicked on matchange 2 in the tree and identified the Named Selection for the entities I want to change, in this case the named selection Washers. I then entered my desired integer material number for these entities, 102.
Finally, in order to demonstrate that it works, I added on command snippet under the Static Structural branch, containing these APDL commands:
esel,s,mat,,102 ! select material 102 – washers.
Those commands select the washers by my user-defined material number (I could have also selected by named selection). The commands then define new material properties for material 102. Again, there are other ways to do this, but this shows the effect of the extension. Note that this command snippet is set in the details view to only be active for load step number 3. Load step one applies bolt pretension. Load step 2 solves for the operating load with the original material properties and load step 3 solves for the same loads but with the modified material properties for the washers.
This plot shows von Mises stress in the washers vs. loadstep/substep. As you can see in the graph below the stress plot, indeed the von Mises stress is changing due to the material change from step 2 to step 3. This was a nonlinear analysis with large deflection turned on.
So, this should give you a taste of what extensions are and what can be done with them. The next time you are asked to do something in Workbench for which there isn’t a built-in menu, you may be able to say, “There’s an extension for that!”
I have been doing this simulation thing for too long. I actually got giddy when I saw a new icon in 14.5. That usually is enough to get me going. Then when I saw it allowed me to put tags on items in my model tree, the OCD part of me got very interested. When it became apparent that it all worked with filtering I got down right joyful. These are the sort of little tools that can make your analysis process a lot more enjoyable and efficient. And to be honest, these are the things that we used to use APDL to control in the old days, and that we have been needing a GUI equivalent for in ANSYS Mechanical. In this weeks posting we will look at the new tagging, and then take an in-depth look at what you can do with filtering.
Both of these tools are ways for you to get a handle on larger models. When you have one or two parts in an assembly, and maybe four or five loads and boundary conditions, you can see all of your model in the tree in one quick glance. But when you are dealing with a big assembly, with dozens if not hundreds of parts, contacts, boundary conditions, etc… it can become overwhelming and you spend all of your time looking through the tree. And thanks to the hard work of the ANSYS development team, Filters and Tags come to the rescue.
So the cute new little icon is a picture of a tag, and it is used to tag things. I like it when things are that literal. Do note that it is used to tag items in your model outline, not geometric entities. Why? Because you have named selections for that. This is for grouping things that are not groupable with named selections.
When you click on the Tag icon it brings up the Tags window. It looks like the default state for this window is free and floating. I found that it goes nicely under the details window, or as a tab under the model tree itself. If you are not familiar with how to move windows around in ANSYS Mechanical, here is a short video:
When you first bring the window up it will be blank.
To create a tag you go to your Outline and select (CTRL-Click to select more than one) the items you want to group. For this first example I am going to put all my size controls in a group:
Then go to the Tags window and click Add icon (tag with a green plus) and give it a name:
Now you have your first tag:
The way tags work is that the checkbox next to the name is there to add an entity to a tag, remove it from a tag, or to show that it is currently part of the tag. To see this we can click on something that is not in the tag group and note that the check box is un-checked:
Then if we click on one of more of the edge sizes, the check box is checked:
If I want to remove one or more of the entities from the tag, select them and un-check the box. The same goes if I want to add an entity, click on it, then check the check box. Easy as can be.
The only other thing you should know is that if you want to delete a tag completely, click on it and RMB->Delete Tag(s) or click on the delete icon (tag with a red minus sign). To rename a tag, click on the rename tag icon, which is just a picture of a tag with now fancy additions.
The other interaction you should be aware of is the ability to select items in the tree by Tag. You can do this with filters, which we will cover next, or by doing a RMB on the tag and choosing “Find Items with selected tag”
In a huge model, this can really speed up finding things in the tree.
You may have noticed by now that Tags are non-exclusive. A tag can refer to more than one entity, and a given entity can have more than one tags. Because of this you can get real fancy and select entities that belong to any selected tags, or only those that belong to all the selected tags. In this example I have selected any entities belonging to Sizes2 and TopNSs:
You can find the union of two or more groups by choosing “Find items with all selected tags” This can become very handy in complex models.
One thing to remember is to be careful when you are clicking around in the Tags window. I found that I was checking and unchecking the boxes when I meant to just select a tag in the list. So my grouping was getting muffed up a bit.
The close cousin to tagging for managing a big tree is the ability to filter what is in visible from your tree. Again, if you have a simple model as far as item count goes, you may never need this. But if you have a complicated tree, Filtering can be a life saver.
It exists at the top of the Model Outline window. You do have to expand the window it sits in a bit more than I normally do to see all the controls. Not a big deal, but be aware of it.
The interface is pretty intuitive. You specify what you want to filter on, choose some sort of filter value, refresh the tree applying the new filter, and clear the filter. The final icon, Expand on Refresh, expands your tree to show every selected entity. On a huge tree you may want to turn this off and manually expand the tree where you need to.
Fort filter types your options are Name, Tag, Type, and State. For Name and Tag, it looks for the string you specify anywhere in the name or tag of each entity. So you don’t need to use wildcard characters. “siz” and “size” will both filter any string with size in the name… and any with just siz if you use “siz.”
If you want to filter on Type the text box turns into a drop down and you have two choices: all or results. I’m guessing that will expand over time, but right now the way you would use it is to just hide everything in your model tree but your results. I have often in the past found myself scrolling the tree window to the bottom to get to my results, use the Type = Results to avoid this.
The State filter can be helpful in checking out or debugging a model. It can filter on the state of each entity: Suppression, Underdefined, or Not Licensed.
As you muck around with a big model you are constantly suppressing and unsupressing things. The icon next to a suppressed item turns into one with a little X next to it, but in a big model these might be hard to spot. Use the “Not suppressed” and “Suppressed” options to find what is and what is not suppressed. On a big model you may surprise yourself and find something suppressed that you thought was active.
The Underdefined is just as useful. In a complicated model you may see the dreaded “underdefined” question mark high up on a branch, but become overwhelmed as you look for the source in a big tree. The answer is to simply filter and show only Underdefined entities in the tree.
There are two things you should know about when using the Filter options. The first is that I found that it was really important for me to remember to hit the clear button when I was done doing what I wanted to do with the filter. If I did not, then I would work with a filtered tree and miss important information. The second is that you
can avoid having to hit the refresh button for filter types Name and Tag by pressing the enter key when you are done typing your string in. It automatically does a refresh when you do so. It also automatically does a refresh when you choose an item from the drop down for State and Type.
There is not much else to say about these two productivity tools. They are handy and well thought out. If you have been using ANSYS Mechanical for a while, you just need to get used to having them by using them as often as possible. Once you do so, you will find it difficult to work on your models without them.
ICEM CFD is probably the most capable mesher on the planet. Not only do we here at PADT use it as our preferred tool for creating complex hex meshes, it has a whole host of other capabilities and controls that make it the power users choice. But one thing that has been frustrating for some time is that we could not easily add it into a project that automatically updates. At 14.5, ICEM CFD is now data compliant and you can use it in a project with parameters.
If you know ICEM CFD well you know that there are many aspects of it that do not fit into a project flow, but the most commonly used capabilities do: read in geometry, mesh it, output nodes and elements into a solver or node/element based pre-processor. Because it is node/element based it does not work with ANSYS Mechanical or other tools that require surface or solid geometry, but it does work with FLUENT, CFX, ANSYS Mechanical APDL (MAPDL) and Polyflow, the ANSYS solvers that can work directly with nodes and meshes. Once put into your system, you can modify geometry or ICEM CFD parameters and then update your system to get a new solution.
In this article we will focus on using ICEM CFD with ANSYS MAPDL. That is because 1) most of our readers are ANSYS Mechanical/MAPDL users and 2) it is what I know best. But most everything we are talking about will work with FLUENT, CFX, and Polyflow.
Why is this a Big Deal?
For the vast majority of users, this is not such a big deal because they can do all their meshing with ANSYS MAPDL, ANSYS Mechanical, ANSYS Meshing, or FLUENT (with TGrid meshing). But if you can not, then this is an awesome new capability. This is especially true if you need to use the blocking based hex meshing built into ICEM CFD.
Getting Started and Things to Know
Frist thing we recommend you do is read the help on the ICEM CFD System:
Workbench User Guide // User’s Guide // Systems // Component Systems
Click on ANSYS ICEM CFD and read the whole thing. There are lots of little details that you should be aware of.
The first thing you should note is that if you want to use it with Mechanical APDL you need to turn on Beta Features: Tools>Options>Appearance scroll down and check “Beta Options” to be on.
The next thing is to realize that from a project standpoint, you can feed an ICEM CFD system with any system that has a geometry module. Although ICEM CFD will read a mesh in and use the external surface of that mesh as geometry, that capability is not currently implemented in Workbench. This means if the source mesh changes, you can not automatically update your mesh if the “geometry” mesh changes. See below for a work around.
You do need to make sure that your ICEM CFD model is setup to output to your solver type. Make sure you check this when you are setting up your mesh.
If you have worked in Workbench with legacy mesh you know that named selections can be very important. I did not have enough time to play with all the different options, but it looks like named selections come in from DesignModeler, and if they define a solid, the resulting nodes that are in that solid get written as a component that goes to the MAPDL solver. However, surface, edge, and vertex named selections do not seem to get passed over at this time. I am contacting ANSYS, Inc. to see if there is a way to turn that on.
It also looks like if you are using blocking only the solid elements are written, and no corner, edge, or surface elements are output. I will also be checking on this.
The last, and most important thing to know, is that your ICEM CFD model needs to be robust. Anyone that spends a lot of time in ICEM CFD already knows this. If you make a change to geometry or a parameter, then it needs to update reliably. The key to success with this is to just do your meshing with updates in mind and make it as simple and flexible as possible, especially if you are blocking with HEXA.
A Simple Example
I made a very silly model, because these Focus articles are always about silly models, that sort of shows the process you can use. It is not a flat plate with a hole in it, but it is a block with a cylinder on top.
Nothing too fancy. I made the block dimensions, the cylinder diameter, and its offset parameters.
This system feeds the ICEM CFD system where it comes in as points, lines, and surfaces.
I then blocked it out:
And specified meshing sizes:
And generated the mesh:
Like I said, a simple model.
Parameters are supported for meshing controls, any user parameters you want to make that you will use in Tcl scripts, or meshing diagnostics.
I made the number of nodes across the width a parameter:
Values that you can make into parameters have little white boxes next to them. To make them workbench parameters click on the box and you get the “Blue P” that everyone should know and love from all of the other ANSYS, Inc. applications.
I also wanted mesh parameters so I went to Settings->Workbench Parameters->Workbench Output Parameters and set some of those:
Now when I go back to my project and check out the parameters for my ICEM CFD system I get:
Now it is time to add the ANSYS Mechanical APDL system. You will want to write a macro that defines material properties, constraints, and loads. Mine also has some output parameters and makes some PNG plots.
This is the mesh I get in MAPDL:
and here are the results. Exciting:
To try the whole thing out I made a design study:
Everything updated just fine and I got all my output parameters and my plots in my MAPDL directory for each design point (remember to tell it to save all the design points or it deletes them, or use a macro like the one discussed in the bonus article from this posting).
I made an animated GIF of the different meshes for fun:
Here is a link to an archive of the project I used: ICEM-wb-1.wbpz
Doing more with ICEM CFD in a Project
This was a basic example. But the cool thing about the implementation is that it will do much more. If there is a replay file, it will execute the file and run whatever scripts you specify in the file. This is how you can get it to work with existing meshes as geometry. And you can do whatever else you want to do.
On an update ICEM CFD does the following:
- Update geometry if Tetin file changed
- Runs tetra default meshing, if no blocking file and no replay file
- If a replay file, run the replay file
- Runs Hexa default meshing if a Blocking file exists
- Convert any blocked mesh to unstructured mesh file
- Convert unstructured mesh file to solver input file
- Save the project
So you just need to be aware of this order and plan accordingly. There really is no limit to what you can do.
If there was ever a place to use Crawl-Walk-Run this is it. Make yourself a very simple model and get a feel for things. Then work with your real geometry doing some simple meshing, maybe just blowing a TET mesh on it, then set up you full run. Also, keep the simple model around to try stuff out when you are working with the big model.
The help was very helpful, I recommend that you read it once then reread it after you have played around with this feature a bit.
One of the cool features in the ANSYS Workbench is the ability to set up a design study and kick off a bunch of runs that bring back key parameters. This is great for a design exploration but sometimes you actually would like a result plot, or maybe the info in a text file as well. When a design study is done, unless you tell Workbench to save all your run files, it deletes all the files.
To do the posting on ICEM CFD in the workbench project page, I needed to do just that, so I thought I would share my method in case others want to use it.
The way I do it is pretty simple:
- Use a /INQUIRE to get the directory the run is running in
- Use some string functions to get the name of the design point from the directory name
- Temporarily change the jobname
- Save my plots
- Change the jobname back to file
- Copy the files to the User_Files directory.
Here is what it looks like:
See how it uses /inquire to get the directory, then strpos(), strsub(), and strcat() to get the design point name. Then it simply changes the file name, does a /show,png and plots. The results are copied using a system command.
Two important things to note:
- You have to do the set command before you change the jobname, otherwise your RST files will not work
- This version is written for windows, you need to use forward slashes and cp for Linux.
You can attach this to a MAPDL system or as a code snippet.
One day me ARG says, “ARG, go to ARG and get the ARG to ARG the mainsail.” I says to me ARG, “ARG went yesterday. The ARG is over yonder by the ARG and the rum! Ha-ha-ha-ha-ARG!!”
Yeah… pirate jokes don’t work so well when the same ARG is used in too many places. The same goes for command snippets.
Summary Note: This article got longer than I intended, so here is a summary of the important points.
1. When using multiple Command Objects in a single mechanical session, the ARG variables initialized in earlier scripts are still active in later snippets if the ARG values for that snippet are not filled in the details window. Don’t assume the ARG values are zero, unless you set them to zero.
2. Output arguments are evaluated at the end of the MAPDL run. If the same variable name is used in multiple command objects, all the snippets will show the same output value, which is the value of that variable at the end of the solution process.
Now you can keep reading if you’re bored, or curious, or just confused.
Up until a few days ago, I was under the impression that each command snippet that was added to a Workbench Mechanical had it’s own set of ‘ARG’ variables, like MAPDL does for macros, since each one has a details window with it’s own set of ARG Variables. Well, they don’t.
When you hit the ‘Solve’ button in Mechanical, it builds one large input file that it sends to MAPDL. This input file contains all the nodes and elements, loads and supports. It also contains any command snippets that you have in the model. All command snippets are run in the main namespace. ARGS from one snippet carry over to another.
As an example I set up a small command snippet with the details from the above picture. It uses two arguments, ARG1 and ARG2. Below shows exactly what get added to the overall input file.
The first two lines are added by Workbench to initialize the variables. All looks good and works fine, until I add another command snippet. This one is even simpler and just stores the ARG variable to defined variables that Workbench will then read back to the details window, which is discussed below.
As you can see below, the ARG1 and ARG2 variables are left blank, but the two output variables match what was set in the previous command snippet. This is because the*SET commands that Workbench adds, are only added when the details window has values given. So ARG1 and ARG2 are never overwritten from the previous command snippet. The way to avoid the overlapping of input variables is to fill in the Input Arguments with zeros whenever using multiple command snippets.
Which brings up another point, about output variables. As many of you know, but some may not, each command snippet has a “Parameter Search Prefix”, which is set to “my_” by default. This allows Mechanical to search through your snippet and find any variables that you define that start with “MY_”. In the example above, the output variables are MY_ARG1 and MY_ARG2. (Remember that MAPDL stores all variable in uppercase.) The values of these variables are then pulled out of the MAPDL database and shown in the details window for that command snippet. The values are taken at the end of the solution phase, and not at the time they are defined. So this means that if two or more command objects use the same output variable names, whatever value the last command object set for the variables, that is going to be the same value read back in and displayed for all of the command objects using that variable. The best way to avoid this is to use different output variable names in each command object.
Since I already gave you the good points in the summary, I won’t restate them here. I will just add that command objects are great for adding functionality to your Workbench Mechanical runs. Just be cautious ARGS when using multiple objects. (Or pirate jokes, for that matter.)