ANSYS 18 HPC Licensing Updates Webinar

PADT’s webinar covering Mechanical APDL & HPC available in ANSYS 18 will be going live tomorrow at 12:00 PM MST.

Don’t miss this opportunity, sign up today!

With the release of ANSYS 18 comes a plethora of new HPC product packages, each uniquely positioned at a competitive price to ensure that you receive the option that is right for you.

For more information, join us as PADT covers the specifics of the available licensing options, followed by a live Q & A session with simulation support manager Ted Harris.

By watching this webinar you will learn:

  • About the four main product packages available with ANSYS 18

  • What licensing options are available under each package

  • How price scaling works with ANSYS 18

  • The solving capabilities for each package and licensing option

Peeling Away the *VMASK

vmask-icon2One way to really unleash the power of APDL is to become familiar, and ultimately fluent, with array parameters. The APDL student will quickly learn that array manipulation involves heavy use of the *V commands, which are used to operate on vectors (single columns of an array). These commands can be used to add two vectors together, find the standard deviation of a column of data, and so on. *V commands consist of what I like to refer to as “action” commands and “setting” commands. The action commands, such as *VOPER, *VFILL, and *VFUN * have their own default behaviors, but these defaults may be overridden by a preceding setting command, such as *VABS, *VLEN, or *VMASK.

*VMASK is one of the most useful, but one of the most difficult to understand, *V command. At its essence it is a setting command that directs the following action command to a “masking” array of true/false values. Only cells corresponding to “true” values in the masking array are considered for the array being operated on in the subsequent action command.

For example, a frequently used application of *VMASK is in the compression of an array—for instance to only include data for selected entities. The array to be compressed would consist of data for all entities, such as element numbers, x-locations for all nodes, etc. The masking array would consist of values indicating the select status for the entities of interest: 1 for selected, –1 for unselected, and 0 for not even in the model to begin with. Only array cells corresponding to a masking array value of 1 would be included in the compression operation, with those corresponding to a value or 0 or –1 being thrown out. Here is a slide from our APDL training class that I hope illustrates things a little better.

image

Take the class or buy the manual (and review it at Amazon, please!)

What we’ve learned so far is that the masking array contains a list of true/false (or not true) values to refer to when performing its vector operation. But actually, it’s much more general than 1, 0, and –1. What *VMASK does is include cells corresponding to all positive numbers in the masking array (not just +1) and exclude cells corresponding to all values less than or equal to zero in the masking array (not just 0 and            -1), which broadens the possibilities for how *VMASK can be handy.

Everything I’ve used *VMASK for up to this point in my career has involved array compression, and I figured I’d be put out on a sweep meshed ice floe into a sea of CFD velocity streamlines (that’s what happens to old CAE engineers; you didn’t know that?) before I came up with anything else. However, I recently ran into a situation where I needed to add up just the positive numbers in an array. I was about to construct an algorithm that would test each individual number in the array to see if it was positive and, if so, add it to the total. It would’ve been cumbersome. Then I came up with a much less cumbersome approach: use the array as it’s own masking array and then perform the addition operation. Let’s look at an example.

Take the following array:

image

The sum of all values in the array is 1.5 whereas the sum of just the positive values is 11.5. What’s the most efficient way to have APDL calculate each?

In the case of summing all values in the array, it’s easy, just simply execute

*VSCFUN,sum_total,SUM,sum_exmpl(1)

which gives you

image

But what about summing just the positive values? That’s easy, just use SUM_EXMPL as its own masking array so that only the positive values are included in the operation.

*VMASK,sum_exmpl(1)

*VSCFUN,sum_pos,SUM,sum_exmpl(1)

image

Boo yeah

Now why was I doing this? I had to create a macro to calculate total nodal loads for an unconstrained component in just the positive direction (to ignore the loads counteracting in the negative direction), and this was my approach. Feel free to download the macro: facelds.mac and try it out yourself.

Continue a Workbench Analysis in ANSYS MAPDL R15

stopsignThis article outlines the steps required to continue a partially solved Workbench based analysis using a Multi-Frame Restart and the MAPDL Batch mode.

In this article you will learn:

  • Some ways to interface between ANSYS Workbench and ANSYS MAPDL
  • How to re-launch a run using a Multi-Frame Restart in ANSYS Batch mode
  • The value of the jobname.abt functionality for Static Structural and Transient Structural analyses

Recently I was working in the ANSYS Workbench interface within the Mechanical application running a Transient Structural analysis. I began my run thinking that my workstation had the necessary resources to complete the analysis in a reasonable amount of time. As the analysis slowly progressed, I began to realize that I needed to make a change and switch to a computer that had more resources. But some of my analysis was already complete and I did not want to lose that progress. In addition, I wanted to be sure that I could monitor the analysis intermediately to ensure that it was advancing as I would like. This meant that however I decided to proceed I needed to make sure that I could still read my results back into Mechanical along with having the capability to restart again from a later point. Here were my options.

1: I could use the Remote Solve Manager (RSM) to continue running my analysis on a compute server machine. Check out this article for more on that.

I did use RSM in part but perhaps you do not have RSM configured or your computer resources are not connected through a network. Then I will show the other option you can use.

2: A Multi-Frame Restart using MADPL in ANSYS Batch mode

Here’s the process:

1. Make note of the current load step and last converged substep that your analysis completed when you hit the Interrupt Solution button
rs1

2. Copy the *.rdb, *.ldhi, *.Rnnn files from the Solver Files Directory on the local machine to the Working Directory on the computing machine
rs2

You can find your Solver Files Directory by right clicking on the Solution Branch in the Model Tree and selecting Open Solver Files Directory:
p1

3. Write an MAPDL input file with the commands to launch a restart and save it in the Working Directory on the computing machine (save with extension *.inp)

Below is an example of an input that will work well for restarting an analysis, but feel free to adjust it with the understanding that the ANSYS Programming Design Language (APDL) is a sophisticated language with a vast array of capability.
rs4

4. Start the MADPL Product Launcher interface on the computing machine and:
    a: Set Simulation Environment to ANSYS Batch
    b. Navigate to your Working Directory
    c. Set the jobname to the same name as that of the *.rdb file
    d. Browse to the input file you generated in Step 3
    e. Give your output file a descriptive name
    f. Adjust parallel processing and memory settings as desired
    g. Run

rs5

5. Look at the output file to see progress and monitor the run
rs6
rs7

6. Write “nonlinear” in a text file and save it as jobname.abt inside the Working Directory to cleanly interrupt the run and generate restart files when desired
rs8

rs9
The jobname.abt will appear briefly in the Working Directory

rs10
The output file will read the following:
rs11

Note that the jobname.abt interruption process is the exact process that ANSYS uses in the background when the Interrupt Solution button is pressed interactively in Mechanical
rs12

Read more about the jobname.abt functionality in the Help Documentation links at the end of this article.

7. Copy all newly created files in Working Directory on the computing machine to the Solver Files Directory on the local machine
rs13

8. Back in the Mechanical application, highlight the Solution branch of the model tree, select Tools menu>Read Results Files… and navigate to the Solver Files Directory and read the updated *.rst file
rs14

After you have read in the results file, notice that the restart file generated from the interruption through the jobname.abt process appears as an option within the Mechanical interface under Analysis Settings
rs15

9. Review intermediate results to determine if analysis should continue or if adjustments need to be made

10. Repeat entire process to continue analysis using the new current loadstep and substep

Happy solving!

Here are some useful Help Documentation sections in ANSYS 15 for your reference:

  • Understanding Solving:
    • help/wb_sim/ds_Solving.html
  • Mechanical APDL: Multiframe Restart:
    • help/ans_bas/Hlp_G_BAS3_12.html#BASmultrestmap52199

And, as always, please contact PADT with your questions!

Introduction to APDL Book Turns One

PADT-Intro-APDL-coverWe got our monthly report from Amazon on our book  “Introduction to the ANSYS Parametric Design Language (APDL)” and we noticed that it has been one year since we published it.  This was our first foray into self publishing so we thought it was worth noting that it has been a year.

Being engineers, we are kind of obsessed with numbers.  The first number is a bit discouraging, 194 units sold.  That is not going to make any best seller lists (more on lessons learned below).  51% were sold on Amazon.com, 19% by Amazon Europe, and 16% on Amazon UK, with 13% sold by non-Amazon affiliates.  

Lessons Learned

This is our first time doing self publishing we have learned some lessons worth sharing:

  1. You can’t publish a work document as an e-book.  
    We figured we would format it for a paper book, then just publish the same file as an e-book.  WRONG.  The formatting, didn’t translate at all. If it was a novel, it would have worked fine, but with all the figures and code, it was a mess. So we took it off the site.  We have received feedback that this has kept some people from buying the book.
  2. Reviews matter.
    We got one review, and it was not good because they bought the E-Book (see 1).We have resisted the temptation to publish our own review… everyone does it… It would be great if anyone reading this could put up a review.
  3. We should have done this 5 years ago.
    The reality is that APDL usage is down as ANSYS Mechanical keeps getting better and better.  So the need to do advanced APDL scripting is not what it used to be. Plus, many new users are never exposed to APDL.
  4. Amazon fiddles with your price.
    It may or may not be a bad thing, but Amazon lowers your price if their affiliates start selling a book for less than you originally set the price at.  So the initial $75 price has gone as low as $55 when demand was high (several copies a week!).  In that the whole thing is an experiment, this has caused no grief but it is something to be aware of.
  5. Overall, the whole process was easy and a nice business model
    Let’s be honest, there is not a huge demand for a book like this. The CreateSpace.com (owned by Amazon) model is a great model for niche publishing like this. It was easy to upload, easy to monitor, and those fat royalty checks (what is the emoticon for sarcasm?) come in once a month. The best part is that because it is print-on-demand, there is no need pay for an inventory up front.

If you don’t have a copy (and only 190 some of you do so I’m guessing you don’t) head on over to our page on amazon and check it out.  You can spin it around and see the front and back cover!

If you are one of the select few, maybe write a review and help us out a bit?

Saving Mechanical APDL Plots in a Design Study

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:

   1: /post1

   2: set,last

   3: finish

   4: /inquire,aa,directory

   5: ii = strpos(aa(1),'\dp')

   6: ij = strpos(aa(ii+1),'\')-1

   7: dpn = strsub(aa(1),ii+1,ij)

   8: dpn = strcat(dpn,'_')

   9: /file,dpn

  10: /post1

  11: /view,1,1,1,1

  12: /vup,1,z

  13: /show,png

  14: eplot

  15: plnsol,u,sum

  16: /show,close

  17: /sys,copy *.png ..\..\..\user_files

  18: finish

  19: /file,file

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:

  1. You have to do the set command before you change the jobname, otherwise your RST files will not work
  2. 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.