Visualizing Nodal Connectors in Mechanical

As I noted in my series on nodal interactions in Mechanical, ANSYS has been exposing more capabilities to interact with the underlying finite element model over the past couple of versions. Additionally, Mechanical’s visual verification capabilities have improved as well, as it is now possible to view nodal connectors created by remote forces and displacements, weak springs, and MPC contact.

To demonstrate this, I’ve modeled a ball valve as shown below.

image

The model is set up with the following options and boundary conditions. (Don’t try to make real-life sense of these; I’m just demonstrating capabilities here.)

  • Weak springs are turned On under Analysis Settings.
  • The bonded contact between the handle and shaft is set to MPC behavior (the bonded contact between between the valve body and ball is kept as Program Controlled).
  • A 50 lb remote load is applied just off the end of the handle and scoped to the end face of the handle (B in the figure above).
  • A 5 degree Z-rotation is applied as a remote displacement and scoped to the front face of the valve body (C in the figure above).

Now, you won’t be able to view the “spider webs,” “bicycle spokes,” etc. generated by the nodal connections yet. The weak springs, MPCs, and beams are not created until the matrices are assembled. So, at this point you will want to solve the model.

When the solution is complete, highlight the Solution Information folder in the Model tree. You will see two tabs at the bottom of the graphics window: Graphics and Worksheet. Click on the Graphics tab.

image

You will now see all the nodal connections displayed for your finite element edification, and they are glorious. Note: Constraint equations (CEs) include multi-points constraints (MPCs).

image

Click the Show Mesh button for the full finite element display.

image

The “clumping” of the MPCs on the front face of the valve body might look a little odd, and it is—you’re not imagining it—but it deflects the way I expect it to, so I’m good with it.

Now right about now, you’re yelling at me through your monitor and I can hear what you’re saying. “Hey, Strain, I don’t have the luxury of working with these little Mickey Mouse sample models that you create for sales demos or training courses or Focus articles! The models I make are real-life models that take hours or days to solve. Do you really expect me to wait for hours or days before I can verify that my connectors are correct?” Fret not, dear ANSYS user; there is a simple workaround to this. When the Solution Status says “Solving the mathematical model,” simply click [Stop Solution] and continue to display the connectors as described above. Maybe give it a minute or two first, though, just to make sure the matrices have been assembled and the connectors generated.

image

The default is that you see everything, displayed as lines, but if you take a look at the Solution Information details, you’ll see that you have some additional display options under FE Connection Visibility.

image

By default, we see All FE Connectors, but we can switch the Display option to CE Based, Beam Based, or Weak Springs. (We can also change it to None, but that would defeat the purpose of this article.) Here is the same model with Display set to Weak Springs.

image

image

By default, the connections for all nodes are displayed, but you can isolate the display to a nodal named selection under the Draw Connections Attached To option. For example, here is the connector display for the front valve body face nodes, named “front face nodes.” (Note: I’ve turned all FE connectors back on.)

image

image

Finally, if you want a bit more visual clarity, you can change the Display Type to Points instead of Lines.

image

image

This is another example of direct finite element interaction being enabled in Mechanical. With this capability, the user will no longer need to export the model to Mechanical APDL for visual node connector verification. Expect even further finite element interaction capability in future versions; ANSYS is on a roll in this area.

Some Stuff ANSYS Users Should Know about Excel

imageWhat is the software tool that us numerical simulation types use almost as much as ANSYS products, maybe even more?  Most of you will answer Microsoft Excel.  We all use it almost every day for a variety of things. Every time I see someone doing something sophisticated with Excel, I learn something new, a tool I can use to be more efficient. 

For this week’s The Focus posting I will be sharing some stuff in Excel, tips and tricks, that ANSYS users should find useful.  I am using Microsoft Excel 2010 and the assumption is that the reader is a good user of Excel, maybe not an expert, but good.  I have tried to pick things that have a direct impact on user efficiency.  You may already know some or even most of these things, but hopefully you will find some of it useful.  If you have something to share, please add it to the comments.

Take the Time to Setup Tables

I love tables.  I’m always getting made fun of because I always convert what I’m working on into tables.  Why are they so great? 

    • They auto-format
    • They have filtering built in
    • You can refer to the table, columns, rows, and cells in equations with names rather than ranges
    • When you add a formula in a column, it automatically copies it to the whole table (my favorite)
    • It does automatic totals, averages, etc…

Making a table is easy:

    1. Select the columns you want in your table
      1. It is a good idea to have the headers defined
    2. Go to the Insert Tab
    3. Click on Table

image

That give you:

image

Click on the downward facing triangle icons to filter.  Use the options in the Table Tools > Design tab to set the name, remove duplicates, turn on the total row, and change the basic formatting (color).  Once you have played with these for a while, you will find you can not live without them and people will ask you why you use tables so often.

Concatenation

One of the ways that we use Excel is to convert some sort of text data in row/column form into a command, mostly MAPDL commands.  A key to this is the ability to concatenate text strings and the values of cells.  I’ve even seen someone write a NASTRAN to ANSYS translator in Excel.

To do so you create a formula (start with =) and string together the text you want with ampersands: &

As an example, if we want to add a column to the table we used above to create N commands we simply click on any of the cells in the empty column next to our table and enter:

=”n, “&[@N]&”, “&[@X]&”, “&[@[Y ]]&”, “&[@Z]

Because we are using a table, the command uses the column reference [@name] from the tables rather than cells.  In a non table the command would look like:

=”n, “&$A6&”, “&$B6&”, “&$C6&”, “&$D6

Either way you are stringing the values in your cells together with text to make a command:

image

That column can be pasted into a text file, an ANSYS Mechanical code snippet window, or saved to a file.

Text to Columns

After tables, the next most useful feature in Excel for the analyst is the ability to convert the text in a column into multiple columns. This is a lot like the text import window that opens up when you open a text file, but it can be used at any time on any column in your spreadsheet.  To use it, simply select the column you want to convert:

image

Then go to the Data tab and click on “Text to Columns”

image

This will bring up the wizard that steps you through the process:

image

If you are working with a NASTRAN type input file, formatted with fixed columns, you can chose “Fixed Width” here. If not, choose delimited.  Click next.

For fixed, you get a ruler that you can drag the column lines back and forth on till you get what you want. Pretty simple.

For delimited, you get the delimiter screen.  Specify your delimiter here.  In the example, we will use a comma. But it can be spaces, tabs, or any other character. When you specify the delimiter, it shows you how Excel will break it up. 

image

I usually click finish here because the next screen is formatting and I usually play with that once I have the data in Excel.

That is it. Very simple.

image

One thing to note, it converts to columns by overwriting columns to the right. So if you have data in those columns, you should insert enough blank columns before you use this command, so you don’t overwrite anything.

Names

Usually you refer to a cell or a range of cells with the old LetterNumber syntax: A3, B7:NN2145, etc…  That can be a real pain to deal with and it really doesn’t tell you what the data in that range is.  A better way to deal with chunks of information, or critical cells, is to use names. 

Creating names is very easy.  The simplest is to click on the cell or cells you want to name and then type in the name you want in the input box in the upper left corner:

image

Now, if you want to know the max value of those numbers, you can use the formula =max(MyData)

image

If I have a lot of constants I want to define, I can use the “Create from Selection” tool in the Formulas tab:

image

This command brings up a dialog box and you can tell Excel where to grab your names from. Three or Four clicks and you have named parameters instead of cell locations.  This is very useful if you have a group of key parameters you want to use in your calculations.  Now when you look at your formulas, the descriptive name of the parameters are there rather than a reference.

image

Use the Name Manager in the same Formulas tab to view, edit, and delete your names.

Dynamic Range

A related trick for Excel is creating dynamic ranges. What do you do when you name a range and then the amount of data in that range changes? You have to redefine your range.  Nope, you don’t. You can define the range using a formula that changes as the length of the column, or row, changes. 

The name can be defined for a column as: =OFFSET(startCell,0,0,COUNTA(column)-1)

Or for a row: =OFFSET(startCell,0,0,0,COUNTA(row)-1)

This may be the most time saving trick I know in Excel.

You put the formula into the “Define Name” dialog box found on the Formulas tab:

image

Now, no matter how long the column of data is, MyVals will always contain it.  A big time saver.

Relative Reference on Record Macro

How many times have you gotten data in Excel, or imported data into Excel, where you want to make a small change to every line. But you have several thousand lines. If you do a “Record Macro” that doesn’t work because you have to click down to the next line, then run the macro and repeat that over and over again. Wouldn’t it be great if you could simply record a macro with some sort of relative reference. 

For years (maybe decades) I didn’t know you could do that. There is an option under the Developer Tab called “Relative Reference.”  Click that before you record your macro and you are good to go.

image

As an example, take a look at this data. Nodal coordinates on one line, rotations on the second. 

image

I want to grab the rotations, paste them on the same line as the coordinates, delete the rotation line, then move to the next node.

Here is a video that shows the process:

That is all fine and dandy if you have a few dozen lines, but your fingers will get tired CTRL-e’ing that many times.  I quick fix is to go into the macro and add a simple loop.  First we use CountA() to see how many nodes we have, then we loop on that with a for statement:

Sub Macro3()

'

' Macro3 Macro

'

' Keyboard Shortcut: Ctrl+e

'

    cnt = Application.CountA(Range("a:a"))

    For i = 1 To cnt

    ActiveCell.Offset(1, 1).Range("A1:C1").Select

    Selection.Cut

    ActiveCell.Offset(-1, 3).Range("A1").Select

    ActiveSheet.Paste

    ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select

    Selection.Delete Shift:=xlUp

    ActiveCell.Select

    Next i

End Sub

Of course you could have done this with *VREAD’s in MAPDL, or python. But sometimes Excel is just faster.

The Files View in ANSYS Workbench

image

When you watch someone work with a tool as complex as ANSYS Workbench, you quickly realize that they use different tools and features than you do.  One thing I noticed the other day was someone really using the Files View.  So I thought, I should really make sure I know what is there and take advantage of it.  In looking into it I found a few things I was not aware of, and I needed an article, so here we are.

Philosophy of Files in Workbench

Before we get started, you have to realize that the way ANSYS Workbench thinks about files is unique, and you should understand it.  The idea originally was that the program itself would manage all your files. You just had to worry about the project file and the directory tree it points to.  Therefore the directory structure in that tree is pretty complex, and the user can not change the name of a file being used. That is all managed by the program. Times have changed and there are a lot of programs that run in the Workbench that require the user to know about the files, especially some of the legacy solvers.  So we have the Files View to help us with that.

It is very important that you do not go in and rename, delete, or move files around.  ANSYS Workbench has no way of knowing that you have done that. You should just use it to find files, edit their content, and deal with files that non-workbench type solvers (FLUENT, MAPDL, Etc…) use that are not managed by the Workbench.

The Files View

You see your files through view by toggling it on and off. Under the View menu there is Files item.  Click on it to turn on the Files View and click on it again to make it go away.

image

If you see the check and not the view, then use View->Reset Window Layout

image

As with any window in the ANSYS Workbench GUI you can drag the bar at the top of the view, or click the thumbtack in the upper right corner, to break it out as its own window, and drag it anywhere you want. I have two monitors so I like to do that, and have a full size graphics window.

If you look at what is in the view, there are no real surprises.  Like a lot of Workbench applications, the information is presented in a spreadsheet from.  If we take a look at each column we can learn some things:

image

Name:
Nothing spectacular here. The icons are kind of nice to let you know what type of file you are dealing with.

Cell ID:
This one is kind of handy.  It shows you where in your project the file in question is used.  This helps with complex models where you have multiple systems.  If you don’t change the names on your files, then things get confusing quickly.  The Cell ID helps sort it out.

image

Take a look at the Cell ID and the associated project schematic. You can see that the geometry is used in two systems, and that the material properties are used in the Static Structural system.  As you review this, you can see how useful these references can be.

Also notice how some of the files only have a letter for the Cell ID. These are usually solver related files that really apply to the whole system, and not to any one particular cell in the system.

Size:
Not much to say here.  One nice use is to see if your result files are large enough to indicate a successful solve.

Type:
This tells you what type of file you are dealing with, often including the tool that uses it.  What is cool about it is that you can sort on it and you can filter on the file type.  More on that below.

Date Modified:
Always useful for finding out what files were, or were not created and what the most recent work is.

Location:
Again, not much to say here. This is where your files are.  Sometimes you can tell a bit more about where the file is used by looking at what directory it is in.

Interacting with the Files View

You can do some cool stuff in the Files View. The most obvious, is you can click on the upside down triangles and sort by any of the columns: Ascending or Descending.

image

You can also choose Sort Settings… and specify multiple columns to sort on.

 

image

Just add columns and set the Ascending flag as needed. Delete by clicking the X or Remove All.

Notice how the triangle now shows the columns that are being used to sort.

image

When you are done using the sorting, you can click on any of the columns being used in the sort, and choose Cancel sorting.

If you right mouse button (RMB) on any of the cells, you get two options.  They both do what they say: open the folder that contains the file or bring up the File Type Filter.

image

Note, just because you can open the folder that does not mean you can go messing around with file names and locations. Only do that on files that are not managed by Workbench.

The File Type Filter will list all of your file types and let you turn on or off the visibility of any of them.

image

This can be very useful for a very complicated project.

Some Suggested Uses

So using this tool is not that hard.  A better question than how is why?  Here are some suggestions:

Finding Output Files
Many of the solvers in the ANSYS family create log, error, journal, and output files. Instead of poking around and trying to find them through the operating system, you can quickly use the type filter and maybe sort by Date Modified to find the files you need. Then open up the folder containing them and view the contents.

Extracting a Solve
Sometimes you need to get into the lower levels of the directory structure and get all the files associated with a particular solve so that you can run them outside of workbench, or give them to a user who does not use Workbench.  Using this too, you can quickly sort by directory, find the one you need, then bring up the OS file browser tool.

Managing Macros and Input files
If I’m writing macros or input files, I really don’t want to dig around through directories. So when I’m ready to save my macro, I copy the directory that my solver uses out of the cell in the Files View, then paste it into my text editor’s Save As… dialog.

Making a File Table
Because the information is presented like a spread sheet, you can copy and paste any of the columns you want right into Excel. This comes in handy for reports because you can add a column where you add your own description or notes. To copy hold down the CTRL key and click on the column label of any columns you want.

Get to Know your Files View

We recommend that you use the Files View all the time, not just when you have to. The more familiar you are with the files the program is using the better you will understand what is going on when you use the program. Black boxes are fine and dandy when you are learning or in a hurry, but if you are going to be spending a good chunk of your life alone with one of the ANSYS, Inc. products, you should be spending some time looking at what file are created and where it stores them.

Webinar Info: Getting Started with ANSYS Engineering Knowledge Manager (EKM)

imageLast Thursday (10/25/2012) Clinton Smith gave a well attended webinar sharing his experience getting the Engineering Knowledge Manager (EKM) up and running for him and how he used it on a project. As promised, the slides from that presentation and a link to the recording can be found here:

PDF of Presentation:

The Recording: https://padtincevents.webex.com/padtincevents/lsr.php?AT=pb&SP=EC&rID=5952687&rKey=eefe3ba0d2f0cbc6

Overcoming Convergence Difficulties in ANSYS Workbench Mechanical, Part II: Quick Usage of Mechanical APDL to Plot Distorted Elements

image

In part I if this series, we saw how to use Newton-Raphson residual plots as an aid to vanquishing convergence difficulties in ANSYS Workbench Mechanical.  In part II, we will see how to quickly launch the ANSYS Mechanical APDL user interface to plot elements that have undergone too much distortion, thereby resulting in a convergence failure.  Several problems can cause convergence failures, but one that can be particularly frustrating is elements that have undergone too much distortion.

Currently there isn’t a way to isolate and view elements that have triggered a convergence failure due to too much distortion within the Workbench Mechanical user interface.  Fortunately we have access to the older ANSYS Mechanical APDL interface, which does allow us to select and visualize elements that have undergone too much distortion.  This can be useful in that it tells us exactly where in the model the elements are failing.  Hopefully we can use this information to take corrective action in Mechanical such as making local mesh modifications, adding more details to geometry, etc.

So, how do we do this?  Rather than try to give a lesson on how to use the Mechanical APDL interface, we’re just going to give the commands needed to be clicked with the mouse or typed in.  We’re following the K.I.S.S. principal, meaning Keep It Simple, Silly. 

The procedure to follow includes these steps:

1.  Identify the directory in which our results file resides.

2.  Launch ANSYS Mechanical APDL.

3.  Point to the results file identified in step 1.

4.  Modify the nodal coordinates so they are in the deflected state at the point of convergence failure.

5.  Plot those error-causing elements.

We will now go into more detail using a model that has convergence trouble.  This model solved successfully for the first 4 substeps, but on the 5th substep the solution failed to converge.  We get this error in the solver output (Solution Information):

*** ERROR *** CP = 2872.649 TIME= 16:29:51
One or more elements have become highly distorted. Excessive
distortion of elements is usually a symptom indicating the need for
corrective action elsewhere. Try incrementing the load more slowly
(increase the number of substeps or decrease the time step size). You
may need to improve your mesh to obtain elements with better aspect
ratios. Also consider the behavior of materials, contact pairs,
and/or constraint equations. If this message appears in the first
iteration of first substep, be sure to perform element shape checking.

Looking at the model, we see we have an indenter that is being pressed into a block of material.  The indenter is steel and the block is aluminum.  Both have nonlinear material properties defined.

image

Total deformation for the last converged substep looks like this:

image

The unconverged results show that we have some elements that have large nodal deflections:

image

So, our error message tells us that one or more elements have become highly distorted.  Which elements are they?  The following procedure will show us how to view those for sure, using Mechanical APDL.

Here are each of the 6 steps mentioned above, in detail:

1. Identify the directory in which our results file resides:

We do this from the Workbench window, by clicking on View > Files.  Scroll down in the resulting list of files until you find file.rst, the ANSYS Result file.  The location will be listed in the resulting information, but the text is not selectable.  To make it easier, right click on the file.rst row and select Open Containing Folder. 

image

From the top of the resulting Windows Explorer window, select the folder path and right click > copy. 

image

2. Launch ANSYS Mechanical APDL:

Click Start > All Programs > ANSYS 14.0 > ANSYS Mechanical APDL Product Launcher.  In the resulting window, paste in the directory path in the Working Directory box:

image

Click the Run button at the bottom of the window.  The Mechanical APDL user interface will start. 

3. Point to the results file identified in step 1:

Click on General Postproc on the left, then Data & File Opts.  In the resulting Data and File Options window, click on the […] button below Read single result file:

image

You should see the result file, file.rst, available in the resulting window.  Click on that file, then click Open.  Click OK in the Data and File Options window.

We need to read in one set of results to load the model into the Mechanical APDL database.  Click General Postproc > Read Results > Last Set.

4. Modify the nodal coordinates so they are in the deflected state at the point of convergence failure:

Let’s plot the elements so we can see the model (this will show the elements with nodes in the original, undeflected positions).  We’ll just have you type in the command to make the element plot:  in the input line near the top of the window, type eplot, then return.

image

 

The plot will show in the default “front” view, looking down the global Z axis.  Note that if weak springs are on in Workbench Mechanical, you will see these as line elements pointing away from the model in a few places.

image

The nodal modification is performed in the preprocessor.  Click on the Preprocessor command on the left side of the window.  Type in this command in the input line to modify the nodal positions to those of the unconverged (last set) of results:

upgeom,,,,file,rst

Plot the elements again.  You should now see the deflected nodal positions.

image

Using the view controls over on the right side, we can rotate and zoom in. A short cut is to use the right mouse button to box zoom and Ctrl + Right Mouse Button to rotate the model.  Now we can better see where the deformations are occurring.  We still have all elements selected and plotted, so the next step will be to filter the plot to show the error-causing elements.

image

5.  Plot those error-causing elements:

Shape checking of elements consists of two levels, warning and error.  The solver will not continue if any elements exceed the error level.  Shape checking is discussed in detail in section 13.1 of the Theory Reference in the ANSYS Help.  We have the ability to plot both warning level elements and error level elements, using this procedure:

On the left side of the window, click on Meshing > Check Mesh > Individual Elm > Plot Warning/Error Messages. 

image

With all boxed checked, this is the resulting plot in the front view.  “Good” elements are displayed in blue, “warning” elements in yellow, and “error” or failed elements are shown in red.image

When the elements are very highly distorted, their surfaces can’t always be displayed and it looks like there is a hole in the model.  This won’t always happen depending on how highly distorted the elements are, viewing direction, etc..

image

image

If we uncheck the Good Elements (blue) box, then only the warning and error elements are displayed.

image

image

When you are done viewing the elements, click on the Quit button near the top, and exit without saving to get out of Mechanical APDL.

So what does all this tell us?  For this model, the elements below the indenter body are experiencing too much deformation (red elements).  Some elements in the indenter body are at the warning level but not the error level (yellow elements).  The fix could be to apply the load more gradually (more substeps), refine the mesh at this location, or maybe a combination of both.  In this case we also changed the Workbench Mechanical shape checking from Standard to Aggressive Mechanical.

image

ANSYS Penetration Model

Webinar Info: An Example of Moving Mesh Modeling of a Valve

imageLast week Clinton Smith gave a webinar showing an example of using moving meshes with ANSYS FLUENT.

If you missed the presentation you can view a Recording here.

Or download a PDF of the presentation here:

As always, you can see which webinars are coming up, and view recordings of past webinars at:

padtincevents.webex.com.

Overcoming Convergence Difficulties in ANSYS Workbench Mechanical, Part I: Using Newton-Raphson Residual Information

image

Unable to converge.  Convergence Failure.  Failure to Converge.  Never nice words to see when you are trying to get your simulation done. 

If you’ve encountered convergence failures while running nonlinear structural analyses in ANSYS Workbench Mechanical, this two part series is for you.  What is a convergence failure?  In a nutshell it means that there is too much imbalance in the system.  The calculated reaction forces do not match the applied loads and even though the program tries hard to make changes to overcome the imbalances, it hasn’t been able to do so and stops.  If we look at the Force residuals under Solution Information, we will see that the solver has been unable to get the force convergence residual, or imbalance force, to drop below the current criterion

image

Test model example:  Newton Raphson Convergence Failure; Solution Stops

We won’t spend a lot of time here explaining the Newton-Raphson method, convergence, and residual plots here, since we wrote a Focus article back in 2002 which discusses them in more detail.  The article begins on p. 7 at this link:

/blog/wp-content/uploads/oldblog/archive/PADT_TheFocus_08.pdf

The context of that article was Mechanical APDL, but the article is directly relevant since solving in Workbench Mechanical is done in Mechanical APDL in batch mode. 

In crayon terms, we want the purple line to drop below the blue line.  When it doesn’t and the solver is out of options to keep trying, the solution stops and we get an error message. 

Now what?  The traditional knobs to turn are to increase the number of substeps, decrease contact stiffness if contact is involved, perhaps add more points to the plasticity curve, etc.  But what if something else is the problem?  How can we identify where the problem is?

In this part I article we will discuss how to plot the Newton-Raphson residuals as contour plots to see where in the model the highest force imbalances are located.  Often this is useful information to help us figure out what is going on so we can take corrective action.  First, be aware that we must turn on the Newton-Raphson residual plots prior to solving.  That means you either have to turn them on and re-solve after a convergence failure, knowing that you’ll get the same failure again, or you need to clairvoyantly (or perhaps just prudently) turn on the residuals prior to attempting the initial solve.  Why aren’t they on all the time, you ask?  Most likely because they slow things down just a bit and also require a bit more disk space than otherwise, although if the solution runs to completion no Newton-Raphson residual plots are saved.

Here is how we turn them on.  In the Details view for the Solution Information branch, change the Newton-Raphson Residuals setting from the default of zero to a nonzero number such as 3 or 4.  That will continuously save the last 3 or 4 Newton-Raphson residual plots for viewing as contour plots after the solution has stopped due to a convergence failure.

image

After the solution has stopped, the Newton-Raphson residual plots will be available under the Solution Information branch.

image

The quantity plotted is actually the square root of the sum of the squares of the residuals in the global X, Y, and Z directions.  So, the plots don’t show us direction information, but they do show where the residuals and hence the force imbalances are the largest.  Below is an example.  The region in red shows where the residuals are the highest.  Since this is a model involving contact between two bodies, apparently the contact regions and specifically contact at the corners of the part on the left is the source of our convergence difficulties.

image

Newton-Raphson Residual Force Plot for the last attempted equilibrium iteration.

So, how do we use this information?  In this case we now suspect that the contact regions, especially at the corners of the smaller part, are the problematic areas.  Using this information we made two changes to the model. 

First, we changed the Detection Method for the contact elements from Program Controlled (at the element Gauss points) to Nodal-Normal to Target.  Many times when contact problems involve touching at corners, the robustness of the contact interface can be improved by changing the detection method from Gauss points to nodes.

Second, we reduced the contact stiffness by changing Normal Stiffness from Program Controlled (factor of 1.0) to a Manual setting of 0.2.  Reducing the contact stiffness can help with contact convergence for a lot of problems.  Too low of a stiffness value can cause problems too, but in this case the resulting penetration is still small so a value of 0.2 seems reasonable.  When in doubt, a sensitivity study can be performed whereby you make changes to the contact stiffness value while tracking your results quantities of interest.  As with most inputs you can vary, your results of interest should not be sensitive to contact stiffness.

These two changes allowed our test model to nicely converge for the full amount of load.

image

Other considerations:

The Newton-Raphson Residual plots are always displayed on the original geometry, not the deflected geometry at version 14.0 of ANSYS Mechanical.  If the deflections are large this can make it harder to ascertain what is causing the high residual values.  In those cases, it can be helpful to compare the total deformation and stress plots for the unconverged solution, along with those plots for the last converged solution, with the 1.0 true scale on the deformation active.  This will show the parts in their deflected state, and that can help in determining why the residuals are high at certain locations.

We recommend creating at least 3 residual plots (set in the details of Solution Information as described above).  Sometimes the location of the imbalance can bounce around a bit from equilibrium iteration to equilibrium iteration, so having more than one or two plots to look at can be beneficial in determining problem locations.

Conclusion

Summing it up, the Newton-Raphson residual plots are one piece of information we can use to determine why we are having convergence difficulties.  They can give us an indication of where the convergence difficulties are occurring in the model, and many times we can use that information to help us know what settings should be modified or what other changes should be made to the model to improve the convergence behavior.

In part II of this article, we’ll look at how to quickly use ANSYS Mechanical APDL to view the elements that have undergone too much deformation.

Suppressing New-Line Characters in APDL, and a Better WRTTBL.mac

OK, it is Friday afternoon and if I do not write something soon the week will be missed. We did not do a seminar this week so I can not just post the notes and some comments from the webinar, bummer.  All of the real tech support people at PADT have been busy with training, mentoring and doing tech support, so they did not kick anything out. So that leaves me to come up with something. So, as is usually with me, I looked for something I felt guilty or ashamed of. Because that is the way my brain works.

And I remembered that two posting ago I put out a piece of junk macro that printed out tables, as part of the second article on tables in APDL.  Although it worked it was brute force and it used a bunch of *if statements to determine how many columns to write.  Ugly.

While I was extruding that particular piece of bodily waste something in the back of my mind said that APDL had an undocumented command that would suppress a line-feed on a *VWRITE. This is what one does with ‘C’ and other languages invented after the 1970’s.  If you suppress the line-feed, you can just loop over the number of columns. 

Next step, go to the help and see if it is there is some clue as to if that tickle in my brain was valid.  I found a posting on XANSYS from 2004… by some guy name Eric Miller…  Go figure. 

There are two descriptors that are not documented in the help: ‘/’ and ‘$’. 

‘/’ adds a newline, and ‘$’ suppresses it.  So if I want to write out the values in a 1D array all on one line but I don’t know how long the array is I can do:

*dim,myar,,10
myar(1) = 1,2,3,4,5,6,7,8,9,10
*get,nrw,parm,myar,dim,X

*cfopen,foo1.txt

*do,i,1,nrw
*vlen,1
*vwrite,myar(i)
(g16.9,$)
*enddo
*vwrite
(x)
*cfclose
 
This ends up creating foo1.txt:

image

So, extrapolating this, we can rewrite the nothing-to-be-proud about old wrttbl.mac with

 

ttbl = arg1      ! Get the name of the table you want to write

fname = arg2     ! get the name of the file to write to

 

*get,nrw,parm,%ttbl%,dim,X         ! Get the size of the table

*get,ncl,parm,%ttbl%,dim,Y

*get,xax,parm,%ttbl%,var,1         ! Get the names of the columns

*get,yax,parm,%ttbl%,var,2

 

*cfopen,%fname%    !Open the file

 

*vwrite,ttbl,xax,yax    ! Write a header (note / to add a line)

('Table: ',A,' ',A,' vs ',A,/) 

 

*vwrite         ! write 10 spaces, then don't write a new line by using $

('          |',$)

 

*do,jj,1,ncl ! Loop on each column, writing out the column value ($ again)

    *vlen,1

    *vwrite,%ttbl%(0,jj)

    (g10.4,$)

*enddo

*vwrite    !You need a line feed now that you are done, just write a space

(' ')

*vwrite    !Write a line of  dashes to seperate the header, with a pipe

(10x,'|',$)   ! to seperate the row values

*do,jj,1,ncl

    *vwrite

    (10('-'),$)

*enddo

*vwrite

(' ')

 

*do,ii,1,nrw    !Now write the values, looping on each row, then each column

    *vlen,1

    *vwrite,%ttbl%(ii,0)

    (g10.4,'|',$) 

    *do,jj,1,ncl

        *vlen,1

        *vwrite,%ttbl%(ii,jj)

        (g10.4,$) 

    *enddo

    *vwrite

    (' ')

*enddo

 

*cfclose

Have a great weekend!

Webinar Info: Writing and Compiling a Custom Material Property in ANSYS Mechanical APDL

imageDuring our webinar held at noon on 9/27/2012 we promised to provide a link to the recording, a PDF of the PowerPoint, and some answers to a few questions.  Here is that information:

Files

Presentation PDF is here:

Zip file with the sample USERMAT.f and input file:

 

imageState Variables

I was a bit confusing on state variables. The problem is with my use of them, not with the variables.  The test model only had one integration point.  My code is still not working right, the default USERMAT is overwriting my flag somewhere and I don’t have time to figure it out. It’s killing me but I have to do some real work.

But anyhow, my assertion that the state variables are per integration point is correct.

Debugging

I am not aware of any way to use a debugger with ANSYS.  There is nothing in the documentation, and to be honest, I’ve not used a real debugger in years.  So there may be a way to do so, and see your routine in the debugger since you have the source code, but I have no idea on how to do that.  Perhaps someone with more debugging experience can comment below.

Other UPF’s

Someone asked about other routines that are available and we ran out of time before I could go over them.  Here is a list.

ELEMENTS
UserElem.f User Defined Element that use newer API
UEL100.f – UEL105.f
UEC100.f – UEC105.f
UEX100.f – UEX105.f
UEP100.f-UEP105.f
USERTR.f
USERAC.f
User elements defined that access the program database directly
USEROU.f Stores user-provided element output
USERAN.f Modify orientation of material properties
USERRC.f COMBIN37 (control/thermostat/spring/damper/resistor) user routine.
UEIMatx.f Access to an elements matrix or load vector
UTHICK.f Sets thickness at integration points
UsrFictive Sets “fictive” temperature (I have no idea what that is)
UFLEX.f Calculates pipe flexibility for PIPE288/289
UsrShift.f Allows user to specify time shift
Materials
UserMat.f User material models
UserHyper.f User defined hyperelasticity models
UserCreep.f User defined creep model
user_tbelastic.f Allows definition of elastic stiffness at a given integration point based on user model.  TB,ELASTIC,,,,USER
USERFC.f User defined failure criteria
USERSWTRAIN.f User defined swelling, for TB, SWELL,,,,USER
USERCK.f Helper routine that passes material properties for a user material in
USERFRIC.f User defined friction calculation.  Not just friction but all values calculated in contact calculations with friction turned on.
LOADS
USERFL.f Changes scalar field values (temp, fluence, heat generation, moisture content, magnetic virtual displacement), by element.
USERPR.f Calculates element pressure, by element
USERCV.f Calculates element face convection.
USERFX.f Calculates element face heat flux
USERCH.f Calculates element face charge density surface values
USERFD.f Computes complex load vectors for frequency domain logic
USERPE.f Calculate the rotation of an elbow pipe element caused by internal pressure
USRSURF116.f
USER116Cond.f
USER116Hf.f
Modifies the conduction, film coefficient, bulk temp for SURF151/152
userPartVelAcc.f Ocean wave particle acceleration calculation for PIPE288/289
userPanelHydFor.f Calcs hydrodynamic loading on SURF164 from ocean loading
USER Commands
USER01.f-USER10.f Create your own ANSYS commands that are accessed through /UCMD,cmd,num where num refers to the subroutine number and cmd is the command name you want to assign it. Put this in your startxx.ans file to give regular access.

Other Stuff Every User Should Know about Tables in ANSYS Mechanical APDL: Nesting and 4 or 5 Dimension Tables

complicated table design

About a month ago we published an article on “What Every User Should Know About Tables in ANSYS Mechanical APDL”  At the end of that article we had a section on “Other Stuff”  and expressed our hope to cover those subjects in the future. The future is now.  If you are not very familiar with table arrays, make sure you review the previous article before delving into nesting and 4/5 dimension tables in this article. 

By the way, the funky table at the end of the article got a lot of good feedback, so I’ve googled around and found some other interesting tables. The one here at the top is what you get if you google “complicated table”

Nested Tables

As you will remember from memorizing the previous article, a common use for tables is the set them up to give you a value for a given “primary variable” that is determined by the solver at a given point in the solution.  Possible primary variables are: TIME, FREQ, X, Y, Z, TEMP, VELOCITY, PRESSURE and SECTOR. But what if you want to use one of those primary variables to look up a value, then use that value to then interpolate a second value?

A good example is that you have a piece of rotating equipment and the value of the heat transfer coefficient (HF) is a function of RPM and the radius of a given element face.  But RPM varies over time.  What you can do is make the HF table point to and RPM table that is based on the primary variable time:

*DIM,MYCNV,TABLE,3,3,,RPM,X,,1
*taxis,mycnv(1,1),1,0,1000,20.01e6
*taxis,mycnv(1,1),2,0,1,2
mycnv(1,1) = .25,4,10
mycnv(1,2) = .35,7,15
mycnv(1,3) = .45,10,28

*DIM,RPM,TABLE,4,1,1,TIME
RPM(1,0)=0.0,10.0,40.0,60.0
RPM(1,1)=0.0,5.0,20.0,30.0

wrttbl,'mycnv','foo4.txt'
wrttbl, 'rpm','foo5.txt'

SF,ALL,CONV,%mycnv%

This macro is missing stuff, like a model and selecting the nodes to apply the SF command to.

The tables look like this:

Table: mycnv    RPM      vs X       

| 0.000 1.000 2.000
|------------------------------
0.000 |0.2500 0.3500 0.4500
1000. | 4.000 7.000 10.00
0.2001E+08| 10.00 15.00 28.00

and

Table: rpm      TIME     vs         

|0.7889E-30
|----------
0.000 | 0.000
10.00 | 5.000
40.00 | 20.00
60.00 | 30.00

(We’ll cover the wrttbl macro below.)

So at a given substep, the program will take time and figure out what RPM needs to be.  Then it will use RPM and the radius (X in CSYS 1) to figure out the convection coefficient for each node.

As you can imagine, you can get pretty sophisticated with this. The key is that the name of the table you use for the calculated value is input into the variables to interpolate on for the second table, using the *DIM command.

Another common use is scaling tables based on some value. Let say you have a pressure table and the total pressure is scaled over time, based on time.  You would make a pressure table that is dependent on say X and y. It would have two planes. One with 0 values and one with the max values. Then you would make a scale table that scales from 0 to 1 based on time.  It would look like this:

*DIM,pscl,table,5,,,time    !Row label is CPTAB, the table of Cps
*taxis,pscl(1,1),1,0,1,5,10,30
pscl(1,1) = .25,.5,1,1,.333

*DIM,ptab,TABLE,4,4,2,X,Y,pscl
*taxis,ptab(1,1),1,0,1.35,2.75
*taxis,ptab(1,1),2,-7.2,-3.2,6.5,10.6
*taxis,ptab(1,1),3,0,1
ptab(1,1,1) = 0,0,0,0
ptab(1,2,1) = 0,0,0,0
ptab(1,3,1) = 0,0,0,0
ptab(1,4,1) = 0,0,0,0
ptab(1,1,2) = 72,48,97,123
ptab(1,2,2) = 53,48,88,98
ptab(1,3,2) = 43,38,77,88
ptab(1,4,2) = 33,28,55,77

SF,ALL,PRESS,%ptab%

 

As always with tables, double check things and make sure you have your  rows and columns correct.  Start simple, and then add more detail. Testing out on a 2×2 or 3×3 tables is a good way to start.

4 and 5 Dimension Arrays and Tables

 
This section applies to both arrays and tables, so it is a bit beyond the scope of the title, but I hope you will forgive me.

Most users will simply use a one, two, or even three dimension array or table (row, column, plane). However, both arrays and tables support two more dimensions: books and shelves. Because this capability is a later addition to the program, it behaves a little differently. You need to add values for the size of the book (KMAX) and the shelf (MMAX) as well as variable names for each: VAR4 and VAR5

The first difference is in the *DIM command. For normal arrays and tables you use:

*DIM, Par, ARRAY, IMAX, JMAX, KMAX, Var1, Var2, Var3, CSYSID 

*DIM, Par, TABLE, IMAX, JMAX, KMAX, Var1, Var2, Var3, CSYSID

For 4 dimension arrays or tables you use:

*DIM,Par,ARR4,IMAX,JMAX,KMAX,LMAX,Var1,Var2,Var3,Var4,CSYSID
*DIM,Par,TAB4,IMAX,JMAX,KMAX,LMAX,Var1,Var2,Var3,Var4,CSYSID

For 5 dimension arrays or tables you use:

*DIM,Par,ARR5,IMAX,JMAX,KMAX,LMAX,MMAX,Var1,Var2,Var3,Var4,Var5,CSYSID
*DIM,Par,TAB5,IMAX,JMAX,KMAX,LMAX,MMAX,Var1,Var2,Var3,Var4,Var5,CSYSID

It is important to be aware of this because if you look at the manual entry for *DIM it only lists the 3 dimension version of the command, and these variations are covered in the notes.

Once the array or table is defined you have to fill it using APDL commands, this size is not supported in the user interface. The same commands are used, but instead of supplying one, two or three indices values, you supply four or five.

The following is an example of defining a table in terms of location (X,Y,Z), Time, and Temperature. This is the most common usage of a five dimension table:

*dim,ldval,tab5,3,3,3,3,3,X,Y,Z,TIME,TEMP    ! table
*taxis,ldval(1,1,1,1,1),1,-2.3,0,3.4 ! X Range
*taxis,ldval(1,1,1,1,1),2,-1.2,0,1.8 ! Y Range
*taxis,ldval(1,1,1,1,1),3,-3.6,0,4.5 ! Z Range
*taxis,ldval(1,1,1,1,1),4,0,5,10 ! Time Range
*taxis,ldval(1,1,1,1,1),5,32,320,500 ! Temp Range

*do,ii,1,3
*do,jj,1,3
*do,kk,1,3
*do,ll,1,3
*do,mm,1,3
!silly made up equation to fill the table with
ldval(ii,jj,kk,ll,mm) = ii*.123+jj/.2+ll*kk+mm*JJ*JJ
*enddo
*enddo
*enddo
*enddo
*enddo

sancal-elipse-floating-coffee-table-rafa-garcia-11Writing a Table to a File

For simple 2D tables with up to 10 columns, I use a cheesy macro I wrote called wrttbl.mac. It was used above.  It is a bit of a brute force method, because it has code blocks for from 0 to 10 columns.  A more general approach would build the actual *VWRITE commands with *VWRITES… It should also be expanded to do Planes.  Maybe for a future article.

Anyhow, here it is, maybe you will find it useful.

ttbl = arg1
fname = arg2
*get,nrw,parm,%ttbl%,dim,X
*get,ncl,parm,%ttbl%,dim,Y
*get,xax,parm,%ttbl%,var,1
*get,yax,parm,%ttbl%,var,2

nmcl = nint((ncl*10)/2)
nmrw = nint(nrw/2)

*cfopen,%fname%

*vwrite,ttbl,xax,yax
('Table: ',A,' ',A,' vs ',A)
*vwrite,
(x)
*if,ncl,eq,1,then
*vlen,1
*vwrite,%ttbl%(0,1)
(10x,'|',10g10.4)
*vwrite
(10x,'|',10('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii ,1)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,2,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2)
(10x,'|',10g10.4)
*vwrite
(10x,'|',20('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,3,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3)
(10x,'|',10g10.4)
*vwrite
(10x,'|',30('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,4,then
/gopr
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3),%ttbl%(0,4)
(10x,'|',10g10.4)
*vwrite
(10x,'|',40('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3),%ttbl%(ii,4)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,5,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3),%ttbl%(0,4),%ttbl%(0,5)
(10x,'|',10g10.4)
*vwrite
(10x,'|',50('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3),%ttbl%(ii,4),%ttbl%(ii,5)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,6,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3),%ttbl%(0,4),%ttbl%(0,5),%ttbl%(0,6)
(10x,'|',10g10.4)
*vwrite
(10x,'|',60('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3),%ttbl%(ii,4),%ttbl%(ii,5),%ttbl%(ii,6)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,7,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3),%ttbl%(0,4),%ttbl%(0,5),%ttbl%(0,6),%ttbl%(0,7)
(10x,'|',10g10.4)
*vwrite
(10x,'|',70('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3),%ttbl%(ii,4),%ttbl%(ii,5),%ttbl%(ii,6),%ttbl%(ii,7)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,8,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3),%ttbl%(0,4),%ttbl%(0,5),%ttbl%(0,6),%ttbl%(0,7),%ttbl%(0,8)
(10x,'|',10g10.4)
*vwrite
(10x,'|',80('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3),%ttbl%(ii,4),%ttbl%(ii,5),%ttbl%(ii,6),%ttbl%(ii,7),%ttbl%(ii,8)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,9,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3),%ttbl%(0,4),%ttbl%(0,5),%ttbl%(0,6),%ttbl%(0,7),%ttbl%(0,8),%ttbl%(0,9)
(10x,'|',10g10.4)
*vwrite
(10x,'|',90('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3),%ttbl%(ii,4),%ttbl%(ii,5),%ttbl%(ii,6),%ttbl%(ii,7),%ttbl%(ii,8),%ttbl%(ii,9)
(g10.4,'|',10g10.4)
*enddo
*endif
*if,ncl,eq,10,then
*vlen,1
*vwrite,%ttbl%(0,1),%ttbl%(0,2),%ttbl%(0,3),%ttbl%(0,4),%ttbl%(0,5),%ttbl%(0,6),%ttbl%(0,7),%ttbl%(0,8),%ttbl%(0,9),%ttbl%(0,10)
(10x,'|',10g10.4)
*vwrite
(10x,'|',100('-')) |
*do,ii,1,nrw
*vlen,1
*vwrite,%ttbl%(ii,0),%ttbl%(ii,1),%ttbl%(ii,2),%ttbl%(ii,3),%ttbl%(ii,4),%ttbl%(ii,5),%ttbl%(ii,6),%ttbl%(ii,7),%ttbl%(ii,8),%ttbl%(ii,9),%ttbl%(ii,10)
(g10.4,'|',10g10.4)
*enddo
*endif
*cfclose

And with that, I think we have beaten the table topic to death.

naturalistic-curved-wood-table-design-z

Get to Know VCollab, and Geomagic Training

VCollab_Shaded_Logo_FinalPADT is proud to announce that it has added the VCollab 3D Visual Collaboration Software for CAE (http://www.vcollab.com) to its software product offerings. PADT will offer VCollab along with VCollab’s facilitating CAX file format to deliver on the growing need for smaller simulation result files and increased efficiency in data transfer to its customers in Arizona, New Mexico, Colorado, Utah and Nevada.  You can read more at on our press release.

What does this mean to you the ANSYS user?  Well it means you can share your models and results in 3D with others: over the web, imbedded in MS Word or PowerPoint, from within EKM, or as a stand alone file.  The tool converts your monster ANSYS result file into a lightweight file that only has the results you want to share.  We like it because of the small file size and the fact that we can send one 3D “image” instead of a bunch of different 2D images to our customers.

imageYou can learn more about it at our next Webinar

Using VCollab to Share 3D ANSYS Results
September 13, 2012
12:00 – 1:00 MST

You can also try it out yourself by signing up to get the free viewer:

http://www.marechi.com

Register and they will email you a login. Once you log in you can download the viewer (Download tab) and also look at some sample models they have.

Note: You need to set the following Environment Variable:

Variable :   VCOLLAB_SKIP_OGL_DRIVER_CHECK
Value    :   1

You can also look at the one we use in the Webinar:

We will be sharing more on this tool as time goes by.

Geomagic_200x42We announced that we were a Geomagic reseller when we rolled out our 3D Laser and Cross Sectional Scanning hardware offerings. Although we added this as a tool for our scanning customers, we have found many ANSYS customers that are interested in it or that already had it in house. 

If you don’t know Geomagic, it is a suite of tools that take scan or faceted (yes, meshes are included) and allows you to repair them, wrap them, compare them, or convert them to usable CAD solid geometry. Yes, this is the tool you have been looking for to take your distorted FEA mesh and convert it into a usable CAD model.

So we wanted to let everyone know that we are now certified to offer training on the Geomagic suite.  As always, we can offer training when your want it and where you want it, or you can sign up for one of PADT’s scheduled classes.  The first two are in October:

10/17/2012 – 10/19/2012      Geomagic Studio     PADT’s Tempe Office
10/22/2012 – 10/24/2012      Geomagic Qualify   PADT’s Tempe Office

Click on the course names to get more information on the content and to register, or simply contact us at 480.813.4884 or training@padtinc.com.

Look for some Focus articles on Geomagic, or a seminar for ANSYS users, later in the year when we get caught up on our backlog and Joe has some time to prepare something.

Composite Sketching, ANSYS Style: Copying a Sketch from One DesignModeler Session to Another

Recently a customer approached me and told me that he had a sketch in one DesignModeler database that needed to be copied over to another DesignModeler database and asked me if it would be possible to do so. My initial reaction was, “No way, dude be trippin’,” because that’s how I talk in professional settings. But, I really wasn’t ready to assert its impossibility without first digging into it a bit, so that’s what I did.

Clicking around the DesignModeler menus (Ever wonder how we ANSYS support professionals figure things out? Now you know.) I found something that had flown under my radar previously. Under the File menu are a couple of selections indicating the ability to write and read sketch scripts. Pay dirt.

So, what is it that these wonderful scripts can do for us? Let’s take a look. Say, for example, you have two separate sketches in two separate DesignModeler sessions. I have labeled these sessions “Face” and “Head.” See if you can figure out which is which.

imageimage

(Side note: It may be hard to believe, but this is not the original geometry the customer was working with)

Now, keeping in mind that these are two completely different DesignModeler databases, how can I copy the Face sketch, including dimensions, and paste it on top of the Head sketch? The answer is simple. First highlight the DesignModeler plane containing the Face sketch.

image

Next, click File > Write Script: Sketch(es) of Active Plane. You will be prompted for a file name and location of the resulting jScript file. Specify those and click [Save].

imageimage

Note that all of the sketches on the selected plane will be written to the jScript file. If there are any sketches you don’t want to keep, you can always delete them later.

Next, move over to the Head model. Highlight the plane you would like to copy the Face sketch to. In this case, it is the XYPlane again, but you can pick whatever plane you want; it doesn’t have to be the same plane between sessions. The sketch will maintain its position relative to the origin of whichever plane you select.

image

Next click File > Run Script and select the jScript file that was written previously. Click [Open].

image

image

More than likely, you will get a warning about modifying the feature number to avoid duplicates. This is normal. It simply means that it’s renumbering the imported sketch to avoid having, for example, two “Sketch1” objects. Click [OK].

You will now see the Face sketch, dimensions and all, overlaid on the Head sketch. The Sketch object has been renumbered and placed onto the XYPlane.

imageimage

And, as you can see, everyone is happy.

ANSYS 14.0 Service Pack Summary

You may have noticed there are several official service packs available for ANSYS 14.0. In case it’s not clear to you what each of these service packs is for, here is a brief explanation to hopefully allow you to determine which of them you may need for your particular application of ANSYS products.

ANSYS140.0.1: Service Pack 1:

This fixes a rare scenario in which the ANSYS Mechanical database can be overwritten with a zero size file on exiting ANSYS Workbench by clicking the close window icon. This is recommended for all Workbench Mechanical Users.

ANSYS140.0.3: Service Pack 3:

This fixes a problem causing a potential solver error for ANSYS Mechanical APDL ("classic") for large modal superposition harmonic analyses. The definition of large is on the order of half a million degrees of freedom. If you are an ANSYS Mechanical APDL user, this service pack is recommended.

ANSYS140.0.8: Service Pack 8:

This fixes a list of issues with ANSYS Icepak. If you are a user of Icepak 14.0, this service pack is recommended.

ANSYS140.0.10: Service Pack 10:

This fixes a performance (speed) issue with ANSYS Composite PrepPost 14.0. As of this writing the service pack is only available for Windows 64 bit platforms. This service pack also includes service pack 1.

All other service packs are available for Windows 32 bit, Windows 64 bit, and Linux 64 bit systems. All service packs and more info on the service packs can be obtained on the ANSYS Customer Portal in the software download area. Click on the hyperlink for a given product’s "Last Update" date. That will bring up documentation on the available service packs for that product.

Running an APDL Command Snippet for Every Load Step in ANSYS Mechanical

This week went by very fast, and I never got time to do the more advanced article on tables to follow up on last week’s article.  So I was going to give up till someone stopped by my office to ask a question and I thought my simple and clever answer would make a nice quick, but useful, posting.

What he need to do was apply fairly complicated loading over multiple substeps. Do some *get’s, calculate some stuff, then apply a load. I immediately thought of a trick we used in the early days of ANSYS Mechanical (before it was called ANSYS Mechanical) where we would put in a script that redefined the solve command as nall (*abbr,solve,nall).  You then used your own code to do the solves.

This made us feel very smart and clever.

However, something in the corner of my brain was saying “dumb and silly.” So I fired up 14.0 and realized that my brain was right, you don’t have to trick ANSYS Mechanical any more. The developers now allow you  to specify load steps and such for preprocessing command objects.  I should know this because I did a seminar on APDL Command Objects. .

Darn no article for this week, it was already covered. 

But just to make sure I looked through the PowerPoint and found that the ability wasn’t covered. Yipee! I have an article, now to stretch it out make it look important!

If you insert a command object into your model setup:

image

You end up with a Details view like so:

image

Under definition you can set “Step Selection Mode”  This simply lets you determine if the APDL code in the command object is applied every load step (All), at the first (First), at the last (Last), or if the command object is only applied to a specific load step number (By Number). 

  If your complicated loading/modification to your model is the same commands for every load step, pick All and enter your commands. If it varies by load step in some way, you have two choices. You can write a set of commands for each load step, or you can write a macro that uses a *get,nmstp,active,,solu,ncmls and then use logic to figure out what you need to do.

So, pretty simple, but it opens up a lot of possibilities when you need to do some simple tweaks during a multi-step solve.

There, now I don’t feel like a looser for not doing an article this week.